1import{r as u,R as T}from"./vendor-react-3efCd3Xu.js";const we="modulepreload",Oe=function(e){return"/"+e},ie={},Dt=function(t,r,n){let o=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),l=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));o=Promise.allSettled(r.map(f=>{if(f=Oe(f),f in ie)return;ie[f]=!0;const h=f.endsWith(".css"),E=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${E}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":we,h||(v.as="script"),v.crossOrigin="",v.href=f,l&&v.setAttribute("nonce",l),document.head.appendChild(v),h)return new Promise(($,D)=>{v.addEventListener("load",$),v.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${f}`)))})}))}function i(c){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=c,window.dispatchEvent(l),!l.defaultPrevented)throw c}return o.then(c=>{for(const l of c||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function ae(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function je(e){if(Array.isArray(e))return e}function Me(e,t,r){return(t=Le(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ee(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,c,l=[],f=!0,h=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(f=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);f=!0);}catch(E){h=!0,o=E}finally{try{if(!f&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(h)throw o}}return l}}function Se(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ce(Object(r),!0).forEach(function(n){Me(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pe(e,t){if(e==null)return{};var r,n,o=Re(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Re(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Ie(e,t){return je(e)||Ee(e,t)||Ae(e,t)||Se()}function Ce(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Le(e){var t=Ce(e,"string");return typeof t=="symbol"?t:t+""}function Ae(e,t){if(e){if(typeof e=="string")return ae(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ae(e,t):void 0}}function Te(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?le(Object(r),!0).forEach(function(n){Te(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $e(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,i){return i(o)},n)}}function z(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,l=new Array(c),f=0;f<c;f++)l[f]=arguments[f];return t.apply(r,[].concat(o,l))}}}function Y(e){return{}.toString.call(e).includes("Object")}function De(e){return!Object.keys(e).length}function N(e){return typeof e=="function"}function xe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}
2function Ve(e,t){return Y(t)||P("changeType"),Object.keys(t).some(function(r){return!xe(e,r)})&&P("changeField"),t}function Ue(e){N(e)||P("selectorType")}function _e(e){N(e)||Y(e)||P("handlerType"),Y(e)&&Object.values(e).some(function(t){return!N(t)})&&P("handlersType")}function qe(e){e||P("initialIsRequired"),Y(e)||P("initialType"),De(e)&&P("initialContent")}function ze(e,t){throw new Error(e[t]||e.default)}var Fe={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"},P=z(ze)(Fe),K={changes:Ve,selector:Ue,handler:_e,initial:qe};function Ne(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};K.initial(e),K.handler(t);var r={current:e},n=z(ke)(r,t),o=z(We)(r),i=z(K.changes)(e),c=z(He)(r);function l(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(E){return E};return K.selector(h),h(r.current)}function f(h){$e(n,o,i,c)(h)}return[l,f]}function He(e,t){return N(t)?t(e.current):t}function We(e,t){return e.current=se(se({},e.current),t),t}function ke(e,t,r){return N(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var Be={create:Ne},Ke={paths:{vs:"https://cdn.jsdelivr.net/npm/[email protected]/min/vs"}};function Ge(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,l=new Array(c),f=0;f<c;f++)l[f]=arguments[f];return t.apply(r,[].concat(o,l))}}}function Ye(e){return{}.toString.call(e).includes("Object")}function Je(e){return e||fe("configIsRequired"),Ye(e)||fe("configType"),e.urls?(Qe(),{paths:{vs:e.urls.monacoBase}}):e}function Qe(){console.warn(de.deprecation)}function Xe(e,t){throw new Error(e[t]||e.default)}var de={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! 3 You are using deprecated way of configuration. 4 5 Instead of using 6 monaco.config({ urls: { monacoBase: '...' } }) 7 use 8 monaco.config({ paths: { vs: '...' } }) 9 10 For more please check the link https://github.com/suren-atoyan/monaco-loader#config 11 `},fe=Ge(Xe)(de),Ze={config:Je},et=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return function(o){return r.reduceRight(function(i,c){return c(i)},o)}};function pe(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],pe(e[r],t[r]))}),ue(ue({},e),t)}var tt={type:"cancelation",msg:"operation is manually canceled"};function te(e){var t=!1,r=new Promise(function(n,o){e.then(function(i){return t?o(tt):n(i)}),e.catch(o)});return r.cancel=function(){return t=!0},r}var rt=["monaco"],nt=Be.create({config:Ke,isInitialized:!1,resolve:null,reject:null,monaco:null}),ge=Ie(nt,2),W=ge[0],J=ge[1];function ot(e){var t=Ze.config(e),r=t.monaco,n=Pe(t,rt);J(function(o){return{config:pe(o.config,n),monaco:r}})}function it(){var e=W(function(t){var r=t.monaco,n=t.isInitialized,o=t.resolve;return{monaco:r,isInitialized:n,resolve:o}});if(!e.isInitialized){if(J({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),te(re);if(window.monaco&&window.monaco.editor)return he(window.monaco),e.resolve(window.monaco),te(re);et(at,ut)(lt)}return te(re)}function at(e){return document.body.appendChild(e)}function ct(e){var t=document.createElement("script");return e&&(t.src=e),t}function ut(e){var t=W(function(n){var o=n.config,i=n.reject;return{config:o,reject:i}}),r=ct("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function lt(){var e=W(function(r){var n=r.config,o=r.resolve,i=r.reject;return{config:n,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var n=r.m;he(n),e.resolve(n)},function(r){e.reject(r)})}function he(e){W().monaco||J({monaco:e})}function st(){return W(function(e){var t=e.monaco;return t})}var re=new Promise(function(e,t){return J({resolve:e,reject:t})}),H={config:ot,init:it,__getMonacoInstance:st},ft={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ne=ft,dt={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},pt=dt;function gt({children:e}){return T.createElement("div",{style:pt.container},e)}var ht=gt,vt=ht;function mt({width:e,height:t,isEditorReady:r,loading:n,_ref:o,className:i,wrapperProps:c}){return T.createElement("section",{style:{...ne.wrapper,width:e,height:t},...c},!r&&T.createElement(vt,null,n),T.createElement("div",{ref:o,style:{...ne.fullWidth,...!r&&ne.hide},className:i}))}var bt=mt,ve=u.memo(bt);function yt(e){u.useEffect(e,[])}var oe=yt;function wt(e,t,r=!0){let n=u.useRef(!0);u.useEffect(n.current||!r?()=>{n.current=!1}:e,t)}var M=wt;function F(){}function A(e,t,r,n){return Ot(e,n)||jt(e,t,r,n)}function Ot(e,t){return e.editor.getModel(me(e,t))}function jt(e,t,r,n){return e.editor.createModel(t,r,n?me(e,n):void 0)}function me(e,t){return e.Uri.parse(t)}function Mt({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:f=!1,theme:h="light",loading:E="Loading...",options:v={}
11,height:$="100%",width:D="100%",className:Q,wrapperProps:X={},beforeMount:Z=F,onMount:ee=F}){let[O,x]=u.useState(!1),[R,b]=u.useState(!0),y=u.useRef(null),m=u.useRef(null),V=u.useRef(null),w=u.useRef(ee),d=u.useRef(Z),I=u.useRef(!1);oe(()=>{let a=H.init();return a.then(p=>(m.current=p)&&b(!1)).catch(p=>(p==null?void 0:p.type)!=="cancelation"&&console.error("Monaco initialization: error:",p)),()=>y.current?U():a.cancel()}),M(()=>{if(y.current&&m.current){let a=y.current.getOriginalEditor(),p=A(m.current,e||"",n||r||"text",i||"");p!==a.getModel()&&a.setModel(p)}},[i],O),M(()=>{if(y.current&&m.current){let a=y.current.getModifiedEditor(),p=A(m.current,t||"",o||r||"text",c||"");p!==a.getModel()&&a.setModel(p)}},[c],O),M(()=>{let a=y.current.getModifiedEditor();a.getOption(m.current.editor.EditorOption.readOnly)?a.setValue(t||""):t!==a.getValue()&&(a.executeEdits("",[{range:a.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),a.pushUndoStop())},[t],O),M(()=>{var a,p;(p=(a=y.current)==null?void 0:a.getModel())==null||p.original.setValue(e||"")},[e],O),M(()=>{let{original:a,modified:p}=y.current.getModel();m.current.editor.setModelLanguage(a,n||r||"text"),m.current.editor.setModelLanguage(p,o||r||"text")},[r,n,o],O),M(()=>{var a;(a=m.current)==null||a.editor.setTheme(h)},[h],O),M(()=>{var a;(a=y.current)==null||a.updateOptions(v)},[v],O);let k=u.useCallback(()=>{var S;if(!m.current)return;d.current(m.current);let a=A(m.current,e||"",n||r||"text",i||""),p=A(m.current,t||"",o||r||"text",c||"");(S=y.current)==null||S.setModel({original:a,modified:p})},[r,t,o,e,n,i,c]),B=u.useCallback(()=>{var a;!I.current&&V.current&&(y.current=m.current.editor.createDiffEditor(V.current,{automaticLayout:!0,...v}),k(),(a=m.current)==null||a.editor.setTheme(h),x(!0),I.current=!0)},[v,h,k]);u.useEffect(()=>{O&&w.current(y.current,m.current)},[O]),u.useEffect(()=>{!R&&!O&&B()},[R,O,B]);function U(){var p,S,C,_;let a=(p=y.current)==null?void 0:p.getModel();l||((S=a==null?void 0:a.original)==null||S.dispose()),f||((C=a==null?void 0:a.modified)==null||C.dispose()),(_=y.current)==null||_.dispose()}return T.createElement(ve,{width:D,height:$,isEditorReady:O,loading:E,_ref:V,className:Q,wrapperProps:X})}var Et=Mt,St=u.memo(Et);function Pt(){let[e,t]=u.useState(H.__getMonacoInstance());return oe(()=>{let r;return e||(r=H.init(),r.then(n=>{t(n)})),()=>r==null?void 0:r.cancel()}),e}var Rt=Pt;function It(e){let t=u.useRef();return u.useEffect(()=>{t.current=e},[e]),t.current}var Ct=It,G=new Map;function Lt({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:o,path:i,theme:c="light",line:l,loading:f="Loading...",options:h={},overrideServices:E={},saveViewState:v=!0,keepCurrentModel:$=!1,width:D="100%",height:Q="100%",className:X,wrapperProps:Z={},beforeMount:ee=F,onMount:O=F,onChange:x,onValidate:R=F}){let[b,y]=u.useState(!1),[m,V]=u.useState(!0),w=u.useRef(null),d=u.useRef(null),I=u.useRef(null),k=u.useRef(O),B=u.useRef(ee),U=u.useRef(),a=u.useRef(n),p=Ct(i),S=u.useRef(!1),C=u.useRef(!1);oe(()=>{let s=H.init();return s.then(g=>(w.current=g)&&V(!1)).catch(g=>(g==null?void 0:g.type)!=="cancelation"&&console.error("Monaco initialization: error:",g)),()=>d.current?ye():s.cancel()}),M(()=>{var g,j,q,L;let s=A(w.current,e||n||"",t||o||"",i||r||"");s!==((g=d.current)==null?void 0:g.getModel())&&(v&&G.set(p,(j=d.current)==null?void 0:j.saveViewState()),(q=d.current)==null||q.setModel(s),v&&((L=d.current)==null||L.restoreViewState(G.get(i))))},[i],b),M(()=>{var s;(s=d.current)==null||s.updateOptions(h)},[h],b),M(()=>{!d.current||n===void 0||(d.current.getOption(w.current.editor.EditorOption.readOnly)?d.current.setValue(n):n!==d.current.getValue()&&(C.current=!0,d.current.executeEdits("",[{range:d.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),d.current.pushUndoStop(),C.current=!1))},[n],b),M(()=>{var g,j;let s=(g=d.current)==null?void 0:g.getModel();s&&o&&((j=w.current)==null||j.editor.setModelLanguage(s,o))},[o],b),M(()=>{var s;l!==void 0&&((s=d.current)==null||s.revealLine(l))},[l],b),M(()=>{var s;(s=w.current)==null||s.editor.setTheme(c)},[c],b);let _=u.useCallback(()=>{var s;if(!(!I.current||!w.current)&&!S.current){B.current(w.current);let g=i||r,j=A(w.current,n||e||"",t||o||"",g||"");d.current=(s=w.current)==null?void 0:s.editor.create(I.current,{model:j,automaticLayout:!0,...h},E),v&&d.current.restoreViewState(G.get(g)),w.current.editor.setTheme(c),l!==void 0&&d.current.revealLine(l),y(!0),S.current=!0}},[e,t,r,n,o,i,h,E,v,c,l]);u.useEffect(()=>{b&&k.current(d.current,w.current)},[b]),u.useEffect(()=>{!m&&!b&&_()},[m,b,_]),a.current=n,u.useEffect(()=>{var s,g;b&&x&&((s=U.current)==null||s.dispose(),U.current=(g=d.current)==null?void 0:g.onDidChangeModelContent(j=>{C.current||x(d.current.getValue(),j)}))},[b,x]),u.useEffect(()=>{if(b){let s=w.current.editor.onDidChangeMarkers(g=>{var q;let j=(q=d.current.getModel())==null?void 0:q.uri;if(j&&g.find(L=>
11L.path===j.path)){let L=w.current.editor.getModelMarkers({resource:j});R==null||R(L)}});return()=>{s==null||s.dispose()}}return()=>{}},[b,R]);function ye(){var s,g;(s=U.current)==null||s.dispose(),$?v&&G.set(i,d.current.saveViewState()):(g=d.current.getModel())==null||g.dispose(),d.current.dispose()}return T.createElement(ve,{width:D,height:Q,isEditorReady:b,loading:f,_ref:I,className:X,wrapperProps:Z})}var At=Lt,be=u.memo(At),Tt=be;const xt=Object.freeze(Object.defineProperty({__proto__:null,DiffEditor:St,Editor:be,default:Tt,loader:H,useMonaco:Rt},Symbol.toStringTag,{value:"Module"}));export{Tt as F,Dt as _,xt as i};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.