import{p as o}from"./vendor-lezer-json-Iaex0UN-.js";import{L as a,b as s,c as i,d as n,g as p,h as m}from"./vendor-codemirror-language-BgPj_McA.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-lezer-highlight-CDMHUZ74.js";import"./vendor-codemirror-state-C9awkmn-.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-codemirror-view-CiLROUVV.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";const P=()=>r=>{try{JSON.parse(r.state.doc.toString())}catch(t){if(!(t instanceof SyntaxError))throw t;const e=c(t,r.state.doc);return[{from:e,message:t.message,severity:"error",to:e}]}return[]};function c(r,t){let e;return(e=r.message.match(/at position (\d+)/))?Math.min(+e[1],t.length):(e=r.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+e[1]).from+ +e[2]-1,t.length):0}const d=s.define({name:"json",parser:o.configure({props:[i.add({Object:n({except:/^\s*\}/}),Array:n({except:/^\s*\]/})}),p.add({"Object Array":m})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function S(){return new a(d)}export{S as json,d as jsonLanguage,P as jsonParseLinter};
