import { __commonJSMin, __toCommonJS } from "../../../../_virtual/rolldown_runtime.js";
import { init_main, main_exports } from "../../../vscode-languageserver-types/lib/esm/main.js";
import { require_messages } from "./messages.js";
import { require_is } from "./utils/is.js";
var require_protocol_notebook = /* @__PURE__ */ __commonJSMin(((e) => {
	Object.defineProperty(e, "__esModule", { value: !0 }), e.DidCloseNotebookDocumentNotification = e.DidSaveNotebookDocumentNotification = e.DidChangeNotebookDocumentNotification = e.NotebookCellArrayChange = e.DidOpenNotebookDocumentNotification = e.NotebookDocumentSyncRegistrationType = e.NotebookDocument = e.NotebookCell = e.ExecutionSummary = e.NotebookCellKind = void 0;
	var o = (init_main(), __toCommonJS(main_exports)), s = require_is(), c = require_messages(), l;
	(function(e) {
		e.Markup = 1, e.Code = 2;
		function t(e) {
			return e === 1 || e === 2;
		}
		e.is = t;
	})(l || (e.NotebookCellKind = l = {}));
	var u;
	(function(e) {
		function t(e, t) {
			let n = { executionOrder: e };
			return (t === !0 || t === !1) && (n.success = t), n;
		}
		e.create = t;
		function n(e) {
			let t = e;
			return s.objectLiteral(t) && o.uinteger.is(t.executionOrder) && (t.success === void 0 || s.boolean(t.success));
		}
		e.is = n;
		function r(e, t) {
			return e === t ? !0 : e == null || t == null ? !1 : e.executionOrder === t.executionOrder && e.success === t.success;
		}
		e.equals = r;
	})(u || (e.ExecutionSummary = u = {}));
	var d;
	(function(e) {
		function t(e, t) {
			return {
				kind: e,
				document: t
			};
		}
		e.create = t;
		function n(e) {
			let t = e;
			return s.objectLiteral(t) && l.is(t.kind) && o.DocumentUri.is(t.document) && (t.metadata === void 0 || s.objectLiteral(t.metadata));
		}
		e.is = n;
		function r(e, t) {
			let n = /* @__PURE__ */ new Set();
			return e.document !== t.document && n.add("document"), e.kind !== t.kind && n.add("kind"), e.executionSummary !== t.executionSummary && n.add("executionSummary"), (e.metadata !== void 0 || t.metadata !== void 0) && !i(e.metadata, t.metadata) && n.add("metadata"), (e.executionSummary !== void 0 || t.executionSummary !== void 0) && !u.equals(e.executionSummary, t.executionSummary) && n.add("executionSummary"), n;
		}
		e.diff = r;
		function i(e, t) {
			if (e === t) return !0;
			if (e == null || t == null || typeof e != typeof t || typeof e != "object") return !1;
			let n = Array.isArray(e), r = Array.isArray(t);
			if (n !== r) return !1;
			if (n && r) {
				if (e.length !== t.length) return !1;
				for (let n = 0; n < e.length; n++) if (!i(e[n], t[n])) return !1;
			}
			if (s.objectLiteral(e) && s.objectLiteral(t)) {
				let n = Object.keys(e), r = Object.keys(t);
				if (n.length !== r.length || (n.sort(), r.sort(), !i(n, r))) return !1;
				for (let r = 0; r < n.length; r++) {
					let a = n[r];
					if (!i(e[a], t[a])) return !1;
				}
			}
			return !0;
		}
	})(d || (e.NotebookCell = d = {}));
	var f;
	(function(e) {
		function t(e, t, n, r) {
			return {
				uri: e,
				notebookType: t,
				version: n,
				cells: r
			};
		}
		e.create = t;
		function n(e) {
			let t = e;
			return s.objectLiteral(t) && s.string(t.uri) && o.integer.is(t.version) && s.typedArray(t.cells, d.is);
		}
		e.is = n;
	})(f || (e.NotebookDocument = f = {}));
	var p;
	(function(e) {
		e.method = "notebookDocument/sync", e.messageDirection = c.MessageDirection.clientToServer, e.type = new c.RegistrationType(e.method);
	})(p || (e.NotebookDocumentSyncRegistrationType = p = {}));
	var m;
	(function(e) {
		e.method = "notebookDocument/didOpen", e.messageDirection = c.MessageDirection.clientToServer, e.type = new c.ProtocolNotificationType(e.method), e.registrationMethod = p.method;
	})(m || (e.DidOpenNotebookDocumentNotification = m = {}));
	var h;
	(function(e) {
		function t(e) {
			let t = e;
			return s.objectLiteral(t) && o.uinteger.is(t.start) && o.uinteger.is(t.deleteCount) && (t.cells === void 0 || s.typedArray(t.cells, d.is));
		}
		e.is = t;
		function n(e, t, n) {
			let r = {
				start: e,
				deleteCount: t
			};
			return n !== void 0 && (r.cells = n), r;
		}
		e.create = n;
	})(h || (e.NotebookCellArrayChange = h = {}));
	var g;
	(function(e) {
		e.method = "notebookDocument/didChange", e.messageDirection = c.MessageDirection.clientToServer, e.type = new c.ProtocolNotificationType(e.method), e.registrationMethod = p.method;
	})(g || (e.DidChangeNotebookDocumentNotification = g = {}));
	var _;
	(function(e) {
		e.method = "notebookDocument/didSave", e.messageDirection = c.MessageDirection.clientToServer, e.type = new c.ProtocolNotificationType(e.method), e.registrationMethod = p.method;
	})(_ || (e.DidSaveNotebookDocumentNotification = _ = {}));
	var v;
	(function(e) {
		e.method = "notebookDocument/didClose", e.messageDirection = c.MessageDirection.clientToServer, e.type = new c.ProtocolNotificationType(e.method), e.registrationMethod = p.method;
	})(v || (e.DidCloseNotebookDocumentNotification = v = {}));
}));
export default require_protocol_notebook();
export { require_protocol_notebook };
