PageSourceSearch

https://json-5.com/_next/static/chunks/461.c24b3322fd1f6f4b.js

js json-5.com collected 2026-10-03 20:48:43 UTC 13,726 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[461,632],{37461:(e,t,r)=>{r.r(t),r.d(t,{DiffEditor:()=>y,Editor:()=>O,default:()=>w,loader:()=>n.default,useMonaco:()=>m});var n=r(38632),o=r(65162),i={display:"flex",position:"relative",textAlign:"initial"},u={width:"100%"},c={display:"none"},a={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},l=function({children:e}){return o.createElement("div",{style:a},e)},s=(0,o.memo)(function({width:e,height:t,isEditorReady:r,loading:n,_ref:a,className:s,wrapperProps:f}){return o.createElement("section",{style:{...i,width:e,height:t},...f},!r&&o.createElement(l,null,n),o.createElement("div",{ref:a,style:{...u,...!r&&c},className:s}))}),f=function(e){(0,o.useEffect)(e,[])},d=function(e,t,r=!0){let n=(0,o.useRef)(!0);(0,o.useEffect)(n.current||!r?()=>{n.current=!1}:e,t)};function g(){}function p(e,t,r,n){var o,i,u,c,a,l;return o=e,i=n,o.editor.getModel(h(o,i))||(u=e,c=t,a=r,l=n,u.editor.createModel(c,a,l?h(u,l):void 0))}function h(e,t){return e.Uri.parse(t)}var y=(0,o.memo)(function({original:e,modified:t,language:r,originalLanguage:i,modifiedLanguage:u,originalModelPath:c,modifiedModelPath:a,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:h=!1,theme:y="light",loading:m="Loading...",options:v={},height:b="100%",width:O="100%",className:w,wrapperProps:j={},beforeMount:M=g,onMount:E=g}){let[P,R]=(0,o.useState)(!1),[S,k]=(0,o.useState)(!0),T=(0,o.useRef)(null),C=(0,o.useRef)(null),I=(0,o.useRef)(null),x=(0,o.useRef)(E),A=(0,o.useRef)(M),D=(0,o.useRef)(!1);f(()=>{let e=n.default.init();return e.then(e=>(C.current=e)&&k(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return T.current?(t=T.current?.getModel(),void(l||t?.original?.dispose(),h||t?.modified?.dispose(),T.current?.dispose())):e.cancel()}}),d(()=>{let e=T.current.getModifiedEditor();e.getOption(C.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],P),d(()=>{T.current?.getModel()?.original.setValue(e||"")},[e],P),d(()=>{let{original:e,modified:t}=T.current.getModel();C.current.editor.setModelLanguage(e,i||r||"text"),C.current.editor.setModelLanguage(t,u||r||"text")},[r,i,u],P),d(()=>{C.current?.editor.setTheme(y)},[y],P),d(()=>{T.current?.updateOptions(v)},[v],P);let V=(0,o.useCallback)(()=>{if(!C.current)return;A.current(C.current);let n=p(C.current,e||"",i||r||"text",c||""),o=p(C.current,t||"",u||r||"text",a||"");T.current?.setModel({original:n,modified:o})},[r,t,u,e,i,c,a]),L=(0,o.useCallback)(()=>{!D.current&&I.current&&(T.current=C.current.editor.createDiffEditor(I.current,{automaticLayout:!0,...v}),V(),C.current?.editor.setTheme(y),R(!0),D.current=!0)},[v,y,V]);return(0,o.useEffect)(()=>{P&&x.current(T.current,C.current)},[P]),(0,o.useEffect)(()=>{S||P||L()},[S,P,L]),o.createElement(s,{width:O,height:b,isEditorReady:P,loading:m,_ref:I,className:w,wrapperProps:j})}),m=function(){let[e,t]=(0,o.useState)(n.default.__getMonacoInstance());return f(()=>{let r;return e||(r=n.default.init()).then(e=>{t(e)}),()=>r?.cancel()}),e},v=function(e){let t=(0,o.useRef)();return(0,o.useEffect)(()=>{t.current=e},[e]),t.current},b=new Map,O=(0,o.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:i,language:u,path:c,theme:a="light",line:l,loading:h="Loading...",options:y={},overrideServices:m={},saveViewState:O=!0,keepCurrentModel:w=!1,width:j="100%",height:M="100%",className:E,wrapperProps:P={},beforeMount:R=g,onMount:S=g,onChange:k,onValidate:T=g}){let[C,I]=(0,o.useState)(!1),[x,A]=(0,o.useState)(!0),D=(0,o.useRef)(null),V=(0,o.useRef)(null),L=(0,o.useRef)(null),_=(0,o.useRef)(S),N=(0,o.useRef)(R),q=(0,o.useRef)(),z=(0,o.useRef)(i),F=v(c),U=(0,o.useRef)(!1),B=(0,o.useRef)(!1);f(()=>{let e=n.default.init();return e.then(e=>(D.current=e)&&A(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>V.current?void(q.current?.dispose(),w?O&&b.set(c,V.current.saveViewState()):V.current.getModel()?.dispose(),V.current.dispose()):e.cancel()}),d(()=>{let n=p(D.current,e||i||"",t||u||"",c||r||"");n!==V.current?.getModel()&&(O&&b.set(F,V.current?.saveViewState()),V.current?.setModel(n),O&&V.current?.restoreViewState(b.get(c))
1)},[c],C),d(()=>{V.current?.updateOptions(y)},[y],C),d(()=>{V.current&&void 0!==i&&(V.current.getOption(D.current.editor.EditorOption.readOnly)?V.current.setValue(i):i!==V.current.getValue()&&(B.current=!0,V.current.executeEdits("",[{range:V.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),V.current.pushUndoStop(),B.current=!1))},[i],C),d(()=>{let e=V.current?.getModel();e&&u&&D.current?.editor.setModelLanguage(e,u)},[u],C),d(()=>{void 0!==l&&V.current?.revealLine(l)},[l],C),d(()=>{D.current?.editor.setTheme(a)},[a],C);let Y=(0,o.useCallback)(()=>{if(!(!L.current||!D.current)&&!U.current){N.current(D.current);let n=c||r,o=p(D.current,i||e||"",t||u||"",n||"");V.current=D.current?.editor.create(L.current,{model:o,automaticLayout:!0,...y},m),O&&V.current.restoreViewState(b.get(n)),D.current.editor.setTheme(a),I(!0),U.current=!0}},[e,t,r,i,u,c,y,m,O,a]);return(0,o.useEffect)(()=>{C&&_.current(V.current,D.current)},[C]),(0,o.useEffect)(()=>{x||C||Y()},[x,C,Y]),z.current=i,(0,o.useEffect)(()=>{C&&k&&(q.current?.dispose(),q.current=V.current?.onDidChangeModelContent(e=>{B.current||k(V.current.getValue(),e)}))},[C,k]),(0,o.useEffect)(()=>{if(C){let e=D.current.editor.onDidChangeMarkers(e=>{let t=V.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=D.current.editor.getModelMarkers({resource:t});T?.(e)}});return()=>{e?.dispose()}}return()=>{}},[C,T]),o.createElement(s,{width:j,height:M,isEditorReady:C,loading:h,_ref:L,className:E,wrapperProps:P})}),w=O},38632:(e,t,r)=>{function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){var n,o;n=t,o=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e){return function t(){for(var r=this,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.apply(r,[].concat(o,n))}}}function l(e){return({}).toString.call(e).includes("Object")}function s(e){return"function"==typeof e}r.r(t),r.d(t,{default:()=>L});var f,d,g=a(function(e,t){throw Error(e[t]||e.default)})({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=function(e,t){return l(t)||g("changeType"),Object.keys(t).some(function(t){return!Object.prototype.hasOwnProperty.call(e,t)})&&g("changeField"),t},h=function(e){s(e)||g("selectorType")},y=function(e){s(e)||l(e)||g("handlerType"),l(e)&&Object.values(e).some(function(e){return!s(e)})&&g("handlersType")},m=function(e){e||g("initialIsRequired"),l(e)||g("initialType"),Object.keys(e).length||g("initialContent")};function v(e,t){return s(t)?t(e.current):t}function b(e,t){return e.current=c(c({},e.current),t),t}function O(e,t,r){return s(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null==(n=t[r])?void 0:n.call(t,e.current[r])}),r}var w={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!\n    You are using deprecated way of configuration.\n\n    Instead of using\n      monaco.config({ urls: { monacoBase: '...' } })\n    use\n      monaco.config({ paths: { vs: '...' } })\n\n    For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n  "},j=(f=function(e,t){throw Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];return n.length>=f.length?f.apply(this,n):function(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return e.apply(t,[].concat(n,o))}})(w),M=function(e){return(e||j("configIsRequired"),({}).toString.call(e).includes("Object")||j("configType"),e.urls)?(console.warn(w.deprecation),{paths:{vs:e.urls.monacoBase}}):e},E=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}},P={type:"cancelation",msg:"operation is manually canceled"};function R(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(P):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var S=["monaco"],k=function(e){if(Array.isArray(e))return e}(d=({create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(e),y(t);var r={current:e},n=a(O)(r,t),o=a(b)(r),i=a(p)(e),u=a(v)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return h(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}})(n,o,i,u)(e)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/[email protected]/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e,t){var r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,u,c=[],a=!0,l=!1;try{i=(r=r.call(e)).next,!1;for(;!(a=(n=i.call(r)).done)&&(c.push(n.value),2!==c.length);a=!0);}catch(e){l=!0,o=e}
1finally{try{if(!a&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(l)throw o}}return c}}(d,2)||function(e,t){if(e){if("string"==typeof e)return n(e,2);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,2):void 0}}(d,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),T=k[0],C=k[1];function I(e){return document.body.appendChild(e)}function x(e){var t,r,n=T(function(e){return{config:e.config,reject:e.reject}}),o=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return o.onload=function(){return e()},o.onerror=n.reject,o}function A(){var e=T(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var r=t.m||t;D(r),e.resolve(r)},function(t){e.reject(t)})}function D(e){T().monaco||C({monaco:e})}var V=new Promise(function(e,t){return C({resolve:e,reject:t})}),L={config:function(e){var t=M(e),r=t.monaco,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,S);C(function(e){return{config:function e(t,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&t[n]&&Object.assign(r[n],e(t[n],r[n]))}),i(i({},t),r)}(e.config,n),monaco:r}})},init:function(){var e=T(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(C({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),R(V);if(window.monaco&&window.monaco.editor)return D(window.monaco),e.resolve(window.monaco),R(V);E(I,x)(A)}return R(V)},__getMonacoInstance:function(){return T(function(e){return e.monaco})}}}}]);

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.