Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

api-smart-diff

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-smart-diff - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

dist/api-smart-diff.min.js
/*!
* api-smart-diff v1.0.0
* api-smart-diff v1.0.1
* Copyright (C) 2012-2024 Damir Yusipov
* Date: Sun, 21 Jan 2024 13:55:12 GMT
* Date: Sun, 21 Jan 2024 16:15:17 GMT
*/
var ApiSmartDiff=function(e){"use strict";function t(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}const r=(e={},t,r,n)=>{const a=`/${t}`,s="function"==typeof e["/**"]?e["/**"]({key:t,path:r,value:n}):e["/**"],o="function"==typeof e["/*"]?e["/*"]({key:t,path:r,value:n}):e["/*"];let i={};if(a in e)i=e[a];else if(!s&&!o)return;return i="function"==typeof i?i({key:t,path:r,value:n}):i,o&&(i=Object.assign(Object.assign({},o),i)),s?Object.assign(Object.assign({"/**":e["/**"]},s),i):i},n=e=>{const t={},r=e.reduce(((e,t)=>(Object.keys(t).forEach((t=>e.add(t))),e)),new Set);for(const a of r.keys()){const r=e.filter((e=>a in e));if(1!==r.length){if("/"!==a.charAt(0))throw new Error(`Cannot merge rules. Duplicate key: ${a}. Rules should not have same Rule key`);t[a]=(e,t)=>{const s=r.map((r=>"function"==typeof r[a]?r[a](e,t):r[a]));return n(s)}}else t[a]=r[0][a]}return t},a=e=>"object"==typeof e&&null!==e,s=e=>Array.isArray(e),o=(e,o,i={})=>{var l,c;o=s(o)?o:[o];const p=s(i.rules)?n(i.rules):i.rules,u=[{data:e,state:i.state,path:[],keys:[],keyIndex:-1,rules:p}];for(;u.length>0;){const e=u[u.length-1];if(e.keyIndex>=e.keys.length){for(;null===(l=e.hooks)||void 0===l?void 0:l.length;)e.hooks.pop()();u.pop();continue}const n=e.keys[e.keyIndex++],[i,f,d]=u.length>1?[e.data[n],[...e.path,n],r(e.rules,n,[...e.path,n],e.data[n])]:[e.data,e.path,p];let m={value:i,path:f,key:n,state:e.state,rules:d};const g=[];for(const e of o){if(!e||"function"!=typeof e)continue;const r=null!==(c=e(m))&&void 0!==c?c:{},{terminate:n,done:a,exitHook:s}=r,o=t(r,["terminate","done","exitHook"]);if(n)return;if(s&&g.push(s),m=Object.assign(Object.assign({},m),o),a){m=null;break}}if(m&&a(m.value)){const e=s(m.value)?[...m.value.keys()]:Object.keys(m.value);u.push({hooks:g,state:m.state,data:m.value,path:f,keys:e,keyIndex:0,rules:m.rules})}else for(;g.length;)g.pop()()}},i=(e,t=[],r={})=>{var n;t=Array.isArray(t)?t:[t];const s={"#":void 0},i=Object.assign({state:Object.assign(Object.assign({},null!==(n=r.state)&&void 0!==n?n:{}),{root:s,node:s})},r.rules?{rules:r.rules}:{}),[l,c]=(()=>{const e=new WeakMap;let t;return[({value:e})=>{t=e},({value:r,path:n,key:s,state:o})=>{if(s=n.length?s:"#",a(t)){if(e.has(t))return o.node[s]=e.get(t),{done:!0};const n=Array.isArray(r)?[]:{};o.node[s]=n,e.set(t,n)}else o.node[s]=r;return{value:r,state:Object.assign(Object.assign({},o),{node:o.node[s]})}}]})();return o(e,[l,...t,c],i),s["#"]},l=(e,t)=>t in e,c=e=>"object"==typeof e&&null!==e,p=e=>Array.isArray(e),u=e=>!(!Array.isArray(e)||!e.length),f=e=>void 0!==e,d=e=>"string"==typeof e,m=e=>"number"==typeof e||d(e)&&!Number.isNaN(+e),g=e=>"function"==typeof e,y=e=>Array.isArray(e)?"array":null==e?"null":typeof e,h=e=>Object.keys(e),b=(e,t,r)=>(e[t]=r,e),v=(e,t)=>{const r={};for(const n of t)n in e&&(r[n]=e[n],delete e[n]);return r},O=(e,...t)=>{let r=e;for(const e of t){if(Array.isArray(r)&&"number"==typeof+e&&r.length<+e)r=r[+e];else{if(!c(r)||!(e in r))return;r=r[e]}if(void 0===r)return}return r},$=(e,...t)=>{const r=O(e,...t);return"string"==typeof r?r:void 0},j=(e,...t)=>{const r=O(e,...t);return c(r)?r:void 0},x=(e,...t)=>{const r=[...e];for(const e of t)for(const t of e)""===t?r.pop():r.push(t);return r},k="$diff",A={add:"add",remove:"remove",replace:"replace",rename:"rename"},R={breaking:"breaking",nonBreaking:"non-breaking",annotation:"annotation",unclassified:"unclassified",deprecated:"deprecated"},{breaking:S,nonBreaking:C,unclassified:M,annotation:P,deprecated:I}=R,w=[C,C,C],q=[S,S,S],E=[S,C,C],T=[C,S,S],_=[M,M,M],N=[P,P,P],B=[I,I,I],D=(e,t)=>{var r,n,a,s;const o=null!==(n=null===(r=t.rules)||void 0===r?void 0:r.$)&&void 0!==n?n:{},i=Object.assign(Object.assign({},e),{type:M});if(o){const r=(Array.isArray(o)?o:_)["rename"===e.action?2:["add","remove","replace"].indexOf(e.action)];try{i.type=g(r)?r(t):r}catch(e){const r=e instanceof Error?e.message:"";console.error(`Classification Rule error for node: ${t.before.path.join(".")}. ${r}`)}}const l=null===(s=(a=t.options).annotateHook)||void 0===s?void 0:s.call(a,i,t);return Object.assign(Object.assign({},i),l?{description:l}:{})},H={added:(e,t,r)=>D({path:e,after:t,action:A.add},r),removed:(e,t,r)=>D({path:e,before:t,action:A.remove},r),replaced:(e,t,r,n)=>D({path:e,before:t,after:r,action:A.replace},n),renamed:(e,t,r,n)=>D({path:e,before:t,after:r,action:A.rename},n)},V=e=>{var t;return Object.assign({action:e.action,type:null!==(t=e.type)&&void 0!==t?t:M},"replace"===e.action||"rename"===e.action?{replaced:e.before}:{})},K=e=>{const t={};for(const r of e){const e=V(r);t["rename"!==r.action?r.path[r.path.length-1]:r.after]=e}return t},L=(e,...t)=>{const r=x(e.path.slice(0,-1),t);if(!r.length)return{path:[],key:"",value:e.root,root:e.root};const n=[...r],a=n.pop(),s=O(e.root,...n),o=s[a];return void 0!==o?{path:r,key:a,value:o,parent:s,root:e.root}:void 0},F=e=>(t,r)=>[e(t,r),e(r,t)],U=(e,t)=>{const r=Math.abs(e.length-t.length),n=Array.from({length:Math.min(e.length,t.length)},((e,t)=>t));return{removed:e.length>t.length?Array.from({length:r},((e,r)=>t.length+r)):[],added:e.length<t.length?Array.from({length:r},((t,r)=>e.length+r)):[],mapped:n.reduce(((e,t)=>(e[t]=t,e)),{})}},J=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=new Set(Object.keys(t));for(const t of Object.keys(e))n.has(t)?(r.mapped[t]=t,n.delete(t)):r.removed.push(t);return n.forEach((e=>r.added.push(e))),r},W=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=new Set(Object.keys(t).map((e=>e.toLocaleLowerCase())));for(const t of Object.keys(e)){const e=t.toLocaleLowerCase();n.has(e)?(r.mapped[e]=e,n.delete(e)):r.removed.push(e)}return n.forEach((e=>r.added.push(e))),r},G=(e,t)=>{const{bNode:r,aNode:n,aPath:a,root:s,akey:o,bkey:i,bPath:l,before:c,after:p,rules:u}=e,f=l.length||"#"!==i?[...l,i]:[],d=a.length||"#"!==o?[...a,o]:[];return{before:{key:i,path:f,parent:r,value:c,root:s.before["#"]},after:{key:o,path:d,parent:n,value:p,root:s.after["#"]},rules:u,options:t}},z=({before:e,after:t,rules:n,options:a},s,o)=>{var i;const l=O(e.value,s),c=O(t.value,o);return{before:{path:[...e.path,s],key:s,value:l,parent:e.value,root:e.root},after:{path:[...t.path,o],key:o,value:c,parent:t.value,root:t.root},rules:null!==(i=r(n,s||o,s?e.path:t.path,s?l:c))&&void 0!==i?i:{},options:a}},Y=(e,t,r)=>(e[t]=r,{done:!0}),Q=(e,t,r)=>(e[t]=V(r),r),X=(e,t,r={},n={})=>{var a,s;const{jsonPath:i=[],source:l=e}=null!==(a=n.before)&&void 0!==a?a:{},{jsonPath:u=[],source:f=t}=null!==(s=n.after)&&void 0!==s?s:{},d={before:{"#":l},after:{"#":f},merged:{}},g=i.slice(0,-1),b=u.slice(0,-1),v=g.length?O(l,...g):d.before,$=b.length?O(f,...b):d.after;if(!c(v)||!c($))throw new Error("");const j=g.length?i[g.length]:"#",x=b.length?u[b.length]:"#",A=v[j],R=$[x];v[j]=e,$[x]=t;const{diffs:S,hook:C}=((e={})=>{const t=[],{arrayMeta:r,metaKey:n=k}=e;return{diffs:t,hook:a=>{var s;const{rules:o={},state:i,value:l,key:u}=a,{transform:f,compare:d,mapping:g,skip:b}=o,{keyMap:v,parentMeta:O,bNode:$,aNode:j,mNode:x}=i,k=null!=u?u:p($)?+Object.keys(v).pop():Object.keys(v).pop(),A=v[k],R=p(x)&&m(k)?k:A;if(b||!(k in v))return Y(x,k,l);const S=i.bPath.length||"#"!==k?[...i.bPath,k]:[],C=i.aPath.length||"#"!==A?[...i.aPath,A]:[],M=[l,j[A]],[P,I]=!p(l)&&f?f.reduce(((e,t)=>t(...e)),M):M;$[k]=P,j[A]=I;const w=G(Object.assign(Object.assign({},i),{before:P,after:I,akey:A,bkey:k,rules:o}),e),q=null==d?void 0:d(w);if(q){const{diffs:e,merged:r,rootMergeMeta:n}=q;return t.push(...e),n&&(O[A]=n),Y(x,R,r)}if(y(P)!==y(I))return t.push(Q(O,A,H.replaced(S,P,I,w))),Y(x,R,I);if(c(P)&&c(I)){const e=[],o=p(P)?[]:{};x[R]=o;const i=null!=g?g:p(P)?U:J,{added:l,removed:c,mapped:u}=i(P,I,w),f=p(P)?[]:h(u).filter((e=>e!==u[e]));e.push(...c.map((e=>H.removed([...S,e],P[e],z(w,e,""))))),e.push(...f.map((e=>H.renamed(S,e,u[e],z(w,e,u[e]))))),t.push(...e);const d=null!==(s=K(e))&&void 0!==s?s:{},m=()=>{l.forEach((e=>{const r=p(o)?o.length:e,n=H.added([...S,r],I[e],z(w,"",e));d[r]=V(n),o[r]=I[e],t.push(n)})),Object.keys(d).length&&(p(o)&&!r?O[A]={array:d}:o[n]=d)},y=Object.assign(Object.assign({},a.state),{keyMap:u,aPath:C,bPath:S,bNode:P,aNode:I,parentMeta:d,mNode:o});return{value:P,state:y,exitHook:m}}return P!==I&&t.push(Q(O,A,H.replaced(S,P,I,w))),Y(x,R,I)}}})(r),M={aPath:b,bPath:g,mNode:d.merged,bNode:v,aNode:$,keyMap:{[j]:x},parentMeta:{},root:d};return o(e,C,{state:M,rules:r.rules}),v[j]=A,$[x]=R,{diffs:S,merged:d.merged[x],rootMergeMeta:M.parentMeta[x]}},Z=(e,t)=>Object.assign({template:e},t?{params:t}:{}),ee=(e,t={})=>{if(!e)return"";const{template:r,params:n}=e;return((e="",r={})=>{var n;let a=((e,r)=>{const n=h(t).filter((t=>t.startsWith(`${e}_`)));let a=e in t?t[e]:void 0,s=1;for(const e of n){const n=e.split("_").slice(1);!n.filter((e=>!f(r[e])||""===r[e])).length&&n.length>=s&&(a=t[e],s=n.length)}return a})(e,r);if(!a)return"";const s={};for(const e of h(r)){const n=r[e];s[e]=c(n)?ee(n,t):n}for(const e of[...a.matchAll(/{{(\w+)}}/g)].reverse()){if(!(e[1]in s))continue;const t=null!==(n=e.index)&&void 0!==n?n:0;a=a.substring(0,t)+String(s[e[1]])+a.substring(t+e[0].length)}return a})(r,n)},te=(e,t)=>i(e,(({value:e,key:r})=>{if(!r||d(r)&&r.startsWith("/"))return"function"==typeof e?{value:(...r)=>te(e(...r),t)}:!Array.isArray(e)&&c(e)?{value:t(e)}:void 0})),re=e=>"$"in e&&Array.isArray(e.$)?Object.assign(Object.assign({},e),{$:ae(e.$)}):e,ne=e=>{if("function"==typeof e)return t=>ne(e(t));switch(e){case S:return C;case C:return S;default:return e}},ae=([e,t,r])=>[ne(e),ne(t),ne(r)],se=([e,t,r],n)=>[t=>n(g(e)?e(t):e,t,"add"),e=>n(g(t)?t(e):t,e,"remove"),e=>n(g(r)?r(e):r,e,"replace")];function oe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function ie(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function le(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}const ce=(e={},t,r,n)=>{const a=`/${t}`,s="function"==typeof e["/**"]?e["/**"]({key:t,path:r,value:n}):e["/**"],o="function"==typeof e["/*"]?e["/*"]({key:t,path:r,value:n}):e["/*"];let i={};if(a in e)i=e[a];else if(!s&&!o)return;return i="function"==typeof i?i({key:t,path:r,value:n}):i,o&&(i=Object.assign(Object.assign({},o),i)),s?Object.assign(Object.assign({"/**":e["/**"]},s),i):i},pe=e=>{const t={},r=e.reduce(((e,t)=>(Object.keys(t).forEach((t=>e.add(t))),e)),new Set);for(const n of r.keys()){const r=e.filter((e=>n in e));if(1!==r.length){if("/"!==n.charAt(0))throw new Error(`Cannot merge rules. Duplicate key: ${n}. Rules should not have same Rule key`);t[n]=(e,t)=>{const a=r.map((r=>"function"==typeof r[n]?r[n](e,t):r[n]));return pe(a)}}else t[n]=r[0][n]}return t},ue=e=>"object"==typeof e&&null!==e,fe=e=>Array.isArray(e),de=(e,t,r={})=>{var n,a;t=fe(t)?t:[t];const s=fe(r.rules)?pe(r.rules):r.rules,o=[{data:e,state:r.state,path:[],keys:[],keyIndex:-1,rules:s}];for(;o.length>0;){const e=o[o.length-1];if(e.keyIndex>=e.keys.length){for(;null===(n=e.hooks)||void 0===n?void 0:n.length;)e.hooks.pop()();o.pop();continue}const r=e.keys[e.keyIndex++],[i,l,c]=o.length>1?[e.data[r],[...e.path,r],ce(e.rules,r,[...e.path,r],e.data[r])]:[e.data,e.path,s];let p={value:i,path:l,key:r,state:e.state,rules:c};const u=[];for(const e of t){if(!e||"function"!=typeof e)continue;const t=null!==(a=e(p))&&void 0!==a?a:{},{terminate:r,done:n,exitHook:s}=t,o=le(t,["terminate","done","exitHook"]);if(r)return;if(s&&u.push(s),p=Object.assign(Object.assign({},p),o),n){p=null;break}}if(p&&ue(p.value)){const e=fe(p.value)?[...p.value.keys()]:Object.keys(p.value);o.push({hooks:u,state:p.state,data:p.value,path:l,keys:e,keyIndex:0,rules:p.rules})}else for(;u.length;)u.pop()()}},me=()=>{const e=new WeakMap;let t;return[({value:e})=>{t=e},({value:r,path:n,key:a,state:s})=>{if(a=n.length?a:"#",ue(t)){if(e.has(t))return s.node[a]=e.get(t),{done:!0};const n=Array.isArray(r)?[]:{};s.node[a]=n,e.set(t,n)}else s.node[a]=r;return{value:r,state:Object.assign(Object.assign({},s),{node:s.node[a]})}}]};class ge extends Map{add(e,t){const r=this.get(e);return r?r.push(t):this.set(e,[t]),this}}const ye=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t))return[...e,...t];if(ue(e)&&ue(t)){const r=Object.assign({},e);for(const e of Object.keys(t))r[e]=ye(r[e],t[e]);return r}return t},he=e=>e&&e.$ref&&"string"==typeof e.$ref,be=e=>e&&e.anyOf&&Array.isArray(e.anyOf),ve=e=>e&&e.oneOf&&Array.isArray(e.oneOf),Oe=(e,t="")=>{const[r=t,n]=e.split("#"),a=n&&"/"!==n?n:"";return{filePath:r,pointer:a,normalized:$e(r,a),jsonPath:Se(a)}},$e=(e,t)=>e?`${e}${t?"#"+t:""}`:t?`#${t}`:"#",je=(e,t,r=[t])=>{if(!ue(e))return;let n=e;const a=Se(t);for(const t of a)if(Array.isArray(n)&&n.length>+t)n=n[+t];else if(ue(n)&&t in n)n=n[t];else{if(!he(n))return;{const t=Oe(n.$ref);n=t.filePath||r.includes(t.pointer)?void 0:je(e,t.pointer,[...r,t.pointer])}}return n},xe=/\//g,ke=/~/g,Ae=/~1/g,Re=/~0/g,Se=e=>e.split("/").map((e=>decodeURIComponent(e.replace(Ae,"/").replace(Re,"~")))).slice(1),Ce=e=>e.length?"/"+e.map((e=>encodeURIComponent(String(e).replace(ke,"~0").replace(xe,"~1")))).join("/"):"";function Me(e){const t=e.reduce(((e,t)=>Math.max(e,(e=>{let t=1;for(;e*t%1!=0;)t*=10;return t})(t))),0);return e.reduce(((e,r)=>Math.round(e*t*r*t/Pe(e*t,r*t))/t))}function Pe(e,t){return 0===t?e:Pe(t,e%t)}const Ie=e=>{if(0===e.length)return[[]];const t=e[0],r=e.slice(1),n=Ie(r),a=[];for(const e of t)for(const t of n)a.push([e,...t]);return a},we=e=>{const t={},r=Te(e);for(const[e,n]of Object.entries(r))n.includes(!1)?t[e]=!1:t[e]=n.length>1?{allOf:n}:n[0];return t},qe=(e,t)=>!!e.reduce(((e,t)=>e&&!0===t),!0)||_e(e,t),Ee=e=>`Merge rule not found for key: ${e}`,Te=e=>{const t={};for(const r of e)for(const e of Object.keys(r))Array.isArray(t[e])?t[e].push(r[e]):t[e]=[r[e]];return t},_e=(e,t)=>{if(e.includes(!1))return!1;const r={},n=Te(e);"properties"in n&&(n.properties=(e=>{const t=[];for(const r of e){if(!("properties"in r))continue;const n=new Set(Object.keys(r.properties)),a=new ge;for(const t of n.values())for(const s of e)if(!(s==r||s.properties&&t in s.properties))if("patternProperties"in s&&s.patternProperties)for(const e of Object.keys(s.patternProperties))new RegExp(e).test(t)||n.delete(t);else"additionalProperties"in s&&(!1===s.additionalProperties?n.delete(t):"object"==typeof s.additionalProperties&&a.add(t,s.additionalProperties));if(!n.size)continue;const s={};for(const e of n.values())a.has(e)?s[e]={allOf:[r.properties[e],...a.get(e)]}:s[e]=r.properties[e];t.push(s)}return t})(e)),"patternProperties"in n&&(n.patternProperties=(e=>{const t=[];for(const r of e){if(!("patternProperties"in r))continue;const n=new Set(Object.keys(r.patternProperties));for(const t of e)if(t!=r&&"additionalProperties"in t&&!t.additionalProperties)for(const e of n.values())t.patternProperties&&e in t.patternProperties||n.delete(e);if(!n.size)continue;const a={};for(const e of n.values())a[e]=r.patternProperties[e];t.push(a)}return t})(e));for(let[a,s]of Object.entries(n)){if(!s.length)continue;const n=t.mergeRules;let o=`/${a}`in n?n[`/${a}`]:n["/?"];o=o&&!("$"in o)&&"/"in o?o["/"]:o,o="function"==typeof o?o():o;const i=o&&"$"in o?o.$:void 0;if(!i)throw new Error(Ee(a));const l=s.length>1?i(s,Object.assign(Object.assign({},t),{allOfItems:e})):s[0];void 0===l?t.mergeError(s):r[a]=l}return Object.keys(r).length?r:void 0},Ne=e=>e[e.length-1],Be=e=>e.reduce(((e,t)=>e||t),!1),De=e=>Math.min(...e),He=e=>Math.max(...e),Ve=e=>e.length>1?e.reduce(((e,t)=>`${e}(?=${t})`),""):e[0],Ke=([e,...t])=>t.reduce(((e,t)=>e.filter((e=>t.includes(e)))),e),Le=([e,...t])=>t.find((t=>!((e,t)=>JSON.stringify(e)==JSON.stringify(t))(t,e)))?void 0:e,Fe=([e,...t])=>t.reduce(((e,t)=>ye(e,t)),e),Ue=e=>Ie(e).map((e=>({allOf:e}))),Je=e=>({anyOf:e}),We=e=>Me(e),Ge=(e,t)=>{const r=e.map((e=>e.map((e=>JSON.stringify(e))))),n=Ke(r).map((e=>JSON.parse(e))).sort();return n.length||t.mergeError(e),n},ze=(e,t)=>{const r=e.map((e=>Array.isArray(e)?e:[e])),n=Ke(r);return 1===n.length?n[0]:n.length?n:void 0},Ye=e=>{const t=new Set;for(const r of e)for(const e of r)t.add(e);return Array.from(t).sort()},Qe=(e,t)=>{const r={},n=Te(e);for(const[e,t]of Object.entries(n))if(t.reduce(((e,t)=>e&&Array.isArray(t)),!0))r[e]=Ye(t);else{const n=t.map((e=>Array.isArray(e)?{required:e}:e));r[e]=n.length>1?{allOf:n}:n[0]}return r},Xe=(e,t)=>{if(!e.reduce(((e,t)=>Array.isArray(t)||e),!1))return _e(e,t);const r=[];let n=1/0,a=0;const s=new ge;for(const e of t.allOfItems)"additionalItems"in e&&e.additionalItems&&"items"in e&&Array.isArray(e.items)&&s.add(e.items.length,e.additionalItems),"items"in e&&(r.push(e.items),Array.isArray(e.items)&&(a=Math.max(a,e.items.length),"additionalItems"in e&&!1===e.additionalItems&&(n=Math.min(n,e.items.length))));const o=Math.min(a,n),i=[...Array(o)].map((()=>({allOf:[]})));for(const e of r)if(Array.isArray(e))for(let t=0;t<o;t++){const r=[];for(let e=0;e<=t;e++)s.has(e)&&r.push(...s.get(e));t<e.length?i[t].allOf.push(r.length?Object.assign(Object.assign({},e[t]),{allOf:r}):e[t]):i[t].allOf.push(!r.length||{allOf:r})}else i.forEach((({allOf:t})=>t.push(e)));return i},Ze=(e,t)=>{const r=[],n=[];for(const e of t.allOfItems)"items"in e&&!Array.isArray(e.items)&&n.push(e.items),"additionalItems"in e&&"items"in e&&Array.isArray(e.items)&&r.push(e.additionalItems);return n.length&&r.forEach((e=>e.allOf=n)),_e(r,t)},et=(e="draft-06",t={})=>Object.assign(Object.assign(Object.assign(Object.assign({"/maximum":{$:De},"/exclusiveMaximum":{$:Be},"/minimum":{$:He},"/exclusiveMinimum":{$:Be},"/maxLength":{$:De},"/minLength":{$:He},"/maxItems":{$:De},"/minItems":{$:He},"/uniqueItems":{$:Be},"/maxProperties":{$:De},"/minProperties":{$:He},"/required":{$:Ye},"/multipleOf":{$:We},"/enum":{$:Ge},"/type":{$:ze},"/allOf":{"/*":()=>et(e,t),$:Ue},"/not":{$:Je},"/oneOf":{"/*":()=>et(e,t),$:Ue,sibling:["definitions","$defs","$id","$schema"]},"/anyOf":{"/*":()=>et(e,t),$:Ue,sibling:["definitions","$defs","$id","$schema"]},"/properties":{"/*":()=>et(e,t),$:we},"/items":()=>Object.assign(Object.assign({},et(e,t)),{$:Xe,"/*":({key:r})=>"number"==typeof r?et(e,t):{}}),"/additionalProperties":()=>Object.assign(Object.assign({},et(e,t)),{$:qe}),"/additionalItems":()=>Object.assign(Object.assign({},et(e,t)),{$:Ze}),"/patternProperties":{"/*":()=>et(e,t),$:we},"/pattern":{$:Ve},"/readOnly":{$:Be},"/writeOnly":{$:Be},"/example":{$:Fe},"/examples":{$:Fe},"/deprecated":{$:Be}},"draft-04"!==e?{"/propertyNames":()=>et(e,t),"/contains":()=>et(e,t),"/dependencies":{"/*":()=>et(e,t),$:Qe},"/const":{$:Le},"/exclusiveMaximum":{$:De},"/exclusiveMinimum":{$:He},"/$defs":{"/*":()=>et(e,t),$:Fe}}:{}),{"/definitions":{"/*":()=>et(e,t),$:Fe},"/xml":{$:Fe},"/externalDocs":{$:Ne},"/description":{$:Ne},"/title":{$:Ne},"/format":{$:Ne},"/default":{$:Ne},"/?":{$:Ne}}),t),{$:_e}),tt=e=>et(e,{"/discriminator":{$:Fe},"/oneOf":{"/*":()=>tt(e),$:Ue,sibling:["discriminator"]},"/anyOf":{"/*":()=>tt(e),$:Ue,sibling:["discriminator"]}}),rt=e=>"3.0.x"===e?Object.assign(Object.assign({},tt("draft-04")),{"/items":({key:e})=>Object.assign(Object.assign({},tt("draft-04")),{$:Xe})}):tt("draft-06"),nt=e=>({"/*":{"/schema":rt(e)}}),at=e=>({"/content":{"/*":{"/schema":rt(e),"/encoding":{"/headers":nt(e)}}}}),st=e=>({"/*":{"/headers":nt(e),"/content":{"/*":{"/schema":rt(e),"/encoding":{"/headers":nt(e)}}}}}),ot=et("draft-06",{"/args":()=>ot,"/nullable":{$:Be},"/specifiedByURL":{$:Ne},"/values":{$:Fe,"/*":{$:Fe,"/description":{$:Ne},"/deprecated":{$:Ne,"/reason":{$:Ne}}}},"/interfaces":{$:Fe,"/*":{$:Fe}},"/directives":{$:Fe,"/*":()=>Object.assign(Object.assign({},ot),{"/meta":{$:Fe}})}}),it={"/queries":{"/*":()=>ot},"/mutations":{"/*":()=>ot},"/subscriptions":{"/*":()=>ot},"/components":{"/*":{"/*":ot},"/directives":{"/*":{"/args":()=>ot}}}},lt=(e,t,r)=>{const n=r.sibling||[],a=e,s=t,o=a[s],i=ie(a,["symbol"==typeof s?s:s+""]),l=((e,t)=>{const r={};for(const n of t)n in e&&(r[n]=e[n],delete e[n]);return r})(i,n);return Object.keys(i).length?Object.assign({[t]:o.map((e=>({allOf:[i,e]})))},l):e},ct=(e,t,r,n)=>{const a=[],s=Ce(t),o=[],i={pointer:s,data:"",refs:[]};for(const t of e)if(he(t)&&!o.includes(t.$ref)){""===i.data&&(i.data=JSON.stringify(e));const{$ref:s}=t,l=ie(t,["$ref"]),{filePath:c,normalized:p,pointer:u}=Oe(s),f=n.find((e=>e.refs.includes(t.$ref)&&e.data===i.data&&u!==e.pointer));if(f)return{allOfItems:[{$ref:"#"+f.pointer}],brokenRefs:o};i.refs.push(p);const d=c?void 0:je(r,u);void 0===d?(o.push(p),a.push(t)):a.push(d),Object.keys(l).length&&a.push(l)}else a.push(t);i.refs.length&&n.push(i);const l=pt(a);return l.find((e=>he(e)&&!o.includes(e.$ref)))?ct(l,t,r,n):{allOfItems:l,brokenRefs:o}},pt=e=>{const t=[];for(const r of e)if(ue(r))if(r.allOf&&Array.isArray(r.allOf)){const{allOf:e}=r,n=ie(r,["allOf"]),a=Object.keys(n).length?[...e,n]:e;t.push(...pt(a))}else t.push(r);return t},ut=e=>{if("object"!=typeof e||!e)return et();if("openapi"in e&&"string"==typeof e.openapi&&/3.+/.test(e.openapi)){return((e="3.0.x")=>({"/paths":{"/*":{"/*":{"/parameters":nt(e),"/requestBody":at(e),"/responses":st(e)},"/parameters":nt(e)}},"/components":{"/schemas":{"/*":rt(e)},"/responses":st(e),"/parameters":nt(e),"/requestBodies":{"/*":at(e)},"/headers":nt(e)}}))(e.openapi.startsWith("3.1")?"3.1.x":"3.0.x")}return"graphapi"in e&&"string"==typeof e.graphapi?it:et()},ft=(e,t)=>{var r;const n=null!==(r=null==t?void 0:t.rules)&&void 0!==r?r:ut(e);return((e,t=[],r={})=>{var n;t=Array.isArray(t)?t:[t];const a={"#":void 0},s=Object.assign({state:Object.assign(Object.assign({},null!==(n=r.state)&&void 0!==n?n:{}),{root:a,node:a})},r.rules?{rules:r.rules}:{}),[o,i]=me();return de(e,[o,...t,i],s),a["#"]})(e,dt(t),{rules:n})},dt=e=>{const t=new Map;let r=null==e?void 0:e.source;const n=[];return({value:a,key:s,path:o,rules:i,state:l})=>{o.length||(null==e?void 0:e.source)||(r=a);const c=r=>{var n;const a=mt(o);a?t.set(...a):null===(n=null==e?void 0:e.onMergeError)||void 0===n||n.call(e,"Could not merge values, they are probably incompatible",o,r)},p=()=>{const{node:e}=l,r=Ce(o);if(t.has(r)){const n=t.get(r),o=e[s];Array.isArray(o)&&(o.length<2&&c((null==a?void 0:a.allOf)||[]),o.splice(n,1))}};if(!ue(a)||Array.isArray(a))return{exitHook:p};if(!(e=>!!e&&e["/allOf"]&&"$"in e["/allOf"])(i))return{exitHook:p};const{allOf:u}=a,f=ie(a,["allOf"]),d=[];if(Array.isArray(u)&&d.push(...u),d.length)Object.keys(f).length&&d.push(f);else{const{$ref:t}=f,r=ie(f,["$ref"]);if((null==e?void 0:e.mergeRefSibling)&&t&&Object.keys(r).length>0)d.push({$ref:t},r);else if(null==e?void 0:e.mergeCombinarySibling){if(be(f)&&i["/anyOf"])return{value:lt(f,"anyOf",i["/anyOf"]),exitHook:p};if(ve(f)&&i["/oneOf"])return{value:lt(f,"oneOf",i["/oneOf"]),exitHook:p}}}if(!d.length)return{value:f,exitHook:p};const{allOfItems:m,brokenRefs:g}=ct(d,o,r,n);if(g.length)return g.forEach((t=>{var r;return null===(r=null==e?void 0:e.onRefResolveError)||void 0===r?void 0:r.call(e,"Cannot resolve $ref",o,t)})),{value:{allOf:m},exitHook:p};if(m.length<2)return{value:m.length?m[0]:{},exitHook:p};const y=_e(m,{allOfItems:m,mergeRules:i,mergeError:c});return(null==e?void 0:e.mergeCombinarySibling)&&be(y)?{value:lt(y,"anyOf",i["/anyOf"]),exitHook:p}:(null==e?void 0:e.mergeCombinarySibling)&&ve(y)?{value:lt(y,"oneOf",i["/oneOf"]),exitHook:p}:{value:y,exitHook:p}}},mt=e=>{for(let t=e.length-2;t>=0;t--)if("anyOf"===e[t]||"oneOf"===e[t]){const r=e.slice(0,t+1);return[Ce(r),e[t+1]]}},gt=["any","string","number","integer","boolean","null","array","object"],yt=["deprecated","readOnly","writeOnly","externalDocs"],ht=["type","description","title","enum","default","examples","format","const"],bt={any:[],boolean:[],null:[],string:["minLength","maxLength","pattern"],number:["multipleOf","minimum","exclusiveMinimum","maximum","exclusiveMaximum"],integer:["multipleOf","minimum","exclusiveMinimum","maximum","exclusiveMaximum"],object:["required","minProperties","maxProperties","propertyNames","properties","patternProperties","additionalProperties"],array:["minItems","maxItems","uniqueItems","items","additionalItems"]},vt={any:[...bt.any,...ht,...yt],boolean:[...bt.boolean,...ht,...yt],null:[...bt.null,...ht,...yt],string:[...bt.string,...ht,...yt],number:[...bt.number,...ht,...yt],integer:[...bt.integer,...ht,...yt],object:[...bt.object,...ht,...yt],array:[...bt.array,...ht,...yt]},Ot=["$defs","definitions","$schema","$id"];const $t=(e,t)=>{const{$ref:r}=t;oe(t,["$ref"]);const n=Oe(r);return n.filePath?void 0:je(e,n.pointer)};function jt(e){if("object"!=typeof e||!e)return[];const t=[];for(const r of Object.keys(vt)){if("integer"===r)continue;const n=bt[r];for(const a of n)if(a in e){t.push(r);break}}return t}const xt=(e,t)=>{if(!c(t))return!1;for(const r of e)if(!t.type||Array.isArray(t.type)&&t.type.includes(r)||t.type===r||"any"===r)return!0;return!1};const kt=e=>"/"+e.map((e=>String(e).replace(new RegExp("/","g"),"~1"))).join("/"),At=(e,t,r)=>{var n;return!!e&&(!!(null===(n=r[e])||void 0===n?void 0:n.find((e=>t.startsWith(e))))||!!t.startsWith(e))},Rt=(e,t)=>e===t?e:`${e}:${t}`,St=(e,t)=>he(e)?$t(t,e):e,Ct=e=>{var t;return e&&null!==(t=Oe(e).normalized)&&void 0!==t?t:""},Mt=(e,t=[],r=[])=>e.map((e=>Object.assign(Object.assign({},e),{path:[...r,...e.path.slice(t.length)]}))),Pt=(e,t,r=[])=>{const n=Object.assign({},e),a=v(n,[...r,t]),s=t,o=a[s],i=oe(a,["symbol"==typeof s?s:s+""]);return Object.keys(n).length?Object.assign(Object.assign({},Array.isArray(o)?{[t]:o.map((e=>({allOf:[e,n]})))}:n),i):e},It=(e,t=[])=>{const r=Object.assign({},e),n=v(r,[...t,"allOf"]),{allOf:a}=n,s=oe(n,["allOf"]);return Object.keys(r).length?Object.assign(Object.assign({},Array.isArray(a)?{allOf:[...a,r]}:r),s):e},wt=(e,t=[])=>{const r=Object.assign({},e),n=v(r,[...t,"$ref"]),{$ref:a}=n,s=oe(n,["$ref"]);return Object.keys(r).length?Object.assign({allOf:[{$ref:a},r]},s):e},qt=(e,t,r=[])=>{const n=Object.assign({},e),a=v(n,[...r]),s=t;a[s];const o=oe(a,["symbol"==typeof s?s:s+""]);return Object.assign(Object.assign({},o),{[t]:Object.keys(n).length?[n]:[]})},Et=(e,t="")=>{for(let r=0;r<e.length;r++)"properties"===e[r]&&r<e.length-1?t+=t?"."+String(e[++r]):String(e[++r]):"additionalProperties"===e[r]?t+="{.*}":"patternProperties"===e[r]&&r<e.length-1?t+=`{${String(e[++r])}}`:"items"===e[r]&&(r<e.length-1&&m(e[r+1])?t+=`[${e[++r]}]`:t+="[]");return t||void 0},Tt={add:"[Added] {{text}}",add_target:"[Added] {{text}} to `{{target}}`",remove:"[Removed] {{text}}",remove_target:"[Removed] {{text}} from `{{target}}`",replace:"[Replaced] {{text}}",replace_target:"[Replaced] {{text}} of `{{target}}`",rename:"[Renamed] {{text}}",rename_target:"[Renamed] {{text}} of `{{target}}`",status:"{{key}} status",validation:"{{key}} validator",annotation:"annotation ({{key}})",enum:"possible values",format:"value format",default:"default value",const:"possible value",type:"type definition",nullable:"possbile nullable value",property:"property `{{key}}`",arratItem:"array item with index `{{key}}`",patternProperty:"property with key pattern `{{key}}`",additionalProperties:"schema for additional properties",arrayItems:"schema for array items",additionalArrayItems:"schema for additional array items",oneOfItem:"oneOf schema",anyOfItem:"anyOf schema",allOfItem:"allOf schema"},_t=(e,t)=>{var r;const n=null===(r=t.rules)||void 0===r?void 0:r.annotate;return n?ee(n(e,t),Tt):""},Nt=({action:e,path:t})=>({template:e,params:{text:{template:"annotation",params:{key:t[t.length-1]}},target:Et(t)}}),Bt=({action:e,path:t})=>(t[t.length-1],Z(e,{text:Z("annotation",{key:"example"}),target:Et(t)})),Dt=({action:e,path:t})=>{const r=t[t.length-1];return Z(e,{text:Z("validation",{key:r}),target:Et(t)})},Ht=({path:e},t)=>{const r=e[e.length-1];return t.after.value?Z("add",{text:Z("status",{key:r}),target:Et(e)}):t.before.value?Z("remove",{text:Z("status",{key:r}),target:Et(e)}):void 0},Vt=({action:e,path:t})=>{const r=t[t.length-1];if(!m(r))return Z(e,{target:Et(t),text:Z(r)})},Kt=({action:e,path:t},r)=>{const n=t[t.length-1],{value:a}="add"===e?r.after:r.before,s=t.length>1?t[t.length-2]:"",o=Et(t.slice(0,-1)),i=Et(t);switch(s){case"enum":return Z("replace",{text:Z("enum"),target:i});case"properties":return d(n)?Z(e,{text:Z("property",{key:n}),target:o}):void 0;case"items":return m(n)?Z(e,{text:Z("arratItem",{key:n}),target:o}):void 0;case"patternProperties":return d(n)?Z(e,{text:Z("patternProperty",{key:n}),target:o}):void 0;case"oneOf":case"anyOf":case"allOf":return Z(e,{text:Z(`${s}Item`),target:i});case"required":return d(a)?Z(e,{text:Z("status",{key:s}),target:i?`${i}.${a}`:a}):void 0}},Lt=e=>e?S:C,Ft=({after:e})=>Lt(!!e.value),Ut=(e,t)=>{const r=Array.isArray(e)?e:[e];return r.includes("number")&&r.push("integer"),se(t,((e,{before:t,after:n},a)=>xt(r,"remove"===a?t.parent:n.parent)?e:M))},Jt=[S,C,({before:e,after:t})=>Lt(!m(e.value)||!m(t.value)||e.value>t.value)],Wt=[S,C,({before:e,after:t})=>Lt(!m(e.value)||!m(t.value)||e.value<t.value)],Gt=[Ft,C,Ft],zt=[Ft,C,Ft],Yt=[S,C,({before:e,after:t})=>Lt(!(m(e.value)&&m(t.value)&&!(e.value%t.value)))],Qt=[({after:e})=>{var t;return!d(e.value)||f(null===(t=L(e,"","properties",e.value,"default"))||void 0===t?void 0:t.value)?C:S},C,({after:e})=>{var t;return!d(e.value)||f(null===(t=L(e,"","properties",e.value,"default"))||void 0===t?void 0:t.value)?C:S}],Xt=(e,t)=>{e.before=t(e.before,e.after),e.after=t(e.after,e.before)},Zt=(e=Ot)=>(t,r)=>{if(!c(t)||!c(r))return[t,r];const n={before:t,after:r};Xt(n,(t=>"oneOf"in t?Pt(t,"oneOf",e):"anyOf"in t?Pt(t,"anyOf",e):"allOf"in t?It(t,e):"$ref"in t?wt(t,e):t));for(const t of["oneOf","anyOf"]){if(t in n.before&&!("oneOf"in n.after)&&!("anyOf"in n.after))return[n.before,qt(n.after,t,e)];if(t in n.after&&!("oneOf"in n.before)&&!("anyOf"in n.before))return[qt(n.before,t,e),n.after]}return[n.before,n.after]},er=(...e)=>(t,r)=>{if(!c(t)||!c(r))return[t,r];const n={before:Object.assign({},t),after:Object.assign({},r)};return Xt(n,((t,r)=>{for(const n of e)n in r&&c(r[n])&&!(n in t)&&(t[n]=Array.isArray(r[n])?[]:{});return t})),[n.before,n.after]},tr=(e="2020-12")=>(e,t)=>{if(!c(e)||!c(t))return[e,t];const r={before:Object.assign({},e),after:Object.assign({},t)};return Xt(r,((e,t)=>{for(const r of["enum","required","properties","patternProperties","definitions","examples"])r in t&&c(t[r])&&!(r in e)&&(e[r]=Array.isArray(t[r])?[]:{});return e})),Xt(r,((e,t)=>{if("const"in e&&"enum"in t){const{const:t}=e,r=oe(e,["const"]);return Object.assign(Object.assign({},r),{enum:[t]})}return e})),Xt(r,(e=>(Array.isArray(e.enum)&&(e.enum=e.enum.filter(((e,t,r)=>r.indexOf(e)===t))),e))),Xt(r,(e=>{if("required"in e&&Array.isArray(e.required)){const t=e.required.filter(((e,t,r)=>d(e)&&r.indexOf(e)===t));return Object.assign(Object.assign({},e),{required:t})}return e})),Xt(r,((e,t)=>"items"in t&&p(t.items)?"items"in e&&"object"==typeof e.items?p(e.items)?e:Object.assign(Object.assign({},e),{items:t.items.map((()=>e.items)),additionalItems:e.items}):Object.assign(Object.assign({},e),{items:[]}):e)),Xt(r,((e,t)=>{if(!("type"in e)&&"type"in t){const r=jt(e);r.length&&(e.type=d(t.type)&&r.includes(t.type)?t.type:r)}return e})),Xt(r,(e=>{if("exclusiveMinimum"in e&&"boolean"==typeof e.exclusiveMinimum&&"minimum"in e){const{minimum:t,exclusiveMinimum:r}=e,n=oe(e,["minimum","exclusiveMinimum"]);return Object.assign(Object.assign({},n),{exclusiveMinimum:t})}return e})),Xt(r,(e=>{if("exclusiveMaximum"in e&&"boolean"==typeof e.exclusiveMaximum&&"maximum"in e){const{maximum:t,exclusiveMaximum:r}=e,n=oe(e,["maximum","exclusiveMaximum"]);return Object.assign(Object.assign({},n),{exclusiveMaximum:t})}return e})),Xt(r,((e,t)=>{if("example"in e&&"examples"in t){const{example:t}=e,r=oe(e,["example"]),n="examples"in e&&Array.isArray(e.examples)?e.examples:[];return Object.assign(Object.assign({},r),{examples:[...n,t]})}return e})),[r.before,r.after]},rr=e=>F((t=>ft(t,{rules:et("draft-04"===e?e:"draft-06"),mergeCombinarySibling:!0,mergeRefSibling:!0}))),nr=(e,t,r)=>{const{added:n,removed:a,mapped:s}=J(e,t),o=a.findIndex((e=>"oneOf"==e||"anyOf"===e)),i=n.findIndex((e=>"oneOf"==e||"anyOf"===e));if(o<0||i<0)return{added:n,removed:a,mapped:s};const[l]=a.splice(o,1),[c]=n.splice(i,1);return s[l]=c,{added:n,removed:a,mapped:s}},ar=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=[...t],a=new Set(t.keys()),s=[];for(let t=0;t<e.length;t++){const o=n.indexOf(e[t]);o<0?s.push(t):(r.mapped[t]=o,a.delete(o))}let o=0;a.forEach((e=>{o<s.length?r.mapped[s[o++]]=e:r.added.push(e)}));for(let e=o;e<s.length;e++)r.removed.push(s[e]);return r},sr=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=[...t],a=new Set(t.keys());for(let t=0;t<e.length;t++){const s=n.indexOf(e[t]);s<0?r.removed.push(t):(r.mapped[t]=s,a.delete(s))}return a.forEach((e=>{r.added.push(e)})),r},or=e=>{const{before:t,after:n,options:a}=e,{arrayMeta:s,metaKey:o=k}=a;if(!p(t.value)||!p(n.value)){const r=H.replaced(t.path,t.value,n.value,e);return{diffs:[r],merged:n.value,rootMergeMeta:V(r)}}const i=new Set(n.value.keys()),l=new Set(t.value.keys()),c=[],u=[],f=[],d=r(e.rules,"*",t.path,t.value);for(const e of t.value.keys()){const r=t.value[e];for(const s of n.value.keys()){if(!i.has(s))continue;const o=n.value[s],{diffs:p,merged:f}=X(r,o,Object.assign(Object.assign({},a),{rules:d}),{before:{jsonPath:[...t.path,e],source:t.root},after:{jsonPath:[...n.path,s],source:n.root}});if(!p.length){i.delete(s),l.delete(e),u[s]=f;break}c.push({before:e,after:s,diffs:p,merged:f})}}c.sort(((e,t)=>e.diffs.length-t.diffs.length));for(const e of c)i.has(e.after)&&l.has(e.before)&&(i.delete(e.after),l.delete(e.before),u[e.before]=e.merged,f.push(...e.diffs));const m=[];for(const r of l.values()){u[r]=t.value[r];const n=H.removed([...t.path,r],t.value[r],z(e,r,""));m.push(n),f.push(n)}for(const t of i.values()){const r=H.added([...n.path,u.length],n.value[t],z(e,"",t));u.push(n.value[t]),m.push(r),f.push(r)}const g=K(m);return s&&(u[o]=g),Object.assign({diffs:f,merged:u},!s&&Object.keys(g).length?{rootMergeMeta:{array:g}}:{})},ir=(e={})=>{var t,r,n;e.results=null!==(t=e.results)&&void 0!==t?t:new Map,e.bRefs=null!==(r=e.bRefs)&&void 0!==r?r:{},e.aRefs=null!==(n=e.aRefs)&&void 0!==n?n:{};const{results:a,bRefs:s,aRefs:o}=e;return({before:e,after:t,rules:r,options:n})=>{var i,l;const c=kt(e.path),p=kt(t.path);let u=Rt(c,p);if(a.has(u))return a.get(u);const f=he(e.value)?Ct(e.value.$ref):"",d=he(t.value)?Ct(t.value.$ref):"";if(!f&&!d)return;if(At(f,`#${c}`,s)||At(d,`#${p}`,o))return;if(f&&(s[f]=[...null!==(i=s[f])&&void 0!==i?i:[],`#${c}`]),d&&(o[d]=[...null!==(l=o[d])&&void 0!==l?l:[],`#${p}`]),f&&d&&(u=Rt(f,d),a.has(u))){const t=a.get(u),{path:r,diffs:n}=t,s=oe(t,["path","diffs"]);return Object.assign(Object.assign({},s),{diffs:Mt(n,r,e.path)})}const m=St(e.value,e.root),g=St(t.value,t.root);if(void 0===m||void 0===g)return;const y=X(m,g,Object.assign(Object.assign({},n),{rules:r}),{before:{jsonPath:e.path,source:e.root},after:{jsonPath:t.path,source:t.root}});return f&&d&&a.set(u,Object.assign(Object.assign({},y),{path:e.path})),y}},lr={$:N,annotate:Nt},cr=(e,t)=>({$:e,annotate:t}),pr=({baseRules:e={},notMergeAllOf:t,version:r="draft-04",cache:n={}}={})=>{var a;const s=Object.assign(Object.assign(Object.assign({compare:ir(n),transform:[Zt(),tr(r)],mapping:nr,"/title":lr,"/multipleOf":cr(Ut("number",Yt),Dt),"/maximum":cr(Ut("number",Jt),Dt),"/minimum":cr(Ut("number",Wt),Dt)},"draft-04"===r?{"/exclusiveMaximum":cr(Ut("number",Gt),Dt),"/exclusiveMinimum":cr(Ut("number",Gt),Dt)}:{"/exclusiveMaximum":cr(Ut("number",Jt),Dt),"/exclusiveMinimum":cr(Ut("number",Wt),Dt)}),{"/maxLength":cr(Ut("string",Jt),Dt),"/minLength":cr(Ut("string",Wt),Dt),"/pattern":cr(Ut("string",[S,C,S]),Dt),"/maxItems":cr(Ut("array",Jt),Dt),"/minItems":cr(Ut("array",Wt),Dt),"/uniqueItems":cr(Ut("array",zt),Dt),"/maxProperties":cr(Ut("object",Jt),Dt),"/minProperties":cr(Ut("object",Wt),Dt),"/required":{mapping:sr,"/*":cr(Qt,Kt)},"/enum":{mapping:ar,annotate:Vt,"/*":{$:[C,S,S],annotate:Kt}},"/const":cr([S,C,S],Vt),"/type":{$:[S,C,S],annotate:Vt,"/*":{$:[C,S,S]}},"/not":()=>Object.assign(Object.assign({},te(s,re)),{$:q}),"/allOf":{compare:or,"/*":()=>Object.assign(Object.assign({},s),{$:q,annotate:Kt})},"/oneOf":{compare:or,"/*":()=>Object.assign(Object.assign({},s),{$:[C,S,S],annotate:Kt})},"/anyOf":{compare:or,"/*":()=>Object.assign(Object.assign({},s),{$:[C,S,S],annotate:Kt})},"/items":({value:e})=>((e,t)=>Array.isArray(e)?{"/*":()=>Object.assign(Object.assign({},t),{$:q,annotate:Kt})}:Object.assign(Object.assign({},t),{$:w,annotate:Vt}))(e,s),"/additionalItems":()=>Object.assign(Object.assign({},s),{$:[C,S,M],annotate:Vt}),"/properties":{"/*":()=>Object.assign(Object.assign({},s),{$:[C,S,M],annotate:Kt})},"/additionalProperties":()=>Object.assign(Object.assign({},s),{$:w,annotate:Vt}),"/patternProperties":{"/*":()=>Object.assign(Object.assign({},s),{$:[S,C,M],annotate:Kt})},"/propertyNames":()=>Object.assign(Object.assign({},s),{$:E,annotate:Dt}),"/description":lr,"/format":{$:[S,C,S],annotate:Vt},"/default":{$:[C,S,S],annotate:Vt},"/definitions":{"/*":()=>Object.assign(Object.assign({},s),{$:w})},"/$defs":{"/*":()=>Object.assign(Object.assign({},s),{$:w})},"/readOnly":{$:zt,annotate:Ht},"/writeOnly":{$:zt,annotate:Ht},"/deprecated":{$:B,annotate:Ht},"/examples":{$:N,annotate:Nt,"/*":{$:N,annotate:Bt}},"/**":{annotate:Nt,$:_}}),e);return t?s:Object.assign(Object.assign({},s),{transform:[...null!==(a=s.transform)&&void 0!==a?a:[],rr(r)]})},ur=(e,t,r={},n={})=>{var a,s;const o=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:pr({notMergeAllOf:r.notMergeAllOf}),annotateHook:null!==(s=r.annotateHook)&&void 0!==s?s:_t});return X(e,t,o,n)},fr=e=>{const t=e.indexOf("args");return 2===t||t>3&&"properties"===e[t-2]&&"properties"!==e[t-1]||t>2&&"directives"===e[t-2]&&"directives"!==e[t-1]},dr={add:"[Added] {{text}} to Argument `{{target}}`",add_target:"[Added] {{text}} to Argument `{{target}}`",add_target_schema:"[Added] {{text}} to Argument `{{target}}` of property `{{schema}}(...)`",add_target_directive:"[Added] {{text}} to Argument `{{target}}` of directive `@{{directive}}(...)`",remove:"[Removed] {{text}} from Argument {{target}}",remove_target:"[Removed] {{text}} from Argument `{{target}}`",remove_target_schema:"[Removed] {{text}} from Argument `{{target}}` of property `{{schema}}(...)`",remove_target_directive:"[Removed] {{text}} from Argument `{{target}}` of directive `@{{directive}}(...)`",replace:"[Replaced] {{text}} of Argument {{target}}",replace_target:"[Replaced] {{text}} of Argument `{{target}}`",replace_target_schema:"[Replaced] {{text}} of Argument `{{target}}` of property `{{schema}}(...)`",replace_target_directive:"[Replaced] {{text}} of Argument `{{target}}` of directive `@{{directive}}(...)`"},mr=Object.assign(Object.assign({},Tt),{directive:"directive `@{{key}}`",directive_definition:"difinition for directive `@{{key}}`",directive_meta:"directive meta `@{{key}}({{meta}})`",values_annotation:"possible values annotation ({{key}})",values_status:"possible values {{key}} status"}),gr=(e,t)=>{var r;let n=null===(r=t.rules)||void 0===r?void 0:r.annotate;if(!n||"components"===e.path[0]&&"directives"!==e.path[1])return"";if(fr(e.path)){const r=e.path.indexOf("args"),a=Object.assign(Object.assign({},e),{path:e.path.slice(r)}),s=Et(e.path.slice(0,r)),o="directives"===e.path[1]?e.path[2]:void 0,i=n(a,t);if(!i)return"";const l=Object.assign(Object.assign({},i),{params:Object.assign(Object.assign({},i.params),{schema:s,directive:o})});return ee(l,Object.assign(Object.assign({},mr),dr))}return ee(n(e,t),mr)},yr=({path:e,action:t},r)=>{const n=e[e.length-1],a=Et(e.slice(0,-4));switch(n){case"description":return Z(t,{text:Z("values_annotation",{key:n}),target:a});case"deprecated":return Z(t,{text:Z("values_status",{key:n}),target:a});case"reason":return Z(t,{text:Z("values_annotation",{key:"deprecation reason"}),target:a})}},hr=({path:e,action:t},r)=>{const n=e[e.length-1],a=e[e.length-2],s=Et(e);switch(a){case"directives":return Z(t,{text:Z("directive",{key:n,definition:"components"===e[0]?1:void 0}),target:s});case"deprecated":return Z(t,{text:Z("reason",{key:n}),target:s});case"meta":return Z(t,{text:Z("directive",{key:e[e.length-3],meta:n}),target:Et(e.slice(0,-4))})}},br={ScalarTypeDefinition:"scalars",ObjectTypeDefinition:"objects",InterfaceTypeDefinition:"interfaces",InputObjectTypeDefinition:"inputObjects",DirectiveDefinition:"directives",UnionTypeDefinition:"unions",EnumTypeDefinition:"enums"},vr={query:"query",mutation:"mutation",subscription:"subscription"},Or=["args","values","interfaces","directives"],$r=F(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);for(const n of Object.values(br))!(n in e)&&n in t&&(r[n]={});return r})),jr=F(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);for(const n of Or)if(!(n in e)&&n in t&&(r[n]={}),"values"===n&&n in t){const e=t[n];for(const t of Object.keys(e))t in r[n]||(r[n][t]={})}return"nullable"in e&&!e.nullable&&delete r.nullable,r})),xr=F(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;if("meta"in e){const{meta:t}=e;return oe(e,["meta"]),{meta:t}}return"meta"in t?{meta:{}}:{}})),kr=F(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);for(const n of Object.values(vr))!(n in e)&&n in t&&(r[n]={});return r})),Ar=F(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);return!("args"in e)&&"args"in t&&(r.args={type:"object",properties:{}}),!("locations"in e)&&"locations"in t&&(r.locations=[]),r})),Rr=F((e=>ft(e,{rules:it,mergeCombinarySibling:!0,mergeRefSibling:!0}))),Sr=(e=!1)=>{const t=pr({notMergeAllOf:!0,baseRules:{transform:[Zt(),tr(),jr],"/nullable":{$:[C,S,C],annotate:Vt},"/specifiedByURL":{$:N},"/args":()=>Object.assign({},Sr()),"/values":{"/*":{"/description":{annotate:yr,$:N},"/deprecated":{annotate:yr,$:B,"/reason":{annotate:yr,$:B}}}},"/deprecated":{$:B,annotate:Ht,"/reason":{annotate:hr,$:B}},"/interfaces":{"/*":{$:N}},"/directives":{"/*":{annotate:hr,transform:[xr],"/meta":{"/*":{annotate:hr,$:N}}}}}});return e?te(t,re):t},Cr=({notMergeAllOf:e=!1}={})=>{const t=Sr(),r=Sr(!0);return{transform:[...e?[]:[Rr],kr],"/queries":{"/*":r},"/mutations":{"/*":r},"/subscriptions":{"/*":r},"/components":{transform:[$r],"/*":{"/*":r},"/directives":{"/*":{annotate:hr,transform:[Ar],$:T,"/title":{$:N},"/description":{$:N},"/locations":{mapping:ar,$:N},"/repeatable":{$:N},"/args":t}}}}},Mr=(e,t,r={},n={})=>{var a,s;const o=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:Cr(),annotateHook:null!==(s=r.annotateHook)&&void 0!==s?s:gr});return X(e,t,o,n)},Pr=e=>!!Array.isArray(e)&&(!!e&&(0===e.length||1===e.length&&0===Object.keys(e[0]).length)),Ir=(e=[],t=[])=>{if(!Array.isArray(e)||!Array.isArray(t))return!1;const r=new Set(e.map((e=>Object.keys(e)[0])));for(const e of t)if(!r.has(Object.keys(e)[0]))return!1;return!0},wr=({before:e,after:t})=>{if("string"!=typeof e.path[1]||"string"!=typeof t.path[1])return{};const r=[...e.path[1].matchAll(new RegExp("{(.*?)}","g"))].map((e=>e.pop())),n=[...t.path[1].matchAll(new RegExp("{(.*?)}","g"))].map((e=>e.pop())),a={};for(let e=0;e<r.length&&e<n.length;e++)a[r[e]]=n[e];return a},qr=e=>{switch(e){case"query":case"cookie":return"form";case"path":case"header":return"simple"}},Er=e=>"responses"===e[3]&&"schema"===e[7],Tr=e=>"requestBody"===e[3]&&"schema"===e[6],_r=e=>"parameters"===e[2]&&"schema"===e[4]||"parameters"===e[3]&&"schema"===e[5],Nr=(e,t)=>{if(!(a(e)&&a(t)&&"openapi"in e&&"openapi"in t))return;return(e.openapi>t.openapi?e.openapi:t.openapi).startsWith("3.1")?"3.1.x":"3.0.x"},Br=[({after:e})=>"form"===e.value?P:S,({before:e})=>"form"===e.value?P:S,S],Dr=[({after:e})=>e.value&&"form"===O(e.parent,"style")||!e.value&&"form"!==O(e.parent,"style")?P:S,({before:e})=>e.value&&"form"===O(e.parent,"style")||!e.value&&"form"!==O(e.parent,"style")?P:S,S],Hr=[C,S,({before:e})=>"path"===O(e.parent,"in")?C:S],Vr=[S,C,e=>O(e.after.parent,"schema","default")?C:Ft(e)],Kr=[S,C,({before:e,after:t})=>{var r;const n=L(e,""),a=null!==(r=O(null==n?void 0:n.value,"style"))&&void 0!==r?r:"form";return"query"===O(null==n?void 0:n.value,"in")&&"form"===a?"object"===e.value||"array"===e.value||"object"===t.value?S:C:S}],Lr=[({after:e})=>O(e.value,"required")&&!f(O(e.value,"schema","default"))?S:C,S,M],Fr=[({after:e})=>Pr(e.value)?C:S,C,({after:e,before:t})=>Ir(e.value,t.value)||Pr(e.value)?C:S],Ur=[({before:e})=>u(e.parent)?C:S,({after:e})=>u(e.parent)?C:S,({after:e,before:t})=>Ir(e.parent,t.parent)||Pr(e.value)?C:S],Jr=[({before:e,after:t})=>Pr(t.value)||Ir(t.value,O(e.root,"security"))?C:S,({before:e,after:t})=>Ir(O(t.root,"security"),e.value)?C:S,({before:e,after:t})=>Ir(t.value,e.value)||Pr(t.value)?C:S],Wr=[({before:e})=>u(e.parent)?C:S,({after:e})=>u(e.parent)?S:C,({before:e,after:t})=>Ir(t.parent,e.parent)||Pr(t.value)?C:S],Gr={requestBodySchema:"{{schemaChange}} in Request Body content ({{contentType}})",responseSchema:"{{schemaChange}} in Response {{responseCode}} content ({{contentType}})",parameterSchema:"{{schemaChange}} in {{in}} parameter `{{name}}`",add:"[Added] {{text}}",add_target:"[Added] {{text}} to {{target}}",remove:"[Removed] {{text}}",remove_target:"[Removed] {{text}} from {{target}}",replace:"[Replaced] {{text}}",replace_target:"[Replaced] {{text}} of {{target}}",rename:"[Renamed] {{text}}",rename_target:"[Renamed] {{text}} of {{target}}",param:"{{in}} parameter `{{name}}`",param_required:"required {{in}} parameter `{{name}}`",status:"{{key}} status",method:"operation {{method}} {{path}}",annotation:"annotation ({{key}})",security:"some security details",document:"document metadata ({{key}})",requestBody:"Request Body",requestBody_contentType:"Request Body content ({{contentType}})",response:"Response {{responseCode}}",response_contentType:"Response {{responseCode}} content ({{contentType}})",contentType:"Content type",encoding:"Encoding details",encoding_key:"Encoding details ({{key}})"},zr=(e,t)=>{var r;let n=null===(r=t.rules)||void 0===r?void 0:r.annotate;if(!n||"components"===e.path[0])return"";if(Er(e.path)){const r=ee(n(e,t),Tt);n=()=>Z("responseSchema",{schemaChange:r,responseCode:e.path[4],contentType:e.path[6]})}else if(Tr(e.path)){const r=ee(n(e,t),Tt);n=()=>Z("requestBodySchema",{schemaChange:r,contentType:e.path[5]})}else if(_r(e.path)){const r=ee(n(e,t),Tt),{root:a}="add"===e.action?t.after:t.before,s=e.path.slice(0,"parameters"===e.path[2]?4:5),o=j(a,...s);n=()=>Z("parameterSchema",Object.assign(Object.assign({},St(o,a)),{schemaChange:r}))}return ee(n(e,t),Gr)},Yr=({action:e,path:t})=>Z(e,{text:Z("method",{path:t[1],method:String(t[2]).toUpperCase()})}),Qr=({action:e,path:t})=>Z(e,{text:Z("document",{key:t.join(".")})}),Xr=({action:e})=>Z(e,{text:Z("security")}),Zr=({path:e,action:t})=>{const r=e[e.length-1];return Z(t,"required"===r||"deprecated"===r?{text:Z("status",{key:r}),target:Z("requestBody")}:{text:Z("annotation",{key:r}),target:Z("requestBody")})},en=({path:e,action:t})=>{const r=e[4],n=e[e.length-1];return Z(t,r===n?{text:Z("response",{responseCode:r})}:{text:Z("annotation",{key:n}),target:Z("response",{responseCode:r})})},tn=({path:e,action:t},r)=>{const n=Er(e)?e[6]:e[5],a=Er(e)?e[4]:void 0,s=Er(e)?Z("response",{contentType:n,responseCode:a}):Z("requestBody",{contentType:n}),o=e[e.length-1];return Z(t,n&&n!==o?{text:Z("annotation",{key:o}),target:s}:{text:Z("contentType"),target:s})},rn=({path:e,action:t},r)=>{const n=Er(e)?e[6]:e[5],a=Er(e)?e[4]:void 0,s=Er(e)?Z("response",{contentType:n,responseCode:a}):Z("requestBody",{contentType:n}),o=(Er(e)?e.slice(8):e.slice(7)).join(".");return Z(t,{text:Z("encoding",{key:o}),target:s})},nn=({path:e,action:t},r)=>{const{key:n}="add"===t?r.after:r.before;if("deprecated"===n)return r.after.value?Z("add",{text:Z("status",{key:n})}):r.before.value?Z("remove",{text:Z("status",{key:n})}):void 0;if("requestBody"===n)return Z(t,{text:Z(n)});if("number"==typeof n){const{value:n}="add"===t?r.after:r.before;return Z(t,{text:Z("annotation",{key:`${e[e.length-2]}: ${n}`})})}return Z(t,{text:Z("annotation",{key:n})})},an=({action:e},t)=>{const{path:r,root:n,key:a}="add"===e?t.after:t.before,s=r.slice(0,"parameters"===r[2]?4:5),o=j(n,...s),i=St(o,n);return Z(e,"required"===a||"deprecated"===a?{text:Z("status",{key:a}),target:Z("param",i)}:{text:Z("param",i)})},sn=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=h(e),a=n.map((e=>e.replace(new RegExp("{.*?}","g"),"*"))),s=h(t),o=s.map((e=>e.replace(new RegExp("{.*?}","g"),"*"))),i=new Set(s.keys());for(let e=0;e<n.length;e++){const t=o.indexOf(a[e]);t<0?r.removed.push(n[e]):(r.mapped[n[e]]=s[t],i.delete(t))}return i.forEach((e=>r.added.push(s[e]))),r},on=(e,t,r)=>{var n;const a={added:[],removed:[],mapped:{}},s=wr(r),o=new Set(t.keys()),i=e.map((e=>St(e,r.before.root))),l=t.map((e=>St(e,r.after.root)));for(let t=0;t<i.length;t++){const r=$(e[t],"in"),i=null!==(n=$(e[t],"name"))&&void 0!==n?n:"",c=l.findIndex((e=>{var t;const n=$(e,"in"),a=null!==(t=$(e,"name"))&&void 0!==t?t:"";return r===n&&(i===a||"path"===r&&s[i]===a)}));c<0?a.removed.push(t):(a.mapped[t]=c,o.delete(c))}return o.forEach((e=>a.added.push(e))),a},ln=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=h(e),a=n.map((e=>{var t;return null!==(t=e.split(";")[0])&&void 0!==t?t:""})),s=h(t),o=s.map((e=>{var t;return null!==(t=e.split(";")[0])&&void 0!==t?t:""})),i=new Set(s.keys());for(let e=0;e<n.length;e++){const t=o.findIndex((t=>{const[r,n]=t.split("/"),[s,o]=a[e].split("/");return(r===s||"*"===r||"*"===s)&&(n===o||"*"===n||"*"===o)}));t<0||!i.has(t)?r.removed.push(n[e]):(r.mapped[n[e]]=s[t],i.delete(t))}return i.forEach((e=>r.added.push(s[e]))),r},cn=F((e=>{if(!c(e))return e;const t=["get","put","post","delete","options","head","patch","trace"],r=h(e).reduce(((r,n)=>(t.includes(n)||(r[n]=e[n]),r)),{});if(!h(r).length)return e;const n={};for(const a of t){if(!l(e,a)||"object"!=typeof e[a]||!e[a])continue;const t=Object.assign({},e[a]),{parameters:s,servers:o}=r,i=oe(r,["parameters","servers"]);s&&Array.isArray(s)&&("parameters"in t&&Array.isArray(t.parameters)?t.parameters=[...t.parameters,...s]:t.parameters=s),o&&Array.isArray(o)&&("servers"in t&&Array.isArray(t.servers)?t.servers=[...t.servers,...o]:t.servers=o);for(const e of h(i))l(t,e)||(t[e]=i[e]);n[a]=t}return n})),pn=F(((e,t)=>{if(!c(e)||!c(t))return e;const r=Object.assign({},e);return!("tags"in e)&&"tags"in t&&(r.tags=[]),"deprecated"in r&&!r.deprecated&&delete r.deprecated,r})),un=(e,t)=>{if(!c(e)||!c(t))return[e,t];const{added:r,removed:n}=sn(e,t);return[r.reduce(((e,t)=>b(e,t,{[t]:{}})),Object.assign({},e)),n.reduce(((e,t)=>b(e,t,{[t]:{}})),Object.assign({},t))]},fn=F(((e,t)=>{if(!c(e)||!c(t))return e;const r=Object.assign({},e);if("in"in e&&!("style"in e)&&"style"in t){const t=qr(e.in);t&&(r.style=t)}return"style"in r&&"explode"in e&&"explode"in t&&"form"===r.style&&(r.explode=!0),"deprecated"in r&&!r.deprecated&&delete r.deprecated,"required"in r&&!r.required&&delete r.required,r})),dn=F(((e,t)=>(c(e)&&c(t),e))),mn=(e={})=>{const t="3.0.x"===e.version?"draft-04":"2020-12",r=pr({baseRules:{transform:[Zt([...Ot,"discriminator"]),tr(t),dn],"/nullable":{$:zt,annotate:Vt},"/discriminator":{$:_,annotate:Nt},"/example":{$:N,annotate:Nt},"/externalDocs":{$:N,annotate:Nt,"/*":{$:N}},"/xml":{}},notMergeAllOf:e.notMergeAllOf,version:t});return e.response?te(r,re):r},gn=e=>({$:e,annotate:an}),yn={$:N,annotate:Qr},hn={$:N,annotate:nn},bn=(e={})=>{const t=mn(e),r=mn(Object.assign(Object.assign({},e),{response:!0})),n=ir(),a={$:N,"/**":{$:N},"/*":{"/variables":{"/*":{"/enum":{mapping:ar}}}}},s={"/*":{annotate:an,compare:n,transform:[fn],$:Lr,"/name":gn(Hr),"/in":gn([C,S,S]),"/schema":()=>Object.assign(Object.assign({},t),{$:q,"/type":Object.assign(Object.assign({},t["/type"]),{$:Kr})}),"/explode":gn(Dr),"/style":gn(Br),"/description":gn(N),"/required":gn(Vr),"/deprecated":gn(B)}},o={$:[C,S,S],"/*":{$:[C,S,S],compare:n,"/description":{$:N},"/required":{$:[S,C,Ft]},"/deprecated":{$:B}}},i={annotate:tn,$:[C,S,S],mapping:ln,"/*":{annotate:tn,"/*":{annotate:tn},$:[C,S,C],"/schema":({path:e})=>Object.assign(Object.assign({},Er(e)?r:t),{$:q}),"/example":{$:N},"/examples":{$:N,compare:n},"/encoding":{annotate:rn,$:[S,C,S],"/*":{"/contentType":{$:[C,S,S]},"/headers":o,"/style":{$:[C,S,S]},"/explode":{$:[C,S,S]},"/allowReserved":{$:[C,S,S]}},"/**":{annotate:rn}}}},l={"/*":{annotate:Zr},$:[C,S,S],compare:n,"/description":{$:N},"/content":i,"/required":{$:[S,C,Ft]}},c={$:[C,S,S],mapping:W,"/*":{annotate:en,"/*":{annotate:en},$:[C,S,S],compare:n,"/description":{$:N},"/headers":o,"/content":i}};return{"/openapi":yn,"/info":Object.assign(Object.assign({},yn),{"/**":yn}),"/servers":a,"/paths":{transform:[un],mapping:sn,"/*":{$:[M,M,C],transform:[cn],compare:n,"/summary":{$:N},"/description":{$:N},"/*":{annotate:Yr,$:[C,S,M],transform:[pn],"/*":hn,"/tags":Object.assign(Object.assign({},hn),{mapping:ar,"/*":hn}),"/parameters":Object.assign(Object.assign({},s),{$:[C,S,S],mapping:on}),"/requestBody":l,"/callbacks":{"/*":{compare:n}},"/responses":c,"/deprecated":{$:B},"/security":{"/**":{annotate:Xr},$:Jr,"/*":{$:Wr,"/*":{$:T,mapping:ar,"/*":{$:T}}}},"/servers":a},"/servers":a,"/parameters":Object.assign(Object.assign({},s),{$:[C,S,S],mapping:on})}},"/components":{$:w,"/schemas":{$:[C,S,S],"/*":()=>Object.assign(Object.assign({},t),{$:T})},"/responses":{$:[C,S,S],"/*":c},"/parameters":{$:[C,S,S],"/*":s},"/examples":{$:N},"/requestBodies":{$:[C,S,S],"/*":l},"/headers":o,"/securitySchemes":{$:[S,C,S],"/*":{$:[S,C,S],"/type":{$:[S,C,S]},"/description":{$:N},"/name":{$:[S,C,S]},"/in":{$:[S,C,S]},"/scheme":{$:[S,C,S]},"/bearerFormat":{$:N},"/flows":{$:[S,C,S]},"/openIdConnectUrl":{$:N}}}},"/security":{$:Fr,"/*":{$:Ur}},"/tags":{$:N},"/externalDocs":{$:N}}},vn=(e,t,r={},n={})=>{var a,s;const{notMergeAllOf:o}=r,i=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:bn({notMergeAllOf:o}),version:Nr(e,t),annotateHook:null!==(s=r.annotateHook)&&void 0!==s?s:zr});return X(e,t,i,n)},On=e=>{var t;return"object"==typeof e&&e?/3.+/.test(null!==(t=e.openapi)&&void 0!==t?t:"")?vn:(null==e?void 0:e.graphapi)?Mr:ur:ur},$n=(e,t)=>{if(!(c(e)&&c(t)&&"asyncapi"in e&&"asyncapi"in t))return;const r=String(e.asyncapi).charAt(0);return r===String(t.asyncapi).charAt(0)?`${r}.x`:""},jn=()=>{const e=te(pr(),re),t=pr(),r=ir(),n={$:T,"/location":{$:T},"/description":{$:N}},a={$:_,"/*":{$:_,compare:r,"/*":{$:_},"/query":()=>e,"/headers":()=>t}},s={transform:[er("tags","traits","bindings","examples")],"/summary":{$:N},"/tags":{$:N},"/externalDocs":{$:N},"/bindings":a},o=Object.assign({$:T,"/*":{$:T},"/operationId":{$:N},"/description":{$:N}},s),i=Object.assign({$:T,"/*":{$:T},"/headers":{$:_},"/correlationId":n,"/schemaFormat":{$:q},"/contentType":{$:T},"/name":{$:w},"/title":{$:w},"/examples":{$:N}},s),l=(r=!1)=>Object.assign({$:q,"/headers":{$:_},"/correlationId":n,"/schemaFormat":{$:q},"/contentType":{$:T},"/name":{$:w},"/title":{$:N},"/description":{$:N},"/examples":{$:N},"/traits":i,"/payload":()=>Object.assign(Object.assign({},r?e:t),{$:q})},s),c=(e=!1)=>Object.assign({$:T,"/operationId":{$:N},"/description":{$:N},"/traits":o,"/message":l(e)},s),p={$:N,"/version":{$:N},"/termsOfService":{$:N},"/license":{$:N,"/name":{$:N},"/url":{$:N}},"/title":{$:N},"/description":{$:N},"/contact":{$:N,"/name":{$:N},"/url":{$:N},"/email":{$:N}}},u={$:N,"/*":{compare:r,transform:[er("variables","bindings","security")],$:N,"/url":{$:N},"/description":{$:N},"/protocol":{$:N},"/protocolVersion":{$:N},"/variables":{$:N,"/*":{compare:r,$:N,"/enum":{$:N,"/*":{$:N}},"/default":{$:N},"/description":{$:N},"/examples":{$:N}}},"/security":{$:N,"/*":{$:N}},"/bindings":a}},f={compare:r,transform:[er("parameters","bindings")],$:T,"/description":{$:N},"/bindings":a,"/subscribe":c(!0),"/publish":c(!1),"/parameters":{$:q,"/*":{compare:r,$:T,"/description":{$:N},"/schema":()=>Object.assign(Object.assign({},t),{$:q}),"/location":{$:q}}}};return{transform:[er("channels","components","tags","servers")],"/asyncapi":{$:N},"/id":{$:N},"/defaultContentType":{$:q},"/info":p,"/servers":u,"/channels":{$:T,"/*":f},"/components":{"/*":{$:N}},"/tags":{$:N},"/externalDocs":{$:N}}};return e.ClassifierType=R,e.DIFF_META_KEY=k,e.DiffAction=A,e.addNonBreaking=T,e.allAnnotation=N,e.allBreaking=q,e.allDeprecated=B,e.allNonBreaking=w,e.allUnclassified=_,e.annotation=P,e.annotationTemplate=Z,e.apiCompare=(e,t,r={})=>On(e)(e,t,r),e.apiDiff=(e,t,r={})=>{const n=On(e),{diffs:a}=n(e,t,r);return a},e.apiMerge=(e,t,r={})=>{const n=On(e),{merged:a}=n(e,t,r);return a},e.arrayMappingResolver=U,e.asyncApi2Rules=jn,e.booleanClassifier=zt,e.breaking=S,e.breakingIf=Lt,e.breakingIfAfterTrue=Ft,e.buildPath=kt,e.caseInsensitiveKeyMappingResolver=W,e.changeDiffsPath=Mt,e.combinaryCompareResolver=or,e.compare=X,e.compareAsyncApi=(e,t,r={},n={})=>{var a;const s=$n(e,t);if("2.x"!==s)throw new Error(`Unsupported version: ${s}`);const o=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:jn()});return X(e,t,o,n)},e.compareGraphApi=Mr,e.compareJsonSchema=ur,e.compareOpenApi=vn,e.compareTransformationFactory=F,e.contentChangeAnnotation=tn,e.contentMediaTypeMappingResolver=ln,e.convertDiffToMeta=V,e.createAnnotation=ee,e.createChildContext=z,e.createContext=G,e.createDiff=D,e.createEmptyCombiner=qt,e.createFields=er,e.createMergeMeta=K,e.createRefsCompareResolver=ir,e.deprecated=I,e.diffFactory=H,e.discoverCompareEngine=On,e.documentChangeAnnotation=Qr,e.emptySecurity=Pr,e.encodingChangeAnnotation=rn,e.enumMappingResolver=ar,e.excludeKeys=v,e.exclusiveClassifier=Gt,e.filterObj=(e,t)=>{const r={};for(const n of h(e))t(n,e)&&(r[n]=e[n]);return r},e.getArrayValue=(e,...t)=>{const r=O(e,...t);return Array.isArray(r)?r:void 0},e.getAsyncApiVersion=$n,e.getBooleanValue=(e,...t)=>{const r=O(e,...t);return"boolean"==typeof r?r:"string"!=typeof r||"true"!==r&&"false"!==r?void 0:Boolean(r)},e.getCompareId=Rt,e.getDefaultStyle=qr,e.getKeyValue=O,e.getMaxOpenApiVersion=Nr,e.getNumberValue=(e,...t)=>{const r=O(e,...t);return"number"==typeof r?r:"string"==typeof r&&+r?+r:void 0},e.getObjectValue=j,e.getParentContext=L,e.getRef=Ct,e.getStringValue=$,e.getTarget=Et,e.globalSecurityClassifyRule=Fr,e.globalSecurityItemClassifyRule=Ur,e.graphApiAnnotateHook=gr,e.graphApiComponents=br,e.graphApiMergeAllOf=Rr,e.graphApiOperations=vr,e.graphApiRules=Cr,e.graphApiSchemaRules=Sr,e.graphSchemaCustomProps=Or,e.includeSecurity=Ir,e.inferTypes=jt,e.isAllOfNode=function(e){return e&&e.allOf&&Array.isArray(e.allOf)},e.isArgSchema=fr,e.isArray=p,e.isCycleRef=At,e.isExist=f,e.isFunc=g,e.isKey=l,e.isNotEmptyArray=u,e.isNumber=m,e.isObject=c,e.isParameterSchema=_r,e.isRequestBodySchema=Tr,e.isResponseSchema=Er,e.isString=d,e.isValidSchemaTypes=xt,e.isValidType=e=>"string"==typeof e&&gt.includes(e),e.joinPath=x,e.jsonSchemaAllowedSibling=Ot,e.jsonSchemaAnnotationHook=_t,e.jsonSchemaAnnotations=Tt,e.jsonSchemaCommonProps=ht,e.jsonSchemaDefinitionsPath=["$defs","definitions"],e.jsonSchemaKeyChange=Vt,e.jsonSchemaMappingResolver=nr,e.jsonSchemaMergeAllOf=rr,e.jsonSchemaNodeMetaProps=yt,e.jsonSchemaRules=pr,e.jsonSchemaTypeProps=vt,e.jsonSchemaTypes=gt,e.jsonSchemaValidators=bt,e.mapPathParams=wr,e.maxClassifier=Jt,e.mergeAllOfSibling=It,e.mergeCombinarySibling=Pt,e.mergeRefSibling=wt,e.minClassifier=Wt,e.multipleOfClassifier=Yt,e.nonBreaking=C,e.objectKeys=h,e.objectMappingResolver=J,e.onlyAddBreaking=E,e.openApi3AnnotateHook=zr,e.openApiSchemaRules=mn,e.openapi3Rules=bn,e.operationChangeAnnotation=nn,e.operationSecurityChangeAnnotation=Xr,e.operationSecurityClassifyRule=Jr,e.operationSecurityItemClassifyRule=Wr,e.paramClassifyRule=Lr,e.paramMappingResolver=on,e.paramSchemaTypeClassifyRule=Kr,e.parameterChangeAnnotation=an,e.parameterExplodeClassifyRule=Dr,e.parameterNameClassifyRule=Hr,e.parameterRequiredClassifyRule=Vr,e.parameterStyleClassifyRule=Br,e.parentKeyChangeAnnotation=hr,e.pathMappingResolver=sn,e.pathMethodChangeAnnotation=Yr,e.requestBodyChangeAnnotation=Zr,e.requiredItemClassifyRule=Qt,e.requiredMappingResolver=sr,e.resolveRef=St,e.resolveRefNode=$t,e.responseChangeAnnotation=en,e.reverseClassifyRule=ae,e.reverseClassifyRuleTransformer=re,e.schemaAnnotationChange=Nt,e.schemaExampleChange=Bt,e.schemaKeyItemChange=Kt,e.schemaStatusChange=Ht,e.schemaValidationChange=Dt,e.setKeyValue=b,e.transformClassifyRule=se,e.transformComapreRules=te,e.transformGraphApiComponents=$r,e.transformGraphApiDirective=Ar,e.transformGraphApiDocument=kr,e.transformGraphSchema=jr,e.transformJsonSchema=tr,e.transformJsonSchemaCombiners=Zt,e.transformOpenApiSchema=dn,e.transformOperation=pn,e.transformParameterItem=fn,e.transformPathItems=cn,e.transformPaths=un,e.transfromGraphSchemaDirective=xr,e.typeClassifier=Ut,e.typeOf=y,e.unclassified=M,e.unwrapArrayOrNull=function(e){return Array.isArray(e)?e:null},e.unwrapStringOrNull=function(e){return"string"==typeof e?e:null},e.valuesAnnotationChange=yr,e.valuesTransformation=Xt,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
var ApiSmartDiff=function(e){"use strict";function t(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}const r=(e={},t,r,n)=>{const a=`/${t}`,s="function"==typeof e["/**"]?e["/**"]({key:t,path:r,value:n}):e["/**"],o="function"==typeof e["/*"]?e["/*"]({key:t,path:r,value:n}):e["/*"];let i={};if(a in e)i=e[a];else if(!s&&!o)return;return i="function"==typeof i?i({key:t,path:r,value:n}):i,o&&(i=Object.assign(Object.assign({},o),i)),s?Object.assign(Object.assign({"/**":e["/**"]},s),i):i},n=e=>{const t={},r=e.reduce(((e,t)=>(Object.keys(t).forEach((t=>e.add(t))),e)),new Set);for(const a of r.keys()){const r=e.filter((e=>a in e));if(1!==r.length){if("/"!==a.charAt(0))throw new Error(`Cannot merge rules. Duplicate key: ${a}. Rules should not have same Rule key`);t[a]=(e,t)=>{const s=r.map((r=>"function"==typeof r[a]?r[a](e,t):r[a]));return n(s)}}else t[a]=r[0][a]}return t},a=e=>"object"==typeof e&&null!==e,s=e=>Array.isArray(e),o=(e,o,i={})=>{var l,c;o=s(o)?o:[o];const p=s(i.rules)?n(i.rules):i.rules,u=[{data:e,state:i.state,path:[],keys:[],keyIndex:-1,rules:p}];for(;u.length>0;){const e=u[u.length-1];if(e.keyIndex>=e.keys.length){for(;null===(l=e.hooks)||void 0===l?void 0:l.length;)e.hooks.pop()();u.pop();continue}const n=e.keys[e.keyIndex++],[i,f,d]=u.length>1?[e.data[n],[...e.path,n],r(e.rules,n,[...e.path,n],e.data[n])]:[e.data,e.path,p];let m={value:i,path:f,key:n,state:e.state,rules:d};const g=[];for(const e of o){if(!e||"function"!=typeof e)continue;const r=null!==(c=e(m))&&void 0!==c?c:{},{terminate:n,done:a,exitHook:s}=r,o=t(r,["terminate","done","exitHook"]);if(n)return;if(s&&g.push(s),m=Object.assign(Object.assign({},m),o),a){m=null;break}}if(m&&a(m.value)){const e=s(m.value)?[...m.value.keys()]:Object.keys(m.value);u.push({hooks:g,state:m.state,data:m.value,path:f,keys:e,keyIndex:0,rules:m.rules})}else for(;g.length;)g.pop()()}},i=(e,t=[],r={})=>{var n;t=Array.isArray(t)?t:[t];const s={"#":void 0},i=Object.assign({state:Object.assign(Object.assign({},null!==(n=r.state)&&void 0!==n?n:{}),{root:s,node:s})},r.rules?{rules:r.rules}:{}),[l,c]=(()=>{const e=new WeakMap;let t;return[({value:e})=>{t=e},({value:r,path:n,key:s,state:o})=>{if(s=n.length?s:"#",a(t)){if(e.has(t))return o.node[s]=e.get(t),{done:!0};const n=Array.isArray(r)?[]:{};o.node[s]=n,e.set(t,n)}else o.node[s]=r;return{value:r,state:Object.assign(Object.assign({},o),{node:o.node[s]})}}]})();return o(e,[l,...t,c],i),s["#"]},l=(e,t)=>t in e,c=e=>"object"==typeof e&&null!==e,p=e=>Array.isArray(e),u=e=>!(!Array.isArray(e)||!e.length),f=e=>void 0!==e,d=e=>"string"==typeof e,m=e=>"number"==typeof e||d(e)&&!Number.isNaN(+e),g=e=>"function"==typeof e,y=e=>Array.isArray(e)?"array":null==e?"null":typeof e,h=e=>Object.keys(e),b=(e,t,r)=>(e[t]=r,e),v=(e,t)=>{const r={};for(const n of t)n in e&&(r[n]=e[n],delete e[n]);return r},O=(e,...t)=>{let r=e;for(const e of t){if(Array.isArray(r)&&"number"==typeof+e&&r.length<+e)r=r[+e];else{if(!c(r)||!(e in r))return;r=r[e]}if(void 0===r)return}return r},$=(e,...t)=>{const r=O(e,...t);return"string"==typeof r?r:void 0},j=(e,...t)=>{const r=O(e,...t);return c(r)?r:void 0},x=(e,...t)=>{const r=[...e];for(const e of t)for(const t of e)""===t?r.pop():r.push(t);return r},k="$diff",A={add:"add",remove:"remove",replace:"replace",rename:"rename"},R={breaking:"breaking",nonBreaking:"non-breaking",annotation:"annotation",unclassified:"unclassified",deprecated:"deprecated"},{breaking:S,nonBreaking:C,unclassified:M,annotation:P,deprecated:I}=R,w=[C,C,C],q=[S,S,S],E=[S,C,C],T=[C,S,S],_=[M,M,M],N=[P,P,P],B=[I,I,I],D=(e,t)=>{var r,n,a,s;const o=null!==(n=null===(r=t.rules)||void 0===r?void 0:r.$)&&void 0!==n?n:{},i=Object.assign(Object.assign({},e),{type:M});if(o){const r=(Array.isArray(o)?o:_)["rename"===e.action?2:["add","remove","replace"].indexOf(e.action)];try{i.type=g(r)?r(t):r}catch(e){const r=e instanceof Error?e.message:"";console.error(`Classification Rule error for node: ${t.before.path.join(".")}. ${r}`)}}const l=null===(s=(a=t.options).annotateHook)||void 0===s?void 0:s.call(a,i,t);return Object.assign(Object.assign({},i),l?{description:l}:{})},H={added:(e,t,r)=>D({path:e,after:t,action:A.add},r),removed:(e,t,r)=>D({path:e,before:t,action:A.remove},r),replaced:(e,t,r,n)=>D({path:e,before:t,after:r,action:A.replace},n),renamed:(e,t,r,n)=>D({path:e,before:t,after:r,action:A.rename},n)},V=e=>{var t;return Object.assign({action:e.action,type:null!==(t=e.type)&&void 0!==t?t:M},"replace"===e.action||"rename"===e.action?{replaced:e.before}:{})},K=e=>{const t={};for(const r of e){const e=V(r);t["rename"!==r.action?r.path[r.path.length-1]:r.after]=e}return t},L=(e,...t)=>{const r=x(e.path.slice(0,-1),t);if(!r.length)return{path:[],key:"",value:e.root,root:e.root};const n=[...r],a=n.pop(),s=O(e.root,...n),o=s[a];return void 0!==o?{path:r,key:a,value:o,parent:s,root:e.root}:void 0},F=e=>(t,r)=>[e(t,r),e(r,t)],U=(e,t)=>{const r=Math.abs(e.length-t.length),n=Array.from({length:Math.min(e.length,t.length)},((e,t)=>t));return{removed:e.length>t.length?Array.from({length:r},((e,r)=>t.length+r)):[],added:e.length<t.length?Array.from({length:r},((t,r)=>e.length+r)):[],mapped:n.reduce(((e,t)=>(e[t]=t,e)),{})}},J=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=new Set(Object.keys(t));for(const t of Object.keys(e))n.has(t)?(r.mapped[t]=t,n.delete(t)):r.removed.push(t);return n.forEach((e=>r.added.push(e))),r},W=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=new Set(Object.keys(t).map((e=>e.toLocaleLowerCase())));for(const t of Object.keys(e)){const e=t.toLocaleLowerCase();n.has(e)?(r.mapped[e]=e,n.delete(e)):r.removed.push(e)}return n.forEach((e=>r.added.push(e))),r},G=(e,t)=>{const{bNode:r,aNode:n,aPath:a,root:s,akey:o,bkey:i,bPath:l,before:c,after:p,rules:u}=e,f=l.length||"#"!==i?[...l,i]:[],d=a.length||"#"!==o?[...a,o]:[];return{before:{key:i,path:f,parent:r,value:c,root:s.before["#"]},after:{key:o,path:d,parent:n,value:p,root:s.after["#"]},rules:u,options:t}},z=({before:e,after:t,rules:n,options:a},s,o)=>{var i;const l=O(e.value,s),c=O(t.value,o);return{before:{path:[...e.path,s],key:s,value:l,parent:e.value,root:e.root},after:{path:[...t.path,o],key:o,value:c,parent:t.value,root:t.root},rules:null!==(i=r(n,s||o,s?e.path:t.path,s?l:c))&&void 0!==i?i:{},options:a}},Y=(e,t,r)=>(e[t]=r,{done:!0}),Q=(e,t,r)=>(e[t]=V(r),r),X=(e,t,r={},n={})=>{var a,s;const{jsonPath:i=[],source:l=e}=null!==(a=n.before)&&void 0!==a?a:{},{jsonPath:u=[],source:f=t}=null!==(s=n.after)&&void 0!==s?s:{},d={before:{"#":l},after:{"#":f},merged:{}},g=i.slice(0,-1),b=u.slice(0,-1),v=g.length?O(l,...g):d.before,$=b.length?O(f,...b):d.after;if(!c(v)||!c($))throw new Error("");const j=g.length?i[g.length]:"#",x=b.length?u[b.length]:"#",A=v[j],R=$[x];v[j]=e,$[x]=t;const{diffs:S,hook:C}=((e={})=>{const t=[],{arrayMeta:r,metaKey:n=k}=e;return{diffs:t,hook:a=>{var s;const{rules:o={},state:i,value:l,key:u}=a,{transform:f,compare:d,mapping:g,skip:b}=o,{keyMap:v,parentMeta:O,bNode:$,aNode:j,mNode:x}=i,k=null!=u?u:p($)?+Object.keys(v).pop():Object.keys(v).pop(),A=v[k],R=p(x)&&m(k)?k:A;if(b||!(k in v))return Y(x,k,l);const S=i.bPath.length||"#"!==k?[...i.bPath,k]:[],C=i.aPath.length||"#"!==A?[...i.aPath,A]:[],M=[l,j[A]],[P,I]=!p(l)&&f?f.reduce(((e,t)=>t(...e)),M):M;$[k]=P,j[A]=I;const w=G(Object.assign(Object.assign({},i),{before:P,after:I,akey:A,bkey:k,rules:o}),e),q=null==d?void 0:d(w);if(q){const{diffs:e,merged:r,rootMergeMeta:n}=q;return t.push(...e),n&&(O[A]=n),Y(x,R,r)}if(y(P)!==y(I))return t.push(Q(O,A,H.replaced(S,P,I,w))),Y(x,R,I);if(c(P)&&c(I)){const e=[],o=p(P)?[]:{};x[R]=o;const i=null!=g?g:p(P)?U:J,{added:l,removed:c,mapped:u}=i(P,I,w),f=p(P)?[]:h(u).filter((e=>e!==u[e]));e.push(...c.map((e=>H.removed([...S,e],P[e],z(w,e,""))))),e.push(...f.map((e=>H.renamed(S,e,u[e],z(w,e,u[e]))))),t.push(...e);const d=null!==(s=K(e))&&void 0!==s?s:{},m=()=>{l.forEach((e=>{const r=p(o)?o.length:e,n=H.added([...S,r],I[e],z(w,"",e));d[r]=V(n),o[r]=I[e],t.push(n)})),Object.keys(d).length&&(p(o)&&!r?O[A]={array:d}:o[n]=d)},y=Object.assign(Object.assign({},a.state),{keyMap:u,aPath:C,bPath:S,bNode:P,aNode:I,parentMeta:d,mNode:o});return{value:P,state:y,exitHook:m}}return P!==I&&t.push(Q(O,A,H.replaced(S,P,I,w))),Y(x,R,I)}}})(r),M={aPath:b,bPath:g,mNode:d.merged,bNode:v,aNode:$,keyMap:{[j]:x},parentMeta:{},root:d};return o(e,C,{state:M,rules:r.rules}),v[j]=A,$[x]=R,{diffs:S,merged:d.merged[x],rootMergeMeta:M.parentMeta[x]}},Z=(e,t)=>Object.assign({template:e},t?{params:t}:{}),ee=(e,t={})=>{if(!e)return"";const{template:r,params:n}=e;return((e="",r={})=>{var n;let a=((e,r)=>{const n=h(t).filter((t=>t.startsWith(`${e}_`)));let a=e in t?t[e]:void 0,s=1;for(const e of n){const n=e.split("_").slice(1);!n.filter((e=>!f(r[e])||""===r[e])).length&&n.length>=s&&(a=t[e],s=n.length)}return a})(e,r);if(!a)return"";const s={};for(const e of h(r)){const n=r[e];s[e]=c(n)?ee(n,t):n}for(const e of[...a.matchAll(/{{(\w+)}}/g)].reverse()){if(!(e[1]in s))continue;const t=null!==(n=e.index)&&void 0!==n?n:0;a=a.substring(0,t)+String(s[e[1]])+a.substring(t+e[0].length)}return a})(r,n)},te=(e,t)=>i(e,(({value:e,key:r})=>{if(!r||d(r)&&r.startsWith("/"))return"function"==typeof e?{value:(...r)=>te(e(...r),t)}:!Array.isArray(e)&&c(e)?{value:t(e)}:void 0})),re=e=>"$"in e&&Array.isArray(e.$)?Object.assign(Object.assign({},e),{$:ae(e.$)}):e,ne=e=>{if("function"==typeof e)return t=>ne(e(t));switch(e){case S:return C;case C:return S;default:return e}},ae=([e,t,r])=>[ne(e),ne(t),ne(r)],se=([e,t,r],n)=>[t=>n(g(e)?e(t):e,t,"add"),e=>n(g(t)?t(e):t,e,"remove"),e=>n(g(r)?r(e):r,e,"replace")];function oe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function ie(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function le(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}const ce=(e={},t,r,n)=>{const a=`/${t}`,s="function"==typeof e["/**"]?e["/**"]({key:t,path:r,value:n}):e["/**"],o="function"==typeof e["/*"]?e["/*"]({key:t,path:r,value:n}):e["/*"];let i={};if(a in e)i=e[a];else if(!s&&!o)return;return i="function"==typeof i?i({key:t,path:r,value:n}):i,o&&(i=Object.assign(Object.assign({},o),i)),s?Object.assign(Object.assign({"/**":e["/**"]},s),i):i},pe=e=>{const t={},r=e.reduce(((e,t)=>(Object.keys(t).forEach((t=>e.add(t))),e)),new Set);for(const n of r.keys()){const r=e.filter((e=>n in e));if(1!==r.length){if("/"!==n.charAt(0))throw new Error(`Cannot merge rules. Duplicate key: ${n}. Rules should not have same Rule key`);t[n]=(e,t)=>{const a=r.map((r=>"function"==typeof r[n]?r[n](e,t):r[n]));return pe(a)}}else t[n]=r[0][n]}return t},ue=e=>"object"==typeof e&&null!==e,fe=e=>Array.isArray(e),de=(e,t,r={})=>{var n,a;t=fe(t)?t:[t];const s=fe(r.rules)?pe(r.rules):r.rules,o=[{data:e,state:r.state,path:[],keys:[],keyIndex:-1,rules:s}];for(;o.length>0;){const e=o[o.length-1];if(e.keyIndex>=e.keys.length){for(;null===(n=e.hooks)||void 0===n?void 0:n.length;)e.hooks.pop()();o.pop();continue}const r=e.keys[e.keyIndex++],[i,l,c]=o.length>1?[e.data[r],[...e.path,r],ce(e.rules,r,[...e.path,r],e.data[r])]:[e.data,e.path,s];let p={value:i,path:l,key:r,state:e.state,rules:c};const u=[];for(const e of t){if(!e||"function"!=typeof e)continue;const t=null!==(a=e(p))&&void 0!==a?a:{},{terminate:r,done:n,exitHook:s}=t,o=le(t,["terminate","done","exitHook"]);if(r)return;if(s&&u.push(s),p=Object.assign(Object.assign({},p),o),n){p=null;break}}if(p&&ue(p.value)){const e=fe(p.value)?[...p.value.keys()]:Object.keys(p.value);o.push({hooks:u,state:p.state,data:p.value,path:l,keys:e,keyIndex:0,rules:p.rules})}else for(;u.length;)u.pop()()}},me=()=>{const e=new WeakMap;let t;return[({value:e})=>{t=e},({value:r,path:n,key:a,state:s})=>{if(a=n.length?a:"#",ue(t)){if(e.has(t))return s.node[a]=e.get(t),{done:!0};const n=Array.isArray(r)?[]:{};s.node[a]=n,e.set(t,n)}else s.node[a]=r;return{value:r,state:Object.assign(Object.assign({},s),{node:s.node[a]})}}]};class ge extends Map{add(e,t){const r=this.get(e);return r?r.push(t):this.set(e,[t]),this}}const ye=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t))return[...e,...t];if(ue(e)&&ue(t)){const r=Object.assign({},e);for(const e of Object.keys(t))r[e]=ye(r[e],t[e]);return r}return t},he=e=>e&&e.$ref&&"string"==typeof e.$ref,be=e=>e&&e.anyOf&&Array.isArray(e.anyOf),ve=e=>e&&e.oneOf&&Array.isArray(e.oneOf),Oe=(e,t="")=>{const[r=t,n]=e.split("#"),a=n&&"/"!==n?n:"";return{filePath:r,pointer:a,normalized:$e(r,a),jsonPath:Se(a)}},$e=(e,t)=>e?`${e}${t?"#"+t:""}`:t?`#${t}`:"#",je=(e,t,r=[t])=>{if(!ue(e))return;let n=e;const a=Se(t);for(const t of a)if(Array.isArray(n)&&n.length>+t)n=n[+t];else if(ue(n)&&t in n)n=n[t];else{if(!he(n))return;{const t=Oe(n.$ref);n=t.filePath||r.includes(t.pointer)?void 0:je(e,t.pointer,[...r,t.pointer])}}return n},xe=/\//g,ke=/~/g,Ae=/~1/g,Re=/~0/g,Se=e=>e.split("/").map((e=>decodeURIComponent(e.replace(Ae,"/").replace(Re,"~")))).slice(1),Ce=e=>e.length?"/"+e.map((e=>encodeURIComponent(String(e).replace(ke,"~0").replace(xe,"~1")))).join("/"):"";function Me(e){const t=e.reduce(((e,t)=>Math.max(e,(e=>{let t=1;for(;e*t%1!=0;)t*=10;return t})(t))),0);return e.reduce(((e,r)=>Math.round(e*t*r*t/Pe(e*t,r*t))/t))}function Pe(e,t){return 0===t?e:Pe(t,e%t)}const Ie=e=>{if(0===e.length)return[[]];const t=e[0],r=e.slice(1),n=Ie(r),a=[];for(const e of t)for(const t of n)a.push([e,...t]);return a},we=e=>{const t={},r=Te(e);for(const[e,n]of Object.entries(r))n.includes(!1)?t[e]=!1:t[e]=n.length>1?{allOf:n}:n[0];return t},qe=(e,t)=>!!e.reduce(((e,t)=>e&&!0===t),!0)||_e(e,t),Ee=e=>`Merge rule not found for key: ${e}`,Te=e=>{const t={};for(const r of e)for(const e of Object.keys(r))Array.isArray(t[e])?t[e].push(r[e]):t[e]=[r[e]];return t},_e=(e,t)=>{if(e.includes(!1))return!1;const r={},n=Te(e);"properties"in n&&(n.properties=(e=>{const t=[];for(const r of e){if(!("properties"in r))continue;const n=new Set(Object.keys(r.properties)),a=new ge;for(const t of n.values())for(const s of e)if(!(s==r||s.properties&&t in s.properties))if("patternProperties"in s&&s.patternProperties)for(const e of Object.keys(s.patternProperties))new RegExp(e).test(t)||n.delete(t);else"additionalProperties"in s&&(!1===s.additionalProperties?n.delete(t):"object"==typeof s.additionalProperties&&a.add(t,s.additionalProperties));if(!n.size)continue;const s={};for(const e of n.values())a.has(e)?s[e]={allOf:[r.properties[e],...a.get(e)]}:s[e]=r.properties[e];t.push(s)}return t})(e)),"patternProperties"in n&&(n.patternProperties=(e=>{const t=[];for(const r of e){if(!("patternProperties"in r))continue;const n=new Set(Object.keys(r.patternProperties));for(const t of e)if(t!=r&&"additionalProperties"in t&&!t.additionalProperties)for(const e of n.values())t.patternProperties&&e in t.patternProperties||n.delete(e);if(!n.size)continue;const a={};for(const e of n.values())a[e]=r.patternProperties[e];t.push(a)}return t})(e));for(let[a,s]of Object.entries(n)){if(!s.length)continue;const n=t.mergeRules;let o=`/${a}`in n?n[`/${a}`]:n["/?"];o=o&&!("$"in o)&&"/"in o?o["/"]:o,o="function"==typeof o?o():o;const i=o&&"$"in o?o.$:void 0;if(!i)throw new Error(Ee(a));const l=s.length>1?i(s,Object.assign(Object.assign({},t),{allOfItems:e})):s[0];void 0===l?t.mergeError(s):r[a]=l}return Object.keys(r).length?r:void 0},Ne=e=>e[e.length-1],Be=e=>e.reduce(((e,t)=>e||t),!1),De=e=>Math.min(...e),He=e=>Math.max(...e),Ve=e=>e.length>1?e.reduce(((e,t)=>`${e}(?=${t})`),""):e[0],Ke=([e,...t])=>t.reduce(((e,t)=>e.filter((e=>t.includes(e)))),e),Le=([e,...t])=>t.find((t=>!((e,t)=>JSON.stringify(e)==JSON.stringify(t))(t,e)))?void 0:e,Fe=([e,...t])=>t.reduce(((e,t)=>ye(e,t)),e),Ue=e=>Ie(e).map((e=>({allOf:e}))),Je=e=>({anyOf:e}),We=e=>Me(e),Ge=(e,t)=>{const r=e.map((e=>e.map((e=>JSON.stringify(e))))),n=Ke(r).map((e=>JSON.parse(e))).sort();return n.length||t.mergeError(e),n},ze=(e,t)=>{const r=e.map((e=>Array.isArray(e)?e:[e])),n=Ke(r);return 1===n.length?n[0]:n.length?n:void 0},Ye=e=>{const t=new Set;for(const r of e)for(const e of r)t.add(e);return Array.from(t).sort()},Qe=(e,t)=>{const r={},n=Te(e);for(const[e,t]of Object.entries(n))if(t.reduce(((e,t)=>e&&Array.isArray(t)),!0))r[e]=Ye(t);else{const n=t.map((e=>Array.isArray(e)?{required:e}:e));r[e]=n.length>1?{allOf:n}:n[0]}return r},Xe=(e,t)=>{if(!e.reduce(((e,t)=>Array.isArray(t)||e),!1))return _e(e,t);const r=[];let n=1/0,a=0;const s=new ge;for(const e of t.allOfItems)"additionalItems"in e&&e.additionalItems&&"items"in e&&Array.isArray(e.items)&&s.add(e.items.length,e.additionalItems),"items"in e&&(r.push(e.items),Array.isArray(e.items)&&(a=Math.max(a,e.items.length),"additionalItems"in e&&!1===e.additionalItems&&(n=Math.min(n,e.items.length))));const o=Math.min(a,n),i=[...Array(o)].map((()=>({allOf:[]})));for(const e of r)if(Array.isArray(e))for(let t=0;t<o;t++){const r=[];for(let e=0;e<=t;e++)s.has(e)&&r.push(...s.get(e));t<e.length?i[t].allOf.push(r.length?Object.assign(Object.assign({},e[t]),{allOf:r}):e[t]):i[t].allOf.push(!r.length||{allOf:r})}else i.forEach((({allOf:t})=>t.push(e)));return i},Ze=(e,t)=>{const r=[],n=[];for(const e of t.allOfItems)"items"in e&&!Array.isArray(e.items)&&n.push(e.items),"additionalItems"in e&&"items"in e&&Array.isArray(e.items)&&r.push(e.additionalItems);return n.length&&r.forEach((e=>e.allOf=n)),_e(r,t)},et=(e="draft-06",t={})=>Object.assign(Object.assign(Object.assign(Object.assign({"/maximum":{$:De},"/exclusiveMaximum":{$:Be},"/minimum":{$:He},"/exclusiveMinimum":{$:Be},"/maxLength":{$:De},"/minLength":{$:He},"/maxItems":{$:De},"/minItems":{$:He},"/uniqueItems":{$:Be},"/maxProperties":{$:De},"/minProperties":{$:He},"/required":{$:Ye},"/multipleOf":{$:We},"/enum":{$:Ge},"/type":{$:ze},"/allOf":{"/*":()=>et(e,t),$:Ue},"/not":{$:Je},"/oneOf":{"/*":()=>et(e,t),$:Ue,sibling:["definitions","$defs","$id","$schema"]},"/anyOf":{"/*":()=>et(e,t),$:Ue,sibling:["definitions","$defs","$id","$schema"]},"/properties":{"/*":()=>et(e,t),$:we},"/items":()=>Object.assign(Object.assign({},et(e,t)),{$:Xe,"/*":({key:r})=>"number"==typeof r?et(e,t):{}}),"/additionalProperties":()=>Object.assign(Object.assign({},et(e,t)),{$:qe}),"/additionalItems":()=>Object.assign(Object.assign({},et(e,t)),{$:Ze}),"/patternProperties":{"/*":()=>et(e,t),$:we},"/pattern":{$:Ve},"/readOnly":{$:Be},"/writeOnly":{$:Be},"/example":{$:Fe},"/examples":{$:Fe},"/deprecated":{$:Be}},"draft-04"!==e?{"/propertyNames":()=>et(e,t),"/contains":()=>et(e,t),"/dependencies":{"/*":()=>et(e,t),$:Qe},"/const":{$:Le},"/exclusiveMaximum":{$:De},"/exclusiveMinimum":{$:He},"/$defs":{"/*":()=>et(e,t),$:Fe}}:{}),{"/definitions":{"/*":()=>et(e,t),$:Fe},"/xml":{$:Fe},"/externalDocs":{$:Ne},"/description":{$:Ne},"/title":{$:Ne},"/format":{$:Ne},"/default":{$:Ne},"/?":{$:Ne}}),t),{$:_e}),tt=e=>et(e,{"/discriminator":{$:Fe},"/oneOf":{"/*":()=>tt(e),$:Ue,sibling:["discriminator"]},"/anyOf":{"/*":()=>tt(e),$:Ue,sibling:["discriminator"]}}),rt=e=>"3.0.x"===e?Object.assign(Object.assign({},tt("draft-04")),{"/items":({key:e})=>Object.assign(Object.assign({},tt("draft-04")),{$:Xe})}):tt("draft-06"),nt=e=>({"/*":{"/schema":rt(e)}}),at=e=>({"/content":{"/*":{"/schema":rt(e),"/encoding":{"/headers":nt(e)}}}}),st=e=>({"/*":{"/headers":nt(e),"/content":{"/*":{"/schema":rt(e),"/encoding":{"/headers":nt(e)}}}}}),ot=et("draft-06",{"/args":()=>ot,"/nullable":{$:Be},"/specifiedByURL":{$:Ne},"/values":{$:Fe,"/*":{$:Fe,"/description":{$:Ne},"/deprecated":{$:Ne,"/reason":{$:Ne}}}},"/interfaces":{$:Fe,"/*":{$:Fe}},"/directives":{$:Fe,"/*":()=>Object.assign(Object.assign({},ot),{"/meta":{$:Fe}})}}),it={"/queries":{"/*":()=>ot},"/mutations":{"/*":()=>ot},"/subscriptions":{"/*":()=>ot},"/components":{"/*":{"/*":ot},"/directives":{"/*":{"/args":()=>ot}}}},lt=(e,t,r)=>{const n=r.sibling||[],a=e,s=t,o=a[s],i=ie(a,["symbol"==typeof s?s:s+""]),l=((e,t)=>{const r={};for(const n of t)n in e&&(r[n]=e[n],delete e[n]);return r})(i,n);return Object.keys(i).length?Object.assign({[t]:o.map((e=>({allOf:[i,e]})))},l):e},ct=(e,t,r,n)=>{const a=[],s=Ce(t),o=[],i={pointer:s,data:"",refs:[]};for(const t of e)if(he(t)&&!o.includes(t.$ref)){""===i.data&&(i.data=JSON.stringify(e));const{$ref:s}=t,l=ie(t,["$ref"]),{filePath:c,normalized:p,pointer:u}=Oe(s),f=n.find((e=>e.refs.includes(t.$ref)&&e.data===i.data&&u!==e.pointer));if(f)return{allOfItems:[{$ref:"#"+f.pointer}],brokenRefs:o};i.refs.push(p);const d=c?void 0:je(r,u);void 0===d?(o.push(p),a.push(t)):a.push(d),Object.keys(l).length&&a.push(l)}else a.push(t);i.refs.length&&n.push(i);const l=pt(a);return l.find((e=>he(e)&&!o.includes(e.$ref)))?ct(l,t,r,n):{allOfItems:l,brokenRefs:o}},pt=e=>{const t=[];for(const r of e)if(ue(r))if(r.allOf&&Array.isArray(r.allOf)){const{allOf:e}=r,n=ie(r,["allOf"]),a=Object.keys(n).length?[...e,n]:e;t.push(...pt(a))}else t.push(r);return t},ut=e=>{if("object"!=typeof e||!e)return et();if("openapi"in e&&"string"==typeof e.openapi&&/3.+/.test(e.openapi)){return((e="3.0.x")=>({"/paths":{"/*":{"/*":{"/parameters":nt(e),"/requestBody":at(e),"/responses":st(e)},"/parameters":nt(e)}},"/components":{"/schemas":{"/*":rt(e)},"/responses":st(e),"/parameters":nt(e),"/requestBodies":{"/*":at(e)},"/headers":nt(e)}}))(e.openapi.startsWith("3.1")?"3.1.x":"3.0.x")}return"graphapi"in e&&"string"==typeof e.graphapi?it:et()},ft=(e,t)=>{var r;const n=null!==(r=null==t?void 0:t.rules)&&void 0!==r?r:ut(e);return((e,t=[],r={})=>{var n;t=Array.isArray(t)?t:[t];const a={"#":void 0},s=Object.assign({state:Object.assign(Object.assign({},null!==(n=r.state)&&void 0!==n?n:{}),{root:a,node:a})},r.rules?{rules:r.rules}:{}),[o,i]=me();return de(e,[o,...t,i],s),a["#"]})(e,dt(t),{rules:n})},dt=e=>{const t=new Map;let r=null==e?void 0:e.source;const n=[];return({value:a,key:s,path:o,rules:i,state:l})=>{o.length||(null==e?void 0:e.source)||(r=a);const c=r=>{var n;const a=mt(o);a?t.set(...a):null===(n=null==e?void 0:e.onMergeError)||void 0===n||n.call(e,"Could not merge values, they are probably incompatible",o,r)},p=()=>{const{node:e}=l,r=Ce(o);if(t.has(r)){const n=t.get(r),o=e[s];Array.isArray(o)&&(o.length<2&&c((null==a?void 0:a.allOf)||[]),o.splice(n,1))}};if(!ue(a)||Array.isArray(a))return{exitHook:p};if(!(e=>!!e&&e["/allOf"]&&"$"in e["/allOf"])(i))return{exitHook:p};const{allOf:u}=a,f=ie(a,["allOf"]),d=[];if(Array.isArray(u)&&d.push(...u),d.length)Object.keys(f).length&&d.push(f);else{const{$ref:t}=f,r=ie(f,["$ref"]);if((null==e?void 0:e.mergeRefSibling)&&t&&Object.keys(r).length>0)d.push({$ref:t},r);else if(null==e?void 0:e.mergeCombinarySibling){if(be(f)&&i["/anyOf"])return{value:lt(f,"anyOf",i["/anyOf"]),exitHook:p};if(ve(f)&&i["/oneOf"])return{value:lt(f,"oneOf",i["/oneOf"]),exitHook:p}}}if(!d.length)return{value:f,exitHook:p};const{allOfItems:m,brokenRefs:g}=ct(d,o,r,n);if(g.length)return g.forEach((t=>{var r;return null===(r=null==e?void 0:e.onRefResolveError)||void 0===r?void 0:r.call(e,"Cannot resolve $ref",o,t)})),{value:{allOf:m},exitHook:p};if(m.length<2)return{value:m.length?m[0]:{},exitHook:p};const y=_e(m,{allOfItems:m,mergeRules:i,mergeError:c});return(null==e?void 0:e.mergeCombinarySibling)&&be(y)?{value:lt(y,"anyOf",i["/anyOf"]),exitHook:p}:(null==e?void 0:e.mergeCombinarySibling)&&ve(y)?{value:lt(y,"oneOf",i["/oneOf"]),exitHook:p}:{value:y,exitHook:p}}},mt=e=>{for(let t=e.length-2;t>=0;t--)if("anyOf"===e[t]||"oneOf"===e[t]){const r=e.slice(0,t+1);return[Ce(r),e[t+1]]}},gt=["any","string","number","integer","boolean","null","array","object"],yt=["deprecated","readOnly","writeOnly","externalDocs"],ht=["type","description","title","enum","default","examples","format","const"],bt={any:[],boolean:[],null:[],string:["minLength","maxLength","pattern"],number:["multipleOf","minimum","exclusiveMinimum","maximum","exclusiveMaximum"],integer:["multipleOf","minimum","exclusiveMinimum","maximum","exclusiveMaximum"],object:["required","minProperties","maxProperties","propertyNames","properties","patternProperties","additionalProperties"],array:["minItems","maxItems","uniqueItems","items","additionalItems"]},vt={any:[...bt.any,...ht,...yt],boolean:[...bt.boolean,...ht,...yt],null:[...bt.null,...ht,...yt],string:[...bt.string,...ht,...yt],number:[...bt.number,...ht,...yt],integer:[...bt.integer,...ht,...yt],object:[...bt.object,...ht,...yt],array:[...bt.array,...ht,...yt]},Ot=["$defs","definitions","$schema","$id"];const $t=(e,t)=>{const{$ref:r}=t;oe(t,["$ref"]);const n=Oe(r);return n.filePath?void 0:je(e,n.pointer)};function jt(e){if("object"!=typeof e||!e)return[];const t=[];for(const r of Object.keys(vt)){if("integer"===r)continue;const n=bt[r];for(const a of n)if(a in e){t.push(r);break}}return t}const xt=(e,t)=>{if(!c(t))return!1;for(const r of e)if(!t.type||Array.isArray(t.type)&&t.type.includes(r)||t.type===r||"any"===r)return!0;return!1};const kt=e=>"/"+e.map((e=>String(e).replace(new RegExp("/","g"),"~1"))).join("/"),At=(e,t,r)=>{var n;return!!e&&(!!(null===(n=r[e])||void 0===n?void 0:n.find((e=>t.startsWith(e))))||!!t.startsWith(e))},Rt=(e,t)=>e===t?e:`${e}:${t}`,St=(e,t)=>he(e)?$t(t,e):e,Ct=e=>{var t;return e&&null!==(t=Oe(e).normalized)&&void 0!==t?t:""},Mt=(e,t=[],r=[])=>e.map((e=>Object.assign(Object.assign({},e),{path:[...r,...e.path.slice(t.length)]}))),Pt=(e,t,r=[])=>{const n=Object.assign({},e),a=v(n,[...r,t]),s=t,o=a[s],i=oe(a,["symbol"==typeof s?s:s+""]);return Object.keys(n).length?Object.assign(Object.assign({},Array.isArray(o)?{[t]:o.map((e=>({allOf:[e,n]})))}:n),i):e},It=(e,t=[])=>{const r=Object.assign({},e),n=v(r,[...t,"allOf"]),{allOf:a}=n,s=oe(n,["allOf"]);return Object.keys(r).length?Object.assign(Object.assign({},Array.isArray(a)?{allOf:[...a,r]}:r),s):e},wt=(e,t=[])=>{const r=Object.assign({},e),n=v(r,[...t,"$ref"]),{$ref:a}=n,s=oe(n,["$ref"]);return Object.keys(r).length?Object.assign({allOf:[{$ref:a},r]},s):e},qt=(e,t,r=[])=>{const n=Object.assign({},e),a=v(n,[...r]),s=t;a[s];const o=oe(a,["symbol"==typeof s?s:s+""]);return Object.assign(Object.assign({},o),{[t]:Object.keys(n).length?[n]:[]})},Et=(e,t="")=>{for(let r=0;r<e.length;r++)"properties"===e[r]&&r<e.length-1?t+=t?"."+String(e[++r]):String(e[++r]):"additionalProperties"===e[r]?t+="{.*}":"patternProperties"===e[r]&&r<e.length-1?t+=`{${String(e[++r])}}`:"items"===e[r]&&(r<e.length-1&&m(e[r+1])?t+=`[${e[++r]}]`:t+="[]");return t||void 0},Tt={add:"[Added] {{text}}",add_target:"[Added] {{text}} to `{{target}}`",remove:"[Removed] {{text}}",remove_target:"[Removed] {{text}} from `{{target}}`",replace:"[Replaced] {{text}}",replace_target:"[Replaced] {{text}} of `{{target}}`",rename:"[Renamed] {{text}}",rename_target:"[Renamed] {{text}} of `{{target}}`",status:"{{key}} status",validation:"{{key}} validator",annotation:"annotation ({{key}})",enum:"possible values",format:"value format",default:"default value",const:"possible value",type:"type definition",nullable:"possbile nullable value",property:"property `{{key}}`",arratItem:"array item with index `{{key}}`",patternProperty:"property with key pattern `{{key}}`",additionalProperties:"schema for additional properties",arrayItems:"schema for array items",additionalArrayItems:"schema for additional array items",oneOfItem:"oneOf schema",anyOfItem:"anyOf schema",allOfItem:"allOf schema"},_t=(e,t)=>{var r;const n=null===(r=t.rules)||void 0===r?void 0:r.annotate;return n?ee(n(e,t),Tt):""},Nt=({action:e,path:t})=>({template:e,params:{text:{template:"annotation",params:{key:t[t.length-1]}},target:Et(t)}}),Bt=({action:e,path:t})=>(t[t.length-1],Z(e,{text:Z("annotation",{key:"example"}),target:Et(t)})),Dt=({action:e,path:t})=>{const r=t[t.length-1];return Z(e,{text:Z("validation",{key:r}),target:Et(t)})},Ht=({path:e},t)=>{const r=e[e.length-1];return t.after.value?Z("add",{text:Z("status",{key:r}),target:Et(e)}):t.before.value?Z("remove",{text:Z("status",{key:r}),target:Et(e)}):void 0},Vt=({action:e,path:t})=>{const r=t[t.length-1];if(!m(r))return Z(e,{target:Et(t),text:Z(r)})},Kt=({action:e,path:t},r)=>{const n=t[t.length-1],{value:a}="add"===e?r.after:r.before,s=t.length>1?t[t.length-2]:"",o=Et(t.slice(0,-1)),i=Et(t);switch(s){case"enum":return Z("replace",{text:Z("enum"),target:i});case"properties":return d(n)?Z(e,{text:Z("property",{key:n}),target:o}):void 0;case"items":return m(n)?Z(e,{text:Z("arratItem",{key:n}),target:o}):void 0;case"patternProperties":return d(n)?Z(e,{text:Z("patternProperty",{key:n}),target:o}):void 0;case"oneOf":case"anyOf":case"allOf":return Z(e,{text:Z(`${s}Item`),target:i});case"required":return d(a)?Z(e,{text:Z("status",{key:s}),target:i?`${i}.${a}`:a}):void 0}},Lt=e=>e?S:C,Ft=({after:e})=>Lt(!!e.value),Ut=(e,t)=>{const r=Array.isArray(e)?e:[e];return r.includes("number")&&r.push("integer"),se(t,((e,{before:t,after:n},a)=>xt(r,"remove"===a?t.parent:n.parent)?e:M))},Jt=[S,C,({before:e,after:t})=>Lt(!m(e.value)||!m(t.value)||e.value>t.value)],Wt=[S,C,({before:e,after:t})=>Lt(!m(e.value)||!m(t.value)||e.value<t.value)],Gt=[Ft,C,Ft],zt=[Ft,C,Ft],Yt=[S,C,({before:e,after:t})=>Lt(!(m(e.value)&&m(t.value)&&!(e.value%t.value)))],Qt=[({after:e})=>{var t;return!d(e.value)||f(null===(t=L(e,"","properties",e.value,"default"))||void 0===t?void 0:t.value)?C:S},C,({after:e})=>{var t;return!d(e.value)||f(null===(t=L(e,"","properties",e.value,"default"))||void 0===t?void 0:t.value)?C:S}],Xt=(e,t)=>{e.before=t(e.before,e.after),e.after=t(e.after,e.before)},Zt=(e=Ot)=>(t,r)=>{if(!c(t)||!c(r))return[t,r];const n={before:t,after:r};Xt(n,(t=>"oneOf"in t?Pt(t,"oneOf",e):"anyOf"in t?Pt(t,"anyOf",e):"allOf"in t?It(t,e):"$ref"in t?wt(t,e):t));for(const t of["oneOf","anyOf"]){if(t in n.before&&!("oneOf"in n.after)&&!("anyOf"in n.after))return[n.before,qt(n.after,t,e)];if(t in n.after&&!("oneOf"in n.before)&&!("anyOf"in n.before))return[qt(n.before,t,e),n.after]}return[n.before,n.after]},er=(...e)=>(t,r)=>{if(!c(t)||!c(r))return[t,r];const n={before:Object.assign({},t),after:Object.assign({},r)};return Xt(n,((t,r)=>{for(const n of e)n in r&&c(r[n])&&!(n in t)&&(t[n]=Array.isArray(r[n])?[]:{});return t})),[n.before,n.after]},tr=(e="2020-12")=>(e,t)=>{if(!c(e)||!c(t))return[e,t];const r={before:Object.assign({},e),after:Object.assign({},t)};return Xt(r,((e,t)=>{for(const r of["enum","required","properties","patternProperties","definitions","examples"])r in t&&c(t[r])&&!(r in e)&&(e[r]=Array.isArray(t[r])?[]:{});return e})),Xt(r,((e,t)=>{if("const"in e&&"enum"in t){const{const:t}=e,r=oe(e,["const"]);return Object.assign(Object.assign({},r),{enum:[t]})}return e})),Xt(r,(e=>(Array.isArray(e.enum)&&(e.enum=e.enum.filter(((e,t,r)=>r.indexOf(e)===t))),e))),Xt(r,(e=>{if("required"in e&&Array.isArray(e.required)){const t=e.required.filter(((e,t,r)=>d(e)&&r.indexOf(e)===t));return Object.assign(Object.assign({},e),{required:t})}return e})),Xt(r,((e,t)=>"items"in t&&p(t.items)?"items"in e&&"object"==typeof e.items?p(e.items)?e:Object.assign(Object.assign({},e),{items:t.items.map((()=>e.items)),additionalItems:e.items}):Object.assign(Object.assign({},e),{items:[]}):e)),Xt(r,((e,t)=>{if(!("type"in e)&&"type"in t){const r=jt(e);r.length&&(e.type=d(t.type)&&r.includes(t.type)?t.type:r)}return e})),Xt(r,(e=>{if("exclusiveMinimum"in e&&"boolean"==typeof e.exclusiveMinimum&&"minimum"in e){const{minimum:t,exclusiveMinimum:r}=e,n=oe(e,["minimum","exclusiveMinimum"]);return Object.assign(Object.assign({},n),{exclusiveMinimum:t})}return e})),Xt(r,(e=>{if("exclusiveMaximum"in e&&"boolean"==typeof e.exclusiveMaximum&&"maximum"in e){const{maximum:t,exclusiveMaximum:r}=e,n=oe(e,["maximum","exclusiveMaximum"]);return Object.assign(Object.assign({},n),{exclusiveMaximum:t})}return e})),Xt(r,((e,t)=>{if("example"in e&&"examples"in t){const{example:t}=e,r=oe(e,["example"]),n="examples"in e&&Array.isArray(e.examples)?e.examples:[];return Object.assign(Object.assign({},r),{examples:[...n,t]})}return e})),[r.before,r.after]},rr=e=>F((t=>ft(t,{rules:et("draft-04"===e?e:"draft-06"),mergeCombinarySibling:!0,mergeRefSibling:!0}))),nr=(e,t,r)=>{const{added:n,removed:a,mapped:s}=J(e,t),o=a.findIndex((e=>"oneOf"==e||"anyOf"===e)),i=n.findIndex((e=>"oneOf"==e||"anyOf"===e));if(o<0||i<0)return{added:n,removed:a,mapped:s};const[l]=a.splice(o,1),[c]=n.splice(i,1);return s[l]=c,{added:n,removed:a,mapped:s}},ar=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=[...t],a=new Set(t.keys()),s=[];for(let t=0;t<e.length;t++){const o=n.indexOf(e[t]);o<0?s.push(t):(r.mapped[t]=o,a.delete(o))}let o=0;a.forEach((e=>{o<s.length?r.mapped[s[o++]]=e:r.added.push(e)}));for(let e=o;e<s.length;e++)r.removed.push(s[e]);return r},sr=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=[...t],a=new Set(t.keys());for(let t=0;t<e.length;t++){const s=n.indexOf(e[t]);s<0?r.removed.push(t):(r.mapped[t]=s,a.delete(s))}return a.forEach((e=>{r.added.push(e)})),r},or=e=>{const{before:t,after:n,options:a}=e,{arrayMeta:s,metaKey:o=k}=a;if(!p(t.value)||!p(n.value)){const r=H.replaced(t.path,t.value,n.value,e);return{diffs:[r],merged:n.value,rootMergeMeta:V(r)}}const i=new Set(n.value.keys()),l=new Set(t.value.keys()),c=[],u=[],f=[],d=r(e.rules,"*",t.path,t.value);for(const e of t.value.keys()){const r=t.value[e];for(const s of n.value.keys()){if(!i.has(s))continue;const o=n.value[s],{diffs:p,merged:f}=X(r,o,Object.assign(Object.assign({},a),{rules:d}),{before:{jsonPath:[...t.path,e],source:t.root},after:{jsonPath:[...n.path,s],source:n.root}});if(!p.length){i.delete(s),l.delete(e),u[s]=f;break}c.push({before:e,after:s,diffs:p,merged:f})}}c.sort(((e,t)=>e.diffs.length-t.diffs.length));for(const e of c)i.has(e.after)&&l.has(e.before)&&(i.delete(e.after),l.delete(e.before),u[e.before]=e.merged,f.push(...e.diffs));const m=[];for(const r of l.values()){u[r]=t.value[r];const n=H.removed([...t.path,r],t.value[r],z(e,r,""));m.push(n),f.push(n)}for(const t of i.values()){const r=H.added([...n.path,u.length],n.value[t],z(e,"",t));u.push(n.value[t]),m.push(r),f.push(r)}const g=K(m);return s&&(u[o]=g),Object.assign({diffs:f,merged:u},!s&&Object.keys(g).length?{rootMergeMeta:{array:g}}:{})},ir=(e={})=>{var t,r,n;e.results=null!==(t=e.results)&&void 0!==t?t:new Map,e.bRefs=null!==(r=e.bRefs)&&void 0!==r?r:{},e.aRefs=null!==(n=e.aRefs)&&void 0!==n?n:{};const{results:a,bRefs:s,aRefs:o}=e;return({before:e,after:t,rules:r,options:n})=>{var i,l;const c=kt(e.path),p=kt(t.path);let u=Rt(c,p);if(a.has(u))return a.get(u);const f=he(e.value)?Ct(e.value.$ref):"",d=he(t.value)?Ct(t.value.$ref):"";if(!f&&!d)return;if(At(f,`#${c}`,s)||At(d,`#${p}`,o))return;if(f&&(s[f]=[...null!==(i=s[f])&&void 0!==i?i:[],`#${c}`]),d&&(o[d]=[...null!==(l=o[d])&&void 0!==l?l:[],`#${p}`]),f&&d&&(u=Rt(f,d),a.has(u))){const t=a.get(u),{path:r,diffs:n}=t,s=oe(t,["path","diffs"]);return Object.assign(Object.assign({},s),{diffs:Mt(n,r,e.path)})}const m=St(e.value,e.root),g=St(t.value,t.root);if(void 0===m||void 0===g)return;const y=X(m,g,Object.assign(Object.assign({},n),{rules:r}),{before:{jsonPath:e.path,source:e.root},after:{jsonPath:t.path,source:t.root}});return f&&d&&a.set(u,Object.assign(Object.assign({},y),{path:e.path})),y}},lr={$:N,annotate:Nt},cr=(e,t)=>({$:e,annotate:t}),pr=({baseRules:e={},notMergeAllOf:t,version:r="draft-04",cache:n={}}={})=>{var a;const s=Object.assign(Object.assign(Object.assign({compare:ir(n),transform:[Zt(),tr(r)],mapping:nr,"/title":lr,"/multipleOf":cr(Ut("number",Yt),Dt),"/maximum":cr(Ut("number",Jt),Dt),"/minimum":cr(Ut("number",Wt),Dt)},"draft-04"===r?{"/exclusiveMaximum":cr(Ut("number",Gt),Dt),"/exclusiveMinimum":cr(Ut("number",Gt),Dt)}:{"/exclusiveMaximum":cr(Ut("number",Jt),Dt),"/exclusiveMinimum":cr(Ut("number",Wt),Dt)}),{"/maxLength":cr(Ut("string",Jt),Dt),"/minLength":cr(Ut("string",Wt),Dt),"/pattern":cr(Ut("string",[S,C,S]),Dt),"/maxItems":cr(Ut("array",Jt),Dt),"/minItems":cr(Ut("array",Wt),Dt),"/uniqueItems":cr(Ut("array",zt),Dt),"/maxProperties":cr(Ut("object",Jt),Dt),"/minProperties":cr(Ut("object",Wt),Dt),"/required":{mapping:sr,"/*":cr(Qt,Kt)},"/enum":{mapping:ar,annotate:Vt,"/*":{$:[C,S,S],annotate:Kt}},"/const":cr([S,C,S],Vt),"/type":{$:[S,C,S],annotate:Vt,"/*":{$:[C,S,S]}},"/not":()=>Object.assign(Object.assign({},te(s,re)),{$:q}),"/allOf":{compare:or,"/*":()=>Object.assign(Object.assign({},s),{$:q,annotate:Kt})},"/oneOf":{compare:or,"/*":()=>Object.assign(Object.assign({},s),{$:[C,S,S],annotate:Kt})},"/anyOf":{compare:or,"/*":()=>Object.assign(Object.assign({},s),{$:[C,S,S],annotate:Kt})},"/items":({value:e})=>((e,t)=>Array.isArray(e)?{"/*":()=>Object.assign(Object.assign({},t),{$:q,annotate:Kt})}:Object.assign(Object.assign({},t),{$:w,annotate:Vt}))(e,s),"/additionalItems":()=>Object.assign(Object.assign({},s),{$:[C,S,M],annotate:Vt}),"/properties":{"/*":()=>Object.assign(Object.assign({},s),{$:[C,S,M],annotate:Kt})},"/additionalProperties":()=>Object.assign(Object.assign({},s),{$:w,annotate:Vt}),"/patternProperties":{"/*":()=>Object.assign(Object.assign({},s),{$:[S,C,M],annotate:Kt})},"/propertyNames":()=>Object.assign(Object.assign({},s),{$:E,annotate:Dt}),"/description":lr,"/format":{$:[S,C,S],annotate:Vt},"/default":{$:[C,S,S],annotate:Vt},"/definitions":{"/*":()=>Object.assign(Object.assign({},s),{$:w})},"/$defs":{"/*":()=>Object.assign(Object.assign({},s),{$:w})},"/readOnly":{$:zt,annotate:Ht},"/writeOnly":{$:zt,annotate:Ht},"/deprecated":{$:B,annotate:Ht},"/examples":{$:N,annotate:Nt,"/*":{$:N,annotate:Bt}},"/**":{annotate:Nt,$:_}}),e);return t?s:Object.assign(Object.assign({},s),{transform:[...null!==(a=s.transform)&&void 0!==a?a:[],rr(r)]})},ur=(e,t,r={},n={})=>{var a,s;const o=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:pr({notMergeAllOf:r.notMergeAllOf}),annotateHook:null!==(s=r.annotateHook)&&void 0!==s?s:_t});return X(e,t,o,n)},fr=e=>{const t=e.indexOf("args");return 2===t||t>3&&"properties"===e[t-2]&&"properties"!==e[t-1]||t>2&&"directives"===e[t-2]&&"directives"!==e[t-1]},dr={add:"[Added] {{text}} to Argument `{{target}}`",add_target:"[Added] {{text}} to Argument `{{target}}`",add_target_schema:"[Added] {{text}} to Argument `{{target}}` of property `{{schema}}(...)`",add_target_directive:"[Added] {{text}} to Argument `{{target}}` of directive `@{{directive}}(...)`",remove:"[Removed] {{text}} from Argument {{target}}",remove_target:"[Removed] {{text}} from Argument `{{target}}`",remove_target_schema:"[Removed] {{text}} from Argument `{{target}}` of property `{{schema}}(...)`",remove_target_directive:"[Removed] {{text}} from Argument `{{target}}` of directive `@{{directive}}(...)`",replace:"[Replaced] {{text}} of Argument {{target}}",replace_target:"[Replaced] {{text}} of Argument `{{target}}`",replace_target_schema:"[Replaced] {{text}} of Argument `{{target}}` of property `{{schema}}(...)`",replace_target_directive:"[Replaced] {{text}} of Argument `{{target}}` of directive `@{{directive}}(...)`"},mr=Object.assign(Object.assign({},Tt),{directive:"directive `@{{key}}`",directive_definition:"difinition for directive `@{{key}}`",directive_meta:"directive meta `@{{key}}({{meta}})`",values_annotation:"possible values annotation ({{key}})",values_status:"possible values {{key}} status"}),gr=(e,t)=>{var r;let n=null===(r=t.rules)||void 0===r?void 0:r.annotate;if(!n||"components"===e.path[0]&&"directives"!==e.path[1])return"";if(fr(e.path)){const r=e.path.indexOf("args"),a=Object.assign(Object.assign({},e),{path:e.path.slice(r)}),s=Et(e.path.slice(0,r)),o="directives"===e.path[1]?e.path[2]:void 0,i=n(a,t);if(!i)return"";const l=Object.assign(Object.assign({},i),{params:Object.assign(Object.assign({},i.params),{schema:s,directive:o})});return ee(l,Object.assign(Object.assign({},mr),dr))}return ee(n(e,t),mr)},yr=({path:e,action:t},r)=>{const n=e[e.length-1],a=Et(e.slice(0,-4));switch(n){case"description":return Z(t,{text:Z("values_annotation",{key:n}),target:a});case"deprecated":return Z(t,{text:Z("values_status",{key:n}),target:a});case"reason":return Z(t,{text:Z("values_annotation",{key:"deprecation reason"}),target:a})}},hr=({path:e,action:t},r)=>{const n=e[e.length-1],a=e[e.length-2],s=Et(e);switch(a){case"directives":return Z(t,{text:Z("directive",{key:n,definition:"components"===e[0]?1:void 0}),target:s});case"deprecated":return Z(t,{text:Z("reason",{key:n}),target:s});case"meta":return Z(t,{text:Z("directive",{key:e[e.length-3],meta:n}),target:Et(e.slice(0,-4))})}},br={ScalarTypeDefinition:"scalars",ObjectTypeDefinition:"objects",InterfaceTypeDefinition:"interfaces",InputObjectTypeDefinition:"inputObjects",DirectiveDefinition:"directives",UnionTypeDefinition:"unions",EnumTypeDefinition:"enums"},vr={query:"query",mutation:"mutation",subscription:"subscription"},Or=["args","values","interfaces","directives"],$r=F(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);for(const n of Object.values(br))!(n in e)&&n in t&&(r[n]={});return r})),jr=F(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);for(const n of Or)if(!(n in e)&&n in t&&(r[n]={}),"values"===n&&n in t){const e=t[n];for(const t of Object.keys(e))t in r[n]||(r[n][t]={})}return"nullable"in e&&!e.nullable&&delete r.nullable,r})),xr=F(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;if("meta"in e){const{meta:t}=e;return oe(e,["meta"]),{meta:t}}return"meta"in t?{meta:{}}:{}})),kr=F(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);for(const n of Object.values(vr))!(n in e)&&n in t&&(r[n]={});return r})),Ar=F(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);return!("args"in e)&&"args"in t&&(r.args={type:"object",properties:{}}),!("locations"in e)&&"locations"in t&&(r.locations=[]),r})),Rr=F((e=>ft(e,{rules:it,mergeCombinarySibling:!0,mergeRefSibling:!0}))),Sr=(e=!1)=>{const t=pr({notMergeAllOf:!0,baseRules:{transform:[Zt(),tr(),jr],"/nullable":{$:[C,S,C],annotate:Vt},"/specifiedByURL":{$:N},"/args":()=>Object.assign({},Sr()),"/values":{"/*":{"/description":{annotate:yr,$:N},"/deprecated":{annotate:yr,$:B,"/reason":{annotate:yr,$:B}}}},"/deprecated":{$:B,annotate:Ht,"/reason":{annotate:hr,$:B}},"/interfaces":{"/*":{$:N}},"/directives":{"/*":{annotate:hr,transform:[xr],"/meta":{"/*":{annotate:hr,$:N}}}}}});return e?te(t,re):t},Cr=({notMergeAllOf:e=!1}={})=>{const t=Sr(),r=Sr(!0);return{transform:[...e?[]:[Rr],kr],"/queries":{"/*":r},"/mutations":{"/*":r},"/subscriptions":{"/*":r},"/components":{transform:[$r],"/*":{"/*":r},"/directives":{"/*":{annotate:hr,transform:[Ar],$:T,"/title":{$:N},"/description":{$:N},"/locations":{mapping:ar,$:N},"/repeatable":{$:N},"/args":t}}}}},Mr=(e,t,r={},n={})=>{var a,s;const o=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:Cr(),annotateHook:null!==(s=r.annotateHook)&&void 0!==s?s:gr});return X(e,t,o,n)},Pr=(e,t)=>{if(!(c(e)&&c(t)&&"asyncapi"in e&&"asyncapi"in t))return;const r=String(e.asyncapi).charAt(0);return r===String(t.asyncapi).charAt(0)?`${r}.x`:""},Ir=()=>{const e=te(pr(),re),t=pr(),r=ir(),n={$:T,"/location":{$:T},"/description":{$:N}},a={$:_,"/*":{$:_,compare:r,"/*":{$:_},"/query":()=>e,"/headers":()=>t}},s={transform:[er("tags","traits","bindings","examples")],"/summary":{$:N},"/tags":{$:N},"/externalDocs":{$:N},"/bindings":a},o=Object.assign({$:T,"/*":{$:T},"/operationId":{$:N},"/description":{$:N}},s),i=Object.assign({$:T,"/*":{$:T},"/headers":{$:_},"/correlationId":n,"/schemaFormat":{$:q},"/contentType":{$:T},"/name":{$:w},"/title":{$:w},"/examples":{$:N}},s),l=(r=!1)=>Object.assign({$:q,"/headers":{$:_},"/correlationId":n,"/schemaFormat":{$:q},"/contentType":{$:T},"/name":{$:w},"/title":{$:N},"/description":{$:N},"/examples":{$:N},"/traits":i,"/payload":()=>Object.assign(Object.assign({},r?e:t),{$:q})},s),c=(e=!1)=>Object.assign({$:T,"/operationId":{$:N},"/description":{$:N},"/traits":o,"/message":l(e)},s),p={$:N,"/version":{$:N},"/termsOfService":{$:N},"/license":{$:N,"/name":{$:N},"/url":{$:N}},"/title":{$:N},"/description":{$:N},"/contact":{$:N,"/name":{$:N},"/url":{$:N},"/email":{$:N}}},u={$:N,"/*":{compare:r,transform:[er("variables","bindings","security")],$:N,"/url":{$:N},"/description":{$:N},"/protocol":{$:N},"/protocolVersion":{$:N},"/variables":{$:N,"/*":{compare:r,$:N,"/enum":{$:N,"/*":{$:N}},"/default":{$:N},"/description":{$:N},"/examples":{$:N}}},"/security":{$:N,"/*":{$:N}},"/bindings":a}},f={compare:r,transform:[er("parameters","bindings")],$:T,"/description":{$:N},"/bindings":a,"/subscribe":c(!0),"/publish":c(!1),"/parameters":{$:q,"/*":{compare:r,$:T,"/description":{$:N},"/schema":()=>Object.assign(Object.assign({},t),{$:q}),"/location":{$:q}}}};return{transform:[er("channels","components","tags","servers")],"/asyncapi":{$:N},"/id":{$:N},"/defaultContentType":{$:q},"/info":p,"/servers":u,"/channels":{$:T,"/*":f},"/components":{"/*":{$:N}},"/tags":{$:N},"/externalDocs":{$:N}}},wr=(e,t,r={},n={})=>{var a;const s=Pr(e,t);if("2.x"!==s)throw new Error(`Unsupported version: ${s}`);const o=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:Ir()});return X(e,t,o,n)},qr=e=>!!Array.isArray(e)&&(!!e&&(0===e.length||1===e.length&&0===Object.keys(e[0]).length)),Er=(e=[],t=[])=>{if(!Array.isArray(e)||!Array.isArray(t))return!1;const r=new Set(e.map((e=>Object.keys(e)[0])));for(const e of t)if(!r.has(Object.keys(e)[0]))return!1;return!0},Tr=({before:e,after:t})=>{if("string"!=typeof e.path[1]||"string"!=typeof t.path[1])return{};const r=[...e.path[1].matchAll(new RegExp("{(.*?)}","g"))].map((e=>e.pop())),n=[...t.path[1].matchAll(new RegExp("{(.*?)}","g"))].map((e=>e.pop())),a={};for(let e=0;e<r.length&&e<n.length;e++)a[r[e]]=n[e];return a},_r=e=>{switch(e){case"query":case"cookie":return"form";case"path":case"header":return"simple"}},Nr=e=>"responses"===e[3]&&"schema"===e[7],Br=e=>"requestBody"===e[3]&&"schema"===e[6],Dr=e=>"parameters"===e[2]&&"schema"===e[4]||"parameters"===e[3]&&"schema"===e[5],Hr=(e,t)=>{if(!(a(e)&&a(t)&&"openapi"in e&&"openapi"in t))return;return(e.openapi>t.openapi?e.openapi:t.openapi).startsWith("3.1")?"3.1.x":"3.0.x"},Vr=[({after:e})=>"form"===e.value?P:S,({before:e})=>"form"===e.value?P:S,S],Kr=[({after:e})=>e.value&&"form"===O(e.parent,"style")||!e.value&&"form"!==O(e.parent,"style")?P:S,({before:e})=>e.value&&"form"===O(e.parent,"style")||!e.value&&"form"!==O(e.parent,"style")?P:S,S],Lr=[C,S,({before:e})=>"path"===O(e.parent,"in")?C:S],Fr=[S,C,e=>O(e.after.parent,"schema","default")?C:Ft(e)],Ur=[S,C,({before:e,after:t})=>{var r;const n=L(e,""),a=null!==(r=O(null==n?void 0:n.value,"style"))&&void 0!==r?r:"form";return"query"===O(null==n?void 0:n.value,"in")&&"form"===a?"object"===e.value||"array"===e.value||"object"===t.value?S:C:S}],Jr=[({after:e})=>O(e.value,"required")&&!f(O(e.value,"schema","default"))?S:C,S,M],Wr=[({after:e})=>qr(e.value)?C:S,C,({after:e,before:t})=>Er(e.value,t.value)||qr(e.value)?C:S],Gr=[({before:e})=>u(e.parent)?C:S,({after:e})=>u(e.parent)?C:S,({after:e,before:t})=>Er(e.parent,t.parent)||qr(e.value)?C:S],zr=[({before:e,after:t})=>qr(t.value)||Er(t.value,O(e.root,"security"))?C:S,({before:e,after:t})=>Er(O(t.root,"security"),e.value)?C:S,({before:e,after:t})=>Er(t.value,e.value)||qr(t.value)?C:S],Yr=[({before:e})=>u(e.parent)?C:S,({after:e})=>u(e.parent)?S:C,({before:e,after:t})=>Er(t.parent,e.parent)||qr(t.value)?C:S],Qr={requestBodySchema:"{{schemaChange}} in Request Body content ({{contentType}})",responseSchema:"{{schemaChange}} in Response {{responseCode}} content ({{contentType}})",parameterSchema:"{{schemaChange}} in {{in}} parameter `{{name}}`",add:"[Added] {{text}}",add_target:"[Added] {{text}} to {{target}}",remove:"[Removed] {{text}}",remove_target:"[Removed] {{text}} from {{target}}",replace:"[Replaced] {{text}}",replace_target:"[Replaced] {{text}} of {{target}}",rename:"[Renamed] {{text}}",rename_target:"[Renamed] {{text}} of {{target}}",param:"{{in}} parameter `{{name}}`",param_required:"required {{in}} parameter `{{name}}`",status:"{{key}} status",method:"operation {{method}} {{path}}",annotation:"annotation ({{key}})",security:"some security details",document:"document metadata ({{key}})",requestBody:"Request Body",requestBody_contentType:"Request Body content ({{contentType}})",response:"Response {{responseCode}}",response_contentType:"Response {{responseCode}} content ({{contentType}})",contentType:"Content type",encoding:"Encoding details",encoding_key:"Encoding details ({{key}})"},Xr=(e,t)=>{var r;let n=null===(r=t.rules)||void 0===r?void 0:r.annotate;if(!n||"components"===e.path[0])return"";if(Nr(e.path)){const r=ee(n(e,t),Tt);n=()=>Z("responseSchema",{schemaChange:r,responseCode:e.path[4],contentType:e.path[6]})}else if(Br(e.path)){const r=ee(n(e,t),Tt);n=()=>Z("requestBodySchema",{schemaChange:r,contentType:e.path[5]})}else if(Dr(e.path)){const r=ee(n(e,t),Tt),{root:a}="add"===e.action?t.after:t.before,s=e.path.slice(0,"parameters"===e.path[2]?4:5),o=j(a,...s);n=()=>Z("parameterSchema",Object.assign(Object.assign({},St(o,a)),{schemaChange:r}))}return ee(n(e,t),Qr)},Zr=({action:e,path:t})=>Z(e,{text:Z("method",{path:t[1],method:String(t[2]).toUpperCase()})}),en=({action:e,path:t})=>Z(e,{text:Z("document",{key:t.join(".")})}),tn=({action:e})=>Z(e,{text:Z("security")}),rn=({path:e,action:t})=>{const r=e[e.length-1];return Z(t,"required"===r||"deprecated"===r?{text:Z("status",{key:r}),target:Z("requestBody")}:{text:Z("annotation",{key:r}),target:Z("requestBody")})},nn=({path:e,action:t})=>{const r=e[4],n=e[e.length-1];return Z(t,r===n?{text:Z("response",{responseCode:r})}:{text:Z("annotation",{key:n}),target:Z("response",{responseCode:r})})},an=({path:e,action:t},r)=>{const n=Nr(e)?e[6]:e[5],a=Nr(e)?e[4]:void 0,s=Nr(e)?Z("response",{contentType:n,responseCode:a}):Z("requestBody",{contentType:n}),o=e[e.length-1];return Z(t,n&&n!==o?{text:Z("annotation",{key:o}),target:s}:{text:Z("contentType"),target:s})},sn=({path:e,action:t},r)=>{const n=Nr(e)?e[6]:e[5],a=Nr(e)?e[4]:void 0,s=Nr(e)?Z("response",{contentType:n,responseCode:a}):Z("requestBody",{contentType:n}),o=(Nr(e)?e.slice(8):e.slice(7)).join(".");return Z(t,{text:Z("encoding",{key:o}),target:s})},on=({path:e,action:t},r)=>{const{key:n}="add"===t?r.after:r.before;if("deprecated"===n)return r.after.value?Z("add",{text:Z("status",{key:n})}):r.before.value?Z("remove",{text:Z("status",{key:n})}):void 0;if("requestBody"===n)return Z(t,{text:Z(n)});if("number"==typeof n){const{value:n}="add"===t?r.after:r.before;return Z(t,{text:Z("annotation",{key:`${e[e.length-2]}: ${n}`})})}return Z(t,{text:Z("annotation",{key:n})})},ln=({action:e},t)=>{const{path:r,root:n,key:a}="add"===e?t.after:t.before,s=r.slice(0,"parameters"===r[2]?4:5),o=j(n,...s),i=St(o,n);return Z(e,"required"===a||"deprecated"===a?{text:Z("status",{key:a}),target:Z("param",i)}:{text:Z("param",i)})},cn=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=h(e),a=n.map((e=>e.replace(new RegExp("{.*?}","g"),"*"))),s=h(t),o=s.map((e=>e.replace(new RegExp("{.*?}","g"),"*"))),i=new Set(s.keys());for(let e=0;e<n.length;e++){const t=o.indexOf(a[e]);t<0?r.removed.push(n[e]):(r.mapped[n[e]]=s[t],i.delete(t))}return i.forEach((e=>r.added.push(s[e]))),r},pn=(e,t,r)=>{var n;const a={added:[],removed:[],mapped:{}},s=Tr(r),o=new Set(t.keys()),i=e.map((e=>St(e,r.before.root))),l=t.map((e=>St(e,r.after.root)));for(let t=0;t<i.length;t++){const r=$(e[t],"in"),i=null!==(n=$(e[t],"name"))&&void 0!==n?n:"",c=l.findIndex((e=>{var t;const n=$(e,"in"),a=null!==(t=$(e,"name"))&&void 0!==t?t:"";return r===n&&(i===a||"path"===r&&s[i]===a)}));c<0?a.removed.push(t):(a.mapped[t]=c,o.delete(c))}return o.forEach((e=>a.added.push(e))),a},un=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=h(e),a=n.map((e=>{var t;return null!==(t=e.split(";")[0])&&void 0!==t?t:""})),s=h(t),o=s.map((e=>{var t;return null!==(t=e.split(";")[0])&&void 0!==t?t:""})),i=new Set(s.keys());for(let e=0;e<n.length;e++){const t=o.findIndex((t=>{const[r,n]=t.split("/"),[s,o]=a[e].split("/");return(r===s||"*"===r||"*"===s)&&(n===o||"*"===n||"*"===o)}));t<0||!i.has(t)?r.removed.push(n[e]):(r.mapped[n[e]]=s[t],i.delete(t))}return i.forEach((e=>r.added.push(s[e]))),r},fn=F((e=>{if(!c(e))return e;const t=["get","put","post","delete","options","head","patch","trace"],r=h(e).reduce(((r,n)=>(t.includes(n)||(r[n]=e[n]),r)),{});if(!h(r).length)return e;const n={};for(const a of t){if(!l(e,a)||"object"!=typeof e[a]||!e[a])continue;const t=Object.assign({},e[a]),{parameters:s,servers:o}=r,i=oe(r,["parameters","servers"]);s&&Array.isArray(s)&&("parameters"in t&&Array.isArray(t.parameters)?t.parameters=[...t.parameters,...s]:t.parameters=s),o&&Array.isArray(o)&&("servers"in t&&Array.isArray(t.servers)?t.servers=[...t.servers,...o]:t.servers=o);for(const e of h(i))l(t,e)||(t[e]=i[e]);n[a]=t}return n})),dn=F(((e,t)=>{if(!c(e)||!c(t))return e;const r=Object.assign({},e);return!("tags"in e)&&"tags"in t&&(r.tags=[]),"deprecated"in r&&!r.deprecated&&delete r.deprecated,r})),mn=(e,t)=>{if(!c(e)||!c(t))return[e,t];const{added:r,removed:n}=cn(e,t);return[r.reduce(((e,t)=>b(e,t,{[t]:{}})),Object.assign({},e)),n.reduce(((e,t)=>b(e,t,{[t]:{}})),Object.assign({},t))]},gn=F(((e,t)=>{if(!c(e)||!c(t))return e;const r=Object.assign({},e);if("in"in e&&!("style"in e)&&"style"in t){const t=_r(e.in);t&&(r.style=t)}return"style"in r&&"explode"in e&&"explode"in t&&"form"===r.style&&(r.explode=!0),"deprecated"in r&&!r.deprecated&&delete r.deprecated,"required"in r&&!r.required&&delete r.required,r})),yn=F(((e,t)=>(c(e)&&c(t),e))),hn=(e={})=>{const t="3.0.x"===e.version?"draft-04":"2020-12",r=pr({baseRules:{transform:[Zt([...Ot,"discriminator"]),tr(t),yn],"/nullable":{$:zt,annotate:Vt},"/discriminator":{$:_,annotate:Nt},"/example":{$:N,annotate:Nt},"/externalDocs":{$:N,annotate:Nt,"/*":{$:N}},"/xml":{}},notMergeAllOf:e.notMergeAllOf,version:t});return e.response?te(r,re):r},bn=e=>({$:e,annotate:ln}),vn={$:N,annotate:en},On={$:N,annotate:on},$n=(e={})=>{const t=hn(e),r=hn(Object.assign(Object.assign({},e),{response:!0})),n=ir(),a={$:N,"/**":{$:N},"/*":{"/variables":{"/*":{"/enum":{mapping:ar}}}}},s={"/*":{annotate:ln,compare:n,transform:[gn],$:Jr,"/name":bn(Lr),"/in":bn([C,S,S]),"/schema":()=>Object.assign(Object.assign({},t),{$:q,"/type":Object.assign(Object.assign({},t["/type"]),{$:Ur})}),"/explode":bn(Kr),"/style":bn(Vr),"/description":bn(N),"/required":bn(Fr),"/deprecated":bn(B)}},o={$:[C,S,S],"/*":{$:[C,S,S],compare:n,"/description":{$:N},"/required":{$:[S,C,Ft]},"/deprecated":{$:B}}},i={annotate:an,$:[C,S,S],mapping:un,"/*":{annotate:an,"/*":{annotate:an},$:[C,S,C],"/schema":({path:e})=>Object.assign(Object.assign({},Nr(e)?r:t),{$:q}),"/example":{$:N},"/examples":{$:N,compare:n},"/encoding":{annotate:sn,$:[S,C,S],"/*":{"/contentType":{$:[C,S,S]},"/headers":o,"/style":{$:[C,S,S]},"/explode":{$:[C,S,S]},"/allowReserved":{$:[C,S,S]}},"/**":{annotate:sn}}}},l={"/*":{annotate:rn},$:[C,S,S],compare:n,"/description":{$:N},"/content":i,"/required":{$:[S,C,Ft]}},c={$:[C,S,S],mapping:W,"/*":{annotate:nn,"/*":{annotate:nn},$:[C,S,S],compare:n,"/description":{$:N},"/headers":o,"/content":i}};return{"/openapi":vn,"/info":Object.assign(Object.assign({},vn),{"/**":vn}),"/servers":a,"/paths":{transform:[mn],mapping:cn,"/*":{$:[M,M,C],transform:[fn],compare:n,"/summary":{$:N},"/description":{$:N},"/*":{annotate:Zr,$:[C,S,M],transform:[dn],"/*":On,"/tags":Object.assign(Object.assign({},On),{mapping:ar,"/*":On}),"/parameters":Object.assign(Object.assign({},s),{$:[C,S,S],mapping:pn}),"/requestBody":l,"/callbacks":{"/*":{compare:n}},"/responses":c,"/deprecated":{$:B},"/security":{"/**":{annotate:tn},$:zr,"/*":{$:Yr,"/*":{$:T,mapping:ar,"/*":{$:T}}}},"/servers":a},"/servers":a,"/parameters":Object.assign(Object.assign({},s),{$:[C,S,S],mapping:pn})}},"/components":{$:w,"/schemas":{$:[C,S,S],"/*":()=>Object.assign(Object.assign({},t),{$:T})},"/responses":{$:[C,S,S],"/*":c},"/parameters":{$:[C,S,S],"/*":s},"/examples":{$:N},"/requestBodies":{$:[C,S,S],"/*":l},"/headers":o,"/securitySchemes":{$:[S,C,S],"/*":{$:[S,C,S],"/type":{$:[S,C,S]},"/description":{$:N},"/name":{$:[S,C,S]},"/in":{$:[S,C,S]},"/scheme":{$:[S,C,S]},"/bearerFormat":{$:N},"/flows":{$:[S,C,S]},"/openIdConnectUrl":{$:N}}}},"/security":{$:Wr,"/*":{$:Gr}},"/tags":{$:N},"/externalDocs":{$:N}}},jn=(e,t,r={},n={})=>{var a,s;const{notMergeAllOf:o}=r,i=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:$n({notMergeAllOf:o}),version:Hr(e,t),annotateHook:null!==(s=r.annotateHook)&&void 0!==s?s:Xr});return X(e,t,i,n)},xn=e=>c(e)?"openapi"in e&&d(e.openapi)&&/3.+/.test(e.openapi)?jn:"asyncapi"in e&&d(e.asyncapi)&&/2.+/.test(e.asyncapi)?wr:"graphapi"in e&&e.graphapi?Mr:ur:ur;return e.ClassifierType=R,e.DIFF_META_KEY=k,e.DiffAction=A,e.addNonBreaking=T,e.allAnnotation=N,e.allBreaking=q,e.allDeprecated=B,e.allNonBreaking=w,e.allUnclassified=_,e.annotation=P,e.annotationTemplate=Z,e.apiCompare=(e,t,r={})=>xn(e)(e,t,r),e.apiDiff=(e,t,r={})=>{const n=xn(e),{diffs:a}=n(e,t,r);return a},e.apiMerge=(e,t,r={})=>{const n=xn(e),{merged:a}=n(e,t,r);return a},e.arrayMappingResolver=U,e.asyncApi2Rules=Ir,e.booleanClassifier=zt,e.breaking=S,e.breakingIf=Lt,e.breakingIfAfterTrue=Ft,e.buildPath=kt,e.caseInsensitiveKeyMappingResolver=W,e.changeDiffsPath=Mt,e.combinaryCompareResolver=or,e.compare=X,e.compareAsyncApi=wr,e.compareGraphApi=Mr,e.compareJsonSchema=ur,e.compareOpenApi=jn,e.compareTransformationFactory=F,e.contentChangeAnnotation=an,e.contentMediaTypeMappingResolver=un,e.convertDiffToMeta=V,e.createAnnotation=ee,e.createChildContext=z,e.createContext=G,e.createDiff=D,e.createEmptyCombiner=qt,e.createFields=er,e.createMergeMeta=K,e.createRefsCompareResolver=ir,e.deprecated=I,e.diffFactory=H,e.discoverCompareEngine=xn,e.documentChangeAnnotation=en,e.emptySecurity=qr,e.encodingChangeAnnotation=sn,e.enumMappingResolver=ar,e.excludeKeys=v,e.exclusiveClassifier=Gt,e.filterObj=(e,t)=>{const r={};for(const n of h(e))t(n,e)&&(r[n]=e[n]);return r},e.getArrayValue=(e,...t)=>{const r=O(e,...t);return Array.isArray(r)?r:void 0},e.getAsyncApiVersion=Pr,e.getBooleanValue=(e,...t)=>{const r=O(e,...t);return"boolean"==typeof r?r:"string"!=typeof r||"true"!==r&&"false"!==r?void 0:Boolean(r)},e.getCompareId=Rt,e.getDefaultStyle=_r,e.getKeyValue=O,e.getMaxOpenApiVersion=Hr,e.getNumberValue=(e,...t)=>{const r=O(e,...t);return"number"==typeof r?r:"string"==typeof r&&+r?+r:void 0},e.getObjectValue=j,e.getParentContext=L,e.getRef=Ct,e.getStringValue=$,e.getTarget=Et,e.globalSecurityClassifyRule=Wr,e.globalSecurityItemClassifyRule=Gr,e.graphApiAnnotateHook=gr,e.graphApiComponents=br,e.graphApiMergeAllOf=Rr,e.graphApiOperations=vr,e.graphApiRules=Cr,e.graphApiSchemaRules=Sr,e.graphSchemaCustomProps=Or,e.includeSecurity=Er,e.inferTypes=jt,e.isAllOfNode=function(e){return e&&e.allOf&&Array.isArray(e.allOf)},e.isArgSchema=fr,e.isArray=p,e.isCycleRef=At,e.isExist=f,e.isFunc=g,e.isKey=l,e.isNotEmptyArray=u,e.isNumber=m,e.isObject=c,e.isParameterSchema=Dr,e.isRequestBodySchema=Br,e.isResponseSchema=Nr,e.isString=d,e.isValidSchemaTypes=xt,e.isValidType=e=>"string"==typeof e&&gt.includes(e),e.joinPath=x,e.jsonSchemaAllowedSibling=Ot,e.jsonSchemaAnnotationHook=_t,e.jsonSchemaAnnotations=Tt,e.jsonSchemaCommonProps=ht,e.jsonSchemaDefinitionsPath=["$defs","definitions"],e.jsonSchemaKeyChange=Vt,e.jsonSchemaMappingResolver=nr,e.jsonSchemaMergeAllOf=rr,e.jsonSchemaNodeMetaProps=yt,e.jsonSchemaRules=pr,e.jsonSchemaTypeProps=vt,e.jsonSchemaTypes=gt,e.jsonSchemaValidators=bt,e.mapPathParams=Tr,e.maxClassifier=Jt,e.mergeAllOfSibling=It,e.mergeCombinarySibling=Pt,e.mergeRefSibling=wt,e.minClassifier=Wt,e.multipleOfClassifier=Yt,e.nonBreaking=C,e.objectKeys=h,e.objectMappingResolver=J,e.onlyAddBreaking=E,e.openApi3AnnotateHook=Xr,e.openApiSchemaRules=hn,e.openapi3Rules=$n,e.operationChangeAnnotation=on,e.operationSecurityChangeAnnotation=tn,e.operationSecurityClassifyRule=zr,e.operationSecurityItemClassifyRule=Yr,e.paramClassifyRule=Jr,e.paramMappingResolver=pn,e.paramSchemaTypeClassifyRule=Ur,e.parameterChangeAnnotation=ln,e.parameterExplodeClassifyRule=Kr,e.parameterNameClassifyRule=Lr,e.parameterRequiredClassifyRule=Fr,e.parameterStyleClassifyRule=Vr,e.parentKeyChangeAnnotation=hr,e.pathMappingResolver=cn,e.pathMethodChangeAnnotation=Zr,e.requestBodyChangeAnnotation=rn,e.requiredItemClassifyRule=Qt,e.requiredMappingResolver=sr,e.resolveRef=St,e.resolveRefNode=$t,e.responseChangeAnnotation=nn,e.reverseClassifyRule=ae,e.reverseClassifyRuleTransformer=re,e.schemaAnnotationChange=Nt,e.schemaExampleChange=Bt,e.schemaKeyItemChange=Kt,e.schemaStatusChange=Ht,e.schemaValidationChange=Dt,e.setKeyValue=b,e.transformClassifyRule=se,e.transformComapreRules=te,e.transformGraphApiComponents=$r,e.transformGraphApiDirective=Ar,e.transformGraphApiDocument=kr,e.transformGraphSchema=jr,e.transformJsonSchema=tr,e.transformJsonSchemaCombiners=Zt,e.transformOpenApiSchema=yn,e.transformOperation=dn,e.transformParameterItem=gn,e.transformPathItems=fn,e.transformPaths=mn,e.transfromGraphSchemaDirective=xr,e.typeClassifier=Ut,e.typeOf=y,e.unclassified=M,e.unwrapArrayOrNull=function(e){return Array.isArray(e)?e:null},e.unwrapStringOrNull=function(e){return"string"==typeof e?e:null},e.valuesAnnotationChange=yr,e.valuesTransformation=Xt,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=api-smart-diff.min.js.map
import type { ComapreOptions, CompareEngine } from "./types";
export declare const discoverCompareEngine: (data: any) => CompareEngine;
export declare const discoverCompareEngine: (data: unknown) => CompareEngine;
export declare const apiMerge: (before: unknown, after: unknown, options?: ComapreOptions) => any;
export declare const apiDiff: (before: unknown, after: unknown, options?: ComapreOptions) => import("./types").Diff[];
export declare const apiCompare: (before: unknown, after: unknown, options?: ComapreOptions) => import("./types").CompareResult;
{
"name": "api-smart-diff",
"version": "1.0.0",
"version": "1.0.1",
"description": "Generate the diff between two API specifications (OpenAPI, AsyncAPI, GraphApi, JsonSchema)",

@@ -5,0 +5,0 @@ "module": "dist/index.mjs",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc