From 9ef4b5a4a098ca01e82ea6622aa82e6c70d27b9c Mon Sep 17 00:00:00 2001 From: Robert Mosolgo Date: Fri, 23 Feb 2024 12:47:43 -0500 Subject: [PATCH] Update GraphiQL and dependencies --- .../javascripts/graphiql/rails/application.js | 6 +- .../graphiql/rails/graphiql-2.4.1.js | 3 - .../graphiql/rails/graphiql-3.1.1.js | 83731 ++++++++++++++++ .../graphiql/rails/react-17.0.2.js | 31 - .../graphiql/rails/react-18.2.0.js | 31 + .../graphiql/rails/react-dom-17.0.2.js | 245 - .../graphiql/rails/react-dom-18.2.0.js | 267 + .../graphiql/rails/application.css | 2 +- ...{graphiql-2.4.1.css => graphiql-3.1.1.css} | 308 +- 9 files changed, 84339 insertions(+), 285 deletions(-) delete mode 100644 app/assets/javascripts/graphiql/rails/graphiql-2.4.1.js create mode 100644 app/assets/javascripts/graphiql/rails/graphiql-3.1.1.js delete mode 100644 app/assets/javascripts/graphiql/rails/react-17.0.2.js create mode 100644 app/assets/javascripts/graphiql/rails/react-18.2.0.js delete mode 100644 app/assets/javascripts/graphiql/rails/react-dom-17.0.2.js create mode 100644 app/assets/javascripts/graphiql/rails/react-dom-18.2.0.js rename app/assets/stylesheets/graphiql/rails/{graphiql-2.4.1.css => graphiql-3.1.1.css} (87%) diff --git a/app/assets/javascripts/graphiql/rails/application.js b/app/assets/javascripts/graphiql/rails/application.js index a421752..bf8eb8a 100644 --- a/app/assets/javascripts/graphiql/rails/application.js +++ b/app/assets/javascripts/graphiql/rails/application.js @@ -1,5 +1,5 @@ -//= require ./react-17.0.2 -//= require ./react-dom-17.0.2 +//= require ./react-18.2.0 +//= require ./react-dom-18.2.0 //= require ./fetch-0.10.1 -//= require ./graphiql-2.4.1 +//= require ./graphiql-3.1.1 //= require ./graphiql_show diff --git a/app/assets/javascripts/graphiql/rails/graphiql-2.4.1.js b/app/assets/javascripts/graphiql/rails/graphiql-2.4.1.js deleted file mode 100644 index d600cc4..0000000 --- a/app/assets/javascripts/graphiql/rails/graphiql-2.4.1.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see graphiql.min.js.LICENSE.txt */ -!function(){var e,t,n={8042:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,n=function(){"use strict";function e(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}Object.defineProperty(t,"__esModule",{value:!0});const n=Symbol(),r=Symbol();function i(){let t=!0;const i=[];let o=e();const a=e(),s=async function*(){for(;;)if(i.length>0)yield i.shift();else{const e=await Promise.race([o.promise,a.promise]);if(e===n)break;if(e!==r)throw e}}();const l=s.return.bind(s);s.return=function(){return t=!1,a.resolve(n),l(...arguments)};const u=s.throw.bind(s);return s.throw=e=>(t=!1,a.resolve(e),u(e)),{pushValue:function(n){!1!==t&&(i.push(n),o.resolve(r),o=e())},asyncIterableIterator:s}}t.applyAsyncIterableIteratorToSink=function(e,t){return(async()=>{try{for await(const n of e)t.next(n);t.complete()}catch(e){t.error(e)}})(),()=>{var t;null===(t=e.return)||void 0===t||t.call(e)}},t.isAsyncIterable=function(e){return"object"==typeof e&&null!==e&&("AsyncGenerator"===e[Symbol.toStringTag]||Symbol.asyncIterator&&Symbol.asyncIterator in e)},t.makeAsyncIterableIteratorFromSink=e=>{const{pushValue:t,asyncIterableIterator:n}=i(),r=e({next:e=>{t(e)},complete:()=>{n.return()},error:e=>{n.throw(e)}}),o=n.return;let a;return n.return=()=>(void 0===a&&(r(),a=o()),a),n},t.makePushPullAsyncIterableIterator=i},void 0===(r=n.apply(t,[]))||(e.exports=r)},7674:function(e,t,n){var r,i;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,void 0===(i="function"==typeof(r=function(){"use strict";var e=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},r=function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||e(n,t,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(5313),t),r(n(6718),t),r(n(863),t)})?r.apply(t,[]):r)||(e.exports=i)},5609:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,void 0===(r="function"==typeof(n=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.R=e.P=void 0;var t=Object.defineProperty,n=(e,n)=>t(e,"name",{value:n,configurable:!0});class r{constructor(e,t){this.containsPosition=e=>this.start.line===e.line?this.start.character<=e.character:this.end.line===e.line?this.end.character>=e.character:this.start.line<=e.line&&this.end.line>=e.line,this.start=e,this.end=t}setStart(e,t){this.start=new i(e,t)}setEnd(e,t){this.end=new i(e,t)}}e.R=r,n(r,"Range");class i{constructor(e,t){this.lessThanOrEqualTo=e=>this.linei(e,"name",{value:t,configurable:!0});function a(e,n){const i={schema:e,type:null,parentType:null,inputType:null,directiveDef:null,fieldDef:null,argDef:null,argDefs:null,objectFieldDefs:null};return(0,r.f)(n,(n=>{var r,o;switch(n.kind){case"Query":case"ShortQuery":i.type=e.getQueryType();break;case"Mutation":i.type=e.getMutationType();break;case"Subscription":i.type=e.getSubscriptionType();break;case"InlineFragment":case"FragmentDefinition":n.type&&(i.type=e.getType(n.type));break;case"Field":case"AliasedField":i.fieldDef=i.type&&n.name?s(e,i.parentType,n.name):null,i.type=null===(r=i.fieldDef)||void 0===r?void 0:r.type;break;case"SelectionSet":i.parentType=i.type?(0,t.getNamedType)(i.type):null;break;case"Directive":i.directiveDef=n.name?e.getDirective(n.name):null;break;case"Arguments":const a=n.prevState?"Field"===n.prevState.kind?i.fieldDef:"Directive"===n.prevState.kind?i.directiveDef:"AliasedField"===n.prevState.kind?n.prevState.name&&s(e,i.parentType,n.prevState.name):null:null;i.argDefs=a?a.args:null;break;case"Argument":if(i.argDef=null,i.argDefs)for(let e=0;ee.value===n.name)):null;break;case"ListValue":const c=i.inputType?(0,t.getNullableType)(i.inputType):null;i.inputType=c instanceof t.GraphQLList?c.ofType:null;break;case"ObjectValue":const d=i.inputType?(0,t.getNamedType)(i.inputType):null;i.objectFieldDefs=d instanceof t.GraphQLInputObjectType?d.getFields():null;break;case"ObjectField":const f=n.name&&i.objectFieldDefs?i.objectFieldDefs[n.name]:null;i.inputType=null==f?void 0:f.type;break;case"NamedType":i.type=n.name?e.getType(n.name):null}})),i}function s(e,r,i){return i===n.S.name&&e.getQueryType()===r?n.S:i===n.T.name&&e.getQueryType()===r?n.T:i===n.a.name&&(0,t.isCompositeType)(r)?n.a:r&&r.getFields?r.getFields()[i]:void 0}function l(e,t){for(let n=0;nn(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};!function(e){function t(t){return function(n,i){var o=i.line,a=n.getLine(o);function s(t){for(var r,s=i.ch,l=0;;){var u=s<=0?-1:a.lastIndexOf(t[0],s-1);if(-1!=u){if(1==l&&ut.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:r.end,end:e.Pos(i,a)}}}r(i,"hasImport");var o,a=n.line,s=i(a);if(!s||i(a-1)||(o=i(a-2))&&o.end.line==a-1)return null;for(var l=s.end;;){var u=i(l.line+1);if(null==u)break;l=u.end}return{from:t.clipPos(e.Pos(a,s.startCh+1)),to:l}})),e.registerHelper("fold","include",(function(t,n){function i(n){if(nt.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}r(i,"hasInclude");var o=n.line,a=i(o);if(null==a||null!=i(o-1))return null;for(var s=o;null!=i(s+1);)++s;return{from:e.Pos(o,a+1),to:t.clipPos(e.Pos(s))}}))}(t.a.exports);var a=i({__proto__:null,default:o.exports},[o.exports]);e.b=a})?r.apply(t,i):r)||(e.exports=o)},5728:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535)],void 0===(o="function"==typeof(r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.c=void 0;var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function i(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(o),t.state.closeBrackets=null),n&&(a(i(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(o))})),r(i,"getOption");var o={Backspace:u,Enter:c};function a(e){for(var t=0;t=0;s--){var c=a[s].head;t.replaceRange("",n(c.line,c.ch-1),n(c.line,c.ch+1),"+delete")}}function c(t){var n=l(t),r=n&&i(n,"explode");if(!r||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a0?{line:a.head.line,ch:a.head.ch+t}:{line:a.head.line-1};n.push({anchor:s,head:s})}e.setSelections(n,i)}function f(t){var r=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new n(t.head.line,t.head.ch+(r?1:-1))}}function p(t,r){var o=l(t);if(!o||t.getOption("disableInput"))return e.Pass;var a=i(o,"pairs"),s=a.indexOf(r);if(-1==s)return e.Pass;for(var u,c=i(o,"closeBefore"),p=i(o,"triples"),h=a.charAt(s+1)==r,g=t.listSelections(),v=s%2==0,y=0;y1&&p.indexOf(r)>=0&&t.getRange(n(T.line,T.ch-2),T)==r+r){if(T.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(T.line,T.ch-2))))return e.Pass;b="addFour"}else if(h){var C=0==T.ch?" ":t.getRange(n(T.line,T.ch-1),T);if(e.isWordChar(w)||C==r||e.isWordChar(C))return e.Pass;b="both"}else{if(!v||!(0===w.length||/\s/.test(w)||c.indexOf(w)>-1))return e.Pass;b="both"}else b=h&&m(t,T)?"both":p.indexOf(r)>=0&&t.getRange(T,n(T.line,T.ch+3))==r+r+r?"skipThree":"skip";if(u){if(u!=b)return e.Pass}else u=b}var S=s%2?a.charAt(s-1):r,x=s%2?r:a.charAt(s+1);t.operation((function(){if("skip"==u)d(t,1);else if("skipThree"==u)d(t,3);else if("surround"==u){for(var e=t.getSelections(),n=0;nn(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};e.a=o,function(e,n){t.c,e.exports=function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),s=i||o||a,l=s&&(i?document.documentMode||6:+(a||o)[1]),u=!a&&/WebKit\//.test(e),c=u&&/Qt\/\d+\.\d+/.test(e),d=!a&&/Chrome\//.test(e),f=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),g=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),y=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=g||/Mac/.test(t),E=/\bCrOS\b/.test(e),T=/win/i.test(t),w=f&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(f=!1,u=!0);var C=b&&(c||f&&(null==w||w<12.11)),S=n||s&&l>=9;function x(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}r(x,"classTest");var N,k=r((function(e,t){var n=e.className,r=x(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}}),"rmClass");function _(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return _(e).appendChild(t)}function I(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}g?F=r((function(e){e.selectionStart=0,e.selectionEnd=e.value.length}),"selectInput"):s&&(F=r((function(e){try{e.select()}catch(e){}}),"selectInput")),r(P,"bind"),r(j,"copyObj"),r(V,"countColumn");var U=r((function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)}),"Delayed");function B(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}r(W,"findColumn");var K=[""];function Q(e){for(;K.length<=e;)K.push(X(K)+" ");return K[e]}function X(e){return e[e.length-1]}function Y(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||te.test(e))}function re(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ne(e))||t.test(e):ne(e)}function ie(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}r(ne,"isWordCharBasic"),r(re,"isWordChar"),r(ie,"isEmpty");var oe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ae(e){return e.charCodeAt(0)>=768&&oe.test(e)}function se(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function ue(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}r(ae,"isExtendingChar"),r(se,"skipExtendingChars"),r(le,"findFirst"),r(ue,"iterateBidiSections");var ce=null;function de(e,t,n){var r;ce=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ce=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ce=i)}return null!=r?r:ce}r(de,"getBidiPartAt");var fe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}r(n,"charType");var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/;function u(e,t,n){this.level=e,this.from=t,this.to=n}return r(u,"BidiSpan"),function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!i.test(e))return!1;for(var c=e.length,d=[],f=0;f-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ye(e,t){var n=ge(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function we(e){e.prototype.on=function(e,t){me(this,e,t)},e.prototype.off=function(e,t){ve(this,e,t)}}function Ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ne(e){Ce(e),Se(e)}function ke(e){return e.target||e.srcElement}function _e(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}r(ge,"getHandlers"),r(ve,"off"),r(ye,"signal"),r(be,"signalDOMEvent"),r(Ee,"signalCursorActivity"),r(Te,"hasHandler"),r(we,"eventMixin"),r(Ce,"e_preventDefault"),r(Se,"e_stopPropagation"),r(xe,"e_defaultPrevented"),r(Ne,"e_stop"),r(ke,"e_target"),r(_e,"e_button");var Oe,Ie,De=function(){if(s&&l<9)return!1;var e=I("div");return"draggable"in e||"dragDrop"in e}();function Le(e){if(null==Oe){var t=I("span","​");O(e,I("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Oe=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&l<8))}var n=Oe?I("span","​"):I("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ae(e){if(null!=Ie)return Ie;var t=O(e,document.createTextNode("AخA")),n=N(t,0,1).getBoundingClientRect(),r=N(t,1,2).getBoundingClientRect();return _(e),!(!n||n.left==n.right)&&(Ie=r.right-n.right<3)}r(Le,"zeroWidthElement"),r(Ae,"hasBadBidiRects");var Me,Re=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Fe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Pe="oncopy"in(Me=I("div"))||(Me.setAttribute("oncopy","return;"),"function"==typeof Me.oncopy),je=null;function Ve(e){if(null!=je)return je;var t=O(e,I("span","x")),n=t.getBoundingClientRect(),r=N(t,0,1).getBoundingClientRect();return je=Math.abs(n.left-r.left)>1}r(Ve,"hasBadZoomedRects");var Ue={},Be={};function $e(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ue[e]=t}function qe(e,t){Be[e]=t}function He(e){if("string"==typeof e&&Be.hasOwnProperty(e))e=Be[e];else if(e&&"string"==typeof e.name&&Be.hasOwnProperty(e.name)){var t=Be[e.name];"string"==typeof t&&(t={name:t}),(e=ee(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return He("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return He("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ge(e,t){t=He(t);var n=Ue[t.name];if(!n)return Ge(e,"text/plain");var r=n(e,t);if(ze.hasOwnProperty(t.name)){var i=ze[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}r($e,"defineMode"),r(qe,"defineMIME"),r(He,"resolveMode"),r(Ge,"getMode");var ze={};function We(e,t){j(t,ze.hasOwnProperty(e)?ze[e]:ze[e]={})}function Ke(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Qe(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Xe(e,t,n){return!e.startState||e.startState(t,n)}r(We,"extendMode"),r(Ke,"copyState"),r(Qe,"innerMode"),r(Xe,"startState");var Ye=r((function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n}),"StringStream");function Je(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?at(n,Je(e,n).text.length):ht(t,Je(e,t.line).text.length)}function ht(e,t){var n=e.ch;return null==n||n>t?at(e.line,t):n<0?at(e.line,0):e}function mt(e,t){for(var n=[],r=0;r=this.string.length},Ye.prototype.sol=function(){return this.pos==this.lineStart},Ye.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ye.prototype.next=function(){if(this.post},Ye.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ye.prototype.skipToEnd=function(){this.pos=this.string.length},Ye.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ye.prototype.backUp=function(e){this.pos-=e},Ye.prototype.column=function(){return this.lastColumnPos0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var o=r((function(e){return n?e.toLowerCase():e}),"cased");if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},Ye.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ye.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ye.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ye.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)},r(Je,"getLine"),r(Ze,"getBetween"),r(et,"getLines"),r(tt,"updateLineHeight"),r(nt,"lineNo"),r(rt,"lineAtHeight"),r(it,"isLine"),r(ot,"lineNumberFor"),r(at,"Pos"),r(st,"cmp"),r(lt,"equalCursorPos"),r(ut,"copyPos"),r(ct,"maxPos"),r(dt,"minPos"),r(ft,"clipLine"),r(pt,"clipPos"),r(ht,"clipToLen"),r(mt,"clipPosArray");var gt=r((function(e,t){this.state=e,this.lookAhead=t}),"SavedContext"),vt=r((function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1}),"Context");function yt(e,t,n,i){var o=[e.state.modeGen],a={};kt(e,t.text,e.doc.mode,n,(function(e,t){return o.push(e,t)}),a,i);for(var s=n.state,l=r((function(r){n.baseTokens=o;var i=e.state.overlays[r],l=1,u=0;n.state=!0,kt(e,t.text,i.mode,n,(function(e,t){for(var n=l;ue&&o.splice(l,1,e,o[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(i.opaque)o.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&Ke(e.doc.mode,r.state),o=yt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Et(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new vt(r,!0,t);var o=_t(e,t,n),a=o>r.first&&Je(r,o-1).stateAfter,s=a?vt.fromSaved(r,a,o):new vt(r,Xe(r.mode),o);return r.iter(o,t,(function(n){Tt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}vt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},vt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},vt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},vt.fromSaved=function(e,t,n){return t instanceof gt?new vt(e,Ke(e.mode,t.state),n,t.lookAhead):new vt(e,Ke(e.mode,t),n)},vt.prototype.save=function(e){var t=!1!==e?Ke(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gt(t,this.maxLookAhead):t},r(yt,"highlightLine"),r(bt,"getLineStyles"),r(Et,"getContextBefore"),r(Tt,"processLine"),r(wt,"callBlankLine"),r(Ct,"readToken");var St=r((function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n}),"Token");function xt(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=Je(a,(t=pt(a,t)).line),u=Et(e,t.line,n),c=new Ye(l.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(s=!1,a&&Tt(e,t,r,d.pos),d.pos=t.length,l=null):l=Nt(Ct(n,d,r.state,f),o),f){var p=f[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||c!=l){for(;ua;--s){if(s<=o.first)return o.first;var l=Je(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof gt?u.lookAhead:0)<=o.modeFrontier))return s;var c=V(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function Ot(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Je(e,r).stateAfter;if(i&&(!(i instanceof gt)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new Mt(a,o.from,s?null:o.to))}}return r}function Vt(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;b0)){var c=[l,1],d=st(u.from,s.from),f=st(u.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function qt(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||Wt(n,o.marker)<0)&&(n=o.marker)}return n}function Jt(e,t,n,r,i){var o=Je(e,t),a=Dt&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?st(u.to,n)>=0:st(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?st(u.from,r)<=0:st(u.from,r)<0)))return!0}}}function Zt(e){for(var t;t=Qt(e);)e=t.find(-1,!0).line;return e}function en(e){for(var t;t=Xt(e);)e=t.find(1,!0).line;return e}function tn(e){for(var t,n;t=Xt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function nn(e,t){var n=Je(e,t),r=Zt(n);return n==r?t:nt(r)}function rn(e,t){if(t>e.lastLine())return t;var n,r=Je(e,t);if(!on(e,r))return t;for(;n=Xt(r);)r=n.find(1,!0).line;return nt(r)+1}function on(e,t){var n=Dt&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}r(Lt,"seeReadOnlySpans"),r(At,"seeCollapsedSpans"),r(Mt,"MarkedSpan"),r(Rt,"getMarkedSpanFor"),r(Ft,"removeMarkedSpan"),r(Pt,"addMarkedSpan"),r(jt,"markedSpansBefore"),r(Vt,"markedSpansAfter"),r(Ut,"stretchSpansOverChange"),r(Bt,"clearEmptySpans"),r($t,"removeReadOnlyRanges"),r(qt,"detachMarkedSpans"),r(Ht,"attachMarkedSpans"),r(Gt,"extraLeft"),r(zt,"extraRight"),r(Wt,"compareCollapsedMarkers"),r(Kt,"collapsedSpanAtSide"),r(Qt,"collapsedSpanAtStart"),r(Xt,"collapsedSpanAtEnd"),r(Yt,"collapsedSpanAround"),r(Jt,"conflictingCollapsedRange"),r(Zt,"visualLine"),r(en,"visualLineEnd"),r(tn,"visualLineContinued"),r(nn,"visualLineNo"),r(rn,"visualLineEndNo"),r(on,"lineIsHidden"),r(an,"lineIsHiddenInner"),r(sn,"heightAtLine"),r(ln,"lineLength"),r(un,"findMaxLine");var cn=r((function(e,t,n){this.text=e,Ht(this,t),this.height=n?n(this):1}),"Line");function dn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),qt(e),Ht(e,n);var i=r?r(e):1;i!=e.height&&tt(e,i)}function fn(e){e.parent=null,qt(e)}cn.prototype.lineNo=function(){return nt(this)},we(cn),r(dn,"updateLine"),r(fn,"cleanUpLine");var pn={},hn={};function mn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?hn:pn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function gn(e,t){var n=D("span",null,null,u?"padding-right: .1px":null),r={pre:D("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=yn,Ae(e.display.measure)&&(a=pe(o,e.doc.direction))&&(r.addToken=En(r.addToken,a)),r.map=[],wn(o,r,bt(e,o,t!=e.display.externalMeasured&&nt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=R(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=R(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Le(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(u){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=R(r.pre.className,r.textClass||"")),r}function vn(e){var t=I("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function yn(e,t,n,r,i,o,a){if(t){var u,c=e.splitSpaces?bn(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){u=document.createDocumentFragment();for(var p=0;;){d.lastIndex=p;var h=d.exec(t),m=h?h.index-p:t.length-p;if(m){var g=document.createTextNode(c.slice(p,p+m));s&&l<9?u.appendChild(I("span",[g])):u.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;p+=m+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=u.appendChild(I("span",Q(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?((v=u.appendChild(I("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),s&&l<9?u.appendChild(I("span",[v])):u.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),s&&l<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||f||o||a){var E=n||"";r&&(E+=r),i&&(E+=i);var T=I("span",[u],E,o);if(a)for(var w in a)a.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&T.setAttribute(w,a[w]);return e.content.appendChild(T)}e.content.appendChild(u)}}function bn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&d.from<=u);f++);if(d.to>=c)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-u),i,o,null,s,l),o=null,r=r.slice(d.to-u),u=d.to}}}function Tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function wn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,u,c,d,f,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){l=u=c=s="",f=null,d=null,v=1/0;for(var y=[],b=void 0,E=0;Eh||w.collapsed&&T.to==h&&T.from==h)){if(null!=T.to&&T.to!=h&&v>T.to&&(v=T.to,u=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&T.from==h&&(c+=" "+w.startStyle),w.endStyle&&T.to==v&&(b||(b=[])).push(w.endStyle,T.to),w.title&&((f||(f={})).title=w.title),w.attributes)for(var C in w.attributes)(f||(f={}))[C]=w.attributes[C];w.collapsed&&(!d||Wt(d.marker,w)<0)&&(d=T)}else T.from>h&&v>T.from&&(v=T.from)}if(b)for(var S=0;S=p)break;for(var N=Math.min(p,v);;){if(g){var k=h+g.length;if(!d){var _=k>N?g.slice(0,N-h):g;t.addToken(t,_,a?a+l:l,c,h+_.length==v?u:"",s,f)}if(k>=N){g=g.slice(N-h),h=N;break}h=k,c=""}g=i.slice(o,o=n[m++]),a=mn(n[m++],t.cm.options)}}else for(var O=1;O2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Zn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function er(e,t){var n=nt(t=Zt(t)),r=e.display.externalMeasured=new Cn(e.doc,t,n);r.lineN=n;var i=r.built=gn(e,r);return r.text=i.pre,O(e.display.lineMeasure,i.pre),r}function tr(e,t,n,r){return ir(e,rr(e,t),n,r)}function nr(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],a="left";if("right"==n&&i==l-s)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function ur(e,t,n,r){var i,o=sr(t.map,n,r),a=o.node,u=o.start,c=o.end,d=o.collapse;if(3==a.nodeType){for(var f=0;f<4;f++){for(;u&&ae(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c0&&(d=r="right"),i=e.options.lineWrapping&&(p=a.getClientRects()).length>1?p["right"==r?p.length-1:0]:a.getBoundingClientRect()}if(s&&l<9&&!u&&(!i||!i.left&&!i.right)){var h=a.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+Dr(e.display),top:h.top,bottom:h.bottom}:ar}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;b=i.text.length?(u=i.text.length,c="before"):u<=0&&(u=0,c="after"),!l)return s("before"==c?u-1:u,"before"==c);function d(e,t,n){return s(n?e-1:e,1==l[t].level!=n)}r(d,"getBidi");var f=de(l,u,c),p=ce,h=d(u,f,"before"==c);return null!=p&&(h.other=d(u,p,"before"!=c)),h}function Tr(e,t){var n=0;t=pt(e.doc,t),e.options.lineWrapping||(n=Dr(e.display)*t.ch);var r=Je(e.doc,t.line),i=sn(r)+zn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function wr(e,t,n,r,i){var o=at(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Cr(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return wr(r.first,0,null,-1,-1);var i=rt(r,n),o=r.first+r.size-1;if(i>o)return wr(r.first+r.size-1,Je(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Je(r,i);;){var s=kr(e,a,i,t,n),l=Yt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=Je(r,i=u.line)}}function Sr(e,t,n,r){r-=gr(t);var i=t.text.length,o=le((function(t){return ir(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=le((function(t){return ir(e,n,t).top>r}),o,i)}}function xr(e,t,n,r){return n||(n=rr(e,t)),Sr(e,t,n,vr(e,t,ir(e,n,r),"line").top)}function Nr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function kr(e,t,n,r,i){i-=sn(t);var o=rr(e,t),a=gr(t),s=0,l=t.text.length,u=!0,c=pe(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?Or:_r)(e,t,n,o,c,r,i);s=(u=1!=d.level)?d.from:d.to-1,l=u?d.to:d.from-1}var f,p,h=null,m=null,g=le((function(t){var n=ir(e,o,t);return n.top+=a,n.bottom+=a,!!Nr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),s,l),v=!1;if(m){var y=r-m.left=E.bottom?1:0}return wr(n,g=se(t.text,g,1),p,v,r-f)}function _r(e,t,n,r,i,o,a){var s=le((function(s){var l=i[s],u=1!=l.level;return Nr(Er(e,at(n,u?l.to:l.from,u?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=Er(e,at(n,u?l.from:l.to,u?"after":"before"),"line",t,r);Nr(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function Or(e,t,n,r,i,o,a){var s=Sr(e,t,r,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,f=0;f=u||p.to<=l)){var h=ir(e,r,1!=p.level?Math.min(u,p.to)-1:Math.max(l,p.from)).right,m=hm)&&(c=p,d=m)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function Ir(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==or){or=I("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)or.appendChild(document.createTextNode("x")),or.appendChild(I("br"));or.appendChild(document.createTextNode("x"))}O(e.measure,or);var n=or.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),_(e.measure),n||1}function Dr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=I("span","xxxxxxxxxx"),n=I("pre",[t],"CodeMirror-line-like");O(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Lr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Ar(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Mr(e){var t=Ir(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Dr(e.display)-3);return function(i){if(on(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Je(e.doc,u.line).text).length==u.ch){var c=V(l,l.length,e.options.tabSize)-l.length;u=at(u.line,Math.max(0,Math.round((o-Kn(e.display).left)/Dr(e.display))-c))}return u}function Pr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Dt&&nn(e.doc,t)i.viewFrom?Ur(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Ur(e);else if(t<=i.viewFrom){var o=Br(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Ur(e)}else if(n>=i.viewTo){var a=Br(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Ur(e)}else{var s=Br(e,t,t,-1),l=Br(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Sn(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Ur(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Pr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==B(a,n)&&a.push(n)}}}function Ur(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Br(e,t,n,r){var i,o=Pr(e,t),a=e.display.view;if(!Dt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;nn(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function $r(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Sn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Sn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Pr(e,n)))),r.viewTo=n}function qr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||l.to().line0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(I("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Wr(e,t){return e.top-t.top||e.left-t.left}function Kr(e,t,n){var i=e.display,o=e.doc,a=document.createDocumentFragment(),s=Kn(e.display),l=s.left,u=Math.max(i.sizerWidth,Xn(e)-i.sizer.offsetLeft)-s.right,c="ltr"==o.direction;function d(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),a.appendChild(I("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?u-e:n)+"px;\n height: "+(r-t)+"px"))}function f(t,n,i){var a,s,f=Je(o,t),p=f.text.length;function h(n,r){return br(e,at(t,n),"div",f,r)}function m(t,n,r){var i=xr(e,f,null,t),o="ltr"==n==("after"==r)?"left":"right";return h("after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}r(h,"coords"),r(m,"wrapX");var g=pe(f,o.direction);return ue(g,n||0,null==i?p:i,(function(e,t,r,o){var f="ltr"==r,v=h(e,f?"left":"right"),y=h(t-1,f?"right":"left"),b=null==n&&0==e,E=null==i&&t==p,T=0==o,w=!g||o==g.length-1;if(y.top-v.top<=3){var C=(c?E:b)&&w,S=(c?b:E)&&T?l:(f?v:y).left,x=C?u:(f?y:v).right;d(S,v.top,x-S,v.bottom)}else{var N,k,_,O;f?(N=c&&b&&T?l:v.left,k=c?u:m(e,r,"before"),_=c?l:m(t,r,"after"),O=c&&E&&w?u:y.right):(N=c?m(e,r,"before"):l,k=!c&&b&&T?u:v.right,_=!c&&E&&w?l:y.left,O=c?m(t,r,"after"):u),d(N,v.top,k-N,v.bottom),v.bottom0?t.blinker=setInterval((function(){e.hasFocus()||Zr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Xr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Jr(e))}function Yr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Zr(e))}),100)}function Jr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ye(e,"focus",e,t),e.state.focused=!0,M(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),u&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Qr(e))}function Zr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ye(e,"blur",e,t),e.state.focused=!1,k(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function ei(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a.005||m<-.005)&&(ie.display.sizerWidth){var v=Math.ceil(f/Dr(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ti(e){if(e.widgets)for(var t=0;t=a&&(o=rt(t,sn(Je(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ri(e,t){if(!be(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var o=I("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-zn(e.display))+"px;\n height: "+(t.bottom-t.top+Qn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ii(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?at(t.line,t.ch+1,"before"):t,t=t.ch?at(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,s=Er(e,t),l=n&&n!=t?Er(e,n):s,u=ai(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=u.scrollTop&&(pi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(mi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function oi(e,t){var n=ai(e,t);null!=n.scrollTop&&pi(e,n.scrollTop),null!=n.scrollLeft&&mi(e,n.scrollLeft)}function ai(e,t){var n=e.display,r=Ir(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Yn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Wn(n),l=t.tops-r;if(t.topi+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=Xn(e)-n.gutters.offsetWidth,h=t.right-t.left>p;return h&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.leftp+f-3&&(a.scrollLeft=t.right+(h?0:10)-p),a}function si(e,t){null!=t&&(di(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function li(e){di(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ui(e,t,n){null==t&&null==n||di(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ci(e,t){di(e),e.curOp.scrollToPos=t}function di(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,fi(e,Tr(e,t.from),Tr(e,t.to),t.margin))}function fi(e,t,n,r){var i=ai(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});ui(e,i.scrollLeft,i.scrollTop)}function pi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Hi(e,{top:t}),hi(e,t,!0),n&&Hi(e),Fi(e,100))}function hi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function mi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Ki(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function gi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Wn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Qn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}r(sr,"nodeAndOffsetInLineMap"),r(lr,"getUsefulRect"),r(ur,"measureCharInner"),r(cr,"maybeUpdateRectForZooming"),r(dr,"clearLineMeasurementCacheFor"),r(fr,"clearLineMeasurementCache"),r(pr,"clearCaches"),r(hr,"pageScrollX"),r(mr,"pageScrollY"),r(gr,"widgetTopHeight"),r(vr,"intoCoordSystem"),r(yr,"fromCoordSystem"),r(br,"charCoords"),r(Er,"cursorCoords"),r(Tr,"estimateCoords"),r(wr,"PosWithInfo"),r(Cr,"coordsChar"),r(Sr,"wrappedLineExtent"),r(xr,"wrappedLineExtentChar"),r(Nr,"boxIsAfter"),r(kr,"coordsCharInner"),r(_r,"coordsBidiPart"),r(Or,"coordsBidiPartWrapped"),r(Ir,"textHeight"),r(Dr,"charWidth"),r(Lr,"getDimensions"),r(Ar,"compensateForHScroll"),r(Mr,"estimateHeight"),r(Rr,"estimateLineHeights"),r(Fr,"posFromMouse"),r(Pr,"findViewIndex"),r(jr,"regChange"),r(Vr,"regLineChange"),r(Ur,"resetView"),r(Br,"viewCuttingPoint"),r($r,"adjustView"),r(qr,"countDirtyView"),r(Hr,"updateSelection"),r(Gr,"prepareSelection"),r(zr,"drawSelectionCursor"),r(Wr,"cmpCoords"),r(Kr,"drawSelectionRange"),r(Qr,"restartBlink"),r(Xr,"ensureFocus"),r(Yr,"delayBlurEvent"),r(Jr,"onFocus"),r(Zr,"onBlur"),r(ei,"updateHeightsInViewport"),r(ti,"updateWidgetHeight"),r(ni,"visibleLines"),r(ri,"maybeScrollWindow"),r(ii,"scrollPosIntoView"),r(oi,"scrollIntoView"),r(ai,"calculateScrollPos"),r(si,"addToScrollTop"),r(li,"ensureCursorVisible"),r(ui,"scrollToCoords"),r(ci,"scrollToRange"),r(di,"resolveScrollToPos"),r(fi,"scrollToCoordsRange"),r(pi,"updateScrollTop"),r(hi,"setScrollTop"),r(mi,"setScrollLeft"),r(gi,"measureForScrollbars");var vi=r((function(e,t,n){this.cm=n;var r=this.vert=I("div",[I("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=I("div",[I("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),me(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),me(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}),"NativeScrollbars");vi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},vi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},vi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},vi.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new U,this.disableVert=new U},vi.prototype.enableZeroWidthBar=function(e,t,n){function i(){var r=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)}e.style.pointerEvents="auto",r(i,"maybeDisable"),t.set(1e3,i)},vi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var yi=r((function(){}),"NullScrollbars");function bi(e,t){t||(t=gi(e));var n=e.display.barWidth,r=e.display.barHeight;Ei(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ei(e),Ei(e,gi(e)),n=e.display.barWidth,r=e.display.barHeight}function Ei(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}yi.prototype.update=function(){return{bottom:0,right:0}},yi.prototype.setScrollLeft=function(){},yi.prototype.setScrollTop=function(){},yi.prototype.clear=function(){},r(bi,"updateScrollbars"),r(Ei,"updateScrollbarsInner");var Ti={native:vi,null:yi};function wi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&k(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ti[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),me(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?mi(e,t):pi(e,t)}),e),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)}r(wi,"initScrollbars");var Ci=0;function Si(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ci,markArrays:null},Nn(e.curOp)}function xi(e){var t=e.curOp;t&&_n(t,(function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ji(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function _i(e){e.updatedDisplay=e.mustUpdate&&$i(e.cm,e.update)}function Oi(e){var t=e.cm,n=t.display;e.updatedDisplay&&ei(t),e.barMeasure=gi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=tr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Qn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Xn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ii(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Et(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ke(t.mode,r.state):null,l=yt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!d&&fn)return Fi(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Li(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==qr(e))return!1;Qi(e)&&(Ur(e),t.dims=Lr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Dt&&(o=nn(e.doc,o),a=rn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;$r(e,o,a),n.viewOffset=sn(Je(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=qr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Ui(e);return l>4&&(n.lineDiv.style.display="none"),Gi(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Bi(u),_(n.cursorDiv),_(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Fi(e,400)),n.updateLineNumbers=null,!0}function qi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Xn(e))r&&(t.visible=ni(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Wn(e.display)-Yn(e),n.top)}),t.visible=ni(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!$i(e,t))break;ei(e);var i=gi(e);Hr(e),bi(e,i),Wi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Hi(e,t){var n=new ji(e,t);if($i(e,n)){ei(e),qi(e,n);var r=gi(e);Hr(e),bi(e,r),Wi(e,r),n.finish()}}function Gi(e,t,n){var i=e.display,o=e.options.lineNumbers,a=i.lineDiv,s=a.firstChild;function l(t){var n=t.nextSibling;return u&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}r(l,"rm");for(var c=i.view,d=i.viewFrom,f=0;f-1&&(h=!1),Ln(e,p,d,n)),h&&(_(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(ot(e.options,d)))),s=p.node.nextSibling}else{var m=Un(e,p,d,n);a.insertBefore(m,s)}d+=p.size}for(;s;)s=l(s)}function zi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",In(e,"gutterChanged",e)}function Wi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Qn(e)+"px"}function Ki(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Ar(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;al.clientWidth,d=l.scrollHeight>l.clientHeight;if(i&&c||o&&d){if(o&&b&&u)e:for(var p=t.target,h=s.view;p!=l;p=p.parentNode)for(var m=0;m=0&&st(e,r.to())<=0)return n}return-1};var ao=r((function(e,t){this.anchor=e,this.head=t}),"Range");function so(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return st(e.from(),t.from())})),n=B(t,i);for(var o=1;o0:l>=0){var u=dt(s.from(),a.from()),c=ct(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new ao(d?c:u,d?u:c))}}return new oo(t,n)}function lo(e,t){return new oo([new ao(e,t||e)],0)}function uo(e){return e.text?at(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function co(e,t){if(st(e,t.from)<0)return e;if(st(e,t.to)<=0)return uo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=uo(t).ch-t.to.ch),at(n,r)}function fo(e,t){for(var n=[],r=0;r1&&e.remove(l.line+1,m-1),e.insert(l.line+1,y)}In(e,"change",e,t)}function bo(e,t,n){function i(e,r,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0}function ko(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=No(i,i.lastOp==r)))a=X(o.changes),0==st(t.from,t.to)&&0==st(t.from,a.to)?a.to=uo(t):o.changes.push(So(e,t));else{var l=X(i.done);for(l&&l.ranges||Io(e.sel,i.done),o={changes:[So(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||ye(e,"historyAdded")}function _o(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Oo(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||_o(e,o,X(i.done),t))?i.done[i.done.length-1]=t:Io(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&xo(i.undone)}function Io(e,t){var n=X(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Do(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Lo(e){if(!e)return null;for(var t,n=0;n-1&&(X(s)[d]=u[d],delete u[d])}}}return r}function Fo(e,t,n,r){if(r){var i=e.anchor;if(n){var o=st(t,i)<0;o!=st(n,i)<0?(i=t,t=n):o!=st(t,n)<0&&(t=n)}return new ao(i,t)}return new ao(n||t,t)}function Po(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),qo(e,new oo([Fo(e.sel.primary(),t,n,i)],0),r)}function jo(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(ye(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),f=void 0;if((r<0?c:u)&&(d=Xo(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=st(d,n))&&(r<0?f<0:f>0))return Ko(e,d,t,r,i)}var p=l.find(r<0?-1:1);return(r<0?u:c)&&(p=Xo(e,p,r,p.line==t.line?o:null)),p?Ko(e,p,t,r,i):null}}return t}function Qo(e,t,n,r,i){var o=r||1;return Ko(e,t,n,o,i)||!i&&Ko(e,t,n,o,!0)||Ko(e,t,n,-o,i)||!i&&Ko(e,t,n,-o,!0)||(e.cantEdit=!0,at(e.first,0))}function Xo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?pt(e,at(t.line-1)):null:n>0&&t.ch==(r||Je(e,t.line)).text.length?t.line=0;--i)ea(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else ea(e,t)}}function ea(e,t){if(1!=t.text.length||""!=t.text[0]||0!=st(t.from,t.to)){var n=fo(e,t);ko(e,t,n,e.cm?e.cm.curOp.id:NaN),ra(e,t,n,Ut(e,t));var r=[];bo(e,(function(e,n){n||-1!=B(r,e.history)||(la(e.history,t),r.push(e.history)),ra(e,t,null,Ut(e,t))}))}}function ta(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(!i||n){for(var o,a=e.history,s=e.sel,l="undo"==t?a.done:a.undone,u="undo"==t?a.undone:a.done,c=0;c=0;--h){var m=p(h);if(m)return m.v}}}}function na(e,t){if(0!=t&&(e.first+=t,e.sel=new oo(Y(e.sel.ranges,(function(e){return new ao(at(e.anchor.line+t,e.anchor.ch),at(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){jr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:at(o,Je(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ze(e,t.from,t.to),n||(n=fo(e,t)),e.cm?ia(e.cm,t,r):yo(e,t,r),Ho(e,n,H),e.cantEdit&&Qo(e,at(e.firstLine(),0))&&(e.cantEdit=!1)}}function ia(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=nt(Zt(Je(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&Ee(e),yo(r,t,n,Mr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=ln(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),Ot(r,o.line),Fi(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?jr(e):o.line!=a.line||1!=t.text.length||vo(e.doc,t)?jr(e,o.line,a.line+1,u):Vr(e,o.line,"text");var c=Te(e,"changes"),d=Te(e,"change");if(d||c){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&In(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function oa(e,t,n,r,i){var o;r||(r=n),st(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Zo(e,{from:n,to:r,text:t,origin:i})}function aa(e,t,n,r){n1||!(this.children[0]instanceof ca))){var s=[];this.collapse(s),this.children=[new ca(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Jt(e,t.line,t,n,o)||t.line!=n.line&&Jt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");At()}o.addToHistory&&ko(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(r){u&&o.collapsed&&!u.options.lineWrapping&&Zt(r)==u.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&tt(r,0),Pt(r,new Mt(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){on(e,t)&&tt(t,0)})),o.clearOnEnter&&me(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Lt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ma,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)jr(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)Vr(u,c,"text");o.atomic&&zo(u.doc),In(u,"markerAdded",u,o)}return o}ga.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Si(e),Te(this,"clear")){var n=this.find();n&&In(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&jr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&zo(e.doc)),e&&In(e,"markerCleared",e,this,r,i),t&&xi(e),this.parent&&this.parent.clear()}},ga.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)Zo(this,r[l]);s?$o(this,s):this.cm&&li(this.cm)})),undo:Ri((function(){ta(this,"undo")})),redo:Ri((function(){ta(this,"redo")})),undoSelection:Ri((function(){ta(this,"undo",!0)})),redoSelection:Ri((function(){ta(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=pt(this,e),t=pt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),pt(this,at(n,t))},indexFromPos:function(e){var t=(e=pt(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),Ho(t.doc,lo(n,n)),p)for(var h=0;h=0;t--)oa(e.doc,"",r[t].from,r[t].to,"+delete");li(e)}))}function Ka(e,t,n){var r=se(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Qa(e,t,n){var r=Ka(e,t.ch,n);return null==r?null:new at(t.line,r,n<0?"after":"before")}function Xa(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=pe(n,t.doc.direction);if(o){var a,s=i<0?X(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=rr(t,n);a=i<0?n.text.length-1:0;var c=ir(t,u,a).top;a=le((function(e){return ir(t,u,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Ka(n,a,1))}else a=i<0?s.to:s.from;return new at(r,a,l)}}return new at(r,i<0?n.text.length:0,i<0?"before":"after")}function Ya(e,t,n,i){var o=pe(t,e.doc.direction);if(!o)return Qa(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=de(o,n.ch,n.sticky),s=o[a];if("ltr"==e.doc.direction&&s.level%2==0&&(i>0?s.to>n.ch:s.from=s.from&&p>=d.begin)){var h=f?"before":"after";return new at(n.line,p,h)}}var m=r((function(e,t,i){for(var a=r((function(e,t){return t?new at(n.line,u(e,1),"before"):new at(n.line,e,"after")}),"getRes");e>=0&&e0==(1!=s.level),c=l?i.begin:u(i.end,-1);if(s.from<=c&&c0?d.end:u(d.begin,-1);return null==v||i>0&&v==t.text.length||!(g=m(i>0?0:o.length-1,i,c(v)))?null:g}Va.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Va.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Va.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Va.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Va.default=b?Va.macDefault:Va.pcDefault,r(Ua,"normalizeKeyName"),r(Ba,"normalizeKeyMap"),r($a,"lookupKey"),r(qa,"isModifierKey"),r(Ha,"addModifierNames"),r(Ga,"keyName"),r(za,"getKeyMap"),r(Wa,"deleteNearSelection"),r(Ka,"moveCharLogically"),r(Qa,"moveLogically"),r(Xa,"endOfLine"),r(Ya,"moveVisually");var Ja={selectAll:Yo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),H)},killLine:function(e){return Wa(e,(function(t){if(t.empty()){var n=Je(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new at(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),at(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Je(e.doc,i.line-1).text;a&&(i=new at(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),at(i.line-1,a.length-1),i,"+transpose"))}n.push(new ao(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Li(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(st((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(st(i.to(),t)>0||t.xRel<0)?Cs(e,r,t,o):xs(e,r,t,o)}function Cs(e,t,n,i){var o=e.display,a=!1,c=Ai(e,(function(t){u&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Yr(e)),ve(o.wrapper.ownerDocument,"mouseup",c),ve(o.wrapper.ownerDocument,"mousemove",d),ve(o.scroller,"dragstart",f),ve(o.scroller,"drop",c),a||(Ce(t),i.addNew||Po(e.doc,n,null,null,i.extend),u&&!p||s&&9==l?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),d=r((function(e){a=a||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10}),"mouseMove"),f=r((function(){return a=!0}),"dragStart");u&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!i.moveOnDrag,me(o.wrapper.ownerDocument,"mouseup",c),me(o.wrapper.ownerDocument,"mousemove",d),me(o.scroller,"dragstart",f),me(o.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}function Ss(e,t,n){if("char"==n)return new ao(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new ao(at(t.line,0),pt(e.doc,at(t.line+1,0)));var r=n(e,t);return new ao(r.from,r.to)}function xs(e,t,n,i){s&&Yr(e);var o=e.display,a=e.doc;Ce(t);var l,u,c=a.sel,d=c.ranges;if(i.addNew&&!i.extend?(u=a.sel.contains(n),l=u>-1?d[u]:new ao(n,n)):(l=a.sel.primary(),u=a.sel.primIndex),"rectangle"==i.unit)i.addNew||(l=new ao(n,n)),n=Fr(e,t,!0,!0),u=-1;else{var f=Ss(e,n,i.unit);l=i.extend?Fo(l,f.anchor,f.head,i.extend):f}i.addNew?-1==u?(u=d.length,qo(a,so(e,d.concat([l]),u),{scroll:!1,origin:"*mouse"})):d.length>1&&d[u].empty()&&"char"==i.unit&&!i.extend?(qo(a,so(e,d.slice(0,u).concat(d.slice(u+1)),0),{scroll:!1,origin:"*mouse"}),c=a.sel):Vo(a,u,l,G):(u=0,qo(a,new oo([l],0),G),c=a.sel);var p=n;function h(t){if(0!=st(p,t))if(p=t,"rectangle"==i.unit){for(var r=[],o=e.options.tabSize,s=V(Je(a,n.line).text,n.ch,o),d=V(Je(a,t.line).text,t.ch,o),f=Math.min(s,d),h=Math.max(s,d),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=Je(a,m).text,y=W(v,f,o);f==h?r.push(new ao(at(m,y),at(m,y))):v.length>y&&r.push(new ao(at(m,y),at(m,W(v,h,o))))}r.length||r.push(new ao(n,n)),qo(a,so(e,c.ranges.slice(0,u).concat(r),u),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,E=l,T=Ss(e,t,i.unit),w=E.anchor;st(T.anchor,w)>0?(b=T.head,w=dt(E.from(),T.anchor)):(b=T.anchor,w=ct(E.to(),T.head));var C=c.ranges.slice(0);C[u]=Ns(e,new ao(pt(a,w),b)),qo(a,so(e,C,u),G)}}r(h,"extendTo");var m=o.wrapper.getBoundingClientRect(),g=0;function v(t){var n=++g,r=Fr(e,t,!0,"rectangle"==i.unit);if(r)if(0!=st(r,p)){e.curOp.focus=A(),h(r);var s=ni(o,a);(r.line>=s.to||r.linem.bottom?20:0;l&&setTimeout(Ai(e,(function(){g==n&&(o.scroller.scrollTop+=l,v(t))})),50)}}function y(t){e.state.selectingText=!1,g=1/0,t&&(Ce(t),o.input.focus()),ve(o.wrapper.ownerDocument,"mousemove",b),ve(o.wrapper.ownerDocument,"mouseup",E),a.history.lastSelOrigin=null}r(v,"extend"),r(y,"done");var b=Ai(e,(function(e){0!==e.buttons&&_e(e)?v(e):y(e)})),E=Ai(e,y);e.state.selectingText=E,me(o.wrapper.ownerDocument,"mousemove",b),me(o.wrapper.ownerDocument,"mouseup",E)}function Ns(e,t){var n=t.anchor,r=t.head,i=Je(e.doc,n.line);if(0==st(n,r)&&n.sticky==r.sticky)return t;var o=pe(i);if(!o)return t;var a=de(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=de(o,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?d<0:d>0}var f=o[u+(l?-1:0)],p=l==(1==f.level),h=p?f.from:f.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new ao(new at(n.line,h,m),r)}function ks(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ce(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!Te(e,n))return xe(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return ye(e,n,e,rt(e.doc,o),e.display.gutterSpecs[l].className,t),xe(t)}}function _s(e,t){return ks(e,t,"gutterClick",!0)}function Os(e,t){Gn(e.display,t)||Is(e,t)||be(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function Is(e,t){return!!Te(e,"gutterContextMenu")&&ks(e,t,"gutterContextMenu",!1)}function Ds(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pr(e)}vs.prototype.compare=function(e,t,n){return this.time+gs>e&&0==st(t,this.pos)&&n==this.button},r(ys,"clickRepeat"),r(bs,"onMouseDown"),r(Es,"handleMappedButton"),r(Ts,"configureMouse"),r(ws,"leftButtonDown"),r(Cs,"leftButtonStartDrag"),r(Ss,"rangeForUnit"),r(xs,"leftButtonSelect"),r(Ns,"bidiSimplify"),r(ks,"gutterEvent"),r(_s,"clickInGutter"),r(Os,"onContextMenu"),r(Is,"contextMenuInGutter"),r(Ds,"themeChanged");var Ls={toString:function(){return"CodeMirror.Init"}},As={},Ms={};function Rs(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Ls&&i(e,t,n)}:i)}r(n,"option"),e.defineOption=n,e.Init=Ls,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,mo(e)}),!0),n("indentUnit",2,mo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){go(e),pr(e),jr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(at(r,o))}r++}));for(var i=n.length-1;i>=0;i--)oa(e.doc,t,n[i],at(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ls&&e.refresh()})),n("specialCharPlaceholder",vn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!T),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ds(e),Ji(e)}),!0),n("keyMap","default",(function(e,t,n){var r=za(t),i=n!=Ls&&za(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ps,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Xi(t,e.options.lineNumbers),Ji(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Ar(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return bi(e)}),!0),n("scrollbarStyle","native",(function(e){wi(e),bi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Xi(e.options.gutters,t),Ji(e)}),!0),n("firstLineNumber",1,Ji,!0),n("lineNumberFormatter",(function(e){return e}),Ji,!0),n("showCursorWhenSelecting",!1,Hr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Zr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Fs),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Hr,!0),n("singleCursorHeightPerLine",!0,Hr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,go,!0),n("addModeClass",!1,go,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,go,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Fs(e,t,n){if(!t!=!(n&&n!=Ls)){var r=e.display.dragFunctions,i=t?me:ve;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Ps(e){e.options.lineWrapping?(M(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(k(e.display.wrapper,"CodeMirror-wrap"),un(e)),Rr(e),jr(e),pr(e),setTimeout((function(){return bi(e)}),100)}function js(e,t){var n=this;if(!(this instanceof js))return new js(e,t);this.options=t=t?j(t):{},j(As,t,!1);var r=t.value;"string"==typeof r?r=new Sa(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new js.inputStyles[t.inputStyle](this),o=this.display=new Zi(e,r,i,t);for(var a in o.wrapper.CodeMirror=this,Ds(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new U,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),s&&l<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Vs(this),La(),Si(this),this.curOp.forceUpdate=!0,Eo(this,r),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Jr(n)}),20):Zr(this),Ms)Ms.hasOwnProperty(a)&&Ms[a](this,t[a],Ls);Qi(this),t.finishInit&&t.finishInit(this);for(var c=0;c400}r(o,"finishTouch"),r(a,"isMouseLikeTouchEvent"),r(u,"farAway"),me(t.scroller,"touchstart",(function(r){if(!be(e,r)&&!a(r)&&!_s(e,r)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==r.touches.length&&(t.activeTouch.left=r.touches[0].pageX,t.activeTouch.top=r.touches[0].pageY)}})),me(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),me(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Gn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var i,a=e.coordsChar(t.activeTouch,"page");i=!r.prev||u(r,r.prev)?new ao(a,a):!r.prev.prev||u(r,r.prev.prev)?e.findWordAt(a):new ao(at(a.line,0),pt(e.doc,at(a.line+1,0))),e.setSelection(i.anchor,i.head),e.focus(),Ce(n)}o()})),me(t.scroller,"touchcancel",o),me(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(pi(e,t.scroller.scrollTop),mi(e,t.scroller.scrollLeft,!0),ye(e,"scroll",e))})),me(t.scroller,"mousewheel",(function(t){return io(e,t)})),me(t.scroller,"DOMMouseScroll",(function(t){return io(e,t)})),me(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){be(e,t)||Ne(t)},over:function(t){be(e,t)||(_a(e,t),Ne(t))},start:function(t){return ka(e,t)},drop:Ai(e,Na),leave:function(t){be(e,t)||Oa(e)}};var c=t.input.getField();me(c,"keyup",(function(t){return fs.call(e,t)})),me(c,"keydown",Ai(e,cs)),me(c,"keypress",Ai(e,ps)),me(c,"focus",(function(t){return Jr(e,t)})),me(c,"blur",(function(t){return Zr(e,t)}))}r(Rs,"defineOptions"),r(Fs,"dragDropChanged"),r(Ps,"wrappingChanged"),r(js,"CodeMirror"),js.defaults=As,js.optionHandlers=Ms,r(Vs,"registerEventHandlers");var Us=[];function Bs(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=Et(e,t).state:n="prev");var a=e.options.tabSize,s=Je(o,t),l=V(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==q||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?V(Je(o,t-1).text,null,a):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var d="",f=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/a);p;--p)f+=a,d+="\t";if(fa,l=Re(t),u=null;if(s&&r.ranges.length>1)if($s&&$s.text.join("\n")==t){if(r.ranges.length%$s.text.length==0){u=[];for(var c=0;c<$s.text.length;c++)u.push(o.splitLines($s.text[c]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=Y(l,(function(e){return[e]})));for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var p=r.ranges[f],h=p.from(),m=p.to();p.empty()&&(n&&n>0?h=at(h.line,h.ch-n):e.state.overwrite&&!s?m=at(m.line,Math.min(Je(o,m.line).text.length,m.ch+X(l).length)):s&&$s&&$s.lineWise&&$s.text.join("\n")==l.join("\n")&&(h=m=at(h.line,0)));var g={from:h,to:m,text:u?u[f%u.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Zo(e.doc,g),In(e,"inputRead",e,g)}t&&!s&&zs(e,t),li(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Gs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Li(t,(function(){return Hs(t,n,0,null,"paste")})),!0}function zs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Bs(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Je(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Bs(e,i.head.line,"smart"));a&&In(e,"electricInput",e,i.head.line)}}}function Ws(e){for(var t=[],n=[],r=0;rn&&(Bs(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&li(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Vo(this.doc,r,new ao(o,u[r].to()),H)}}})),getTokenAt:function(e,t){return xt(this,e,t)},getLineTokens:function(e,t){return xt(this,at(e),t,!0)},getTokenTypeAt:function(e){e=pt(this.doc,e);var t,n=bt(this,Je(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=Je(this.doc,e)}else r=e;return vr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-sn(r):0)},defaultTextHeight:function(){return Ir(this.display)},defaultCharWidth:function(){return Dr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=Er(this,pt(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&oi(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Mi(cs),triggerOnKeyPress:Mi(ps),triggerOnKeyUp:fs,triggerOnMouseDown:Mi(bs),execCommand:function(e){if(Ja.hasOwnProperty(e))return Ja[e].call(null,this)},triggerElectric:Mi((function(e){zs(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=pt(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Rr(this),ye(this,"refresh",this)})),swapDoc:Mi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Eo(this,e),pr(this),this.display.input.reset(),ui(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,In(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},we(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function Ys(e,t,n,i,o){var a=t,s=n,l=Je(e,t.line),u=o&&"rtl"==e.direction?-n:n;function c(){var n=t.line+u;return!(n=e.first+e.size)&&(t=new at(n,t.ch,t.sticky),l=Je(e,n))}function d(r){var a;if("codepoint"==i){var s=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(s))a=null;else{var d=n>0?s>=55296&&s<56320:s>=56320&&s<57343;a=new at(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(d?2:1))),-n)}}else a=o?Ya(e.cm,l,t,n):Qa(l,t,n);if(null==a){if(r||!c())return!1;t=Xa(o,e.cm,l,t.line,u)}else t=a;return!0}if(r(c,"findNextLine"),r(d,"moveOnce"),"char"==i||"codepoint"==i)d();else if("column"==i)d(!0);else if("word"==i||"group"==i)for(var f=null,p="group"==i,h=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;!(n<0)||d(!m);m=!1){var g=l.text.charAt(t.ch)||"\n",v=re(g,h)?"w":p&&"\n"==g?"n":!p||/\s/.test(g)?null:"p";if(!p||m||v||(v="s"),f&&f!=v){n<0&&(n=1,d(),t.sticky="after");break}if(v&&(f=v),n>0&&!d(!m))break}var y=Qo(e,t,a,s,!0);return lt(a,y)&&(y.hitSide=!0),y}function Js(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*Ir(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Cr(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}r(qs,"setLastCopied"),r(Hs,"applyTextInput"),r(Gs,"handlePaste"),r(zs,"triggerElectric"),r(Ws,"copyableRanges"),r(Ks,"disableBrowserMagic"),r(Qs,"hiddenTextarea"),r(Xs,"addEditorMethods"),r(Ys,"findPosH"),r(Js,"findPosV");var Zs=r((function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new U,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}),"ContentEditableInput");function el(e,t){var n=nr(e,t.line);if(!n||n.hidden)return null;var r=Je(e.doc,t.line),i=Zn(n,r,t.line),o=pe(r,e.doc.direction),a="left";o&&(a=de(o,t.ch)%2?"right":"left");var s=sr(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function tl(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function nl(e,t){return t&&(e.bad=!0),e}function rl(e,t,n,i,o){var a="",s=!1,l=e.doc.lineSeparator(),u=!1;function c(e){return function(t){return t.id==e}}function d(){s&&(a+=l,u&&(a+=l),s=u=!1)}function f(e){e&&(d(),a+=e)}function p(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void f(n);var r,a=t.getAttribute("cm-marker");if(a){var h=e.findMarks(at(i,0),at(o+1,0),c(+a));return void(h.length&&(r=h[0].find(0))&&f(Ze(e.doc,r.from,r.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&d();for(var g=0;g=t.display.viewTo||o.line=t.display.viewFrom&&el(t,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(a=at(a.line-1,Je(r.doc,a.line-1).length)),s.ch==Je(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=Pr(r,a.line))?(t=nt(i.view[0].line),n=i.view[0].node):(t=nt(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,u,c=Pr(r,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=nt(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(rl(r,n,u,t,l)),f=Ze(r.doc,at(t,0),at(l,Je(r.doc,l).text.length));d.length>1&&f.length>1;)if(X(d)==X(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var p=0,h=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);pa.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)p--,h++;d[d.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var T=at(t,p),w=at(l,f.length?X(f).length-h:0);return d.length>1||d[0]||st(T,w)?(oa(r.doc,d,T,w,"+input"),!0):void 0},Zs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Zs.prototype.reset=function(){this.forceCompositionEnd()},Zs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Zs.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Zs.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Li(this.cm,(function(){return jr(e.cm)}))},Zs.prototype.setUneditable=function(e){e.contentEditable="false"},Zs.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ai(this.cm,Hs)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Zs.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Zs.prototype.onContextMenu=function(){},Zs.prototype.resetPosition=function(){},Zs.prototype.needsContentAttribute=!0,r(el,"posToDOM"),r(tl,"isInGutter"),r(nl,"badPos"),r(rl,"domTextBetween"),r(il,"domToPos"),r(ol,"locateNodeInLineView");var al=r((function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new U,this.hasSelection=!1,this.composing=null}),"TextareaInput");function sl(e,t){if((t=t?j(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=A();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=l.getValue()}var o;if(r(i,"save"),e.form&&(me(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var a=e.form;o=a.submit;try{var s=a.submit=function(){i(),a.submit=o,a.submit(),a.submit=s}}catch(e){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ve(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var l=js((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return l}function ll(e){e.off=ve,e.on=me,e.wheelEventPixels=ro,e.Doc=Sa,e.splitLines=Re,e.countColumn=V,e.findColumn=W,e.isWordChar=ne,e.Pass=q,e.signal=ye,e.Line=cn,e.changeEnd=uo,e.scrollbarModel=Ti,e.Pos=at,e.cmpPos=st,e.modes=Ue,e.mimeModes=Be,e.resolveMode=He,e.getMode=Ge,e.modeExtensions=ze,e.extendMode=We,e.copyState=Ke,e.startState=Xe,e.innerMode=Qe,e.commands=Ja,e.keyMap=Va,e.keyName=Ga,e.isModifierKey=qa,e.lookupKey=$a,e.normalizeKeyMap=Ba,e.StringStream=Ye,e.SharedTextMarker=ya,e.TextMarker=ga,e.LineWidget=fa,e.e_preventDefault=Ce,e.e_stopPropagation=Se,e.e_stop=Ne,e.addClass=M,e.contains=L,e.rmClass=k,e.keyNames=Ra}al.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var o=this.textarea;function a(e){if(!be(i,e)){if(i.somethingSelected())qs({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Ws(i);qs({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,H):(n.prevInput="",o.value=t.text.join("\n"),F(o))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(o.style.width="0px"),me(o,"input",(function(){s&&l>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),me(o,"paste",(function(e){be(i,e)||Gs(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),r(a,"prepareCopyCut"),me(o,"cut",a),me(o,"copy",a),me(e.scroller,"paste",(function(t){if(!Gn(e,t)&&!be(i,t)){if(!o.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var r=new Event("paste");r.clipboardData=t.clipboardData,o.dispatchEvent(r)}})),me(e.lineSpace,"selectstart",(function(t){Gn(e,t)||Ce(t)})),me(o,"compositionstart",(function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}})),me(o,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},al.prototype.createField=function(e){this.wrapper=Qs(),this.textarea=this.wrapper.firstChild},al.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},al.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Gr(e);if(e.options.moveInputWithCursor){var i=Er(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},al.prototype.showSelection=function(e){var t=this.cm.display;O(t.cursorDiv,e.cursors),O(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},al.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&F(this.textarea),s&&l>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&l>=9&&(this.hasSelection=null))}},al.prototype.getField=function(){return this.textarea},al.prototype.supportsTouch=function(){return!1},al.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||A()!=this.textarea))try{this.textarea.focus()}catch(e){}},al.prototype.blur=function(){this.textarea.blur()},al.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},al.prototype.receivedFocus=function(){this.slowPoll()},al.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},al.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,r(n,"p"),t.polling.set(20,n)},al.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Fe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&l>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,u=Math.min(r.length,i.length);a1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},al.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},al.prototype.onKeyPress=function(){s&&l>=9&&(this.hasSelection=null),this.fastPoll()},al.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Fr(n,e),c=i.scroller.scrollTop;if(a&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(a)&&Ai(n,qo)(n.doc,lo(a),H);var d,p=o.style.cssText,h=t.wrapper.style.cssText,m=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-m.top-5)+"px; left: "+(e.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",u&&(d=window.scrollY),i.input.focus(),u&&window.scrollTo(null,d),i.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=y,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),r(v,"prepareSelectAllHack"),r(y,"rehide"),s&&l>=9&&v(),S){Ne(e);var g=r((function(){ve(window,"mouseup",g),setTimeout(y,20)}),"mouseup");me(window,"mouseup",g)}else setTimeout(y,50)}function v(){if(null!=o.selectionStart){var e=n.somethingSelected(),r="​"+(e?o.value:"");o.value="⇚",o.value=r,t.prevInput=e?"":"​",o.selectionStart=1,o.selectionEnd=r.length,i.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,o.style.cssText=p,s&&l<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=o.selectionStart)){(!s||s&&l<9)&&v();var e=0,a=r((function(){i.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==t.prevInput?Ai(n,Yo)(n):e++<10?i.detectingSelectAll=setTimeout(a,500):(i.selForContextMenu=null,i.input.reset())}),"poll");i.detectingSelectAll=setTimeout(a,200)}}},al.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},al.prototype.setUneditable=function(){},al.prototype.needsContentAttribute=!1,r(sl,"fromTextArea"),r(ll,"addLegacyProps"),Rs(js),Xs(js);var ul="iter insert remove copy getEditor constructor".split(" ");for(var cl in Sa.prototype)Sa.prototype.hasOwnProperty(cl)&&B(ul,cl)<0&&(js.prototype[cl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Sa.prototype[cl]));return we(Sa),js.inputStyles={textarea:al,contenteditable:Zs},js.defineMode=function(e){js.defaults.mode||"null"==e||(js.defaults.mode=e),$e.apply(this,arguments)},js.defineMIME=qe,js.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),js.defineMIME("text/plain","null"),js.defineExtension=function(e,t){js.prototype[e]=t},js.defineDocExtension=function(e,t){Sa.prototype[e]=t},js.fromTextArea=sl,ll(js),js.version="5.65.3",js}()}(o);var a=o.exports;e.C=a;var s=i({__proto__:null,default:a},[o.exports]);e.c=s},void 0===(o=r.apply(t,i))||(e.exports=o)},6754:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535)],void 0===(o="function"==typeof(r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.c=void 0;var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};!function(e){var t={},n=/[^\s\u00a0]/,i=e.Pos,o=e.cmpPos;function a(e){var t=e.search(n);return-1==t?0:t}function s(e,t,n){return/\bstring\b/.test(e.getTokenTypeAt(i(t.line,0)))&&!/^[\'\"\`]/.test(n)}function l(e,t){var n=e.getMode();return!1!==n.useInnerComments&&n.innerMode?e.getModeAt(t):n}r(a,"firstNonWS"),e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=t);for(var n=this,r=1/0,o=this.listSelections(),a=null,s=o.length-1;s>=0;s--){var l=o[s].from(),u=o[s].to();l.line>=r||(u.line>=r&&(u=i(r,0)),r=l.line,null==a?n.uncomment(l,u,e)?a="un":(n.lineComment(l,u,e),a="line"):"un"==a?n.uncomment(l,u,e):n.lineComment(l,u,e))}})),r(s,"probablyInsideString"),r(l,"getMode"),e.defineExtension("lineComment",(function(e,r,o){o||(o=t);var u=this,c=l(u,e),d=u.getLine(e.line);if(null!=d&&!s(u,e,d)){var f=o.lineComment||c.lineComment;if(f){var p=Math.min(0!=r.ch||r.line==e.line?r.line+1:r.line,u.lastLine()+1),h=null==o.padding?" ":o.padding,m=o.commentBlankLines||e.line==r.line;u.operation((function(){if(o.indent){for(var t=null,r=e.line;rs.length)&&(t=s)}for(r=e.line;rf||s.operation((function(){if(0!=a.fullLines){var t=n.test(s.getLine(f));s.replaceRange(p+d,i(f)),s.replaceRange(c+p,i(e.line,0));var l=a.blockCommentLead||u.blockCommentLead;if(null!=l)for(var h=e.line+1;h<=f;++h)(h!=f||t)&&s.replaceRange(l+p,i(h,0))}else{var m=0==o(s.getCursor("to"),r),g=!s.somethingSelected();s.replaceRange(d,r),m&&s.setSelection(g?r:s.getCursor("from"),r),s.replaceRange(c,e)}}))}}else(a.lineComment||u.lineComment)&&0!=a.fullLines&&s.lineComment(e,r,a)})),e.defineExtension("uncomment",(function(e,r,o){o||(o=t);var a,s=this,u=l(s,e),c=Math.min(0!=r.ch||r.line==e.line?r.line:r.line-1,s.lastLine()),d=Math.min(e.line,c),f=o.lineComment||u.lineComment,p=[],h=null==o.padding?" ":o.padding;e:if(f){for(var m=d;m<=c;++m){var g=s.getLine(m),v=g.indexOf(f);if(v>-1&&!/comment/.test(s.getTokenTypeAt(i(m,v+1)))&&(v=-1),-1==v&&n.test(g))break e;if(v>-1&&n.test(g.slice(0,v)))break e;p.push(g)}if(s.operation((function(){for(var e=d;e<=c;++e){var t=p[e-d],n=t.indexOf(f),r=n+f.length;n<0||(t.slice(r,r+h.length)==h&&(r+=h.length),a=!0,s.replaceRange("",i(e,n),i(e,r)))}})),a)return!0}var y=o.blockCommentStart||u.blockCommentStart,b=o.blockCommentEnd||u.blockCommentEnd;if(!y||!b)return!1;var E=o.blockCommentLead||u.blockCommentLead,T=s.getLine(d),w=T.indexOf(y);if(-1==w)return!1;var C=c==d?T:s.getLine(c),S=C.indexOf(b,c==d?w+y.length:0),x=i(d,w+1),N=i(c,S+1);if(-1==S||!/comment/.test(s.getTokenTypeAt(x))||!/comment/.test(s.getTokenTypeAt(N))||s.getRange(x,N,"\n").indexOf(b)>-1)return!1;var k=T.lastIndexOf(y,e.ch),_=-1==k?-1:T.slice(0,e.ch).indexOf(b,k+y.length);if(-1!=k&&-1!=_&&_+b.length!=e.ch)return!1;_=C.indexOf(b,r.ch);var O=C.slice(r.ch).lastIndexOf(y,_-r.ch);return k=-1==_||-1==O?-1:r.ch+O,(-1==_||-1==k||k==r.ch)&&(s.operation((function(){s.replaceRange("",i(c,S-(h&&C.slice(S-h.length,S)==h?h.length:0)),i(c,S+b.length));var e=w+y.length;if(h&&T.slice(e,e+h.length)==h&&(e+=h.length),s.replaceRange("",i(d,w),i(d,e)),E)for(var t=d+1;t<=c;++t){var r=s.getLine(t),o=r.indexOf(E);if(-1!=o&&!n.test(r.slice(0,o))){var a=o+E.length;h&&r.slice(a,a+h.length)==h&&(a+=h.length),s.replaceRange("",i(t,o),i(t,a))}}})),!0)}))}(t.a.exports);var a=i({__proto__:null,default:o.exports},[o.exports]);e.c=a})?r.apply(t,i):r)||(e.exports=o)},8058:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535)],void 0===(o="function"==typeof(r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.d=e.a=void 0;var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};e.a=o,function(e){function t(t,n,r){var i,o=t.getWrapperElement();return(i=o.appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(o,"dialog-opened"),i}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}r(t,"dialogDiv"),r(n,"closeNotification"),e.defineExtension("openDialog",(function(i,o,a){a||(a={}),n(this,null);var s=t(this,i,a.bottom),l=!1,u=this;function c(t){if("string"==typeof t)f.value=t;else{if(l)return;l=!0,e.rmClass(s.parentNode,"dialog-opened"),s.parentNode.removeChild(s),u.focus(),a.onClose&&a.onClose(s)}}r(c,"close");var d,f=s.getElementsByTagName("input")[0];return f?(f.focus(),a.value&&(f.value=a.value,!1!==a.selectValueOnOpen&&f.select()),a.onInput&&e.on(f,"input",(function(e){a.onInput(e,f.value,c)})),a.onKeyUp&&e.on(f,"keyup",(function(e){a.onKeyUp(e,f.value,c)})),e.on(f,"keydown",(function(t){a&&a.onKeyDown&&a.onKeyDown(t,f.value,c)||((27==t.keyCode||!1!==a.closeOnEnter&&13==t.keyCode)&&(f.blur(),e.e_stop(t),c()),13==t.keyCode&&o(f.value,t))})),!1!==a.closeOnBlur&&e.on(s,"focusout",(function(e){null!==e.relatedTarget&&c()}))):(d=s.getElementsByTagName("button")[0])&&(e.on(d,"click",(function(){c(),u.focus()})),!1!==a.closeOnBlur&&e.on(d,"blur",c),d.focus()),c})),e.defineExtension("openConfirm",(function(i,o,a){n(this,null);var s=t(this,i,a&&a.bottom),l=s.getElementsByTagName("button"),u=!1,c=this,d=1;function f(){u||(u=!0,e.rmClass(s.parentNode,"dialog-opened"),s.parentNode.removeChild(s),c.focus())}r(f,"close"),l[0].focus();for(var p=0;pn(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};!function(e){function t(t,i,a,s){if(a&&a.call){var l=a;a=null}else l=o(t,a,"rangeFinder");"number"==typeof i&&(i=e.Pos(i,0));var u=o(t,a,"minFoldSize");function c(e){var n=l(t,i);if(!n||n.to.line-n.from.linet.firstLine();)i=e.Pos(i.line-1,0),d=c(!1);if(d&&!d.cleared&&"unfold"!==s){var f=n(t,a,d);e.on(f,"mousedown",(function(t){p.clear(),e.e_preventDefault(t)}));var p=t.markText(d.from,d.to,{replacedWith:f,clearOnEnter:o(t,a,"clearOnEnter"),__isFold:!0});p.on("clear",(function(n,r){e.signal(t,"unfold",t,n,r)})),e.signal(t,"fold",t,d.from,d.to)}}function n(e,t,n){var r=o(e,t,"widget");if("function"==typeof r&&(r=r(n.from,n.to)),"string"==typeof r){var i=document.createTextNode(r);(r=document.createElement("span")).appendChild(i),r.className="CodeMirror-foldmarker"}else r&&(r=r.cloneNode(!0));return r}r(t,"doFold"),r(n,"makeWidget"),e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",(function(e,n,r){t(this,e,n,r)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),n=0;n=u){if(f&&l&&f.test(l.className))return;r=a(i.indicatorOpen)}}(r||l)&&e.setGutterMarker(n,i.gutter,r)}))}function l(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function u(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation((function(){s(e,t.from,t.to)})),n.from=t.from,n.to=t.to)}function c(e,n,r){var i=e.state.foldGutter;if(i){var a=i.options;if(r==a.gutter){var s=o(e,n);s?s.clear():e.foldCode(t(n,0),a)}}}function d(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){u(e)}),n.foldOnChangeTimeSpan||600)}}function f(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?u(e):e.operation((function(){n.fromt.to&&(s(e,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function p(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r=0;e--)t(n[e])}Object.defineProperty(e,"__esModule",{value:!0}),e.f=t,(0,Object.defineProperty)(t,"name",{value:"forEachState",configurable:!0})})?n.apply(t,[t]):n)||(e.exports=r)},7139:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(6856),n(9196),n(3573),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Argument",{enumerable:!0,get:function(){return t.A}}),Object.defineProperty(e,"ArgumentIcon",{enumerable:!0,get:function(){return t.ac}}),Object.defineProperty(e,"Button",{enumerable:!0,get:function(){return t.aH}}),Object.defineProperty(e,"ButtonGroup",{enumerable:!0,get:function(){return t.aI}}),Object.defineProperty(e,"ChevronDownIcon",{enumerable:!0,get:function(){return t.ad}}),Object.defineProperty(e,"ChevronLeftIcon",{enumerable:!0,get:function(){return t.ae}}),Object.defineProperty(e,"ChevronUpIcon",{enumerable:!0,get:function(){return t.af}}),Object.defineProperty(e,"CloseIcon",{enumerable:!0,get:function(){return t.ag}}),Object.defineProperty(e,"CopyIcon",{enumerable:!0,get:function(){return t.ah}}),Object.defineProperty(e,"DOC_EXPLORER_PLUGIN",{enumerable:!0,get:function(){return t._}}),Object.defineProperty(e,"DefaultValue",{enumerable:!0,get:function(){return t.D}}),Object.defineProperty(e,"DeprecatedArgumentIcon",{enumerable:!0,get:function(){return t.ai}}),Object.defineProperty(e,"DeprecatedEnumValueIcon",{enumerable:!0,get:function(){return t.aj}}),Object.defineProperty(e,"DeprecatedFieldIcon",{enumerable:!0,get:function(){return t.ak}}),Object.defineProperty(e,"DeprecationReason",{enumerable:!0,get:function(){return t.w}}),Object.defineProperty(e,"Dialog",{enumerable:!0,get:function(){return t.aJ}}),Object.defineProperty(e,"Directive",{enumerable:!0,get:function(){return t.x}}),Object.defineProperty(e,"DirectiveIcon",{enumerable:!0,get:function(){return t.al}}),Object.defineProperty(e,"DocExplorer",{enumerable:!0,get:function(){return t.y}}),Object.defineProperty(e,"DocsFilledIcon",{enumerable:!0,get:function(){return t.am}}),Object.defineProperty(e,"DocsIcon",{enumerable:!0,get:function(){return t.an}}),Object.defineProperty(e,"EditorContext",{enumerable:!0,get:function(){return t.E}}),Object.defineProperty(e,"EditorContextProvider",{enumerable:!0,get:function(){return t.d}}),Object.defineProperty(e,"EnumValueIcon",{enumerable:!0,get:function(){return t.ao}}),Object.defineProperty(e,"ExecuteButton",{enumerable:!0,get:function(){return t.aS}}),Object.defineProperty(e,"ExecutionContext",{enumerable:!0,get:function(){return t.r}}),Object.defineProperty(e,"ExecutionContextProvider",{enumerable:!0,get:function(){return t.s}}),Object.defineProperty(e,"ExplorerContext",{enumerable:!0,get:function(){return t.z}}),Object.defineProperty(e,"ExplorerContextProvider",{enumerable:!0,get:function(){return t.B}}),Object.defineProperty(e,"ExplorerSection",{enumerable:!0,get:function(){return t.F}}),Object.defineProperty(e,"FieldDocumentation",{enumerable:!0,get:function(){return t.G}}),Object.defineProperty(e,"FieldIcon",{enumerable:!0,get:function(){return t.ap}}),Object.defineProperty(e,"FieldLink",{enumerable:!0,get:function(){return t.J}}),Object.defineProperty(e,"GraphiQLProvider",{enumerable:!0,get:function(){return t.a3}}),Object.defineProperty(e,"HISTORY_PLUGIN",{enumerable:!0,get:function(){return t.$}}),Object.defineProperty(e,"HeaderEditor",{enumerable:!0,get:function(){return t.H}}),Object.defineProperty(e,"History",{enumerable:!0,get:function(){return t.W}}),Object.defineProperty(e,"HistoryContext",{enumerable:!0,get:function(){return t.X}}),Object.defineProperty(e,"HistoryContextProvider",{enumerable:!0,get:function(){return t.Y}}),Object.defineProperty(e,"HistoryIcon",{enumerable:!0,get:function(){return t.aq}}),Object.defineProperty(e,"ImagePreview",{enumerable:!0,get:function(){return t.I}}),Object.defineProperty(e,"ImplementsIcon",{enumerable:!0,get:function(){return t.ar}}),Object.defineProperty(e,"KeyboardShortcutIcon",{enumerable:!0,get:function(){return t.as}}),Object.defineProperty(e,"Listbox",{enumerable:!0,get:function(){return t.aL}}),Object.defineProperty(e,"MagnifyingGlassIcon",{enumerable:!0,get:function(){return t.at}}),Object.defineProperty(e,"MarkdownContent",{enumerable:!0,get:function(){return t.aM}}),Object.defineProperty(e,"Menu",{enumerable:!0,get:function(){return t.aK}}),Object.defineProperty(e,"MergeIcon",{enumerable:!0,get:function(){return t.au}}),Object.defineProperty(e,"PenIcon",{enumerable:!0,get:function(){return t.av}}),Object.defineProperty(e,"PlayIcon",{enumerable:!0,get:function(){return t.aw}}),Object.defineProperty(e,"PluginContext",{enumerable:!0,get:function(){return t.a0}}),Object.defineProperty(e,"PluginContextProvider",{enumerable:!0,get:function(){return t.a1}}),Object.defineProperty(e,"PlusIcon",{enumerable:!0,get:function(){return t.ax}}),Object.defineProperty(e,"PrettifyIcon",{enumerable:!0,get:function(){return t.ay}}),Object.defineProperty(e,"QueryEditor",{enumerable:!0,get:function(){return t.Q}}),Object.defineProperty(e,"ReloadIcon",{enumerable:!0,get:function(){return t.az}}),Object.defineProperty(e,"ResponseEditor",{enumerable:!0,get:function(){return t.R}}),Object.defineProperty(e,"RootTypeIcon",{enumerable:!0,get:function(){return t.aA}}),Object.defineProperty(e,"SchemaContext",{enumerable:!0,get:function(){return t.a4}}),Object.defineProperty(e,"SchemaContextProvider",{enumerable:!0,get:function(){return t.a5}}),Object.defineProperty(e,"SchemaDocumentation",{enumerable:!0,get:function(){return t.K}}),Object.defineProperty(e,"Search",{enumerable:!0,get:function(){return t.M}}),Object.defineProperty(e,"SettingsIcon",{enumerable:!0,get:function(){return t.aB}}),Object.defineProperty(e,"Spinner",{enumerable:!0,get:function(){return t.aN}}),Object.defineProperty(e,"StarFilledIcon",{enumerable:!0,get:function(){return t.aC}}),Object.defineProperty(e,"StarIcon",{enumerable:!0,get:function(){return t.aD}}),Object.defineProperty(e,"StopIcon",{enumerable:!0,get:function(){return t.aE}}),Object.defineProperty(e,"StorageContext",{enumerable:!0,get:function(){return t.a7}}),Object.defineProperty(e,"StorageContextProvider",{enumerable:!0,get:function(){return t.a8}}),Object.defineProperty(e,"Tab",{enumerable:!0,get:function(){return t.aO}}),Object.defineProperty(e,"Tabs",{enumerable:!0,get:function(){return t.aP}}),Object.defineProperty(e,"ToolbarButton",{enumerable:!0,get:function(){return t.aR}}),Object.defineProperty(e,"ToolbarListbox",{enumerable:!0,get:function(){return t.aT}}),Object.defineProperty(e,"ToolbarMenu",{enumerable:!0,get:function(){return t.aU}}),Object.defineProperty(e,"Tooltip",{enumerable:!0,get:function(){return t.aQ}}),Object.defineProperty(e,"TypeDocumentation",{enumerable:!0,get:function(){return t.N}}),Object.defineProperty(e,"TypeIcon",{enumerable:!0,get:function(){return t.aF}}),Object.defineProperty(e,"TypeLink",{enumerable:!0,get:function(){return t.O}}),Object.defineProperty(e,"UnStyledButton",{enumerable:!0,get:function(){return t.aG}}),Object.defineProperty(e,"VariableEditor",{enumerable:!0,get:function(){return t.V}}),Object.defineProperty(e,"useAutoCompleteLeafs",{enumerable:!0,get:function(){return t.u}}),Object.defineProperty(e,"useCopyQuery",{enumerable:!0,get:function(){return t.e}}),Object.defineProperty(e,"useDragResize",{enumerable:!0,get:function(){return t.ab}}),Object.defineProperty(e,"useEditorContext",{enumerable:!0,get:function(){return t.f}}),Object.defineProperty(e,"useExecutionContext",{enumerable:!0,get:function(){return t.v}}),Object.defineProperty(e,"useExplorerContext",{enumerable:!0,get:function(){return t.U}}),Object.defineProperty(e,"useHeaderEditor",{enumerable:!0,get:function(){return t.h}}),Object.defineProperty(e,"useHistoryContext",{enumerable:!0,get:function(){return t.Z}}),Object.defineProperty(e,"useMergeQuery",{enumerable:!0,get:function(){return t.j}}),Object.defineProperty(e,"usePluginContext",{enumerable:!0,get:function(){return t.a2}}),Object.defineProperty(e,"usePrettifyEditors",{enumerable:!0,get:function(){return t.k}}),Object.defineProperty(e,"useQueryEditor",{enumerable:!0,get:function(){return t.m}}),Object.defineProperty(e,"useResponseEditor",{enumerable:!0,get:function(){return t.n}}),Object.defineProperty(e,"useSchemaContext",{enumerable:!0,get:function(){return t.a6}}),Object.defineProperty(e,"useStorageContext",{enumerable:!0,get:function(){return t.a9}}),Object.defineProperty(e,"useTheme",{enumerable:!0,get:function(){return t.aa}}),Object.defineProperty(e,"useVariableEditor",{enumerable:!0,get:function(){return t.q}})})?r.apply(t,i):r)||(e.exports=o)},4840:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(6980),n(3573),n(6856),n(5609),n(9196),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i,o,a){"use strict";e.C.registerHelper("hint","graphql",((t,n)=>{const{schema:o,externalFragments:a}=n;if(!o)return;const s=t.getCursor(),l=t.getTokenAt(s),u=null!==l.type&&/"|\w/.test(l.string[0])?l.start:l.end,c=new i.P(s.line,u),d={list:(0,r.g)(o,t.getValue(),c,l,a).map((e=>({text:e.label,type:e.type,description:e.documentation,isDeprecated:e.isDeprecated,deprecationReason:e.deprecationReason}))),from:{line:s.line,ch:u},to:{line:s.line,ch:l.end}};return(null==d?void 0:d.list)&&d.list.length>0&&(d.from=e.C.Pos(d.from.line,d.from.ch),d.to=e.C.Pos(d.to.line,d.to.ch),e.C.signal(t,"hasCompletion",t,d,l)),d}))})?r.apply(t,i):r)||(e.exports=o)},4712:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(3573),n(2635),n(6856),n(9196),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i,o){"use strict";var a=Object.defineProperty,s=(e,t)=>a(e,"name",{value:t,configurable:!0});function l(e,t,n){const r=u(n,d(t.string));if(!r)return;const i=null!==t.type&&/"|\w/.test(t.string[0])?t.start:t.end;return{list:r,from:{line:e.line,ch:i},to:{line:e.line,ch:t.end}}}function u(e,t){return t?c(c(e.map((e=>({proximity:f(d(e.text),t),entry:e}))),(e=>e.proximity<=2)),(e=>!e.entry.isDeprecated)).sort(((e,t)=>(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.text.length-t.entry.text.length)).map((e=>e.entry)):c(e,(e=>!e.isDeprecated))}function c(e,t){const n=e.filter(t);return 0===n.length?e:n}function d(e){return e.toLowerCase().replaceAll(/\W/g,"")}function f(e,t){let n=p(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}function p(e,t){let n,r;const i=[],o=e.length,a=t.length;for(n=0;n<=o;n++)i[n]=[n];for(r=1;r<=a;r++)i[0][r]=r;for(n=1;n<=o;n++)for(r=1;r<=a;r++){const o=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+o),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+o))}return i[o][a]}function h(e,n,r){const i="Invalid"===n.state.kind?n.state.prevState:n.state,{kind:o,step:a}=i;if("Document"===o&&0===a)return l(e,n,[{text:"{"}]);const{variableToType:s}=r;if(!s)return;const u=m(s,n.state);if("Document"===o||"Variable"===o&&0===a)return l(e,n,Object.keys(s).map((e=>({text:`"${e}": `,type:s[e]}))));if(("ObjectValue"===o||"ObjectField"===o&&0===a)&&u.fields)return l(e,n,Object.keys(u.fields).map((e=>u.fields[e])).map((e=>({text:`"${e.name}": `,type:e.type,description:e.description}))));if("StringValue"===o||"NumberValue"===o||"BooleanValue"===o||"NullValue"===o||"ListValue"===o&&1===a||"ObjectField"===o&&2===a||"Variable"===o&&2===a){const r=u.type?(0,t.getNamedType)(u.type):void 0;if(r instanceof t.GraphQLInputObjectType)return l(e,n,[{text:"{"}]);if(r instanceof t.GraphQLEnumType)return l(e,n,r.getValues().map((e=>({text:`"${e.name}"`,type:r,description:e.description}))));if(r===t.GraphQLBoolean)return l(e,n,[{text:"true",type:t.GraphQLBoolean,description:"Not false."},{text:"false",type:t.GraphQLBoolean,description:"Not true."}])}}function m(e,r){const i={type:null,fields:null};return(0,n.f)(r,(n=>{switch(n.kind){case"Variable":i.type=e[n.name];break;case"ListValue":{const e=i.type?(0,t.getNullableType)(i.type):void 0;i.type=e instanceof t.GraphQLList?e.ofType:null;break}case"ObjectValue":{const e=i.type?(0,t.getNamedType)(i.type):void 0;i.fields=e instanceof t.GraphQLInputObjectType?e.getFields():null;break}case"ObjectField":{const e=n.name&&i.fields?i.fields[n.name]:null;i.type=null==e?void 0:e.type;break}}})),i}s(l,"hintList"),s(u,"filterAndSortList"),s(c,"filterNonEmpty"),s(d,"normalizeText"),s(f,"getProximity"),s(p,"lexicalDistance"),e.C.registerHelper("hint","graphql-variables",((t,n)=>{const r=t.getCursor(),i=t.getTokenAt(r),o=h(r,i,n);return(null==o?void 0:o.list)&&o.list.length>0&&(o.from=e.C.Pos(o.from.line,o.from.ch),o.to=e.C.Pos(o.to.line,o.to.ch),e.C.signal(t,"hasCompletion",t,o,i)),o})),s(h,"getVariablesHint"),s(m,"getTypeInfo")})?r.apply(t,i):r)||(e.exports=o)},6856:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(9196),n(3573),n(1850)],r=function(e,t,r,i){"use strict";function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}function a(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}Object.defineProperty(e,"__esModule",{value:!0}),e.$=void 0,e.A=YE,e.B=BE,e.C=void 0,e.D=OE,e.E=void 0,e.F=aT,e.G=cT,e.H=uS,e.I=fS,e.J=Dw,e.K=mT,e.L=void 0,e.M=Sw,e.N=Mw,e.O=KE,e.P=void 0,e.Q=vS,e.R=CS,e.U=e.T=e.S=void 0,e.V=NS,e.W=iE,e.X=void 0,e.Y=Zb,e.a0=e.a=e._=e.Z=void 0,e.a1=Qw,e.a2=void 0,e.a3=OS,e.a4=void 0,e.a5=AE,e.a7=e.a6=void 0,e.a8=ge,e.aR=e.aQ=e.aP=e.aO=e.aN=e.aM=e.aL=e.aK=e.aJ=e.aI=e.aH=e.aG=e.aF=e.aE=e.aD=e.aC=e.aB=e.aA=e.a9=void 0,e.aS=qS,e.aU=e.aT=void 0,e.aa=LS,e.ab=FS,e.az=e.ay=e.ax=e.aw=e.av=e.au=e.at=e.as=e.ar=e.aq=e.ap=e.ao=e.an=e.am=e.al=e.ak=e.aj=e.ai=e.ah=e.ag=e.af=e.ae=e.ad=e.ac=void 0,e.b=ki,e.c=void 0,e.d=rS,e.e=lC,e.f=void 0,e.g=Zi,e.h=hC,e.i=void 0,e.j=uC,e.k=cC,e.l=_i,e.m=CC,e.n=ES,e.o=ji,e.p=Di,e.q=JC,e.r=void 0,e.s=cE,e.t=Ii,e.u=dC,e.v=void 0,e.w=eT,e.x=rT,e.y=qw,e.z=void 0,t=a(t),i=a(i);var s=Object.defineProperty,l=Object.defineProperties,u=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,p=(e,t,n)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h=(e,t)=>{for(var n in t||(t={}))d.call(t,n)&&p(e,n,t[n]);if(c)for(var n of c(t))f.call(t,n)&&p(e,n,t[n]);return e},m=(e,t)=>l(e,u(t)),g=(e,t)=>s(e,"name",{value:t,configurable:!0}),v=(e,t)=>{var n={};for(var r in e)d.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&c)for(var r of c(e))t.indexOf(r)<0&&f.call(e,r)&&(n[r]=e[r]);return n};function y(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t{const r=e.subscribe({next:e=>{t(e),r.unsubscribe()},error:n,complete:()=>{n(new Error("no value resolved"))}})}))}function w(e){return"object"==typeof e&&null!==e&&"subscribe"in e&&"function"==typeof e.subscribe}function C(e){return"object"==typeof e&&null!==e&&("AsyncGenerator"===e[Symbol.toStringTag]||Symbol.asyncIterator in e)}function S(e){return new Promise(((t,n)=>{var r;const i=null===(r=("return"in e?e:e[Symbol.asyncIterator]()).return)||void 0===r?void 0:r.bind(e);("next"in e?e:e[Symbol.asyncIterator]()).next.bind(e)().then((e=>{t(e.value),null==i||i()})).catch((e=>{n(e)}))}))}function x(e){return Promise.resolve(e).then((e=>C(e)?S(e):w(e)?T(e):e))}g(y,"r$2"),g(b,"clsx"),g(E,"isPromise"),g(T,"observableToPromise"),g(w,"isObservable"),g(C,"isAsyncIterable"),g(S,"asyncIterableToPromise"),g(x,"fetcherReturnToPromise"),globalThis&&globalThis.__awaiter;var N=globalThis&&globalThis.__await||function(e){return this instanceof N?(this.v=e,this):new N(e)};function k(e){return JSON.stringify(e,null,2)}function _(e){return Object.assign(Object.assign({},e),{message:e.message,stack:e.stack})}function O(e){return e instanceof Error?_(e):e}function I(e){return Array.isArray(e)?k({errors:e.map((e=>O(e)))}):k({errors:[O(e)]})}function D(e){return k(e)}function L(e,t,n){const i=[];if(!e||!t)return{insertions:i,result:t};let o;try{o=(0,r.parse)(t)}catch(e){return{insertions:i,result:t}}const a=n||A,s=new r.TypeInfo(e);return(0,r.visit)(o,{leave(e){s.leave(e)},enter(e){if(s.enter(e),"Field"===e.kind&&!e.selectionSet){const n=M(P(s.getType()),a);if(n&&e.loc){const o=F(t,e.loc.start);i.push({index:e.loc.end,string:" "+(0,r.print)(n).replaceAll("\n","\n"+o)})}}}}),{insertions:i,result:R(t,i)}}function A(e){if(!("getFields"in e))return[];const t=e.getFields();if(t.id)return["id"];if(t.edges)return["edges"];if(t.node)return["node"];const n=[];return Object.keys(t).forEach((e=>{(0,r.isLeafType)(t[e].type)&&n.push(e)})),n}function M(e,t){const n=(0,r.getNamedType)(e);if(!e||(0,r.isLeafType)(e))return;const i=t(n);return Array.isArray(i)&&0!==i.length&&"getFields"in n?{kind:r.Kind.SELECTION_SET,selections:i.map((e=>{const i=n.getFields()[e],o=i?i.type:null;return{kind:r.Kind.FIELD,name:{kind:r.Kind.NAME,value:e},selectionSet:M(o,t)}}))}:void 0}function R(e,t){if(0===t.length)return e;let n="",r=0;return t.forEach((t=>{let{index:i,string:o}=t;n+=e.slice(r,i)+o,r=i})),n+=e.slice(r),n}function F(e,t){let n=t,r=t;for(;n;){const t=e.charCodeAt(n-1);if(10===t||13===t||8232===t||8233===t)break;n--,9!==t&&11!==t&&12!==t&&32!==t&&160!==t&&(r=n)}return e.slice(n,r)}function P(e){if(e)return e}function j(e,t){var n;const r=new Map,i=[];for(const o of e)if("Field"===o.kind){const e=t(o),a=r.get(e);if(null===(n=o.directives)||void 0===n?void 0:n.length){const e=Object.assign({},o);i.push(e)}else if((null==a?void 0:a.selectionSet)&&o.selectionSet)a.selectionSet.selections=[...a.selectionSet.selections,...o.selectionSet.selections];else if(!a){const t=Object.assign({},o);r.set(e,t),i.push(t)}}else i.push(o);return i}function V(e,t,n){var i;const o=n?(0,r.getNamedType)(n).name:null,a=[],s=[];for(let l of t){if("FragmentSpread"===l.kind){const t=l.name.value;if(!l.directives||0===l.directives.length){if(s.includes(t))continue;s.push(t)}const n=e[l.name.value];if(n){const{typeCondition:e,directives:t,selectionSet:i}=n;l={kind:r.Kind.INLINE_FRAGMENT,typeCondition:e,directives:t,selectionSet:i}}}if(l.kind===r.Kind.INLINE_FRAGMENT&&(!l.directives||0===(null===(i=l.directives)||void 0===i?void 0:i.length))){const t=l.typeCondition?l.typeCondition.name.value:null;if(!t||t===o){a.push(...V(e,l.selectionSet.selections,n));continue}}a.push(l)}return a}function U(e,t){const n=t?new r.TypeInfo(t):null,i=Object.create(null);for(const t of e.definitions)t.kind===r.Kind.FRAGMENT_DEFINITION&&(i[t.name.value]=t);const o={SelectionSet(e){const t=n?n.getParentType():null;let{selections:r}=e;return r=V(i,r,t),r=j(r,(e=>e.alias?e.alias.value:e.name.value)),Object.assign(Object.assign({},e),{selections:r})},FragmentDefinition(){return null}};return(0,r.visit)(e,n?(0,r.visitWithTypeInfo)(n,o):o)}function B(e,t,n){if(!n||n.length<1)return;const r=n.map((e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.value}));if(t&&r.includes(t))return t;if(t&&e){const n=e.map((e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.value})).indexOf(t);if(-1!==n&&n{for(const e in window.localStorage)0===e.indexOf(`${H}:`)&&window.localStorage.removeItem(e)}}}get(e){if(!this.storage)return null;const t=`${H}:${e}`,n=this.storage.getItem(t);return"null"===n||"undefined"===n?(this.storage.removeItem(t),null):n||null}set(e,t){let n=!1,r=null;if(this.storage){const i=`${H}:${e}`;if(t)try{this.storage.setItem(i,t)}catch(e){r=e instanceof Error?e:new Error(`${e}`),n=$(this.storage,e)}else this.storage.removeItem(i)}return{isQuotaError:n,error:r}}clear(){this.storage&&this.storage.clear()}}g(q,"StorageAPI");const H="graphiql";class G{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.key=e,this.storage=t,this.maxSize=n,this.items=this.fetchAll()}get length(){return this.items.length}contains(e){return this.items.some((t=>t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName))}edit(e){const t=this.items.findIndex((t=>t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName));-1!==t&&(this.items.splice(t,1,e),this.save())}delete(e){const t=this.items.findIndex((t=>t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName));-1!==t&&(this.items.splice(t,1),this.save())}fetchRecent(){return this.items.at(-1)}fetchAll(){const e=this.storage.get(this.key);return e?JSON.parse(e)[this.key]:[]}push(e){const t=[...this.items,e];this.maxSize&&t.length>this.maxSize&&t.shift();for(let e=0;e<5;e++){const e=this.storage.set(this.key,JSON.stringify({[this.key]:t}));if(null==e?void 0:e.error){if(!e.isQuotaError||!this.maxSize)return;t.shift()}else this.items=t}}save(){this.storage.set(this.key,JSON.stringify({[this.key]:this.items}))}}g(G,"QueryStore");class z{constructor(e,t){this.storage=e,this.maxHistoryLength=t,this.updateHistory=(e,t,n,r)=>{if(this.shouldSaveQuery(e,t,n,this.history.fetchRecent())){this.history.push({query:e,variables:t,headers:n,operationName:r});const i=this.history.items,o=this.favorite.items;this.queries=i.concat(o)}},this.history=new G("queries",this.storage,this.maxHistoryLength),this.favorite=new G("favorites",this.storage,null),this.queries=[...this.history.fetchAll(),...this.favorite.fetchAll()]}shouldSaveQuery(e,t,n,i){if(!e)return!1;try{(0,r.parse)(e)}catch(e){return!1}if(e.length>1e5)return!1;if(!i)return!0;if(JSON.stringify(e)===JSON.stringify(i.query)){if(JSON.stringify(t)===JSON.stringify(i.variables)){if(JSON.stringify(n)===JSON.stringify(i.headers))return!1;if(n&&!i.headers)return!1}if(t&&!i.variables)return!1}return!0}toggleFavorite(e,t,n,r,i,o){const a={query:e,variables:t,headers:n,operationName:r,label:i};this.favorite.contains(a)?o&&(a.favorite=!1,this.favorite.delete(a)):(a.favorite=!0,this.favorite.push(a)),this.queries=[...this.history.items,...this.favorite.items]}editLabel(e,t,n,r,i,o){const a={query:e,variables:t,headers:n,operationName:r,label:i};o?this.favorite.edit(Object.assign(Object.assign({},a),{favorite:o})):this.history.edit(a),this.queries=[...this.history.items,...this.favorite.items]}}g(z,"HistoryStore");var W=Object.defineProperty,K=g(((e,t)=>W(e,"name",{value:t,configurable:!0})),"__name$G");function Q(e){const n=(0,t.createContext)(null);return n.displayName=e,n}function X(e){function n(r){var i;const o=(0,t.useContext)(e);if(null===o&&(null==r?void 0:r.nonNull))throw new Error(`Tried to use \`${(null==(i=r.caller)?void 0:i.name)||n.caller.name}\` without the necessary context. Make sure to render the \`${e.displayName}Provider\` component higher up the tree.`);return o}return g(n,"useGivenContext"),K(n,"useGivenContext"),Object.defineProperty(n,"name",{value:`use${e.displayName}`}),n}g(Q,"createNullableContext"),K(Q,"createNullableContext"),g(X,"createContextHook"),K(X,"createContextHook");var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function J(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Z(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}e.c=Y,g(J,"getDefaultExportFromCjs"),g(Z,"getAugmentedNamespace");var ee={exports:{}},te={};function ne(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,g((function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}),"toObject"),g(ne,"shouldUseNative"),ne()&&Object.assign;var re=t.default,ie=60103;if(te.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var oe=Symbol.for;ie=oe("react.element"),te.Fragment=oe("react.fragment")}var ae=re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,se=Object.prototype.hasOwnProperty,le={key:!0,ref:!0,__self:!0,__source:!0};function ue(e,t,n){var r,i={},o=null,a=null;for(r in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(a=t.ref),t)se.call(t,r)&&!le.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:ie,type:e,key:o,ref:a,props:i,_owner:ae.current}}g(ue,"q$1"),te.jsx=ue,te.jsxs=ue,ee.exports=te;const ce=ee.exports.jsx,de=ee.exports.jsxs,fe=ee.exports.Fragment;var pe=Object.defineProperty,he=g(((e,t)=>pe(e,"name",{value:t,configurable:!0})),"__name$F");const me=Q("StorageContext");function ge(e){const n=(0,t.useRef)(!0),[r,i]=(0,t.useState)(new q(e.storage));return(0,t.useEffect)((()=>{n.current?n.current=!1:i(new q(e.storage))}),[e.storage]),ce(me.Provider,{value:r,children:e.children})}e.a7=me,g(ge,"StorageContextProvider"),he(ge,"StorageContextProvider");const ve=X(me);e.a9=ve;const ye=10,be=2;function Ee(e){return Te(e,[])}function Te(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return we(e,t);default:return String(e)}}function we(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(Ce(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:Te(t,n)}else if(Array.isArray(e))return xe(e,n);return Se(e,n)}function Ce(e){return"function"==typeof e.toJSON}function Se(e,t){const n=Object.entries(e);return 0===n.length?"{}":t.length>be?"["+Ne(e)+"]":"{ "+n.map((e=>{let[n,r]=e;return n+": "+Te(r,t)})).join(", ")+" }"}function xe(e,t){if(0===e.length)return"[]";if(t.length>be)return"[Array]";const n=Math.min(ye,e.length),r=e.length-n,i=[];for(let r=0;r1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function Ne(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}function ke(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}let _e;function Oe(e){return 9===e||32===e}function Ie(e){return e>=48&&e<=57}function De(e){return e>=97&&e<=122||e>=65&&e<=90}function Le(e){return De(e)||95===e}function Ae(e){return De(e)||Ie(e)||95===e}function Me(e,t){const n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=1===r.length,o=r.length>1&&r.slice(1).every((e=>0===e.length||Oe(e.charCodeAt(0)))),a=n.endsWith('\\"""'),s=e.endsWith('"')&&!a,l=e.endsWith("\\"),u=s||l,c=!(null!=t&&t.minimize)&&(!i||e.length>70||u||o||a);let d="";const f=i&&Oe(e.charCodeAt(0));return(c&&!f||o)&&(d+="\n"),d+=n,(c||u)&&(d+="\n"),'"""'+d+'"""'}function Re(e){return`"${e.replace(Pe,je)}"`}var Fe;g(Ee,"inspect"),g(Te,"formatValue"),g(we,"formatObjectValue"),g(Ce,"isJSONable"),g(Se,"formatObject"),g(xe,"formatArray"),g(Ne,"getObjectTag"),g(ke,"invariant"),(Fe=_e||(_e={})).QUERY="QUERY",Fe.MUTATION="MUTATION",Fe.SUBSCRIPTION="SUBSCRIPTION",Fe.FIELD="FIELD",Fe.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",Fe.FRAGMENT_SPREAD="FRAGMENT_SPREAD",Fe.INLINE_FRAGMENT="INLINE_FRAGMENT",Fe.VARIABLE_DEFINITION="VARIABLE_DEFINITION",Fe.SCHEMA="SCHEMA",Fe.SCALAR="SCALAR",Fe.OBJECT="OBJECT",Fe.FIELD_DEFINITION="FIELD_DEFINITION",Fe.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",Fe.INTERFACE="INTERFACE",Fe.UNION="UNION",Fe.ENUM="ENUM",Fe.ENUM_VALUE="ENUM_VALUE",Fe.INPUT_OBJECT="INPUT_OBJECT",Fe.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",g(Oe,"isWhiteSpace$2"),g(Ie,"isDigit$1"),g(De,"isLetter$1"),g(Le,"isNameStart"),g(Ae,"isNameContinue"),g(Me,"printBlockString"),g(Re,"printString");const Pe=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function je(e){return Ve[e.charCodeAt(0)]}g(je,"escapedReplacer");const Ve=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];function Ue(e,t){if(!Boolean(e))throw new Error(t)}g(Ue,"devAssert");const Be={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},$e=new Set(Object.keys(Be));function qe(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&$e.has(t)}let He,Ge;var ze,We;g(qe,"isNode"),(We=He||(He={})).QUERY="query",We.MUTATION="mutation",We.SUBSCRIPTION="subscription",(ze=Ge||(Ge={})).NAME="Name",ze.DOCUMENT="Document",ze.OPERATION_DEFINITION="OperationDefinition",ze.VARIABLE_DEFINITION="VariableDefinition",ze.SELECTION_SET="SelectionSet",ze.FIELD="Field",ze.ARGUMENT="Argument",ze.FRAGMENT_SPREAD="FragmentSpread",ze.INLINE_FRAGMENT="InlineFragment",ze.FRAGMENT_DEFINITION="FragmentDefinition",ze.VARIABLE="Variable",ze.INT="IntValue",ze.FLOAT="FloatValue",ze.STRING="StringValue",ze.BOOLEAN="BooleanValue",ze.NULL="NullValue",ze.ENUM="EnumValue",ze.LIST="ListValue",ze.OBJECT="ObjectValue",ze.OBJECT_FIELD="ObjectField",ze.DIRECTIVE="Directive",ze.NAMED_TYPE="NamedType",ze.LIST_TYPE="ListType",ze.NON_NULL_TYPE="NonNullType",ze.SCHEMA_DEFINITION="SchemaDefinition",ze.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",ze.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",ze.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",ze.FIELD_DEFINITION="FieldDefinition",ze.INPUT_VALUE_DEFINITION="InputValueDefinition",ze.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",ze.UNION_TYPE_DEFINITION="UnionTypeDefinition",ze.ENUM_TYPE_DEFINITION="EnumTypeDefinition",ze.ENUM_VALUE_DEFINITION="EnumValueDefinition",ze.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",ze.DIRECTIVE_DEFINITION="DirectiveDefinition",ze.SCHEMA_EXTENSION="SchemaExtension",ze.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",ze.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",ze.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",ze.UNION_TYPE_EXTENSION="UnionTypeExtension",ze.ENUM_TYPE_EXTENSION="EnumTypeExtension",ze.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension";const Ke=Object.freeze({});function Qe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Be;const r=new Map;for(const e of Object.values(Ge))r.set(e,Xe(t,e));let i,o,a,s=Array.isArray(e),l=[e],u=-1,c=[],d=e;const f=[],p=[];do{u++;const e=u===l.length,v=e&&0!==c.length;if(e){if(o=0===p.length?void 0:f[f.length-1],d=a,a=p.pop(),v)if(s){d=d.slice();let e=0;for(const[t,n]of c){const r=t-e;null===n?(d.splice(r,1),e++):d[r]=n}}else{d=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));for(const[e,t]of c)d[e]=t}u=i.index,l=i.keys,c=i.edits,s=i.inArray,i=i.prev}else if(a){if(o=s?u:l[u],d=a[o],null==d)continue;f.push(o)}let y;if(!Array.isArray(d)){var h,m;qe(d)||Ue(!1,`Invalid AST Node: ${Ee(d)}.`);const n=e?null===(h=r.get(d.kind))||void 0===h?void 0:h.leave:null===(m=r.get(d.kind))||void 0===m?void 0:m.enter;if(y=null==n?void 0:n.call(t,d,o,a,f,p),y===Ke)break;if(!1===y){if(!e){f.pop();continue}}else if(void 0!==y&&(c.push([o,y]),!e)){if(!qe(y)){f.pop();continue}d=y}}var g;void 0===y&&v&&c.push([o,d]),e?f.pop():(i={inArray:s,index:u,keys:l,edits:c,prev:i},s=Array.isArray(d),l=s?d:null!==(g=n[d.kind])&&void 0!==g?g:[],u=-1,c=[],a&&p.push(a),a=d)}while(void 0!==i);return 0!==c.length?c[c.length-1][1]:e}function Xe(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function Ye(e){return Qe(e,Je)}g(Qe,"visit"),g(Xe,"getEnterLeaveForKind"),g(Ye,"print");const Je={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Ze(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=tt("(",Ze(e.variableDefinitions,", "),")"),n=Ze([e.operation,Ze([e.name,t]),Ze(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:e=>{let{variable:t,type:n,defaultValue:r,directives:i}=e;return t+": "+n+tt(" = ",r)+tt(" ",Ze(i," "))}},SelectionSet:{leave:e=>{let{selections:t}=e;return et(t)}},Field:{leave(e){let{alias:t,name:n,arguments:r,directives:i,selectionSet:o}=e;const a=tt("",t,": ")+n;let s=a+tt("(",Ze(r,", "),")");return s.length>80&&(s=a+tt("(\n",nt(Ze(r,"\n")),"\n)")),Ze([s,Ze(i," "),o]," ")}},Argument:{leave:e=>{let{name:t,value:n}=e;return t+": "+n}},FragmentSpread:{leave:e=>{let{name:t,directives:n}=e;return"..."+t+tt(" ",Ze(n," "))}},InlineFragment:{leave:e=>{let{typeCondition:t,directives:n,selectionSet:r}=e;return Ze(["...",tt("on ",t),Ze(n," "),r]," ")}},FragmentDefinition:{leave:e=>{let{name:t,typeCondition:n,variableDefinitions:r,directives:i,selectionSet:o}=e;return`fragment ${t}${tt("(",Ze(r,", "),")")} on ${n} ${tt("",Ze(i," ")," ")}`+o}},IntValue:{leave:e=>{let{value:t}=e;return t}},FloatValue:{leave:e=>{let{value:t}=e;return t}},StringValue:{leave:e=>{let{value:t,block:n}=e;return n?Me(t):Re(t)}},BooleanValue:{leave:e=>{let{value:t}=e;return t?"true":"false"}},NullValue:{leave:()=>"null"},EnumValue:{leave:e=>{let{value:t}=e;return t}},ListValue:{leave:e=>{let{values:t}=e;return"["+Ze(t,", ")+"]"}},ObjectValue:{leave:e=>{let{fields:t}=e;return"{"+Ze(t,", ")+"}"}},ObjectField:{leave:e=>{let{name:t,value:n}=e;return t+": "+n}},Directive:{leave:e=>{let{name:t,arguments:n}=e;return"@"+t+tt("(",Ze(n,", "),")")}},NamedType:{leave:e=>{let{name:t}=e;return t}},ListType:{leave:e=>{let{type:t}=e;return"["+t+"]"}},NonNullType:{leave:e=>{let{type:t}=e;return t+"!"}},SchemaDefinition:{leave:e=>{let{description:t,directives:n,operationTypes:r}=e;return tt("",t,"\n")+Ze(["schema",Ze(n," "),et(r)]," ")}},OperationTypeDefinition:{leave:e=>{let{operation:t,type:n}=e;return t+": "+n}},ScalarTypeDefinition:{leave:e=>{let{description:t,name:n,directives:r}=e;return tt("",t,"\n")+Ze(["scalar",n,Ze(r," ")]," ")}},ObjectTypeDefinition:{leave:e=>{let{description:t,name:n,interfaces:r,directives:i,fields:o}=e;return tt("",t,"\n")+Ze(["type",n,tt("implements ",Ze(r," & ")),Ze(i," "),et(o)]," ")}},FieldDefinition:{leave:e=>{let{description:t,name:n,arguments:r,type:i,directives:o}=e;return tt("",t,"\n")+n+(rt(r)?tt("(\n",nt(Ze(r,"\n")),"\n)"):tt("(",Ze(r,", "),")"))+": "+i+tt(" ",Ze(o," "))}},InputValueDefinition:{leave:e=>{let{description:t,name:n,type:r,defaultValue:i,directives:o}=e;return tt("",t,"\n")+Ze([n+": "+r,tt("= ",i),Ze(o," ")]," ")}},InterfaceTypeDefinition:{leave:e=>{let{description:t,name:n,interfaces:r,directives:i,fields:o}=e;return tt("",t,"\n")+Ze(["interface",n,tt("implements ",Ze(r," & ")),Ze(i," "),et(o)]," ")}},UnionTypeDefinition:{leave:e=>{let{description:t,name:n,directives:r,types:i}=e;return tt("",t,"\n")+Ze(["union",n,Ze(r," "),tt("= ",Ze(i," | "))]," ")}},EnumTypeDefinition:{leave:e=>{let{description:t,name:n,directives:r,values:i}=e;return tt("",t,"\n")+Ze(["enum",n,Ze(r," "),et(i)]," ")}},EnumValueDefinition:{leave:e=>{let{description:t,name:n,directives:r}=e;return tt("",t,"\n")+Ze([n,Ze(r," ")]," ")}},InputObjectTypeDefinition:{leave:e=>{let{description:t,name:n,directives:r,fields:i}=e;return tt("",t,"\n")+Ze(["input",n,Ze(r," "),et(i)]," ")}},DirectiveDefinition:{leave:e=>{let{description:t,name:n,arguments:r,repeatable:i,locations:o}=e;return tt("",t,"\n")+"directive @"+n+(rt(r)?tt("(\n",nt(Ze(r,"\n")),"\n)"):tt("(",Ze(r,", "),")"))+(i?" repeatable":"")+" on "+Ze(o," | ")}},SchemaExtension:{leave:e=>{let{directives:t,operationTypes:n}=e;return Ze(["extend schema",Ze(t," "),et(n)]," ")}},ScalarTypeExtension:{leave:e=>{let{name:t,directives:n}=e;return Ze(["extend scalar",t,Ze(n," ")]," ")}},ObjectTypeExtension:{leave:e=>{let{name:t,interfaces:n,directives:r,fields:i}=e;return Ze(["extend type",t,tt("implements ",Ze(n," & ")),Ze(r," "),et(i)]," ")}},InterfaceTypeExtension:{leave:e=>{let{name:t,interfaces:n,directives:r,fields:i}=e;return Ze(["extend interface",t,tt("implements ",Ze(n," & ")),Ze(r," "),et(i)]," ")}},UnionTypeExtension:{leave:e=>{let{name:t,directives:n,types:r}=e;return Ze(["extend union",t,Ze(n," "),tt("= ",Ze(r," | "))]," ")}},EnumTypeExtension:{leave:e=>{let{name:t,directives:n,values:r}=e;return Ze(["extend enum",t,Ze(n," "),et(r)]," ")}},InputObjectTypeExtension:{leave:e=>{let{name:t,directives:n,fields:r}=e;return Ze(["extend input",t,Ze(n," "),et(r)]," ")}}};function Ze(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function et(e){return tt("{\n",nt(Ze(e,"\n")),"\n}")}function tt(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function nt(e){return tt(" ",e.replace(/\n/g,"\n "))}function rt(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}function it(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}function ot(e){return"object"==typeof e&&null!==e}g(Ze,"join"),g(et,"block$2"),g(tt,"wrap"),g(nt,"indent"),g(rt,"hasMultilineItems"),g(it,"isIterableObject"),g(ot,"isObjectLike");const at=5;function st(e,t){const[n,r]=t?[e,t]:[void 0,e];let i=" Did you mean ";n&&(i+=n+" ");const o=r.map((e=>`"${e}"`));switch(o.length){case 0:return"";case 1:return i+o[0]+"?";case 2:return i+o[0]+" or "+o[1]+"?"}const a=o.slice(0,at),s=a.pop();return i+a.join(", ")+", or "+s+"?"}function lt(e){return e}g(st,"didYouMean"),g(lt,"identityFunc");const ut=g((function(e,t){return e instanceof t}),"instanceOf");function ct(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function dt(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function ft(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function pt(e,t){let n=0,r=0;for(;n0);let s=0;do{++r,s=10*s+o-ht,o=t.charCodeAt(r)}while(gt(o)&&s>0);if(as)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}g(ct,"keyMap"),g(dt,"keyValMap"),g(ft,"mapValue"),g(pt,"naturalCompare");const ht=48,mt=57;function gt(e){return!isNaN(e)&&ht<=e&&e<=mt}function vt(e,t){const n=Object.create(null),r=new yt(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const r=n[e]-n[t];return 0!==r?r:pt(e,t)}))}g(gt,"isDigit"),g(vt,"suggestionList");class yt{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=bt(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=bt(n),i=this._inputArray;if(r.lengtht)return;const s=this._rows;for(let e=0;e<=a;e++)s[0][e]=e;for(let e=1;e<=o;e++){const n=s[(e-1)%3],o=s[e%3];let l=o[0]=e;for(let t=1;t<=a;t++){const a=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+a);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=s[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const l=s[o%3][a];return l<=t?l:void 0}}function bt(e){const t=e.length,n=new Array(t);for(let r=0;r=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function Ct(e){return St(e.source,wt(e.source,e.start))}function St(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?n:0,l=t.column+s,u=`${e.name}:${a}:${l}\n`,c=r.split(/\r\n|[\n\r]/g),d=c[i];if(d.length>120){const e=Math.floor(l/80),t=l%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+xt([[a-1+" |",c[i-1]],[`${a} |`,d],["|","^".padStart(l)],[`${a+1} |`,c[i+1]]])}function xt(e){const t=e.filter((e=>{let[t,n]=e;return void 0!==n})),n=Math.max(...t.map((e=>{let[t]=e;return t.length})));return t.map((e=>{let[t,r]=e;return t.padStart(n)+(r?" "+r:"")})).join("\n")}function Nt(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}g(wt,"getLocation"),g(Ct,"printLocation"),g(St,"printSourceLocation"),g(xt,"printPrefixedLines"),g(Nt,"toNormalizedOptions");class kt extends Error{constructor(e){for(var t,n,r,i=arguments.length,o=new Array(i>1?i-1:0),a=1;ae.loc)).filter((e=>null!=e)));this.source=null!=l?l:null==p||null===(n=p[0])||void 0===n?void 0:n.source,this.positions=null!=u?u:null==p?void 0:p.map((e=>e.start)),this.locations=u&&l?u.map((e=>wt(l,e))):null==p?void 0:p.map((e=>wt(e.source,e.start)));const h=ot(null==d?void 0:d.extensions)?null==d?void 0:d.extensions:void 0;this.extensions=null!==(r=null!=f?f:h)&&void 0!==r?r:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=d&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,kt):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+Ct(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+St(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function _t(e){return void 0===e||0===e.length?void 0:e}function Ot(e,t){switch(e.kind){case Ge.NULL:return null;case Ge.INT:return parseInt(e.value,10);case Ge.FLOAT:return parseFloat(e.value);case Ge.STRING:case Ge.ENUM:case Ge.BOOLEAN:return e.value;case Ge.LIST:return e.values.map((e=>Ot(e,t)));case Ge.OBJECT:return dt(e.fields,(e=>e.name.value),(e=>Ot(e.value,t)));case Ge.VARIABLE:return null==t?void 0:t[e.name.value]}}function It(e){if(null!=e||Ue(!1,"Must provide name."),"string"==typeof e||Ue(!1,"Expected name to be a string."),0===e.length)throw new kt("Expected name to be a non-empty string.");for(let t=1;to(Ot(e,t)),this.extensions=Et(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(i=e.extensionASTNodes)&&void 0!==i?i:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||Ue(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${Ee(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||Ue(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||Ue(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}g(Kt,"GraphQLScalarType");class Qt{constructor(e){var t;this.name=It(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=Et(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=()=>Yt(e),this._interfaces=()=>Xt(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||Ue(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${Ee(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:en(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Xt(e){var t;const n=zt(null!==(t=e.interfaces)&&void 0!==t?t:[]);return Array.isArray(n)||Ue(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function Yt(e){const t=Wt(e.fields);return Zt(t)||Ue(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),ft(t,((t,n)=>{var r;Zt(t)||Ue(!1,`${e.name}.${n} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||Ue(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${Ee(t.resolve)}.`);const i=null!==(r=t.args)&&void 0!==r?r:{};return Zt(i)||Ue(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:It(n),description:t.description,type:t.type,args:Jt(i),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:Et(t.extensions),astNode:t.astNode}}))}function Jt(e){return Object.entries(e).map((e=>{let[t,n]=e;return{name:It(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:Et(n.extensions),astNode:n.astNode}}))}function Zt(e){return ot(e)&&!Array.isArray(e)}function en(e){return ft(e,(e=>({description:e.description,type:e.type,args:tn(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function tn(e){return dt(e,(e=>e.name),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}g(Qt,"GraphQLObjectType"),g(Xt,"defineInterfaces"),g(Yt,"defineFieldMap"),g(Jt,"defineArguments"),g(Zt,"isPlainObj"),g(en,"fieldsToFieldsConfig"),g(tn,"argsToArgsConfig");class nn{constructor(e){var t;this.name=It(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Et(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=Yt.bind(void 0,e),this._interfaces=Xt.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||Ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${Ee(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:en(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}g(nn,"GraphQLInterfaceType");class rn{constructor(e){var t;this.name=It(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Et(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._types=on.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||Ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${Ee(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function on(e){const t=zt(e.types);return Array.isArray(t)||Ue(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}g(rn,"GraphQLUnionType"),g(on,"defineTypes");class an{constructor(e){var t;this.name=It(e.name),this.description=e.description,this.extensions=Et(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._values=ln(this.name,e.values),this._valueLookup=new Map(this._values.map((e=>[e.value,e]))),this._nameLookup=ct(this._values,(e=>e.name))}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(e){return this._nameLookup[e]}serialize(e){const t=this._valueLookup.get(e);if(void 0===t)throw new kt(`Enum "${this.name}" cannot represent value: ${Ee(e)}`);return t.name}parseValue(e){if("string"!=typeof e){const t=Ee(e);throw new kt(`Enum "${this.name}" cannot represent non-string value: ${t}.`+sn(this,t))}const t=this.getValue(e);if(null==t)throw new kt(`Value "${e}" does not exist in "${this.name}" enum.`+sn(this,e));return t.value}parseLiteral(e,t){if(e.kind!==Ge.ENUM){const t=Ye(e);throw new kt(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+sn(this,t),{nodes:e})}const n=this.getValue(e.value);if(null==n){const t=Ye(e);throw new kt(`Value "${t}" does not exist in "${this.name}" enum.`+sn(this,t),{nodes:e})}return n.value}toConfig(){const e=dt(this.getValues(),(e=>e.name),(e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function sn(e,t){return st("the enum value",vt(t,e.getValues().map((e=>e.name))))}function ln(e,t){return Zt(t)||Ue(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map((t=>{let[n,r]=t;return Zt(r)||Ue(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${Ee(r)}.`),{name:Dt(n),description:r.description,value:void 0!==r.value?r.value:n,deprecationReason:r.deprecationReason,extensions:Et(r.extensions),astNode:r.astNode}}))}g(an,"GraphQLEnumType"),g(sn,"didYouMeanEnumValue"),g(ln,"defineEnumValues");class un{constructor(e){var t;this.name=It(e.name),this.description=e.description,this.extensions=Et(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=cn.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=ft(this.getFields(),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function cn(e){const t=Wt(e.fields);return Zt(t)||Ue(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),ft(t,((t,n)=>(!("resolve"in t)||Ue(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:It(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Et(t.extensions),astNode:t.astNode})))}g(un,"GraphQLInputObjectType"),g(cn,"defineInputFieldMap");const dn=2147483647,fn=-2147483648,pn=new Kt({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=yn(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new kt(`Int cannot represent non-integer value: ${Ee(t)}`);if(n>dn||ndn||edn||t({description:{type:mn,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new Ht(new qt(new Ht(Sn))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new Ht(Sn),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Sn,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Sn,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new Ht(new qt(new Ht(wn))),resolve:e=>e.getDirectives()}})}),wn=new Qt({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new Ht(mn),resolve:e=>e.name},description:{type:mn,resolve:e=>e.description},isRepeatable:{type:new Ht(gn),resolve:e=>e.isRepeatable},locations:{type:new Ht(new qt(new Ht(Cn))),resolve:e=>e.locations},args:{type:new Ht(new qt(new Ht(Nn))),args:{includeDeprecated:{type:gn,defaultValue:!1}},resolve(e,t){let{includeDeprecated:n}=t;return n?e.args:e.args.filter((e=>null==e.deprecationReason))}}})}),Cn=new an({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:_e.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:_e.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:_e.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:_e.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:_e.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:_e.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:_e.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:_e.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:_e.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:_e.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:_e.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:_e.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:_e.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:_e.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:_e.UNION,description:"Location adjacent to a union definition."},ENUM:{value:_e.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:_e.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:_e.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:_e.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Sn=new Qt({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new Ht(In),resolve(e){return At(e)?_n.SCALAR:Mt(e)?_n.OBJECT:Rt(e)?_n.INTERFACE:Ft(e)?_n.UNION:Pt(e)?_n.ENUM:jt(e)?_n.INPUT_OBJECT:Vt(e)?_n.LIST:Ut(e)?_n.NON_NULL:void ke(!1,`Unexpected type: "${Ee(e)}".`)}},name:{type:mn,resolve:e=>"name"in e?e.name:void 0},description:{type:mn,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:mn,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new qt(new Ht(xn)),args:{includeDeprecated:{type:gn,defaultValue:!1}},resolve(e,t){let{includeDeprecated:n}=t;if(Mt(e)||Rt(e)){const t=Object.values(e.getFields());return n?t:t.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new qt(new Ht(Sn)),resolve(e){if(Mt(e)||Rt(e))return e.getInterfaces()}},possibleTypes:{type:new qt(new Ht(Sn)),resolve(e,t,n,r){let{schema:i}=r;if($t(e))return i.getPossibleTypes(e)}},enumValues:{type:new qt(new Ht(kn)),args:{includeDeprecated:{type:gn,defaultValue:!1}},resolve(e,t){let{includeDeprecated:n}=t;if(Pt(e)){const t=e.getValues();return n?t:t.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new qt(new Ht(Nn)),args:{includeDeprecated:{type:gn,defaultValue:!1}},resolve(e,t){let{includeDeprecated:n}=t;if(jt(e)){const t=Object.values(e.getFields());return n?t:t.filter((e=>null==e.deprecationReason))}}},ofType:{type:Sn,resolve:e=>"ofType"in e?e.ofType:void 0}})}),xn=new Qt({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new Ht(mn),resolve:e=>e.name},description:{type:mn,resolve:e=>e.description},args:{type:new Ht(new qt(new Ht(Nn))),args:{includeDeprecated:{type:gn,defaultValue:!1}},resolve(e,t){let{includeDeprecated:n}=t;return n?e.args:e.args.filter((e=>null==e.deprecationReason))}},type:{type:new Ht(Sn),resolve:e=>e.type},isDeprecated:{type:new Ht(gn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:mn,resolve:e=>e.deprecationReason}})}),Nn=new Qt({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new Ht(mn),resolve:e=>e.name},description:{type:mn,resolve:e=>e.description},type:{type:new Ht(Sn),resolve:e=>e.type},defaultValue:{type:mn,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=bn(n,t);return r?Ye(r):null}},isDeprecated:{type:new Ht(gn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:mn,resolve:e=>e.deprecationReason}})}),kn=new Qt({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new Ht(mn),resolve:e=>e.name},description:{type:mn,resolve:e=>e.description},isDeprecated:{type:new Ht(gn),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:mn,resolve:e=>e.deprecationReason}})});let _n;var On;(On=_n||(_n={})).SCALAR="SCALAR",On.OBJECT="OBJECT",On.INTERFACE="INTERFACE",On.UNION="UNION",On.ENUM="ENUM",On.INPUT_OBJECT="INPUT_OBJECT",On.LIST="LIST",On.NON_NULL="NON_NULL";const In=new an({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:_n.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:_n.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:_n.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:_n.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:_n.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:_n.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:_n.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:_n.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Dn={name:"__schema",type:new Ht(Tn),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,r)=>{let{schema:i}=r;return i},deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};e.S=Dn;const Ln={name:"__type",type:Sn,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new Ht(mn),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,t,n,r)=>{let{name:i}=t,{schema:o}=r;return o.getType(i)},deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};e.T=Ln;const An={name:"__typename",type:new Ht(mn),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,r)=>{let{parentType:i}=r;return i.name},deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};function Mn(e){let t;return Fn(e,(e=>{switch(e.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":t=e}})),t}function Rn(e,t,n){return n===Dn.name&&e.getQueryType()===t?Dn:n===Ln.name&&e.getQueryType()===t?Ln:n===An.name&&(0,r.isCompositeType)(t)?An:"getFields"in t?t.getFields()[n]:null}function Fn(e,t){const n=[];let r=e;for(;null==r?void 0:r.kind;)n.push(r),r=r.prevState;for(let e=n.length-1;e>=0;e--)t(n[e])}function Pn(e){const t=Object.keys(e),n=t.length,r=new Array(n);for(let i=0;i({proximity:$n(Bn(e.label),t),entry:e}))),(e=>e.proximity<=2)),(e=>!e.entry.isDeprecated)).sort(((e,t)=>(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.label.length-t.entry.label.length)).map((e=>e.entry)):Un(e,(e=>!e.isDeprecated))}function Un(e,t){const n=e.filter(t);return 0===n.length?e:n}function Bn(e){return e.toLowerCase().replaceAll(/\W/g,"")}function $n(e,t){let n=qn(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}function qn(e,t){let n,r;const i=[],o=e.length,a=t.length;for(n=0;n<=o;n++)i[n]=[n];for(r=1;r<=a;r++)i[0][r]=r;for(n=1;n<=o;n++)for(r=1;r<=a;r++){const o=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+o),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+o))}return i[o][a]}var Hn,Gn,zn,Wn,Kn,Qn,Xn,Yn,Jn,Zn,er,tr,nr,rr,ir,or,ar,sr,lr,ur,cr,dr,fr,pr,hr,mr,gr,vr,yr,br,Er;e.a=An,Object.freeze([Tn,wn,Cn,Sn,xn,Nn,kn,In]),g(Mn,"getDefinitionState"),g(Rn,"getFieldDef"),g(Fn,"forEachState"),g(Pn,"objectValues"),g(jn,"hintList"),g(Vn,"filterAndSortList"),g(Un,"filterNonEmpty"),g(Bn,"normalizeText"),g($n,"getProximity"),g(qn,"lexicalDistance"),function(e){function t(e){return"string"==typeof e}g(t,"is"),e.is=t}(Hn||(Hn={})),function(e){function t(e){return"string"==typeof e}g(t,"is"),e.is=t}(Gn||(Gn={})),function(e){function t(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647,g(t,"is"),e.is=t}(zn||(zn={})),function(e){function t(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.MIN_VALUE=0,e.MAX_VALUE=2147483647,g(t,"is"),e.is=t}(Wn||(Wn={})),function(e){function t(e,t){return e===Number.MAX_VALUE&&(e=Wn.MAX_VALUE),t===Number.MAX_VALUE&&(t=Wn.MAX_VALUE),{line:e,character:t}}function n(e){var t=e;return Ci.objectLiteral(t)&&Ci.uinteger(t.line)&&Ci.uinteger(t.character)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Kn||(Kn={})),function(e){function t(e,t,n,r){if(Ci.uinteger(e)&&Ci.uinteger(t)&&Ci.uinteger(n)&&Ci.uinteger(r))return{start:Kn.create(e,t),end:Kn.create(n,r)};if(Kn.is(e)&&Kn.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments[".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,"]"))}function n(e){var t=e;return Ci.objectLiteral(t)&&Kn.is(t.start)&&Kn.is(t.end)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Qn||(Qn={})),function(e){function t(e,t){return{uri:e,range:t}}function n(e){var t=e;return Ci.defined(t)&&Qn.is(t.range)&&(Ci.string(t.uri)||Ci.undefined(t.uri))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Xn||(Xn={})),function(e){function t(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}}function n(e){var t=e;return Ci.defined(t)&&Qn.is(t.targetRange)&&Ci.string(t.targetUri)&&Qn.is(t.targetSelectionRange)&&(Qn.is(t.originSelectionRange)||Ci.undefined(t.originSelectionRange))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Yn||(Yn={})),function(e){function t(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}}function n(e){var t=e;return Ci.objectLiteral(t)&&Ci.numberRange(t.red,0,1)&&Ci.numberRange(t.green,0,1)&&Ci.numberRange(t.blue,0,1)&&Ci.numberRange(t.alpha,0,1)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Jn||(Jn={})),function(e){function t(e,t){return{range:e,color:t}}function n(e){var t=e;return Ci.objectLiteral(t)&&Qn.is(t.range)&&Jn.is(t.color)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Zn||(Zn={})),function(e){function t(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}}function n(e){var t=e;return Ci.objectLiteral(t)&&Ci.string(t.label)&&(Ci.undefined(t.textEdit)||ur.is(t))&&(Ci.undefined(t.additionalTextEdits)||Ci.typedArray(t.additionalTextEdits,ur.is))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(er||(er={})),(Er=tr||(tr={})).Comment="comment",Er.Imports="imports",Er.Region="region",function(e){function t(e,t,n,r,i,o){var a={startLine:e,endLine:t};return Ci.defined(n)&&(a.startCharacter=n),Ci.defined(r)&&(a.endCharacter=r),Ci.defined(i)&&(a.kind=i),Ci.defined(o)&&(a.collapsedText=o),a}function n(e){var t=e;return Ci.objectLiteral(t)&&Ci.uinteger(t.startLine)&&Ci.uinteger(t.startLine)&&(Ci.undefined(t.startCharacter)||Ci.uinteger(t.startCharacter))&&(Ci.undefined(t.endCharacter)||Ci.uinteger(t.endCharacter))&&(Ci.undefined(t.kind)||Ci.string(t.kind))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(nr||(nr={})),function(e){function t(e,t){return{location:e,message:t}}function n(e){var t=e;return Ci.defined(t)&&Xn.is(t.location)&&Ci.string(t.message)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(rr||(rr={})),(br=ir||(ir={})).Error=1,br.Warning=2,br.Information=3,br.Hint=4,(yr=or||(or={})).Unnecessary=1,yr.Deprecated=2,function(e){function t(e){var t=e;return Ci.objectLiteral(t)&&Ci.string(t.href)}g(t,"is"),e.is=t}(ar||(ar={})),function(e){function t(e,t,n,r,i,o){var a={range:e,message:t};return Ci.defined(n)&&(a.severity=n),Ci.defined(r)&&(a.code=r),Ci.defined(i)&&(a.source=i),Ci.defined(o)&&(a.relatedInformation=o),a}function n(e){var t,n=e;return Ci.defined(n)&&Qn.is(n.range)&&Ci.string(n.message)&&(Ci.number(n.severity)||Ci.undefined(n.severity))&&(Ci.integer(n.code)||Ci.string(n.code)||Ci.undefined(n.code))&&(Ci.undefined(n.codeDescription)||Ci.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(Ci.string(n.source)||Ci.undefined(n.source))&&(Ci.undefined(n.relatedInformation)||Ci.typedArray(n.relatedInformation,rr.is))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(sr||(sr={})),function(e){function t(e,t){for(var n=[],r=2;r0&&(i.arguments=n),i}function n(e){var t=e;return Ci.defined(t)&&Ci.string(t.title)&&Ci.string(t.command)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(lr||(lr={})),function(e){function t(e,t){return{range:e,newText:t}}function n(e,t){return{range:{start:e,end:e},newText:t}}function r(e){return{range:e,newText:""}}function i(e){var t=e;return Ci.objectLiteral(t)&&Ci.string(t.newText)&&Qn.is(t.range)}g(t,"replace"),e.replace=t,g(n,"insert"),e.insert=n,g(r,"del"),e.del=r,g(i,"is"),e.is=i}(ur||(ur={})),function(e){function t(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r}function n(e){var t=e;return Ci.objectLiteral(t)&&Ci.string(t.label)&&(Ci.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Ci.string(t.description)||void 0===t.description)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(cr||(cr={})),function(e){function t(e){var t=e;return Ci.string(t)}g(t,"is"),e.is=t}(dr||(dr={})),function(e){function t(e,t,n){return{range:e,newText:t,annotationId:n}}function n(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}}function r(e,t){return{range:e,newText:"",annotationId:t}}function i(e){var t=e;return ur.is(t)&&(cr.is(t.annotationId)||dr.is(t.annotationId))}g(t,"replace"),e.replace=t,g(n,"insert"),e.insert=n,g(r,"del"),e.del=r,g(i,"is"),e.is=i}(fr||(fr={})),function(e){function t(e,t){return{textDocument:e,edits:t}}function n(e){var t=e;return Ci.defined(t)&&Cr.is(t.textDocument)&&Array.isArray(t.edits)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(pr||(pr={})),function(e){function t(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r}function n(e){var t=e;return t&&"create"===t.kind&&Ci.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Ci.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Ci.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||dr.is(t.annotationId))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(hr||(hr={})),function(e){function t(e,t,n,r){var i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i}function n(e){var t=e;return t&&"rename"===t.kind&&Ci.string(t.oldUri)&&Ci.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Ci.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Ci.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||dr.is(t.annotationId))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(mr||(mr={})),function(e){function t(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r}function n(e){var t=e;return t&&"delete"===t.kind&&Ci.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Ci.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Ci.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||dr.is(t.annotationId))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(gr||(gr={})),function(e){function t(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return Ci.string(e.kind)?hr.is(e)||mr.is(e)||gr.is(e):pr.is(e)})))}g(t,"is"),e.is=t}(vr||(vr={}));var Tr,wr,Cr,Sr,xr,Nr,kr,_r,Or,Ir,Dr,Lr,Ar,Mr,Rr,Fr,Pr,jr,Vr,Ur,Br,$r,qr,Hr,Gr,zr,Wr,Kr,Qr,Xr,Yr,Jr,Zr,ei,ti,ni,ri,ii,oi,ai,si,li,ui,ci,di,fi,pi,hi,mi,gi,vi,yi,bi,Ei,Ti=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return g(e,"TextEditChangeImpl"),e.prototype.insert=function(e,t,n){var r,i;if(void 0===n?r=ur.insert(e,t):dr.is(n)?(i=n,r=fr.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=fr.insert(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.replace=function(e,t,n){var r,i;if(void 0===n?r=ur.replace(e,t):dr.is(n)?(i=n,r=fr.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=fr.replace(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=ur.del(e):dr.is(t)?(r=t,n=fr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=fr.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),wi=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return g(e,"ChangeAnnotations"),e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(dr.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}();(function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new wi(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(pr.is(e)){var n=new Ti(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new Ti(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}g(e,"WorkspaceChange"),Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(Cr.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new Ti(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new Ti(i),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new wi,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(cr.is(t)||dr.is(t)?r=t:n=t,void 0===r?i=hr.create(e,n):(o=dr.is(r)?r:this._changeAnnotations.manage(r),i=hr.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var i,o,a;if(cr.is(n)||dr.is(n)?i=n:r=n,void 0===i?o=mr.create(e,t,r):(a=dr.is(i)?i:this._changeAnnotations.manage(i),o=mr.create(e,t,r,a)),this._workspaceEdit.documentChanges.push(o),void 0!==a)return a},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(cr.is(t)||dr.is(t)?r=t:n=t,void 0===r?i=gr.create(e,n):(o=dr.is(r)?r:this._changeAnnotations.manage(r),i=gr.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o}})(),function(e){function t(e){return{uri:e}}function n(e){var t=e;return Ci.defined(t)&&Ci.string(t.uri)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Tr||(Tr={})),function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return Ci.defined(t)&&Ci.string(t.uri)&&Ci.integer(t.version)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(wr||(wr={})),function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return Ci.defined(t)&&Ci.string(t.uri)&&(null===t.version||Ci.integer(t.version))}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Cr||(Cr={})),function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}function n(e){var t=e;return Ci.defined(t)&&Ci.string(t.uri)&&Ci.string(t.languageId)&&Ci.integer(t.version)&&Ci.string(t.text)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Sr||(Sr={})),function(e){function t(t){var n=t;return n===e.PlainText||n===e.Markdown}e.PlainText="plaintext",e.Markdown="markdown",g(t,"is"),e.is=t}(xr||(xr={})),function(e){function t(e){var t=e;return Ci.objectLiteral(e)&&xr.is(t.kind)&&Ci.string(t.value)}g(t,"is"),e.is=t}(Nr||(Nr={})),(Ei=kr||(kr={})).Text=1,Ei.Method=2,Ei.Function=3,Ei.Constructor=4,Ei.Field=5,Ei.Variable=6,Ei.Class=7,Ei.Interface=8,Ei.Module=9,Ei.Property=10,Ei.Unit=11,Ei.Value=12,Ei.Enum=13,Ei.Keyword=14,Ei.Snippet=15,Ei.Color=16,Ei.File=17,Ei.Reference=18,Ei.Folder=19,Ei.EnumMember=20,Ei.Constant=21,Ei.Struct=22,Ei.Event=23,Ei.Operator=24,Ei.TypeParameter=25,(bi=_r||(_r={})).PlainText=1,bi.Snippet=2,(Or||(Or={})).Deprecated=1,function(e){function t(e,t,n){return{newText:e,insert:t,replace:n}}function n(e){var t=e;return t&&Ci.string(t.newText)&&Qn.is(t.insert)&&Qn.is(t.replace)}g(t,"create"),e.create=t,g(n,"is"),e.is=n}(Ir||(Ir={})),(yi=Dr||(Dr={})).asIs=1,yi.adjustIndentation=2,function(e){function t(e){var t=e;return t&&(Ci.string(t.detail)||void 0===t.detail)&&(Ci.string(t.description)||void 0===t.description)}g(t,"is"),e.is=t}(Lr||(Lr={})),function(e){function t(e){return{label:e}}g(t,"create"),e.create=t}(Ar||(Ar={})),function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}g(t,"create"),e.create=t}(Mr||(Mr={})),function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function n(e){var t=e;return Ci.string(t)||Ci.objectLiteral(t)&&Ci.string(t.language)&&Ci.string(t.value)}g(t,"fromPlainText"),e.fromPlainText=t,g(n,"is"),e.is=n}(Rr||(Rr={})),function(e){function t(e){var t=e;return!!t&&Ci.objectLiteral(t)&&(Nr.is(t.contents)||Rr.is(t.contents)||Ci.typedArray(t.contents,Rr.is))&&(void 0===e.range||Qn.is(e.range))}g(t,"is"),e.is=t}(Fr||(Fr={})),function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}g(t,"create"),e.create=t}(Pr||(Pr={})),function(e){function t(e,t){for(var n=[],r=2;r=0;a--){var s=r[a],l=e.offsetAt(s.range.start),u=e.offsetAt(s.range.end);if(!(u<=o))throw new Error("Overlapping edit");n=n.substring(0,l)+s.newText+n.substring(u,n.length),o=l}return n}function i(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),o=e.slice(n);i(r,t),i(o,t);for(var a=0,s=0,l=0;a0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return Kn.create(0,e);for(;ne?r=i:n=i+1}var o=n-1;return Kn.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1this._start,this.getCurrentPosition=()=>this._pos,this.eol=()=>this._sourceText.length===this._pos,this.sol=()=>0===this._pos,this.peek=()=>this._sourceText.charAt(this._pos)||null,this.next=()=>{const e=this._sourceText.charAt(this._pos);return this._pos++,e},this.eat=e=>{if(this._testNextCharacter(e))return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},this.eatWhile=e=>{let t=this._testNextCharacter(e),n=!1;for(t&&(n=t,this._start=this._pos);t;)this._pos++,t=this._testNextCharacter(e),n=!0;return n},this.eatSpace=()=>this.eatWhile(/[\s\u00a0]/),this.skipToEnd=()=>{this._pos=this._sourceText.length},this.skipTo=e=>{this._pos=e},this.match=function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=null,i=null;return"string"==typeof e?(i=new RegExp(e,arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"i":"g").test(t._sourceText.slice(t._pos,t._pos+e.length)),r=e):e instanceof RegExp&&(i=t._sourceText.slice(t._pos).match(e),r=null==i?void 0:i[0]),!(null==i||!("string"==typeof e||i instanceof Array&&t._sourceText.startsWith(i[0],t._pos)))&&(n&&(t._start=t._pos,r&&r.length&&(t._pos+=r.length)),i)},this.backUp=e=>{this._pos-=e},this.column=()=>this._pos,this.indentation=()=>{const e=this._sourceText.match(/\s*/);let t=0;if(e&&0!==e.length){const n=e[0];let r=0;for(;n.length>r;)9===n.charCodeAt(r)?t+=2:t++,r++}return t},this.current=()=>this._sourceText.slice(this._start,this._pos),this._start=0,this._pos=0,this._sourceText=e}_testNextCharacter(e){const t=this._sourceText.charAt(this._pos);let n=!1;return n="string"==typeof e?t===e:e instanceof RegExp?e.test(t):e(t),n}}function ki(e){return{ofRule:e}}function _i(e,t){return{ofRule:e,isList:!0,separator:t}}function Oi(e,t){const n=e.match;return e.match=e=>{let r=!1;return n&&(r=n(e)),r&&t.every((t=>t.match&&!t.match(e)))},e}function Ii(e,t){return{style:t,match:t=>t.kind===e}}function Di(e,t){return{style:t||"punctuation",match:t=>"Punctuation"===t.kind&&t.value===e}}e.C=Ni,g(Ni,"CharacterStream"),g(ki,"opt"),g(_i,"list$1"),g(Oi,"butNot"),g(Ii,"t$2"),g(Di,"p$1");const Li=g((e=>" "===e||"\t"===e||","===e||"\n"===e||"\r"===e||"\ufeff"===e||" "===e),"isIgnored");e.i=Li;const Ai={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,Comment:/^#.*/};e.L=Ai;const Mi={Document:[_i("Definition")],Definition(e){switch(e.value){case"{":return"ShortQuery";case"query":return"Query";case"mutation":return"Mutation";case"subscription":return"Subscription";case"fragment":return r.Kind.FRAGMENT_DEFINITION;case"schema":return"SchemaDef";case"scalar":return"ScalarDef";case"type":return"ObjectTypeDef";case"interface":return"InterfaceDef";case"union":return"UnionDef";case"enum":return"EnumDef";case"input":return"InputDef";case"extend":return"ExtendDef";case"directive":return"DirectiveDef"}},ShortQuery:["SelectionSet"],Query:[Ri("query"),ki(Fi("def")),ki("VariableDefinitions"),_i("Directive"),"SelectionSet"],Mutation:[Ri("mutation"),ki(Fi("def")),ki("VariableDefinitions"),_i("Directive"),"SelectionSet"],Subscription:[Ri("subscription"),ki(Fi("def")),ki("VariableDefinitions"),_i("Directive"),"SelectionSet"],VariableDefinitions:[Di("("),_i("VariableDefinition"),Di(")")],VariableDefinition:["Variable",Di(":"),"Type",ki("DefaultValue")],Variable:[Di("$","variable"),Fi("variable")],DefaultValue:[Di("="),"Value"],SelectionSet:[Di("{"),_i("Selection"),Di("}")],Selection(e,t){return"..."===e.value?t.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?"InlineFragment":"FragmentSpread":t.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field"},AliasedField:[Fi("property"),Di(":"),Fi("qualifier"),ki("Arguments"),_i("Directive"),ki("SelectionSet")],Field:[Fi("property"),ki("Arguments"),_i("Directive"),ki("SelectionSet")],Arguments:[Di("("),_i("Argument"),Di(")")],Argument:[Fi("attribute"),Di(":"),"Value"],FragmentSpread:[Di("..."),Fi("def"),_i("Directive")],InlineFragment:[Di("..."),ki("TypeCondition"),_i("Directive"),"SelectionSet"],FragmentDefinition:[Ri("fragment"),ki(Oi(Fi("def"),[Ri("on")])),"TypeCondition",_i("Directive"),"SelectionSet"],TypeCondition:[Ri("on"),"NamedType"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable";case"&":return"NamedType"}return null;case"Name":switch(e.value){case"true":case"false":return"BooleanValue"}return"null"===e.value?"NullValue":"EnumValue"}},NumberValue:[Ii("Number","number")],StringValue:[{style:"string",match:e=>"String"===e.kind,update(e,t){t.value.startsWith('"""')&&(e.inBlockstring=!t.value.slice(3).endsWith('"""'))}}],BooleanValue:[Ii("Name","builtin")],NullValue:[Ii("Name","keyword")],EnumValue:[Fi("string-2")],ListValue:[Di("["),_i("Value"),Di("]")],ObjectValue:[Di("{"),_i("ObjectField"),Di("}")],ObjectField:[Fi("attribute"),Di(":"),"Value"],Type(e){return"["===e.value?"ListType":"NonNullType"},ListType:[Di("["),"Type",Di("]"),ki(Di("!"))],NonNullType:["NamedType",ki(Di("!"))],NamedType:[Pi("atom")],Directive:[Di("@","meta"),Fi("meta"),ki("Arguments")],DirectiveDef:[Ri("directive"),Di("@","meta"),Fi("meta"),ki("ArgumentsDef"),Ri("on"),_i("DirectiveLocation",Di("|"))],InterfaceDef:[Ri("interface"),Fi("atom"),ki("Implements"),_i("Directive"),Di("{"),_i("FieldDef"),Di("}")],Implements:[Ri("implements"),_i("NamedType",Di("&"))],DirectiveLocation:[Fi("string-2")],SchemaDef:[Ri("schema"),_i("Directive"),Di("{"),_i("OperationTypeDef"),Di("}")],OperationTypeDef:[Fi("keyword"),Di(":"),Fi("atom")],ScalarDef:[Ri("scalar"),Fi("atom"),_i("Directive")],ObjectTypeDef:[Ri("type"),Fi("atom"),ki("Implements"),_i("Directive"),Di("{"),_i("FieldDef"),Di("}")],FieldDef:[Fi("property"),ki("ArgumentsDef"),Di(":"),"Type",_i("Directive")],ArgumentsDef:[Di("("),_i("InputValueDef"),Di(")")],InputValueDef:[Fi("attribute"),Di(":"),"Type",ki("DefaultValue"),_i("Directive")],UnionDef:[Ri("union"),Fi("atom"),_i("Directive"),Di("="),_i("UnionMember",Di("|"))],UnionMember:["NamedType"],EnumDef:[Ri("enum"),Fi("atom"),_i("Directive"),Di("{"),_i("EnumValueDef"),Di("}")],EnumValueDef:[Fi("string-2"),_i("Directive")],InputDef:[Ri("input"),Fi("atom"),_i("Directive"),Di("{"),_i("InputValueDef"),Di("}")],ExtendDef:[Ri("extend"),"ExtensionDefinition"],ExtensionDefinition(e){switch(e.value){case"schema":return r.Kind.SCHEMA_EXTENSION;case"scalar":return r.Kind.SCALAR_TYPE_EXTENSION;case"type":return r.Kind.OBJECT_TYPE_EXTENSION;case"interface":return r.Kind.INTERFACE_TYPE_EXTENSION;case"union":return r.Kind.UNION_TYPE_EXTENSION;case"enum":return r.Kind.ENUM_TYPE_EXTENSION;case"input":return r.Kind.INPUT_OBJECT_TYPE_EXTENSION}},[r.Kind.SCHEMA_EXTENSION]:["SchemaDef"],[r.Kind.SCALAR_TYPE_EXTENSION]:["ScalarDef"],[r.Kind.OBJECT_TYPE_EXTENSION]:["ObjectTypeDef"],[r.Kind.INTERFACE_TYPE_EXTENSION]:["InterfaceDef"],[r.Kind.UNION_TYPE_EXTENSION]:["UnionDef"],[r.Kind.ENUM_TYPE_EXTENSION]:["EnumDef"],[r.Kind.INPUT_OBJECT_TYPE_EXTENSION]:["InputDef"]};function Ri(e){return{style:"keyword",match:t=>"Name"===t.kind&&t.value===e}}function Fi(e){return{style:e,match:e=>"Name"===e.kind,update(e,t){e.name=t.value}}}function Pi(e){return{style:e,match:e=>"Name"===e.kind,update(e,t){var n;(null===(n=e.prevState)||void 0===n?void 0:n.prevState)&&(e.name=t.value,e.prevState.prevState.type=t.value)}}}function ji(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{eatWhitespace:e=>e.eatWhile(Li),lexRules:Ai,parseRules:Mi,editorConfig:{}};return{startState(){const t={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return $i(e.parseRules,t,r.Kind.DOCUMENT),t},token(t,n){return Vi(t,n,e)}}}function Vi(e,t,n){var r;if(t.inBlockstring)return e.match(/.*"""/)?(t.inBlockstring=!1,"string"):(e.skipToEnd(),"string");const{lexRules:i,parseRules:o,eatWhitespace:a,editorConfig:s}=n;if(t.rule&&0===t.rule.length?qi(t):t.needsAdvance&&(t.needsAdvance=!1,Hi(t,!0)),e.sol()){const n=(null==s?void 0:s.tabSize)||2;t.indentLevel=Math.floor(e.indentation()/n)}if(a(e))return"ws";const l=Wi(i,e);if(!l)return e.match(/\S+/)||e.match(/\s/),$i(Bi,t,"Invalid"),"invalidchar";if("Comment"===l.kind)return $i(Bi,t,"Comment"),"comment";const u=Ui({},t);if("Punctuation"===l.kind)if(/^[{([]/.test(l.value))void 0!==t.indentLevel&&(t.levels=(t.levels||[]).concat(t.indentLevel+1));else if(/^[})\]]/.test(l.value)){const e=t.levels=(t.levels||[]).slice(0,-1);t.indentLevel&&e.length>0&&e.at(-1){const t=[];if(e)try{(0,r.visit)((0,r.parse)(e),{FragmentDefinition(e){t.push(e)}})}catch(e){return[]}return t}),"collectFragmentDefs"),Yi=[r.Kind.SCHEMA_DEFINITION,r.Kind.OPERATION_TYPE_DEFINITION,r.Kind.SCALAR_TYPE_DEFINITION,r.Kind.OBJECT_TYPE_DEFINITION,r.Kind.INTERFACE_TYPE_DEFINITION,r.Kind.UNION_TYPE_DEFINITION,r.Kind.ENUM_TYPE_DEFINITION,r.Kind.INPUT_OBJECT_TYPE_DEFINITION,r.Kind.DIRECTIVE_DEFINITION,r.Kind.SCHEMA_EXTENSION,r.Kind.SCALAR_TYPE_EXTENSION,r.Kind.OBJECT_TYPE_EXTENSION,r.Kind.INTERFACE_TYPE_EXTENSION,r.Kind.UNION_TYPE_EXTENSION,r.Kind.ENUM_TYPE_EXTENSION,r.Kind.INPUT_OBJECT_TYPE_EXTENSION],Ji=g((e=>{let t=!1;if(e)try{(0,r.visit)((0,r.parse)(e),{enter(e){if("Document"!==e.kind)return!!Yi.includes(e.kind)&&(t=!0,r.BREAK)}})}catch(e){return t}return t}),"hasTypeSystemDefinitions");function Zi(e,t,n,i,o,a){var s;const l=Object.assign(Object.assign({},a),{schema:e}),u=i||go(t,n),c="Invalid"===u.state.kind?u.state.prevState:u.state,d=(null==a?void 0:a.mode)||wo(t,null==a?void 0:a.uri);if(!c)return[];const{kind:f,step:p,prevState:h}=c,m=bo(e,u.state);if(f===Ki.DOCUMENT)return d===Eo.TYPE_SYSTEM?no(u):ro(u);if(f===Ki.EXTEND_DEF)return io(u);if((null===(s=null==h?void 0:h.prevState)||void 0===s?void 0:s.kind)===Ki.EXTENSION_DEFINITION&&c.name)return jn(u,[]);if((null==h?void 0:h.kind)===r.Kind.SCALAR_TYPE_EXTENSION)return jn(u,Object.values(e.getTypeMap()).filter(r.isScalarType).map((e=>({label:e.name,kind:Si.Function}))));if((null==h?void 0:h.kind)===r.Kind.OBJECT_TYPE_EXTENSION)return jn(u,Object.values(e.getTypeMap()).filter((e=>(0,r.isObjectType)(e)&&!e.name.startsWith("__"))).map((e=>({label:e.name,kind:Si.Function}))));if((null==h?void 0:h.kind)===r.Kind.INTERFACE_TYPE_EXTENSION)return jn(u,Object.values(e.getTypeMap()).filter(r.isInterfaceType).map((e=>({label:e.name,kind:Si.Function}))));if((null==h?void 0:h.kind)===r.Kind.UNION_TYPE_EXTENSION)return jn(u,Object.values(e.getTypeMap()).filter(r.isUnionType).map((e=>({label:e.name,kind:Si.Function}))));if((null==h?void 0:h.kind)===r.Kind.ENUM_TYPE_EXTENSION)return jn(u,Object.values(e.getTypeMap()).filter((e=>(0,r.isEnumType)(e)&&!e.name.startsWith("__"))).map((e=>({label:e.name,kind:Si.Function}))));if((null==h?void 0:h.kind)===r.Kind.INPUT_OBJECT_TYPE_EXTENSION)return jn(u,Object.values(e.getTypeMap()).filter(r.isInputObjectType).map((e=>({label:e.name,kind:Si.Function}))));if(f===Ki.IMPLEMENTS||f===Ki.NAMED_TYPE&&(null==h?void 0:h.kind)===Ki.IMPLEMENTS)return so(u,c,e,t,m);if(f===Ki.SELECTION_SET||f===Ki.FIELD||f===Ki.ALIASED_FIELD)return oo(u,m,l);if(f===Ki.ARGUMENTS||f===Ki.ARGUMENT&&0===p){const{argDefs:e}=m;if(e)return jn(u,e.map((e=>{var t;return{label:e.name,insertText:e.name+": ",command:Qi,detail:String(e.type),documentation:null!==(t=e.description)&&void 0!==t?t:void 0,kind:Si.Variable,type:e.type}})))}if((f===Ki.OBJECT_VALUE||f===Ki.OBJECT_FIELD&&0===p)&&m.objectFieldDefs){const e=Pn(m.objectFieldDefs),t=f===Ki.OBJECT_VALUE?Si.Value:Si.Field;return jn(u,e.map((e=>{var n;return{label:e.name,detail:String(e.type),documentation:null!==(n=e.description)&&void 0!==n?n:void 0,kind:t,type:e.type}})))}if(f===Ki.ENUM_VALUE||f===Ki.LIST_VALUE&&1===p||f===Ki.OBJECT_FIELD&&2===p||f===Ki.ARGUMENT&&2===p)return ao(u,m,t,e);if(f===Ki.VARIABLE&&1===p){const n=(0,r.getNamedType)(m.inputType);return jn(u,fo(t,e,u).filter((e=>e.detail===(null==n?void 0:n.name))))}if(f===Ki.TYPE_CONDITION&&1===p||f===Ki.NAMED_TYPE&&null!=h&&h.kind===Ki.TYPE_CONDITION)return lo(u,m,e);if(f===Ki.FRAGMENT_SPREAD&&1===p)return uo(u,m,e,t,Array.isArray(o)?o:Xi(o));const g=Co(c);if(d===Eo.TYPE_SYSTEM&&!g.needsAdvance&&f===Ki.NAMED_TYPE||f===Ki.LIST_TYPE){if(g.kind===Ki.FIELD_DEF)return jn(u,Object.values(e.getTypeMap()).filter((e=>(0,r.isOutputType)(e)&&!e.name.startsWith("__"))).map((e=>({label:e.name,kind:Si.Function}))));if(g.kind===Ki.INPUT_VALUE_DEF)return jn(u,Object.values(e.getTypeMap()).filter((e=>(0,r.isInputType)(e)&&!e.name.startsWith("__"))).map((e=>({label:e.name,kind:Si.Function}))))}return f===Ki.VARIABLE_DEFINITION&&2===p||f===Ki.LIST_TYPE&&1===p||f===Ki.NAMED_TYPE&&h&&(h.kind===Ki.VARIABLE_DEFINITION||h.kind===Ki.LIST_TYPE||h.kind===Ki.NON_NULL_TYPE)?ho(u,e):f===Ki.DIRECTIVE?mo(u,c,e):[]}g(Zi,"getAutocompleteSuggestions");const eo=" {\n $1\n}",to=g((e=>{const{type:t}=e;if((0,r.isCompositeType)(t))return eo;if((0,r.isListType)(t)&&(0,r.isCompositeType)(t.ofType))return eo;if((0,r.isNonNullType)(t)){if((0,r.isCompositeType)(t.ofType))return eo;if((0,r.isListType)(t.ofType)&&(0,r.isCompositeType)(t.ofType.ofType))return eo}return null}),"getInsertText");function no(e){return jn(e,[{label:"extend",kind:Si.Function},{label:"type",kind:Si.Function},{label:"interface",kind:Si.Function},{label:"union",kind:Si.Function},{label:"input",kind:Si.Function},{label:"scalar",kind:Si.Function},{label:"schema",kind:Si.Function}])}function ro(e){return jn(e,[{label:"query",kind:Si.Function},{label:"mutation",kind:Si.Function},{label:"subscription",kind:Si.Function},{label:"fragment",kind:Si.Function},{label:"{",kind:Si.Constructor}])}function io(e){return jn(e,[{label:"type",kind:Si.Function},{label:"interface",kind:Si.Function},{label:"union",kind:Si.Function},{label:"input",kind:Si.Function},{label:"scalar",kind:Si.Function},{label:"schema",kind:Si.Function}])}function oo(e,t,n){var i;if(t.parentType){const{parentType:o}=t;let a=[];return"getFields"in o&&(a=Pn(o.getFields())),(0,r.isCompositeType)(o)&&a.push(r.TypeNameMetaFieldDef),o===(null===(i=null==n?void 0:n.schema)||void 0===i?void 0:i.getQueryType())&&a.push(r.SchemaMetaFieldDef,r.TypeMetaFieldDef),jn(e,a.map(((e,t)=>{var r;const i={sortText:String(t)+e.name,label:e.name,detail:String(e.type),documentation:null!==(r=e.description)&&void 0!==r?r:void 0,deprecated:Boolean(e.deprecationReason),isDeprecated:Boolean(e.deprecationReason),deprecationReason:e.deprecationReason,kind:Si.Field,type:e.type};if(null==n?void 0:n.fillLeafsOnComplete){const t=to(e);t&&(i.insertText=e.name+t,i.insertTextFormat=_r.Snippet,i.command=Qi)}return i})))}return[]}function ao(e,t,n,i){const o=(0,r.getNamedType)(t.inputType),a=fo(n,i,e).filter((e=>e.detail===o.name));return o instanceof r.GraphQLEnumType?jn(e,o.getValues().map((e=>{var t;return{label:e.name,detail:String(o),documentation:null!==(t=e.description)&&void 0!==t?t:void 0,deprecated:Boolean(e.deprecationReason),isDeprecated:Boolean(e.deprecationReason),deprecationReason:e.deprecationReason,kind:Si.EnumMember,type:o}})).concat(a)):o===r.GraphQLBoolean?jn(e,a.concat([{label:"true",detail:String(r.GraphQLBoolean),documentation:"Not false.",kind:Si.Variable,type:r.GraphQLBoolean},{label:"false",detail:String(r.GraphQLBoolean),documentation:"Not true.",kind:Si.Variable,type:r.GraphQLBoolean}])):a}function so(e,t,n,i,o){if(t.needsSeparator)return[];const a=Pn(n.getTypeMap()).filter(r.isInterfaceType),s=a.map((e=>{let{name:t}=e;return t})),l=new Set;vo(i,((e,t)=>{var i,a,u,c,d;if(t.name&&(t.kind!==Ki.INTERFACE_DEF||s.includes(t.name)||l.add(t.name),t.kind===Ki.NAMED_TYPE&&(null===(i=t.prevState)||void 0===i?void 0:i.kind)===Ki.IMPLEMENTS))if(o.interfaceDef){if(null===(a=o.interfaceDef)||void 0===a?void 0:a.getInterfaces().find((e=>{let{name:n}=e;return n===t.name})))return;const e=n.getType(t.name),i=null===(u=o.interfaceDef)||void 0===u?void 0:u.toConfig();o.interfaceDef=new r.GraphQLInterfaceType(Object.assign(Object.assign({},i),{interfaces:[...i.interfaces,e||new r.GraphQLInterfaceType({name:t.name,fields:{}})]}))}else if(o.objectTypeDef){if(null===(c=o.objectTypeDef)||void 0===c?void 0:c.getInterfaces().find((e=>{let{name:n}=e;return n===t.name})))return;const e=n.getType(t.name),i=null===(d=o.objectTypeDef)||void 0===d?void 0:d.toConfig();o.objectTypeDef=new r.GraphQLObjectType(Object.assign(Object.assign({},i),{interfaces:[...i.interfaces,e||new r.GraphQLInterfaceType({name:t.name,fields:{}})]}))}}));const u=o.interfaceDef||o.objectTypeDef,c=((null==u?void 0:u.getInterfaces())||[]).map((e=>{let{name:t}=e;return t}));return jn(e,a.concat([...l].map((e=>({name:e})))).filter((e=>{let{name:t}=e;return t!==(null==u?void 0:u.name)&&!c.includes(t)})).map((e=>{const t={label:e.name,kind:Si.Interface,type:e};return(null==e?void 0:e.description)&&(t.documentation=e.description),t})))}function lo(e,t,n,i){let o;if(t.parentType)if((0,r.isAbstractType)(t.parentType)){const e=(0,r.assertAbstractType)(t.parentType),i=n.getPossibleTypes(e),a=Object.create(null);i.forEach((e=>{e.getInterfaces().forEach((e=>{a[e.name]=e}))})),o=i.concat(Pn(a))}else o=[t.parentType];else o=Pn(n.getTypeMap()).filter((e=>(0,r.isCompositeType)(e)&&!e.name.startsWith("__")));return jn(e,o.map((e=>{const t=(0,r.getNamedType)(e);return{label:String(e),documentation:(null==t?void 0:t.description)||"",kind:Si.Field}})))}function uo(e,t,n,i,o){if(!i)return[];const a=n.getTypeMap(),s=Mn(e.state),l=po(i);return o&&o.length>0&&l.push(...o),jn(e,l.filter((e=>a[e.typeCondition.name.value]&&!(s&&s.kind===Ki.FRAGMENT_DEFINITION&&s.name===e.name.value)&&(0,r.isCompositeType)(t.parentType)&&(0,r.isCompositeType)(a[e.typeCondition.name.value])&&(0,r.doTypesOverlap)(n,t.parentType,a[e.typeCondition.name.value]))).map((e=>({label:e.name.value,detail:String(a[e.typeCondition.name.value]),documentation:`fragment ${e.name.value} on ${e.typeCondition.name.value}`,kind:Si.Field,type:a[e.typeCondition.name.value]}))))}g(no,"getSuggestionsForTypeSystemDefinitions"),g(ro,"getSuggestionsForExecutableDefinitions"),g(io,"getSuggestionsForExtensionDefinitions"),g(oo,"getSuggestionsForFieldNames"),g(ao,"getSuggestionsForInputValues"),g(so,"getSuggestionsForImplements"),g(lo,"getSuggestionsForFragmentTypeConditions"),g(uo,"getSuggestionsForFragmentSpread");const co=g(((e,t)=>{var n,r,i,o,a,s,l,u,c,d;return(null===(n=e.prevState)||void 0===n?void 0:n.kind)===t?e.prevState:(null===(i=null===(r=e.prevState)||void 0===r?void 0:r.prevState)||void 0===i?void 0:i.kind)===t?e.prevState.prevState:(null===(s=null===(a=null===(o=e.prevState)||void 0===o?void 0:o.prevState)||void 0===a?void 0:a.prevState)||void 0===s?void 0:s.kind)===t?e.prevState.prevState.prevState:(null===(d=null===(c=null===(u=null===(l=e.prevState)||void 0===l?void 0:l.prevState)||void 0===u?void 0:u.prevState)||void 0===c?void 0:c.prevState)||void 0===d?void 0:d.kind)===t?e.prevState.prevState.prevState.prevState:void 0}),"getParentDefinition");function fo(e,t,n){let r,i=null;const o=Object.create({});return vo(e,((e,a)=>{if((null==a?void 0:a.kind)===Ki.VARIABLE&&a.name&&(i=a.name),(null==a?void 0:a.kind)===Ki.NAMED_TYPE&&i){const e=co(a,Ki.TYPE);(null==e?void 0:e.type)&&(r=t.getType(null==e?void 0:e.type))}i&&r&&!o[i]&&(o[i]={detail:r.toString(),insertText:"$"===n.string?i:"$"+i,label:i,type:r,kind:Si.Variable},i=null,r=null)})),Pn(o)}function po(e){const t=[];return vo(e,((e,n)=>{n.kind===Ki.FRAGMENT_DEFINITION&&n.name&&n.type&&t.push({kind:Ki.FRAGMENT_DEFINITION,name:{kind:r.Kind.NAME,value:n.name},selectionSet:{kind:Ki.SELECTION_SET,selections:[]},typeCondition:{kind:Ki.NAMED_TYPE,name:{kind:r.Kind.NAME,value:n.type}}})})),t}function ho(e,t,n){return jn(e,Pn(t.getTypeMap()).filter(r.isInputType).map((e=>({label:e.name,documentation:e.description,kind:Si.Variable}))))}function mo(e,t,n,r){var i;return(null===(i=t.prevState)||void 0===i?void 0:i.kind)?jn(e,n.getDirectives().filter((e=>yo(t.prevState,e))).map((e=>({label:e.name,documentation:e.description||"",kind:Si.Function})))):[]}function go(e,t){let n=null,r=null,i=null;const o=vo(e,((e,o,a,s)=>{if(s===t.line&&e.getCurrentPosition()>=t.character)return n=a,r=Object.assign({},o),i=e.current(),"BREAK"}));return{start:o.start,end:o.end,string:i||o.string,state:r||o.state,style:n||o.style}}function vo(e,t){const n=e.split("\n"),r=ji();let i=r.startState(),o="",a=new Ni("");for(let e=0;e{var h;switch(t.kind){case Ki.QUERY:case"ShortQuery":f=e.getQueryType();break;case Ki.MUTATION:f=e.getMutationType();break;case Ki.SUBSCRIPTION:f=e.getSubscriptionType();break;case Ki.INLINE_FRAGMENT:case Ki.FRAGMENT_DEFINITION:t.type&&(f=e.getType(t.type));break;case Ki.FIELD:case Ki.ALIASED_FIELD:f&&t.name?(s=d?Rn(e,d,t.name):null,f=s?s.type:null):s=null;break;case Ki.SELECTION_SET:d=(0,r.getNamedType)(f);break;case Ki.DIRECTIVE:o=t.name?e.getDirective(t.name):null;break;case Ki.INTERFACE_DEF:t.name&&(u=null,p=new r.GraphQLInterfaceType({name:t.name,interfaces:[],fields:{}}));break;case Ki.OBJECT_TYPE_DEF:t.name&&(p=null,u=new r.GraphQLObjectType({name:t.name,interfaces:[],fields:{}}));break;case Ki.ARGUMENTS:if(t.prevState)switch(t.prevState.kind){case Ki.FIELD:i=s&&s.args;break;case Ki.DIRECTIVE:i=o&&o.args;break;case Ki.ALIASED_FIELD:{const n=null===(h=t.prevState)||void 0===h?void 0:h.name;if(!n){i=null;break}const r=d?Rn(e,d,n):null;if(!r){i=null;break}i=r.args;break}default:i=null}else i=null;break;case Ki.ARGUMENT:if(i)for(let e=0;ee.value===t.name)):null;break;case Ki.LIST_VALUE:const g=(0,r.getNullableType)(l);l=g instanceof r.GraphQLList?g.ofType:null;break;case Ki.OBJECT_VALUE:const v=(0,r.getNamedType)(l);c=v instanceof r.GraphQLInputObjectType?v.getFields():null;break;case Ki.OBJECT_FIELD:const y=t.name&&c?c[t.name]:null;l=null==y?void 0:y.type;break;case Ki.NAMED_TYPE:t.name&&(f=e.getType(t.name))}})),{argDef:n,argDefs:i,directiveDef:o,enumValue:a,fieldDef:s,inputType:l,objectFieldDefs:c,parentType:d,type:f,interfaceDef:p,objectTypeDef:u}}var Eo,To;function wo(e,t){return(null==t?void 0:t.endsWith(".graphqls"))||Ji(e)?Eo.TYPE_SYSTEM:Eo.EXECUTABLE}function Co(e){return e.prevState&&e.kind&&[Ki.NAMED_TYPE,Ki.LIST_TYPE,Ki.TYPE,Ki.NON_NULL_TYPE].includes(e.kind)?Co(e.prevState):e}g(fo,"getVariableCompletions"),g(po,"getFragmentDefinitions"),g(ho,"getSuggestionsForVariableDefinition"),g(mo,"getSuggestionsForDirective"),g(go,"getTokenAtPosition"),g(vo,"runOnlineParser"),g(yo,"canUseDirective"),g(bo,"getTypeInfo"),(To=Eo||(Eo={})).TYPE_SYSTEM="TYPE_SYSTEM",To.EXECUTABLE="EXECUTABLE",g(wo,"getDocumentMode"),g(Co,"unwrapType");var So={exports:{}};function xo(e,t){if(null!=e)return e;var n=new Error(void 0!==t?t:"Got unexpected "+e);throw n.framesToPop=1,n}g(xo,"nullthrows"),So.exports=xo,So.exports.default=xo,Object.defineProperty(So.exports,"__esModule",{value:!0});var No=J(So.exports);const ko=g(((e,t)=>{if(!t)return[];const n=new Map,i=new Set;(0,r.visit)(e,{FragmentDefinition(e){n.set(e.name.value,!0)},FragmentSpread(e){i.has(e.name.value)||i.add(e.name.value)}});const o=new Set;i.forEach((e=>{!n.has(e)&&t.has(e)&&o.add(No(t.get(e)))}));const a=[];return o.forEach((e=>{(0,r.visit)(e,{FragmentSpread(e){!i.has(e.name.value)&&t.get(e.name.value)&&(o.add(No(t.get(e.name.value))),i.add(e.name.value))}}),n.has(e.name.value)||a.push(e)})),a}),"getFragmentDependenciesForAST");function _o(e,t){const n=Object.create(null);return t.definitions.forEach((t=>{if("OperationDefinition"===t.kind){const{variableDefinitions:i}=t;i&&i.forEach((t=>{let{variable:i,type:o}=t;const a=(0,r.typeFromAST)(e,o);a?n[i.name.value]=a:o.kind===r.Kind.NAMED_TYPE&&"Float"===o.name.value&&(n[i.name.value]=r.GraphQLFloat)}))}})),n}function Oo(e,t){const n=t?_o(t,e):void 0,i=[];return(0,r.visit)(e,{OperationDefinition(e){i.push(e)}}),{variableToType:n,operations:i}}function Io(e,t){if(t)try{const n=(0,r.parse)(t);return Object.assign(Object.assign({},Oo(n,e)),{documentAST:n})}catch(e){return}}g(_o,"collectVariables"),g(Oo,"getOperationASTFacts"),g(Io,"getOperationFacts"),globalThis&&globalThis.__awaiter;var Do=g((function(e){return"object"==typeof e?null===e:"function"!=typeof e}),"isPrimitive"),Lo=g((function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}),"isObject");function Ao(e){return!0===Lo(e)&&"[object Object]"===Object.prototype.toString.call(e)}g(Ao,"isObjectObject");var Mo=g((function(e){var t,n;return!1!==Ao(e)&&"function"==typeof(t=e.constructor)&&!1!==Ao(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")}),"isPlainObject");const{deleteProperty:Ro}=Reflect,Fo=Do,Po=Mo,jo=g((e=>"object"==typeof e&&null!==e||"function"==typeof e),"isObject$1"),Vo=g((e=>"__proto__"===e||"constructor"===e||"prototype"===e),"isUnsafeKey"),Uo=g((e=>{if(!Fo(e))throw new TypeError("Object keys must be strings or symbols");if(Vo(e))throw new Error(`Cannot set unsafe key: "${e}"`)}),"validateKey"),Bo=g((e=>Array.isArray(e)?e.flat().map(String).join(","):e),"toStringKey"),$o=g(((e,t)=>{if("string"!=typeof e||!t)return e;let n=e+";";return void 0!==t.arrays&&(n+=`arrays=${t.arrays};`),void 0!==t.separator&&(n+=`separator=${t.separator};`),void 0!==t.split&&(n+=`split=${t.split};`),void 0!==t.merge&&(n+=`merge=${t.merge};`),void 0!==t.preservePaths&&(n+=`preservePaths=${t.preservePaths};`),n}),"createMemoKey"),qo=g(((e,t,n)=>{const r=Bo(t?$o(e,t):e);Uo(r);const i=Wo.cache.get(r)||n();return Wo.cache.set(r,i),i}),"memoize"),Ho=g((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.separator||".",r="/"!==n&&t.preservePaths;if("string"==typeof e&&!1!==r&&/\//.test(e))return[e];const i=[];let o="";const a=g((e=>{let t;""!==e.trim()&&Number.isInteger(t=Number(e))?i.push(t):i.push(e)}),"push");for(let t=0;tt&&"function"==typeof t.split?t.split(e):"symbol"==typeof e?[e]:Array.isArray(e)?e:qo(e,t,(()=>Ho(e,t)))),"split"),zo=g(((e,t,n,r)=>{if(Uo(t),void 0===n)Ro(e,t);else if(r&&r.merge){const i="function"===r.merge?r.merge:Object.assign;i&&Po(e[t])&&Po(n)?e[t]=i(e[t],n):e[t]=n}else e[t]=n;return e}),"assignProp"),Wo=g(((e,t,n,r)=>{if(!t||!jo(e))return e;const i=Go(t,r);let o=e;for(let e=0;e{Wo.cache=new Map};var Ko=Wo;function Qo(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M5.0484 1.40838C6.12624 0.33054 7.87376 0.330541 8.9516 1.40838L12.5916 5.0484C13.6695 6.12624 13.6695 7.87376 12.5916 8.9516L8.9516 12.5916C7.87376 13.6695 6.12624 13.6695 5.0484 12.5916L1.40838 8.9516C0.33054 7.87376 0.330541 6.12624 1.40838 5.0484L5.0484 1.40838Z",stroke:"currentColor",strokeWidth:1.2}),t.createElement("rect",{x:6,y:6,width:2,height:2,rx:1,fill:"currentColor"}))}function Xo(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 9",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M1 1L7 7L13 1",stroke:"currentColor",strokeWidth:1.5}))}function Yo(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 7 10",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M6 1.04819L2 5.04819L6 9.04819",stroke:"currentColor",strokeWidth:1.75}))}function Jo(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 9",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M13 8L7 2L1 8",stroke:"currentColor",strokeWidth:1.5}))}function Zo(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M1 1L12.9998 12.9997",stroke:"currentColor",strokeWidth:1.5}),t.createElement("path",{d:"M13 1L1.00079 13.0003",stroke:"currentColor",strokeWidth:1.5}))}function ea(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"-2 -2 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M11.25 14.2105V15.235C11.25 16.3479 10.3479 17.25 9.23501 17.25H2.76499C1.65214 17.25 0.75 16.3479 0.75 15.235L0.75 8.76499C0.75 7.65214 1.65214 6.75 2.76499 6.75L3.78947 6.75",stroke:"currentColor",strokeWidth:1.5}),t.createElement("rect",{x:6.75,y:.75,width:10.5,height:10.5,rx:2.2069,stroke:"currentColor",strokeWidth:1.5}))}function ta(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M5.0484 1.40838C6.12624 0.33054 7.87376 0.330541 8.9516 1.40838L12.5916 5.0484C13.6695 6.12624 13.6695 7.87376 12.5916 8.9516L8.9516 12.5916C7.87376 13.6695 6.12624 13.6695 5.0484 12.5916L1.40838 8.9516C0.33054 7.87376 0.330541 6.12624 1.40838 5.0484L5.0484 1.40838Z",stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{d:"M5 9L9 5",stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{d:"M5 5L9 9",stroke:"currentColor",strokeWidth:1.2}))}function na(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M4 8L8 4",stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{d:"M4 4L8 8",stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 1.2H9C9.99411 1.2 10.8 2.00589 10.8 3V9C10.8 9.99411 9.99411 10.8 9 10.8H8.5V12H9C10.6569 12 12 10.6569 12 9V3C12 1.34315 10.6569 0 9 0H8.5V1.2ZM3.5 1.2V0H3C1.34315 0 0 1.34315 0 3V9C0 10.6569 1.34315 12 3 12H3.5V10.8H3C2.00589 10.8 1.2 9.99411 1.2 9V3C1.2 2.00589 2.00589 1.2 3 1.2H3.5Z",fill:"currentColor"}))}function ra(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{x:.6,y:.6,width:10.8,height:10.8,rx:3.4,stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{d:"M4 8L8 4",stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{d:"M4 4L8 8",stroke:"currentColor",strokeWidth:1.2}))}function ia(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0.5 12 12",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{x:7,y:5.5,width:2,height:2,rx:1,transform:"rotate(90 7 5.5)",fill:"currentColor"}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8 9L10.8 9.5C10.8 10.4941 9.99411 11.3 9 11.3L3 11.3C2.00589 11.3 1.2 10.4941 1.2 9.5L1.2 9L-3.71547e-07 9L-3.93402e-07 9.5C-4.65826e-07 11.1569 1.34314 12.5 3 12.5L9 12.5C10.6569 12.5 12 11.1569 12 9.5L12 9L10.8 9ZM10.8 4L12 4L12 3.5C12 1.84315 10.6569 0.5 9 0.5L3 0.5C1.34315 0.5 -5.87117e-08 1.84315 -1.31135e-07 3.5L-1.5299e-07 4L1.2 4L1.2 3.5C1.2 2.50589 2.00589 1.7 3 1.7L9 1.7C9.99411 1.7 10.8 2.50589 10.8 3.5L10.8 4Z",fill:"currentColor"}))}function oa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 20 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M0.75 3C0.75 1.75736 1.75736 0.75 3 0.75H17.25C17.8023 0.75 18.25 1.19772 18.25 1.75V5.25",stroke:"currentColor",strokeWidth:1.5}),t.createElement("path",{d:"M0.75 3C0.75 4.24264 1.75736 5.25 3 5.25H18.25C18.8023 5.25 19.25 5.69771 19.25 6.25V22.25C19.25 22.8023 18.8023 23.25 18.25 23.25H3C1.75736 23.25 0.75 22.2426 0.75 21V3Z",stroke:"currentColor",strokeWidth:1.5}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 5.25C1.75736 5.25 0.75 4.24264 0.75 3V21C0.75 22.2426 1.75736 23.25 3 23.25H18.25C18.8023 23.25 19.25 22.8023 19.25 22.25V6.25C19.25 5.69771 18.8023 5.25 18.25 5.25H3ZM13 11L6 11V12.5L13 12.5V11Z",fill:"currentColor"}))}function aa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 20 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M0.75 3C0.75 4.24264 1.75736 5.25 3 5.25H17.25M0.75 3C0.75 1.75736 1.75736 0.75 3 0.75H16.25C16.8023 0.75 17.25 1.19772 17.25 1.75V5.25M0.75 3V21C0.75 22.2426 1.75736 23.25 3 23.25H18.25C18.8023 23.25 19.25 22.8023 19.25 22.25V6.25C19.25 5.69771 18.8023 5.25 18.25 5.25H17.25",stroke:"currentColor",strokeWidth:1.5}),t.createElement("line",{x1:13,y1:11.75,x2:6,y2:11.75,stroke:"currentColor",strokeWidth:1.5}))}function sa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{x:5,y:5,width:2,height:2,rx:1,fill:"currentColor"}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 1.2H9C9.99411 1.2 10.8 2.00589 10.8 3V9C10.8 9.99411 9.99411 10.8 9 10.8H8.5V12H9C10.6569 12 12 10.6569 12 9V3C12 1.34315 10.6569 0 9 0H8.5V1.2ZM3.5 1.2V0H3C1.34315 0 0 1.34315 0 3V9C0 10.6569 1.34315 12 3 12H3.5V10.8H3C2.00589 10.8 1.2 9.99411 1.2 9V3C1.2 2.00589 2.00589 1.2 3 1.2H3.5Z",fill:"currentColor"}))}function la(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{x:.6,y:1.1,width:10.8,height:10.8,rx:2.4,stroke:"currentColor",strokeWidth:1.2}),t.createElement("rect",{x:5,y:5.5,width:2,height:2,rx:1,fill:"currentColor"}))}function ua(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 24 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M1.59375 9.52344L4.87259 12.9944L8.07872 9.41249",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square"}),t.createElement("path",{d:"M13.75 5.25V10.75H18.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square"}),t.createElement("path",{d:"M4.95427 11.9332C4.55457 10.0629 4.74441 8.11477 5.49765 6.35686C6.25089 4.59894 7.5305 3.11772 9.16034 2.11709C10.7902 1.11647 12.6901 0.645626 14.5986 0.769388C16.5071 0.893151 18.3303 1.60543 19.8172 2.80818C21.3042 4.01093 22.3818 5.64501 22.9017 7.48548C23.4216 9.32595 23.3582 11.2823 22.7203 13.0853C22.0824 14.8883 20.9013 16.4492 19.3396 17.5532C17.778 18.6572 15.9125 19.25 14 19.25",stroke:"currentColor",strokeWidth:1.5}))}function ca(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("circle",{cx:6,cy:6,r:5.4,stroke:"currentColor",strokeWidth:1.2,strokeDasharray:"4.241025 4.241025",transform:"rotate(22.5)","transform-origin":"center"}),t.createElement("circle",{cx:6,cy:6,r:1,fill:"currentColor"}))}function da(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M1.5 14.5653C1.5 15.211 1.75652 15.8303 2.21314 16.2869C2.66975 16.7435 3.28905 17 3.9348 17C4.58054 17 5.19984 16.7435 5.65646 16.2869C6.11307 15.8303 6.36959 15.211 6.36959 14.5653V12.1305H3.9348C3.28905 12.1305 2.66975 12.387 2.21314 12.8437C1.75652 13.3003 1.5 13.9195 1.5 14.5653Z",stroke:"currentColor",strokeWidth:1.125,strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M3.9348 1.00063C3.28905 1.00063 2.66975 1.25715 2.21314 1.71375C1.75652 2.17035 1.5 2.78964 1.5 3.43537C1.5 4.0811 1.75652 4.70038 2.21314 5.15698C2.66975 5.61358 3.28905 5.8701 3.9348 5.8701H6.36959V3.43537C6.36959 2.78964 6.11307 2.17035 5.65646 1.71375C5.19984 1.25715 4.58054 1.00063 3.9348 1.00063Z",stroke:"currentColor",strokeWidth:1.125,strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M15.0652 12.1305H12.6304V14.5653C12.6304 15.0468 12.7732 15.5175 13.0407 15.9179C13.3083 16.3183 13.6885 16.6304 14.1334 16.8147C14.5783 16.9989 15.0679 17.0472 15.5402 16.9532C16.0125 16.8593 16.4464 16.6274 16.7869 16.2869C17.1274 15.9464 17.3593 15.5126 17.4532 15.0403C17.5472 14.568 17.4989 14.0784 17.3147 13.6335C17.1304 13.1886 16.8183 12.8084 16.4179 12.5409C16.0175 12.2733 15.5468 12.1305 15.0652 12.1305Z",stroke:"currentColor",strokeWidth:1.125,strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M12.6318 5.86775H6.36955V12.1285H12.6318V5.86775Z",stroke:"currentColor",strokeWidth:1.125,strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M17.5 3.43473C17.5 2.789 17.2435 2.16972 16.7869 1.71312C16.3303 1.25652 15.711 1 15.0652 1C14.4195 1 13.8002 1.25652 13.3435 1.71312C12.8869 2.16972 12.6304 2.789 12.6304 3.43473V5.86946H15.0652C15.711 5.86946 16.3303 5.61295 16.7869 5.15635C17.2435 4.69975 17.5 4.08046 17.5 3.43473Z",stroke:"currentColor",strokeWidth:1.125,strokeLinecap:"round",strokeLinejoin:"round"}))}function fa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("circle",{cx:5,cy:5,r:4.35,stroke:"currentColor",strokeWidth:1.3}),t.createElement("line",{x1:8.45962,y1:8.54038,x2:11.7525,y2:11.8333,stroke:"currentColor",strokeWidth:1.3}))}function pa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"-2 -2 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M17.2492 6V2.9569C17.2492 1.73806 16.2611 0.75 15.0423 0.75L2.9569 0.75C1.73806 0.75 0.75 1.73806 0.75 2.9569L0.75 6",stroke:"currentColor",strokeWidth:1.5}),t.createElement("path",{d:"M0.749873 12V15.0431C0.749873 16.2619 1.73794 17.25 2.95677 17.25H15.0421C16.261 17.25 17.249 16.2619 17.249 15.0431V12",stroke:"currentColor",strokeWidth:1.5}),t.createElement("path",{d:"M6 4.5L9 7.5L12 4.5",stroke:"currentColor",strokeWidth:1.5}),t.createElement("path",{d:"M12 13.5L9 10.5L6 13.5",stroke:"currentColor",strokeWidth:1.5}))}function ha(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M0.75 13.25L0.0554307 12.967C-0.0593528 13.2488 0.00743073 13.5719 0.224488 13.7851C0.441545 13.9983 0.765869 14.0592 1.04549 13.9393L0.75 13.25ZM12.8214 1.83253L12.2911 2.36286L12.2911 2.36286L12.8214 1.83253ZM12.8214 3.90194L13.3517 4.43227L12.8214 3.90194ZM10.0981 1.17859L9.56773 0.648259L10.0981 1.17859ZM12.1675 1.17859L12.6978 0.648258L12.6978 0.648257L12.1675 1.17859ZM2.58049 8.75697L3.27506 9.03994L2.58049 8.75697ZM2.70066 8.57599L3.23099 9.10632L2.70066 8.57599ZM5.2479 11.4195L4.95355 10.7297L5.2479 11.4195ZM5.42036 11.303L4.89003 10.7727L5.42036 11.303ZM4.95355 10.7297C4.08882 11.0987 3.41842 11.362 2.73535 11.6308C2.05146 11.9 1.35588 12.1743 0.454511 12.5607L1.04549 13.9393C1.92476 13.5624 2.60256 13.2951 3.28469 13.0266C3.96762 12.7578 4.65585 12.4876 5.54225 12.1093L4.95355 10.7297ZM1.44457 13.533L3.27506 9.03994L1.88592 8.474L0.0554307 12.967L1.44457 13.533ZM3.23099 9.10632L10.6284 1.70892L9.56773 0.648259L2.17033 8.04566L3.23099 9.10632ZM11.6371 1.70892L12.2911 2.36286L13.3517 1.3022L12.6978 0.648258L11.6371 1.70892ZM12.2911 3.37161L4.89003 10.7727L5.95069 11.8333L13.3517 4.43227L12.2911 3.37161ZM12.2911 2.36286C12.5696 2.64142 12.5696 3.09305 12.2911 3.37161L13.3517 4.43227C14.2161 3.56792 14.2161 2.16654 13.3517 1.3022L12.2911 2.36286ZM10.6284 1.70892C10.9069 1.43036 11.3586 1.43036 11.6371 1.70892L12.6978 0.648257C11.8335 -0.216088 10.4321 -0.216084 9.56773 0.648259L10.6284 1.70892ZM3.27506 9.03994C3.26494 9.06479 3.24996 9.08735 3.23099 9.10632L2.17033 8.04566C2.04793 8.16806 1.95123 8.31369 1.88592 8.474L3.27506 9.03994ZM5.54225 12.1093C5.69431 12.0444 5.83339 11.9506 5.95069 11.8333L4.89003 10.7727C4.90863 10.7541 4.92988 10.7398 4.95355 10.7297L5.54225 12.1093Z",fill:"currentColor"}),t.createElement("path",{d:"M11.5 4.5L9.5 2.5",stroke:"currentColor",strokeWidth:1.4026,strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M5.5 10.5L3.5 8.5",stroke:"currentColor",strokeWidth:1.4026,strokeLinecap:"round",strokeLinejoin:"round"}))}function ma(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 16 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M1.32226e-07 1.6609C7.22332e-08 0.907329 0.801887 0.424528 1.46789 0.777117L15.3306 8.11621C16.0401 8.49182 16.0401 9.50818 15.3306 9.88379L1.46789 17.2229C0.801886 17.5755 1.36076e-06 17.0927 1.30077e-06 16.3391L1.32226e-07 1.6609Z",fill:"currentColor"}))}function ga(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.25 9.25V13.5H5.75V9.25L10 9.25V7.75L5.75 7.75V3.5H4.25V7.75L0 7.75V9.25L4.25 9.25Z",fill:"currentColor"}))}function va(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({width:25,height:25,viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M10.2852 24.0745L13.7139 18.0742",stroke:"currentColor",strokeWidth:1.5625}),t.createElement("path",{d:"M14.5742 24.0749L17.1457 19.7891",stroke:"currentColor",strokeWidth:1.5625}),t.createElement("path",{d:"M19.4868 24.0735L20.7229 21.7523C21.3259 20.6143 21.5457 19.3122 21.3496 18.0394C21.1535 16.7666 20.5519 15.591 19.6342 14.6874L23.7984 6.87853C24.0123 6.47728 24.0581 6.00748 23.9256 5.57249C23.7932 5.1375 23.4933 4.77294 23.0921 4.55901C22.6908 4.34509 22.221 4.29932 21.7861 4.43178C21.3511 4.56424 20.9865 4.86408 20.7726 5.26533L16.6084 13.0742C15.3474 12.8142 14.0362 12.9683 12.8699 13.5135C11.7035 14.0586 10.7443 14.9658 10.135 16.1L6 24.0735",stroke:"currentColor",strokeWidth:1.5625}),t.createElement("path",{d:"M4 15L5 13L7 12L5 11L4 9L3 11L1 12L3 13L4 15Z",stroke:"currentColor",strokeWidth:1.5625,strokeLinejoin:"round"}),t.createElement("path",{d:"M11.5 8L12.6662 5.6662L15 4.5L12.6662 3.3338L11.5 1L10.3338 3.3338L8 4.5L10.3338 5.6662L11.5 8Z",stroke:"currentColor",strokeWidth:1.5625,strokeLinejoin:"round"}))}function ya(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M4.75 9.25H1.25V12.75",stroke:"currentColor",strokeWidth:1,strokeLinecap:"square"}),t.createElement("path",{d:"M11.25 6.75H14.75V3.25",stroke:"currentColor",strokeWidth:1,strokeLinecap:"square"}),t.createElement("path",{d:"M14.1036 6.65539C13.8 5.27698 13.0387 4.04193 11.9437 3.15131C10.8487 2.26069 9.48447 1.76694 8.0731 1.75043C6.66173 1.73392 5.28633 2.19563 4.17079 3.0604C3.05526 3.92516 2.26529 5.14206 1.92947 6.513",stroke:"currentColor",strokeWidth:1}),t.createElement("path",{d:"M1.89635 9.34461C2.20001 10.723 2.96131 11.9581 4.05631 12.8487C5.15131 13.7393 6.51553 14.2331 7.9269 14.2496C9.33827 14.2661 10.7137 13.8044 11.8292 12.9396C12.9447 12.0748 13.7347 10.8579 14.0705 9.487",stroke:"currentColor",strokeWidth:1}))}function ba(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{x:.6,y:.6,width:11.8,height:11.8,rx:5.9,stroke:"currentColor",strokeWidth:1.2}),t.createElement("path",{d:"M4.25 7.5C4.25 6 5.75 5 6.5 6.5C7.25 8 8.75 7 8.75 5.5",stroke:"currentColor",strokeWidth:1.2}))}function Ea(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29186 1.92702C9.06924 1.82745 8.87014 1.68202 8.70757 1.50024L7.86631 0.574931C7.62496 0.309957 7.30773 0.12592 6.95791 0.0479385C6.60809 -0.0300431 6.24274 0.00182978 5.91171 0.139208C5.58068 0.276585 5.3001 0.512774 5.10828 0.815537C4.91645 1.1183 4.82272 1.47288 4.83989 1.83089L4.90388 3.08019C4.91612 3.32348 4.87721 3.56662 4.78968 3.79394C4.70215 4.02126 4.56794 4.2277 4.39571 4.39994C4.22347 4.57219 4.01704 4.7064 3.78974 4.79394C3.56243 4.88147 3.3193 4.92038 3.07603 4.90814L1.8308 4.84414C1.47162 4.82563 1.11553 4.91881 0.811445 5.11086C0.507359 5.30292 0.270203 5.58443 0.132561 5.91671C-0.00508149 6.249 -0.0364554 6.61576 0.0427496 6.9666C0.121955 7.31744 0.307852 7.63514 0.5749 7.87606L1.50016 8.71204C1.68193 8.87461 1.82735 9.07373 1.92692 9.29636C2.02648 9.51898 2.07794 9.76012 2.07794 10.004C2.07794 10.2479 2.02648 10.489 1.92692 10.7116C1.82735 10.9343 1.68193 11.1334 1.50016 11.296L0.5749 12.1319C0.309856 12.3729 0.125575 12.6898 0.0471809 13.0393C-0.0312128 13.3888 9.64098e-05 13.754 0.13684 14.0851C0.273583 14.4162 0.509106 14.6971 0.811296 14.8894C1.11349 15.0817 1.46764 15.1762 1.82546 15.1599L3.0707 15.0959C3.31397 15.0836 3.5571 15.1225 3.7844 15.2101C4.01171 15.2976 4.21814 15.4318 4.39037 15.6041C4.56261 15.7763 4.69682 15.9827 4.78435 16.2101C4.87188 16.4374 4.91078 16.6805 4.89855 16.9238L4.83455 18.1691C4.81605 18.5283 4.90921 18.8844 5.10126 19.1885C5.2933 19.4926 5.5748 19.7298 5.90707 19.8674C6.23934 20.0051 6.60608 20.0365 6.9569 19.9572C7.30772 19.878 7.6254 19.6921 7.86631 19.4251L8.7129 18.4998C8.87547 18.318 9.07458 18.1725 9.29719 18.073C9.51981 17.9734 9.76093 17.9219 10.0048 17.9219C10.2487 17.9219 10.4898 17.9734 10.7124 18.073C10.935 18.1725 11.1341 18.318 11.2967 18.4998L12.1326 19.4251C12.3735 19.6921 12.6912 19.878 13.042 19.9572C13.3929 20.0365 13.7596 20.0051 14.0919 19.8674C14.4241 19.7298 14.7056 19.4926 14.8977 19.1885C15.0897 18.8844 15.1829 18.5283 15.1644 18.1691L15.1004 16.9238C15.0882 16.6805 15.1271 16.4374 15.2146 16.2101C15.3021 15.9827 15.4363 15.7763 15.6086 15.6041C15.7808 15.4318 15.9872 15.2976 16.2145 15.2101C16.4418 15.1225 16.685 15.0836 16.9282 15.0959L18.1735 15.1599C18.5326 15.1784 18.8887 15.0852 19.1928 14.8931C19.4969 14.7011 19.7341 14.4196 19.8717 14.0873C20.0093 13.755 20.0407 13.3882 19.9615 13.0374C19.8823 12.6866 19.6964 12.3689 19.4294 12.1279L18.5041 11.292C18.3223 11.1294 18.1769 10.9303 18.0774 10.7076C17.9778 10.485 17.9263 10.2439 17.9263 10C17.9263 9.75612 17.9778 9.51499 18.0774 9.29236C18.1769 9.06973 18.3223 8.87062 18.5041 8.70804L19.4294 7.87206C19.6964 7.63114 19.8823 7.31344 19.9615 6.9626C20.0407 6.61176 20.0093 6.245 19.8717 5.91271C19.7341 5.58043 19.4969 5.29892 19.1928 5.10686C18.8887 4.91481 18.5326 4.82163 18.1735 4.84014L16.9282 4.90414C16.685 4.91638 16.4418 4.87747 16.2145 4.78994C15.9872 4.7024 15.7808 4.56818 15.6086 4.39594C15.4363 4.2237 15.3021 4.01726 15.2146 3.78994C15.1271 3.56262 15.0882 3.31948 15.1004 3.07619L15.1644 1.83089C15.1829 1.4717 15.0897 1.11559 14.8977 0.811487C14.7056 0.507385 14.4241 0.270217 14.0919 0.132568C13.7596 -0.00508182 13.3929 -0.0364573 13.042 0.0427519C12.6912 0.121961 12.3735 0.307869 12.1326 0.574931L11.2914 1.50024C11.1288 1.68202 10.9297 1.82745 10.7071 1.92702C10.4845 2.02659 10.2433 2.07805 9.99947 2.07805C9.7556 2.07805 9.51448 2.02659 9.29186 1.92702ZM14.3745 10C14.3745 12.4162 12.4159 14.375 9.99977 14.375C7.58365 14.375 5.625 12.4162 5.625 10C5.625 7.58375 7.58365 5.625 9.99977 5.625C12.4159 5.625 14.3745 7.58375 14.3745 10Z",fill:"currentColor"}))}function Ta(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M6.5782 1.07092C6.71096 0.643026 7.28904 0.643027 7.4218 1.07092L8.59318 4.84622C8.65255 5.03758 8.82284 5.16714 9.01498 5.16714L12.8056 5.16714C13.2353 5.16714 13.4139 5.74287 13.0663 6.00732L9.99962 8.34058C9.84418 8.45885 9.77913 8.66848 9.83851 8.85984L11.0099 12.6351C11.1426 13.063 10.675 13.4189 10.3274 13.1544L7.26069 10.8211C7.10524 10.7029 6.89476 10.7029 6.73931 10.8211L3.6726 13.1544C3.32502 13.4189 2.85735 13.063 2.99012 12.6351L4.16149 8.85984C4.22087 8.66848 4.15582 8.45885 4.00038 8.34058L0.933671 6.00732C0.586087 5.74287 0.764722 5.16714 1.19436 5.16714L4.98502 5.16714C5.17716 5.16714 5.34745 5.03758 5.40682 4.84622L6.5782 1.07092Z",fill:"currentColor",stroke:"currentColor"}))}function wa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("path",{d:"M6.5782 1.07092C6.71096 0.643026 7.28904 0.643027 7.4218 1.07092L8.59318 4.84622C8.65255 5.03758 8.82284 5.16714 9.01498 5.16714L12.8056 5.16714C13.2353 5.16714 13.4139 5.74287 13.0663 6.00732L9.99962 8.34058C9.84418 8.45885 9.77913 8.66848 9.83851 8.85984L11.0099 12.6351C11.1426 13.063 10.675 13.4189 10.3274 13.1544L7.26069 10.8211C7.10524 10.7029 6.89476 10.7029 6.73931 10.8211L3.6726 13.1544C3.32502 13.4189 2.85735 13.063 2.99012 12.6351L4.16149 8.85984C4.22087 8.66848 4.15582 8.45885 4.00038 8.34058L0.933671 6.00732C0.586087 5.74287 0.764722 5.16714 1.19436 5.16714L4.98502 5.16714C5.17716 5.16714 5.34745 5.03758 5.40682 4.84622L6.5782 1.07092Z",stroke:"currentColor",strokeWidth:1.5}))}function Ca(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{width:16,height:16,rx:2,fill:"currentColor"}))}function Sa(e){var n=e,{title:r,titleId:i}=n,o=v(n,["title","titleId"]);return t.createElement("svg",Object.assign({height:"1em",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":i},o),r?t.createElement("title",{id:i},r):null,t.createElement("rect",{x:.6,y:.6,width:11.8,height:11.8,rx:5.9,stroke:"currentColor",strokeWidth:1.2}),t.createElement("rect",{x:5.5,y:5.5,width:2,height:2,rx:1,fill:"currentColor"}))}g(Qo,"SvgArgument"),g(Xo,"SvgChevronDown"),g(Yo,"SvgChevronLeft"),g(Jo,"SvgChevronUp"),g(Zo,"SvgClose"),g(ea,"SvgCopy"),g(ta,"SvgDeprecatedArgument"),g(na,"SvgDeprecatedEnumValue"),g(ra,"SvgDeprecatedField"),g(ia,"SvgDirective"),g(oa,"SvgDocsFilled"),g(aa,"SvgDocs"),g(sa,"SvgEnumValue"),g(la,"SvgField"),g(ua,"SvgHistory"),g(ca,"SvgImplements"),g(da,"SvgKeyboardShortcut"),g(fa,"SvgMagnifyingGlass"),g(pa,"SvgMerge"),g(ha,"SvgPen"),g(ma,"SvgPlay"),g(ga,"SvgPlus"),g(va,"SvgPrettify"),g(ya,"SvgReload"),g(ba,"SvgRootType"),g(Ea,"SvgSettings"),g(Ta,"SvgStarFilled"),g(wa,"SvgStar"),g(Ca,"SvgStop"),g(Sa,"SvgType");var xa=Object.defineProperty,Na=g(((e,t)=>xa(e,"name",{value:t,configurable:!0})),"__name$E");const ka=rs(Qo,"argument icon");e.ac=ka;const _a=rs(Xo,"chevron down icon");e.ad=_a;const Oa=rs(Yo,"chevron left icon");e.ae=Oa;const Ia=rs(Jo,"chevron up icon");e.af=Ia;const Da=rs(Zo,"close icon");e.ag=Da;const La=rs(ea,"copy icon");e.ah=La;const Aa=rs(ta,"deprecated argument icon");e.ai=Aa;const Ma=rs(na,"deprecated enum value icon");e.aj=Ma;const Ra=rs(ra,"deprecated field icon");e.ak=Ra;const Fa=rs(ia,"directive icon");e.al=Fa;const Pa=rs(oa,"filled docs icon");e.am=Pa;const ja=rs(aa,"docs icon");e.an=ja;const Va=rs(sa,"enum value icon");e.ao=Va;const Ua=rs(la,"field icon");e.ap=Ua;const Ba=rs(ua,"history icon");e.aq=Ba;const $a=rs(ca,"implements icon");e.ar=$a;const qa=rs(da,"keyboard shortcut icon");e.as=qa;const Ha=rs(fa,"magnifying glass icon");e.at=Ha;const Ga=rs(pa,"merge icon");e.au=Ga;const za=rs(ha,"pen icon");e.av=za;const Wa=rs(ma,"play icon");e.aw=Wa;const Ka=rs(ga,"plus icon");e.ax=Ka;const Qa=rs(va,"prettify icon");e.ay=Qa;const Xa=rs(ya,"reload icon");e.az=Xa;const Ya=rs(ba,"root type icon");e.aA=Ya;const Ja=rs(Ea,"settings icon");e.aB=Ja;const Za=rs(Ta,"filled star icon");e.aC=Za;const es=rs(wa,"star icon");e.aD=es;const ts=rs(Ca,"stop icon");e.aE=ts;const ns=rs(Sa,"type icon");function rs(e,t){const n=Na(g((function(n){return ce(e,m(h({},n),{title:t}))}),"IconComponent"),"IconComponent");return Object.defineProperty(n,"name",{value:e.name}),n}e.aF=ns,g(rs,"generateIcon"),Na(rs,"generateIcon");const is=(0,t.forwardRef)(((e,t)=>ce("button",m(h({},e),{ref:t,className:b("graphiql-un-styled",e.className)}))));e.aG=is,is.displayName="UnStyledButton";const os=(0,t.forwardRef)(((e,t)=>ce("button",m(h({},e),{ref:t,className:b("graphiql-button",{success:"graphiql-button-success",error:"graphiql-button-error"}[e.state],e.className)}))));e.aH=os,os.displayName="Button";const as=(0,t.forwardRef)(((e,t)=>ce("div",m(h({},e),{ref:t,className:b("graphiql-button-group",e.className)}))));function ss(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}e.aI=as,as.displayName="ButtonGroup",g(ss,"canUseDOM");var ls=ss()?t.useLayoutEffect:t.useEffect;function us(){var e=(0,t.useState)(Object.create(null))[1];return(0,t.useCallback)((function(){e(Object.create(null))}),[])}function cs(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}g(us,"useForceUpdate"),g(cs,"_objectWithoutPropertiesLoose$b");var ds=["unstable_skipInitialRender"],fs=g((function(e){var n=e.children,r=e.type,o=void 0===r?"reach-portal":r,a=e.containerRef,s=(0,t.useRef)(null),l=(0,t.useRef)(null),u=us();return ls((function(){if(s.current){var e=s.current.ownerDocument,t=(null==a?void 0:a.current)||e.body;return l.current=null==e?void 0:e.createElement(o),t.appendChild(l.current),u(),function(){l.current&&t&&t.removeChild(l.current)}}}),[o,u,a]),l.current?(0,i.createPortal)(n,l.current):(0,t.createElement)("span",{ref:s})}),"PortalImpl"),ps=g((function(e){var n=e.unstable_skipInitialRender,r=cs(e,ds),i=(0,t.useState)(!1),o=i[0],a=i[1];return(0,t.useEffect)((function(){n&&a(!0)}),[n]),n&&!o?null:(0,t.createElement)(fs,r)}),"Portal");function hs(e){return ss()?e?e.ownerDocument:document:null}function ms(e){return"boolean"==typeof e}function gs(e){return!(!e||"[object Function]"!={}.toString.call(e))}function vs(e){return"string"==typeof e}function ys(){}function bs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function ws(e,t){if(null!=e)if(gs(e))e(t);else try{e.current=t}catch(n){throw new Error('Cannot assign value "'+t+'" to ref "'+e+'"')}}function Cs(){for(var e=arguments.length,n=new Array(e),r=0;r=0||(i[n]=e[n]);return i}function Ns(){return Ns=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0})).sort(El)}),"orderByTabIndex"),wl=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"].join(","),Cl="".concat(wl,", [data-focus-guard]"),Sl=g((function(e,t){var n;return nl((null===(n=e.shadowRoot)||void 0===n?void 0:n.children)||e.children).reduce((function(e,n){return e.concat(n.matches(t?Cl:wl)?[n]:[],Sl(n))}),[])}),"getFocusablesWithShadowDom"),xl=g((function(e,t){return e.reduce((function(e,n){return e.concat(Sl(n,t),n.parentNode?nl(n.parentNode.querySelectorAll(wl)).filter((function(e){return e===n})):[])}),[])}),"getFocusables"),Nl=g((function(e){var t=e.querySelectorAll("[".concat("data-autofocus-inside","]"));return nl(t).map((function(e){return xl([e])})).reduce((function(e,t){return e.concat(t)}),[])}),"getParentAutofocusables"),kl=g((function(e,t){return nl(e).filter((function(e){return ll(t,e)})).filter((function(e){return ml(e)}))}),"filterFocusable"),_l=g((function(e,t){return void 0===t&&(t=new Map),nl(e).filter((function(e){return cl(t,e)}))}),"filterAutoFocusable"),Ol=g((function(e,t,n){return Tl(kl(xl(e,n),t),!0,n)}),"getTabbableNodes"),Il=g((function(e,t){return Tl(kl(xl(e),t),!1)}),"getAllTabbableNodes"),Dl=g((function(e,t){return kl(Nl(e),t)}),"parentAutofocusables"),Ll=g((function(e,t){return(e.shadowRoot?Ll(e.shadowRoot,t):Object.getPrototypeOf(e).contains.call(e,t))||nl(e.children).some((function(e){return Ll(e,t)}))}),"contains"),Al=g((function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter((function(e,n){return!t.has(n)}))}),"filterNested"),Ml=g((function(e){return e.parentNode?Ml(e.parentNode):e}),"getTopParent"),Rl=g((function(e){return rl(e).filter(Boolean).reduce((function(e,t){var n=t.getAttribute(Is);return e.push.apply(e,n?Al(nl(Ml(t).querySelectorAll("[".concat(Is,'="').concat(n,'"]:not([').concat(Ds,'="disabled"])')))):[t]),e}),[])}),"getAllAffectedNodes"),Fl=g((function(e){return e.activeElement?e.activeElement.shadowRoot?Fl(e.activeElement.shadowRoot):e.activeElement:void 0}),"getNestedShadowActiveElement"),Pl=g((function(){return document.activeElement?document.activeElement.shadowRoot?Fl(document.activeElement.shadowRoot):document.activeElement:void 0}),"getActiveElement"),jl=g((function(e){return e===document.activeElement}),"focusInFrame"),Vl=g((function(e){return Boolean(nl(e.querySelectorAll("iframe")).some((function(e){return jl(e)})))}),"focusInsideIframe"),Ul=g((function(e){var t=document&&Pl();return!(!t||t.dataset&&t.dataset.focusGuard)&&Rl(e).some((function(e){return Ll(e,t)||Vl(e)}))}),"focusInside"),Bl=g((function(){var e=document&&Pl();return!!e&&nl(document.querySelectorAll("[".concat("data-no-focus-lock","]"))).some((function(t){return Ll(t,e)}))}),"focusIsHidden"),$l=g((function(e,t){return t.filter(hl).filter((function(t){return t.name===e.name})).filter((function(e){return e.checked}))[0]||e}),"findSelectedRadio"),ql=g((function(e,t){return hl(e)&&e.name?$l(e,t):e}),"correctNode"),Hl=g((function(e){var t=new Set;return e.forEach((function(n){return t.add(ql(n,e))})),e.filter((function(e){return t.has(e)}))}),"correctNodes"),Gl=g((function(e){return e[0]&&e.length>1?ql(e[0],e):e[0]}),"pickFirstFocus"),zl=g((function(e,t){return e.length>1?e.indexOf(ql(e[t],e)):t}),"pickFocusable"),Wl="NEW_FOCUS",Kl=g((function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=vl(n);if(!(n&&e.indexOf(n)>=0)){var l=void 0!==n?t.indexOf(n):-1,u=r?t.indexOf(r):l,c=r?e.indexOf(r):-1,d=l-u,f=t.indexOf(o),p=t.indexOf(a),h=Hl(t),m=(void 0!==n?h.indexOf(n):-1)-(r?h.indexOf(r):l),g=zl(e,0),v=zl(e,i-1);return-1===l||-1===c?Wl:!d&&c>=0?c:l<=f&&s&&Math.abs(d)>1?v:l>=p&&s&&Math.abs(d)>1?g:d&&Math.abs(m)>1?c:l<=f?v:l>p?g:d?Math.abs(d)>1?c:(i+c+d)%i:void 0}}),"newFocus"),Ql=g((function(e,t){return void 0===t&&(t=[]),t.push(e),e.parentNode&&Ql(e.parentNode.host||e.parentNode,t),t}),"getParents"),Xl=g((function(e,t){for(var n=Ql(e),r=Ql(t),i=0;i=0)return o}return!1}),"getCommonParent"),Yl=g((function(e,t,n){var r=rl(e),i=rl(t),o=r[0],a=!1;return i.filter(Boolean).forEach((function(e){a=Xl(a||e,e)||a,n.filter(Boolean).forEach((function(e){var t=Xl(o,e);t&&(a=!a||Ll(t,a)?t:Xl(t,a))}))})),a}),"getTopCommonParent"),Jl=g((function(e,t){return e.reduce((function(e,n){return e.concat(Dl(n,t))}),[])}),"allParentAutofocusables"),Zl=g((function(e){return function(t){var n;return t.autofocus||!!(null===(n=dl(t))||void 0===n?void 0:n.autofocus)||e.indexOf(t)>=0}}),"findAutoFocused"),eu=g((function(e,t){var n=new Map;return t.forEach((function(e){return n.set(e.node,e)})),e.map((function(e){return n.get(e)})).filter(bl)}),"reorderNodes"),tu=g((function(e,t){var n=document&&Pl(),r=Rl(e).filter(yl),i=Yl(n||e,e,r),o=new Map,a=Il(r,o),s=Ol(r,o).filter((function(e){var t=e.node;return yl(t)}));if(s[0]||(s=a)[0]){var l=Il([i],o).map((function(e){return e.node})),u=eu(l,s),c=u.map((function(e){return e.node})),d=Kl(c,l,n,t);if(d===Wl){var f=_l(a.map((function(e){return e.node}))).filter(Zl(Jl(r,o)));return{node:f&&f.length?Gl(f):Gl(_l(c))}}return void 0===d?d:u[d]}}),"getFocusMerge"),nu=g((function(e){var t=Rl(e).filter(yl),n=Yl(e,e,t),r=new Map,i=Ol([n],r,!0),o=Ol(t,r).filter((function(e){var t=e.node;return yl(t)})).map((function(e){return e.node}));return i.map((function(e){var t=e.node;return{node:t,index:e.index,lockItem:o.indexOf(t)>=0,guard:vl(t)}}))}),"getFocusabledIn"),ru=g((function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()}),"focusOn"),iu=0,ou=!1,au=g((function(e,t,n){void 0===n&&(n={});var r=tu(e,t);if(!ou&&r){if(iu>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),ou=!0,void setTimeout((function(){ou=!1}),1);iu++,ru(r.node,n.focusOptions),iu--}}),"setFocus");function su(e){var t=window.setImmediate;void 0!==t?t(e):setTimeout(e,1)}g(su,"deferAction");var lu=g((function(){return document&&document.activeElement===document.body}),"focusOnBody"),uu=g((function(){return lu()||Bl()}),"isFreeFocus"),cu=null,du=null,fu=null,pu=!1,hu=g((function(){return!0}),"defaultWhitelist"),mu=g((function(e){return(cu.whiteList||hu)(e)}),"focusWhitelisted"),gu=g((function(e,t){fu={observerNode:e,portaledElement:t}}),"recordPortal"),vu=g((function(e){return fu&&fu.portaledElement===e}),"focusIsPortaledPair");function yu(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else{if(!a.lockItem)break;if(o!==e)return;i=null}}while((o+=n)!==t);i&&(i.node.tabIndex=0)}g(yu,"autoGuard");var bu=g((function(e){return e&&"current"in e?e.current:e}),"extractRef"),Eu=g((function(e){return e?Boolean(pu):"meanwhile"===pu}),"focusWasOutside"),Tu=g((function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))}),"checkInHost"),wu=g((function(e,t){return t.some((function(t){return Tu(e,t,t)}))}),"withinHost"),Cu=g((function(){var e=!1;if(cu){var t=cu,n=t.observed,r=t.persistentFocus,i=t.autoFocus,o=t.shards,a=t.crossFrame,s=t.focusOptions,l=n||fu&&fu.portaledElement,u=document&&document.activeElement;if(l){var c=[l].concat(o.map(bu).filter(Boolean));if(u&&!mu(u)||(r||Eu(a)||!uu()||!du&&i)&&(l&&!(Ul(c)||u&&wu(u,c)||vu(u))&&(document&&!du&&u&&!i?(u.blur&&u.blur(),document.body.focus()):(e=au(c,du,{focusOptions:s}),fu={})),pu=!1,du=document&&document.activeElement),document){var d=document&&document.activeElement,f=nu(c),p=f.map((function(e){return e.node})).indexOf(d);p>-1&&(f.filter((function(e){var t=e.guard,n=e.node;return t&&n.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),yu(p,f.length,1,f),yu(p,-1,-1,f))}}}return e}),"activateTrap"),Su=g((function(e){Cu()&&e&&(e.stopPropagation(),e.preventDefault())}),"onTrap"),xu=g((function(){return su(Cu)}),"onBlur"),Nu=g((function(e){var t=e.target,n=e.currentTarget;n.contains(t)||gu(n,t)}),"onFocus"),ku=g((function(){return null}),"FocusWatcher"),_u=g((function(){pu="just",setTimeout((function(){pu="meanwhile"}),0)}),"onWindowBlur"),Ou=g((function(){document.addEventListener("focusin",Su),document.addEventListener("focusout",xu),window.addEventListener("blur",_u)}),"attachHandler"),Iu=g((function(){document.removeEventListener("focusin",Su),document.removeEventListener("focusout",xu),window.removeEventListener("blur",_u)}),"detachHandler");function Du(e){return e.filter((function(e){return!e.disabled}))}function Lu(e){var t=e.slice(-1)[0];t&&!cu&&Ou();var n=cu,r=n&&t&&t.id===n.id;cu=t,n&&!r&&(n.onDeactivation(),e.filter((function(e){return e.id===n.id})).length||n.returnFocus(!t)),t?(du=null,r&&n.observed===t.observed||t.onActivation(),Cu(),su(Cu)):(Iu(),du=null)}g(Du,"reducePropsToState"),g(Lu,"handleStateChangeOnClient"),Gs.assignSyncMedium(Nu),zs.assignMedium(xu),Ws.assignMedium((function(e){return e({moveFocusInside:au,focusInside:Ul})}));var Au=tl(Du,Lu)(ku),Mu=t.forwardRef(g((function(e,n){return t.createElement(Ys,Ns({sideCar:Au,ref:n},e))}),"FocusLockUICombination")),Ru=Ys.propTypes||{};Ru.sideCar,xs(Ru,["sideCar"]),Mu.propTypes={};var Fu=Mu,Pu="right-scroll-bar-position",ju="width-before-scroll-bar",Vu=$s(),Uu=g((function(){}),"nothing"),Bu=t.forwardRef((function(e,n){var r=t.useRef(null),i=t.useState({onScrollCapture:Uu,onWheelCapture:Uu,onTouchMoveCapture:Uu}),o=i[0],a=i[1],s=e.forwardProps,l=e.children,u=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=Ps(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),E=p,T=Ms([r,n]),w=Fs(Fs({},b),o);return t.createElement(t.Fragment,null,d&&t.createElement(E,{sideCar:Vu,removeScrollBar:c,shards:f,noIsolation:h,inert:m,setCallbacks:a,allowPinchZoom:!!g,lockRef:r}),s?t.cloneElement(t.Children.only(l),Fs(Fs({},w),{ref:T})):t.createElement(y,Fs({},w,{className:u,ref:T}),l))}));Bu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Bu.classNames={fullWidth:ju,zeroRight:Pu};var $u=g((function(){return n.nc}),"getNonce");function qu(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=$u();return t&&e.setAttribute("nonce",t),e}function Hu(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Gu(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}g(qu,"makeStyleTag"),g(Hu,"injectStyles"),g(Gu,"insertStyleTag");var zu=g((function(){var e=0,t=null;return{add:function(n){0==e&&(t=qu())&&(Hu(t,n),Gu(t)),e++},remove:function(){!--e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}}),"stylesheetSingleton"),Wu=g((function(){var e=zu();return function(n,r){t.useEffect((function(){return e.add(n),function(){e.remove()}}),[n&&r])}}),"styleHookSingleton"),Ku=g((function(){var e=Wu();return g((function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}),"Sheet")}),"styleSingleton"),Qu={left:0,top:0,right:0,gap:0},Xu=g((function(e){return parseInt(e||"",10)||0}),"parse$1"),Yu=g((function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[Xu(n),Xu(r),Xu(i)]}),"getOffset"),Ju=g((function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Qu;var t=Yu(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}}),"getGapWidth"),Zu=Ku(),ec=g((function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Pu," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(ju," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Pu," .").concat(Pu," {\n right: 0 ").concat(r,";\n }\n \n .").concat(ju," .").concat(ju," {\n margin-right: 0 ").concat(r,";\n }\n \n body {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")}),"getStyles$2"),tc=g((function(e){var n=e.noRelative,r=e.noImportant,i=e.gapMode,o=void 0===i?"margin":i,a=t.useMemo((function(){return Ju(o)}),[o]);return t.createElement(Zu,{styles:ec(a,!n,o,r?"":"!important")})}),"RemoveScrollBar"),nc=!1;if("undefined"!=typeof window)try{var rc=Object.defineProperty({},"passive",{get:function(){return nc=!0,!0}});window.addEventListener("test",rc,rc),window.removeEventListener("test",rc,rc)}catch(e){nc=!1}var ic=!!nc&&{passive:!1},oc=g((function(e){return"TEXTAREA"===e.tagName}),"alwaysContainsScroll"),ac=g((function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!oc(e)&&"visible"===n[t])}),"elementCanBeScrolled"),sc=g((function(e){return ac(e,"overflowY")}),"elementCouldBeVScrolled"),lc=g((function(e){return ac(e,"overflowX")}),"elementCouldBeHScrolled"),uc=g((function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),fc(e,n)){var r=pc(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1}),"locationCouldBeScrolled"),cc=g((function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}),"getVScrollVariables"),dc=g((function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}),"getHScrollVariables"),fc=g((function(e,t){return"v"===e?sc(t):lc(t)}),"elementCouldBeScrolled"),pc=g((function(e,t){return"v"===e?cc(t):dc(t)}),"getScrollVariables"),hc=g((function(e,t){return"h"===e&&"rtl"===t?-1:1}),"getDirectionFactor"),mc=g((function(e,t,n,r,i){var o=hc(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,c=a>0,d=0,f=0;do{var p=pc(e,s),h=p[0],m=p[1]-p[2]-o*h;(h||m)&&fc(e,s)&&(d+=m,f+=h),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(i&&0===d||!i&&a>d)||!c&&(i&&0===f||!i&&-a>f))&&(u=!0),u}),"handleScroll"),gc=g((function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]}),"getTouchXY"),vc=g((function(e){return[e.deltaX,e.deltaY]}),"getDeltaXY"),yc=g((function(e){return e&&"current"in e?e.current:e}),"extractRef"),bc=g((function(e,t){return e[0]===t[0]&&e[1]===t[1]}),"deltaCompare"),Ec=g((function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")}),"generateStyle"),Tc=0,wc=[];function Cc(e){var n=t.useRef([]),r=t.useRef([0,0]),i=t.useRef(),o=t.useState(Tc++)[0],a=t.useState((function(){return Ku()}))[0],s=t.useRef(e);t.useEffect((function(){s.current=e}),[e]),t.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=js([e.lockRef.current],(e.shards||[]).map(yc),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=t.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!s.current.allowPinchZoom;var n,o=gc(e),a=r.current,l="deltaX"in e?e.deltaX:a[0]-o[0],u="deltaY"in e?e.deltaY:a[1]-o[1],c=e.target,d=Math.abs(l)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=uc(d,c);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=uc(d,c)),!f)return!1;if(!i.current&&"changedTouches"in e&&(l||u)&&(i.current=n),!n)return!0;var p=i.current||n;return mc(p,t,e,"h"===p?l:u,!0)}),[]),u=t.useCallback((function(e){var t=e;if(wc.length&&wc[wc.length-1]===a){var r="deltaY"in t?vc(t):gc(t),i=n.current.filter((function(e){return e.name===t.type&&e.target===t.target&&bc(e.delta,r)}))[0];if(i&&i.should)t.cancelable&&t.preventDefault();else if(!i){var o=(s.current.shards||[]).map(yc).filter(Boolean).filter((function(e){return e.contains(t.target)}));(o.length>0?l(t,o[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}}),[]),c=t.useCallback((function(e,t,r,i){var o={name:e,delta:t,target:r,should:i};n.current.push(o),setTimeout((function(){n.current=n.current.filter((function(e){return e!==o}))}),1)}),[]),d=t.useCallback((function(e){r.current=gc(e),i.current=void 0}),[]),f=t.useCallback((function(t){c(t.type,vc(t),t.target,l(t,e.lockRef.current))}),[]),p=t.useCallback((function(t){c(t.type,gc(t),t.target,l(t,e.lockRef.current))}),[]);t.useEffect((function(){return wc.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",u,ic),document.addEventListener("touchmove",u,ic),document.addEventListener("touchstart",d,ic),function(){wc=wc.filter((function(e){return e!==a})),document.removeEventListener("wheel",u,ic),document.removeEventListener("touchmove",u,ic),document.removeEventListener("touchstart",d,ic)}}),[]);var h=e.removeScrollBar,m=e.inert;return t.createElement(t.Fragment,null,m?t.createElement(a,{styles:Ec(o)}):null,h?t.createElement(tc,{gapMode:"margin"}):null)}g(Cc,"RemoveScrollSideCar");var Sc=Hs(Vu,Cc),xc=t.forwardRef((function(e,n){return t.createElement(Bu,Fs({},e,{ref:n,sideCar:Sc}))}));xc.classNames=Bu.classNames;var Nc=xc,kc={exports:{}},_c="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function Oc(){}function Ic(){}g(Oc,"emptyFunction"),g(Ic,"emptyFunctionWithReset"),Ic.resetWarningCache=Oc;var Dc=g((function(){function e(e,t,n,r,i,o){if(o!==_c){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}g(e,"shim"),e.isRequired=e,g(t,"getShim");var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Ic,resetWarningCache:Oc};return n.PropTypes=n,n}),"factoryWithThrowingShims");kc.exports=Dc();var Lc=kc.exports;function Ac(){return Ac=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}g(Ac,"_extends$9"),g(Mc,"_objectWithoutPropertiesLoose$9");var Rc=["as","isOpen"],Fc=["allowPinchZoom","as","dangerouslyBypassFocusLock","dangerouslyBypassScrollLock","initialFocusRef","onClick","onDismiss","onKeyDown","onMouseDown","unstable_lockFocusAcrossFrames"],Pc=["as","onClick","onKeyDown"],jc=["allowPinchZoom","initialFocusRef","isOpen","onDismiss"];Lc.bool,Lc.bool,Lc.bool,Lc.func;var Vc=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"div":r,o=e.isOpen,a=void 0===o||o,s=Mc(e,Rc);return(0,t.useEffect)((function(){a?window.__REACH_DISABLE_TOOLTIPS=!0:window.requestAnimationFrame((function(){window.__REACH_DISABLE_TOOLTIPS=!1}))}),[a]),a?(0,t.createElement)(ps,{"data-reach-dialog-wrapper":""},(0,t.createElement)(Uc,Ac({ref:n,as:i},s))):null}),"DialogOverlay")),Uc=(0,t.forwardRef)(g((function(e,n){var r=e.allowPinchZoom,i=e.as,o=void 0===i?"div":i,a=e.dangerouslyBypassFocusLock,s=void 0!==a&&a,l=e.dangerouslyBypassScrollLock,u=void 0!==l&&l,c=e.initialFocusRef,d=e.onClick,f=e.onDismiss,p=void 0===f?ys:f,h=e.onKeyDown,m=e.onMouseDown,v=e.unstable_lockFocusAcrossFrames,y=Mc(e,Fc),b=(0,t.useRef)(null),E=(0,t.useRef)(null),T=Cs(E,n),w=(0,t.useCallback)((function(){c&&c.current&&c.current.focus()}),[c]);function C(e){b.current===e.target&&(e.stopPropagation(),p(e))}function S(e){"Escape"===e.key&&(e.stopPropagation(),p(e))}function x(e){b.current=e.target}return g(C,"handleClick"),g(S,"handleKeyDown"),g(x,"handleMouseDown"),(0,t.useEffect)((function(){return E.current?qc(E.current):void 0}),[]),(0,t.createElement)(Fu,{autoFocus:!0,returnFocus:!0,onActivation:w,disabled:s,crossFrame:null==v||v},(0,t.createElement)(Nc,{allowPinchZoom:r,enabled:!u},(0,t.createElement)(o,Ac({},y,{ref:T,"data-reach-dialog-overlay":"",onClick:Ss(d,C),onKeyDown:Ss(h,S),onMouseDown:Ss(m,x)}))))}),"DialogInner")),Bc=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"div":r,o=e.onClick;e.onKeyDown;var a=Mc(e,Pc);return(0,t.createElement)(i,Ac({"aria-modal":"true",role:"dialog",tabIndex:-1},a,{ref:n,"data-reach-dialog-content":"",onClick:Ss(o,(function(e){e.stopPropagation()}))}))}),"DialogContent")),$c=(0,t.forwardRef)(g((function(e,n){var r=e.allowPinchZoom,i=void 0!==r&&r,o=e.initialFocusRef,a=e.isOpen,s=e.onDismiss,l=void 0===s?ys:s,u=Mc(e,jc);return(0,t.createElement)(Vc,{allowPinchZoom:i,initialFocusRef:o,isOpen:a,onDismiss:l},(0,t.createElement)(Bc,Ac({ref:n},u)))}),"Dialog"));function qc(e){var t=[],n=[],r=hs(e);return e?(Array.prototype.forEach.call(r.querySelectorAll("body > *"),(function(r){var i,o;if(r!==(null==(i=e.parentNode)||null==(o=i.parentNode)?void 0:o.parentNode)){var a=r.getAttribute("aria-hidden");null!==a&&"false"!==a||(t.push(a),n.push(r),r.setAttribute("aria-hidden","true"))}})),function(){n.forEach((function(e,n){var r=t[n];null===r?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r)}))}):ys}function Hc(){return Hc=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}g(qc,"createAriaHider"),g(Hc,"_extends$8"),g(Gc,"_objectWithoutPropertiesLoose$8");var zc=["as","style"],Wc=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"span":r,o=e.style,a=void 0===o?{}:o,s=Gc(e,zc);return(0,t.createElement)(i,Hc({ref:n,style:Hc({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},a)},s))}),"VisuallyHidden")),Kc=Object.defineProperty;const Qc=g(((e,t)=>Kc(e,"name",{value:t,configurable:!0})),"__name$D")(((e,t)=>Object.entries(t).reduce(((e,t)=>{let[n,r]=t;return e[n]=r,e}),e)),"createComponentGroup"),Xc=(0,t.forwardRef)(((e,t)=>ce($c,m(h({},e),{ref:t}))));Xc.displayName="Dialog";const Yc=(0,t.forwardRef)(((e,t)=>de(is,m(h({},e),{ref:t,type:"button",className:b("graphiql-dialog-close",e.className),children:[ce(Wc,{children:"Close dialog"}),ce(Da,{})]}))));Yc.displayName="Dialog.Close";const Jc=Qc(Xc,{Close:Yc});e.aJ=Jc;var Zc=!1,ed=0;function td(){return++ed}function nd(e){var n;if("function"==typeof t.useId){var r=(0,t.useId)(e);return null!=e?e:r}var i=null!=e?e:Zc?td():null,o=(0,t.useState)(i),a=o[0],s=o[1];return ls((function(){null===a&&s(td())}),[]),(0,t.useEffect)((function(){!1===Zc&&(Zc=!0)}),[]),null!=(n=null!=e?e:a)?n:void 0}g(td,"genId"),g(nd,"useId");var rd,id=["bottom","height","left","right","top","width"],od=g((function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),id.some((function(n){return e[n]!==t[n]}))}),"rectChanged"),ad=new Map,sd=g((function e(){var t=[];ad.forEach((function(e,n){var r=n.getBoundingClientRect();od(r,e.rect)&&(e.rect=r,t.push(e))})),t.forEach((function(e){e.callbacks.forEach((function(t){return t(e.rect)}))})),rd=window.requestAnimationFrame(e)}),"run");function ld(e,t){return{observe:g((function(){var n=0===ad.size;ad.has(e)?ad.get(e).callbacks.push(t):ad.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),n&&sd()}),"observe"),unobserve:g((function(){var n=ad.get(e);if(n){var r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||ad.delete(e),ad.size||cancelAnimationFrame(rd)}}),"unobserve")}}function ud(e,n,r){var i,o,a;ms(n)?i=n:(i=null==(a=null==n?void 0:n.observe)||a,o=null==n?void 0:n.onChange),gs(r)&&(o=r);var s=(0,t.useState)(e.current),l=s[0],u=s[1],c=(0,t.useRef)(!1),d=(0,t.useRef)(!1),f=(0,t.useState)(null),p=f[0],h=f[1],m=(0,t.useRef)(o);return ls((function(){m.current=o,e.current!==l&&u(e.current)})),ls((function(){l&&!c.current&&(c.current=!0,h(l.getBoundingClientRect()))}),[l]),ls((function(){if(i){var t=l;if(d.current||(d.current=!0,t=e.current),t){var n=ld(t,(function(e){null==m.current||m.current(e),h(e)}));return n.observe(),function(){n.unobserve()}}}}),[i,l,e]),p}g(ld,"observeRect"),g(ud,"useRect");var cd=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],dd=cd.join(","),fd="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function pd(e,t){t=t||{};var n,r,i,o=[],a=[],s=e.querySelectorAll(dd);for(t.includeContainer&&fd.call(e,dd)&&(s=Array.prototype.slice.apply(s)).unshift(e),n=0;n=0||(i[n]=e[n]);return i}g(Id,"_extends$7"),g(Dd,"_objectWithoutPropertiesLoose$7");var Ld=["unstable_skipInitialPortalRender"],Ad=["as","targetRef","position","unstable_observableRefs"],Md=(0,t.forwardRef)(g((function(e,n){var r=e.unstable_skipInitialPortalRender,i=Dd(e,Ld);return(0,t.createElement)(ps,{unstable_skipInitialRender:r},(0,t.createElement)(Rd,Id({ref:n},i)))}),"Popover")),Rd=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"div":r,o=e.targetRef,a=e.position,s=void 0===a?jd:a,l=e.unstable_observableRefs,u=void 0===l?[]:l,c=Dd(e,Ad),d=(0,t.useRef)(null),f=ud(d,{observe:!c.hidden}),p=ud(o,{observe:!c.hidden}),h=Cs(d,n);return Bd(o,d),(0,t.createElement)(i,Id({"data-reach-popover":"",ref:h},c,{style:Id({position:"absolute"},Fd.apply(void 0,[s,p,f].concat(u)),c.style)}))}),"PopoverImpl"));function Fd(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o=0||(i[n]=e[n]);return i}function qd(){return qd=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}g(Gd,"createDescendantContext"),g(zd,"useDescendant"),g(Wd,"useDescendantsInit"),g(Kd,"useDescendants"),g(Qd,"DescendantProvider"),g(Xd,"useDescendantKeyDown"),g(Yd,"isRightClick"),g(Jd,"createStableCallbackHook"),g(Zd,"useStableCallback"),g(ef,"_objectWithoutPropertiesLoose$5");var tf,nf,rf=["children"];function of(e,n){return(0,t.createContext)(n)}function af(e,n){var r=(0,t.createContext)(n);function i(e){var n=e.children,i=ef(e,rf),o=(0,t.useMemo)((function(){return i}),Object.values(i));return(0,t.createElement)(r.Provider,{value:o},n)}function o(i){var o=(0,t.useContext)(r);if(o)return o;if(n)return n;throw Error(i+" must be rendered inside of a "+e+" component.")}return g(i,"Provider"),g(o,"useContext$1"),[i,o]}function sf(){for(var e=arguments.length,t=new Array(e),n=0;n0||m,matches:pf(o)}}}}),"x");try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(d),h=p.next();!h.done;h=p.next()){var m=f(h.value);if("object"==typeof m)return m.value}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}}return mf(s,l)}};return n}g(cf,"e$1"),g(df,"r$1"),g(ff,"i$1"),g(pf,"o"),g(hf,"a"),g(mf,"u"),g(gf,"c$1");var vf=g((function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))}),"s");function yf(e){var t=e.initialState,n=tf.NotStarted,r=new Set,i={_machine:e,send:function(i){n===tf.Running&&(t=e.transition(t,i),vf(t,hf(i)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(){return n=tf.Running,vf(t,uf),i},stop:function(){return n=tf.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}function bf(e){var n=(0,t.useRef)();return n.current||(n.current={v:e()}),n.current.v}function Ef(){return Ef=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}g(kf,"useMachine"),g(_f,"unwrapRefs"),g(Of,"useCreateMachine"),g(If,"_extends$4"),g(Df,"_objectWithoutPropertiesLoose$4"),(xf=wf||(wf={})).Idle="IDLE",xf.Open="OPEN",xf.Navigating="NAVIGATING",xf.Dragging="DRAGGING",xf.Interacting="INTERACTING",(Sf=Cf||(Cf={})).ButtonMouseDown="BUTTON_MOUSE_DOWN",Sf.ButtonMouseUp="BUTTON_MOUSE_UP",Sf.Blur="BLUR",Sf.ClearNavSelection="CLEAR_NAV_SELECTION",Sf.ClearTypeahead="CLEAR_TYPEAHEAD",Sf.GetDerivedData="GET_DERIVED_DATA",Sf.KeyDownEscape="KEY_DOWN_ESCAPE",Sf.KeyDownEnter="KEY_DOWN_ENTER",Sf.KeyDownSpace="KEY_DOWN_SPACE",Sf.KeyDownNavigate="KEY_DOWN_NAVIGATE",Sf.KeyDownSearch="KEY_DOWN_SEARCH",Sf.KeyDownTab="KEY_DOWN_TAB",Sf.KeyDownShiftTab="KEY_DOWN_SHIFT_TAB",Sf.OptionTouchStart="OPTION_TOUCH_START",Sf.OptionMouseMove="OPTION_MOUSE_MOVE",Sf.OptionMouseEnter="OPTION_MOUSE_ENTER",Sf.OptionMouseDown="OPTION_MOUSE_DOWN",Sf.OptionMouseUp="OPTION_MOUSE_UP",Sf.OptionClick="OPTION_CLICK",Sf.ListMouseUp="LIST_MOUSE_UP",Sf.OptionPress="OPTION_PRESS",Sf.OutsideMouseDown="OUTSIDE_MOUSE_DOWN",Sf.OutsideMouseUp="OUTSIDE_MOUSE_UP",Sf.ValueChange="VALUE_CHANGE",Sf.PopoverPointerDown="POPOVER_POINTER_DOWN",Sf.PopoverPointerUp="POPOVER_POINTER_UP",Sf.UpdateAfterTypeahead="UPDATE_AFTER_TYPEAHEAD";var Lf=df({navigationValue:null}),Af=df({typeaheadQuery:null}),Mf=df({value:g((function(e,t){return t.value}),"value")}),Rf=df({navigationValue:g((function(e,t){return t.value}),"navigationValue")}),Ff=df({navigationValue:g((function(e){var t,n=ep(e.value,e.options);return n&&!n.disabled?e.value:(null==(t=e.options.find((function(e){return!e.disabled})))?void 0:t.value)||null}),"navigationValue")});function Pf(e,t){if(t.type===Cf.Blur){var n=t.refs,r=n.list,i=n.popover,o=t.relatedTarget,a=hs(i);return!((null==a?void 0:a.activeElement)===r||!i||i.contains(o||(null==a?void 0:a.activeElement)))}return!1}function jf(e,t){if(t.type===Cf.OutsideMouseDown||t.type===Cf.OutsideMouseUp){var n=t.refs,r=n.button,i=n.popover,o=t.relatedTarget;return!(o===r||!r||r.contains(o)||!i||i.contains(o))}return!1}function Vf(e,t){return!!e.options.find((function(t){return t.value===e.navigationValue}))}function Uf(e,t){var n=t.refs,r=n.popover,i=n.list,o=t.relatedTarget;return!(r&&o&&r.contains(o)&&o!==i)&&Vf(e)}function Bf(e,t){requestAnimationFrame((function(){t.refs.list&&t.refs.list.focus()}))}function $f(e,t){t.refs.button&&t.refs.button.focus()}function qf(e,t){return!t.disabled}function Hf(e,t){return t.type!==Cf.OptionTouchStart||!t||!t.disabled}function Gf(e,t){return!("disabled"in t&&t.disabled||("value"in t?null==t.value:null==e.navigationValue))}function zf(e,t){t.callback&&t.callback(t.value)}function Wf(e,t){if(t.type===Cf.KeyDownEnter){var n=t.refs.hiddenInput;if(n&&n.form){var r=n.form.querySelector("button:not([type]),[type='submit']");r&&r.click()}}}g(Pf,"listboxLostFocus"),g(jf,"clickedOutsideOfListbox"),g(Vf,"optionIsActive"),g(Uf,"shouldNavigate"),g(Bf,"focusList"),g($f,"focusButton"),g(qf,"listboxIsNotDisabled"),g(Hf,"optionIsNavigable"),g(Gf,"optionIsSelectable"),g(zf,"selectOption"),g(Wf,"submitForm");var Kf=df({typeaheadQuery:g((function(e,t){return(e.typeaheadQuery||"")+t.query}),"typeaheadQuery")}),Qf=df({value:g((function(e,t){if(t.type===Cf.UpdateAfterTypeahead&&t.query){var n=Zf(e.options,t.query);if(n&&!n.disabled)return t.callback&&t.callback(n.value),n.value}return e.value}),"value")}),Xf=df({navigationValue:g((function(e,t){if(t.type===Cf.UpdateAfterTypeahead&&t.query){var n=Zf(e.options,t.query);if(n&&!n.disabled)return n.value}return e.navigationValue}),"navigationValue")}),Yf=((Tf={})[Cf.GetDerivedData]={actions:df((function(e,t){return If({},e,t.data)}))},Tf[Cf.ValueChange]={actions:[Mf,zf]},Tf),Jf=g((function(e){var t,n,r,i,o,a,s=e.value;return{id:"listbox",initial:wf.Idle,context:{value:s,options:[],navigationValue:null,typeaheadQuery:null},states:(a={},a[wf.Idle]={on:If({},Yf,(t={},t[Cf.ButtonMouseDown]={target:wf.Open,actions:[Ff],cond:qf},t[Cf.KeyDownSpace]={target:wf.Navigating,actions:[Ff,Bf],cond:qf},t[Cf.KeyDownSearch]={target:wf.Idle,actions:Kf,cond:qf},t[Cf.UpdateAfterTypeahead]={target:wf.Idle,actions:[Qf],cond:qf},t[Cf.ClearTypeahead]={target:wf.Idle,actions:Af},t[Cf.KeyDownNavigate]={target:wf.Navigating,actions:[Ff,Af,Bf],cond:qf},t[Cf.KeyDownEnter]={actions:[Wf],cond:qf},t))},a[wf.Interacting]={entry:[Lf],on:If({},Yf,(n={},n[Cf.ClearNavSelection]={actions:[Lf,Bf]},n[Cf.KeyDownEnter]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},n[Cf.KeyDownSpace]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},n[Cf.ButtonMouseDown]={target:wf.Idle,actions:[$f]},n[Cf.KeyDownEscape]={target:wf.Idle,actions:[$f]},n[Cf.OptionMouseDown]={target:wf.Dragging},n[Cf.OutsideMouseDown]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Dragging,actions:Af,cond:Vf}],n[Cf.OutsideMouseUp]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Navigating,cond:Vf},{target:wf.Interacting,actions:Af}],n[Cf.KeyDownEnter]=wf.Interacting,n[Cf.Blur]=[{target:wf.Idle,cond:Pf,actions:Af},{target:wf.Navigating,cond:Uf},{target:wf.Interacting,actions:Af}],n[Cf.OptionTouchStart]={target:wf.Navigating,actions:[Rf,Af],cond:Hf},n[Cf.OptionClick]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},n[Cf.OptionPress]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},n[Cf.OptionMouseEnter]={target:wf.Navigating,actions:[Rf,Af],cond:Hf},n[Cf.KeyDownNavigate]={target:wf.Navigating,actions:[Rf,Af,Bf]},n))},a[wf.Open]={on:If({},Yf,(r={},r[Cf.ClearNavSelection]={actions:[Lf]},r[Cf.KeyDownEnter]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},r[Cf.KeyDownSpace]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},r[Cf.ButtonMouseDown]={target:wf.Idle,actions:[$f]},r[Cf.KeyDownEscape]={target:wf.Idle,actions:[$f]},r[Cf.OptionMouseDown]={target:wf.Dragging},r[Cf.OutsideMouseDown]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Dragging,cond:Vf},{target:wf.Interacting,actions:Af}],r[Cf.OutsideMouseUp]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Navigating,cond:Vf},{target:wf.Interacting,actions:Af}],r[Cf.Blur]=[{target:wf.Idle,cond:Pf,actions:Af},{target:wf.Navigating,cond:Uf},{target:wf.Interacting,actions:Af}],r[Cf.ButtonMouseUp]={target:wf.Navigating,actions:[Ff,Bf]},r[Cf.ListMouseUp]={target:wf.Navigating,actions:[Ff,Bf]},r[Cf.OptionTouchStart]={target:wf.Navigating,actions:[Rf,Af],cond:Hf},r[Cf.OptionClick]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},r[Cf.OptionPress]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},r[Cf.KeyDownNavigate]={target:wf.Navigating,actions:[Rf,Af,Bf]},r[Cf.KeyDownSearch]={target:wf.Navigating,actions:Kf},r[Cf.UpdateAfterTypeahead]={actions:[Xf]},r[Cf.ClearTypeahead]={actions:Af},r[Cf.OptionMouseMove]=[{target:wf.Dragging,actions:[Rf],cond:Hf},{target:wf.Dragging}],r))},a[wf.Dragging]={on:If({},Yf,(i={},i[Cf.ClearNavSelection]={actions:[Lf]},i[Cf.KeyDownEnter]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},i[Cf.KeyDownSpace]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},i[Cf.ButtonMouseDown]={target:wf.Idle,actions:[$f]},i[Cf.KeyDownEscape]={target:wf.Idle,actions:[$f]},i[Cf.OptionMouseDown]={target:wf.Dragging},i[Cf.OutsideMouseDown]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Navigating,cond:Vf},{target:wf.Interacting,actions:Af}],i[Cf.OutsideMouseUp]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Navigating,cond:Vf,actions:Bf},{target:wf.Interacting,actions:[Af,Bf]}],i[Cf.Blur]=[{target:wf.Idle,cond:Pf,actions:Af},{target:wf.Navigating,cond:Uf},{target:wf.Interacting,actions:Af}],i[Cf.ButtonMouseUp]={target:wf.Navigating,actions:[Ff,Bf]},i[Cf.OptionTouchStart]={target:wf.Navigating,actions:[Rf,Af],cond:Hf},i[Cf.OptionClick]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},i[Cf.OptionPress]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},i[Cf.OptionMouseEnter]={target:wf.Dragging,actions:[Rf,Af],cond:Hf},i[Cf.KeyDownNavigate]={target:wf.Navigating,actions:[Rf,Af,Bf]},i[Cf.KeyDownSearch]={target:wf.Navigating,actions:Kf},i[Cf.UpdateAfterTypeahead]={actions:[Xf]},i[Cf.ClearTypeahead]={actions:Af},i[Cf.OptionMouseMove]=[{target:wf.Navigating,actions:[Rf],cond:Hf},{target:wf.Navigating}],i[Cf.OptionMouseUp]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},i))},a[wf.Navigating]={on:If({},Yf,(o={},o[Cf.ClearNavSelection]={actions:[Lf,Bf]},o[Cf.KeyDownEnter]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},o[Cf.KeyDownSpace]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},o[Cf.ButtonMouseDown]={target:wf.Idle,actions:[$f]},o[Cf.KeyDownEscape]={target:wf.Idle,actions:[$f]},o[Cf.OptionMouseDown]={target:wf.Dragging},o[Cf.OutsideMouseDown]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Navigating,cond:Vf},{target:wf.Interacting,actions:Af}],o[Cf.OutsideMouseUp]=[{target:wf.Idle,cond:jf,actions:Af},{target:wf.Navigating,cond:Vf},{target:wf.Interacting,actions:Af}],o[Cf.Blur]=[{target:wf.Idle,cond:Pf,actions:Af},{target:wf.Navigating,cond:Uf},{target:wf.Interacting,actions:Af}],o[Cf.ButtonMouseUp]={target:wf.Navigating,actions:[Ff,Bf]},o[Cf.OptionTouchStart]={target:wf.Navigating,actions:[Rf,Af],cond:Hf},o[Cf.OptionClick]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},o[Cf.OptionPress]={target:wf.Idle,actions:[Mf,Af,$f,zf],cond:Gf},o[Cf.OptionMouseEnter]={target:wf.Navigating,actions:[Rf,Af],cond:Hf},o[Cf.KeyDownNavigate]={target:wf.Navigating,actions:[Rf,Af,Bf]},o[Cf.KeyDownSearch]={target:wf.Navigating,actions:Kf},o[Cf.UpdateAfterTypeahead]={actions:[Xf]},o[Cf.ClearTypeahead]={actions:Af},o[Cf.OptionMouseMove]=[{target:wf.Navigating,actions:[Rf],cond:Hf},{target:wf.Navigating}],o))},a)}}),"createMachineDefinition");function Zf(e,t){return void 0===t&&(t=""),t&&e.find((function(e){return!e.disabled&&e.label&&e.label.toLowerCase().startsWith(t.toLowerCase())}))||null}function ep(e,t){return e?t.find((function(t){return t.value===e})):void 0}g(Zf,"findOptionFromTypeahead"),g(ep,"findOptionFromValue");var tp=["as","aria-labelledby","aria-label","children","defaultValue","disabled","form","name","onChange","required","value","__componentName"],np=["arrow","button","children","portal"],rp=["aria-label","arrow","as","children","onKeyDown","onMouseDown","onMouseUp"],ip=["as","children"],op=["as","position","onBlur","onKeyDown","onMouseUp","portal","unstable_observableRefs"],ap=["as"],sp=["as","children","disabled","index","label","onClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseUp","onTouchStart","value"],lp=Gd(),up=of(0,{}),cp=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"div":r,o=e["aria-labelledby"],a=e["aria-label"],s=e.children,l=e.defaultValue,u=e.disabled,c=void 0!==u&&u,d=e.form,f=e.name,p=e.onChange,h=e.required,m=e.value;e.__componentName;var v=Df(e,tp),y=(0,t.useRef)(null!=m),b=Wd(),E=b[0],T=b[1],w=(0,t.useRef)(null),C=(0,t.useRef)(null),S=(0,t.useRef)(null),x=(0,t.useRef)(null),N=(0,t.useRef)(null),k=(0,t.useRef)(null),_=(0,t.useRef)(null),O=kf(Of(Jf({value:(y.current?m:l)||null})),{button:w,hiddenInput:C,highlightedOption:S,input:x,list:N,popover:k,selectedOption:_},false),I=O[0],D=O[1];function L(e){e!==I.context.value&&(null==p||p(e))}g(L,"handleValueChange");var A=nd(v.id),M=v.id||sf("listbox-input",A),R=Cs(x,n),F=(0,t.useMemo)((function(){var e=E.find((function(e){return e.value===I.context.value}));return e?e.label:null}),[E,I.context.value]),P=Ep(I.value),j={ariaLabel:a,ariaLabelledBy:o,buttonRef:w,disabled:c,highlightedOptionRef:S,isExpanded:P,listboxId:M,listboxValueLabel:F,listRef:N,onValueChange:L,popoverRef:k,selectedOptionRef:_,send:D,state:I.value,stateData:I.context},V=(0,t.useRef)(!1);if(!y.current&&null==l&&!V.current&&E.length){V.current=!0;var U=E.find((function(e){return!e.disabled}));U&&U.value&&D({type:Cf.ValueChange,value:U.value})}return Sp(m,I.context.value,(function(){D({type:Cf.ValueChange,value:m})})),ls((function(){D({type:Cf.GetDerivedData,data:{options:E}})}),[E,D]),(0,t.useEffect)((function(){function e(e){var t=e.target,n=e.relatedTarget;Cp(k.current,t)||D({type:Cf.OutsideMouseDown,relatedTarget:n||t})}return g(e,"handleMouseDown"),P&&window.addEventListener("mousedown",e),function(){window.removeEventListener("mousedown",e)}}),[D,P]),(0,t.useEffect)((function(){function e(e){var t=e.target,n=e.relatedTarget;Cp(k.current,t)||D({type:Cf.OutsideMouseUp,relatedTarget:n||t})}return g(e,"handleMouseUp"),P&&window.addEventListener("mouseup",e),function(){window.removeEventListener("mouseup",e)}}),[D,P]),(0,t.createElement)(i,If({},v,{ref:R,"data-reach-listbox-input":"","data-state":P?"expanded":"closed","data-value":I.context.value,id:M}),(0,t.createElement)(up.Provider,{value:j},(0,t.createElement)(Qd,{context:lp,items:E,set:T},gs(s)?s({id:M,isExpanded:P,value:I.context.value,selectedOptionRef:_,highlightedOptionRef:S,valueLabel:F,expanded:P}):s,(d||f||h)&&(0,t.createElement)("input",{ref:C,"data-reach-listbox-hidden-input":"",disabled:c,form:d,name:f,readOnly:!0,required:h,tabIndex:-1,type:"hidden",value:I.context.value||""}))))}),"ListboxInput")),dp=(0,t.forwardRef)(g((function(e,n){var r=e.arrow,i=void 0===r?"▼":r,o=e.button,a=e.children,s=e.portal,l=void 0===s||s,u=Df(e,np);return(0,t.createElement)(cp,If({},u,{__componentName:"Listbox",ref:n}),(function(e){var n=e.value,r=e.valueLabel;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(pp,{arrow:i,children:o?gs(o)?o({value:n,label:r}):o:void 0}),(0,t.createElement)(vp,{portal:l},(0,t.createElement)(yp,null,a)))}))}),"Listbox")),fp=(0,t.forwardRef)(g((function(e,n){var r=e["aria-label"],i=e.arrow,o=void 0!==i&&i,a=e.as,s=void 0===a?"span":a,l=e.children,u=e.onKeyDown,c=e.onMouseDown,d=e.onMouseUp,f=Df(e,rp),p=(0,t.useContext)(up),h=p.buttonRef,m=p.send,v=p.ariaLabelledBy,y=p.disabled,b=p.isExpanded,E=p.listboxId,T=p.stateData,w=p.listboxValueLabel,C=T.value,S=Cs(h,n),x=Tp();function N(e){Yd(e.nativeEvent)||(e.preventDefault(),e.stopPropagation(),m({type:Cf.ButtonMouseDown,disabled:y}))}function k(e){Yd(e.nativeEvent)||(e.preventDefault(),e.stopPropagation(),m({type:Cf.ButtonMouseUp}))}g(N,"handleMouseDown"),g(k,"handleMouseUp");var _=sf("button",E),O=(0,t.useMemo)((function(){return l?gs(l)?l({isExpanded:b,label:w,value:C,expanded:b}):l:w}),[l,w,b,C]);return(0,t.createElement)(s,If({"aria-disabled":y||void 0,"aria-expanded":b||void 0,"aria-haspopup":"listbox","aria-labelledby":r?void 0:[v,_].filter(Boolean).join(" "),"aria-label":r,role:"button",tabIndex:y?-1:0},f,{ref:S,"data-reach-listbox-button":"",id:_,onKeyDown:Ss(u,x),onMouseDown:Ss(c,N),onMouseUp:Ss(d,k)}),O,o&&(0,t.createElement)(mp,null,ms(o)?null:o))}),"ListboxButton")),pp=(0,t.memo)(fp),hp=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"span":r,o=e.children,a=Df(e,ip),s=(0,t.useContext)(up).isExpanded;return(0,t.createElement)(i,If({"aria-hidden":!0},a,{ref:n,"data-reach-listbox-arrow":"","data-expanded":s?"":void 0}),gs(o)?o({isExpanded:s,expanded:s}):o||"▼")}),"ListboxArrow")),mp=(0,t.memo)(hp),gp=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"div":r,o=e.position,a=void 0===o?Vd:o,s=e.onBlur,l=e.onKeyDown,u=e.onMouseUp,c=e.portal,d=void 0===c||c,f=e.unstable_observableRefs,p=Df(e,op),h=(0,t.useContext)(up),m=h.isExpanded,v=h.buttonRef,y=h.popoverRef,b=h.send,E=Cs(y,n),T=Tp();function w(){b({type:Cf.ListMouseUp})}g(w,"handleMouseUp");var C=If({hidden:!m,tabIndex:-1},p,{ref:E,"data-reach-listbox-popover":"",onMouseUp:Ss(u,w),onBlur:Ss(s,S),onKeyDown:Ss(l,T)});function S(e){var t=e.nativeEvent;requestAnimationFrame((function(){b({type:Cf.Blur,relatedTarget:t.relatedTarget||t.target})}))}return g(S,"handleBlur"),d?(0,t.createElement)(Md,If({},C,{as:i,targetRef:v,position:a,unstable_observableRefs:f,unstable_skipInitialPortalRender:!0})):(0,t.createElement)(i,C)}),"ListboxPopover")),vp=(0,t.memo)(gp),yp=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"ul":r,o=Df(e,ap),a=(0,t.useContext)(up),s=a.listRef,l=a.ariaLabel,u=a.ariaLabelledBy,c=a.isExpanded,d=a.listboxId,f=a.stateData,p=f.value,h=f.navigationValue,m=Cs(n,s);return(0,t.createElement)(i,If({"aria-activedescendant":wp(c?h:p),"aria-labelledby":l?void 0:u,"aria-label":l,role:"listbox",tabIndex:-1},o,{ref:m,"data-reach-listbox-list":"",id:sf("listbox",d)}))}),"ListboxList")),bp=(0,t.forwardRef)(g((function(e,n){var r=e.as,i=void 0===r?"li":r,o=e.children,a=e.disabled,s=e.index,l=e.label,u=e.onClick,c=e.onMouseDown,d=e.onMouseEnter,f=e.onMouseLeave,p=e.onMouseMove,h=e.onMouseUp,m=e.onTouchStart,v=e.value,y=Df(e,sp),b=(0,t.useContext)(up),E=b.highlightedOptionRef,T=b.selectedOptionRef,w=b.send,C=b.isExpanded,S=b.onValueChange,x=b.state,N=b.stateData,k=N.value,_=N.navigationValue,O=(0,t.useState)(l),I=O[0],D=O[1],L=l||I||"",A=lf((0,t.useRef)(null),null),M=A[0],R=A[1];zd((0,t.useMemo)((function(){return{element:M,value:v,label:L,disabled:!!a}}),[a,M,L,v]),lp,s);var F=(0,t.useCallback)((function(e){!l&&e&&D((function(t){return e.textContent&&t!==e.textContent?e.textContent:t||""}))}),[l]),P=!!_&&_===v,j=k===v,V=Cs(F,n,R,j?T:null,P?E:null);function U(){w({type:Cf.OptionMouseEnter,value:v,disabled:!!a})}function B(){w({type:Cf.OptionTouchStart,value:v,disabled:!!a})}function $(){w({type:Cf.ClearNavSelection})}function q(e){Yd(e.nativeEvent)||(e.preventDefault(),w({type:Cf.OptionMouseDown}))}function H(e){Yd(e.nativeEvent)||w({type:Cf.OptionMouseUp,value:v,callback:S,disabled:!!a})}function G(e){Yd(e.nativeEvent)||w({type:Cf.OptionClick,value:v,callback:S,disabled:!!a})}function z(){x!==wf.Open&&_===v||w({type:Cf.OptionMouseMove,value:v,disabled:!!a})}return g(U,"handleMouseEnter"),g(B,"handleTouchStart"),g($,"handleMouseLeave"),g(q,"handleMouseDown"),g(H,"handleMouseUp"),g(G,"handleClick"),g(z,"handleMouseMove"),(0,t.createElement)(i,If({"aria-selected":(C?P:j)||void 0,"aria-disabled":a||void 0,role:"option"},y,{ref:V,id:wp(v),"data-reach-listbox-option":"","data-current-nav":P?"":void 0,"data-current-selected":j?"":void 0,"data-label":L,"data-value":v,onClick:Ss(u,G),onMouseDown:Ss(c,q),onMouseEnter:Ss(d,U),onMouseLeave:Ss(f,$),onMouseMove:Ss(p,z),onMouseUp:Ss(h,H),onTouchStart:Ss(m,B)}),o)}),"ListboxOption"));function Ep(e){return[wf.Navigating,wf.Open,wf.Dragging,wf.Interacting].includes(e)}function Tp(){var e=(0,t.useContext)(up),n=e.send,r=e.disabled,i=e.onValueChange,o=e.stateData,a=o.navigationValue,s=o.typeaheadQuery,l=Kd(lp),u=Zd(i);(0,t.useEffect)((function(){s&&n({type:Cf.UpdateAfterTypeahead,query:s,callback:u});var e=window.setTimeout((function(){null!=s&&n({type:Cf.ClearTypeahead})}),1e3);return function(){window.clearTimeout(e)}}),[u,n,s]);var c=l.findIndex((function(e){return e.value===a}));return Ss((function(e){var t=e.key,o=vs(t)&&1===t.length,s=l.find((function(e){return e.value===a}));switch(t){case"Enter":return void n({type:Cf.KeyDownEnter,value:a,callback:i,disabled:!!(null!=s&&s.disabled||r)});case" ":return e.preventDefault(),void n({type:Cf.KeyDownSpace,value:a,callback:i,disabled:!!(null!=s&&s.disabled||r)});case"Escape":return void n({type:Cf.KeyDownEscape});case"Tab":var u=e.shiftKey?Cf.KeyDownShiftTab:Cf.KeyDownTab;return void n({type:u});default:return void(o&&n({type:Cf.KeyDownSearch,query:t,disabled:r}))}}),Xd(lp,{currentIndex:c,orientation:"vertical",key:"index",rotate:!0,filter:g((function(e){return!e.disabled}),"filter"),callback:g((function(e){n({type:Cf.KeyDownNavigate,value:l[e].value,disabled:r})}),"callback")}))}function wp(e){var n=(0,t.useContext)(up).listboxId;return e?sf("option-"+e,n):void 0}function Cp(e,t){return!(!e||!e.contains(t))}function Sp(e,n,r){(0,t.useRef)(null!=e).current&&e!==n&&r()}function xp(e){var n=(0,t.useRef)(null);return(0,t.useEffect)((function(){n.current=e}),[e]),n.current}function Np(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function kp(){return kp=Object.assign||function(e){for(var t=1;t8||n>8)&&(C.current=!0)}V||null==j||p||E({type:Vp,payload:{index:j,dropdownRef:T}})}function K(){C.current=!0,V||null==j||p||E({type:Vp,payload:{index:j}})}function Q(e){Yd(e.nativeEvent)||(C.current?i?M.current?M.current=!1:O.current&&O.current.click():p||B():C.current=!0)}return S.current[j]=f,g(B,"select"),g($,"handleClick"),g(q,"handleDragStart"),g(H,"handleMouseDown"),g(G,"handleMouseEnter"),g(z,"handleMouseLeave"),g(W,"handleMouseMove"),g(K,"handleFocus"),g(Q,"handleMouseUp"),(0,t.useEffect)((function(){if(_){var e=window.setTimeout((function(){C.current=!0}),400);return function(){window.clearTimeout(e)}}C.current=!1}),[_,C]),(0,t.useEffect)((function(){var e=hs(O.current);return e.addEventListener("mouseup",t),function(){e.removeEventListener("mouseup",t)};function t(){M.current=!1}}),[]),{data:{disabled:p},props:kp({id:Jp(j),tabIndex:-1},y,{ref:U,"data-disabled":p?"":void 0,"data-selected":V?"":void 0,"data-valuetext":D,onClick:Ss(o,$),onDragStart:Ss(a,q),onMouseDown:Ss(s,H),onMouseEnter:Ss(l,G),onMouseLeave:Ss(u,z),onMouseMove:Ss(c,W),onFocus:Ss(h,K),onMouseUp:Ss(d,Q)})}}function Qp(e){e.id;var n=e.onKeyDown,r=e.ref,i=Np(e,Ip),o=Hp("useDropdownItems"),a=o.dispatch,s=o.triggerRef,l=o.dropdownRef,u=o.selectCallbacks,c=o.dropdownId,d=o.state,f=d.isExpanded,p=d.triggerId,h=d.selectionIndex,m=d.typeaheadQuery,v=nh(),y=Cs(l,r);(0,t.useEffect)((function(){var e=Yp(v,m);m&&null!=e&&a({type:Vp,payload:{index:e,dropdownRef:l}});var t=window.setTimeout((function(){return m&&a({type:jp,payload:""})}),1e3);return function(){return window.clearTimeout(t)}}),[a,v,m,l]);var b=xp(v.length),E=xp(v[h]),T=xp(h);(0,t.useEffect)((function(){h>v.length-1?a({type:Vp,payload:{index:v.length-1,dropdownRef:l}}):b!==v.length&&h>-1&&E&&T===h&&v[h]!==E&&a({type:Vp,payload:{index:v.findIndex((function(e){return e.key===(null==E?void 0:E.key)})),dropdownRef:l}})}),[l,a,v,b,E,T,h]);var w=Ss(g((function(e){var t=e.key;if(f)switch(t){case"Enter":case" ":var n=v.find((function(e){return e.index===h}));n&&!n.disabled&&(e.preventDefault(),n.isLink&&n.element?n.element.click():(Zp(s.current),u.current[n.index]&&u.current[n.index](),a({type:Ap})));break;case"Escape":Zp(s.current),a({type:Mp});break;case"Tab":e.preventDefault();break;default:if(vs(t)&&1===t.length){var r=m+t.toLowerCase();a({type:jp,payload:r})}}}),"handleKeyDown"),Xd(Bp,{currentIndex:h,orientation:"vertical",rotate:!1,filter:g((function(e){return!e.disabled}),"filter"),callback:g((function(e){a({type:Vp,payload:{index:e,dropdownRef:l}})}),"callback"),key:"index"}));return{data:{activeDescendant:Jp(h)||void 0,triggerId:p},props:kp({tabIndex:-1},i,{ref:y,id:c,onKeyDown:Ss(n,w)})}}function Xp(e){var n=e.onBlur,r=e.portal,i=void 0===r||r,o=e.position,a=e.ref,s=Np(e,Dp),l=Hp("useDropdownPopover"),u=l.triggerRef,c=l.triggerClickedRef,d=l.dispatch,f=l.dropdownRef,p=l.popoverRef,h=l.state.isExpanded,m=Cs(p,a);return(0,t.useEffect)((function(){if(h){var e=hs(p.current);return g(t,"listener"),e.addEventListener("mousedown",t),function(){e.removeEventListener("mousedown",t)}}function t(e){c.current?c.current=!1:eh(p.current,e.target)||d({type:Mp})}}),[c,u,d,f,p,h]),{data:{portal:i,position:o,targetRef:u,isExpanded:h},props:kp({ref:m,hidden:!h,onBlur:Ss(n,(function(e){e.currentTarget.contains(e.relatedTarget)||d({type:Mp})}))},s)}}function Yp(e,t){if(void 0===t&&(t=""),!t)return null;var n=e.find((function(e){var n,r,i;return!e.disabled&&(null==(n=e.element)||null==(r=n.dataset)||null==(i=r.valuetext)?void 0:i.toLowerCase().startsWith(t))}));return n?e.indexOf(n):null}function Jp(e){var t=Hp("useItemId").dropdownId;return null!=e&&e>-1?sf("option-"+e,t):void 0}function Zp(e){e&&e.focus()}function eh(e,t){return!(!e||!e.contains(t))}function th(e,t){switch(void 0===t&&(t={}),t.type){case Ap:case Mp:return kp({},e,{isExpanded:!1,selectionIndex:-1});case Rp:return kp({},e,{isExpanded:!0,selectionIndex:0});case Fp:return kp({},e,{isExpanded:!0,selectionIndex:t.payload.index});case Pp:return kp({},e,{isExpanded:!0,selectionIndex:-1});case Vp:var n=t.payload.dropdownRef,r=void 0===n?{current:null}:n;if(t.payload.index>=0&&t.payload.index!==e.selectionIndex){if(r.current){var i=hs(r.current);r.current!==(null==i?void 0:i.activeElement)&&r.current.focus()}return kp({},e,{selectionIndex:null!=t.payload.max?Math.min(Math.max(t.payload.index,0),t.payload.max):Math.max(t.payload.index,0)})}return e;case Lp:return kp({},e,{selectionIndex:-1});case Up:return kp({},e,{triggerId:t.payload});case jp:return void 0!==t.payload?kp({},e,{typeaheadQuery:t.payload}):e;default:return e}}function nh(){return Kd(Bp)}g(Wp,"useDropdownTrigger"),g(Kp,"useDropdownItem"),g(Qp,"useDropdownItems"),g(Xp,"useDropdownPopover"),g(Yp,"findItemFromTypeahead"),g(Jp,"useItemId"),g(Zp,"focus"),g(eh,"popoverContainsEventTarget"),g(th,"reducer$1"),g(nh,"useDropdownDescendants");var rh={exports:{}},ih={},oh="function"==typeof Symbol&&Symbol.for,ah=oh?Symbol.for("react.element"):60103,sh=oh?Symbol.for("react.portal"):60106,lh=oh?Symbol.for("react.fragment"):60107,uh=oh?Symbol.for("react.strict_mode"):60108,ch=oh?Symbol.for("react.profiler"):60114,dh=oh?Symbol.for("react.provider"):60109,fh=oh?Symbol.for("react.context"):60110,ph=oh?Symbol.for("react.async_mode"):60111,hh=oh?Symbol.for("react.concurrent_mode"):60111,mh=oh?Symbol.for("react.forward_ref"):60112,gh=oh?Symbol.for("react.suspense"):60113,vh=oh?Symbol.for("react.suspense_list"):60120,yh=oh?Symbol.for("react.memo"):60115,bh=oh?Symbol.for("react.lazy"):60116,Eh=oh?Symbol.for("react.block"):60121,Th=oh?Symbol.for("react.fundamental"):60117,wh=oh?Symbol.for("react.responder"):60118,Ch=oh?Symbol.for("react.scope"):60119;function Sh(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case ah:switch(e=e.type){case ph:case hh:case lh:case ch:case uh:case gh:return e;default:switch(e=e&&e.$$typeof){case fh:case mh:case bh:case yh:case dh:return e;default:return t}}case sh:return t}}}function xh(e){return Sh(e)===hh}function Nh(){return Nh=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}g(Sh,"z"),g(xh,"A"),ih.AsyncMode=ph,ih.ConcurrentMode=hh,ih.ContextConsumer=fh,ih.ContextProvider=dh,ih.Element=ah,ih.ForwardRef=mh,ih.Fragment=lh,ih.Lazy=bh,ih.Memo=yh,ih.Portal=sh,ih.Profiler=ch,ih.StrictMode=uh,ih.Suspense=gh,ih.isAsyncMode=function(e){return xh(e)||Sh(e)===ph},ih.isConcurrentMode=xh,ih.isContextConsumer=function(e){return Sh(e)===fh},ih.isContextProvider=function(e){return Sh(e)===dh},ih.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===ah},ih.isForwardRef=function(e){return Sh(e)===mh},ih.isFragment=function(e){return Sh(e)===lh},ih.isLazy=function(e){return Sh(e)===bh},ih.isMemo=function(e){return Sh(e)===yh},ih.isPortal=function(e){return Sh(e)===sh},ih.isProfiler=function(e){return Sh(e)===ch},ih.isStrictMode=function(e){return Sh(e)===uh},ih.isSuspense=function(e){return Sh(e)===gh},ih.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===lh||e===hh||e===ch||e===uh||e===gh||e===vh||"object"==typeof e&&null!==e&&(e.$$typeof===bh||e.$$typeof===yh||e.$$typeof===dh||e.$$typeof===fh||e.$$typeof===mh||e.$$typeof===Th||e.$$typeof===wh||e.$$typeof===Ch||e.$$typeof===Eh)},ih.typeOf=Sh,rh.exports=ih,g(Nh,"_extends$2"),g(kh,"_objectWithoutPropertiesLoose$2");var _h=["as","id","children"],Oh=["as"],Ih=["as"],Dh=["as"],Lh=["as"],Ah=["portal"],Mh=["as"],Rh=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?t.Fragment:r,o=e.id,a=e.children,s=kh(e,_h),l=(0,t.useMemo)((function(){try{return rh.exports.isFragment((0,t.createElement)(i,null))}catch(e){return!1}}),[i])?{}:Nh({ref:n,id:o,"data-reach-menu":""},s);return(0,t.createElement)(i,l,(0,t.createElement)(zp,{id:o,children:a}))})),Fh=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"button":r,o=Wp(Nh({},kh(e,Oh),{ref:n})),a=o.data,s=a.isExpanded,l=a.controls,u=o.props;return(0,t.createElement)(i,Nh({"aria-expanded":!!s||void 0,"aria-haspopup":!0,"aria-controls":l},u,{"data-reach-menu-button":""}))})),Ph=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"div":r,o=Kp(Nh({},kh(e,Ih),{ref:n})),a=o.data.disabled,s=o.props;return(0,t.createElement)(i,Nh({role:"menuitem"},s,{"aria-disabled":a||void 0,"data-reach-menu-item":""}))})),jh=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"div":r,o=kh(e,Dh);return(0,t.createElement)(Ph,Nh({},o,{ref:n,as:i}))})),Vh=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"div":r,o=Qp(Nh({},kh(e,Lh),{ref:n})),a=o.data,s=a.activeDescendant,l=a.triggerId,u=o.props;return(0,t.createElement)(i,Nh({"aria-activedescendant":s,"aria-labelledby":l||void 0,role:"menu"},u,{"data-reach-menu-items":""}))})),Uh=(0,t.forwardRef)((function(e,n){var r=e.portal,i=void 0===r||r,o=kh(e,Ah);return(0,t.createElement)(Bh,{portal:i},(0,t.createElement)(Vh,Nh({},o,{ref:n,"data-reach-menu-list":""})))})),Bh=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"div":r,o=Xp(Nh({},kh(e,Mh),{ref:n})),a=o.data,s=a.portal,l=a.targetRef,u=a.position,c=o.props,d={"data-reach-menu-popover":""};return s?(0,t.createElement)(Md,Nh({},c,d,{as:i,targetRef:l,position:u,unstable_skipInitialPortalRender:!0})):(0,t.createElement)(i,Nh({},c,d))}));const $h=(0,t.forwardRef)(((e,t)=>ce(Fh,m(h({},e),{ref:t,className:b("graphiql-un-styled",e.className)}))));$h.displayName="MenuButton";const qh=Qc(Rh,{Button:$h,Item:jh,List:Uh});e.aK=qh;const Hh=(0,t.forwardRef)(((e,t)=>ce(pp,m(h({},e),{ref:t,className:b("graphiql-un-styled",e.className)}))));Hh.displayName="ListboxButton";const Gh=Qc(dp,{Button:Hh,Input:cp,Option:bp,Popover:vp});e.aL=Gh;var zh={};var Wh={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"},Kh=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Qh={},Xh={};function Yh(e){var t,n,r=Xh[e];if(r)return r;for(r=Xh[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?r.push(n):r.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t=55296&&o<=57343){if(o>=55296&&o<=56319&&r+1=56320&&a<=57343){l+=encodeURIComponent(e[r]+e[r+1]),r++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(e[r]);return l}g(Yh,"getEncodeCache"),g(Jh,"encode$1"),Jh.defaultChars=";/?:@&=+$,-_.!~*'()#",Jh.componentChars="-_.!~*'()";var Zh=Jh,em={};function tm(e){var t,n,r=em[e];if(r)return r;for(r=em[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),r.push(n);for(t=0;t=55296&&l<=57343?"���":String.fromCharCode(l),t+=6):240==(248&i)&&t+91114111?u+="����":(l-=65536,u+=String.fromCharCode(55296+(l>>10),56320+(1023&l))),t+=9):u+="�";return u}))}g(tm,"getDecodeCache"),g(nm,"decode$1"),nm.defaultChars=";/?:@&=+$,#",nm.componentChars="";var rm=nm,im=g((function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",(t+=e.search||"")+(e.hash||"")}),"format");function om(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}g(om,"Url");var am=/^([a-z0-9.+-]+:)/i,sm=/:[0-9]*$/,lm=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,um=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),cm=["'"].concat(um),dm=["%","/","?",";","#"].concat(cm),fm=["/","?","#"],pm=/^[+a-z0-9A-Z_-]{0,63}$/,hm=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,mm={javascript:!0,"javascript:":!0},gm={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vm(e,t){if(e&&e instanceof om)return e;var n=new om;return n.parse(e,t),n}g(vm,"urlParse"),om.prototype.parse=function(e,t){var n,r,i,o,a,s=e;if(s=s.trim(),!t&&1===e.split("#").length){var l=lm.exec(s);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var u=am.exec(s);if(u&&(i=(u=u[0]).toLowerCase(),this.protocol=u,s=s.substr(u.length)),(t||u||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(a="//"===s.substr(0,2))||u&&mm[u]||(s=s.substr(2),this.slashes=!0)),!mm[u]&&(a||u&&!gm[u])){var c,d,f=-1;for(n=0;n127?v+="x":v+=g[y];if(!v.match(pm)){var E=m.slice(0,n),T=m.slice(n+1),w=g.match(hm);w&&(E.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=E.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var C=s.indexOf("#");-1!==C&&(this.hash=s.substr(C),s=s.slice(0,C));var S=s.indexOf("?");return-1!==S&&(this.search=s.substr(S),s=s.slice(0,S)),s&&(this.pathname=s),gm[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this},om.prototype.parseHost=function(e){var t=sm.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var ym=vm;Qh.encode=Zh,Qh.decode=rm,Qh.format=im,Qh.parse=ym;var bm={},Em=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Tm=/[\0-\x1F\x7F-\x9F]/,wm=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;bm.Any=Em,bm.Cc=Tm,bm.Cf=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,bm.P=Kh,bm.Z=wm,function(e){function t(e){return Object.prototype.toString.call(e)}function n(e){return"[object String]"===t(e)}g(t,"_class"),g(n,"isString");var r=Object.prototype.hasOwnProperty;function i(e,t){return r.call(e,t)}function o(e){return Array.prototype.slice.call(arguments,1).forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e}function a(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function s(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||65535==(65535&e)||65534==(65535&e)||e>=0&&e<=8||11===e||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function l(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}g(i,"has"),g(o,"assign"),g(a,"arrayReplaceAt"),g(s,"isValidEntityCode"),g(l,"fromCodePoint");var u=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=new RegExp(u.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),d=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,f=Wh;function p(e,t){var n=0;return i(f,t)?f[t]:35===t.charCodeAt(0)&&d.test(t)&&s(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?l(n):e}function h(e){return e.indexOf("\\")<0?e:e.replace(u,"$1")}function m(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(c,(function(e,t,n){return t||p(e,n)}))}g(p,"replaceEntityPattern"),g(h,"unescapeMd"),g(m,"unescapeAll");var v=/[&<>"]/,y=/[&<>"]/g,b={"&":"&","<":"<",">":">",'"':"""};function E(e){return b[e]}function T(e){return v.test(e)?e.replace(y,E):e}g(E,"replaceUnsafeChar"),g(T,"escapeHtml");var w=/[.?*+^$[\]\\(){}|-]/g;function C(e){return e.replace(w,"\\$&")}function S(e){switch(e){case 9:case 32:return!0}return!1}function x(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}g(C,"escapeRE"),g(S,"isSpace"),g(x,"isWhiteSpace");var N=Kh;function k(e){return N.test(e)}function _(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function O(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}g(k,"isPunctChar"),g(_,"isMdAsciiPunct"),g(O,"normalizeReference"),e.lib={},e.lib.mdurl=Qh,e.lib.ucmicro=bm,e.assign=o,e.isString=n,e.has=i,e.unescapeMd=h,e.unescapeAll=m,e.isValidEntityCode=s,e.fromCodePoint=l,e.escapeHtml=T,e.arrayReplaceAt=a,e.isSpace=S,e.isWhiteSpace=x,e.isMdAsciiPunct=_,e.isPunctChar=k,e.escapeRE=C,e.normalizeReference=O}(zh);var Cm={},Sm=g((function(e,t,n){var r,i,o,a,s=-1,l=e.posMax,u=e.pos;for(e.pos=t+1,r=1;e.pos32)return a;if(41===r){if(0===i)break;i--}t++}return o===t||0!==i||(a.str=xm(e.slice(o,t)),a.lines=0,a.pos=t,a.ok=!0),a}),"parseLinkDestination"),km=zh.unescapeAll,_m=g((function(e,t,n){var r,i,o=0,a=t,s={ok:!1,pos:0,lines:0,str:""};if(t>=n)return s;if(34!==(i=e.charCodeAt(t))&&39!==i&&40!==i)return s;for(t++,40===i&&(i=41);t"+Dm(e[t].content)+""},Lm.code_block=function(e,t,n,r,i){var o=e[t];return""+Dm(e[t].content)+"\n"},Lm.fence=function(e,t,n,r,i){var o,a,s,l,u,c=e[t],d=c.info?Im(c.info).trim():"",f="",p="";return d&&(f=(s=d.split(/(\s+)/g))[0],p=s.slice(2).join("")),0===(o=n.highlight&&n.highlight(c.content,f,p)||Dm(c.content)).indexOf(""+o+"\n"):"
"+o+"
\n"},Lm.image=function(e,t,n,r,i){var o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)},Lm.hardbreak=function(e,t,n){return n.xhtmlOut?"
\n":"
\n"},Lm.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"
\n":"
\n":"\n"},Lm.text=function(e,t){return Dm(e[t].content)},Lm.html_block=function(e,t){return e[t].content},Lm.html_inline=function(e,t){return e[t].content},g(Am,"Renderer$1"),Am.prototype.renderAttrs=g((function(e){var t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t\n":">")}),"renderToken"),Am.prototype.renderInline=function(e,t,n){for(var r,i="",o=this.rules,a=0,s=e.length;a\s]/i.test(e)}function Hm(e){return/^<\/a\s*>/i.test(e)}g(qm,"isLinkOpen"),g(Hm,"isLinkClose");var Gm=g((function(e){var t,n,r,i,o,a,s,l,u,c,d,f,p,h,m,g,v,y=e.tokens;if(e.md.options.linkify)for(n=0,r=y.length;n=0;t--)if("link_close"!==(a=i[t]).type){if("html_inline"===a.type&&(qm(a.content)&&p>0&&p--,Hm(a.content)&&p++),!(p>0)&&"text"===a.type&&e.md.linkify.test(a.content)){for(u=a.content,v=e.md.linkify.match(u),s=[],f=a.level,d=0,l=0;ld&&((o=new e.Token("text","",0)).content=u.slice(d,c),o.level=f,s.push(o)),(o=new e.Token("link_open","a",1)).attrs=[["href",m]],o.level=f++,o.markup="linkify",o.info="auto",s.push(o),(o=new e.Token("text","",0)).content=g,o.level=f,s.push(o),(o=new e.Token("link_close","a",-1)).level=--f,o.markup="linkify",o.info="auto",s.push(o),d=v[l].lastIndex);d=0;t--)"text"!==(n=e[t]).type||r||(n.content=n.content.replace(Km,Xm)),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}function Jm(e){var t,n,r=0;for(t=e.length-1;t>=0;t--)"text"!==(n=e[t]).type||r||zm.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}g(Xm,"replaceFn"),g(Ym,"replace_scoped"),g(Jm,"replace_rare");var Zm=g((function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(Wm.test(e.tokens[t].content)&&Ym(e.tokens[t].children),zm.test(e.tokens[t].content)&&Jm(e.tokens[t].children))}),"replace"),eg=zh.isWhiteSpace,tg=zh.isPunctChar,ng=zh.isMdAsciiPunct,rg=/['"]/,ig=/['"]/g,og="’";function ag(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}function sg(e,t){var n,r,i,o,a,s,l,u,c,d,f,p,h,m,g,v,y,b,E,T,w;for(E=[],n=0;n=0&&!(E[y].level<=l);y--);if(E.length=y+1,"text"===r.type){a=0,s=(i=r.content).length;e:for(;a=0)c=i.charCodeAt(o.index-1);else for(y=n-1;y>=0&&"softbreak"!==e[y].type&&"hardbreak"!==e[y].type;y--)if(e[y].content){c=e[y].content.charCodeAt(e[y].content.length-1);break}if(d=32,a=48&&c<=57&&(v=g=!1),g&&v&&(g=f,v=p),g||v){if(v)for(y=E.length-1;y>=0&&(u=E[y],!(E[y].level=0;t--)"inline"===e.tokens[t].type&&rg.test(e.tokens[t].content)&&sg(e.tokens[t].children,e)}),"smartquotes");function ug(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}g(ug,"Token$3"),ug.prototype.attrIndex=g((function(e){var t,n,r;if(!this.attrs)return-1;for(n=0,r=(t=this.attrs).length;n=0&&(n=this.attrs[t][1]),n}),"attrGet"),ug.prototype.attrJoin=g((function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t}),"attrJoin");var cg=ug,dg=cg;function fg(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}g(fg,"StateCore"),fg.prototype.Token=dg;var pg=fg,hg=Fm,mg=[["normalize",Vm],["block",Um],["inline",Bm],["linkify",Gm],["replacements",Zm],["smartquotes",lg]];function gg(){this.ruler=new hg;for(var e=0;en)return!1;if(u=t+1,e.sCount[u]=4)return!1;if((a=e.bMarks[u]+e.tShift[u])>=e.eMarks[u])return!1;if(124!==(E=e.src.charCodeAt(a++))&&45!==E&&58!==E)return!1;if(a>=e.eMarks[u])return!1;if(124!==(T=e.src.charCodeAt(a++))&&45!==T&&58!==T&&!yg(T))return!1;if(45===E&&yg(T))return!1;for(;a=4)return!1;if((c=Eg(o)).length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),0===(d=c.length)||d!==p.length)return!1;if(r)return!0;for(v=e.parentType,e.parentType="table",b=e.md.block.ruler.getRules("blockquote"),(f=e.push("table_open","table",1)).map=m=[t,0],(f=e.push("thead_open","thead",1)).map=[t,t+1],(f=e.push("tr_open","tr",1)).map=[t,t+1],s=0;s=4)break;for((c=Eg(o)).length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),u===t+2&&((f=e.push("tbody_open","tbody",1)).map=g=[t+2,0]),(f=e.push("tr_open","tr",1)).map=[u,u+1],s=0;s=4))break;i=++r}return e.line=i,(o=e.push("code_block","code",0)).content=e.getLines(t,i,4+e.blkIndent,!1)+"\n",o.map=[t,e.line],!0}),"code"),Cg=g((function(e,t,n,r){var i,o,a,s,l,u,c,d=!1,f=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(f+3>p)return!1;if(126!==(i=e.src.charCodeAt(f))&&96!==i)return!1;if(l=f,(o=(f=e.skipChars(f,i))-l)<3)return!1;if(c=e.src.slice(l,f),a=e.src.slice(f,p),96===i&&a.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;for(s=t;!(++s>=n||(f=l=e.bMarks[s]+e.tShift[s])<(p=e.eMarks[s])&&e.sCount[s]=4||(f=e.skipChars(f,i))-l=4)return!1;if(62!==e.src.charCodeAt(x++))return!1;if(r)return!0;for(s=f=e.sCount[t]+1,32===e.src.charCodeAt(x)?(x++,s++,f++,i=!1,b=!0):9===e.src.charCodeAt(x)?(b=!0,(e.bsCount[t]+f)%4==3?(x++,s++,f++,i=!1):i=!0):b=!1,p=[e.bMarks[t]],e.bMarks[t]=x;x=N,v=[e.sCount[t]],e.sCount[t]=f-s,y=[e.tShift[t]],e.tShift[t]=x-e.bMarks[t],T=e.md.block.ruler.getRules("blockquote"),g=e.parentType,e.parentType="blockquote",d=t+1;d=(N=e.eMarks[d])));d++)if(62!==e.src.charCodeAt(x++)||C){if(u)break;for(E=!1,a=0,l=T.length;a=N,h.push(e.bsCount[d]),e.bsCount[d]=e.sCount[d]+1+(b?1:0),v.push(e.sCount[d]),e.sCount[d]=f-s,y.push(e.tShift[d]),e.tShift[d]=x-e.bMarks[d]}for(m=e.blkIndent,e.blkIndent=0,(w=e.push("blockquote_open","blockquote",1)).markup=">",w.map=c=[t,0],e.md.block.tokenize(e,t,d),(w=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=S,e.parentType=g,c[1]=e.line,a=0;a=4)return!1;if(42!==(i=e.src.charCodeAt(l++))&&45!==i&&95!==i)return!1;for(o=1;l=o)return-1;if((n=e.src.charCodeAt(i++))<48||n>57)return-1;for(;;){if(i>=o)return-1;if(!((n=e.src.charCodeAt(i++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(i-r>=10)return-1}return i=4)return!1;if(e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]=e.blkIndent&&(L=!0),(N=Ig(e,t))>=0){if(c=!0,_=e.bMarks[t]+e.tShift[t],g=Number(e.src.slice(_,N-1)),L&&1!==g)return!1}else{if(!((N=Og(e,t))>=0))return!1;c=!1}if(L&&e.skipSpaces(N)>=e.eMarks[t])return!1;if(m=e.src.charCodeAt(N-1),r)return!0;for(h=e.tokens.length,c?(D=e.push("ordered_list_open","ol",1),1!==g&&(D.attrs=[["start",g]])):D=e.push("bullet_list_open","ul",1),D.map=p=[t,0],D.markup=String.fromCharCode(m),y=t,k=!1,I=e.md.block.ruler.getRules("list"),T=e.parentType,e.parentType="list";y=v?1:b-u)>4&&(l=1),s=u+l,(D=e.push("list_item_open","li",1)).markup=String.fromCharCode(m),D.map=d=[t,0],c&&(D.info=e.src.slice(_,N-1)),S=e.tight,C=e.tShift[t],w=e.sCount[t],E=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=s,e.tight=!0,e.tShift[t]=o-e.bMarks[t],e.sCount[t]=b,o>=v&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,t,n,!0),e.tight&&!k||(A=!1),k=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=E,e.tShift[t]=C,e.sCount[t]=w,e.tight=S,(D=e.push("list_item_close","li",-1)).markup=String.fromCharCode(m),y=t=e.line,d[1]=y,o=e.bMarks[t],y>=n)break;if(e.sCount[y]=4)break;for(O=!1,a=0,f=I.length;a=4)return!1;if(91!==e.src.charCodeAt(T))return!1;for(;++T3||e.sCount[C]<0)){for(v=!1,u=0,c=y.length;u`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",jg="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Vg=new RegExp("^(?:"+Pg+"|"+jg+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?][\\s\\S]*?[?]>|]*>|)"),Ug=new RegExp("^(?:"+Pg+"|"+jg+")");Fg.HTML_TAG_RE=Vg,Fg.HTML_OPEN_CLOSE_TAG_RE=Ug;var Bg=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],$g=Fg.HTML_OPEN_CLOSE_TAG_RE,qg=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp($g.source+"\\s*$"),/^$/,!1]],Hg=g((function(e,t,n,r){var i,o,a,s,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(l))return!1;for(s=e.src.slice(l,u),i=0;i=4)return!1;if(35!==(i=e.src.charCodeAt(l))||l>=u)return!1;for(o=1,i=e.src.charCodeAt(++l);35===i&&l6||ll&&Gg(e.src.charCodeAt(a-1))&&(u=a),e.line=t+1,(s=e.push("heading_open","h"+String(o),1)).markup="########".slice(0,o),s.map=[t,e.line],(s=e.push("inline","",0)).content=e.src.slice(l,u).trim(),s.map=[t,e.line],s.children=[],(s=e.push("heading_close","h"+String(o),-1)).markup="########".slice(0,o)),0))}),"heading"),Wg=g((function(e,t,n){var r,i,o,a,s,l,u,c,d,f,p=t+1,h=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(f=e.parentType,e.parentType="paragraph";p3)){if(e.sCount[p]>=e.blkIndent&&(l=e.bMarks[p]+e.tShift[p])<(u=e.eMarks[p])&&(45===(d=e.src.charCodeAt(l))||61===d)&&(l=e.skipChars(l,d),(l=e.skipSpaces(l))>=u)){c=61===d?1:2;break}if(!(e.sCount[p]<0)){for(i=!1,o=0,a=h.length;o3||e.sCount[l]<0)){for(r=!1,i=0,o=u.length;i0&&this.level++,this.tokens.push(r),r},Yg.prototype.isEmpty=g((function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}),"isEmpty"),Yg.prototype.skipEmptyLines=g((function(e){for(var t=this.lineMax;et;)if(!Xg(this.src.charCodeAt(--e)))return e+1;return e}),"skipSpacesBack"),Yg.prototype.skipChars=g((function(e,t){for(var n=this.src.length;en;)if(t!==this.src.charCodeAt(--e))return e+1;return e}),"skipCharsBack"),Yg.prototype.getLines=g((function(e,t,n,r){var i,o,a,s,l,u,c,d=e;if(e>=t)return"";for(u=new Array(t-e),i=0;dn?new Array(o-n+1).join(" ")+this.src.slice(s,l):this.src.slice(s,l)}return u.join("")}),"getLines"),Yg.prototype.Token=Qg;var Jg=Yg,Zg=Fm,ev=[["table",Tg,["paragraph","reference"]],["code",wg],["fence",Cg,["paragraph","reference","blockquote","list"]],["blockquote",xg,["paragraph","reference","blockquote","list"]],["hr",kg,["paragraph","reference","blockquote","list"]],["list",Lg,["paragraph","reference","blockquote"]],["reference",Rg],["html_block",Hg,["paragraph","reference","blockquote"]],["heading",zg,["paragraph","reference","blockquote"]],["lheading",Wg],["paragraph",Kg]];function tv(){this.ruler=new Zg;for(var e=0;e=n))&&!(e.sCount[a]=l){e.line=n;break}for(r=0;r=0&&32===e.pending.charCodeAt(n)?n>=1&&32===e.pending.charCodeAt(n-1)?(e.pending=e.pending.replace(/ +$/,""),e.push("hardbreak","br",0)):(e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0)):e.push("softbreak","br",0)),i++;i?@[]^_`{|}~-".split("").forEach((function(e){lv[e.charCodeAt(0)]=1}));var cv=g((function(e,t){var n,r=e.pos,i=e.posMax;if(92!==e.src.charCodeAt(r))return!1;if(++r=0;n--)95!==(r=t[n]).marker&&42!==r.marker||-1!==r.end&&(i=t[r.end],s=n>0&&t[n-1].end===r.end+1&&t[n-1].token===r.token-1&&t[r.end+1].token===i.token+1&&t[n-1].marker===r.marker,a=String.fromCharCode(r.marker),(o=e.tokens[r.token]).type=s?"strong_open":"em_open",o.tag=s?"strong":"em",o.nesting=1,o.markup=s?a+a:a,o.content="",(o=e.tokens[i.token]).type=s?"strong_close":"em_close",o.tag=s?"strong":"em",o.nesting=-1,o.markup=s?a+a:a,o.content="",s&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--))}hv.tokenize=g((function(e,t){var n,r,i=e.pos,o=e.src.charCodeAt(i);if(t)return!1;if(95!==o&&42!==o)return!1;for(r=e.scanDelims(e.pos,42===o),n=0;n=p)return!1;if(h=s,(l=e.md.helpers.parseLinkDestination(e.src,s,e.posMax)).ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?s=l.pos:c="",h=s;s=p||41!==e.src.charCodeAt(s))&&(m=!0),s++}if(m){if(void 0===e.env.references)return!1;if(s=0?i=e.src.slice(h,s++):s=o+1):s=o+1,i||(i=e.src.slice(a,o)),!(u=e.env.references[gv(i)]))return e.pos=f,!1;c=u.href,d=u.title}return t||(e.pos=a,e.posMax=o,e.push("link_open","a",1).attrs=n=[["href",c]],d&&n.push(["title",d]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=s,e.posMax=p,!0}),"link"),bv=zh.normalizeReference,Ev=zh.isSpace,Tv=g((function(e,t){var n,r,i,o,a,s,l,u,c,d,f,p,h,m="",g=e.pos,v=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(s=e.pos+2,(a=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((l=a+1)=v)return!1;for(h=l,(c=e.md.helpers.parseLinkDestination(e.src,l,e.posMax)).ok&&(m=e.md.normalizeLink(c.str),e.md.validateLink(m)?l=c.pos:m=""),h=l;l=v||41!==e.src.charCodeAt(l))return e.pos=g,!1;l++}else{if(void 0===e.env.references)return!1;if(l=0?o=e.src.slice(h,l++):l=a+1):l=a+1,o||(o=e.src.slice(s,a)),!(u=e.env.references[bv(o)]))return e.pos=g,!1;m=u.href,d=u.title}return t||(i=e.src.slice(s,a),e.md.inline.parse(i,e.md,e.env,p=[]),(f=e.push("image","img",0)).attrs=n=[["src",m],["alt",""]],f.children=p,f.content=i,d&&n.push(["title",d])),e.pos=l,e.posMax=v,!0}),"image"),wv=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Cv=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/,Sv=g((function(e,t){var n,r,i,o,a,s,l=e.pos;if(60!==e.src.charCodeAt(l))return!1;for(a=e.pos,s=e.posMax;;){if(++l>=s)return!1;if(60===(o=e.src.charCodeAt(l)))return!1;if(62===o)break}return n=e.src.slice(a+1,l),Cv.test(n)?(r=e.md.normalizeLink(n),!!e.md.validateLink(r)&&(t||((i=e.push("link_open","a",1)).attrs=[["href",r]],i.markup="autolink",i.info="auto",(i=e.push("text","",0)).content=e.md.normalizeLinkText(n),(i=e.push("link_close","a",-1)).markup="autolink",i.info="auto"),e.pos+=n.length+2,!0)):!!wv.test(n)&&(r=e.md.normalizeLink("mailto:"+n),!!e.md.validateLink(r)&&(t||((i=e.push("link_open","a",1)).attrs=[["href",r]],i.markup="autolink",i.info="auto",(i=e.push("text","",0)).content=e.md.normalizeLinkText(n),(i=e.push("link_close","a",-1)).markup="autolink",i.info="auto"),e.pos+=n.length+2,!0))}),"autolink"),xv=Fg.HTML_TAG_RE;function Nv(e){var t=32|e;return t>=97&&t<=122}g(Nv,"isLetter");var kv=g((function(e,t){var n,r,i,o=e.pos;return!(!e.md.options.html||(i=e.posMax,60!==e.src.charCodeAt(o)||o+2>=i||33!==(n=e.src.charCodeAt(o+1))&&63!==n&&47!==n&&!Nv(n)||!(r=e.src.slice(o).match(xv))||(t||(e.push("html_inline","",0).content=e.src.slice(o,o+r[0].length)),e.pos+=r[0].length,0)))}),"html_inline"),_v=Wh,Ov=zh.has,Iv=zh.isValidEntityCode,Dv=zh.fromCodePoint,Lv=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Av=/^&([a-z][a-z0-9]{1,31});/i,Mv=g((function(e,t){var n,r,i=e.pos,o=e.posMax;if(38!==e.src.charCodeAt(i))return!1;if(i+1a;r-=o.jump+1)if((o=t[r]).marker===i.marker&&o.open&&o.end<0&&(l=!1,(o.close||i.open)&&(o.length+i.length)%3==0&&(o.length%3==0&&i.length%3==0||(l=!0)),!l)){u=r>0&&!t[r-1].open?t[r-1].jump+1:0,i.jump=n-r+u,i.open=!1,o.end=n,o.jump=u,o.close=!1,s=-1;break}-1!==s&&(c[i.marker][(i.open?3:0)+(i.length||0)%3]=s)}}g(Rv,"processDelimiters");var Fv=g((function(e){var t,n=e.tokens_meta,r=e.tokens_meta.length;for(Rv(0,e.delimiters),t=0;t0&&r++,"text"===i[t].type&&t+10&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},$v.prototype.scanDelims=function(e,t){var n,r,i,o,a,s,l,u,c,d=e,f=!0,p=!0,h=this.posMax,m=this.src.charCodeAt(e);for(n=e>0?this.src.charCodeAt(e-1):32;d=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Wv.prototype.parse=function(e,t,n,r){var i,o,a,s=new this.State(e,t,n,r);for(this.tokenize(s),a=(o=this.ruler2.getRules("")).length,i=0;i|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}),"re");function Xv(e){return Array.prototype.slice.call(arguments,1).forEach((function(t){t&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e}function Yv(e){return Object.prototype.toString.call(e)}function Jv(e){return"[object String]"===Yv(e)}function Zv(e){return"[object Object]"===Yv(e)}function ey(e){return"[object RegExp]"===Yv(e)}function ty(e){return"[object Function]"===Yv(e)}function ny(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}g(Xv,"assign"),g(Yv,"_class"),g(Jv,"isString"),g(Zv,"isObject"),g(ey,"isRegExp"),g(ty,"isFunction"),g(ny,"escapeRE");var ry={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function iy(e){return Object.keys(e||{}).reduce((function(e,t){return e||ry.hasOwnProperty(t)}),!1)}g(iy,"isOptionsObj");var oy={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},ay="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",sy="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function ly(e){e.__index__=-1,e.__text_cache__=""}function uy(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function cy(){return function(e,t){t.normalize(e)}}function dy(e){var t=e.re=Qv(e.__opts__),n=e.__tlds__.slice();function r(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||n.push(ay),n.push(t.src_xn),t.src_tlds=n.join("|"),g(r,"untpl"),t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");var i=[];function o(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},g(o,"schemaError"),Object.keys(e.__schemas__).forEach((function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,Zv(n))return ey(n.validate)?r.validate=uy(n.validate):ty(n.validate)?r.validate=n.validate:o(t,n),void(ty(n.normalize)?r.normalize=n.normalize:n.normalize?o(t,n):r.normalize=function(e,t){t.normalize(e)});Jv(n)?i.push(t):o(t,n)}})),i.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var a=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(ny).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),ly(e)}function fy(e,t){var n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function py(e,t){var n=new fy(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function hy(e,t){if(!(this instanceof hy))return new hy(e,t);t||iy(e)&&(t=e,e={}),this.__opts__=Xv({},ry,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Xv({},oy,e),this.__compiled__={},this.__tlds__=sy,this.__tlds_replaced__=!1,this.re={},dy(this)}g(ly,"resetScanCache"),g(uy,"createValidator"),g(cy,"createNormalizer"),g(dy,"compile"),g(fy,"Match"),g(py,"createMatch"),g(hy,"LinkifyIt$1"),hy.prototype.add=g((function(e,t){return this.__schemas__[e]=t,dy(this),this}),"add"),hy.prototype.set=g((function(e){return this.__opts__=Xv(this.__opts__,e),this}),"set"),hy.prototype.test=g((function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,i,o,a,s,l;if(this.re.schema_test.test(e))for((s=this.re.schema_search).lastIndex=0;null!==(t=s.exec(e));)if(i=this.testSchemaAt(e,t[2],s.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||l=0&&null!==(r=e.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,a=r.index+r[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a)),this.__index__>=0}),"test"),hy.prototype.pretest=g((function(e){return this.re.pretest.test(e)}),"pretest"),hy.prototype.testSchemaAt=g((function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0}),"testSchemaAt"),hy.prototype.match=g((function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(py(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)n.push(py(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null}),"match"),hy.prototype.tlds=g((function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),dy(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,dy(this),this)}),"tlds"),hy.prototype.normalize=g((function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)}),"normalize"),hy.prototype.onCompile=g((function(){}),"onCompile");var my=hy;const gy=2147483647,vy=36,yy=/^xn--/,by=/[^\0-\x7E]/,Ey=/[\x2E\u3002\uFF0E\uFF61]/g,Ty={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},wy=Math.floor,Cy=String.fromCharCode;function Sy(e){throw new RangeError(Ty[e])}function xy(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function Ny(e,t){const n=e.split("@");let r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+xy((e=e.replace(Ey,".")).split("."),t).join(".")}function ky(e){const t=[];let n=0;const r=e.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...e)),"ucs2encode"),Oy=g((function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:vy}),"basicToDigit"),Iy=g((function(e,t){return e+22+75*(e<26)-((0!=t)<<5)}),"digitToBasic"),Dy=g((function(e,t,n){let r=0;for(e=n?wy(e/700):e>>1,e+=wy(e/t);e>455;r+=vy)e=wy(e/35);return wy(r+36*e/(e+38))}),"adapt"),Ly=g((function(e){const t=[],n=e.length;let r=0,i=128,o=72,a=e.lastIndexOf("-");a<0&&(a=0);for(let n=0;n=128&&Sy("not-basic"),t.push(e.charCodeAt(n));for(let s=a>0?a+1:0;s=n&&Sy("invalid-input");const a=Oy(e.charCodeAt(s++));(a>=vy||a>wy((gy-r)/t))&&Sy("overflow"),r+=a*t;const l=i<=o?1:i>=o+26?26:i-o;if(awy(gy/u)&&Sy("overflow"),t*=u}const l=t.length+1;o=Dy(r-a,l,0==a),wy(r/l)>gy-i&&Sy("overflow"),i+=wy(r/l),r%=l,t.splice(r++,0,i)}return String.fromCodePoint(...t)}),"decode"),Ay=g((function(e){const t=[];let n=(e=ky(e)).length,r=128,i=0,o=72;for(const n of e)n<128&&t.push(Cy(n));let a=t.length,s=a;for(a&&t.push("-");s=r&&twy((gy-i)/l)&&Sy("overflow"),i+=(n-r)*l,r=n;for(const n of e)if(ngy&&Sy("overflow"),n==r){let e=i;for(let n=vy;;n+=vy){const r=n<=o?1:n>=o+26?26:n-o;if(e=0))try{t.hostname=zy.toASCII(t.hostname)}catch(e){}return Gy.encode(Gy.format(t))}function Zy(e){var t=Gy.parse(e,!0);if(t.hostname&&(!t.protocol||Yy.indexOf(t.protocol)>=0))try{t.hostname=zy.toUnicode(t.hostname)}catch(e){}return Gy.decode(Gy.format(t),Gy.decode.defaultChars+"%")}function eb(e,t){if(!(this instanceof eb))return new eb(e,t);t||jy.isString(e)||(t=e||{},e="default"),this.inline=new qy,this.block=new $y,this.core=new By,this.renderer=new Uy,this.linkify=new Hy,this.validateLink=Xy,this.normalizeLink=Jy,this.normalizeLinkText=Zy,this.utils=jy,this.helpers=jy.assign({},Vy),this.options={},this.configure(e),t&&this.set(t)}g(Jy,"normalizeLink"),g(Zy,"normalizeLinkText"),g(eb,"MarkdownIt"),eb.prototype.set=function(e){return jy.assign(this.options,e),this},eb.prototype.configure=function(e){var t,n=this;if(jy.isString(e)&&!(e=Wy[t=e]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach((function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)})),this},eb.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.enable(e,!0))}),this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},eb.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.disable(e,!0))}),this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},eb.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},eb.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},eb.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},eb.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},eb.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const tb=new eb({breaks:!0,linkify:!0}),nb=(0,t.forwardRef)(((e,t)=>{var n=e,{children:r,onlyShowFirstChild:i,type:o}=n,a=v(n,["children","onlyShowFirstChild","type"]);return ce("div",m(h({},a),{ref:t,className:b(`graphiql-markdown-${o}`,i&&"graphiql-markdown-preview",a.className),dangerouslySetInnerHTML:{__html:tb.render(r)}}))}));e.aM=nb,nb.displayName="MarkdownContent";const rb=(0,t.forwardRef)(((e,t)=>ce("div",m(h({},e),{ref:t,className:b("graphiql-spinner",e.className)}))));function ib(e){var t,n,r=hs(e),i=r.defaultView||window;return r?{width:null!=(t=r.documentElement.clientWidth)?t:i.innerWidth,height:null!=(n=r.documentElement.clientHeight)?n:i.innerHeight}:{width:0,height:0}}function ob(){return ob=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}e.aN=rb,rb.displayName="Spinner",g(ib,"getDocumentDimensions"),g(ob,"_extends$1"),g(ab,"_objectWithoutPropertiesLoose$1");var sb,lb,ub,cb,db,fb,pb,hb,mb,gb,vb=["children","label","ariaLabel","id","DEBUG_STYLE"],yb=["label","ariaLabel","isVisible","id"],bb=["ariaLabel","aria-label","as","id","isVisible","label","position","style","triggerRect"],Eb=["type"],Tb=100,wb=500;(gb=pb||(pb={})).Idle="IDLE",gb.Focused="FOCUSED",gb.Visible="VISIBLE",gb.LeavingVisible="LEAVING_VISIBLE",gb.Dismissed="DISMISSED",(mb=hb||(hb={})).Blur="BLUR",mb.Focus="FOCUS",mb.GlobalMouseMove="GLOBAL_MOUSE_MOVE",mb.MouseDown="MOUSE_DOWN",mb.MouseEnter="MOUSE_ENTER",mb.MouseLeave="MOUSE_LEAVE",mb.MouseMove="MOUSE_MOVE",mb.Rest="REST",mb.SelectWithKeyboard="SELECT_WITH_KEYBOARD",mb.TimeComplete="TIME_COMPLETE";var Cb,Sb,xb={initial:pb.Idle,states:(fb={},fb[pb.Idle]={enter:Mb,on:(sb={},sb[hb.MouseEnter]=pb.Focused,sb[hb.Focus]=pb.Visible,sb)},fb[pb.Focused]={enter:Ib,leave:Db,on:(lb={},lb[hb.MouseMove]=pb.Focused,lb[hb.MouseLeave]=pb.Idle,lb[hb.MouseDown]=pb.Dismissed,lb[hb.Blur]=pb.Idle,lb[hb.Rest]=pb.Visible,lb)},fb[pb.Visible]={on:(ub={},ub[hb.Focus]=pb.Focused,ub[hb.MouseEnter]=pb.Focused,ub[hb.MouseLeave]=pb.LeavingVisible,ub[hb.Blur]=pb.LeavingVisible,ub[hb.MouseDown]=pb.Dismissed,ub[hb.SelectWithKeyboard]=pb.Dismissed,ub[hb.GlobalMouseMove]=pb.LeavingVisible,ub)},fb[pb.LeavingVisible]={enter:Lb,leave:g((function(){Ab(),Mb()}),"leave"),on:(cb={},cb[hb.MouseEnter]=pb.Visible,cb[hb.Focus]=pb.Visible,cb[hb.TimeComplete]=pb.Idle,cb)},fb[pb.Dismissed]={leave:g((function(){Mb()}),"leave"),on:(db={},db[hb.MouseLeave]=pb.Idle,db[hb.Blur]=pb.Idle,db)},fb)},Nb={value:xb.initial,context:{id:null}},kb=[];function _b(e){return kb.push(e),function(){kb.splice(kb.indexOf(e),1)}}function Ob(){kb.forEach((function(e){return e(Nb)}))}function Ib(){window.clearTimeout(Cb),Cb=window.setTimeout((function(){$b({type:hb.Rest})}),Tb)}function Db(){window.clearTimeout(Cb)}function Lb(){window.clearTimeout(Sb),Sb=window.setTimeout((function(){return $b({type:hb.TimeComplete})}),wb)}function Ab(){window.clearTimeout(Sb)}function Mb(){Nb.context.id=null}function Rb(e){var n=void 0===e?{}:e,r=n.id,i=n.onPointerEnter,o=n.onPointerMove,a=n.onPointerLeave,s=n.onPointerDown,l=n.onMouseEnter,u=n.onMouseMove,c=n.onMouseLeave,d=n.onMouseDown,f=n.onFocus,p=n.onBlur,h=n.onKeyDown,m=n.disabled,v=n.ref,y=n.DEBUG_STYLE,b=String(nd(r)),E=(0,t.useState)(!!y||Hb(b,!0)),T=E[0],w=E[1],C=(0,t.useRef)(null),S=Cs(v,C),x=ud(C,{observe:T});function N(e,t){return"undefined"!=typeof window&&"PointerEvent"in window?e:Ss(e,t)}function k(e){return g((function(t){"mouse"===t.pointerType&&e(t)}),"onPointerEvent")}function _(){$b({type:hb.MouseEnter,id:b})}function O(){$b({type:hb.MouseMove,id:b})}function I(){$b({type:hb.MouseLeave})}function D(){Nb.context.id===b&&$b({type:hb.MouseDown})}function L(){window.__REACH_DISABLE_TOOLTIPS||$b({type:hb.Focus,id:b})}function A(){Nb.context.id===b&&$b({type:hb.Blur})}function M(e){"Enter"!==e.key&&" "!==e.key||$b({type:hb.SelectWithKeyboard})}return(0,t.useEffect)((function(){return _b((function(){w(Hb(b))}))}),[b]),(0,t.useEffect)((function(){var e=hs(C.current);function t(e){"Escape"!==e.key&&"Esc"!==e.key||Nb.value!==pb.Visible||$b({type:hb.SelectWithKeyboard})}return g(t,"listener"),e.addEventListener("keydown",t),function(){return e.removeEventListener("keydown",t)}}),[]),Bb({disabled:m,isVisible:T,ref:C}),g(N,"wrapMouseEvent"),g(k,"wrapPointerEventHandler"),g(_,"handleMouseEnter"),g(O,"handleMouseMove"),g(I,"handleMouseLeave"),g(D,"handleMouseDown"),g(L,"handleFocus"),g(A,"handleBlur"),g(M,"handleKeyDown"),[{"aria-describedby":T?sf("tooltip",b):void 0,"data-state":T?"tooltip-visible":"tooltip-hidden","data-reach-tooltip-trigger":"",ref:S,onPointerEnter:Ss(i,k(_)),onPointerMove:Ss(o,k(O)),onPointerLeave:Ss(a,k(I)),onPointerDown:Ss(s,k(D)),onMouseEnter:N(l,_),onMouseMove:N(u,O),onMouseLeave:N(c,I),onMouseDown:N(d,D),onFocus:Ss(f,L),onBlur:Ss(p,A),onKeyDown:Ss(h,M)},{id:b,triggerRect:x,isVisible:T},T]}g(_b,"subscribe"),g(Ob,"notify"),g(Ib,"startRestTimer"),g(Db,"clearRestTimer"),g(Lb,"startLeavingVisibleTimer"),g(Ab,"clearLeavingVisibleTimer"),g(Mb,"clearContextId"),g(Rb,"useTooltip");var Fb=(0,t.forwardRef)((function(e,n){var r=e.children,i=e.label,o=e.ariaLabel,a=e.id,s=e.DEBUG_STYLE,l=ab(e,vb),u=t.Children.only(r),c=Rb({id:a,onPointerEnter:u.props.onPointerEnter,onPointerMove:u.props.onPointerMove,onPointerLeave:u.props.onPointerLeave,onPointerDown:u.props.onPointerDown,onMouseEnter:u.props.onMouseEnter,onMouseMove:u.props.onMouseMove,onMouseLeave:u.props.onMouseLeave,onMouseDown:u.props.onMouseDown,onFocus:u.props.onFocus,onBlur:u.props.onBlur,onKeyDown:u.props.onKeyDown,disabled:u.props.disabled,ref:u.ref,DEBUG_STYLE:s}),d=c[0],f=c[1];return(0,t.createElement)(t.Fragment,null,(0,t.cloneElement)(u,d),(0,t.createElement)(Pb,ob({ref:n,label:i,"aria-label":o},f,l)))}));e.aQ=Fb;var Pb=(0,t.forwardRef)(g((function(e,n){var r=e.label,i=e.ariaLabel,o=e.isVisible,a=e.id,s=ab(e,yb);return o?(0,t.createElement)(ps,null,(0,t.createElement)(jb,ob({ref:n,label:r,"aria-label":i,isVisible:o},s,{id:sf("tooltip",String(a))}))):null}),"TooltipPopup")),jb=(0,t.forwardRef)(g((function(e,n){var r=e.ariaLabel,i=e["aria-label"],o=e.as,a=void 0===o?"div":o,s=e.id,l=e.isVisible,u=e.label,c=e.position,d=void 0===c?Ub:c,f=e.style,p=e.triggerRect,h=ab(e,bb),m=null!=(i||r),g=(0,t.useRef)(null),v=Cs(n,g),y=ud(g,{observe:l});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(a,ob({role:m?void 0:"tooltip"},h,{ref:v,"data-reach-tooltip":"",id:m?void 0:s,style:ob({},f,Vb(d,p,y))}),u),m&&(0,t.createElement)(Wc,{role:"tooltip",id:s},i||r))}),"TooltipContent"));function Vb(e,t,n){return n?e(t,n):{visibility:"hidden"}}g(Vb,"getStyles");var Ub=g((function(e,t,n){void 0===n&&(n=8);var r=ib(),i=r.width,o=r.height;if(!e||!t)return{};var a={top:e.top-t.height<0,right:i{var n=e,{isActive:r}=n,i=v(n,["isActive"]);return ce("div",m(h({},i),{ref:t,role:"tab","aria-selected":r,className:b("graphiql-tab",r&&"graphiql-tab-active",i.className),children:i.children}))}));Gb.displayName="Tab";const zb=(0,t.forwardRef)(((e,t)=>ce(is,m(h({},e),{ref:t,type:"button",className:b("graphiql-tab-button",e.className),children:e.children}))));zb.displayName="Tab.Button";const Wb=(0,t.forwardRef)(((e,t)=>ce(Fb,{label:"Close Tab",children:ce(is,m(h({"aria-label":"Close Tab"},e),{ref:t,type:"button",className:b("graphiql-tab-close",e.className),children:ce(Da,{})}))})));Wb.displayName="Tab.Close";const Kb=Qc(Gb,{Button:zb,Close:Wb});e.aO=Kb;const Qb=(0,t.forwardRef)(((e,t)=>ce("div",m(h({},e),{ref:t,role:"tablist",className:b("graphiql-tabs",e.className),children:e.children}))));e.aP=Qb,Qb.displayName="Tabs";var Xb=Object.defineProperty,Yb=g(((e,t)=>Xb(e,"name",{value:t,configurable:!0})),"__name$C");const Jb=Q("HistoryContext");function Zb(e){var n;const r=ve(),i=(0,t.useRef)(new z(r||new q(null),e.maxHistoryLength||tE)),[o,a]=(0,t.useState)((null==(n=i.current)?void 0:n.queries)||[]),s=(0,t.useCallback)((e=>{let{query:t,variables:n,headers:r,operationName:o}=e;var s;null==(s=i.current)||s.updateHistory(t,n,r,o),a(i.current.queries)}),[]),l=(0,t.useCallback)((e=>{let{query:t,variables:n,headers:r,operationName:o,label:s,favorite:l}=e;i.current.editLabel(t,n,r,o,s,l),a(i.current.queries)}),[]),u=(0,t.useCallback)((e=>{let{query:t,variables:n,headers:r,operationName:o,label:s,favorite:l}=e;i.current.toggleFavorite(t,n,r,o,s,l),a(i.current.queries)}),[]),c=(0,t.useMemo)((()=>({addToHistory:s,editLabel:l,items:o,toggleFavorite:u})),[s,l,o,u]);return ce(Jb.Provider,{value:c,children:e.children})}e.X=Jb,g(Zb,"HistoryContextProvider"),Yb(Zb,"HistoryContextProvider");const eE=X(Jb);e.Z=eE;const tE=20;var nE=Object.defineProperty,rE=g(((e,t)=>nE(e,"name",{value:t,configurable:!0})),"__name$B");function iE(){const{items:e}=eE({nonNull:!0}),n=e.slice().reverse();return de("section",{"aria-label":"History",className:"graphiql-history",children:[ce("div",{className:"graphiql-history-header",children:"History"}),ce("ul",{className:"graphiql-history-items",children:n.map(((e,r)=>de(t.Fragment,{children:[ce(oE,{item:e}),e.favorite&&n[r+1]&&!n[r+1].favorite?ce("div",{className:"graphiql-history-item-spacer"}):null]},`${r}:${e.label||e.query}`)))})]})}function oE(e){const{editLabel:n,toggleFavorite:r}=eE({nonNull:!0,caller:oE}),{headerEditor:i,queryEditor:o,variableEditor:a}=iS({nonNull:!0,caller:oE}),s=(0,t.useRef)(null),l=(0,t.useRef)(null),[u,c]=(0,t.useState)(!1);(0,t.useEffect)((()=>{u&&s.current&&s.current.focus()}),[u]);const d=e.item.label||e.item.operationName||aE(e.item.query);return ce("li",{className:b("graphiql-history-item",u&&"editable"),children:de(fe,u?{children:[ce("input",{type:"text",defaultValue:e.item.label,ref:s,onKeyDown:t=>{27===t.keyCode?c(!1):13===t.keyCode&&(c(!1),n(m(h({},e.item),{label:t.currentTarget.value})))},placeholder:"Type a label"}),ce(is,{type:"button",ref:l,onClick:()=>{var t;c(!1),n(m(h({},e.item),{label:null==(t=s.current)?void 0:t.value}))},children:"Save"}),ce(is,{type:"button",ref:l,onClick:()=>{c(!1)},children:ce(Da,{})})]}:{children:[ce(is,{type:"button",className:"graphiql-history-item-label",onClick:()=>{var t,n,r;null==o||o.setValue(null!=(t=e.item.query)?t:""),null==a||a.setValue(null!=(n=e.item.variables)?n:""),null==i||i.setValue(null!=(r=e.item.headers)?r:"")},children:d}),ce(Fb,{label:"Edit label",children:ce(is,{type:"button",className:"graphiql-history-item-action",onClick:e=>{e.stopPropagation(),c(!0)},"aria-label":"Edit label",children:ce(za,{"aria-hidden":"true"})})}),ce(Fb,{label:e.item.favorite?"Remove favorite":"Add favorite",children:ce(is,{type:"button",className:"graphiql-history-item-action",onClick:t=>{t.stopPropagation(),r(e.item)},"aria-label":e.item.favorite?"Remove favorite":"Add favorite",children:e.item.favorite?ce(Za,{"aria-hidden":"true"}):ce(es,{"aria-hidden":"true"})})})]})})}function aE(e){return null==e?void 0:e.split("\n").map((e=>e.replace(/#(.*)/,""))).join(" ").replaceAll("{"," { ").replaceAll("}"," } ").replaceAll(/[\s]{2,}/g," ")}g(iE,"History"),rE(iE,"History"),g(oE,"HistoryItem"),rE(oE,"HistoryItem"),g(aE,"formatQuery"),rE(aE,"formatQuery");var sE=Object.defineProperty,lE=g(((e,t)=>sE(e,"name",{value:t,configurable:!0})),"__name$A");const uE=Q("ExecutionContext");function cE(e){let{fetcher:n,getDefaultFieldNames:i,children:o,operationName:a}=e;if(!n)throw new TypeError("The `ExecutionContextProvider` component requires a `fetcher` function to be passed as prop.");const{externalFragments:s,headerEditor:l,queryEditor:u,responseEditor:c,variableEditor:d,updateActiveTabValues:f}=iS({nonNull:!0,caller:cE}),p=eE(),m=dC({getDefaultFieldNames:i,caller:cE}),[g,y]=(0,t.useState)(!1),[b,E]=(0,t.useState)(null),T=(0,t.useRef)(0),S=(0,t.useCallback)((()=>{null==b||b.unsubscribe(),y(!1),E(null)}),[b]),x=(0,t.useCallback)((async()=>{var e,t;if(!u||!c)return;if(b)return void S();const i=lE((e=>{c.setValue(e),f({response:e})}),"setResponse");T.current+=1;const o=T.current;let g=m()||u.getValue();const x=null==d?void 0:d.getValue();let N;try{N=fE({json:x,errorMessageParse:"Variables are invalid JSON",errorMessageType:"Variables are not a JSON object."})}catch(e){return void i(e instanceof Error?e.message:`${e}`)}const k=null==l?void 0:l.getValue();let _;try{_=fE({json:k,errorMessageParse:"Headers are invalid JSON",errorMessageType:"Headers are not a JSON object."})}catch(e){return void i(e instanceof Error?e.message:`${e}`)}if(s){const e=u.documentAST?ko(u.documentAST,s):[];e.length>0&&(g+="\n"+e.map((e=>(0,r.print)(e))).join("\n"))}i(""),y(!0);const O=null!=(e=null!=a?a:u.operationName)?e:void 0;null==p||p.addToHistory({query:g,variables:x,headers:k,operationName:O});try{let e={data:{}};const r=lE((t=>{if(o!==T.current)return;let n=!!Array.isArray(t)&&t;if(!n&&"object"==typeof t&&null!==t&&"hasNext"in t&&(n=[t]),n){const t={data:e.data},r=[...(null==e?void 0:e.errors)||[],...n.flatMap((e=>e.errors)).filter(Boolean)];r.length&&(t.errors=r);for(const r of n){const n=r,{path:i,data:o,errors:a}=n,s=v(n,["path","data","errors"]);if(i){if(!o)throw new Error(`Expected part to contain a data property, but got ${r}`);Ko(t.data,i,o,{merge:!0})}else o&&(t.data=o);e=h(h({},t),s)}y(!1),i(D(e))}else{const e=D(t);y(!1),i(e)}}),"handleResponse"),a=n({query:g,variables:N,operationName:O},{headers:null!=_?_:void 0,documentAST:null!=(t=u.documentAST)?t:void 0}),s=await Promise.resolve(a);if(w(s))E(s.subscribe({next(e){r(e)},error(e){y(!1),e&&i(I(e)),E(null)},complete(){y(!1),E(null)}}));else if(C(s)){E({unsubscribe:()=>{var e,t;return null==(t=(e=s[Symbol.asyncIterator]()).return)?void 0:t.call(e)}});for await(const e of s)r(e);y(!1),E(null)}else r(s)}catch(e){y(!1),i(I(e)),E(null)}}),[m,s,n,l,p,a,u,c,S,b,f,d]),N=Boolean(b),k=(0,t.useMemo)((()=>({isFetching:g,isSubscribed:N,operationName:null!=a?a:null,run:x,stop:S})),[g,N,a,x,S]);return ce(uE.Provider,{value:k,children:o})}e.r=uE,g(cE,"ExecutionContextProvider"),lE(cE,"ExecutionContextProvider");const dE=X(uE);function fE(e){let t,{json:n,errorMessageParse:r,errorMessageType:i}=e;try{t=n&&""!==n.trim()?JSON.parse(n):void 0}catch(e){throw new Error(`${r}: ${e instanceof Error?e.message:e}.`)}const o="object"==typeof t&&null!==t&&!Array.isArray(t);if(void 0!==t&&!o)throw new Error(i);return t}e.v=dE,g(fE,"tryParseJsonObject"),lE(fE,"tryParseJsonObject");var pE=Object.defineProperty,hE=g(((e,t)=>pE(e,"name",{value:t,configurable:!0})),"__name$z");const mE="graphiql",gE="sublime";let vE=!1;"object"==typeof window&&(vE=0===window.navigator.platform.toLowerCase().indexOf("mac"));const yE={[vE?"Cmd-F":"Ctrl-F"]:"findPersistent","Cmd-G":"findPersistent","Ctrl-G":"findPersistent","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"};async function bE(e,t){const r=await Promise.resolve().then(n.t.bind(n,535,23)).then((function(e){return e.c})).then((e=>"function"==typeof e?e:e.default));return await Promise.all(!1===(null==t?void 0:t.useCommonAddons)?e:[Promise.resolve().then(n.t.bind(n,6980,23)).then((function(e){return e.s})),Promise.resolve().then(n.t.bind(n,9171,23)).then((function(e){return e.m})),Promise.resolve().then(n.t.bind(n,5728,23)).then((function(e){return e.c})),Promise.resolve().then(n.t.bind(n,4468,23)).then((function(e){return e.b})),Promise.resolve().then(n.t.bind(n,8419,23)).then((function(e){return e.f})),Promise.resolve().then(n.t.bind(n,4054,23)).then((function(e){return e.l})),Promise.resolve().then(n.t.bind(n,9407,23)).then((function(e){return e.s})),Promise.resolve().then(n.t.bind(n,4471,23)).then((function(e){return e.j})),Promise.resolve().then(n.t.bind(n,8058,23)).then((function(e){return e.d})),Promise.resolve().then(n.t.bind(n,2568,23)).then((function(e){return e.s})),...e]),r}g(bE,"importCodeMirror"),hE(bE,"importCodeMirror");var EE=g((function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;rNE(e,"name",{value:t,configurable:!0})),"__name$y");const _E=kE((e=>e?(0,r.print)(e):""),"printDefault");function OE(e){let{field:t}=e;if(!("defaultValue"in t)||void 0===t.defaultValue)return null;const n=(0,r.astFromValue)(t.defaultValue,t.type);return n?de(fe,{children:[" = ",ce("span",{className:"graphiql-doc-explorer-default-value",children:_E(n)})]}):null}g(OE,"DefaultValue"),kE(OE,"DefaultValue");var IE=Object.defineProperty,DE=g(((e,t)=>IE(e,"name",{value:t,configurable:!0})),"__name$x");const LE=Q("SchemaContext");function AE(e){if(!e.fetcher)throw new TypeError("The `SchemaContextProvider` component requires a `fetcher` function to be passed as prop.");const{initialHeaders:n,headerEditor:i}=iS({nonNull:!0,caller:AE}),[o,a]=(0,t.useState)(),[s,l]=(0,t.useState)(!1),[u,c]=(0,t.useState)(null),d=(0,t.useRef)(0);(0,t.useEffect)((()=>{a((0,r.isSchema)(e.schema)||null===e.schema||void 0===e.schema?e.schema:void 0),d.current++}),[e.schema]);const f=(0,t.useRef)(n);(0,t.useEffect)((()=>{i&&(f.current=i.getValue())}));const{introspectionQuery:p,introspectionQueryName:h,introspectionQuerySansSubscriptions:m}=RE({inputValueDeprecation:e.inputValueDeprecation,introspectionQueryName:e.introspectionQueryName,schemaDescription:e.schemaDescription}),{fetcher:v,onSchemaChange:y,dangerouslyAssumeSchemaIsValid:b,children:T}=e,w=(0,t.useCallback)((()=>{if((0,r.isSchema)(e.schema)||null===e.schema)return;const t=++d.current,n=e.schema;async function i(){if(n)return n;const e=FE(f.current);if(!e.isValidJSON)return void c("Introspection failed as headers are invalid.");const t=e.headers?{headers:e.headers}:{},r=x(v({query:p,operationName:h},t));if(!E(r))return void c("Fetcher did not return a Promise for introspection.");l(!0),c(null);let i=await r;if("object"!=typeof i||null===i||!("data"in i)){const e=x(v({query:m,operationName:h},t));if(!E(e))throw new Error("Fetcher did not return a Promise for introspection.");i=await e}if(l(!1),(null==i?void 0:i.data)&&"__schema"in i.data)return i.data;const o="string"==typeof i?i:D(i);c(o)}g(i,"fetchIntrospectionData"),DE(i,"fetchIntrospectionData"),i().then((e=>{if(t===d.current&&e)try{const t=(0,r.buildClientSchema)(e);a(t),null==y||y(t)}catch(e){c(I(e))}})).catch((e=>{t===d.current&&(c(I(e)),l(!1))}))}),[v,h,p,m,y,e.schema]);(0,t.useEffect)((()=>{w()}),[w]),(0,t.useEffect)((()=>{function e(e){82===e.keyCode&&e.shiftKey&&e.ctrlKey&&w()}return g(e,"triggerIntrospection"),DE(e,"triggerIntrospection"),window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}));const C=(0,t.useMemo)((()=>!o||b?[]:(0,r.validateSchema)(o)),[o,b]),S=(0,t.useMemo)((()=>({fetchError:u,introspect:w,isFetching:s,schema:o,validationErrors:C})),[u,w,s,o,C]);return ce(LE.Provider,{value:S,children:T})}e.a4=LE,g(AE,"SchemaContextProvider"),DE(AE,"SchemaContextProvider");const ME=X(LE);function RE(e){let{inputValueDeprecation:n,introspectionQueryName:i,schemaDescription:o}=e;return(0,t.useMemo)((()=>{const e=i||"IntrospectionQuery";let t=(0,r.getIntrospectionQuery)({inputValueDeprecation:n,schemaDescription:o});i&&(t=t.replace("query IntrospectionQuery",`query ${e}`));const a=t.replace("subscriptionType { name }","");return{introspectionQueryName:e,introspectionQuery:t,introspectionQuerySansSubscriptions:a}}),[n,i,o])}function FE(e){let t=null,n=!0;try{e&&(t=JSON.parse(e))}catch{n=!1}return{headers:t,isValidJSON:n}}e.a6=ME,g(RE,"useIntrospectionQuery"),DE(RE,"useIntrospectionQuery"),g(FE,"parseHeaderString"),DE(FE,"parseHeaderString");var PE=Object.defineProperty,jE=g(((e,t)=>PE(e,"name",{value:t,configurable:!0})),"__name$w");const VE={name:"Docs"},UE=Q("ExplorerContext");function BE(e){const{schema:n,validationErrors:i}=ME({nonNull:!0,caller:BE}),[o,a]=(0,t.useState)([VE]),s=(0,t.useCallback)((e=>{a((t=>t.at(-1).def===e.def?t:[...t,e]))}),[]),l=(0,t.useCallback)((()=>{a((e=>e.length>1?e.slice(0,-1):e))}),[]),u=(0,t.useCallback)((()=>{a((e=>1===e.length?e:[VE]))}),[]);(0,t.useEffect)((()=>{null==n||i.length>0?u():a((e=>{if(1===e.length)return e;const t=[VE];let i=null;for(const o of e)if(o!==VE)if(o.def)if((0,r.isNamedType)(o.def)){const e=n.getType(o.def.name);if(!e)break;t.push({name:o.name,def:e}),i=e}else{if(null===i)break;if((0,r.isObjectType)(i)||(0,r.isInputObjectType)(i)){const e=i.getFields()[o.name];if(!e)break;t.push({name:o.name,def:e})}else{if((0,r.isScalarType)(i)||(0,r.isEnumType)(i)||(0,r.isInterfaceType)(i)||(0,r.isUnionType)(i))break;{const e=i;if(!e.args.find((e=>e.name===o.name)))break;t.push({name:o.name,def:e})}}}else i=null,t.push(o);return t}))}),[u,n,i]);const c=(0,t.useMemo)((()=>({explorerNavStack:o,push:s,pop:l,reset:u})),[o,s,l,u]);return ce(UE.Provider,{value:c,children:e.children})}e.z=UE,g(BE,"ExplorerContextProvider"),jE(BE,"ExplorerContextProvider");const $E=X(UE);e.U=$E;var qE=Object.defineProperty,HE=g(((e,t)=>qE(e,"name",{value:t,configurable:!0})),"__name$v");function GE(e,t){return(0,r.isNonNullType)(e)?de(fe,{children:[GE(e.ofType,t),"!"]}):(0,r.isListType)(e)?de(fe,{children:["[",GE(e.ofType,t),"]"]}):t(e)}g(GE,"renderType"),HE(GE,"renderType");var zE=Object.defineProperty,WE=g(((e,t)=>zE(e,"name",{value:t,configurable:!0})),"__name$u");function KE(e){const{push:t}=$E({nonNull:!0,caller:KE});return e.type?GE(e.type,(e=>ce("a",{className:"graphiql-doc-explorer-type-name",onClick:n=>{n.preventDefault(),t({name:e.name,def:e})},href:"#",children:e.name}))):null}g(KE,"TypeLink"),WE(KE,"TypeLink");var QE=Object.defineProperty,XE=g(((e,t)=>QE(e,"name",{value:t,configurable:!0})),"__name$t");function YE(e){let{arg:t,showDefaultValue:n,inline:r}=e;const i=de("span",{children:[ce("span",{className:"graphiql-doc-explorer-argument-name",children:t.name}),": ",ce(KE,{type:t.type}),!1!==n&&ce(OE,{field:t})]});return r?i:de("div",{className:"graphiql-doc-explorer-argument",children:[i,t.description?ce(nb,{type:"description",children:t.description}):null,t.deprecationReason?de("div",{className:"graphiql-doc-explorer-argument-deprecation",children:[ce("div",{className:"graphiql-doc-explorer-argument-deprecation-label",children:"Deprecated"}),ce(nb,{type:"deprecation",children:t.deprecationReason})]}):null]})}g(YE,"Argument"),XE(YE,"Argument");var JE=Object.defineProperty,ZE=g(((e,t)=>JE(e,"name",{value:t,configurable:!0})),"__name$s");function eT(e){return e.children?de("div",{className:"graphiql-doc-explorer-deprecation",children:[ce("div",{className:"graphiql-doc-explorer-deprecation-label",children:"Deprecated"}),ce(nb,{type:"deprecation",onlyShowFirstChild:!0,children:e.children})]}):null}g(eT,"DeprecationReason"),ZE(eT,"DeprecationReason");var tT=Object.defineProperty,nT=g(((e,t)=>tT(e,"name",{value:t,configurable:!0})),"__name$r");function rT(e){let{directive:t}=e;return de("span",{className:"graphiql-doc-explorer-directive",children:["@",t.name.value]})}g(rT,"Directive"),nT(rT,"Directive");var iT=Object.defineProperty,oT=g(((e,t)=>iT(e,"name",{value:t,configurable:!0})),"__name$q");function aT(e){const t=sT[e.title];return de("div",{children:[de("div",{className:"graphiql-doc-explorer-section-title",children:[ce(t,{}),e.title]}),ce("div",{className:"graphiql-doc-explorer-section-content",children:e.children})]})}g(aT,"ExplorerSection"),oT(aT,"ExplorerSection");const sT={Arguments:ka,"Deprecated Arguments":Aa,"Deprecated Enum Values":Ma,"Deprecated Fields":Ra,Directives:Fa,"Enum Values":Va,Fields:Ua,Implements:$a,Implementations:ns,"Possible Types":ns,"Root Types":Ya,Type:ns};var lT=Object.defineProperty,uT=g(((e,t)=>lT(e,"name",{value:t,configurable:!0})),"__name$p");function cT(e){return de(fe,{children:[e.field.description?ce(nb,{type:"description",children:e.field.description}):null,ce(eT,{children:e.field.deprecationReason}),ce(aT,{title:"Type",children:ce(KE,{type:e.field.type})}),ce(dT,{field:e.field}),ce(fT,{field:e.field})]})}function dT(e){let{field:n}=e;const[r,i]=(0,t.useState)(!1);if(!("args"in n))return null;const o=[],a=[];for(const e of n.args)e.deprecationReason?a.push(e):o.push(e);return de(fe,{children:[o.length>0?ce(aT,{title:"Arguments",children:o.map((e=>ce(YE,{arg:e},e.name)))}):null,a.length>0?r||0===o.length?ce(aT,{title:"Deprecated Arguments",children:a.map((e=>ce(YE,{arg:e},e.name)))}):ce(os,{type:"button",onClick:()=>{i(!0)},children:"Show Deprecated Arguments"}):null]})}function fT(e){let{field:t}=e;var n;const r=(null==(n=t.astNode)?void 0:n.directives)||[];return r&&0!==r.length?ce(aT,{title:"Directives",children:r.map((e=>ce("div",{children:ce(rT,{directive:e})},e.name.value)))}):null}g(cT,"FieldDocumentation"),uT(cT,"FieldDocumentation"),g(dT,"Arguments"),uT(dT,"Arguments"),g(fT,"Directives"),uT(fT,"Directives");var pT=Object.defineProperty,hT=g(((e,t)=>pT(e,"name",{value:t,configurable:!0})),"__name$o");function mT(e){var t,n,r,i;const o=e.schema.getQueryType(),a=null==(n=(t=e.schema).getMutationType)?void 0:n.call(t),s=null==(i=(r=e.schema).getSubscriptionType)?void 0:i.call(r);return de(fe,{children:[ce(nb,{type:"description",children:e.schema.description||"A GraphQL schema provides a root type for each kind of operation."}),de(aT,{title:"Root Types",children:[o?de("div",{children:[ce("span",{className:"graphiql-doc-explorer-root-type",children:"query"}),": ",ce(KE,{type:o})]}):null,a&&de("div",{children:[ce("span",{className:"graphiql-doc-explorer-root-type",children:"mutation"}),": ",ce(KE,{type:a})]}),s&&de("div",{children:[ce("span",{className:"graphiql-doc-explorer-root-type",children:"subscription"}),": ",ce(KE,{type:s})]})]})]})}function gT(e,n){var r=(0,t.useRef)(!1);(0,t.useEffect)((function(){r.current?e():r.current=!0}),n)}function vT(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function yT(){return yT=Object.assign||function(e){for(var t=1;tl&&e.push({highlight:!1,start:l,end:u}),o.index===s.lastIndex&&s.lastIndex++}return e}),[])}function wT(e){var t=e.chunksToHighlight,n=e.totalLength,r=[];if(0===t.length)o(0,n,!1);else{var i=0;t.forEach((function(e){o(i,e.start,!1),o(e.start,e.end,!0),i=e.end})),o(i,n,!1)}return r;function o(e,t,n){t-e>0&&r.push({start:e,end:t,highlight:n})}}function CT(e){return e}function ST(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}g(mT,"SchemaDocumentation"),hT(mT,"SchemaDocumentation"),g(gT,"useUpdateEffect"),g(vT,"_objectWithoutPropertiesLoose"),g(yT,"_extends"),g(bT,"findAll"),g(ET,"combineChunks"),g(TT,"defaultFindChunks"),g(wT,"fillInChunks"),g(CT,"defaultSanitize"),g(ST,"escapeRegExpFn");var xT,NT,kT,_T,OT,IT={combineChunks:ET,fillInChunks:wT,findAll:bT,findChunks:TT},DT=["onSelect","openOnFocus","children","as","aria-label","aria-labelledby"],LT=["as","selectOnClick","autocomplete","onClick","onChange","onKeyDown","onBlur","onFocus","value"],AT=["as","children","portal","onKeyDown","onBlur","position"],MT=["persistSelection","as"],RT=["as","children","index","value","onClick"],FT="IDLE",PT="SUGGESTING",jT="NAVIGATING",VT="INTERACTING",UT="CLEAR",BT="CHANGE",$T="INITIAL_CHANGE",qT="NAVIGATE",HT="SELECT_WITH_KEYBOARD",GT="SELECT_WITH_CLICK",zT="ESCAPE",WT="BLUR",KT="INTERACT",QT="FOCUS",XT="OPEN_WITH_BUTTON",YT="OPEN_WITH_INPUT_CLICK",JT="CLOSE_WITH_BUTTON",ZT={initial:FT,states:(OT={},OT[FT]={on:(xT={},xT[WT]=FT,xT[UT]=FT,xT[BT]=PT,xT[$T]=FT,xT[QT]=PT,xT[qT]=jT,xT[XT]=PT,xT[YT]=PT,xT)},OT[PT]={on:(NT={},NT[BT]=PT,NT[QT]=PT,NT[qT]=jT,NT[UT]=FT,NT[zT]=FT,NT[WT]=FT,NT[GT]=FT,NT[KT]=VT,NT[JT]=FT,NT)},OT[jT]={on:(kT={},kT[BT]=PT,kT[QT]=PT,kT[UT]=FT,kT[WT]=FT,kT[zT]=FT,kT[qT]=jT,kT[GT]=FT,kT[HT]=FT,kT[JT]=FT,kT[KT]=VT,kT)},OT[VT]={on:(_T={},_T[UT]=FT,_T[BT]=PT,_T[QT]=PT,_T[WT]=FT,_T[zT]=FT,_T[qT]=jT,_T[JT]=FT,_T[GT]=FT,_T)},OT)},ew=g((function(e,t){var n=yT({},e,{lastEventType:t.type});switch(t.type){case BT:case $T:return yT({},n,{navigationValue:null,value:t.value});case qT:case XT:case YT:return yT({},n,{navigationValue:nw(n,t)});case UT:return yT({},n,{value:"",navigationValue:null});case WT:case zT:return yT({},n,{navigationValue:null});case GT:return yT({},n,{value:t.isControlled?e.value:t.value,navigationValue:null});case HT:return yT({},n,{value:t.isControlled?e.value:e.navigationValue,navigationValue:null});case JT:return yT({},n,{navigationValue:null});case KT:return n;case QT:return yT({},n,{navigationValue:nw(n,t)});default:return n}}),"reducer");function tw(e){return[PT,jT,VT].includes(e)}function nw(e,t){return t.value?t.value:t.persistSelection?e.value:null}g(tw,"popoverIsExpanded"),g(nw,"findNavigationValue");var rw=Gd(),iw=of(0,{}),ow=of(0,{}),aw=(0,t.forwardRef)((function(e,n){var r,i=e.onSelect,o=e.openOnFocus,a=void 0!==o&&o,s=e.children,l=e.as,u=void 0===l?"div":l,c=e["aria-label"],d=e["aria-labelledby"],f=vT(e,DT),p=Wd(),h=p[0],m=p[1],g=(0,t.useRef)(),v=(0,t.useRef)(),y=(0,t.useRef)(),b=(0,t.useRef)(!1),E=(0,t.useRef)(!1),T=mw(ZT,ew,{value:"",navigationValue:null}),w=T[0],C=T[1],S=T[2];fw(C.lastEventType,g);var x=nd(f.id),N=x?sf("listbox",x):"listbox",k=(0,t.useRef)(!1),_=tw(w),O={ariaLabel:c,ariaLabelledby:d,autocompletePropRef:b,buttonRef:y,comboboxId:x,data:C,inputRef:g,isExpanded:_,listboxId:N,onSelect:i||ys,openOnFocus:a,persistSelectionRef:E,popoverRef:v,state:w,transition:S,isControlledRef:k};return(0,t.createElement)(Qd,{context:rw,items:h,set:m},(0,t.createElement)(iw.Provider,{value:O},(0,t.createElement)(u,yT({},f,{"data-reach-combobox":"","data-state":vw(w),"data-expanded":_||void 0,ref:n}),gs(s)?s({id:x,isExpanded:_,navigationValue:null!=(r=C.navigationValue)?r:null,state:w}):s)))})),sw=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"input":r,o=e.selectOnClick,a=void 0!==o&&o,s=e.autocomplete,l=void 0===s||s,u=e.onClick,c=e.onChange,d=e.onKeyDown,f=e.onBlur,p=e.onFocus,h=e.value,m=vT(e,LT),v=(0,t.useRef)(h).current,y=(0,t.useRef)(!1);gT((function(){y.current=!0}),[h]);var b=(0,t.useContext)(iw),E=b.data,T=E.navigationValue,w=E.value,C=E.lastEventType,S=b.inputRef,x=b.state,N=b.transition,k=b.listboxId,_=b.autocompletePropRef,O=b.openOnFocus,I=b.isExpanded,D=b.ariaLabel,L=b.ariaLabelledby,A=b.persistSelectionRef,M=b.isControlledRef,R=Cs(S,n),F=(0,t.useRef)(!1),P=pw(),j=hw(),V=void 0!==h;(0,t.useEffect)((function(){M.current=V}),[V]),ls((function(){_.current=l}),[l,_]);var U=(0,t.useCallback)((function(e){""===e.trim()?N(UT,{isControlled:V}):e!==v||y.current?N(BT,{value:e}):N($T,{value:e})}),[v,N,V]);function B(e){var t=e.target.value;V||U(t)}function $(){a&&(F.current=!0),O&&C!==GT&&N(QT,{persistSelection:A.current})}function q(){var e;F.current&&(F.current=!1,null==(e=S.current)||e.select()),O&&x===FT&&N(YT)}(0,t.useEffect)((function(){!V||h===w||""===h.trim()&&""===(w||"").trim()||U(h)}),[h,U,V,w]),g(B,"handleChange"),g($,"handleFocus"),g(q,"handleClick");var H=!l||x!==jT&&x!==VT?h||w:T||h||w;return(0,t.createElement)(i,yT({"aria-activedescendant":T?String(gw(T)):void 0,"aria-autocomplete":"both","aria-controls":k,"aria-expanded":I,"aria-haspopup":"listbox","aria-label":D,"aria-labelledby":D?void 0:L,role:"combobox"},m,{"data-reach-combobox-input":"","data-state":vw(x),ref:R,onBlur:Ss(f,j),onChange:Ss(c,B),onClick:Ss(u,q),onFocus:Ss(p,$),onKeyDown:Ss(d,P),value:H||""}))})),lw=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"div":r,o=e.children,a=e.portal,s=void 0===a||a,l=e.onKeyDown,u=e.onBlur,c=e.position,d=void 0===c?Vd:c,f=vT(e,AT),p=(0,t.useContext)(iw),h=p.popoverRef,m=p.inputRef,g=p.isExpanded,v=p.state,y=Cs(h,n),b=pw(),E=hw(),T={"data-reach-combobox-popover":"","data-state":vw(v),onKeyDown:Ss(l,b),onBlur:Ss(u,E),hidden:!g,tabIndex:-1,children:o};return s?(0,t.createElement)(Md,yT({as:i},f,{ref:y,"data-expanded":g||void 0,position:d,targetRef:m,unstable_skipInitialPortalRender:!0},T)):(0,t.createElement)(i,yT({ref:y},f,T))})),uw=(0,t.forwardRef)((function(e,n){var r=e.persistSelection,i=void 0!==r&&r,o=e.as,a=void 0===o?"ul":o,s=vT(e,MT),l=(0,t.useContext)(iw),u=l.persistSelectionRef,c=l.listboxId;return i&&(u.current=!0),(0,t.createElement)(a,yT({role:"listbox"},s,{ref:n,"data-reach-combobox-list":"",id:c}))})),cw=(0,t.forwardRef)((function(e,n){var r=e.as,i=void 0===r?"li":r,o=e.children,a=e.index,s=e.value,l=e.onClick,u=vT(e,RT),c=(0,t.useContext)(iw),d=c.onSelect,f=c.data.navigationValue,p=c.transition,h=c.isControlledRef,m=lf((0,t.useRef)(null),null),v=m[0],y=m[1],b=zd((0,t.useMemo)((function(){return{element:v,value:s}}),[s,v]),rw,a),E=Cs(n,y),T=f===s,w=g((function(){d&&d(s),p(GT,{value:s,isControlled:h.current})}),"handleClick");return(0,t.createElement)(ow.Provider,{value:{value:s,index:b}},(0,t.createElement)(i,yT({"aria-selected":T,role:"option"},u,{"data-reach-combobox-option":"",ref:E,id:String(gw(s)),"data-highlighted":T?"":void 0,tabIndex:-1,onClick:Ss(l,w)}),o?gs(o)?o({value:s,index:b}):o:(0,t.createElement)(dw,null)))}));function dw(){var e=(0,t.useContext)(ow).value,n=(0,t.useContext)(iw).data.value,r=(0,t.useMemo)((function(){return IT.findAll({searchWords:yw(n||"").split(/\s+/),textToHighlight:e})}),[n,e]);return(0,t.createElement)(t.Fragment,null,r.length?r.map((function(n,r){var i=e.slice(n.start,n.end);return(0,t.createElement)("span",{key:r,"data-reach-combobox-option-text":"","data-user-value":!!n.highlight||void 0,"data-suggested-value":!n.highlight||void 0},i)})):e)}function fw(e,t){ls((function(){var n;e!==qT&&e!==zT&&e!==GT&&e!==XT||null==(n=t.current)||n.focus()}),[t,e])}function pw(){var e=(0,t.useContext)(iw),n=e.data.navigationValue,r=e.onSelect,i=e.state,o=e.transition,a=e.autocompletePropRef,s=e.persistSelectionRef,l=e.isControlledRef,u=Kd(rw);return g((function(e){var t=u.findIndex((function(e){return e.value===n}));function c(){return t===u.length-1?a.current?null:f():u[(t+1)%u.length]}function d(){return 0===t?a.current?null:p():-1===t?p():u[(t-1+u.length)%u.length]}function f(){return u[0]}function p(){return u[u.length-1]}switch(g(c,"getNextOption"),g(d,"getPreviousOption"),g(f,"getFirstOption"),g(p,"getLastOption"),e.key){case"ArrowDown":if(e.preventDefault(),!u||!u.length)return;if(i===FT)o(qT,{persistSelection:s.current});else{var h=c();o(qT,{value:h?h.value:null})}break;case"ArrowUp":if(e.preventDefault(),!u||0===u.length)return;if(i===FT)o(qT);else{var m=d();o(qT,{value:m?m.value:null})}break;case"Home":case"PageUp":if(e.preventDefault(),!u||0===u.length)return;i===FT?o(qT):o(qT,{value:f().value});break;case"End":case"PageDown":if(e.preventDefault(),!u||0===u.length)return;i===FT?o(qT):o(qT,{value:p().value});break;case"Escape":i!==FT&&o(zT);break;case"Enter":i===jT&&null!==n&&(e.preventDefault(),r&&r(n),o(HT,{isControlled:l.current}))}}),"handleKeyDown")}function hw(){var e=(0,t.useContext)(iw),n=e.state,r=e.transition,i=e.popoverRef,o=e.inputRef,a=e.buttonRef;return g((function(e){var t=i.current,s=o.current,l=a.current,u=e.relatedTarget;u!==s&&u!==l&&t&&(t.contains(u)?n!==VT&&r(KT):r(WT))}),"handleBlur")}function mw(e,n,r){var i=(0,t.useState)(e.initial),o=i[0],a=i[1],s=(0,t.useReducer)(n,r),l=s[0],u=s[1];return[o,l,g((function(t,n){void 0===n&&(n={});var r=e.states[o],i=r&&r.on[t];if(i)return u(yT({type:t,state:o,nextState:o},n)),void a(i)}),"transition")]}function gw(e){var t=0;if(0===e.length)return t;for(var n=0;nbw(e,"name",{value:t,configurable:!0})),"__name$n");function Tw(e,t){let n;return function(){for(var r=arguments.length,i=new Array(r),o=0;o{n=null,t(...i)}),e)}}g(Tw,"debounce"),Ew(Tw,"debounce");var ww=Object.defineProperty,Cw=g(((e,t)=>ww(e,"name",{value:t,configurable:!0})),"__name$m");function Sw(){const{explorerNavStack:e,push:n}=$E({nonNull:!0,caller:Sw}),i=(0,t.useRef)(null),o=(0,t.useRef)(null),a=xw(),[s,l]=(0,t.useState)(""),[u,c]=(0,t.useState)(a(s)),d=(0,t.useMemo)((()=>Tw(200,(e=>{c(a(e))}))),[a]);(0,t.useEffect)((()=>{d(s)}),[d,s]),(0,t.useEffect)((()=>{function e(e){e.metaKey&&75===e.keyCode&&i.current&&i.current.focus()}return g(e,"handleKeyDown"),Cw(e,"handleKeyDown"),window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[]);const f=e.at(-1);return 1===e.length||(0,r.isObjectType)(f.def)||(0,r.isInterfaceType)(f.def)||(0,r.isInputObjectType)(f.def)?de(aw,{"aria-label":`Search ${f.name}...`,onSelect:e=>{const t=e;n("field"in t?{name:t.field.name,def:t.field}:{name:t.type.name,def:t.type})},children:[de("div",{className:"graphiql-doc-explorer-search-input",onClick:()=>{i.current&&i.current.focus()},children:[ce(Ha,{}),ce(sw,{autocomplete:!1,onChange:e=>{l(e.target.value)},onKeyDown:e=>{if(!e.isDefaultPrevented()){const e=o.current;if(!e)return;window.requestAnimationFrame((()=>{const t=e.querySelector("[aria-selected=true]");if(!(t instanceof HTMLElement))return;const n=t.offsetTop-e.scrollTop,r=e.scrollTop+e.clientHeight-(t.offsetTop+t.clientHeight);r<0&&(e.scrollTop-=r),n<0&&(e.scrollTop+=n)}))}e.stopPropagation()},placeholder:"⌘ K",ref:i,value:s})]}),ce(lw,{portal:!1,ref:o,children:de(uw,{children:[u.within.map(((e,t)=>ce(cw,{index:t,value:e,children:ce(_w,{field:e.field,argument:e.argument})},`within-${t}`))),u.within.length>0&&u.types.length+u.fields.length>0?ce("div",{className:"graphiql-doc-explorer-search-divider",children:"Other results"}):null,u.types.map(((e,t)=>ce(cw,{index:u.within.length+t,value:e,children:ce(kw,{type:e.type})},`type-${t}`))),u.fields.map(((e,t)=>de(cw,{index:u.within.length+u.types.length+t,value:e,children:[ce(kw,{type:e.type}),".",ce(_w,{field:e.field,argument:e.argument})]},`field-${t}`))),u.within.length+u.types.length+u.fields.length===0?ce("div",{className:"graphiql-doc-explorer-search-empty",children:"No results found"}):null]})})]}):null}function xw(e){const{explorerNavStack:n}=$E({nonNull:!0,caller:e||xw}),{schema:i}=ME({nonNull:!0,caller:e||xw}),o=n.at(-1);return(0,t.useCallback)((e=>{const t={within:[],types:[],fields:[]};if(!i)return t;const n=o.def,a=i.getTypeMap();let s=Object.keys(a);n&&(s=s.filter((e=>e!==n.name)),s.unshift(n.name));for(const i of s){if(t.within.length+t.types.length+t.fields.length>=100)break;const o=a[i];if(n!==o&&Nw(i,e)&&t.types.push({type:o}),!(0,r.isObjectType)(o)&&!(0,r.isInterfaceType)(o)&&!(0,r.isInputObjectType)(o))continue;const s=o.getFields();for(const r in s){const i=s[r];let a;if(!Nw(r,e)){if(!("args"in i))continue;if(a=i.args.filter((t=>Nw(t.name,e))),0===a.length)continue}t[n===o?"within":"fields"].push(...a?a.map((e=>({type:o,field:i,argument:e}))):[{type:o,field:i}])}}return t}),[o.def,i])}function Nw(e,t){try{const n=t.replaceAll(/[^_0-9A-Za-z]/g,(e=>"\\"+e));return-1!==e.search(new RegExp(n,"i"))}catch{return e.toLowerCase().includes(t.toLowerCase())}}function kw(e){return ce("span",{className:"graphiql-doc-explorer-search-type",children:e.type.name})}function _w(e){return de(fe,{children:[ce("span",{className:"graphiql-doc-explorer-search-field",children:e.field.name}),e.argument?de(fe,{children:["(",ce("span",{className:"graphiql-doc-explorer-search-argument",children:e.argument.name}),":"," ",GE(e.argument.type,(e=>ce(kw,{type:e}))),")"]}):null]})}g(Sw,"Search"),Cw(Sw,"Search"),g(xw,"useSearchResults"),Cw(xw,"useSearchResults"),g(Nw,"isMatch"),Cw(Nw,"isMatch"),g(kw,"Type"),Cw(kw,"Type"),g(_w,"Field$1"),Cw(_w,"Field");var Ow=Object.defineProperty,Iw=g(((e,t)=>Ow(e,"name",{value:t,configurable:!0})),"__name$l");function Dw(e){const{push:t}=$E({nonNull:!0});return ce("a",{className:"graphiql-doc-explorer-field-name",onClick:n=>{n.preventDefault(),t({name:e.field.name,def:e.field})},href:"#",children:e.field.name})}g(Dw,"FieldLink"),Iw(Dw,"FieldLink");var Lw=Object.defineProperty,Aw=g(((e,t)=>Lw(e,"name",{value:t,configurable:!0})),"__name$k");function Mw(e){return(0,r.isNamedType)(e.type)?de(fe,{children:[e.type.description?ce(nb,{type:"description",children:e.type.description}):null,ce(Rw,{type:e.type}),ce(Fw,{type:e.type}),ce(jw,{type:e.type}),ce(Uw,{type:e.type})]}):null}function Rw(e){let{type:t}=e;return(0,r.isObjectType)(t)&&t.getInterfaces().length>0?ce(aT,{title:"Implements",children:t.getInterfaces().map((e=>ce("div",{children:ce(KE,{type:e})},e.name)))}):null}function Fw(e){let{type:n}=e;const[i,o]=(0,t.useState)(!1);if(!(0,r.isObjectType)(n)&&!(0,r.isInterfaceType)(n)&&!(0,r.isInputObjectType)(n))return null;const a=n.getFields(),s=[],l=[];for(const e of Object.keys(a).map((e=>a[e])))e.deprecationReason?l.push(e):s.push(e);return de(fe,{children:[s.length>0?ce(aT,{title:"Fields",children:s.map((e=>ce(Pw,{field:e},e.name)))}):null,l.length>0?i||0===s.length?ce(aT,{title:"Deprecated Fields",children:l.map((e=>ce(Pw,{field:e},e.name)))}):ce(os,{type:"button",onClick:()=>{o(!0)},children:"Show Deprecated Fields"}):null]})}function Pw(e){let{field:t}=e;const n="args"in t?t.args.filter((e=>!e.deprecationReason)):[];return de("div",{className:"graphiql-doc-explorer-item",children:[de("div",{children:[ce(Dw,{field:t}),n.length>0?de(fe,{children:["(",ce("span",{children:n.map((e=>1===n.length?ce(YE,{arg:e,inline:!0},e.name):ce("div",{className:"graphiql-doc-explorer-argument-multiple",children:ce(YE,{arg:e,inline:!0})},e.name)))}),")"]}):null,": ",ce(KE,{type:t.type}),ce(OE,{field:t})]}),t.description?ce(nb,{type:"description",onlyShowFirstChild:!0,children:t.description}):null,ce(eT,{children:t.deprecationReason})]})}function jw(e){let{type:n}=e;const[i,o]=(0,t.useState)(!1);if(!(0,r.isEnumType)(n))return null;const a=[],s=[];for(const e of n.getValues())e.deprecationReason?s.push(e):a.push(e);return de(fe,{children:[a.length>0?ce(aT,{title:"Enum Values",children:a.map((e=>ce(Vw,{value:e},e.name)))}):null,s.length>0?i||0===a.length?ce(aT,{title:"Deprecated Enum Values",children:s.map((e=>ce(Vw,{value:e},e.name)))}):ce(os,{type:"button",onClick:()=>{o(!0)},children:"Show Deprecated Values"}):null]})}function Vw(e){let{value:t}=e;return de("div",{className:"graphiql-doc-explorer-item",children:[ce("div",{className:"graphiql-doc-explorer-enum-value",children:t.name}),t.description?ce(nb,{type:"description",children:t.description}):null,t.deprecationReason?ce(nb,{type:"deprecation",children:t.deprecationReason}):null]})}function Uw(e){let{type:t}=e;const{schema:n}=ME({nonNull:!0});return n&&(0,r.isAbstractType)(t)?ce(aT,{title:(0,r.isInterfaceType)(t)?"Implementations":"Possible Types",children:n.getPossibleTypes(t).map((e=>ce("div",{children:ce(KE,{type:e})},e.name)))}):null}g(Mw,"TypeDocumentation"),Aw(Mw,"TypeDocumentation"),g(Rw,"ImplementsInterfaces"),Aw(Rw,"ImplementsInterfaces"),g(Fw,"Fields"),Aw(Fw,"Fields"),g(Pw,"Field"),Aw(Pw,"Field"),g(jw,"EnumValues"),Aw(jw,"EnumValues"),g(Vw,"EnumValue"),Aw(Vw,"EnumValue"),g(Uw,"PossibleTypes"),Aw(Uw,"PossibleTypes");var Bw=Object.defineProperty,$w=g(((e,t)=>Bw(e,"name",{value:t,configurable:!0})),"__name$j");function qw(){const{fetchError:e,isFetching:t,schema:n,validationErrors:i}=ME({nonNull:!0,caller:qw}),{explorerNavStack:o,pop:a}=$E({nonNull:!0,caller:qw}),s=o.at(-1);let l,u=null;return e?u=ce("div",{className:"graphiql-doc-explorer-error",children:"Error fetching schema"}):i.length>0?u=de("div",{className:"graphiql-doc-explorer-error",children:["Schema is invalid: ",i[0].message]}):t?u=ce(rb,{}):n?1===o.length?u=ce(mT,{schema:n}):(0,r.isType)(s.def)?u=ce(Mw,{type:s.def}):s.def&&(u=ce(cT,{field:s.def})):u=ce("div",{className:"graphiql-doc-explorer-error",children:"No GraphQL schema available"}),o.length>1&&(l=o.at(-2).name),de("section",{className:"graphiql-doc-explorer","aria-label":"Documentation Explorer",children:[de("div",{className:"graphiql-doc-explorer-header",children:[de("div",{className:"graphiql-doc-explorer-header-content",children:[l&&de("a",{href:"#",className:"graphiql-doc-explorer-back",onClick:e=>{e.preventDefault(),a()},"aria-label":`Go back to ${l}`,children:[ce(Oa,{}),l]}),ce("div",{className:"graphiql-doc-explorer-title",children:s.name})]}),ce("div",{className:"graphiql-doc-explorer-search",children:ce(Sw,{},s.name)})]}),ce("div",{className:"graphiql-doc-explorer-content",children:u})]})}g(qw,"DocExplorer"),$w(qw,"DocExplorer");var Hw=Object.defineProperty,Gw=g(((e,t)=>Hw(e,"name",{value:t,configurable:!0})),"__name$i");const zw={title:"Documentation Explorer",icon:Gw(g((function(){const e=Xw();return(null==e?void 0:e.visiblePlugin)===zw?ce(Pa,{}):ce(ja,{})}),"Icon"),"Icon"),content:qw};e._=zw;const Ww={title:"History",icon:Ba,content:iE};e.$=Ww;const Kw=Q("PluginContext");function Qw(e){const n=ve(),r=$E(),i=eE(),o=Boolean(r),a=Boolean(i),s=(0,t.useMemo)((()=>{const t=[],n={};o&&(t.push(zw),n[zw.title]=!0),a&&(t.push(Ww),n[Ww.title]=!0);for(const r of e.plugins||[]){if("string"!=typeof r.title||!r.title)throw new Error("All GraphiQL plugins must have a unique title");if(n[r.title])throw new Error(`All GraphiQL plugins must have a unique title, found two plugins with the title '${r.title}'`);t.push(r),n[r.title]=!0}return t}),[o,a,e.plugins]),[l,u]=(0,t.useState)((()=>{const t=null==n?void 0:n.get(Yw);return s.find((e=>e.title===t))||(t&&(null==n||n.set(Yw,"")),e.visiblePlugin&&s.find((t=>("string"==typeof e.visiblePlugin?t.title:t)===e.visiblePlugin))||null)})),{onTogglePluginVisibility:c,children:d}=e,f=(0,t.useCallback)((e=>{const t=e&&s.find((t=>("string"==typeof e?t.title:t)===e))||null;u((e=>t===e?e:(null==c||c(t),t)))}),[c,s]);(0,t.useEffect)((()=>{e.visiblePlugin&&f(e.visiblePlugin)}),[s,e.visiblePlugin,f]);const p=(0,t.useMemo)((()=>({plugins:s,setVisiblePlugin:f,visiblePlugin:l})),[s,f,l]);return ce(Kw.Provider,{value:p,children:d})}e.a0=Kw,g(Qw,"PluginContextProvider"),Gw(Qw,"PluginContextProvider");const Xw=X(Kw);e.a2=Xw;const Yw="visiblePlugin";var Jw=Object.defineProperty,Zw=g(((e,t)=>Jw(e,"name",{value:t,configurable:!0})),"__name$h");function eC(e,t,n,i,o,a){function s(e){if(!(n&&i&&o&&e.currentTarget instanceof HTMLElement))return;const t=e.currentTarget.innerText,r=n.getType(t);r&&(o.setVisiblePlugin(zw),i.push({name:r.name,def:r}),null==a||a(r))}bE([],{useCommonAddons:!1}).then((e=>{let n,i,o,a,l,u,c,d,f;e.on(t,"select",((e,t)=>{if(!n){const e=t.parentNode;n=document.createElement("div"),n.className="CodeMirror-hint-information",e.appendChild(n);const r=document.createElement("header");r.className="CodeMirror-hint-information-header",n.appendChild(r),i=document.createElement("span"),i.className="CodeMirror-hint-information-field-name",r.appendChild(i),o=document.createElement("span"),o.className="CodeMirror-hint-information-type-name-pill",r.appendChild(o),a=document.createElement("span"),o.appendChild(a),l=document.createElement("a"),l.className="CodeMirror-hint-information-type-name",l.href="javascript:void 0",l.addEventListener("click",s),o.appendChild(l),u=document.createElement("span"),o.appendChild(u),c=document.createElement("div"),c.className="CodeMirror-hint-information-description",n.appendChild(c),d=document.createElement("div"),d.className="CodeMirror-hint-information-deprecation",n.appendChild(d);const p=document.createElement("span");p.className="CodeMirror-hint-information-deprecation-label",p.innerText="Deprecated",d.appendChild(p),f=document.createElement("div"),f.className="CodeMirror-hint-information-deprecation-reason",d.appendChild(f);const h=parseInt(window.getComputedStyle(n).paddingBottom.replace(/px$/,""),10)||0,m=parseInt(window.getComputedStyle(n).maxHeight.replace(/px$/,""),10)||0,g=Zw((()=>{n&&(n.style.paddingTop=e.scrollTop+h+"px",n.style.maxHeight=e.scrollTop+m+"px")}),"handleScroll");let v;e.addEventListener("scroll",g),e.addEventListener("DOMNodeRemoved",v=Zw((t=>{t.target===e&&(e.removeEventListener("scroll",g),e.removeEventListener("DOMNodeRemoved",v),n&&n.removeEventListener("click",s),n=null,i=null,o=null,a=null,l=null,u=null,c=null,d=null,f=null,v=null)}),"onRemoveFn"))}if(i&&(i.innerText=e.text),o&&a&&l&&u)if(e.type){o.style.display="inline";const t=Zw((e=>{(0,r.isNonNullType)(e)?(u.innerText="!"+u.innerText,t(e.ofType)):(0,r.isListType)(e)?(a.innerText+="[",u.innerText="]"+u.innerText,t(e.ofType)):l.innerText=e.name}),"renderType");a.innerText="",u.innerText="",t(e.type)}else a.innerText="",l.innerText="",u.innerText="",o.style.display="none";c&&(e.description?(c.style.display="block",c.innerHTML=tb.render(e.description)):(c.style.display="none",c.innerHTML="")),d&&f&&(e.deprecationReason?(d.style.display="block",f.innerHTML=tb.render(e.deprecationReason)):(d.style.display="none",f.innerHTML=""))}))})),g(s,"onClickHintInformation"),Zw(s,"onClickHintInformation")}g(eC,"onHasCompletion"),Zw(eC,"onHasCompletion");var tC=Object.defineProperty,nC=g(((e,t)=>tC(e,"name",{value:t,configurable:!0})),"__name$g");function rC(e,n){(0,t.useEffect)((()=>{e&&"string"==typeof n&&n!==e.getValue()&&e.setValue(n)}),[e,n])}function iC(e,n,r){(0,t.useEffect)((()=>{e&&e.setOption(n,r)}),[e,n,r])}function oC(e,n,r,i,o){const{updateActiveTabValues:a}=iS({nonNull:!0,caller:o}),s=ve();(0,t.useEffect)((()=>{if(!e)return;const t=Tw(500,(e=>{s&&null!==r&&s.set(r,e)})),o=Tw(100,(e=>{a({[i]:e})})),l=nC(((e,r)=>{if(!r)return;const i=e.getValue();t(i),o(i),null==n||n(i)}),"handleChange");return e.on("change",l),()=>e.off("change",l)}),[n,e,s,r,i,a])}function aC(e,n,r){const{schema:i}=ME({nonNull:!0,caller:r}),o=$E(),a=Xw();(0,t.useEffect)((()=>{if(!e)return;const t=nC(((e,t)=>{eC(0,t,i,o,a,(e=>{null==n||n({kind:"Type",type:e,schema:i||void 0})}))}),"handleCompletion");return e.on("hasCompletion",t),()=>e.off("hasCompletion",t)}),[n,e,o,a,i])}function sC(e,n,r){(0,t.useEffect)((()=>{if(e){for(const t of n)e.removeKeyMap(t);if(r){const t={};for(const e of n)t[e]=()=>r();e.addKeyMap(t)}}}),[e,n,r])}function lC(){let{caller:e,onCopyQuery:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{queryEditor:r}=iS({nonNull:!0,caller:e||lC});return(0,t.useCallback)((()=>{if(!r)return;const e=r.getValue();xE(e),null==n||n(e)}),[r,n])}function uC(){let{caller:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{queryEditor:n}=iS({nonNull:!0,caller:e||uC}),{schema:i}=ME({nonNull:!0,caller:uC});return(0,t.useCallback)((()=>{const e=null==n?void 0:n.documentAST,t=null==n?void 0:n.getValue();e&&t&&n.setValue((0,r.print)(U(e,i)))}),[n,i])}function cC(){let{caller:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{queryEditor:n,headerEditor:i,variableEditor:o}=iS({nonNull:!0,caller:e||cC});return(0,t.useCallback)((()=>{if(o){const e=o.getValue();try{const t=JSON.stringify(JSON.parse(e),null,2);t!==e&&o.setValue(t)}catch{}}if(i){const e=i.getValue();try{const t=JSON.stringify(JSON.parse(e),null,2);t!==e&&i.setValue(t)}catch{}}if(n){const e=n.getValue(),t=(0,r.print)((0,r.parse)(e));t!==e&&n.setValue(t)}}),[n,o,i])}function dC(){let{getDefaultFieldNames:e,caller:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{schema:r}=ME({nonNull:!0,caller:n||dC}),{queryEditor:i}=iS({nonNull:!0,caller:n||dC});return(0,t.useCallback)((()=>{if(!i)return;const t=i.getValue(),{insertions:n,result:o}=L(r,t,e);return n&&n.length>0&&i.operation((()=>{const e=i.getCursor(),t=i.indexFromPos(e);i.setValue(o||"");let r=0;const a=n.map((e=>{let{index:t,string:n}=e;return i.markText(i.posFromIndex(t+r),i.posFromIndex(t+(r+=n.length)),{className:"auto-inserted-leaf",clearOnEnter:!0,title:"Automatically added leaf fields"})}));setTimeout((()=>a.forEach((e=>e.clear()))),7e3);let s=t;n.forEach((e=>{let{index:n,string:r}=e;nfC(e,"name",{value:t,configurable:!0})),"__name$f");function hC(){let{editorTheme:e=mE,keyMap:r=gE,onEdit:i,readOnly:o=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;const{initialHeaders:s,headerEditor:l,setHeaderEditor:u,shouldPersistHeaders:c}=iS({nonNull:!0,caller:a||hC}),d=dE(),f=uC({caller:a||hC}),p=cC({caller:a||hC}),h=(0,t.useRef)(null);return(0,t.useEffect)((()=>{let t=!0;return bE([Promise.resolve().then(n.t.bind(n,8888,23)).then((function(e){return e.j}))]).then((n=>{if(!t)return;const r=h.current;if(!r)return;const i=n(r,{value:s,lineNumbers:!0,tabSize:2,mode:{name:"javascript",json:!0},theme:e,autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!o&&"nocursor",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:yE});i.addKeyMap({"Cmd-Space"(){i.showHint({completeSingle:!1,container:r})},"Ctrl-Space"(){i.showHint({completeSingle:!1,container:r})},"Alt-Space"(){i.showHint({completeSingle:!1,container:r})},"Shift-Space"(){i.showHint({completeSingle:!1,container:r})}}),i.on("keyup",((e,t)=>{const n=t.keyCode;(n>=65&&n<=90||!t.shiftKey&&n>=48&&n<=57||t.shiftKey&&189===n||t.shiftKey&&222===n)&&e.execCommand("autocomplete")})),u(i)})),()=>{t=!1}}),[e,s,o,u]),iC(l,"keyMap",r),oC(l,i,c?mC:null,"headers",hC),sC(l,["Cmd-Enter","Ctrl-Enter"],null==d?void 0:d.run),sC(l,["Shift-Ctrl-P"],p),sC(l,["Shift-Ctrl-M"],f),h}g(hC,"useHeaderEditor"),pC(hC,"useHeaderEditor");const mC="headers";var gC=Object.defineProperty,vC=g(((e,t)=>gC(e,"name",{value:t,configurable:!0})),"__name$e");const yC=Array.from({length:11},((e,t)=>String.fromCharCode(8192+t))).concat(["\u2028","\u2029"," "," "]),bC=new RegExp("["+yC.join("")+"]","g");function EC(e){return e.replace(bC," ")}g(EC,"normalizeWhitespace"),vC(EC,"normalizeWhitespace");var TC=Object.defineProperty,wC=g(((e,t)=>TC(e,"name",{value:t,configurable:!0})),"__name$d");function CC(){let{editorTheme:e=mE,keyMap:r=gE,onClickReference:i,onCopyQuery:o,onEdit:a,readOnly:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;const{schema:u}=ME({nonNull:!0,caller:l||CC}),{externalFragments:c,initialQuery:d,queryEditor:f,setOperationName:p,setQueryEditor:v,validationRules:y,variableEditor:b,updateActiveTabValues:E}=iS({nonNull:!0,caller:l||CC}),T=dE(),w=ve(),C=$E(),S=Xw(),x=lC({caller:l||CC,onCopyQuery:o}),N=uC({caller:l||CC}),k=cC({caller:l||CC}),_=(0,t.useRef)(null),O=(0,t.useRef)(),I=(0,t.useRef)((()=>{}));(0,t.useEffect)((()=>{I.current=e=>{if(C&&S){switch(S.setVisiblePlugin(zw),e.kind){case"Type":C.push({name:e.type.name,def:e.type});break;case"Field":C.push({name:e.field.name,def:e.field});break;case"Argument":e.field&&C.push({name:e.field.name,def:e.field});break;case"EnumValue":e.type&&C.push({name:e.type.name,def:e.type})}null==i||i(e)}}}),[C,i,S]),(0,t.useEffect)((()=>{let t=!0;return bE([Promise.resolve().then(n.t.bind(n,6754,23)).then((function(e){return e.c})),Promise.resolve().then(n.t.bind(n,9509,23)).then((function(e){return e.s})),Promise.resolve().then(n.t.bind(n,4840,23)),Promise.resolve().then(n.t.bind(n,9444,23)),Promise.resolve().then(n.t.bind(n,9890,23)),Promise.resolve().then(n.t.bind(n,5980,23)),Promise.resolve().then(n.t.bind(n,9863,23))]).then((n=>{if(!t)return;O.current=n;const r=_.current;if(!r)return;const i=n(r,{value:d,lineNumbers:!0,tabSize:2,foldGutter:!0,mode:"graphql",theme:e,autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!s&&"nocursor",lint:{schema:void 0,validationRules:null,externalFragments:void 0},hintOptions:{schema:void 0,closeOnUnfocus:!1,completeSingle:!1,container:r,externalFragments:void 0},info:{schema:void 0,renderDescription:e=>tb.render(e),onClick:e=>{I.current(e)}},jump:{schema:void 0,onClick:e=>{I.current(e)}},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:m(h({},yE),{"Cmd-S"(){},"Ctrl-S"(){}})});i.addKeyMap({"Cmd-Space"(){i.showHint({completeSingle:!0,container:r})},"Ctrl-Space"(){i.showHint({completeSingle:!0,container:r})},"Alt-Space"(){i.showHint({completeSingle:!0,container:r})},"Shift-Space"(){i.showHint({completeSingle:!0,container:r})},"Shift-Alt-Space"(){i.showHint({completeSingle:!0,container:r})}}),i.on("keyup",((e,t)=>{kC.test(t.key)&&e.execCommand("autocomplete")}));let o=!1;i.on("startCompletion",(()=>{o=!0})),i.on("endCompletion",(()=>{o=!1})),i.on("keydown",((e,t)=>{"Escape"===t.key&&o&&t.stopPropagation()})),i.on("beforeChange",((e,t)=>{var n;if("paste"===t.origin){const e=t.text.map(EC);null==(n=t.update)||n.call(t,t.from,t.to,e)}})),i.documentAST=null,i.operationName=null,i.operations=null,i.variableToType=null,v(i)})),()=>{t=!1}}),[e,d,s,v]),iC(f,"keyMap",r),(0,t.useEffect)((()=>{if(!f)return;function e(e){var t,n,r,i,o;const a=Io(u,e.getValue()),s=B(null!=(t=e.operations)?t:void 0,null!=(n=e.operationName)?n:void 0,null==a?void 0:a.operations);return e.documentAST=null!=(r=null==a?void 0:a.documentAST)?r:null,e.operationName=null!=s?s:null,e.operations=null!=(i=null==a?void 0:a.operations)?i:null,b&&(b.state.lint.linterOptions.variableToType=null==a?void 0:a.variableToType,b.options.lint.variableToType=null==a?void 0:a.variableToType,b.options.hintOptions.variableToType=null==a?void 0:a.variableToType,null==(o=O.current)||o.signal(b,"change",b)),a?m(h({},a),{operationName:s}):null}g(e,"getAndUpdateOperationFacts"),wC(e,"getAndUpdateOperationFacts");const t=Tw(100,(t=>{var n;const r=t.getValue();null==w||w.set(_C,r);const i=t.operationName,o=e(t);void 0!==(null==o?void 0:o.operationName)&&(null==w||w.set(OC,o.operationName)),null==a||a(r,null==o?void 0:o.documentAST),(null==o?void 0:o.operationName)&&i!==o.operationName&&p(o.operationName),E({query:r,operationName:null!=(n=null==o?void 0:o.operationName)?n:null})}));return e(f),f.on("change",t),()=>f.off("change",t)}),[a,f,u,p,w,b,E]),SC(f,null!=u?u:null,O),xC(f,null!=y?y:null,O),NC(f,c,O),aC(f,i||null,CC);const D=null==T?void 0:T.run,L=(0,t.useCallback)((()=>{var e;if(!(D&&f&&f.operations&&f.hasFocus()))return void(null==D||D());const t=f.indexFromPos(f.getCursor());let n;for(const r of f.operations)r.loc&&r.loc.start<=t&&r.loc.end>=t&&(n=null==(e=r.name)?void 0:e.value);n&&n!==f.operationName&&p(n),D()}),[f,D,p]);return sC(f,["Cmd-Enter","Ctrl-Enter"],L),sC(f,["Shift-Ctrl-C"],x),sC(f,["Shift-Ctrl-P","Shift-Ctrl-F"],k),sC(f,["Shift-Ctrl-M"],N),_}function SC(e,n,r){(0,t.useEffect)((()=>{if(!e)return;const t=e.options.lint.schema!==n;e.state.lint.linterOptions.schema=n,e.options.lint.schema=n,e.options.hintOptions.schema=n,e.options.info.schema=n,e.options.jump.schema=n,t&&r.current&&r.current.signal(e,"change",e)}),[e,n,r])}function xC(e,n,r){(0,t.useEffect)((()=>{if(!e)return;const t=e.options.lint.validationRules!==n;e.state.lint.linterOptions.validationRules=n,e.options.lint.validationRules=n,t&&r.current&&r.current.signal(e,"change",e)}),[e,n,r])}function NC(e,n,r){const i=(0,t.useMemo)((()=>[...n.values()]),[n]);(0,t.useEffect)((()=>{if(!e)return;const t=e.options.lint.externalFragments!==i;e.state.lint.linterOptions.externalFragments=i,e.options.lint.externalFragments=i,e.options.hintOptions.externalFragments=i,t&&r.current&&r.current.signal(e,"change",e)}),[e,i,r])}g(CC,"useQueryEditor"),wC(CC,"useQueryEditor"),g(SC,"useSynchronizeSchema"),wC(SC,"useSynchronizeSchema"),g(xC,"useSynchronizeValidationRules"),wC(xC,"useSynchronizeValidationRules"),g(NC,"useSynchronizeExternalFragments"),wC(NC,"useSynchronizeExternalFragments");const kC=/^[a-zA-Z0-9_@(]$/,_C="query",OC="operationName";var IC=Object.defineProperty,DC=g(((e,t)=>IC(e,"name",{value:t,configurable:!0})),"__name$c");function LC(e){let{defaultQuery:t,defaultHeaders:n,headers:r,defaultTabs:i,query:o,variables:a,storage:s}=e;const l=null==s?void 0:s.get(QC);try{if(!l)throw new Error("Storage for tabs is empty");const e=JSON.parse(l);if(AC(e)){const t=GC({query:o,variables:a,headers:r});let n=-1;for(let r=0;r=0)e.activeTabIndex=n;else{const n=o?zC(o):null;e.tabs.push({id:HC(),hash:t,title:n||KC,query:o,variables:a,headers:r,operationName:n,response:null}),e.activeTabIndex=e.tabs.length-1}return e}throw new Error("Storage for tabs is invalid")}catch{return{activeTabIndex:0,tabs:(i||[{query:null!=o?o:t,variables:a,headers:null!=r?r:n}]).map($C)}}}function AC(e){return e&&"object"==typeof e&&!Array.isArray(e)&&RC(e,"activeTabIndex")&&"tabs"in e&&Array.isArray(e.tabs)&&e.tabs.every(MC)}function MC(e){return e&&"object"==typeof e&&!Array.isArray(e)&&FC(e,"id")&&FC(e,"title")&&PC(e,"query")&&PC(e,"variables")&&PC(e,"headers")&&PC(e,"operationName")&&PC(e,"response")}function RC(e,t){return t in e&&"number"==typeof e[t]}function FC(e,t){return t in e&&"string"==typeof e[t]}function PC(e,t){return t in e&&("string"==typeof e[t]||null===e[t])}function jC(e){let{queryEditor:n,variableEditor:r,headerEditor:i,responseEditor:o}=e;return(0,t.useCallback)((e=>{var t,a,s,l,u;const c=null!=(t=null==n?void 0:n.getValue())?t:null,d=null!=(a=null==r?void 0:r.getValue())?a:null,f=null!=(s=null==i?void 0:i.getValue())?s:null,p=null!=(l=null==n?void 0:n.operationName)?l:null;return qC(e,{query:c,variables:d,headers:f,response:null!=(u=null==o?void 0:o.getValue())?u:null,operationName:p})}),[n,r,i,o])}function VC(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return JSON.stringify(e,((e,n)=>"hash"===e||"response"===e||!t&&"headers"===e?null:n))}function UC(e){let{storage:n,shouldPersistHeaders:r}=e;const i=(0,t.useMemo)((()=>Tw(500,(e=>{null==n||n.set(QC,e)}))),[n]);return(0,t.useCallback)((e=>{i(VC(e,r))}),[r,i])}function BC(e){let{queryEditor:n,variableEditor:r,headerEditor:i,responseEditor:o}=e;return(0,t.useCallback)((e=>{let{query:t,variables:a,headers:s,response:l}=e;null==n||n.setValue(null!=t?t:""),null==r||r.setValue(null!=a?a:""),null==i||i.setValue(null!=s?s:""),null==o||o.setValue(null!=l?l:"")}),[i,n,o,r])}function $C(){let{query:e=null,variables:t=null,headers:n=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:HC(),hash:GC({query:e,variables:t,headers:n}),title:e&&zC(e)||KC,query:e,variables:t,headers:n,operationName:null,response:null}}function qC(e,t){return m(h({},e),{tabs:e.tabs.map(((n,r)=>{if(r!==e.activeTabIndex)return n;const i=h(h({},n),t);return m(h({},i),{hash:GC(i),title:i.operationName||(i.query?zC(i.query):void 0)||KC})}))})}function HC(){const e=DC((()=>Math.floor(65536*(1+Math.random())).toString(16).slice(1)),"s4");return`${e()}${e()}-${e()}-${e()}-${e()}-${e()}${e()}${e()}`}function GC(e){var t,n,r;return[null!=(t=e.query)?t:"",null!=(n=e.variables)?n:"",null!=(r=e.headers)?r:""].join("|")}function zC(e){var t;const n=/^(?!#).*(query|subscription|mutation)\s+([a-zA-Z0-9_]+)/m.exec(e);return null!=(t=null==n?void 0:n[2])?t:null}function WC(e){const t=null==e?void 0:e.get(QC);if(t){const n=JSON.parse(t);null==e||e.set(QC,JSON.stringify(n,((e,t)=>"headers"===e?null:t)))}}g(LC,"getDefaultTabState"),DC(LC,"getDefaultTabState"),g(AC,"isTabsState"),DC(AC,"isTabsState"),g(MC,"isTabState"),DC(MC,"isTabState"),g(RC,"hasNumberKey"),DC(RC,"hasNumberKey"),g(FC,"hasStringKey"),DC(FC,"hasStringKey"),g(PC,"hasStringOrNullKey"),DC(PC,"hasStringOrNullKey"),g(jC,"useSynchronizeActiveTabValues"),DC(jC,"useSynchronizeActiveTabValues"),g(VC,"serializeTabState"),DC(VC,"serializeTabState"),g(UC,"useStoreTabs"),DC(UC,"useStoreTabs"),g(BC,"useSetEditorValues"),DC(BC,"useSetEditorValues"),g($C,"createTab"),DC($C,"createTab"),g(qC,"setPropertiesInActiveTab"),DC(qC,"setPropertiesInActiveTab"),g(HC,"guid"),DC(HC,"guid"),g(GC,"hashFromTabContents"),DC(GC,"hashFromTabContents"),g(zC,"fuzzyExtractOperationName"),DC(zC,"fuzzyExtractOperationName"),g(WC,"clearHeadersFromTabs"),DC(WC,"clearHeadersFromTabs");const KC="",QC="tabState";var XC=Object.defineProperty,YC=g(((e,t)=>XC(e,"name",{value:t,configurable:!0})),"__name$b");function JC(){let{editorTheme:e=mE,keyMap:r=gE,onClickReference:i,onEdit:o,readOnly:a=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;const{initialVariables:l,variableEditor:u,setVariableEditor:c}=iS({nonNull:!0,caller:s||JC}),d=dE(),f=uC({caller:s||JC}),p=cC({caller:s||JC}),h=(0,t.useRef)(null),m=(0,t.useRef)();return(0,t.useEffect)((()=>{let t=!0;return bE([Promise.resolve().then(n.t.bind(n,4712,23)),Promise.resolve().then(n.t.bind(n,8535,23)),Promise.resolve().then(n.t.bind(n,3340,23))]).then((n=>{if(!t)return;m.current=n;const r=h.current;if(!r)return;const i=n(r,{value:l,lineNumbers:!0,tabSize:2,mode:"graphql-variables",theme:e,autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!a&&"nocursor",foldGutter:!0,lint:{variableToType:void 0},hintOptions:{closeOnUnfocus:!1,completeSingle:!1,container:r,variableToType:void 0},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:yE});i.addKeyMap({"Cmd-Space"(){i.showHint({completeSingle:!1,container:r})},"Ctrl-Space"(){i.showHint({completeSingle:!1,container:r})},"Alt-Space"(){i.showHint({completeSingle:!1,container:r})},"Shift-Space"(){i.showHint({completeSingle:!1,container:r})}}),i.on("keyup",((e,t)=>{const n=t.keyCode;(n>=65&&n<=90||!t.shiftKey&&n>=48&&n<=57||t.shiftKey&&189===n||t.shiftKey&&222===n)&&e.execCommand("autocomplete")})),c(i)})),()=>{t=!1}}),[e,l,a,c]),iC(u,"keyMap",r),oC(u,o,ZC,"variables",JC),aC(u,i||null,JC),sC(u,["Cmd-Enter","Ctrl-Enter"],null==d?void 0:d.run),sC(u,["Shift-Ctrl-P"],p),sC(u,["Shift-Ctrl-M"],f),h}g(JC,"useVariableEditor"),YC(JC,"useVariableEditor");const ZC="variables";var eS=Object.defineProperty,tS=g(((e,t)=>eS(e,"name",{value:t,configurable:!0})),"__name$a");const nS=Q("EditorContext");function rS(e){const n=ve(),[i,o]=(0,t.useState)(null),[a,s]=(0,t.useState)(null),[l,u]=(0,t.useState)(null),[c,d]=(0,t.useState)(null),[f,p]=(0,t.useState)((()=>{const t=null!==(null==n?void 0:n.get(oS));return!1!==e.shouldPersistHeaders&&t?"true"===(null==n?void 0:n.get(oS)):Boolean(e.shouldPersistHeaders)}));rC(i,e.headers),rC(a,e.query),rC(l,e.response),rC(c,e.variables);const g=UC({storage:n,shouldPersistHeaders:f}),[v]=(0,t.useState)((()=>{var t,r,i,o,a,s,l,u,c;const d=null!=(r=null!=(t=e.query)?t:null==n?void 0:n.get(_C))?r:null,f=null!=(o=null!=(i=e.variables)?i:null==n?void 0:n.get(ZC))?o:null,p=null!=(s=null!=(a=e.headers)?a:null==n?void 0:n.get(mC))?s:null,h=null!=(l=e.response)?l:"",m=LC({query:d,variables:f,headers:p,defaultTabs:e.defaultTabs||e.initialTabs,defaultQuery:e.defaultQuery||aS,defaultHeaders:e.defaultHeaders,storage:n});return g(m),{query:null!=(u=null!=d?d:0===m.activeTabIndex?m.tabs[0].query:null)?u:"",variables:null!=f?f:"",headers:null!=(c=null!=p?p:e.defaultHeaders)?c:"",response:h,tabState:m}})),[y,b]=(0,t.useState)(v.tabState),E=(0,t.useCallback)((e=>{var t;if(e){null==n||n.set(mC,null!=(t=null==i?void 0:i.getValue())?t:"");const e=VC(y,!0);null==n||n.set(QC,e)}else null==n||n.set(mC,""),WC(n);p(e),null==n||n.set(oS,e.toString())}),[n,y,i]),T=(0,t.useRef)(void 0);(0,t.useEffect)((()=>{const t=Boolean(e.shouldPersistHeaders);T.current!==t&&(E(t),T.current=t)}),[e.shouldPersistHeaders,E]);const w=jC({queryEditor:a,variableEditor:c,headerEditor:i,responseEditor:l}),C=BC({queryEditor:a,variableEditor:c,headerEditor:i,responseEditor:l}),{onTabChange:S,defaultHeaders:x,children:N}=e,k=(0,t.useCallback)((()=>{b((e=>{const t=w(e),n={tabs:[...t.tabs,$C({headers:x})],activeTabIndex:t.tabs.length};return g(n),C(n.tabs[n.activeTabIndex]),null==S||S(n),n}))}),[x,S,C,g,w]),_=(0,t.useCallback)((e=>{b((t=>{const n=m(h({},w(t)),{activeTabIndex:e});return g(n),C(n.tabs[n.activeTabIndex]),null==S||S(n),n}))}),[S,C,g,w]),O=(0,t.useCallback)((e=>{b((t=>{const n={tabs:t.tabs.filter(((t,n)=>e!==n)),activeTabIndex:Math.max(t.activeTabIndex-1,0)};return g(n),C(n.tabs[n.activeTabIndex]),null==S||S(n),n}))}),[S,C,g]),I=(0,t.useCallback)((e=>{b((t=>{const n=qC(t,e);return g(n),null==S||S(n),n}))}),[S,g]),{onEditOperationName:D}=e,L=(0,t.useCallback)((e=>{a&&(a.operationName=e,I({operationName:e}),null==D||D(e))}),[D,a,I]),A=(0,t.useMemo)((()=>{const t=new Map;if(Array.isArray(e.externalFragments))for(const n of e.externalFragments)t.set(n.name.value,n);else if("string"==typeof e.externalFragments)(0,r.visit)((0,r.parse)(e.externalFragments,{}),{FragmentDefinition(e){t.set(e.name.value,e)}});else if(e.externalFragments)throw new Error("The `externalFragments` prop must either be a string that contains the fragment definitions in SDL or a list of FragmentDefinitionNode objects.");return t}),[e.externalFragments]),M=(0,t.useMemo)((()=>e.validationRules||[]),[e.validationRules]),R=(0,t.useMemo)((()=>m(h({},y),{addTab:k,changeTab:_,closeTab:O,updateActiveTabValues:I,headerEditor:i,queryEditor:a,responseEditor:l,variableEditor:c,setHeaderEditor:o,setQueryEditor:s,setResponseEditor:u,setVariableEditor:d,setOperationName:L,initialQuery:v.query,initialVariables:v.variables,initialHeaders:v.headers,initialResponse:v.response,externalFragments:A,validationRules:M,shouldPersistHeaders:f,setShouldPersistHeaders:E})),[y,k,_,O,I,i,a,l,c,L,v,A,M,f,E]);return ce(nS.Provider,{value:R,children:N})}e.E=nS,g(rS,"EditorContextProvider"),tS(rS,"EditorContextProvider");const iS=X(nS);e.f=iS;const oS="shouldPersistHeaders",aS='# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser tool for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will see intelligent\n# typeaheads aware of the current GraphQL type schema and live syntax and\n# validation errors highlighted within the text.\n#\n# GraphQL queries typically start with a "{" character. Lines that start\n# with a # are ignored.\n#\n# An example GraphQL query might look like:\n#\n# {\n# field(arg: "value") {\n# subField\n# }\n# }\n#\n# Keyboard shortcuts:\n#\n# Prettify query: Shift-Ctrl-P (or press the prettify button)\n#\n# Merge fragments: Shift-Ctrl-M (or press the merge button)\n#\n# Run Query: Ctrl-Enter (or press the play button)\n#\n# Auto Complete: Ctrl-Space (or just start typing)\n#\n\n';var sS=Object.defineProperty,lS=g(((e,t)=>sS(e,"name",{value:t,configurable:!0})),"__name$9");function uS(e){var n=e,{isHidden:r}=n,i=v(n,["isHidden"]);const{headerEditor:o}=iS({nonNull:!0,caller:uS}),a=hC(i,uS);return(0,t.useEffect)((()=>{o&&!r&&o.refresh()}),[o,r]),ce("div",{className:b("graphiql-editor",r&&"hidden"),ref:a})}g(uS,"HeaderEditor"),lS(uS,"HeaderEditor");var cS=Object.defineProperty,dS=g(((e,t)=>cS(e,"name",{value:t,configurable:!0})),"__name$8");function fS(e){var n;const[r,i]=(0,t.useState)({width:null,height:null}),[o,a]=(0,t.useState)(null),s=(0,t.useRef)(null),l=null==(n=pS(e.token))?void 0:n.href;(0,t.useEffect)((()=>{if(s.current)return l?void fetch(l,{method:"HEAD"}).then((e=>{a(e.headers.get("Content-Type"))})).catch((()=>{a(null)})):(i({width:null,height:null}),void a(null))}),[l]);const u=null!==r.width&&null!==r.height?de("div",{children:[r.width,"x",r.height,null===o?null:" "+o]}):null;return de("div",{children:[ce("img",{onLoad:()=>{var e,t,n,r;i({width:null!=(t=null==(e=s.current)?void 0:e.naturalWidth)?t:null,height:null!=(r=null==(n=s.current)?void 0:n.naturalHeight)?r:null})},ref:s,src:l}),u]})}function pS(e){if("string"!==e.type)return;const t=e.string.slice(1).slice(0,-1).trim();try{const{location:e}=window;return new URL(t,e.protocol+"//"+e.host)}catch{return}}function hS(e){return/(bmp|gif|jpeg|jpg|png|svg)$/.test(e.pathname)}g(fS,"ImagePreview"),dS(fS,"ImagePreview"),fS.shouldRender=dS(g((function(e){const t=pS(e);return!!t&&hS(t)}),"shouldRender"),"shouldRender"),g(pS,"tokenToURL"),dS(pS,"tokenToURL"),g(hS,"isImageURL"),dS(hS,"isImageURL");var mS=Object.defineProperty,gS=g(((e,t)=>mS(e,"name",{value:t,configurable:!0})),"__name$7");function vS(e){const t=CC(e,vS);return ce("div",{className:"graphiql-editor",ref:t})}g(vS,"QueryEditor"),gS(vS,"QueryEditor");var yS=Object.defineProperty,bS=g(((e,t)=>yS(e,"name",{value:t,configurable:!0})),"__name$6");function ES(){let{responseTooltip:e,editorTheme:r=mE,keyMap:o=gE}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;const{fetchError:s,validationErrors:l}=ME({nonNull:!0,caller:a||ES}),{initialResponse:u,responseEditor:c,setResponseEditor:d}=iS({nonNull:!0,caller:a||ES}),f=(0,t.useRef)(null),p=(0,t.useRef)(e);return(0,t.useEffect)((()=>{p.current=e}),[e]),(0,t.useEffect)((()=>{let e=!0;return bE([Promise.resolve().then(n.t.bind(n,8419,23)).then((function(e){return e.f})),Promise.resolve().then(n.t.bind(n,4468,23)).then((function(e){return e.b})),Promise.resolve().then(n.t.bind(n,8058,23)).then((function(e){return e.d})),Promise.resolve().then(n.t.bind(n,9509,23)).then((function(e){return e.s})),Promise.resolve().then(n.t.bind(n,9407,23)).then((function(e){return e.s})),Promise.resolve().then(n.t.bind(n,4471,23)).then((function(e){return e.j})),Promise.resolve().then(n.t.bind(n,2568,23)).then((function(e){return e.s})),Promise.resolve().then(n.t.bind(n,1430,23)),Promise.resolve().then(n.t.bind(n,7421,23))],{useCommonAddons:!1}).then((t=>{if(!e)return;const n=document.createElement("div");t.registerHelper("info","graphql-results",((e,t,r,o)=>{const a=[],s=p.current;return s&&a.push(ce(s,{pos:o,token:e})),fS.shouldRender(e)&&a.push(ce(fS,{token:e},"image-preview")),a.length?(i.default.render(a,n),n):(i.default.unmountComponentAtNode(n),null)}));const o=f.current;if(!o)return;const a=t(o,{value:u,lineWrapping:!0,readOnly:!0,theme:r,mode:"graphql-results",foldGutter:!0,gutters:["CodeMirror-foldgutter"],info:!0,extraKeys:yE});d(a)})),()=>{e=!1}}),[r,u,d]),iC(c,"keyMap",o),(0,t.useEffect)((()=>{s&&(null==c||c.setValue(s)),l.length>0&&(null==c||c.setValue(I(l)))}),[c,s,l]),f}g(ES,"useResponseEditor"),bS(ES,"useResponseEditor");var TS=Object.defineProperty,wS=g(((e,t)=>TS(e,"name",{value:t,configurable:!0})),"__name$5");function CS(e){const t=ES(e,CS);return ce("section",{className:"result-window","aria-label":"Result Window","aria-live":"polite","aria-atomic":"true",ref:t})}g(CS,"ResponseEditor"),wS(CS,"ResponseEditor");var SS=Object.defineProperty,xS=g(((e,t)=>SS(e,"name",{value:t,configurable:!0})),"__name$4");function NS(e){var n=e,{isHidden:r}=n,i=v(n,["isHidden"]);const{variableEditor:o}=iS({nonNull:!0,caller:NS}),a=JC(i,NS);return(0,t.useEffect)((()=>{o&&!r&&o.refresh()}),[o,r]),ce("div",{className:b("graphiql-editor",r&&"hidden"),ref:a})}g(NS,"VariableEditor"),xS(NS,"VariableEditor");var kS=Object.defineProperty,_S=g(((e,t)=>kS(e,"name",{value:t,configurable:!0})),"__name$3");function OS(e){let{children:t,dangerouslyAssumeSchemaIsValid:n,defaultQuery:r,defaultHeaders:i,defaultTabs:o,externalFragments:a,fetcher:s,getDefaultFieldNames:l,headers:u,initialTabs:c,inputValueDeprecation:d,introspectionQueryName:f,maxHistoryLength:p,onEditOperationName:h,onSchemaChange:m,onTabChange:g,onTogglePluginVisibility:v,operationName:y,plugins:b,query:E,response:T,schema:w,schemaDescription:C,shouldPersistHeaders:S,storage:x,validationRules:N,variables:k,visiblePlugin:_}=e;return ce(ge,{storage:x,children:ce(Zb,{maxHistoryLength:p,children:ce(rS,{defaultQuery:r,defaultHeaders:i,defaultTabs:o,externalFragments:a,headers:u,initialTabs:c,onEditOperationName:h,onTabChange:g,query:E,response:T,shouldPersistHeaders:S,validationRules:N,variables:k,children:ce(AE,{dangerouslyAssumeSchemaIsValid:n,fetcher:s,inputValueDeprecation:d,introspectionQueryName:f,onSchemaChange:m,schema:w,schemaDescription:C,children:ce(cE,{getDefaultFieldNames:l,fetcher:s,operationName:y,children:ce(BE,{children:ce(Qw,{onTogglePluginVisibility:v,plugins:b,visiblePlugin:_,children:t})})})})})})})}g(OS,"GraphiQLProvider"),_S(OS,"GraphiQLProvider");var IS=Object.defineProperty,DS=g(((e,t)=>IS(e,"name",{value:t,configurable:!0})),"__name$2");function LS(){const e=ve(),[n,r]=(0,t.useState)((()=>{if(!e)return null;const t=e.get(AS);switch(t){case"light":return"light";case"dark":return"dark";default:return"string"==typeof t&&e.set(AS,""),null}}));(0,t.useLayoutEffect)((()=>{"undefined"!=typeof window&&(document.body.classList.remove("graphiql-light","graphiql-dark"),n&&document.body.classList.add(`graphiql-${n}`))}),[n]);const i=(0,t.useCallback)((t=>{null==e||e.set(AS,t||""),r(t)}),[e]);return(0,t.useMemo)((()=>({theme:n,setTheme:i})),[n,i])}g(LS,"useTheme"),DS(LS,"useTheme");const AS="theme";var MS=Object.defineProperty,RS=g(((e,t)=>MS(e,"name",{value:t,configurable:!0})),"__name$1");function FS(e){let{defaultSizeRelation:n=PS,direction:r,initiallyHidden:i,onHiddenElementChange:o,sizeThresholdFirst:a=100,sizeThresholdSecond:s=100,storageKey:l}=e;const u=ve(),c=(0,t.useMemo)((()=>Tw(500,(e=>{u&&l&&u.set(l,e)}))),[u,l]),[d,f]=(0,t.useState)((()=>{const e=u&&l?u.get(l):null;return e===jS||"first"===i?"first":e===VS||"second"===i?"second":null})),p=(0,t.useCallback)((e=>{e!==d&&(f(e),null==o||o(e))}),[d,o]),h=(0,t.useRef)(null),m=(0,t.useRef)(null),v=(0,t.useRef)(null),y=(0,t.useRef)(`${n}`);(0,t.useLayoutEffect)((()=>{const e=u&&l&&u.get(l)||y.current,t="horizontal"===r?"row":"column";h.current&&(h.current.style.display="flex",h.current.style.flexDirection=t,h.current.style.flex=e===jS||e===VS?y.current:e),v.current&&(v.current.style.display="flex",v.current.style.flexDirection=t,v.current.style.flex="1"),m.current&&(m.current.style.display="flex",m.current.style.flexDirection=t)}),[r,u,l]);const b=(0,t.useCallback)((e=>{const t="first"===e?h.current:v.current;if(t&&(t.style.left="-1000px",t.style.position="absolute",t.style.opacity="0",t.style.height="500px",t.style.width="500px",h.current)){const e=parseFloat(h.current.style.flex);(!Number.isFinite(e)||e<1)&&(h.current.style.flex="1")}}),[]),E=(0,t.useCallback)((e=>{const t="first"===e?h.current:v.current;if(t&&(t.style.width="",t.style.height="",t.style.opacity="",t.style.position="",t.style.left="",h.current&&u&&l)){const e=null==u?void 0:u.get(l);e!==jS&&e!==VS&&(h.current.style.flex=e||y.current)}}),[u,l]);return(0,t.useLayoutEffect)((()=>{"first"===d?b("first"):E("first"),"second"===d?b("second"):E("second")}),[d,b,E]),(0,t.useEffect)((()=>{if(!m.current||!h.current||!v.current)return;const e=m.current,t=h.current,n=t.parentElement,i="horizontal"===r?"clientX":"clientY",o="horizontal"===r?"left":"top",l="horizontal"===r?"right":"bottom",u="horizontal"===r?"clientWidth":"clientHeight";function d(r){r.preventDefault();const d=r[i]-e.getBoundingClientRect()[o];function f(r){if(0===r.buttons)return h();const f=r[i]-n.getBoundingClientRect()[o]-d,m=n.getBoundingClientRect()[l]-r[i]+d-e[u];if(f{e.removeEventListener("mousedown",d),e.removeEventListener("dblclick",f)}}),[r,p,a,s,c]),(0,t.useMemo)((()=>({dragBarRef:m,hiddenElement:d,firstRef:h,setHiddenElement:f,secondRef:v})),[d,f])}g(FS,"useDragResize"),RS(FS,"useDragResize");const PS=1,jS="hide-first",VS="hide-second",US=(0,t.forwardRef)(((e,n)=>{var r=e,{label:i}=r,o=v(r,["label"]);const[a,s]=(0,t.useState)(null);return ce(Fb,{label:i,children:ce(is,m(h({},o),{ref:n,type:"button",className:b("graphiql-toolbar-button",a&&"error",o.className),onClick:e=>{var t;try{null==(t=o.onClick)||t.call(o,e),s(null)}catch(e){s(e instanceof Error?e:new Error(`Toolbar button click failed: ${e}`))}},"aria-label":a?a.message:i,"aria-invalid":a?"true":o["aria-invalid"]}))})}));e.aR=US,US.displayName="ToolbarButton";var BS=Object.defineProperty,$S=g(((e,t)=>BS(e,"name",{value:t,configurable:!0})),"__name");function qS(){const{queryEditor:e,setOperationName:t}=iS({nonNull:!0,caller:qS}),{isFetching:n,isSubscribed:r,operationName:i,run:o,stop:a}=dE({nonNull:!0,caller:qS}),s=(null==e?void 0:e.operations)||[],l=s.length>1&&"string"!=typeof i,u=n||r,c=(u?"Stop":"Execute")+" query (Ctrl-Enter)",d={type:"button",className:"graphiql-execute-button",children:ce(u?ts:Wa,{}),"aria-label":c};return l&&!u?de(qh,{children:[ce(Fb,{label:c,children:ce(qh.Button,h({},d))}),ce(qh.List,{children:s.map(((n,r)=>{const i=n.name?n.name.value:``;return ce(qh.Item,{onSelect:()=>{var r;const i=null==(r=n.name)?void 0:r.value;e&&i&&i!==e.operationName&&t(i),o()},children:i},`${i}-${r}`)}))})]}):ce(Fb,{label:c,children:ce("button",m(h({},d),{onClick:()=>{u?a():o()}}))})}g(qS,"ExecuteButton"),$S(qS,"ExecuteButton");const HS=(0,t.forwardRef)(((e,t)=>{var n=e,{button:r,children:i,label:o}=n,a=v(n,["button","children","label"]);const s=`${o}${a.value?`: ${a.value}`:""}`;return de(Gh.Input,m(h({},a),{ref:t,className:b("graphiql-toolbar-listbox",a.className),"aria-label":s,children:[ce(Fb,{label:s,children:ce(Gh.Button,{children:r})}),ce(Gh.Popover,{children:i})]}))}));HS.displayName="ToolbarListbox";const GS=Qc(HS,{Option:Gh.Option});e.aT=GS;const zS=(0,t.forwardRef)(((e,t)=>{var n=e,{button:r,children:i,label:o}=n,a=v(n,["button","children","label"]);return de(qh,m(h({},a),{ref:t,children:[ce(Fb,{label:o,children:ce(qh.Button,{className:b("graphiql-un-styled graphiql-toolbar-menu",a.className),"aria-label":o,children:r})}),ce(qh.List,{children:i})]}))}));zS.displayName="ToolbarMenu";const WS=Qc(zS,{Item:qh.Item});e.aU=WS},void 0===(o=r.apply(t,i))||(e.exports=o)},7421:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(6856),n(9196),n(3573),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i){"use strict";var o=Object.defineProperty,a=(e,t)=>o(e,"name",{value:t,configurable:!0});function s(e){return{options:e instanceof Function?{render:e}:!0===e?{}:e}}function l(e){const{options:t}=e.state.info;return(null==t?void 0:t.hoverTime)||500}function u(t,n){const r=t.state.info,i=n.target||n.srcElement;if(!(i instanceof HTMLElement))return;if("SPAN"!==i.nodeName||void 0!==r.hoverTimeout)return;const o=i.getBoundingClientRect(),s=a((function(){clearTimeout(r.hoverTimeout),r.hoverTimeout=setTimeout(d,f)}),"onMouseMove"),u=a((function(){e.C.off(document,"mousemove",s),e.C.off(t.getWrapperElement(),"mouseout",u),clearTimeout(r.hoverTimeout),r.hoverTimeout=void 0}),"onMouseOut"),d=a((function(){e.C.off(document,"mousemove",s),e.C.off(t.getWrapperElement(),"mouseout",u),r.hoverTimeout=void 0,c(t,o)}),"onHover"),f=l(t);r.hoverTimeout=setTimeout(d,f),e.C.on(document,"mousemove",s),e.C.on(t.getWrapperElement(),"mouseout",u)}function c(e,t){const n=e.coordsChar({left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}),r=e.state.info,{options:i}=r,o=i.render||e.getHelper(n,"info");if(o){const r=e.getTokenAt(n,!0);if(r){const a=o(r,i,e,n);a&&d(e,t,a)}}}function d(t,n,r){const i=document.createElement("div");i.className="CodeMirror-info",i.appendChild(r),document.body.appendChild(i);const o=i.getBoundingClientRect(),s=window.getComputedStyle(i),l=o.right-o.left+parseFloat(s.marginLeft)+parseFloat(s.marginRight),u=o.bottom-o.top+parseFloat(s.marginTop)+parseFloat(s.marginBottom);let c=n.bottom;u>window.innerHeight-n.bottom-15&&n.top>window.innerHeight-n.bottom&&(c=n.top-u),c<0&&(c=n.bottom);let d,f=Math.max(0,window.innerWidth-l-15);f>n.left&&(f=n.left),i.style.opacity="1",i.style.top=c+"px",i.style.left=f+"px";const p=a((function(){clearTimeout(d)}),"onMouseOverPopup"),h=a((function(){clearTimeout(d),d=setTimeout(m,200)}),"onMouseOut"),m=a((function(){e.C.off(i,"mouseover",p),e.C.off(i,"mouseout",h),e.C.off(t.getWrapperElement(),"mouseout",h),i.style.opacity?(i.style.opacity="0",setTimeout((()=>{i.parentNode&&i.parentNode.removeChild(i)}),600)):i.parentNode&&i.parentNode.removeChild(i)}),"hidePopup");e.C.on(i,"mouseover",p),e.C.on(i,"mouseout",h),e.C.on(t.getWrapperElement(),"mouseout",h)}e.C.defineOption("info",!1,((t,n,r)=>{if(r&&r!==e.C.Init){const n=t.state.info.onMouseOver;e.C.off(t.getWrapperElement(),"mouseover",n),clearTimeout(t.state.info.hoverTimeout),delete t.state.info}if(n){const r=t.state.info=s(n);r.onMouseOver=u.bind(null,t),e.C.on(t.getWrapperElement(),"mouseover",r.onMouseOver)}})),a(s,"createState"),a(l,"getHoverTime"),a(u,"onMouseOver"),a(c,"onMouseHover"),a(d,"showPopup")})?r.apply(t,i):r)||(e.exports=o)},9890:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(3573),n(535),n(2645),n(7421),n(6856),n(9196),n(1850),n(2635)],r=function(e,t,n,r,i,o,a,s){"use strict";var l=Object.defineProperty,u=(e,t)=>l(e,"name",{value:t,configurable:!0});function c(e,t,n){d(e,t,n),m(e,t,n,t.type)}function d(e,t,r){var i;b(e,(null===(i=t.fieldDef)||void 0===i?void 0:i.name)||"","field-name",r,(0,n.a)(t))}function f(e,t,r){var i;b(e,"@"+((null===(i=t.directiveDef)||void 0===i?void 0:i.name)||""),"directive-name",r,(0,n.b)(t))}function p(e,t,r){var i;b(e,(null===(i=t.argDef)||void 0===i?void 0:i.name)||"","arg-name",r,(0,n.c)(t)),m(e,t,r,t.inputType)}function h(e,t,r){var i;const o=(null===(i=t.enumValue)||void 0===i?void 0:i.name)||"";g(e,t,r,t.inputType),b(e,"."),b(e,o,"enum-value",r,(0,n.d)(t))}function m(t,r,i,o){const a=document.createElement("span");a.className="type-name-pill",o instanceof e.GraphQLNonNull?(g(a,r,i,o.ofType),b(a,"!")):o instanceof e.GraphQLList?(b(a,"["),g(a,r,i,o.ofType),b(a,"]")):b(a,(null==o?void 0:o.name)||"","type-name",i,(0,n.e)(r,o)),t.appendChild(a)}function g(t,r,i,o){o instanceof e.GraphQLNonNull?(g(t,r,i,o.ofType),b(t,"!")):o instanceof e.GraphQLList?(b(t,"["),g(t,r,i,o.ofType),b(t,"]")):b(t,(null==o?void 0:o.name)||"","type-name",i,(0,n.e)(r,o))}function v(e,t,n){const{description:r}=n;if(r){const n=document.createElement("div");n.className="info-description",t.renderDescription?n.innerHTML=t.renderDescription(r):n.appendChild(document.createTextNode(r)),e.appendChild(n)}y(e,t,n)}function y(e,t,n){const r=n.deprecationReason;if(r){const n=document.createElement("div");n.className="info-deprecation",e.appendChild(n);const i=document.createElement("span");i.className="info-deprecation-label",i.appendChild(document.createTextNode("Deprecated")),n.appendChild(i);const o=document.createElement("div");o.className="info-deprecation-reason",t.renderDescription?o.innerHTML=t.renderDescription(r):o.appendChild(document.createTextNode(r)),n.appendChild(o)}}function b(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{onClick:null},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(n){const{onClick:o}=r;let a;o?(a=document.createElement("a"),a.href="javascript:void 0",a.addEventListener("click",(e=>{o(i,e)}))):a=document.createElement("span"),a.className=n,a.appendChild(document.createTextNode(t)),e.appendChild(a)}else e.appendChild(document.createTextNode(t))}t.C.registerHelper("info","graphql",((e,t)=>{if(!t.schema||!e.state)return;const{kind:r,step:i}=e.state,o=(0,n.g)(t.schema,e.state);if("Field"===r&&0===i&&o.fieldDef||"AliasedField"===r&&2===i&&o.fieldDef){const e=document.createElement("div");e.className="CodeMirror-info-header",c(e,o,t);const n=document.createElement("div");return n.appendChild(e),v(n,t,o.fieldDef),n}if("Directive"===r&&1===i&&o.directiveDef){const e=document.createElement("div");e.className="CodeMirror-info-header",f(e,o,t);const n=document.createElement("div");return n.appendChild(e),v(n,t,o.directiveDef),n}if("Argument"===r&&0===i&&o.argDef){const e=document.createElement("div");e.className="CodeMirror-info-header",p(e,o,t);const n=document.createElement("div");return n.appendChild(e),v(n,t,o.argDef),n}if("EnumValue"===r&&o.enumValue&&o.enumValue.description){const e=document.createElement("div");e.className="CodeMirror-info-header",h(e,o,t);const n=document.createElement("div");return n.appendChild(e),v(n,t,o.enumValue),n}if("NamedType"===r&&o.type&&o.type.description){const e=document.createElement("div");e.className="CodeMirror-info-header",g(e,o,t,o.type);const n=document.createElement("div");return n.appendChild(e),v(n,t,o.type),n}})),u(c,"renderField"),u(d,"renderQualifiedField"),u(f,"renderDirective"),u(p,"renderArg"),u(h,"renderEnumValue"),u(m,"renderTypeAnnotation"),u(g,"renderType"),u(v,"renderDescription"),u(y,"renderDeprecation"),u(b,"text")},void 0===(o=r.apply(t,i))||(e.exports=o)},8888:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535)],r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.j=void 0;var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o,a={exports:{}};(o=t.a.exports).defineMode("javascript",(function(e,t){var n,i,a=e.indentUnit,s=t.statementIndent,l=t.jsonld,u=t.json||l,c=!1!==t.trackScope,d=t.typescript,f=t.wordCharacters||/[\w$\xa1-\uffff]/,p=function(){function e(e){return{type:e,style:"keyword"}}r(e,"kw");var t=e("keyword a"),n=e("keyword b"),i=e("keyword c"),o=e("keyword d"),a=e("operator"),s={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:o,break:o,continue:o,new:e("new"),delete:i,void:i,throw:i,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:a,typeof:a,instanceof:a,true:s,false:s,null:s,undefined:s,NaN:s,Infinity:s,this:e("this"),class:e("class"),super:e("atom"),yield:i,export:e("export"),import:e("import"),extends:i,await:i}}(),h=/[+\-*&%=<>!?|~^@]/,m=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function v(e,t,r){return n=e,i=r,t}function y(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=b(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return v("number","number");if("."==n&&e.match(".."))return v("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return v(n);if("="==n&&e.eat(">"))return v("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return v("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),v("number","number");if("/"==n)return e.eat("*")?(t.tokenize=E,E(e,t)):e.eat("/")?(e.skipToEnd(),v("comment","comment")):ot(e,t,1)?(g(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),v("regexp","string-2")):(e.eat("="),v("operator","operator",e.current()));if("`"==n)return t.tokenize=T,T(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),v("meta","meta");if("#"==n&&e.eatWhile(f))return v("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),v("comment","comment");if(h.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?v("."):v("operator","operator",e.current());if(f.test(n)){e.eatWhile(f);var r=e.current();if("."!=t.lastType){if(p.propertyIsEnumerable(r)){var i=p[r];return v(i.type,i.style,r)}if("async"==r&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return v("async","keyword",r)}return v("variable","variable",r)}}function b(e){return function(t,n){var r,i=!1;if(l&&"@"==t.peek()&&t.match(m))return n.tokenize=y,v("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=y),v("string","string")}}function E(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=y;break}r="*"==n}return v("comment","comment")}function T(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=y;break}r=!r&&"\\"==n}return v("quasi","string-2",e.current())}r(g,"readRegexp"),r(v,"ret"),r(y,"tokenBase"),r(b,"tokenString"),r(E,"tokenComment"),r(T,"tokenQuasi");var w="([{}])";function C(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(d){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l=w.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(f.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}r(C,"findFatArrow");var S={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function x(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function N(e,t){if(!c)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function k(e,t,n,r,i){var o=e.cc;for(_.state=e,_.stream=i,_.marked=null,_.cc=o,_.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():u?z:H)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return _.marked?_.marked:"variable"==n&&N(e,r)?"variable-2":t}}r(x,"JSLexical"),r(N,"inScope"),r(k,"parseJS");var _={state:null,column:null,marked:null,cc:null};function O(){for(var e=arguments.length-1;e>=0;e--)_.cc.push(arguments[e])}function I(){return O.apply(null,arguments),!0}function D(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function L(e){var n=_.state;if(_.marked="def",c){if(n.context)if("var"==n.lexical.info&&n.context&&n.context.block){var r=A(e,n.context);if(null!=r)return void(n.context=r)}else if(!D(e,n.localVars))return void(n.localVars=new F(e,n.localVars));t.globalVars&&!D(e,n.globalVars)&&(n.globalVars=new F(e,n.globalVars))}}function A(e,t){if(t){if(t.block){var n=A(e,t.prev);return n?n==t.prev?t:new R(n,t.vars,!0):null}return D(e,t.vars)?t:new R(t.prev,new F(e,t.vars),!1)}return null}function M(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function R(e,t,n){this.prev=e,this.vars=t,this.block=n}function F(e,t){this.name=e,this.next=t}r(O,"pass"),r(I,"cont"),r(D,"inList"),r(L,"register"),r(A,"registerVarScoped"),r(M,"isModifier"),r(R,"Context"),r(F,"Var");var P=new F("this",new F("arguments",null));function j(){_.state.context=new R(_.state.context,_.state.localVars,!1),_.state.localVars=P}function V(){_.state.context=new R(_.state.context,_.state.localVars,!0),_.state.localVars=null}function U(){_.state.localVars=_.state.context.vars,_.state.context=_.state.context.prev}function B(e,t){var n=r((function(){var n=_.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new x(r,_.stream.column(),e,null,n.lexical,t)}),"result");return n.lex=!0,n}function $(){var e=_.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function q(e){function t(n){return n==e?I():";"==e||"}"==n||")"==n||"]"==n?O():I(t)}return r(t,"exp"),t}function H(e,t){return"var"==e?I(B("vardef",t),Oe,q(";"),$):"keyword a"==e?I(B("form"),K,H,$):"keyword b"==e?I(B("form"),H,$):"keyword d"==e?_.stream.match(/^\s*$/,!1)?I():I(B("stat"),X,q(";"),$):"debugger"==e?I(q(";")):"{"==e?I(B("}"),V,pe,$,U):";"==e?I():"if"==e?("else"==_.state.lexical.info&&_.state.cc[_.state.cc.length-1]==$&&_.state.cc.pop()(),I(B("form"),K,H,$,Re)):"function"==e?I(Ve):"for"==e?I(B("form"),V,Fe,H,U,$):"class"==e||d&&"interface"==t?(_.marked="keyword",I(B("form","class"==e?e:t),He,$)):"variable"==e?d&&"declare"==t?(_.marked="keyword",I(H)):d&&("module"==t||"enum"==t||"type"==t)&&_.stream.match(/^\s*\w/,!1)?(_.marked="keyword","enum"==t?I(nt):"type"==t?I(Be,q("operator"),ye,q(";")):I(B("form"),Ie,q("{"),B("}"),pe,$,$)):d&&"namespace"==t?(_.marked="keyword",I(B("form"),z,H,$)):d&&"abstract"==t?(_.marked="keyword",I(H)):I(B("stat"),ae):"switch"==e?I(B("form"),K,q("{"),B("}","switch"),V,pe,$,$,U):"case"==e?I(z,q(":")):"default"==e?I(q(":")):"catch"==e?I(B("form"),j,G,H,$,U):"export"==e?I(B("stat"),Ke,$):"import"==e?I(B("stat"),Xe,$):"async"==e?I(H):"@"==t?I(z,H):O(B("stat"),z,q(";"),$)}function G(e){if("("==e)return I($e,q(")"))}function z(e,t){return Q(e,t,!1)}function W(e,t){return Q(e,t,!0)}function K(e){return"("!=e?O():I(B(")"),X,q(")"),$)}function Q(e,t,n){if(_.state.fatArrowAt==_.stream.start){var r=n?ne:te;if("("==e)return I(j,B(")"),de($e,")"),$,q("=>"),r,U);if("variable"==e)return O(j,Ie,q("=>"),r,U)}var i=n?J:Y;return S.hasOwnProperty(e)?I(i):"function"==e?I(Ve,i):"class"==e||d&&"interface"==t?(_.marked="keyword",I(B("form"),qe,$)):"keyword c"==e||"async"==e?I(n?W:z):"("==e?I(B(")"),X,q(")"),$,i):"operator"==e||"spread"==e?I(n?W:z):"["==e?I(B("]"),tt,$,i):"{"==e?fe(le,"}",null,i):"quasi"==e?O(Z,i):"new"==e?I(re(n)):I()}function X(e){return e.match(/[;\}\)\],]/)?O():O(z)}function Y(e,t){return","==e?I(X):J(e,t,!1)}function J(e,t,n){var r=0==n?Y:J,i=0==n?z:W;return"=>"==e?I(j,n?ne:te,U):"operator"==e?/\+\+|--/.test(t)||d&&"!"==t?I(r):d&&"<"==t&&_.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?I(B(">"),de(ye,">"),$,r):"?"==t?I(z,q(":"),i):I(i):"quasi"==e?O(Z,r):";"!=e?"("==e?fe(W,")","call",r):"."==e?I(se,r):"["==e?I(B("]"),X,q("]"),$,r):d&&"as"==t?(_.marked="keyword",I(ye,r)):"regexp"==e?(_.state.lastType=_.marked="operator",_.stream.backUp(_.stream.pos-_.stream.start-1),I(i)):void 0:void 0}function Z(e,t){return"quasi"!=e?O():"${"!=t.slice(t.length-2)?I(Z):I(X,ee)}function ee(e){if("}"==e)return _.marked="string-2",_.state.tokenize=T,I(Z)}function te(e){return C(_.stream,_.state),O("{"==e?H:z)}function ne(e){return C(_.stream,_.state),O("{"==e?H:W)}function re(e){return function(t){return"."==t?I(e?oe:ie):"variable"==t&&d?I(Ne,e?J:Y):O(e?W:z)}}function ie(e,t){if("target"==t)return _.marked="keyword",I(Y)}function oe(e,t){if("target"==t)return _.marked="keyword",I(J)}function ae(e){return":"==e?I($,H):O(Y,q(";"),$)}function se(e){if("variable"==e)return _.marked="property",I()}function le(e,t){return"async"==e?(_.marked="property",I(le)):"variable"==e||"keyword"==_.style?(_.marked="property","get"==t||"set"==t?I(ue):(d&&_.state.fatArrowAt==_.stream.start&&(n=_.stream.match(/^\s*:\s*/,!1))&&(_.state.fatArrowAt=_.stream.pos+n[0].length),I(ce))):"number"==e||"string"==e?(_.marked=l?"property":_.style+" property",I(ce)):"jsonld-keyword"==e?I(ce):d&&M(t)?(_.marked="keyword",I(le)):"["==e?I(z,he,q("]"),ce):"spread"==e?I(W,ce):"*"==t?(_.marked="keyword",I(le)):":"==e?O(ce):void 0;var n}function ue(e){return"variable"!=e?O(ce):(_.marked="property",I(Ve))}function ce(e){return":"==e?I(W):"("==e?O(Ve):void 0}function de(e,t,n){function i(r,o){if(n?n.indexOf(r)>-1:","==r){var a=_.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),I((function(n,r){return n==t||r==t?O():O(e)}),i)}return r==t||o==t?I():n&&n.indexOf(";")>-1?O(e):I(q(t))}return r(i,"proceed"),function(n,r){return n==t||r==t?I():O(e,i)}}function fe(e,t,n){for(var r=3;r"),ye):"quasi"==e?O(we,xe):void 0}function be(e){if("=>"==e)return I(ye)}function Ee(e){return e.match(/[\}\)\]]/)?I():","==e||";"==e?I(Ee):O(Te,Ee)}function Te(e,t){return"variable"==e||"keyword"==_.style?(_.marked="property",I(Te)):"?"==t||"number"==e||"string"==e?I(Te):":"==e?I(ye):"["==e?I(q("variable"),me,q("]"),Te):"("==e?O(Ue,Te):e.match(/[;\}\)\],]/)?void 0:I()}function we(e,t){return"quasi"!=e?O():"${"!=t.slice(t.length-2)?I(we):I(ye,Ce)}function Ce(e){if("}"==e)return _.marked="string-2",_.state.tokenize=T,I(we)}function Se(e,t){return"variable"==e&&_.stream.match(/^\s*[?:]/,!1)||"?"==t?I(Se):":"==e?I(ye):"spread"==e?I(Se):O(ye)}function xe(e,t){return"<"==t?I(B(">"),de(ye,">"),$,xe):"|"==t||"."==e||"&"==t?I(ye):"["==e?I(ye,q("]"),xe):"extends"==t||"implements"==t?(_.marked="keyword",I(ye)):"?"==t?I(ye,q(":"),ye):void 0}function Ne(e,t){if("<"==t)return I(B(">"),de(ye,">"),$,xe)}function ke(){return O(ye,_e)}function _e(e,t){if("="==t)return I(ye)}function Oe(e,t){return"enum"==t?(_.marked="keyword",I(nt)):O(Ie,he,Ae,Me)}function Ie(e,t){return d&&M(t)?(_.marked="keyword",I(Ie)):"variable"==e?(L(t),I()):"spread"==e?I(Ie):"["==e?fe(Le,"]"):"{"==e?fe(De,"}"):void 0}function De(e,t){return"variable"!=e||_.stream.match(/^\s*:/,!1)?("variable"==e&&(_.marked="property"),"spread"==e?I(Ie):"}"==e?O():"["==e?I(z,q("]"),q(":"),De):I(q(":"),Ie,Ae)):(L(t),I(Ae))}function Le(){return O(Ie,Ae)}function Ae(e,t){if("="==t)return I(W)}function Me(e){if(","==e)return I(Oe)}function Re(e,t){if("keyword b"==e&&"else"==t)return I(B("form","else"),H,$)}function Fe(e,t){return"await"==t?I(Fe):"("==e?I(B(")"),Pe,$):void 0}function Pe(e){return"var"==e?I(Oe,je):"variable"==e?I(je):O(je)}function je(e,t){return")"==e?I():";"==e?I(je):"in"==t||"of"==t?(_.marked="keyword",I(z,je)):O(z,je)}function Ve(e,t){return"*"==t?(_.marked="keyword",I(Ve)):"variable"==e?(L(t),I(Ve)):"("==e?I(j,B(")"),de($e,")"),$,ge,H,U):d&&"<"==t?I(B(">"),de(ke,">"),$,Ve):void 0}function Ue(e,t){return"*"==t?(_.marked="keyword",I(Ue)):"variable"==e?(L(t),I(Ue)):"("==e?I(j,B(")"),de($e,")"),$,ge,U):d&&"<"==t?I(B(">"),de(ke,">"),$,Ue):void 0}function Be(e,t){return"keyword"==e||"variable"==e?(_.marked="type",I(Be)):"<"==t?I(B(">"),de(ke,">"),$):void 0}function $e(e,t){return"@"==t&&I(z,$e),"spread"==e?I($e):d&&M(t)?(_.marked="keyword",I($e)):d&&"this"==e?I(he,Ae):O(Ie,he,Ae)}function qe(e,t){return"variable"==e?He(e,t):Ge(e,t)}function He(e,t){if("variable"==e)return L(t),I(Ge)}function Ge(e,t){return"<"==t?I(B(">"),de(ke,">"),$,Ge):"extends"==t||"implements"==t||d&&","==e?("implements"==t&&(_.marked="keyword"),I(d?ye:z,Ge)):"{"==e?I(B("}"),ze,$):void 0}function ze(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||d&&M(t))&&_.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(_.marked="keyword",I(ze)):"variable"==e||"keyword"==_.style?(_.marked="property",I(We,ze)):"number"==e||"string"==e?I(We,ze):"["==e?I(z,he,q("]"),We,ze):"*"==t?(_.marked="keyword",I(ze)):d&&"("==e?O(Ue,ze):";"==e||","==e?I(ze):"}"==e?I():"@"==t?I(z,ze):void 0}function We(e,t){if("!"==t)return I(We);if("?"==t)return I(We);if(":"==e)return I(ye,Ae);if("="==t)return I(W);var n=_.state.lexical.prev;return O(n&&"interface"==n.info?Ue:Ve)}function Ke(e,t){return"*"==t?(_.marked="keyword",I(et,q(";"))):"default"==t?(_.marked="keyword",I(z,q(";"))):"{"==e?I(de(Qe,"}"),et,q(";")):O(H)}function Qe(e,t){return"as"==t?(_.marked="keyword",I(q("variable"))):"variable"==e?O(W,Qe):void 0}function Xe(e){return"string"==e?I():"("==e?O(z):"."==e?O(Y):O(Ye,Je,et)}function Ye(e,t){return"{"==e?fe(Ye,"}"):("variable"==e&&L(t),"*"==t&&(_.marked="keyword"),I(Ze))}function Je(e){if(","==e)return I(Ye,Je)}function Ze(e,t){if("as"==t)return _.marked="keyword",I(Ye)}function et(e,t){if("from"==t)return _.marked="keyword",I(z)}function tt(e){return"]"==e?I():O(de(W,"]"))}function nt(){return O(B("form"),Ie,q("{"),B("}"),de(rt,"}"),$,$)}function rt(){return O(Ie,Ae)}function it(e,t){return"operator"==e.lastType||","==e.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function ot(e,t,n){return t.tokenize==y&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return r(j,"pushcontext"),r(V,"pushblockcontext"),j.lex=V.lex=!0,r(U,"popcontext"),U.lex=!0,r(B,"pushlex"),r($,"poplex"),$.lex=!0,r(q,"expect"),r(H,"statement"),r(G,"maybeCatchBinding"),r(z,"expression"),r(W,"expressionNoComma"),r(K,"parenExpr"),r(Q,"expressionInner"),r(X,"maybeexpression"),r(Y,"maybeoperatorComma"),r(J,"maybeoperatorNoComma"),r(Z,"quasi"),r(ee,"continueQuasi"),r(te,"arrowBody"),r(ne,"arrowBodyNoComma"),r(re,"maybeTarget"),r(ie,"target"),r(oe,"targetNoComma"),r(ae,"maybelabel"),r(se,"property"),r(le,"objprop"),r(ue,"getterSetter"),r(ce,"afterprop"),r(de,"commasep"),r(fe,"contCommasep"),r(pe,"block"),r(he,"maybetype"),r(me,"maybetypeOrIn"),r(ge,"mayberettype"),r(ve,"isKW"),r(ye,"typeexpr"),r(be,"maybeReturnType"),r(Ee,"typeprops"),r(Te,"typeprop"),r(we,"quasiType"),r(Ce,"continueQuasiType"),r(Se,"typearg"),r(xe,"afterType"),r(Ne,"maybeTypeArgs"),r(ke,"typeparam"),r(_e,"maybeTypeDefault"),r(Oe,"vardef"),r(Ie,"pattern"),r(De,"proppattern"),r(Le,"eltpattern"),r(Ae,"maybeAssign"),r(Me,"vardefCont"),r(Re,"maybeelse"),r(Fe,"forspec"),r(Pe,"forspec1"),r(je,"forspec2"),r(Ve,"functiondef"),r(Ue,"functiondecl"),r(Be,"typename"),r($e,"funarg"),r(qe,"classExpression"),r(He,"className"),r(Ge,"classNameAfter"),r(ze,"classBody"),r(We,"classfield"),r(Ke,"afterExport"),r(Qe,"exportField"),r(Xe,"afterImport"),r(Ye,"importSpec"),r(Je,"maybeMoreImports"),r(Ze,"maybeAs"),r(et,"maybeFrom"),r(tt,"arrayLiteral"),r(nt,"enumdef"),r(rt,"enummember"),r(it,"isContinuedStatement"),r(ot,"expressionAllowed"),{startState:function(e){var n={tokenize:y,lastType:"sof",cc:[],lexical:new x((e||0)-a,0,"block",!1),localVars:t.localVars,context:t.localVars&&new R(null,null,!1),indented:e||0};return t.globalVars&&"object"==typeof t.globalVars&&(n.globalVars=t.globalVars),n},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),C(e,t)),t.tokenize!=E&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",k(t,r,n,i,e))},indent:function(e,n){if(e.tokenize==E||e.tokenize==T)return o.Pass;if(e.tokenize!=y)return 0;var r,i=n&&n.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(n))for(var u=e.cc.length-1;u>=0;--u){var c=e.cc[u];if(c==$)l=l.prev;else if(c!=Re&&c!=U)break}for(;("stat"==l.type||"form"==l.type)&&("}"==i||(r=e.cc[e.cc.length-1])&&(r==Y||r==J)&&!/^[,\.=+\-*:?[\(]/.test(n));)l=l.prev;s&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,f=i==d;return"vardef"==d?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==d&&"{"==i?l.indented:"form"==d?l.indented+a:"stat"==d?l.indented+(it(e,n)?s||a:0):"switch"!=l.info||f||0==t.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:a):l.indented+(/^(?:case|default)\b/.test(n)?a:2*a)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:u?null:"/*",blockCommentEnd:u?null:"*/",blockCommentContinue:u?null:" * ",lineComment:u?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:u?"json":"javascript",jsonldMode:l,jsonMode:u,expressionAllowed:ot,skipExpression:function(e){k(e,"atom","atom","true",new o.StringStream("",2,null))}}})),o.registerHelper("wordChars","javascript",/[\w$]/),o.defineMIME("text/javascript","javascript"),o.defineMIME("text/ecmascript","javascript"),o.defineMIME("application/javascript","javascript"),o.defineMIME("application/x-javascript","javascript"),o.defineMIME("application/ecmascript","javascript"),o.defineMIME("application/json",{name:"javascript",json:!0}),o.defineMIME("application/x-json",{name:"javascript",json:!0}),o.defineMIME("application/manifest+json",{name:"javascript",json:!0}),o.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),o.defineMIME("text/typescript",{name:"javascript",typescript:!0}),o.defineMIME("application/typescript",{name:"javascript",typescript:!0});var s=i({__proto__:null,default:a.exports},[a.exports]);e.j=s},void 0===(o=r.apply(t,i))||(e.exports=o)},4471:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535),n(8058)],void 0===(o="function"==typeof(r=function(e,t,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.j=void 0;var r=Object.defineProperty,i=(e,t)=>r(e,"name",{value:t,configurable:!0});function o(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}i(o,"_mergeNamespaces");var a={exports:{}};!function(e){function t(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function n(e){return e.phrase("Jump to line:")+' '+e.phrase("(Use line:column or scroll% syntax)")+""}function r(e,t){var n=Number(t);return/^[-+]/.test(t)?e.getCursor().line+n:n-1}e.defineOption("search",{bottom:!1}),i(t,"dialog"),i(n,"getJumpDialog"),i(r,"interpretLine"),e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,n(e),e.phrase("Jump to line:"),i.line+1+":"+i.ch,(function(t){var n;if(t)if(n=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(r(e,n[1]),Number(n[2]));else if(n=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var o=Math.round(e.lineCount()*Number(n[1])/100);/^[-+]/.test(n[1])&&(o=i.line+o+1),e.setCursor(o-1,i.ch)}else(n=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(r(e,n[1]),i.ch)}))},e.keyMap.default["Alt-G"]="jumpToLine"}(t.a.exports,n.a.exports);var s=o({__proto__:null,default:a.exports},[a.exports]);e.j=s})?r.apply(t,i):r)||(e.exports=o)},5980:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(2645),n(6856),n(9196),n(3573),n(1850),n(2635)],void 0===(o="function"==typeof(r=function(e,t,n,r,i,o,a){"use strict";var s=Object.defineProperty,l=(e,t)=>s(e,"name",{value:t,configurable:!0});function u(e,t){const n=t.target||t.srcElement;if(!(n instanceof HTMLElement))return;if("SPAN"!==(null==n?void 0:n.nodeName))return;const r=n.getBoundingClientRect(),i={left:(r.left+r.right)/2,top:(r.top+r.bottom)/2};e.state.jump.cursor=i,e.state.jump.isHoldingModifier&&h(e)}function c(e){e.state.jump.isHoldingModifier||!e.state.jump.cursor?e.state.jump.isHoldingModifier&&e.state.jump.marker&&m(e):e.state.jump.cursor=null}function d(t,n){if(t.state.jump.isHoldingModifier||!p(n.key))return;t.state.jump.isHoldingModifier=!0,t.state.jump.cursor&&h(t);const r=l((a=>{a.code===n.code&&(t.state.jump.isHoldingModifier=!1,t.state.jump.marker&&m(t),e.C.off(document,"keyup",r),e.C.off(document,"click",i),t.off("mousedown",o))}),"onKeyUp"),i=l((e=>{const{destination:n,options:r}=t.state.jump;n&&r.onClick(n,e)}),"onClick"),o=l(((e,n)=>{t.state.jump.destination&&(n.codemirrorIgnore=!0)}),"onMouseDown");e.C.on(document,"keyup",r),e.C.on(document,"click",i),t.on("mousedown",o)}e.C.defineOption("jump",!1,((t,n,r)=>{if(r&&r!==e.C.Init){const n=t.state.jump.onMouseOver;e.C.off(t.getWrapperElement(),"mouseover",n);const r=t.state.jump.onMouseOut;e.C.off(t.getWrapperElement(),"mouseout",r),e.C.off(document,"keydown",t.state.jump.onKeyDown),delete t.state.jump}if(n){const r=t.state.jump={options:n,onMouseOver:u.bind(null,t),onMouseOut:c.bind(null,t),onKeyDown:d.bind(null,t)};e.C.on(t.getWrapperElement(),"mouseover",r.onMouseOver),e.C.on(t.getWrapperElement(),"mouseout",r.onMouseOut),e.C.on(document,"keydown",r.onKeyDown)}})),l(u,"onMouseOver"),l(c,"onMouseOut"),l(d,"onKeyDown");const f="undefined"!=typeof navigator&&navigator&&navigator.appVersion.includes("Mac");function p(e){return e===(f?"Meta":"Control")}function h(e){if(e.state.jump.marker)return;const{cursor:t,options:n}=e.state.jump,r=e.coordsChar(t),i=e.getTokenAt(r,!0),o=n.getDestination||e.getHelper(r,"jump");if(o){const t=o(i,n,e);if(t){const n=e.markText({line:r.line,ch:i.start},{line:r.line,ch:i.end},{className:"CodeMirror-jump-token"});e.state.jump.marker=n,e.state.jump.destination=t}}}function m(e){const{marker:t}=e.state.jump;e.state.jump.marker=null,e.state.jump.destination=null,t.clear()}l(p,"isJumpModifier"),l(h,"enableJumpMode"),l(m,"disableJumpMode"),e.C.registerHelper("jump","graphql",((e,n)=>{if(!n.schema||!n.onClick||!e.state)return;const{state:r}=e,{kind:i,step:o}=r,a=(0,t.g)(n.schema,r);return"Field"===i&&0===o&&a.fieldDef||"AliasedField"===i&&2===o&&a.fieldDef?(0,t.a)(a):"Directive"===i&&1===o&&a.directiveDef?(0,t.b)(a):"Argument"===i&&0===o&&a.argDef?(0,t.c)(a):"EnumValue"===i&&a.enumValue?(0,t.d)(a):"NamedType"===i&&a.type?(0,t.e)(a):void 0}))})?r.apply(t,i):r)||(e.exports=o)},9444:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(3573),n(6856),n(5609),n(9196),n(1850)],r=function(e,t,n,r,i,o){"use strict";var a=Object.defineProperty,s=(e,t)=>a(e,"name",{value:t,configurable:!0});const l=[t.LoneSchemaDefinitionRule,t.UniqueOperationTypesRule,t.UniqueTypeNamesRule,t.UniqueEnumValueNamesRule,t.UniqueFieldDefinitionNamesRule,t.UniqueDirectiveNamesRule,t.KnownTypeNamesRule,t.KnownDirectivesRule,t.UniqueDirectivesPerLocationRule,t.PossibleTypeExtensionsRule,t.UniqueArgumentNamesRule,t.UniqueInputFieldNamesRule];function u(e,n,r,i,o){const a=t.specifiedRules.filter((e=>e!==t.NoUnusedFragmentsRule&&e!==t.ExecutableDefinitionsRule&&(!i||e!==t.KnownFragmentNamesRule)));return r&&Array.prototype.push.apply(a,r),o&&Array.prototype.push.apply(a,l),(0,t.validate)(e,n,a).filter((e=>{if(e.message.includes("Unknown directive")&&e.nodes){const n=e.nodes[0];if(n&&n.kind===t.Kind.DIRECTIVE){const e=n.name.value;if("arguments"===e||"argumentDefinitions"===e)return!1}}return!0}))}s(u,"validateWithCustomRules");const c={["Error"]:1,["Warning"]:2,["Information"]:3,["Hint"]:4},d=s(((e,t)=>{if(!e)throw new Error(t)}),"invariant");function f(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;var a,s;let l=null,u="";o&&(u="string"==typeof o?o:o.reduce(((e,n)=>e+(0,t.print)(n)+"\n\n"),""));const d=u?`${e}\n\n${u}`:e;try{l=(0,t.parse)(d)}catch(e){if(e instanceof t.GraphQLError){const t=m(null!==(s=null===(a=e.locations)||void 0===a?void 0:a[0])&&void 0!==s?s:{line:0,column:0},d);return[{severity:c.Error,message:e.message,source:"GraphQL: Syntax",range:t}]}throw e}return p(l,n,r,i)}function p(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!n)return[];const r=u(n,e,arguments.length>2?arguments[2]:void 0,arguments.length>3?arguments[3]:void 0).flatMap((e=>h(e,c.Error,"Validation"))),i=(0,t.validate)(n,e,[t.NoDeprecatedCustomRule]).flatMap((e=>h(e,c.Warning,"Deprecation")));return r.concat(i)}function h(e,t,n){if(!e.nodes)return[];const i=[];return e.nodes.forEach(((o,a)=>{const s="Variable"!==o.kind&&"name"in o&&void 0!==o.name?o.name:"variable"in o&&void 0!==o.variable?o.variable:o;if(s){d(e.locations,"GraphQL validation error requires locations.");const o=e.locations[a],l=g(s),u=o.column+(l.end-l.start);i.push({source:`GraphQL: ${n}`,message:e.message,severity:t,range:new r.R(new r.P(o.line-1,o.column-1),new r.P(o.line-1,u))})}})),i}function m(e,t){const i=(0,n.o)(),o=i.startState(),a=t.split("\n");d(a.length>=e.line,"Query text must have more lines than where the error happened");let s=null;for(let t=0;t{const{schema:r,validationRules:i,externalFragments:o}=n;return f(t,r,i,void 0,o).map((t=>({message:t.message,severity:t.severity?v[t.severity-1]:v[0],type:t.source?y[t.source]:void 0,from:e.C.Pos(t.range.start.line,t.range.start.character),to:e.C.Pos(t.range.end.line,t.range.end.character)})))}))},void 0===(o=r.apply(t,i))||(e.exports=o)},8535:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(3573),n(6856),n(9196),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i){"use strict";var o=Object.defineProperty,a=(e,t)=>o(e,"name",{value:t,configurable:!0});function s(e){l=e,u=e.length,c=d=f=-1,S(),x();const t=m();return E("EOF"),t}let l,u,c,d,f,p,h;function m(){const e=c,t=[];if(E("{"),!C("}")){do{t.push(g())}while(C(","));E("}")}return{kind:"Object",start:e,end:f,members:t}}function g(){const e=c,t="String"===h?b():null;E("String"),E(":");const n=y();return{kind:"Member",start:e,end:f,key:t,value:n}}function v(){const e=c,t=[];if(E("["),!C("]")){do{t.push(y())}while(C(","));E("]")}return{kind:"Array",start:e,end:f,values:t}}function y(){switch(h){case"[":return v();case"{":return m();case"String":case"Number":case"Boolean":case"Null":const e=b();return x(),e}E("Value")}function b(){return{kind:h,start:c,end:d,value:JSON.parse(l.slice(c,d))}}function E(e){if(h===e)return void x();let t;if("EOF"===h)t="[end of file]";else if(d-c>1)t="`"+l.slice(c,d)+"`";else{const e=l.slice(c).match(/^.+?\b/);t="`"+(e?e[0]:l[c])+"`"}throw w(`Expected ${e} but found ${t}.`)}a(s,"jsonParse"),a(m,"parseObj"),a(g,"parseMember"),a(v,"parseArr"),a(y,"parseVal"),a(b,"curToken"),a(E,"expect");class T extends Error{constructor(e,t){super(e),this.position=t}}function w(e){return new T(e,{start:c,end:d})}function C(e){if(h===e)return x(),!0}function S(){return d31;)if(92===p)switch(p=S(),p){case 34:case 47:case 92:case 98:case 102:case 110:case 114:case 116:S();break;case 117:S(),k(),k(),k(),k();break;default:throw w("Bad character escape sequence.")}else{if(d===u)throw w("Unterminated string.");S()}if(34!==p)throw w("Unterminated string.");S()}function k(){if(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102)return S();throw w("Expected hexadecimal digit.")}function _(){45===p&&S(),48===p?S():O(),46===p&&(S(),O()),69!==p&&101!==p||(p=S(),43!==p&&45!==p||S(),O())}function O(){if(p<48||p>57)throw w("Expected decimal digit.");do{S()}while(p>=48&&p<=57)}function I(e,t,n){const r=[];return n.members.forEach((n=>{var i;if(n){const o=null===(i=n.key)||void 0===i?void 0:i.value,a=t[o];a?D(a,n.value).forEach((t=>{let[n,i]=t;r.push(L(e,n,i))})):r.push(L(e,n.key,`Variable "$${o}" does not appear in any GraphQL query.`))}})),r}function D(e,n){if(!e||!n)return[];if(e instanceof t.GraphQLNonNull)return"Null"===n.kind?[[n,`Type "${e}" is non-nullable and cannot be null.`]]:D(e.ofType,n);if("Null"===n.kind)return[];if(e instanceof t.GraphQLList){const t=e.ofType;return"Array"===n.kind?M(n.values||[],(e=>D(t,e))):D(t,n)}if(e instanceof t.GraphQLInputObjectType){if("Object"!==n.kind)return[[n,`Type "${e}" must be an Object.`]];const r=Object.create(null),i=M(n.members,(t=>{var n;const i=null===(n=null==t?void 0:t.key)||void 0===n?void 0:n.value;r[i]=!0;const o=e.getFields()[i];return o?D(o?o.type:void 0,t.value):[[t.key,`Type "${e}" does not have a field "${i}".`]]}));return Object.keys(e.getFields()).forEach((o=>{const a=e.getFields()[o];!r[o]&&a.type instanceof t.GraphQLNonNull&&!a.defaultValue&&i.push([n,`Object of type "${e}" is missing required field "${o}".`])})),i}return"Boolean"===e.name&&"Boolean"!==n.kind||"String"===e.name&&"String"!==n.kind||"ID"===e.name&&"Number"!==n.kind&&"String"!==n.kind||"Float"===e.name&&"Number"!==n.kind||"Int"===e.name&&("Number"!==n.kind||(0|n.value)!==n.value)||(e instanceof t.GraphQLEnumType||e instanceof t.GraphQLScalarType)&&("String"!==n.kind&&"Number"!==n.kind&&"Boolean"!==n.kind&&"Null"!==n.kind||A(e.parseValue(n.value)))?[[n,`Expected value of type "${e}".`]]:[]}function L(e,t,n){return{message:n,severity:"error",type:"validation",from:e.posFromIndex(t.start),to:e.posFromIndex(t.end)}}function A(e){return null==e||e!=e}function M(e,t){return Array.prototype.concat.apply([],e.map(t))}a(T,"JSONSyntaxError"),a(w,"syntaxError"),a(C,"skip"),a(S,"ch"),a(x,"lex"),a(N,"readString"),a(k,"readHex"),a(_,"readNumber"),a(O,"readDigits"),e.C.registerHelper("lint","graphql-variables",((e,t,n)=>{if(!e)return[];let r;try{r=s(e)}catch(e){if(e instanceof T)return[L(n,e.position,e.message)];throw e}const{variableToType:i}=t;return i?I(n,i,r):[]})),a(I,"validateVariables"),a(D,"validateValue"),a(L,"lintError"),a(A,"isNullish"),a(M,"mapCat")})?r.apply(t,i):r)||(e.exports=o)},4054:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535)],void 0===(o="function"==typeof(r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.l=void 0;var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};!function(e){var t="CodeMirror-lint-markers",n="CodeMirror-lint-line-";function i(t,n,i){var o=document.createElement("div");function a(t){if(!o.parentNode)return e.off(document,"mousemove",a);o.style.top=Math.max(0,t.clientY-o.offsetHeight-5)+"px",o.style.left=t.clientX+5+"px"}return o.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme,o.appendChild(i.cloneNode(!0)),t.state.lint.options.selfContain?t.getWrapperElement().appendChild(o):document.body.appendChild(o),r(a,"position"),e.on(document,"mousemove",a),a(n),null!=o.style.opacity&&(o.style.opacity=1),o}function o(e){e.parentNode&&e.parentNode.removeChild(e)}function a(e){e.parentNode&&(null==e.style.opacity&&o(e),e.style.opacity=0,setTimeout((function(){o(e)}),600))}function s(t,n,o,s){var l=i(t,n,o);function u(){e.off(s,"mouseout",u),l&&(a(l),l=null)}r(u,"hide");var c=setInterval((function(){if(l)for(var e=s;;e=e.parentNode){if(e&&11==e.nodeType&&(e=e.host),e==document.body)return;if(!e){u();break}}if(!l)return clearInterval(c)}),400);e.on(s,"mouseout",u)}function l(e,t,n){for(var r in this.marked=[],t instanceof Function&&(t={getAnnotations:t}),t&&!0!==t||(t={}),this.options={},this.linterOptions=t.options||{},u)this.options[r]=u[r];for(var r in t)u.hasOwnProperty(r)?null!=t[r]&&(this.options[r]=t[r]):t.options||(this.linterOptions[r]=t[r]);this.timeout=null,this.hasGutter=n,this.onMouseOver=function(t){T(e,t)},this.waitingFor=0}r(i,"showTooltip"),r(o,"rm"),r(a,"hideTooltip"),r(s,"showTooltipFor"),r(l,"LintState");var u={highlightLines:!1,tooltips:!0,delay:500,lintOnChange:!0,getAnnotations:null,async:!1,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function c(e){var n=e.state.lint;n.hasGutter&&e.clearGutter(t),n.options.highlightLines&&d(e);for(var r=0;r-1)&&u.push(e.message)}));for(var d=null,g=i.hasGutter&&document.createDocumentFragment(),v=0;v1,o.tooltips)),o.highlightLines&&e.addLineClass(s,"wrap",n+d)}}o.onUpdateLinting&&o.onUpdateLinting(r,a,e)}}function b(e){var t=e.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){v(e)}),t.options.delay))}function E(e,t,n){for(var r=n.target||n.srcElement,i=document.createDocumentFragment(),o=0;on(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};e.a=o,function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function o(e){return e&&e.bracketRegex||/[(){}[\]]/}function a(e,t,r){var a=e.getLineHandle(t.line),l=t.ch-1,u=r&&r.afterCursor;null==u&&(u=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=o(r),d=!u&&l>=0&&c.test(a.text.charAt(l))&&i[a.text.charAt(l)]||c.test(a.text.charAt(l+1))&&i[a.text.charAt(++l)];if(!d)return null;var f=">"==d.charAt(1)?1:-1;if(r&&r.strict&&f>0!=(l==t.ch))return null;var p=e.getTokenTypeAt(n(t.line,l+1)),h=s(e,n(t.line,l+(f>0?1:0)),f,p,r);return null==h?null:{from:n(t.line,l),to:h&&h.pos,match:h&&h.ch==d.charAt(0),forward:f>0}}function s(e,t,r,a,s){for(var l=s&&s.maxScanLineLength||1e4,u=s&&s.maxScanLines||1e3,c=[],d=o(s),f=r>0?Math.min(t.line+u,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-u),p=t.line;p!=f;p+=r){var h=e.getLine(p);if(h){var m=r>0?0:h.length-1,g=r>0?h.length:-1;if(!(h.length>l))for(p==t.line&&(m=t.ch-(r<0?1:0));m!=g;m+=r){var v=h.charAt(m);if(d.test(v)&&(void 0===a||(e.getTokenTypeAt(n(p,m+1))||"")==(a||""))){var y=i[v];if(y&&">"==y.charAt(1)==r>0)c.push(v);else{if(!c.length)return{pos:n(p,m),ch:v};c.pop()}}}}}return p-r!=(r>0?e.lastLine():e.firstLine())&&null}function l(e,i,o){for(var s=e.state.matchBrackets.maxHighlightLineLength||1e3,l=o&&o.highlightNonMatching,u=[],c=e.listSelections(),d=0;da((e=>{const t=(0,n.o)({eatWhitespace:e=>e.eatWhile(n.i),lexRules:n.L,parseRules:n.P,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:r.i,electricInput:/^\s*[})\]]/,fold:"brace",lineComment:"#",closeBrackets:{pairs:'()[]{}""',explode:"()[]{}"}}}),"name",{value:"graphqlModeFactory",configurable:!0}))();e.C.defineMode("graphql",s)})?r.apply(t,i):r)||(e.exports=o)},1430:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(3573),n(6856),n(6592),n(9196),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i,o){"use strict";e.C.defineMode("graphql-results",(e=>{const t=(0,n.o)({eatWhitespace:e=>e.eatSpace(),lexRules:a,parseRules:s,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:r.i,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));const a={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},s={Document:[(0,n.p)("{"),(0,n.l)("Entry",(0,n.p)(",")),(0,n.p)("}")],Entry:[(0,n.t)("String","def"),(0,n.p)(":"),"Value"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[(0,n.t)("Number","number")],StringValue:[(0,n.t)("String","string")],BooleanValue:[(0,n.t)("Keyword","builtin")],NullValue:[(0,n.t)("Keyword","keyword")],ListValue:[(0,n.p)("["),(0,n.l)("Value",(0,n.p)(",")),(0,n.p)("]")],ObjectValue:[(0,n.p)("{"),(0,n.l)("ObjectField",(0,n.p)(",")),(0,n.p)("}")],ObjectField:[(0,n.t)("String","property"),(0,n.p)(":"),"Value"]}})?r.apply(t,i):r)||(e.exports=o)},3340:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[n(535),n(3573),n(6856),n(6592),n(9196),n(1850)],void 0===(o="function"==typeof(r=function(e,t,n,r,i,o){"use strict";var a=Object.defineProperty;e.C.defineMode("graphql-variables",(e=>{const t=(0,n.o)({eatWhitespace:e=>e.eatSpace(),lexRules:s,parseRules:l,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:r.i,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));const s={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},l={Document:[(0,n.p)("{"),(0,n.l)("Variable",(0,n.b)((0,n.p)(","))),(0,n.p)("}")],Variable:[u("variable"),(0,n.p)(":"),"Value"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[(0,n.t)("Number","number")],StringValue:[(0,n.t)("String","string")],BooleanValue:[(0,n.t)("Keyword","builtin")],NullValue:[(0,n.t)("Keyword","keyword")],ListValue:[(0,n.p)("["),(0,n.l)("Value",(0,n.b)((0,n.p)(","))),(0,n.p)("]")],ObjectValue:[(0,n.p)("{"),(0,n.l)("ObjectField",(0,n.b)((0,n.p)(","))),(0,n.p)("}")],ObjectField:[u("attribute"),(0,n.p)(":"),"Value"]};function u(e){return{style:e,match:e=>"String"===e.kind,update(e,t){e.name=t.value.slice(1,-1)}}}a(u,"name",{value:"namedKey",configurable:!0})})?r.apply(t,i):r)||(e.exports=o)},9509:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535),n(9407),n(8058)],r=function(e,t,n,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.s=void 0;var i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function a(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}o(a,"_mergeNamespaces");var s={exports:{}};!function(e){function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);if(n&&n.index==t.pos)return t.pos+=n[0].length||1,"searching";n?t.pos=n.index:t.skipToEnd()}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function a(e,t,n){return e.getSearchCursor(t,n,{caseFold:i(t),multiline:!0})}function s(e,t,n,r,i){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){m(e)},onKeyDown:i,bottom:e.options.search.bottom})}function l(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function u(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function c(e){return e.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"==t?"\\":e}))}function d(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(e){}else e=c(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function f(e,n,r){n.queryText=r,n.query=d(r),e.removeOverlay(n.overlay,i(n.query)),n.overlay=t(n.query,i(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,i(n.query)))}function p(t,n,i,a){var u=r(t);if(u.query)return h(t,n);var c=t.getSelection()||u.lastQuery;if(c instanceof RegExp&&"x^"==c.source&&(c=null),i&&t.openDialog){var d=null,p=o((function(n,r){e.e_stop(r),n&&(n!=u.queryText&&(f(t,u,n),u.posFrom=u.posTo=t.getCursor()),d&&(d.style.opacity=1),h(t,r.shiftKey,(function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((d=r).style.opacity=.4)})))}),"searchNext");s(t,v(t),c,p,(function(n,i){var o=e.keyName(n),a=t.getOption("extraKeys"),s=a&&a[o]||e.keyMap[t.getOption("keyMap")][o];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(e.e_stop(n),f(t,r(t),i),t.execCommand(s)):"find"!=s&&"findPersistent"!=s||(e.e_stop(n),p(i,n))})),a&&c&&(f(t,u,c),h(t,n))}else l(t,v(t),"Search for:",c,(function(e){e&&!u.query&&t.operation((function(){f(t,u,e),u.posFrom=u.posTo=t.getCursor(),h(t,n)}))}))}function h(t,n,i){t.operation((function(){var o=r(t),s=a(t,o.query,n?o.posFrom:o.posTo);(s.find(n)||(s=a(t,o.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(n))&&(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),o.posFrom=s.from(),o.posTo=s.to(),i&&i(s.from(),s.to()))}))}function m(e){e.operation((function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))}))}function g(e,t){var n=e?document.createElement(e):document.createDocumentFragment();for(var r in t)n[r]=t[r];for(var i=2;in(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};e.a=o,function(e){var t,n,i=e.Pos;function o(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}function a(e,t){for(var n=o(e),r=n,i=0;ic);d++){var f=e.getLine(u++);r=null==r?f:r+"\n"+f}o*=2,t.lastIndex=n.ch;var p=t.exec(r);if(p){var h=r.slice(0,p.index).split("\n"),m=p[0].split("\n"),g=n.line+h.length-1,v=h[h.length-1].length;return{from:i(g,v),to:i(g+m.length-1,1==m.length?v+m[0].length:m[m.length-1].length),match:p}}}}function c(e,t,n){for(var r,i=0;i<=e.length;){t.lastIndex=i;var o=t.exec(e);if(!o)break;var a=o.index+o[0].length;if(a>e.length-n)break;(!r||a>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function d(e,t,n){t=a(t,"g");for(var r=n.line,o=n.ch,s=e.firstLine();r>=s;r--,o=-1){var l=e.getLine(r),u=c(l,t,o<0?0:l.length-o);if(u)return{from:i(r,u.index),to:i(r,u.index+u[0].length),match:u}}}function f(e,t,n){if(!s(t))return d(e,t,n);t=a(t,"gm");for(var r,o=1,l=e.getLine(n.line).length-n.ch,u=n.line,f=e.firstLine();u>=f;){for(var p=0;p=f;p++){var h=e.getLine(u--);r=null==r?h:h+"\n"+r}o*=2;var m=c(r,t,l);if(m){var g=r.slice(0,m.index).split("\n"),v=m[0].split("\n"),y=u+g.length,b=g[g.length-1].length;return{from:i(y,b),to:i(y+v.length-1,1==v.length?b+v[0].length:v[v.length-1].length),match:m}}}}function p(e,t,n,r){if(e.length==t.length)return n;for(var i=0,o=n+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=r(e.slice(0,a)).length;if(s==n)return a;s>n?o=a:i=a+1}}function h(e,r,o,a){if(!r.length)return null;var s=a?t:n,l=s(r).split(/\r|\n\r?/);e:for(var u=o.line,c=o.ch,d=e.lastLine()+1-l.length;u<=d;u++,c=0){var f=e.getLine(u).slice(c),h=s(f);if(1==l.length){var m=h.indexOf(l[0]);if(-1==m)continue e;return o=p(f,h,m,s)+c,{from:i(u,p(f,h,m,s)+c),to:i(u,p(f,h,m+l[0].length,s)+c)}}var g=h.length-l[0].length;if(h.slice(g)==l[0]){for(var v=1;v=d;u--,c=-1){var f=e.getLine(u);c>-1&&(f=f.slice(0,c));var h=s(f);if(1==l.length){var m=h.lastIndexOf(l[0]);if(-1==m)continue e;return{from:i(u,p(f,h,m,s)),to:i(u,p(f,h,m+l[0].length,s))}}var g=l[l.length-1];if(h.slice(0,g.length)==g){var v=1;for(o=u-l.length+1;v(this.doc.getLine(n.line)||"").length&&(n.ch=0,n.line++)),0!=e.cmpPos(n,this.doc.clipPos(n))))return this.atOccurrence=!1;var r=this.matches(t,n);if(this.afterEmptyMatch=r&&0==e.cmpPos(r.from,r.to),r)return this.pos=r,this.atOccurrence=!0,this.pos.match||!0;var o=i(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to,n),this.pos.to=i(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new g(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new g(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))}(t.a.exports);var a=i({__proto__:null,default:o.exports},[o.exports]);e.s=a})?r.apply(t,i):r)||(e.exports=o)},6980:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535)],void 0===(o="function"==typeof(r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.s=void 0;var n=Object.defineProperty,r=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}r(i,"_mergeNamespaces");var o={exports:{}};!function(e){var t="CodeMirror-hint",n="CodeMirror-hint-active";function i(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}}e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var r={hint:t};if(n)for(var i in n)r[i]=n[i];return e.showHint(r)},e.defineExtension("showHint",(function(t){t=s(this,this.getCursor("start"),t);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var r=0;rf.clientHeight+1;if(setTimeout((function(){D=a.getScrollInfo()})),L.bottom-I>0){var M=L.bottom-L.top;if(E.top-(E.bottom-L.top)-M>0)f.style.top=(w=E.top-M-x)+"px",C=!1;else if(M>I){f.style.height=I-5+"px",f.style.top=(w=E.bottom-L.top-x)+"px";var R=a.getCursor();i.from.ch!=R.ch&&(E=a.cursorCoords(R),f.style.left=(T=E.left-S)+"px",L=f.getBoundingClientRect())}}var F,P=L.right-O;if(A&&(P+=a.display.nativeBarWidth),P>0&&(L.right-L.left>O&&(f.style.width=O-5+"px",P-=L.right-L.left-O),f.style.left=(T=E.left-P-S)+"px"),A)for(var j=f.firstChild;j;j=j.nextSibling)j.style.paddingRight=a.display.nativeBarWidth+"px";a.addKeyMap(this.keyMap=u(r,{moveFocus:function(e,t){o.changeActive(o.selectedHint+e,t)},setFocus:function(e){o.changeActive(e)},menuSize:function(){return o.screenAmount()},length:h.length,close:function(){r.close()},pick:function(){o.pick()},data:i})),r.options.closeOnUnfocus&&(a.on("blur",this.onBlur=function(){F=setTimeout((function(){r.close()}),100)}),a.on("focus",this.onFocus=function(){clearTimeout(F)})),a.on("scroll",this.onScroll=function(){var e=a.getScrollInfo(),t=a.getWrapperElement().getBoundingClientRect();D||(D=a.getScrollInfo());var n=w+D.top-e.top,i=n-(d.pageYOffset||(s.documentElement||s.body).scrollTop);if(C||(i+=f.offsetHeight),i<=t.top||i>=t.bottom)return r.close();f.style.top=n+"px",f.style.left=T+D.left-e.left+"px"}),e.on(f,"dblclick",(function(e){var t=c(f,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),o.pick())})),e.on(f,"click",(function(e){var t=c(f,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),r.options.completeOnSingleClick&&o.pick())})),e.on(f,"mousedown",(function(){setTimeout((function(){a.focus()}),20)}));var V=this.getSelectedHintRange();return 0===V.from&&0===V.to||this.scrollToActive(),e.signal(i,"select",h[this.selectedHint],f.childNodes[this.selectedHint]),!0}function f(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r0?t(e):a(r+1)}))}r(a,"run"),a(0)}),"resolved");return a.async=!0,a.supportsSelection=!0,a}return(i=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:i})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}i.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n],i=this;this.cm.operation((function(){r.hint?r.hint(i.cm,t,r):i.cm.replaceRange(l(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),i.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(a(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),n=this.cm.getLine(t.line);if(t.line!=this.startPos.line||n.length-t.ch!=this.startLen-this.startPos.ch||t.ch=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i&&(i.className=i.className.replace(" "+n,""),i.removeAttribute("aria-selected")),(i=this.hints.childNodes[this.selectedHint=t]).className+=" "+n,i.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",i.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],i)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],n=this.hints.childNodes[e.to],r=this.hints.firstChild;t.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+r.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},r(f,"applicableHelpers"),r(p,"fetchHints"),r(h,"resolveAutoHints"),e.registerHelper("hint","auto",{resolve:h}),e.registerHelper("hint","fromList",(function(t,n){var r,i=t.getCursor(),o=t.getTokenAt(i),a=e.Pos(i.line,o.start),s=i;o.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(t.a.exports);var a=i({__proto__:null,default:o.exports},[o.exports]);e.s=a})?r.apply(t,i):r)||(e.exports=o)},2568:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(535),n(9407),n(9171)],void 0===(o="function"==typeof(r=function(e,t,n,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.s=void 0;var i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0});function a(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}o(a,"_mergeNamespaces");var s={exports:{}};!function(e){var t=e.commands,n=e.Pos;function r(t,r,i){if(i<0&&0==r.ch)return t.clipPos(n(r.line-1));var o=t.getLine(r.line);if(i>0&&r.ch>=o.length)return t.clipPos(n(r.line+1,0));for(var a,s="start",l=r.ch,u=l,c=i<0?0:o.length,d=0;u!=c;u+=i,d++){var f=o.charAt(i<0?u-1:u),p="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==p&&f.toUpperCase()==f&&(p="W"),"start"==s)"o"!=p?(s="in",a=p):l=u+i;else if("in"==s&&a!=p){if("w"==a&&"W"==p&&i<0&&u--,"W"==a&&"w"==p&&i>0){if(u==l+1){a="w";continue}u--}break}}return n(r.line,u)}function i(e,t){e.extendSelectionsBy((function(n){return e.display.shift||e.doc.extend||n.empty()?r(e.doc,n.head,t):t<0?n.from():n.to()}))}function a(t,r){if(t.isReadOnly())return e.Pass;t.operation((function(){for(var e=t.listSelections().length,i=[],o=-1,a=0;a=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},t.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],i=0;io.line&&s==a.line&&0==a.ch||r.push({anchor:s==o.line?o:n(s,0),head:s==a.line?a:n(s)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;a--){var u=r[i[a]];if(!(l&&e.cmpPos(u.head,l)>0)){var c=s(t,u.head);l=c.from,t.replaceRange(n(c.word),c.from,c.to)}}}))}function m(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var i=s(t,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:t.getRange(n,r),word:i}}function g(e,t){var r=m(e);if(r){var i=r.query,o=e.getSearchCursor(i,t?r.to:r.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(i,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):r.word&&e.setSelection(r.from,r.to))}}o(d,"selectBetweenBrackets"),t.selectScope=function(e){d(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!d(t))return e.Pass},o(f,"puncType"),t.goToBracket=function(t){t.extendSelectionsBy((function(r){var i=t.scanForBracket(r.head,1,f(t.getTokenTypeAt(r.head)));if(i&&0!=e.cmpPos(i.pos,r.head))return i.pos;var o=t.scanForBracket(r.head,-1,f(t.getTokenTypeAt(n(r.head.line,r.head.ch+1))));return o&&n(o.pos.line,o.pos.ch+1)||r.head}))},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.firstLine()-1,a=[],s=0;so?i.push(u,c):i.length&&(i[i.length-1]=c),o=c}t.operation((function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+s,n(t.lastLine()),null,"+swapLine"):t.replaceRange(s+"\n",n(o,0),null,"+swapLine")}t.setSelections(a),t.scrollIntoView()}))},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.lastLine()+1,a=r.length-1;a>=0;a--){var s=r[a],l=s.to().line+1,u=s.from().line;0!=s.to().ch||s.empty()||l--,l=0;e-=2){var r=i[e],o=i[e+1],a=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(a+"\n",n(o,0),null,"+swapLine")}t.scrollIntoView()}))},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;o--){var a=r[o].head,s=t.getRange({line:a.line,ch:0},a),l=e.countColumn(s,null,t.getOption("tabSize")),u=t.findPosH(a,-1,"char",!1);if(s&&!/\S/.test(s)&&l%i==0){var c=new n(a.line,e.findColumn(s,l-i,i));c.ch!=a.ch&&(u=c)}t.replaceRange("",u,a,"+delete")}}))},t.delLineRight=function(e){e.operation((function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()}))},t.upcaseAtCursor=function(e){h(e,(function(e){return e.toUpperCase()}))},t.downcaseAtCursor=function(e){h(e,(function(e){return e.toLowerCase()}))},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},t.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},o(m,"getTarget"),o(g,"findAndGoTo"),t.findUnder=function(e){g(e,!0)},t.findUnderPrevious=function(e){g(e,!1)},t.findAllUnder=function(e){var t=m(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}};var v=e.keyMap;v.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(v.macSublime),v.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(v.pcSublime);var y=v.default==v.macDefault;v.sublime=y?v.macSublime:v.pcSublime}(t.a.exports,n.a.exports,r.a.exports);var l=a({__proto__:null,default:s.exports},[s.exports]);e.s=l})?r.apply(t,i):r)||(e.exports=o)},3691:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,void 0===(r="function"==typeof(n=function(e){"use strict";function t(e){return"object"==typeof e&&null!==e&&"subscribe"in e&&"function"==typeof e.subscribe}function n(e){return"object"==typeof e&&null!==e&&("AsyncGenerator"===e[Symbol.toStringTag]||Symbol.asyncIterator in e)}Object.defineProperty(e,"__esModule",{value:!0}),e.fetcherReturnToPromise=function(e){return Promise.resolve(e).then((e=>{return n(e)?(i=e,new Promise(((e,t)=>{var n;const r=null===(n=("return"in i?i:i[Symbol.asyncIterator]()).return)||void 0===n?void 0:n.bind(i);("next"in i?i:i[Symbol.asyncIterator]()).next.bind(i)().then((t=>{e(t.value),null==r||r()})).catch((e=>{t(e)}))}))):t(e)?(r=e,new Promise(((e,t)=>{const n=r.subscribe({next:t=>{e(t),n.unsubscribe()},error:t,complete:()=>{t(new Error("no value resolved"))}})}))):e;var r,i}))},e.isAsyncIterable=n,e.isObservable=t,e.isPromise=function(e){return"object"==typeof e&&null!==e&&"function"==typeof e.then}})?n.apply(t,[t]):n)||(e.exports=r)},5454:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(2501)],void 0===(o="function"==typeof(r=function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createGraphiQLFetcher=function(e){let n;if("undefined"!=typeof window&&window.fetch&&(n=window.fetch),null!==(null==e?void 0:e.enableIncrementalDelivery)&&!1===e.enableIncrementalDelivery||(e.enableIncrementalDelivery=!0),e.fetch&&(n=e.fetch),!n)throw new Error("No valid fetcher implementation available");const r=(0,t.createSimpleFetcher)(e,n),i=e.enableIncrementalDelivery?(0,t.createMultipartFetcher)(e,n):r;return(n,o)=>{if("IntrospectionQuery"===n.operationName)return(e.schemaFetcher||r)(n,o);if((null==o?void 0:o.documentAST)&&(0,t.isSubscriptionWithName)(o.documentAST,n.operationName||void 0)){const r=(0,t.getWsFetcher)(e,o);if(!r)throw new Error("Your GraphiQL createFetcher is not properly configured for websocket subscriptions yet. "+(e.subscriptionUrl?`Provided URL ${e.subscriptionUrl} failed`:"Please provide subscriptionUrl, wsClient or legacyClient option first."));return r(n)}return i(n,o)}}})?r.apply(t,i):r)||(e.exports=o)},1799:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(3080),n(5454)],void 0===(o="function"==typeof(r=function(e,t,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={createGraphiQLFetcher:!0};Object.defineProperty(e,"createGraphiQLFetcher",{enumerable:!0,get:function(){return n.createGraphiQLFetcher}}),Object.keys(t).forEach((function(n){"default"!==n&&"__esModule"!==n&&(Object.prototype.hasOwnProperty.call(r,n)||n in e&&e[n]===t[n]||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}}))}))})?r.apply(t,i):r)||(e.exports=o)},2501:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(3573),n(8488),n(8042)],r=function(e,t,r,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isSubscriptionWithName=e.getWsFetcher=e.createWebsocketsFetcherFromUrl=e.createWebsocketsFetcherFromClient=e.createSimpleFetcher=e.createMultipartFetcher=e.createLegacyWebsocketsFetcher=void 0;var o=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=function(e){return this instanceof a?(this.v=e,this):new a(e)},s=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}},l=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||l(e,t)}))})}function l(e,t){try{(n=i[e](t)).value instanceof a?Promise.resolve(n.value.v).then(u,c):d(o[0][2],n)}catch(e){d(o[0][3],e)}var n}function u(e){l("next",e)}function c(e){l("throw",e)}function d(e,t){e(t),o.shift(),o.length&&l(o[0][0],o[0][1])}};e.isSubscriptionWithName=(e,n)=>{let r=!1;return(0,t.visit)(e,{OperationDefinition(e){var t;n===(null===(t=e.name)||void 0===t?void 0:t.value)&&"subscription"===e.operation&&(r=!0)}}),r};e.createSimpleFetcher=(e,t)=>(n,r)=>o(void 0,void 0,void 0,(function*(){return(yield t(e.url,{method:"POST",body:JSON.stringify(n),headers:Object.assign(Object.assign({"content-type":"application/json"},e.headers),null==r?void 0:r.headers)})).json()}));const u=(e,t)=>{let r;try{const{createClient:i}=n(7674);return r=i({url:e,connectionParams:t}),c(r)}catch(t){if((e=>"object"==typeof e&&null!==e&&"code"in e)(t)&&"MODULE_NOT_FOUND"===t.code)throw new Error("You need to install the 'graphql-ws' package to use websockets when passing a 'subscriptionUrl'");console.error(`Error creating websocket client for ${e}`,t)}};e.createWebsocketsFetcherFromUrl=u;const c=e=>t=>(0,i.makeAsyncIterableIteratorFromSink)((n=>e.subscribe(t,Object.assign(Object.assign({},n),{error:e=>{e instanceof CloseEvent?n.error(new Error(`Socket closed with event ${e.code} ${e.reason||""}`.trim())):n.error(e)}}))));e.createWebsocketsFetcherFromClient=c;const d=e=>t=>{const n=e.request(t);return(0,i.makeAsyncIterableIteratorFromSink)((e=>n.subscribe(e).unsubscribe))};e.createLegacyWebsocketsFetcher=d;e.createMultipartFetcher=(e,t)=>function(n,o){return l(this,arguments,(function*(){var l,u;const c=yield a(t(e.url,{method:"POST",body:JSON.stringify(n),headers:Object.assign(Object.assign({"content-type":"application/json",accept:"application/json, multipart/mixed"},e.headers),null==o?void 0:o.headers)}).then((e=>(0,r.meros)(e,{multiple:!0}))));if(!(0,i.isAsyncIterable)(c))return yield a(yield yield a(c.json()));try{for(var d,f=s(c);!(d=yield a(f.next())).done;){const e=d.value;if(e.some((e=>!e.json))){const t=e.map((e=>`Headers::\n${e.headers}\n\nBody::\n${e.body}`));throw new Error(`Expected multipart chunks to be of json type. got:\n${t}`)}yield yield a(e.map((e=>e.body)))}}catch(e){l={error:e}}finally{try{d&&!d.done&&(u=f.return)&&(yield a(u.call(f)))}finally{if(l)throw l.error}}}))};e.getWsFetcher=(e,t)=>{if(e.wsClient)return c(e.wsClient);if(e.subscriptionUrl)return u(e.subscriptionUrl,Object.assign(Object.assign({},e.wsConnectionParams),null==t?void 0:t.headers));const n=e.legacyClient||e.legacyWsClient;return n?d(n):void 0}},void 0===(o=r.apply(t,i))||(e.exports=o)},3080:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,void 0===(r="function"==typeof(n=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})})?n.apply(t,[t]):n)||(e.exports=r)},4574:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,void 0===(r="function"==typeof(n=function(e){"use strict";function t(e){return JSON.stringify(e,null,2)}function n(e){return e instanceof Error?function(e){return Object.assign(Object.assign({},e),{message:e.message,stack:e.stack})}(e):e}Object.defineProperty(e,"__esModule",{value:!0}),e.formatError=function(e){return Array.isArray(e)?t({errors:e.map((e=>n(e)))}):t({errors:[n(e)]})},e.formatResult=function(e){return t(e)}})?n.apply(t,[t]):n)||(e.exports=r)},3738:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(3573)],void 0===(o="function"==typeof(r=function(e,t){"use strict";function n(e){if(!("getFields"in e))return[];const n=e.getFields();if(n.id)return["id"];if(n.edges)return["edges"];if(n.node)return["node"];const r=[];return Object.keys(n).forEach((e=>{(0,t.isLeafType)(n[e].type)&&r.push(e)})),r}function r(e,n){const i=(0,t.getNamedType)(e);if(!e||(0,t.isLeafType)(e))return;const o=n(i);return Array.isArray(o)&&0!==o.length&&"getFields"in i?{kind:t.Kind.SELECTION_SET,selections:o.map((e=>{const o=i.getFields()[e],a=o?o.type:null;return{kind:t.Kind.FIELD,name:{kind:t.Kind.NAME,value:e},selectionSet:r(a,n)}}))}:void 0}function i(e,t){if(0===t.length)return e;let n="",r=0;return t.forEach((t=>{let{index:i,string:o}=t;n+=e.slice(r,i)+o,r=i})),n+=e.slice(r),n}Object.defineProperty(e,"__esModule",{value:!0}),e.fillLeafs=function(e,o,a){const s=[];if(!e||!o)return{insertions:s,result:o};let l;try{l=(0,t.parse)(o)}catch(e){return{insertions:s,result:o}}const u=a||n,c=new t.TypeInfo(e);return(0,t.visit)(l,{leave(e){c.leave(e)},enter(e){if(c.enter(e),"Field"===e.kind&&!e.selectionSet){const n=r(function(e){if(e)return e}(c.getType()),u);if(n&&e.loc){const r=function(e,t){let n=t,r=t;for(;n;){const t=e.charCodeAt(n-1);if(10===t||13===t||8232===t||8233===t)break;n--,9!==t&&11!==t&&12!==t&&32!==t&&160!==t&&(r=n)}return e.slice(n,r)}(o,e.loc.start);s.push({index:e.loc.end,string:" "+(0,t.print)(n).replaceAll("\n","\n"+r)})}}}}),{insertions:s,result:i(o,s)}}})?r.apply(t,i):r)||(e.exports=o)},7293:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(3738),n(5682),n(1312)],void 0===(o="function"==typeof(r=function(e,t,n,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach((function(n){"default"!==n&&"__esModule"!==n&&(n in e&&e[n]===t[n]||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}}))})),Object.keys(n).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===n[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}}))})),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===r[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}}))}))})?r.apply(t,i):r)||(e.exports=o)},5682:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(3573)],void 0===(o="function"==typeof(r=function(e,t){"use strict";function n(e,r,i){var o;const a=i?(0,t.getNamedType)(i).name:null,s=[],l=[];for(let u of r){if("FragmentSpread"===u.kind){const n=u.name.value;if(!u.directives||0===u.directives.length){if(l.includes(n))continue;l.push(n)}const r=e[u.name.value];if(r){const{typeCondition:e,directives:n,selectionSet:i}=r;u={kind:t.Kind.INLINE_FRAGMENT,typeCondition:e,directives:n,selectionSet:i}}}if(u.kind===t.Kind.INLINE_FRAGMENT&&(!u.directives||0===(null===(o=u.directives)||void 0===o?void 0:o.length))){const t=u.typeCondition?u.typeCondition.name.value:null;if(!t||t===a){s.push(...n(e,u.selectionSet.selections,i));continue}}s.push(u)}return s}Object.defineProperty(e,"__esModule",{value:!0}),e.mergeAst=function(e,r){const i=r?new t.TypeInfo(r):null,o=Object.create(null);for(const n of e.definitions)n.kind===t.Kind.FRAGMENT_DEFINITION&&(o[n.name.value]=n);const a={SelectionSet(e){const t=i?i.getParentType():null;let{selections:r}=e;return r=n(o,r,t),r=function(e,t){var n;const r=new Map,i=[];for(const o of e)if("Field"===o.kind){const e=t(o),a=r.get(e);if(null===(n=o.directives)||void 0===n?void 0:n.length){const e=Object.assign({},o);i.push(e)}else if((null==a?void 0:a.selectionSet)&&o.selectionSet)a.selectionSet.selections=[...a.selectionSet.selections,...o.selectionSet.selections];else if(!a){const t=Object.assign({},o);r.set(e,t),i.push(t)}}else i.push(o);return i}(r,(e=>e.alias?e.alias.value:e.name.value)),Object.assign(Object.assign({},e),{selections:r})},FragmentDefinition(){return null}};return(0,t.visit)(e,i?(0,t.visitWithTypeInfo)(i,a):a)}})?r.apply(t,i):r)||(e.exports=o)},1312:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,void 0===(r="function"==typeof(n=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSelectedOperationName=function(e,t,n){if(!n||n.length<1)return;const r=n.map((e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.value}));if(t&&r.includes(t))return t;if(t&&e){const n=e.map((e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.value})).indexOf(t);if(-1!==n&&n{for(const e in window.localStorage)0===e.indexOf(`${t}:`)&&window.localStorage.removeItem(e)}}}get(e){if(!this.storage)return null;const n=`${t}:${e}`,r=this.storage.getItem(n);return"null"===r||"undefined"===r?(this.storage.removeItem(n),null):r||null}set(e,n){let r=!1,i=null;if(this.storage){const o=`${t}:${e}`;if(n)try{this.storage.setItem(o,n)}catch(e){i=e instanceof Error?e:new Error(`${e}`),r=function(e,t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==e.length}(this.storage,e)}else this.storage.removeItem(o)}return{isQuotaError:r,error:i}}clear(){this.storage&&this.storage.clear()}};const t="graphiql"})?n.apply(t,[t]):n)||(e.exports=r)},1925:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(3573),n(6837)],void 0===(o="function"==typeof(r=function(e,t,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryStore=void 0;e.HistoryStore=class{constructor(e,t){this.storage=e,this.maxHistoryLength=t,this.updateHistory=(e,t,n,r)=>{if(this.shouldSaveQuery(e,t,n,this.history.fetchRecent())){this.history.push({query:e,variables:t,headers:n,operationName:r});const i=this.history.items,o=this.favorite.items;this.queries=i.concat(o)}},this.history=new n.QueryStore("queries",this.storage,this.maxHistoryLength),this.favorite=new n.QueryStore("favorites",this.storage,null),this.queries=[...this.history.fetchAll(),...this.favorite.fetchAll()]}shouldSaveQuery(e,n,r,i){if(!e)return!1;try{(0,t.parse)(e)}catch(e){return!1}if(e.length>1e5)return!1;if(!i)return!0;if(JSON.stringify(e)===JSON.stringify(i.query)){if(JSON.stringify(n)===JSON.stringify(i.variables)){if(JSON.stringify(r)===JSON.stringify(i.headers))return!1;if(r&&!i.headers)return!1}if(n&&!i.variables)return!1}return!0}toggleFavorite(e,t,n,r,i,o){const a={query:e,variables:t,headers:n,operationName:r,label:i};this.favorite.contains(a)?o&&(a.favorite=!1,this.favorite.delete(a)):(a.favorite=!0,this.favorite.push(a)),this.queries=[...this.history.items,...this.favorite.items]}editLabel(e,t,n,r,i,o){const a={query:e,variables:t,headers:n,operationName:r,label:i};o?this.favorite.edit(Object.assign(Object.assign({},a),{favorite:o})):this.history.edit(a),this.queries=[...this.history.items,...this.favorite.items]}}})?r.apply(t,i):r)||(e.exports=o)},920:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(1180),n(1925),n(6837)],void 0===(o="function"==typeof(r=function(e,t,n,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach((function(n){"default"!==n&&"__esModule"!==n&&(n in e&&e[n]===t[n]||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}}))})),Object.keys(n).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===n[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}}))})),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&(t in e&&e[t]===r[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}}))}))})?r.apply(t,i):r)||(e.exports=o)},6837:function(e,t){var n,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,n=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryStore=void 0;e.QueryStore=class{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.key=e,this.storage=t,this.maxSize=n,this.items=this.fetchAll()}get length(){return this.items.length}contains(e){return this.items.some((t=>t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName))}edit(e){const t=this.items.findIndex((t=>t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName));-1!==t&&(this.items.splice(t,1,e),this.save())}delete(e){const t=this.items.findIndex((t=>t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName));-1!==t&&(this.items.splice(t,1),this.save())}fetchRecent(){return this.items.at(-1)}fetchAll(){const e=this.storage.get(this.key);return e?JSON.parse(e)[this.key]:[]}push(e){const t=[...this.items,e];this.maxSize&&t.length>this.maxSize&&t.shift();for(let e=0;e<5;e++){const e=this.storage.set(this.key,JSON.stringify({[this.key]:t}));if(null==e?void 0:e.error){if(!e.isQuotaError||!this.maxSize)return;t.shift()}else this.items=t}}save(){this.storage.set(this.key,JSON.stringify({[this.key]:this.items}))}}},void 0===(r=n.apply(t,[t]))||(e.exports=r)},6676:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(7139),n(7644),n(3573),n(8506),n(5251),n(2162),n(5605),n(6785)],void 0===(o="function"==typeof(r=function(e,t,n,r,i,o,a,s,l){"use strict";function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,t=c(t),r=c(r),i.GraphiQL.createFetcher=n.createGraphiQLFetcher,i.GraphiQL.GraphQL=r,i.GraphiQL.React=t;var d=i.GraphiQL;e.default=d})?r.apply(t,i):r)||(e.exports=o)},8506:function(e,t,n){var r,i,o;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[t,n(9196),n(7139)],r=function(e,t,n){"use strict";function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"first"===e&&(null==p||p.setVisiblePlugin(null))},sizeThresholdSecond:200,storageKey:"docExplorerFlex"}),T=(0,n.useDragResize)({direction:"horizontal",storageKey:"editorFlex"}),w=(0,n.useDragResize)({defaultSizeRelation:3,direction:"vertical",initiallyHidden:(()=>{if("variables"!==e.defaultEditorToolsVisibility&&"headers"!==e.defaultEditorToolsVisibility)return"boolean"==typeof e.defaultEditorToolsVisibility?e.defaultEditorToolsVisibility?void 0:"second":l.initialVariables||l.initialHeaders?void 0:"second"})(),sizeThresholdSecond:60,storageKey:"secondaryEditorFlex"}),[C,S]=(0,t.useState)((()=>"variables"===e.defaultEditorToolsVisibility||"headers"===e.defaultEditorToolsVisibility?e.defaultEditorToolsVisibility:!l.initialVariables&&l.initialHeaders&&s?"headers":"variables")),[x,N]=(0,t.useState)(null),[k,_]=(0,t.useState)(null),O=t.default.Children.toArray(e.children),I=O.find((e=>c(e,o.Logo)))||t.default.createElement(o.Logo,null),D=O.find((e=>c(e,o.Toolbar)))||t.default.createElement(t.default.Fragment,null,t.default.createElement(n.ToolbarButton,{onClick:()=>g(),label:"Prettify query (Shift-Ctrl-P)"},t.default.createElement(n.PrettifyIcon,{className:"graphiql-toolbar-icon","aria-hidden":"true"})),t.default.createElement(n.ToolbarButton,{onClick:()=>m(),label:"Merge fragments into query (Shift-Ctrl-M)"},t.default.createElement(n.MergeIcon,{className:"graphiql-toolbar-icon","aria-hidden":"true"})),t.default.createElement(n.ToolbarButton,{onClick:()=>h(),label:"Copy query (Shift-Ctrl-C)"},t.default.createElement(n.CopyIcon,{className:"graphiql-toolbar-icon","aria-hidden":"true"})),(null===(a=e.toolbar)||void 0===a?void 0:a.additionalContent)||null),L=O.find((e=>c(e,o.Footer))),A=()=>{"first"===E.hiddenElement&&E.setHiddenElement(null)},M=0===window.navigator.platform.toLowerCase().indexOf("mac")?t.default.createElement("code",{className:"graphiql-key"},"Cmd"):t.default.createElement("code",{className:"graphiql-key"},"Ctrl");return t.default.createElement("div",{"data-testid":"graphiql-container",className:"graphiql-container"},t.default.createElement("div",{className:"graphiql-sidebar"},t.default.createElement("div",{className:"graphiql-sidebar-section"},null==p?void 0:p.plugins.map((e=>{const r=e===p.visiblePlugin,i=`${r?"Hide":"Show"} ${e.title}`,o=e.icon;return t.default.createElement(n.Tooltip,{key:e.title,label:i},t.default.createElement(n.UnStyledButton,{type:"button",className:r?"active":"",onClick:()=>{r?(p.setVisiblePlugin(null),E.setHiddenElement("first")):(p.setVisiblePlugin(e),E.setHiddenElement(null))},"aria-label":i},t.default.createElement(o,{"aria-hidden":"true"})))}))),t.default.createElement("div",{className:"graphiql-sidebar-section"},t.default.createElement(n.Tooltip,{label:"Re-fetch GraphQL schema"},t.default.createElement(n.UnStyledButton,{type:"button",disabled:d.isFetching,onClick:()=>d.introspect(),"aria-label":"Re-fetch GraphQL schema"},t.default.createElement(n.ReloadIcon,{className:d.isFetching?"graphiql-spin":"","aria-hidden":"true"}))),t.default.createElement(n.Tooltip,{label:"Open short keys dialog"},t.default.createElement(n.UnStyledButton,{type:"button",onClick:()=>N("short-keys"),"aria-label":"Open short keys dialog"},t.default.createElement(n.KeyboardShortcutIcon,{"aria-hidden":"true"}))),t.default.createElement(n.Tooltip,{label:"Open settings dialog"},t.default.createElement(n.UnStyledButton,{type:"button",onClick:()=>N("settings"),"aria-label":"Open settings dialog"},t.default.createElement(n.SettingsIcon,{"aria-hidden":"true"}))))),t.default.createElement("div",{className:"graphiql-main"},t.default.createElement("div",{ref:E.firstRef,style:{minWidth:"200px"}},t.default.createElement("div",{className:"graphiql-plugin"},b?t.default.createElement(b,null):null)),t.default.createElement("div",{ref:E.dragBarRef},null!=p&&p.visiblePlugin?t.default.createElement("div",{className:"graphiql-horizontal-drag-bar"}):null),t.default.createElement("div",{ref:E.secondRef,style:{minWidth:0}},t.default.createElement("div",{className:"graphiql-sessions"},t.default.createElement("div",{className:"graphiql-session-header"},t.default.createElement(n.Tabs,{"aria-label":"Select active operation"},l.tabs.length>1?t.default.createElement(t.default.Fragment,null,l.tabs.map(((e,r)=>t.default.createElement(n.Tab,{key:e.id,isActive:r===l.activeTabIndex},t.default.createElement(n.Tab.Button,{"aria-controls":"graphiql-session",id:`graphiql-session-tab-${r}`,onClick:()=>{u.stop(),l.changeTab(r)}},e.title),t.default.createElement(n.Tab.Close,{onClick:()=>{l.activeTabIndex===r&&u.stop(),l.closeTab(r)}})))),t.default.createElement("div",null,t.default.createElement(n.Tooltip,{label:"Add tab"},t.default.createElement(n.UnStyledButton,{type:"button",className:"graphiql-tab-add",onClick:()=>l.addTab(),"aria-label":"Add tab"},t.default.createElement(n.PlusIcon,{"aria-hidden":"true"}))))):null),t.default.createElement("div",{className:"graphiql-session-header-right"},1===l.tabs.length?t.default.createElement("div",{className:"graphiql-add-tab-wrapper"},t.default.createElement(n.Tooltip,{label:"Add tab"},t.default.createElement(n.UnStyledButton,{type:"button",className:"graphiql-tab-add",onClick:()=>l.addTab(),"aria-label":"Add tab"},t.default.createElement(n.PlusIcon,{"aria-hidden":"true"})))):null,I)),t.default.createElement("div",{role:"tabpanel",id:"graphiql-session",className:"graphiql-session","aria-labelledby":`graphiql-session-tab-${l.activeTabIndex}`},t.default.createElement("div",{ref:T.firstRef},t.default.createElement("div",{className:"graphiql-editors"+(1===l.tabs.length?" full-height":"")},t.default.createElement("div",{ref:w.firstRef},t.default.createElement("section",{className:"graphiql-query-editor","aria-label":"Query Editor"},t.default.createElement("div",{className:"graphiql-query-editor-wrapper"},t.default.createElement(n.QueryEditor,{editorTheme:e.editorTheme,keyMap:e.keyMap,onClickReference:A,onCopyQuery:e.onCopyQuery,onEdit:e.onEditQuery,readOnly:e.readOnly})),t.default.createElement("div",{className:"graphiql-toolbar",role:"toolbar","aria-label":"Editor Commands"},t.default.createElement(n.ExecuteButton,null),D))),t.default.createElement("div",{ref:w.dragBarRef},t.default.createElement("div",{className:"graphiql-editor-tools"},t.default.createElement("div",{className:"graphiql-editor-tools-tabs"},t.default.createElement(n.UnStyledButton,{type:"button",className:"variables"===C&&"second"!==w.hiddenElement?"active":"",onClick:()=>{"second"===w.hiddenElement&&w.setHiddenElement(null),S("variables")}},"Variables"),s?t.default.createElement(n.UnStyledButton,{type:"button",className:"headers"===C&&"second"!==w.hiddenElement?"active":"",onClick:()=>{"second"===w.hiddenElement&&w.setHiddenElement(null),S("headers")}},"Headers"):null),t.default.createElement(n.Tooltip,{label:"second"===w.hiddenElement?"Show editor tools":"Hide editor tools"},t.default.createElement(n.UnStyledButton,{type:"button",onClick:()=>{w.setHiddenElement("second"===w.hiddenElement?null:"second")},"aria-label":"second"===w.hiddenElement?"Show editor tools":"Hide editor tools"},"second"===w.hiddenElement?t.default.createElement(n.ChevronUpIcon,{className:"graphiql-chevron-icon","aria-hidden":"true"}):t.default.createElement(n.ChevronDownIcon,{className:"graphiql-chevron-icon","aria-hidden":"true"}))))),t.default.createElement("div",{ref:w.secondRef},t.default.createElement("section",{className:"graphiql-editor-tool","aria-label":"variables"===C?"Variables":"Headers"},t.default.createElement(n.VariableEditor,{editorTheme:e.editorTheme,isHidden:"variables"!==C,keyMap:e.keyMap,onEdit:e.onEditVariables,onClickReference:A,readOnly:e.readOnly}),s&&t.default.createElement(n.HeaderEditor,{editorTheme:e.editorTheme,isHidden:"headers"!==C,keyMap:e.keyMap,onEdit:e.onEditHeaders,readOnly:e.readOnly}))))),t.default.createElement("div",{ref:T.dragBarRef},t.default.createElement("div",{className:"graphiql-horizontal-drag-bar"})),t.default.createElement("div",{ref:T.secondRef},t.default.createElement("div",{className:"graphiql-response"},u.isFetching?t.default.createElement(n.Spinner,null):null,t.default.createElement(n.ResponseEditor,{editorTheme:e.editorTheme,responseTooltip:e.responseTooltip,keyMap:e.keyMap}),L)))))),t.default.createElement(n.Dialog,{isOpen:"short-keys"===x,onDismiss:()=>N(null)},t.default.createElement("div",{className:"graphiql-dialog-header"},t.default.createElement("div",{className:"graphiql-dialog-title"},"Short Keys"),t.default.createElement(n.Dialog.Close,{onClick:()=>N(null)})),t.default.createElement("div",{className:"graphiql-dialog-section"},t.default.createElement("div",null,t.default.createElement("table",{className:"graphiql-table"},t.default.createElement("thead",null,t.default.createElement("tr",null,t.default.createElement("th",null,"Short key"),t.default.createElement("th",null,"Function"))),t.default.createElement("tbody",null,t.default.createElement("tr",null,t.default.createElement("td",null,M," + ",t.default.createElement("code",{className:"graphiql-key"},"F")),t.default.createElement("td",null,"Search in editor")),t.default.createElement("tr",null,t.default.createElement("td",null,M," + ",t.default.createElement("code",{className:"graphiql-key"},"K")),t.default.createElement("td",null,"Search in documentation")),t.default.createElement("tr",null,t.default.createElement("td",null,M," + ",t.default.createElement("code",{className:"graphiql-key"},"Enter")),t.default.createElement("td",null,"Execute query")),t.default.createElement("tr",null,t.default.createElement("td",null,t.default.createElement("code",{className:"graphiql-key"},"Ctrl")," + ",t.default.createElement("code",{className:"graphiql-key"},"Shift")," + ",t.default.createElement("code",{className:"graphiql-key"},"P")),t.default.createElement("td",null,"Prettify editors")),t.default.createElement("tr",null,t.default.createElement("td",null,t.default.createElement("code",{className:"graphiql-key"},"Ctrl")," + ",t.default.createElement("code",{className:"graphiql-key"},"Shift")," + ",t.default.createElement("code",{className:"graphiql-key"},"M")),t.default.createElement("td",null,"Merge fragments definitions into operation definition")),t.default.createElement("tr",null,t.default.createElement("td",null,t.default.createElement("code",{className:"graphiql-key"},"Ctrl")," + ",t.default.createElement("code",{className:"graphiql-key"},"Shift")," + ",t.default.createElement("code",{className:"graphiql-key"},"C")),t.default.createElement("td",null,"Copy query")),t.default.createElement("tr",null,t.default.createElement("td",null,t.default.createElement("code",{className:"graphiql-key"},"Ctrl")," + ",t.default.createElement("code",{className:"graphiql-key"},"Shift")," + ",t.default.createElement("code",{className:"graphiql-key"},"R")),t.default.createElement("td",null,"Re-fetch schema using introspection")))),t.default.createElement("p",null,"The editors use"," ",t.default.createElement("a",{href:"https://codemirror.net/5/doc/manual.html#keymaps",target:"_blank",rel:"noopener noreferrer"},"CodeMirror Key Maps")," ","that add more short keys. This instance of Graph",t.default.createElement("em",null,"i"),"QL uses"," ",t.default.createElement("code",null,e.keyMap||"sublime"),".")))),t.default.createElement(n.Dialog,{isOpen:"settings"===x,onDismiss:()=>{N(null),_(null)}},t.default.createElement("div",{className:"graphiql-dialog-header"},t.default.createElement("div",{className:"graphiql-dialog-title"},"Settings"),t.default.createElement(n.Dialog.Close,{onClick:()=>{N(null),_(null)}})),e.showPersistHeadersSettings?t.default.createElement("div",{className:"graphiql-dialog-section"},t.default.createElement("div",null,t.default.createElement("div",{className:"graphiql-dialog-section-title"},"Persist headers"),t.default.createElement("div",{className:"graphiql-dialog-section-caption"},"Save headers upon reloading."," ",t.default.createElement("span",{className:"graphiql-warning-text"},"Only enable if you trust this device."))),t.default.createElement(n.ButtonGroup,null,t.default.createElement(n.Button,{type:"button",id:"enable-persist-headers",className:l.shouldPersistHeaders?"active":void 0,onClick:()=>{l.setShouldPersistHeaders(!0)}},"On"),t.default.createElement(n.Button,{type:"button",id:"disable-persist-headers",className:l.shouldPersistHeaders?void 0:"active",onClick:()=>{l.setShouldPersistHeaders(!1)}},"Off"))):null,t.default.createElement("div",{className:"graphiql-dialog-section"},t.default.createElement("div",null,t.default.createElement("div",{className:"graphiql-dialog-section-title"},"Theme"),t.default.createElement("div",{className:"graphiql-dialog-section-caption"},"Adjust how the interface looks like.")),t.default.createElement("div",null,t.default.createElement(n.ButtonGroup,null,t.default.createElement(n.Button,{type:"button",className:null===v?"active":"",onClick:()=>y(null)},"System"),t.default.createElement(n.Button,{type:"button",className:"light"===v?"active":"",onClick:()=>y("light")},"Light"),t.default.createElement(n.Button,{type:"button",className:"dark"===v?"active":"",onClick:()=>y("dark")},"Dark")))),f?t.default.createElement("div",{className:"graphiql-dialog-section"},t.default.createElement("div",null,t.default.createElement("div",{className:"graphiql-dialog-section-title"},"Clear storage"),t.default.createElement("div",{className:"graphiql-dialog-section-caption"},"Remove all locally stored data and start fresh.")),t.default.createElement("div",null,t.default.createElement(n.Button,{type:"button",state:k||void 0,disabled:"success"===k,onClick:()=>{try{null==f||f.clear(),_("success")}catch{_("error")}}},"success"===k?"Cleared data":"error"===k?"Failed":"Clear data"))):null))}function s(e){return t.default.createElement("div",{className:"graphiql-logo"},e.children||t.default.createElement("a",{className:"graphiql-logo-link",href:"https://github.com/graphql/graphiql",target:"_blank",rel:"noreferrer"},"Graph",t.default.createElement("em",null,"i"),"QL"))}function l(e){return t.default.createElement(t.default.Fragment,null,e.children)}function u(e){return t.default.createElement("div",{className:"graphiql-footer"},e.children)}function c(e,t){var n;return!(null==e||null===(n=e.type)||void 0===n||!n.displayName||e.type.displayName!==t.displayName)||e.type===t}o.Logo=s,o.Toolbar=l,o.Footer=u,s.displayName="GraphiQLLogo",l.displayName="GraphiQLToolbar",u.displayName="GraphiQLFooter"},void 0===(o=r.apply(t,i))||(e.exports=o)},5313:function(e,t,n){"use strict";n.r(t),n.d(t,{CloseCode:function(){return r.CloseCode},GRAPHQL_TRANSPORT_WS_PROTOCOL:function(){return r.GRAPHQL_TRANSPORT_WS_PROTOCOL},MessageType:function(){return r.MessageType},createClient:function(){return o},isMessage:function(){return r.isMessage},parseMessage:function(){return r.parseMessage},stringifyMessage:function(){return r.stringifyMessage}});var r=n(863),i=n(6764);function o(e){const{url:t,connectionParams:o,lazy:s=!0,onNonLazyError:l=console.error,lazyCloseTimeout:u=0,keepAlive:c=0,disablePong:d,connectionAckWaitTimeout:f=0,retryAttempts:p=5,retryWait:h=async function(e){let t=1e3;for(let n=0;nsetTimeout(e,t+Math.floor(2700*Math.random()+300))))},isFatalConnectionProblem:m=(e=>!a(e)),on:g,webSocketImpl:v,generateID:y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},jsonMessageReplacer:b,jsonMessageReviver:E}=e;let T;if(v){if(!("function"==typeof(w=v)&&"constructor"in w&&"CLOSED"in w&&"CLOSING"in w&&"CONNECTING"in w&&"OPEN"in w))throw new Error("Invalid WebSocket implementation provided");T=v}else"undefined"!=typeof WebSocket?T=WebSocket:void 0!==n.g?T=n.g.WebSocket||n.g.MozWebSocket:"undefined"!=typeof window&&(T=window.WebSocket||window.MozWebSocket);var w;if(!T)throw new Error("WebSocket implementation missing");const C=T,S=(()=>{const e=(()=>{const e={};return{on(t,n){return e[t]=n,()=>{delete e[t]}},emit(t){var n;"id"in t&&(null===(n=e[t.id])||void 0===n||n.call(e,t))}}})(),t={connecting:(null==g?void 0:g.connecting)?[g.connecting]:[],opened:(null==g?void 0:g.opened)?[g.opened]:[],connected:(null==g?void 0:g.connected)?[g.connected]:[],ping:(null==g?void 0:g.ping)?[g.ping]:[],pong:(null==g?void 0:g.pong)?[g.pong]:[],message:(null==g?void 0:g.message)?[e.emit,g.message]:[e.emit],closed:(null==g?void 0:g.closed)?[g.closed]:[],error:(null==g?void 0:g.error)?[g.error]:[]};return{onMessage:e.on,on(e,n){const r=t[e];return r.push(n),()=>{r.splice(r.indexOf(n),1)}},emit(e,...n){for(const r of[...t[e]])r(...n)}}})();function x(e){const t=[S.on("error",(n=>{t.forEach((e=>e())),e(n)})),S.on("closed",(n=>{t.forEach((e=>e())),e(n)}))]}let N,k=0,_=!1,O=0,I=!1;async function D(){const[e,n]=await(null!=N?N:N=new Promise(((e,n)=>(async()=>{if(_){if(await h(O),!k)return N=void 0,n({code:1e3,reason:"All Subscriptions Gone"});O++}S.emit("connecting");const a=new C("function"==typeof t?await t():t,r.GRAPHQL_TRANSPORT_WS_PROTOCOL);let s,l;function u(){isFinite(c)&&c>0&&(clearTimeout(l),l=setTimeout((()=>{a.readyState===C.OPEN&&(a.send((0,r.stringifyMessage)({type:r.MessageType.Ping})),S.emit("ping",!1,void 0))}),c))}x((e=>{N=void 0,clearTimeout(s),clearTimeout(l),n(e)})),a.onerror=e=>S.emit("error",e),a.onclose=e=>S.emit("closed",e),a.onopen=async()=>{try{S.emit("opened",a);const e="function"==typeof o?await o():o;a.send((0,r.stringifyMessage)(e?{type:r.MessageType.ConnectionInit,payload:e}:{type:r.MessageType.ConnectionInit},b)),isFinite(f)&&f>0&&(s=setTimeout((()=>{a.close(r.CloseCode.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")}),f)),u()}catch(e){S.emit("error",e),a.close(r.CloseCode.InternalClientError,(0,i.qj)(e instanceof Error?e.message:new Error(e).message,"Internal client error"))}};let p=!1;a.onmessage=({data:t})=>{try{const n=(0,r.parseMessage)(t,E);if(S.emit("message",n),"ping"===n.type||"pong"===n.type)return S.emit(n.type,!0,n.payload),void("pong"===n.type?u():d||(a.send((0,r.stringifyMessage)(n.payload?{type:r.MessageType.Pong,payload:n.payload}:{type:r.MessageType.Pong})),S.emit("pong",!1,n.payload)));if(p)return;if(n.type!==r.MessageType.ConnectionAck)throw new Error(`First message cannot be of type ${n.type}`);clearTimeout(s),p=!0,S.emit("connected",a,n.payload),_=!1,O=0,e([a,new Promise(((e,t)=>x(t)))])}catch(e){a.onmessage=null,S.emit("error",e),a.close(r.CloseCode.BadResponse,(0,i.qj)(e instanceof Error?e.message:new Error(e).message,"Bad response"))}}})())));e.readyState===C.CLOSING&&await n;let a=()=>{};const s=new Promise((e=>a=e));return[e,a,Promise.race([s.then((()=>{if(!k){const t=()=>e.close(1e3,"Normal Closure");isFinite(u)&&u>0?setTimeout((()=>{k||e.readyState!==C.OPEN||t()}),u):t()}})),n])]}function L(e){if(a(e)&&(t=e.code,![1e3,1001,1006,1005,1012,1013,1013].includes(t)&&t>=1e3&&t<=1999||[r.CloseCode.InternalServerError,r.CloseCode.InternalClientError,r.CloseCode.BadRequest,r.CloseCode.BadResponse,r.CloseCode.Unauthorized,r.CloseCode.SubprotocolNotAcceptable,r.CloseCode.SubscriberAlreadyExists,r.CloseCode.TooManyInitialisationRequests].includes(e.code)))throw e;var t;if(I)return!1;if(a(e)&&1e3===e.code)return k>0;if(!p||O>=p)throw e;if(m(e))throw e;return _=!0}return s||(async()=>{for(k++;;)try{const[,,e]=await D();await e}catch(e){try{if(!L(e))return}catch(e){return null==l?void 0:l(e)}}})(),{on:S.on,subscribe(e,t){const n=y();let i=!1,o=!1,a=()=>{k--,i=!0};return(async()=>{for(k++;;)try{const[s,l,u]=await D();if(i)return l();const c=S.onMessage(n,(e=>{switch(e.type){case r.MessageType.Next:return void t.next(e.payload);case r.MessageType.Error:return o=!0,i=!0,t.error(e.payload),void a();case r.MessageType.Complete:return i=!0,void a()}}));return s.send((0,r.stringifyMessage)({id:n,type:r.MessageType.Subscribe,payload:e},b)),a=()=>{i||s.readyState!==C.OPEN||s.send((0,r.stringifyMessage)({id:n,type:r.MessageType.Complete},b)),k--,i=!0,l()},void await u.finally(c)}catch(e){if(!L(e))return}})().then((()=>{o||t.complete()})).catch((e=>{t.error(e)})),()=>{i||a()}},async dispose(){if(I=!0,N){const[e]=await N;e.close(1e3,"Normal Closure")}}}}function a(e){return(0,i.Kn)(e)&&"code"in e&&"reason"in e}},863:function(e,t,n){"use strict";n.r(t),n.d(t,{CloseCode:function(){return o},GRAPHQL_TRANSPORT_WS_PROTOCOL:function(){return i},MessageType:function(){return a},isMessage:function(){return s},parseMessage:function(){return l},stringifyMessage:function(){return u}});var r=n(6764);const i="graphql-transport-ws";var o,a;function s(e){if((0,r.Kn)(e)){if(!(0,r.ND)(e,"type"))return!1;switch(e.type){case a.ConnectionInit:case a.ConnectionAck:case a.Ping:case a.Pong:return!(0,r.nr)(e,"payload")||void 0===e.payload||(0,r.Kn)(e.payload);case a.Subscribe:return(0,r.ND)(e,"id")&&(0,r.O2)(e,"payload")&&(!(0,r.nr)(e.payload,"operationName")||void 0===e.payload.operationName||null===e.payload.operationName||"string"==typeof e.payload.operationName)&&(0,r.ND)(e.payload,"query")&&(!(0,r.nr)(e.payload,"variables")||void 0===e.payload.variables||null===e.payload.variables||(0,r.O2)(e.payload,"variables"))&&(!(0,r.nr)(e.payload,"extensions")||void 0===e.payload.extensions||null===e.payload.extensions||(0,r.O2)(e.payload,"extensions"));case a.Next:return(0,r.ND)(e,"id")&&(0,r.O2)(e,"payload");case a.Error:return(0,r.ND)(e,"id")&&(0,r.Ox)(e.payload);case a.Complete:return(0,r.ND)(e,"id");default:return!1}}return!1}function l(e,t){if(s(e))return e;if("string"!=typeof e)throw new Error("Message not parsable");const n=JSON.parse(e,t);if(!s(n))throw new Error("Invalid message");return n}function u(e,t){if(!s(e))throw new Error("Cannot stringify invalid message");return JSON.stringify(e,t)}!function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"}(o||(o={})),function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"}(a||(a={}))},6718:function(e,t,n){"use strict";n.r(t),n.d(t,{makeServer:function(){return f}});var r=n(953),i=n(2780),o=n(9458),a=n(4117),s=n(2941),l=n(7180),u=n(863),c=n(6764),d=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}};function f(e){const{schema:t,context:n,roots:f,validate:p,execute:h,subscribe:m,connectionInitWaitTimeout:g=3e3,onConnect:v,onDisconnect:y,onClose:b,onSubscribe:E,onOperation:T,onNext:w,onError:C,onComplete:S,jsonMessageReviver:x,jsonMessageReplacer:N}=e;return{opened(e,k){const _={connectionInitReceived:!1,acknowledged:!1,subscriptions:{},extra:k};if(e.protocol!==u.GRAPHQL_TRANSPORT_WS_PROTOCOL)return e.close(u.CloseCode.SubprotocolNotAcceptable,"Subprotocol not acceptable"),async(e,t)=>{await(null==b?void 0:b(_,e,t))};const O=g>0&&isFinite(g)?setTimeout((()=>{_.connectionInitReceived||e.close(u.CloseCode.ConnectionInitialisationTimeout,"Connection initialisation timeout")}),g):null;return e.onMessage((async function(g){var y,b,k;let O;try{O=(0,u.parseMessage)(g,x)}catch(t){return e.close(u.CloseCode.BadRequest,"Invalid message received")}switch(O.type){case u.MessageType.ConnectionInit:{if(_.connectionInitReceived)return e.close(u.CloseCode.TooManyInitialisationRequests,"Too many initialisation requests");_.connectionInitReceived=!0,(0,c.Kn)(O.payload)&&(_.connectionParams=O.payload);const t=await(null==v?void 0:v(_));return!1===t?e.close(u.CloseCode.Forbidden,"Forbidden"):(await e.send((0,u.stringifyMessage)((0,c.Kn)(t)?{type:u.MessageType.ConnectionAck,payload:t}:{type:u.MessageType.ConnectionAck},N)),void(_.acknowledged=!0))}case u.MessageType.Ping:return e.onPing?await e.onPing(O.payload):void await e.send((0,u.stringifyMessage)(O.payload?{type:u.MessageType.Pong,payload:O.payload}:{type:u.MessageType.Pong}));case u.MessageType.Pong:return await(null===(k=e.onPong)||void 0===k?void 0:k.call(e,O.payload));case u.MessageType.Subscribe:{if(!_.acknowledged)return e.close(u.CloseCode.Unauthorized,"Unauthorized");const{id:g,payload:v}=O;if(g in _.subscriptions)return e.close(u.CloseCode.SubscriberAlreadyExists,`Subscriber for ${g} already exists`);_.subscriptions[g]=null;const x={next:async(t,n)=>{let r={id:g,type:u.MessageType.Next,payload:t};const i=await(null==w?void 0:w(_,r,n,t));i&&(r=Object.assign(Object.assign({},r),{payload:i})),await e.send((0,u.stringifyMessage)(r,N))},error:async t=>{let n={id:g,type:u.MessageType.Error,payload:t};const r=await(null==C?void 0:C(_,n,t));r&&(n=Object.assign(Object.assign({},n),{payload:r})),await e.send((0,u.stringifyMessage)(n,N))},complete:async t=>{const n={id:g,type:u.MessageType.Complete};await(null==S?void 0:S(_,n)),t&&await e.send((0,u.stringifyMessage)(n,N))}};let k;const L=await(null==E?void 0:E(_,O));if(L){if((0,c.Ox)(L))return await x.error(L);if(Array.isArray(L))throw new Error("Invalid return value from onSubscribe hook, expected an array of GraphQLError objects");k=L}else{if(!t)throw new Error("The GraphQL schema is not provided");const e={operationName:v.operationName,document:(0,r.Qc)(v.query),variableValues:v.variables};k=Object.assign(Object.assign({},e),{schema:"function"==typeof t?await t(_,O,e):t});const n=(null!=p?p:i.Gu)(k.schema,k.document);if(n.length>0)return await x.error(n)}const A=(0,o.S)(k.document,k.operationName);if(!A)return await x.error([new a.__("Unable to identify operation")]);let M;"rootValue"in k||(k.rootValue=null==f?void 0:f[A.operation]),"contextValue"in k||(k.contextValue="function"==typeof n?await n(_,O,k):n),M="subscription"===A.operation?await(null!=m?m:s.L)(k):await(null!=h?h:l.ht)(k);const R=await(null==T?void 0:T(_,O,k,M));if(R&&(M=R),(0,c.D0)(M))if(g in _.subscriptions){_.subscriptions[g]=M;try{for(var I,D=d(M);!(I=await D.next()).done;){const e=I.value;await x.next(e,k)}}catch(e){y={error:e}}finally{try{I&&!I.done&&(b=D.return)&&await b.call(D)}finally{if(y)throw y.error}}}else(0,c.Jy)(M)&&M.return(void 0);else g in _.subscriptions&&await x.next(M,k);return await x.complete(g in _.subscriptions),void delete _.subscriptions[g]}case u.MessageType.Complete:{const e=_.subscriptions[O.id];return(0,c.Jy)(e)&&await e.return(void 0),void delete _.subscriptions[O.id]}default:throw new Error(`Unexpected message of type ${O.type} received`)}})),async(e,t)=>{O&&clearTimeout(O);for(const e of Object.values(_.subscriptions))(0,c.Jy)(e)&&await e.return(void 0);_.acknowledged&&await(null==y?void 0:y(_,e,t)),await(null==b?void 0:b(_,e,t))}}}}},6764:function(e,t,n){"use strict";n.d(t,{D0:function(){return o},Jy:function(){return a},Kn:function(){return i},ND:function(){return c},O2:function(){return u},Ox:function(){return s},nr:function(){return l},qj:function(){return d}});const r=Object.prototype.hasOwnProperty;function i(e){return"object"==typeof e&&null!==e}function o(e){return"function"==typeof Object(e)[Symbol.asyncIterator]}function a(e){return i(e)&&"function"==typeof Object(e)[Symbol.asyncIterator]&&"function"==typeof e.return}function s(e){return Array.isArray(e)&&e.length>0&&e.every((e=>"message"in e))}function l(e,t){return r.call(e,t)}function u(e,t){return r.call(e,t)&&i(e[t])}function c(e,t){return r.call(e,t)&&"string"==typeof e[t]}function d(e,t){return e.length<124?e:t}},4117:function(e,t,n){"use strict";n.d(t,{OS:function(){return l},Z:function(){return u},__:function(){return a}});var r=n(1315),i=n(3302),o=n(7026);class a extends Error{constructor(e,...t){var n,o,l;const{nodes:u,source:c,positions:d,path:f,originalError:p,extensions:h}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=f?f:void 0,this.originalError=null!=p?p:void 0,this.nodes=s(Array.isArray(u)?u:u?[u]:void 0);const m=s(null===(n=this.nodes)||void 0===n?void 0:n.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=c?c:null==m||null===(o=m[0])||void 0===o?void 0:o.source,this.positions=null!=d?d:null==m?void 0:m.map((e=>e.start)),this.locations=d&&c?d.map((e=>(0,i.k)(c,e))):null==m?void 0:m.map((e=>(0,i.k)(e.source,e.start)));const g=(0,r.y)(null==p?void 0:p.extensions)?null==p?void 0:p.extensions:void 0;this.extensions=null!==(l=null!=h?h:g)&&void 0!==l?l:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=p&&p.stack?Object.defineProperty(this,"stack",{value:p.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+(0,o.Q)(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+(0,o.z)(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function s(e){return void 0===e||0===e.length?void 0:e}function l(e){return e.toString()}function u(e){return e.toJSON()}},4647:function(e,t,n){"use strict";n.d(t,{y:function(){return a}});var r=n(5648);class i extends Error{constructor(e){super("Unexpected error value: "+(0,r.X)(e)),this.name="NonErrorThrown",this.thrownValue=e}}var o=n(4117);function a(e,t,n){var r;const a=(s=e)instanceof Error?s:new i(s);var s,l;return l=a,Array.isArray(l.path)?a:new o.__(a.message,{nodes:null!==(r=a.nodes)&&void 0!==r?r:t,source:a.source,positions:a.positions,path:n,originalError:a})}},2024:function(e,t,n){"use strict";n.d(t,{h:function(){return i}});var r=n(4117);function i(e,t,n){return new r.__(`Syntax Error: ${n}`,{source:e,positions:[t]})}},5267:function(e,t,n){"use strict";n.d(t,{g:function(){return l},w:function(){return u}});var r=n(3830),i=n(755),o=n(5946),a=n(5998),s=n(2806);function l(e,t,n,r,i){const o=new Map;return c(e,t,n,r,i,o,new Set),o}function u(e,t,n,r,i){const o=new Map,a=new Set;for(const s of i)s.selectionSet&&c(e,t,n,r,s.selectionSet,o,a);return o}function c(e,t,n,i,o,a,s){for(const u of o.selections)switch(u.kind){case r.h.FIELD:{if(!d(n,u))continue;const e=(l=u).alias?l.alias.value:l.name.value,t=a.get(e);void 0!==t?t.push(u):a.set(e,[u]);break}case r.h.INLINE_FRAGMENT:if(!d(n,u)||!f(e,u,i))continue;c(e,t,n,i,u.selectionSet,a,s);break;case r.h.FRAGMENT_SPREAD:{const r=u.name.value;if(s.has(r)||!d(n,u))continue;s.add(r);const o=t[r];if(!o||!f(e,o,i))continue;c(e,t,n,i,o.selectionSet,a,s);break}}var l}function d(e,t){const n=(0,s.zu)(o.QE,t,e);if(!0===(null==n?void 0:n.if))return!1;const r=(0,s.zu)(o.Yf,t,e);return!1!==(null==r?void 0:r.if)}function f(e,t,n){const r=t.typeCondition;if(!r)return!0;const o=(0,a._)(e,r);return o===n||!!(0,i.m0)(o)&&e.isSubType(o,n)}},7180:function(e,t,n){"use strict";n.d(t,{td:function(){return C},VZ:function(){return S},p$:function(){return k},El:function(){return M},mn:function(){return A},ht:function(){return E},p0:function(){return T},Vm:function(){return R}});var r=n(1172),i=n(5648),o=n(5052),a=n(2910),s=n(1315),l=n(1864),u=n(9878),c=n(4117),d=n(4647),f=n(3526),p=n(3830),h=n(755),m=n(8078),g=n(8555),v=n(5267),y=n(2806);const b=function(e){let t;return function(e,n,r){void 0===t&&(t=new WeakMap);let i=t.get(e);void 0===i&&(i=new WeakMap,t.set(e,i));let o=i.get(n);void 0===o&&(o=new WeakMap,i.set(n,o));let a=o.get(r);return void 0===a&&(s=e,l=n,u=r,a=(0,v.w)(s.schema,s.fragments,s.variableValues,l,u),o.set(r,a)),a;var s,l,u}}();function E(e){arguments.length<2||(0,r.a)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,document:n,variableValues:i,rootValue:o}=e;C(t,n,i);const a=S(e);if(!("schema"in a))return{errors:a};try{const{operation:e}=a,t=function(e,t,n){const r=e.schema.getRootType(t.operation);if(null==r)throw new c.__(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});const i=(0,v.g)(e.schema,e.fragments,e.variableValues,r,t.selectionSet),o=void 0;switch(t.operation){case f.ku.QUERY:return x(e,r,n,o,i);case f.ku.MUTATION:return function(e,t,n,r,i){return function(e,t,n){let r=Object.create(null);for(const n of e)r=(0,l.t)(r)?r.then((e=>t(e,n))):t(r,n);return r}(i.entries(),((r,[i,o])=>{const a=(0,u.Q)(undefined,i,t.name),s=N(e,t,n,o,a);return void 0===s?r:(0,l.t)(s)?s.then((e=>(r[i]=e,r))):(r[i]=s,r)}))}(e,r,n,0,i);case f.ku.SUBSCRIPTION:return x(e,r,n,o,i)}}(a,e,o);return(0,l.t)(t)?t.then((e=>w(e,a.errors)),(e=>(a.errors.push(e),w(null,a.errors)))):w(t,a.errors)}catch(e){return a.errors.push(e),w(null,a.errors)}}function T(e){const t=E(e);if((0,l.t)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function w(e,t){return 0===t.length?{data:e}:{errors:t,data:e}}function C(e,t,n){t||(0,r.a)(!1,"Must provide document."),(0,g.J)(e),null==n||(0,s.y)(n)||(0,r.a)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function S(e){var t,n;const{schema:r,document:i,rootValue:o,contextValue:a,variableValues:s,operationName:l,fieldResolver:u,typeResolver:d,subscribeFieldResolver:f}=e;let h;const m=Object.create(null);for(const e of i.definitions)switch(e.kind){case p.h.OPERATION_DEFINITION:if(null==l){if(void 0!==h)return[new c.__("Must provide operation name if query contains multiple operations.")];h=e}else(null===(t=e.name)||void 0===t?void 0:t.value)===l&&(h=e);break;case p.h.FRAGMENT_DEFINITION:m[e.name.value]=e}if(!h)return null!=l?[new c.__(`Unknown operation named "${l}".`)]:[new c.__("Must provide an operation.")];const g=null!==(n=h.variableDefinitions)&&void 0!==n?n:[],v=(0,y.QF)(r,g,null!=s?s:{},{maxErrors:50});return v.errors?v.errors:{schema:r,fragments:m,rootValue:o,contextValue:a,operation:h,variableValues:v.coerced,fieldResolver:null!=u?u:M,typeResolver:null!=d?d:A,subscribeFieldResolver:null!=f?f:M,errors:[]}}function x(e,t,n,r,i){const o=Object.create(null);let a=!1;for(const[s,c]of i.entries()){const i=N(e,t,n,c,(0,u.Q)(r,s,t.name));void 0!==i&&(o[s]=i,(0,l.t)(i)&&(a=!0))}return a?(s=o,Promise.all(Object.values(s)).then((e=>{const t=Object.create(null);for(const[n,r]of Object.keys(s).entries())t[r]=e[n];return t}))):o;var s}function N(e,t,n,r,i){var o;const a=R(e.schema,t,r[0]);if(!a)return;const s=a.type,c=null!==(o=a.resolve)&&void 0!==o?o:e.fieldResolver,f=k(e,a,r,t,i);try{const t=c(n,(0,y.LX)(a,r[0],e.variableValues),e.contextValue,f);let o;return o=(0,l.t)(t)?t.then((t=>O(e,s,r,f,i,t))):O(e,s,r,f,i,t),(0,l.t)(o)?o.then(void 0,(t=>_((0,d.y)(t,r,(0,u.N)(i)),s,e))):o}catch(t){return _((0,d.y)(t,r,(0,u.N)(i)),s,e)}}function k(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function _(e,t,n){if((0,h.zM)(t))throw e;return n.errors.push(e),null}function O(e,t,n,r,s,f){if(f instanceof Error)throw f;if((0,h.zM)(t)){const i=O(e,t.ofType,n,r,s,f);if(null===i)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return i}return null==f?null:(0,h.HG)(t)?function(e,t,n,r,i,o){if(!(0,a.i)(o))throw new c.__(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);const s=t.ofType;let f=!1;const p=Array.from(o,((t,o)=>{const a=(0,u.Q)(i,o,void 0);try{let i;return i=(0,l.t)(t)?t.then((t=>O(e,s,n,r,a,t))):O(e,s,n,r,a,t),(0,l.t)(i)?(f=!0,i.then(void 0,(t=>_((0,d.y)(t,n,(0,u.N)(a)),s,e)))):i}catch(t){return _((0,d.y)(t,n,(0,u.N)(a)),s,e)}}));return f?Promise.all(p):p}(e,t,n,r,s,f):(0,h.UT)(t)?function(e,t){const n=e.serialize(t);if(null==n)throw new Error(`Expected \`${(0,i.X)(e)}.serialize(${(0,i.X)(t)})\` to return non-nullable value, returned: ${(0,i.X)(n)}`);return n}(t,f):(0,h.m0)(t)?function(e,t,n,r,i,o){var a;const s=null!==(a=t.resolveType)&&void 0!==a?a:e.typeResolver,u=e.contextValue,c=s(o,u,r,t);return(0,l.t)(c)?c.then((a=>D(e,I(a,e,t,n,r,o),n,r,i,o))):D(e,I(c,e,t,n,r,o),n,r,i,o)}(e,t,n,r,s,f):(0,h.lp)(t)?D(e,t,n,r,s,f):void(0,o.k)(!1,"Cannot complete value of unexpected output type: "+(0,i.X)(t))}function I(e,t,n,r,o,a){if(null==e)throw new c.__(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${o.parentType.name}.${o.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if((0,h.lp)(e))throw new c.__("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if("string"!=typeof e)throw new c.__(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${o.parentType.name}.${o.fieldName}" with value ${(0,i.X)(a)}, received "${(0,i.X)(e)}".`);const s=t.schema.getType(e);if(null==s)throw new c.__(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!(0,h.lp)(s))throw new c.__(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,s))throw new c.__(`Runtime Object type "${s.name}" is not a possible type for "${n.name}".`,{nodes:r});return s}function D(e,t,n,r,i,o){const a=b(e,t,n);if(t.isTypeOf){const s=t.isTypeOf(o,e.contextValue,r);if((0,l.t)(s))return s.then((r=>{if(!r)throw L(t,o,n);return x(e,t,o,i,a)}));if(!s)throw L(t,o,n)}return x(e,t,o,i,a)}function L(e,t,n){return new c.__(`Expected value of type "${e.name}" but got: ${(0,i.X)(t)}.`,{nodes:n})}const A=function(e,t,n,r){if((0,s.y)(e)&&"string"==typeof e.__typename)return e.__typename;const i=n.schema.getPossibleTypes(r),o=[];for(let r=0;r{for(let t=0;t(0,c.ht)({schema:t,document:n,rootValue:e,contextValue:a,variableValues:s,operationName:l,fieldResolver:u}))):f}async function p(e,t,n,r,f,p,h){(0,c.td)(e,t,f);const m=(0,c.VZ)({schema:e,document:t,rootValue:n,contextValue:r,variableValues:f,operationName:p,subscribeFieldResolver:h});if(!("schema"in m))return{errors:m};try{const e=await async function(e){const{schema:t,fragments:n,operation:r,variableValues:i,rootValue:o}=e,f=t.getSubscriptionType();if(null==f)throw new s.__("Schema is not configured to execute subscription operation.",{nodes:r});const p=(0,u.g)(t,n,i,f,r.selectionSet),[h,m]=[...p.entries()][0],g=(0,c.Vm)(t,f,m[0]);if(!g){const e=m[0].name.value;throw new s.__(`The subscription field "${e}" is not defined.`,{nodes:m})}const v=(0,a.Q)(void 0,h,f.name),y=(0,c.p$)(e,g,m,f,v);try{var b;const t=(0,d.LX)(g,m[0],i),n=e.contextValue,r=null!==(b=g.subscribe)&&void 0!==b?b:e.subscribeFieldResolver,a=await r(o,t,n,y);if(a instanceof Error)throw a;return a}catch(e){throw(0,l.y)(e,m,(0,a.N)(v))}}(m);if(!o(e))throw new Error(`Subscription field must return Async Iterable. Received: ${(0,i.X)(e)}.`);return e}catch(e){if(e instanceof s.__)return{errors:[e]};throw e}}},2806:function(e,t,n){"use strict";n.d(t,{LX:function(){return h},QF:function(){return p},zu:function(){return m}});var r=n(5648),i=n(9815),o=n(4987),a=n(4117),s=n(3830),l=n(5895),u=n(755),c=n(5925),d=n(5998),f=n(5284);function p(e,t,n,i){const s=[],p=null==i?void 0:i.maxErrors;try{const i=function(e,t,n,i){const s={};for(const p of t){const t=p.variable.name.value,h=(0,d._)(e,p.type);if(!(0,u.j$)(h)){const e=(0,l.S)(p.type);i(new a.__(`Variable "$${t}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:p.type}));continue}if(!g(n,t)){if(p.defaultValue)s[t]=(0,f.u)(p.defaultValue,h);else if((0,u.zM)(h)){const e=(0,r.X)(h);i(new a.__(`Variable "$${t}" of required type "${e}" was not provided.`,{nodes:p}))}continue}const m=n[t];if(null===m&&(0,u.zM)(h)){const e=(0,r.X)(h);i(new a.__(`Variable "$${t}" of non-null type "${e}" must not be null.`,{nodes:p}))}else s[t]=(0,c.K)(m,h,((e,n,s)=>{let l=`Variable "$${t}" got invalid value `+(0,r.X)(n);e.length>0&&(l+=` at "${t}${(0,o.F)(e)}"`),i(new a.__(l+"; "+s.message,{nodes:p,originalError:s.originalError}))}))}return s}(e,t,n,(e=>{if(null!=p&&s.length>=p)throw new a.__("Too many errors processing variables, error limit reached. Execution aborted.");s.push(e)}));if(0===s.length)return{coerced:i}}catch(e){s.push(e)}return{errors:s}}function h(e,t,n){var o;const c={},d=null!==(o=t.arguments)&&void 0!==o?o:[],p=(0,i.P)(d,(e=>e.name.value));for(const i of e.args){const e=i.name,o=i.type,d=p[e];if(!d){if(void 0!==i.defaultValue)c[e]=i.defaultValue;else if((0,u.zM)(o))throw new a.__(`Argument "${e}" of required type "${(0,r.X)(o)}" was not provided.`,{nodes:t});continue}const h=d.value;let m=h.kind===s.h.NULL;if(h.kind===s.h.VARIABLE){const t=h.name.value;if(null==n||!g(n,t)){if(void 0!==i.defaultValue)c[e]=i.defaultValue;else if((0,u.zM)(o))throw new a.__(`Argument "${e}" of required type "${(0,r.X)(o)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:h});continue}m=null==n[t]}if(m&&(0,u.zM)(o))throw new a.__(`Argument "${e}" of non-null type "${(0,r.X)(o)}" must not be null.`,{nodes:h});const v=(0,f.u)(h,o,n);if(void 0===v)throw new a.__(`Argument "${e}" has invalid value ${(0,l.S)(h)}.`,{nodes:h});c[e]=v}return c}function m(e,t,n){var r;const i=null===(r=t.directives)||void 0===r?void 0:r.find((t=>t.name.value===e.name));if(i)return h(e,i,n)}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},3573:function(e,t,n){"use strict";n.r(t),n.d(t,{BREAK:function(){return k.$_},BreakingChangeType:function(){return pt},DEFAULT_DEPRECATION_REASON:function(){return g.SY},DangerousChangeType:function(){return ht},DirectiveLocation:function(){return O.B},ExecutableDefinitionsRule:function(){return U.i},FieldsOnCorrectTypeRule:function(){return B.A},FragmentsOnCompositeTypesRule:function(){return $.T},GRAPHQL_MAX_INT:function(){return v.HI},GRAPHQL_MIN_INT:function(){return v.st},GraphQLBoolean:function(){return v.EZ},GraphQLDeprecatedDirective:function(){return g.fg},GraphQLDirective:function(){return g.NZ},GraphQLEnumType:function(){return h.mR},GraphQLError:function(){return R.__},GraphQLFloat:function(){return v.av},GraphQLID:function(){return v.km},GraphQLIncludeDirective:function(){return g.Yf},GraphQLInputObjectType:function(){return h.sR},GraphQLInt:function(){return v._o},GraphQLInterfaceType:function(){return h.oW},GraphQLList:function(){return h.p2},GraphQLNonNull:function(){return h.bM},GraphQLObjectType:function(){return h.h6},GraphQLScalarType:function(){return h.n2},GraphQLSchema:function(){return m.XO},GraphQLSkipDirective:function(){return g.QE},GraphQLSpecifiedByDirective:function(){return g.df},GraphQLString:function(){return v.kH},GraphQLUnionType:function(){return h.Gp},Kind:function(){return _.h},KnownArgumentNamesRule:function(){return q.e},KnownDirectivesRule:function(){return H.J},KnownFragmentNamesRule:function(){return G.a},KnownTypeNamesRule:function(){return z.I},Lexer:function(){return S.h},Location:function(){return E.Ye},LoneAnonymousOperationRule:function(){return W.F},LoneSchemaDefinitionRule:function(){return fe.t},NoDeprecatedCustomRule:function(){return F},NoFragmentCyclesRule:function(){return K.H},NoSchemaIntrospectionCustomRule:function(){return P},NoUndefinedVariablesRule:function(){return Q.$},NoUnusedFragmentsRule:function(){return X.J},NoUnusedVariablesRule:function(){return Y.p},OperationTypeNode:function(){return E.ku},OverlappingFieldsCanBeMergedRule:function(){return J.y},PossibleFragmentSpreadsRule:function(){return Z.a},PossibleTypeExtensionsRule:function(){return be.g},ProvidedRequiredArgumentsRule:function(){return ee.s},ScalarLeafsRule:function(){return te.O},SchemaMetaFieldDef:function(){return y.Az},SingleFieldSubscriptionsRule:function(){return ne.Z},Source:function(){return T.H},Token:function(){return E.WU},TokenKind:function(){return x.T},TypeInfo:function(){return Mt.a},TypeKind:function(){return y.zU},TypeMetaFieldDef:function(){return y.tF},TypeNameMetaFieldDef:function(){return y.hU},UniqueArgumentDefinitionNamesRule:function(){return ve.L},UniqueArgumentNamesRule:function(){return re.L},UniqueDirectiveNamesRule:function(){return ye.o},UniqueDirectivesPerLocationRule:function(){return ie.k},UniqueEnumValueNamesRule:function(){return me.L},UniqueFieldDefinitionNamesRule:function(){return ge.y},UniqueFragmentNamesRule:function(){return oe.N},UniqueInputFieldNamesRule:function(){return ae.P},UniqueOperationNamesRule:function(){return se.H},UniqueOperationTypesRule:function(){return pe.q},UniqueTypeNamesRule:function(){return he.P},UniqueVariableNamesRule:function(){return le.H},ValidationContext:function(){return j._t},ValuesOfCorrectTypeRule:function(){return ue.j},VariablesAreInputTypesRule:function(){return ce.I},VariablesInAllowedPositionRule:function(){return de.w},__Directive:function(){return y.l3},__DirectiveLocation:function(){return y.x2},__EnumValue:function(){return y.jT},__Field:function(){return y.e_},__InputValue:function(){return y.XQ},__Schema:function(){return y.TK},__Type:function(){return y.qz},__TypeKind:function(){return y.PX},assertAbstractType:function(){return h.fU},assertCompositeType:function(){return h.M_},assertDirective:function(){return g.CO},assertEnumType:function(){return h.Zu},assertEnumValueName:function(){return b.g},assertInputObjectType:function(){return h.U8},assertInputType:function(){return h.qT},assertInterfaceType:function(){return h.k2},assertLeafType:function(){return h.H5},assertListType:function(){return h.kS},assertName:function(){return b.i},assertNamedType:function(){return h.rM},assertNonNullType:function(){return h.E$},assertNullableType:function(){return h.i_},assertObjectType:function(){return h.Z6},assertOutputType:function(){return h.Gt},assertScalarType:function(){return h.Pt},assertSchema:function(){return m.EO},assertType:function(){return h.p_},assertUnionType:function(){return h.rc},assertValidName:function(){return ct},assertValidSchema:function(){return l.J},assertWrappingType:function(){return h.vX},astFromValue:function(){return Ge.J},buildASTSchema:function(){return Pe},buildClientSchema:function(){return Oe},buildSchema:function(){return je},coerceInputValue:function(){return Rt.K},concatAST:function(){return ot},createSourceEventStream:function(){return A.z},defaultFieldResolver:function(){return c.El},defaultTypeResolver:function(){return c.mn},doTypesOverlap:function(){return Ft.zR},execute:function(){return c.ht},executeSync:function(){return c.p0},extendSchema:function(){return Le},findBreakingChanges:function(){return mt},findDangerousChanges:function(){return gt},formatError:function(){return R.Z},getArgumentValues:function(){return L.LX},getDirectiveValues:function(){return L.zu},getEnterLeaveForKind:function(){return k.Eu},getIntrospectionQuery:function(){return we},getLocation:function(){return w.k},getNamedType:function(){return h.xC},getNullableType:function(){return h.tf},getOperationAST:function(){return Dt.S},getOperationRootType:function(){return Ce},getVariableValues:function(){return L.QF},getVisitFn:function(){return k.CK},graphql:function(){return d},graphqlSync:function(){return f},introspectionFromSchema:function(){return Se},introspectionTypes:function(){return y.nL},isAbstractType:function(){return h.m0},isCompositeType:function(){return h.Gv},isConstValueNode:function(){return I.Of},isDefinitionNode:function(){return I.Ir},isDirective:function(){return g.wX},isEnumType:function(){return h.EM},isEqualType:function(){return Ft._7},isExecutableDefinitionNode:function(){return I.Wk},isInputObjectType:function(){return h.hL},isInputType:function(){return h.j$},isInterfaceType:function(){return h.oT},isIntrospectionType:function(){return y.s9},isLeafType:function(){return h.UT},isListType:function(){return h.HG},isNamedType:function(){return h.Zs},isNonNullType:function(){return h.zM},isNullableType:function(){return h.zP},isObjectType:function(){return h.lp},isOutputType:function(){return h.SZ},isRequiredArgument:function(){return h.dK},isRequiredInputField:function(){return h.Wd},isScalarType:function(){return h.KA},isSchema:function(){return m.nN},isSelectionNode:function(){return I.pO},isSpecifiedDirective:function(){return g.xg},isSpecifiedScalarType:function(){return v.u1},isType:function(){return h.P9},isTypeDefinitionNode:function(){return I.zT},isTypeExtensionNode:function(){return I.D$},isTypeNode:function(){return I.VB},isTypeSubTypeOf:function(){return Ft.uJ},isTypeSystemDefinitionNode:function(){return I.G4},isTypeSystemExtensionNode:function(){return I.aU},isUnionType:function(){return h.EN},isValidNameError:function(){return dt},isValueNode:function(){return I.nr},isWrappingType:function(){return h.fw},lexicographicSortSchema:function(){return Ue},locatedError:function(){return Te.y},parse:function(){return s.Qc},parseConstValue:function(){return s.tl},parseType:function(){return s.gZ},parseValue:function(){return s.H2},print:function(){return N.S},printError:function(){return R.OS},printIntrospectionSchema:function(){return We},printLocation:function(){return C.Q},printSchema:function(){return ze},printSourceLocation:function(){return C.z},printType:function(){return Ye},resolveObjMapThunk:function(){return h.WB},resolveReadonlyArrayThunk:function(){return h._9},responsePathAsArray:function(){return D.N},separateOperations:function(){return at},specifiedDirectives:function(){return g.V4},specifiedRules:function(){return V.i},specifiedScalarTypes:function(){return v.HS},stripIgnoredCharacters:function(){return ut},subscribe:function(){return A.L},syntaxError:function(){return Ee.h},typeFromAST:function(){return Lt._},validate:function(){return u.Gu},validateSchema:function(){return l.F},valueFromAST:function(){return _e.u},valueFromASTUntyped:function(){return At.M},version:function(){return r},versionInfo:function(){return i},visit:function(){return k.Vn},visitInParallel:function(){return k.j1},visitWithTypeInfo:function(){return Mt.y}});const r="16.5.0",i=Object.freeze({major:16,minor:5,patch:0,preReleaseTag:null});var o=n(1172),a=n(1864),s=n(953),l=n(8555),u=n(2780),c=n(7180);function d(e){return new Promise((t=>t(p(e))))}function f(e){const t=p(e);if((0,a.t)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function p(e){arguments.length<2||(0,o.a)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,source:n,rootValue:r,contextValue:i,variableValues:a,operationName:d,fieldResolver:f,typeResolver:p}=e,h=(0,l.F)(t);if(h.length>0)return{errors:h};let m;try{m=(0,s.Qc)(n)}catch(e){return{errors:[e]}}const g=(0,u.Gu)(t,m);return g.length>0?{errors:g}:(0,c.ht)({schema:t,document:m,rootValue:r,contextValue:i,variableValues:a,operationName:d,fieldResolver:f,typeResolver:p})}var h=n(755),m=n(773),g=n(5946),v=n(1774),y=n(8078),b=n(3228),E=n(3526),T=n(4680),w=n(3302),C=n(7026),S=n(9230),x=n(5685),N=n(5895),k=n(9685),_=n(3830),O=n(3140),I=n(9615),D=n(9878),L=n(2806),A=n(2941),M=n(5052),R=n(4117);function F(e){return{Field(t){const n=e.getFieldDef(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){const i=e.getParentType();null!=i||(0,M.k)(!1),e.reportError(new R.__(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){const n=e.getArgument(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){const i=e.getDirective();if(null!=i)e.reportError(new R.__(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}));else{const i=e.getParentType(),o=e.getFieldDef();null!=i&&null!=o||(0,M.k)(!1),e.reportError(new R.__(`Field "${i.name}.${o.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){const n=(0,h.xC)(e.getParentInputType());if((0,h.hL)(n)){const r=n.getFields()[t.name.value],i=null==r?void 0:r.deprecationReason;null!=i&&e.reportError(new R.__(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){const n=e.getEnumValue(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){const i=(0,h.xC)(e.getInputType());null!=i||(0,M.k)(!1),e.reportError(new R.__(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:t}))}}}}function P(e){return{Field(t){const n=(0,h.xC)(e.getType());n&&(0,y.s9)(n)&&e.reportError(new R.__(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}var j=n(2716),V=n(9299),U=n(3857),B=n(1870),$=n(5167),q=n(4875),H=n(7513),G=n(1435),z=n(591),W=n(831),K=n(9316),Q=n(9518),X=n(3447),Y=n(7114),J=n(7163),Z=n(5961),ee=n(16),te=n(3989),ne=n(9309),re=n(9168),ie=n(5673),oe=n(614),ae=n(5707),se=n(2355),le=n(7417),ue=n(4697),ce=n(6192),de=n(377),fe=n(3402),pe=n(5427),he=n(4519),me=n(4560),ge=n(5240),ve=n(5947),ye=n(5681),be=n(3721),Ee=n(2024),Te=n(4647);function we(e){const t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...e},n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"";function o(e){return t.inputValueDeprecation?e:""}return`\n query IntrospectionQuery {\n __schema {\n ${t.schemaDescription?n:""}\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ${n}\n ${i}\n locations\n args${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ${n}\n ${r}\n fields(includeDeprecated: true) {\n name\n ${n}\n args${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ${n}\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ${n}\n type { ...TypeRef }\n defaultValue\n ${o("isDeprecated")}\n ${o("deprecationReason")}\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n `}function Ce(e,t){if("query"===t.operation){const n=e.getQueryType();if(!n)throw new R.__("Schema does not define the required query root type.",{nodes:t});return n}if("mutation"===t.operation){const n=e.getMutationType();if(!n)throw new R.__("Schema is not configured for mutations.",{nodes:t});return n}if("subscription"===t.operation){const n=e.getSubscriptionType();if(!n)throw new R.__("Schema is not configured for subscriptions.",{nodes:t});return n}throw new R.__("Can only have query, mutation and subscription operations.",{nodes:t})}function Se(e,t){const n={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,...t},r=(0,s.Qc)(we(n)),i=(0,c.p0)({schema:e,document:r});return!i.errors&&i.data||(0,M.k)(!1),i.data}var xe=n(5648),Ne=n(1315),ke=n(8240),_e=n(5284);function Oe(e,t){(0,Ne.y)(e)&&(0,Ne.y)(e.__schema)||(0,o.a)(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,xe.X)(e)}.`);const n=e.__schema,r=(0,ke.w)(n.types,(e=>e.name),(e=>function(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case y.zU.SCALAR:return r=e,new h.n2({name:r.name,description:r.description,specifiedByURL:r.specifiedByURL});case y.zU.OBJECT:return n=e,new h.h6({name:n.name,description:n.description,interfaces:()=>b(n),fields:()=>E(n)});case y.zU.INTERFACE:return t=e,new h.oW({name:t.name,description:t.description,interfaces:()=>b(t),fields:()=>E(t)});case y.zU.UNION:return function(e){if(!e.possibleTypes){const t=(0,xe.X)(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new h.Gp({name:e.name,description:e.description,types:()=>e.possibleTypes.map(f)})}(e);case y.zU.ENUM:return function(e){if(!e.enumValues){const t=(0,xe.X)(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new h.mR({name:e.name,description:e.description,values:(0,ke.w)(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case y.zU.INPUT_OBJECT:return function(e){if(!e.inputFields){const t=(0,xe.X)(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new h.sR({name:e.name,description:e.description,fields:()=>w(e.inputFields)})}(e)}var t,n,r;const i=(0,xe.X)(e);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${i}.`)}(e)));for(const e of[...v.HS,...y.nL])r[e.name]&&(r[e.name]=e);const i=n.queryType?f(n.queryType):null,a=n.mutationType?f(n.mutationType):null,l=n.subscriptionType?f(n.subscriptionType):null,u=n.directives?n.directives.map((function(e){if(!e.args){const t=(0,xe.X)(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(!e.locations){const t=(0,xe.X)(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new g.NZ({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:w(e.args)})})):[];return new m.XO({description:n.description,query:i,mutation:a,subscription:l,types:Object.values(r),directives:u,assumeValid:null==t?void 0:t.assumeValid});function c(e){if(e.kind===y.zU.LIST){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");return new h.p2(c(t))}if(e.kind===y.zU.NON_NULL){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");const n=c(t);return new h.bM((0,h.i_)(n))}return d(e)}function d(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${(0,xe.X)(e)}.`);const n=r[t];if(!n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function f(e){return(0,h.Z6)(d(e))}function p(e){return(0,h.k2)(d(e))}function b(e){if(null===e.interfaces&&e.kind===y.zU.INTERFACE)return[];if(!e.interfaces){const t=(0,xe.X)(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(p)}function E(e){if(!e.fields)throw new Error(`Introspection result missing fields: ${(0,xe.X)(e)}.`);return(0,ke.w)(e.fields,(e=>e.name),T)}function T(e){const t=c(e.type);if(!(0,h.SZ)(t)){const e=(0,xe.X)(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(!e.args){const t=(0,xe.X)(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:w(e.args)}}function w(e){return(0,ke.w)(e,(e=>e.name),C)}function C(e){const t=c(e.type);if(!(0,h.j$)(t)){const e=(0,xe.X)(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}const n=null!=e.defaultValue?(0,_e.u)((0,s.H2)(e.defaultValue),t):void 0;return{description:e.description,type:t,defaultValue:n,deprecationReason:e.deprecationReason}}}var Ie=n(9815),De=n(9997);function Le(e,t,n){(0,m.EO)(e),null!=t&&t.kind===_.h.DOCUMENT||(0,o.a)(!1,"Must provide valid Document AST."),!0!==(null==n?void 0:n.assumeValid)&&!0!==(null==n?void 0:n.assumeValidSDL)&&(0,u.ED)(t,e);const r=e.toConfig(),i=Ae(r,t,n);return r===i?e:new m.XO(i)}function Ae(e,t,n){var r,i,o,a;const s=[],l=Object.create(null),u=[];let c;const d=[];for(const e of t.definitions)if(e.kind===_.h.SCHEMA_DEFINITION)c=e;else if(e.kind===_.h.SCHEMA_EXTENSION)d.push(e);else if((0,I.zT)(e))s.push(e);else if((0,I.D$)(e)){const t=e.name.value,n=l[t];l[t]=n?n.concat([e]):[e]}else e.kind===_.h.DIRECTIVE_DEFINITION&&u.push(e);if(0===Object.keys(l).length&&0===s.length&&0===u.length&&0===d.length&&null==c)return e;const f=Object.create(null);for(const t of e.types)f[t.name]=(p=t,(0,y.s9)(p)||(0,v.u1)(p)?p:(0,h.KA)(p)?function(e){var t;const n=e.toConfig(),r=null!==(t=l[n.name])&&void 0!==t?t:[];let i=n.specifiedByURL;for(const e of r){var o;i=null!==(o=Fe(e))&&void 0!==o?o:i}return new h.n2({...n,specifiedByURL:i,extensionASTNodes:n.extensionASTNodes.concat(r)})}(p):(0,h.lp)(p)?function(e){var t;const n=e.toConfig(),r=null!==(t=l[n.name])&&void 0!==t?t:[];return new h.h6({...n,interfaces:()=>[...e.getInterfaces().map(T),...A(r)],fields:()=>({...(0,De.j)(n.fields,w),...k(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(p):(0,h.oT)(p)?function(e){var t;const n=e.toConfig(),r=null!==(t=l[n.name])&&void 0!==t?t:[];return new h.oW({...n,interfaces:()=>[...e.getInterfaces().map(T),...A(r)],fields:()=>({...(0,De.j)(n.fields,w),...k(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(p):(0,h.EN)(p)?function(e){var t;const n=e.toConfig(),r=null!==(t=l[n.name])&&void 0!==t?t:[];return new h.Gp({...n,types:()=>[...e.getTypes().map(T),...R(r)],extensionASTNodes:n.extensionASTNodes.concat(r)})}(p):(0,h.EM)(p)?function(e){var t;const n=e.toConfig(),r=null!==(t=l[e.name])&&void 0!==t?t:[];return new h.mR({...n,values:{...n.values,...L(r)},extensionASTNodes:n.extensionASTNodes.concat(r)})}(p):(0,h.hL)(p)?function(e){var t;const n=e.toConfig(),r=null!==(t=l[n.name])&&void 0!==t?t:[];return new h.sR({...n,fields:()=>({...(0,De.j)(n.fields,(e=>({...e,type:E(e.type)}))),...D(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(p):void(0,M.k)(!1,"Unexpected type: "+(0,xe.X)(p)));var p;for(const e of s){var m;const t=e.name.value;f[t]=null!==(m=Me[t])&&void 0!==m?m:F(e)}const b={query:e.query&&T(e.query),mutation:e.mutation&&T(e.mutation),subscription:e.subscription&&T(e.subscription),...c&&S([c]),...S(d)};return{description:null===(r=c)||void 0===r||null===(i=r.description)||void 0===i?void 0:i.value,...b,types:Object.values(f),directives:[...e.directives.map((function(e){const t=e.toConfig();return new g.NZ({...t,args:(0,De.j)(t.args,C)})})),...u.map((function(e){var t;return new g.NZ({name:e.name.value,description:null===(t=e.description)||void 0===t?void 0:t.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:O(e.arguments),astNode:e})}))],extensions:Object.create(null),astNode:null!==(o=c)&&void 0!==o?o:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(d),assumeValid:null!==(a=null==n?void 0:n.assumeValid)&&void 0!==a&&a};function E(e){return(0,h.HG)(e)?new h.p2(E(e.ofType)):(0,h.zM)(e)?new h.bM(E(e.ofType)):T(e)}function T(e){return f[e.name]}function w(e){return{...e,type:E(e.type),args:e.args&&(0,De.j)(e.args,C)}}function C(e){return{...e,type:E(e.type)}}function S(e){const t={};for(const r of e){var n;const e=null!==(n=r.operationTypes)&&void 0!==n?n:[];for(const n of e)t[n.operation]=x(n.type)}return t}function x(e){var t;const n=e.name.value,r=null!==(t=Me[n])&&void 0!==t?t:f[n];if(void 0===r)throw new Error(`Unknown type: "${n}".`);return r}function N(e){return e.kind===_.h.LIST_TYPE?new h.p2(N(e.type)):e.kind===_.h.NON_NULL_TYPE?new h.bM(N(e.type)):x(e)}function k(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.fields)&&void 0!==n?n:[];for(const n of e){var r;t[n.name.value]={type:N(n.type),description:null===(r=n.description)||void 0===r?void 0:r.value,args:O(n.arguments),deprecationReason:Re(n),astNode:n}}}return t}function O(e){const t=null!=e?e:[],n=Object.create(null);for(const e of t){var r;const t=N(e.type);n[e.name.value]={type:t,description:null===(r=e.description)||void 0===r?void 0:r.value,defaultValue:(0,_e.u)(e.defaultValue,t),deprecationReason:Re(e),astNode:e}}return n}function D(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.fields)&&void 0!==n?n:[];for(const n of e){var r;const e=N(n.type);t[n.name.value]={type:e,description:null===(r=n.description)||void 0===r?void 0:r.value,defaultValue:(0,_e.u)(n.defaultValue,e),deprecationReason:Re(n),astNode:n}}}return t}function L(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.values)&&void 0!==n?n:[];for(const n of e){var r;t[n.name.value]={description:null===(r=n.description)||void 0===r?void 0:r.value,deprecationReason:Re(n),astNode:n}}}return t}function A(e){return e.flatMap((e=>{var t,n;return null!==(t=null===(n=e.interfaces)||void 0===n?void 0:n.map(x))&&void 0!==t?t:[]}))}function R(e){return e.flatMap((e=>{var t,n;return null!==(t=null===(n=e.types)||void 0===n?void 0:n.map(x))&&void 0!==t?t:[]}))}function F(e){var t;const n=e.name.value,r=null!==(t=l[n])&&void 0!==t?t:[];switch(e.kind){case _.h.OBJECT_TYPE_DEFINITION:{var i;const t=[e,...r];return new h.h6({name:n,description:null===(i=e.description)||void 0===i?void 0:i.value,interfaces:()=>A(t),fields:()=>k(t),astNode:e,extensionASTNodes:r})}case _.h.INTERFACE_TYPE_DEFINITION:{var o;const t=[e,...r];return new h.oW({name:n,description:null===(o=e.description)||void 0===o?void 0:o.value,interfaces:()=>A(t),fields:()=>k(t),astNode:e,extensionASTNodes:r})}case _.h.ENUM_TYPE_DEFINITION:{var a;const t=[e,...r];return new h.mR({name:n,description:null===(a=e.description)||void 0===a?void 0:a.value,values:L(t),astNode:e,extensionASTNodes:r})}case _.h.UNION_TYPE_DEFINITION:{var s;const t=[e,...r];return new h.Gp({name:n,description:null===(s=e.description)||void 0===s?void 0:s.value,types:()=>R(t),astNode:e,extensionASTNodes:r})}case _.h.SCALAR_TYPE_DEFINITION:var u;return new h.n2({name:n,description:null===(u=e.description)||void 0===u?void 0:u.value,specifiedByURL:Fe(e),astNode:e,extensionASTNodes:r});case _.h.INPUT_OBJECT_TYPE_DEFINITION:{var c;const t=[e,...r];return new h.sR({name:n,description:null===(c=e.description)||void 0===c?void 0:c.value,fields:()=>D(t),astNode:e,extensionASTNodes:r})}}}}const Me=(0,Ie.P)([...v.HS,...y.nL],(e=>e.name));function Re(e){const t=(0,L.zu)(g.fg,e);return null==t?void 0:t.reason}function Fe(e){const t=(0,L.zu)(g.df,e);return null==t?void 0:t.url}function Pe(e,t){null!=e&&e.kind===_.h.DOCUMENT||(0,o.a)(!1,"Must provide valid Document AST."),!0!==(null==t?void 0:t.assumeValid)&&!0!==(null==t?void 0:t.assumeValidSDL)&&(0,u.zo)(e);const n=Ae({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...g.V4.filter((e=>n.directives.every((t=>t.name!==e.name))))];return new m.XO({...n,directives:r})}function je(e,t){return Pe((0,s.Qc)(e,{noLocation:null==t?void 0:t.noLocation,allowLegacyFragmentVariables:null==t?void 0:t.allowLegacyFragmentVariables}),{assumeValidSDL:null==t?void 0:t.assumeValidSDL,assumeValid:null==t?void 0:t.assumeValid})}var Ve=n(6625);function Ue(e){const t=e.toConfig(),n=(0,ke.w)($e(t.types),(e=>e.name),(function(e){if((0,h.KA)(e)||(0,y.s9)(e))return e;if((0,h.lp)(e)){const t=e.toConfig();return new h.h6({...t,interfaces:()=>l(t.interfaces),fields:()=>s(t.fields)})}if((0,h.oT)(e)){const t=e.toConfig();return new h.oW({...t,interfaces:()=>l(t.interfaces),fields:()=>s(t.fields)})}if((0,h.EN)(e)){const t=e.toConfig();return new h.Gp({...t,types:()=>l(t.types)})}if((0,h.EM)(e)){const t=e.toConfig();return new h.mR({...t,values:Be(t.values,(e=>e))})}if((0,h.hL)(e)){const t=e.toConfig();return new h.sR({...t,fields:()=>Be(t.fields,(e=>({...e,type:r(e.type)})))})}(0,M.k)(!1,"Unexpected type: "+(0,xe.X)(e))}));return new m.XO({...t,types:Object.values(n),directives:$e(t.directives).map((function(e){const t=e.toConfig();return new g.NZ({...t,locations:qe(t.locations,(e=>e)),args:a(t.args)})})),query:o(t.query),mutation:o(t.mutation),subscription:o(t.subscription)});function r(e){return(0,h.HG)(e)?new h.p2(r(e.ofType)):(0,h.zM)(e)?new h.bM(r(e.ofType)):i(e)}function i(e){return n[e.name]}function o(e){return e&&i(e)}function a(e){return Be(e,(e=>({...e,type:r(e.type)})))}function s(e){return Be(e,(e=>({...e,type:r(e.type),args:e.args&&a(e.args)})))}function l(e){return $e(e).map(i)}}function Be(e,t){const n=Object.create(null);for(const r of Object.keys(e).sort(Ve.K))n[r]=t(e[r]);return n}function $e(e){return qe(e,(e=>e.name))}function qe(e,t){return e.slice().sort(((e,n)=>{const r=t(e),i=t(n);return(0,Ve.K)(r,i)}))}var He=n(6303),Ge=n(3190);function ze(e){return Qe(e,(e=>!(0,g.xg)(e)),Ke)}function We(e){return Qe(e,g.xg,y.s9)}function Ke(e){return!(0,v.u1)(e)&&!(0,y.s9)(e)}function Qe(e,t,n){const r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[Xe(e),...r.map((e=>function(e){return it(e)+"directive @"+e.name+tt(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...i.map((e=>Ye(e)))].filter(Boolean).join("\n\n")}function Xe(e){if(null==e.description&&function(e){const t=e.getQueryType();if(t&&"Query"!==t.name)return!1;const n=e.getMutationType();if(n&&"Mutation"!==n.name)return!1;const r=e.getSubscriptionType();return!r||"Subscription"===r.name}(e))return;const t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);const r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);const i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),it(e)+`schema {\n${t.join("\n")}\n}`}function Ye(e){return(0,h.KA)(e)?function(e){return it(e)+`scalar ${e.name}`+(null==(t=e).specifiedByURL?"":` @specifiedBy(url: ${(0,N.S)({kind:_.h.STRING,value:t.specifiedByURL})})`);var t}(e):(0,h.lp)(e)?function(e){return it(e)+`type ${e.name}`+Je(e)+Ze(e)}(e):(0,h.oT)(e)?function(e){return it(e)+`interface ${e.name}`+Je(e)+Ze(e)}(e):(0,h.EN)(e)?function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return it(e)+"union "+e.name+n}(e):(0,h.EM)(e)?function(e){const t=e.getValues().map(((e,t)=>it(e," ",!t)+" "+e.name+rt(e.deprecationReason)));return it(e)+`enum ${e.name}`+et(t)}(e):(0,h.hL)(e)?function(e){const t=Object.values(e.getFields()).map(((e,t)=>it(e," ",!t)+" "+nt(e)));return it(e)+`input ${e.name}`+et(t)}(e):void(0,M.k)(!1,"Unexpected type: "+(0,xe.X)(e))}function Je(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function Ze(e){return et(Object.values(e.getFields()).map(((e,t)=>it(e," ",!t)+" "+e.name+tt(e.args," ")+": "+String(e.type)+rt(e.deprecationReason))))}function et(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function tt(e,t=""){return 0===e.length?"":e.every((e=>!e.description))?"("+e.map(nt).join(", ")+")":"(\n"+e.map(((e,n)=>it(e," "+t,!n)+" "+t+nt(e))).join("\n")+"\n"+t+")"}function nt(e){const t=(0,Ge.J)(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=` = ${(0,N.S)(t)}`),n+rt(e.deprecationReason)}function rt(e){return null==e?"":e!==g.SY?` @deprecated(reason: ${(0,N.S)({kind:_.h.STRING,value:e})})`:" @deprecated"}function it(e,t="",n=!0){const{description:r}=e;return null==r?"":(t&&!n?"\n"+t:t)+(0,N.S)({kind:_.h.STRING,value:r,block:(0,He.MZ)(r)}).replace(/\n/g,"\n"+t)+"\n"}function ot(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:_.h.DOCUMENT,definitions:t}}function at(e){const t=[],n=Object.create(null);for(const r of e.definitions)switch(r.kind){case _.h.OPERATION_DEFINITION:t.push(r);break;case _.h.FRAGMENT_DEFINITION:n[r.name.value]=lt(r.selectionSet)}const r=Object.create(null);for(const i of t){const t=new Set;for(const e of lt(i.selectionSet))st(t,n,e);r[i.name?i.name.value:""]={kind:_.h.DOCUMENT,definitions:e.definitions.filter((e=>e===i||e.kind===_.h.FRAGMENT_DEFINITION&&t.has(e.name.value)))}}return r}function st(e,t,n){if(!e.has(n)){e.add(n);const r=t[n];if(void 0!==r)for(const n of r)st(e,t,n)}}function lt(e){const t=[];return(0,k.Vn)(e,{FragmentSpread(e){t.push(e.name.value)}}),t}function ut(e){const t=(0,T.T)(e)?e:new T.H(e),n=t.body,r=new S.h(t);let i="",o=!1;for(;r.advance().kind!==x.T.EOF;){const e=r.token,t=e.kind,a=!(0,S.u)(e.kind);o&&(a||e.kind===x.T.SPREAD)&&(i+=" ");const s=n.slice(e.start,e.end);t===x.T.BLOCK_STRING?i+=(0,He.LZ)(e.value,{minimize:!0}):i+=s,o=a}return i}function ct(e){const t=dt(e);if(t)throw t;return e}function dt(e){if("string"==typeof e||(0,o.a)(!1,"Expected name to be a string."),e.startsWith("__"))return new R.__(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{(0,b.i)(e)}catch(e){return e}}var ft=n(4034);let pt,ht;function mt(e,t){return vt(e,t).filter((e=>e.type in pt))}function gt(e,t){return vt(e,t).filter((e=>e.type in ht))}function vt(e,t){return[...bt(e,t),...yt(e,t)]}function yt(e,t){const n=[],r=It(e.getDirectives(),t.getDirectives());for(const e of r.removed)n.push({type:pt.DIRECTIVE_REMOVED,description:`${e.name} was removed.`});for(const[e,t]of r.persisted){const r=It(e.args,t.args);for(const t of r.added)(0,h.dK)(t)&&n.push({type:pt.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${t.name} on directive ${e.name} was added.`});for(const t of r.removed)n.push({type:pt.DIRECTIVE_ARG_REMOVED,description:`${t.name} was removed from ${e.name}.`});e.isRepeatable&&!t.isRepeatable&&n.push({type:pt.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${e.name}.`});for(const r of e.locations)t.locations.includes(r)||n.push({type:pt.DIRECTIVE_LOCATION_REMOVED,description:`${r} was removed from ${e.name}.`})}return n}function bt(e,t){const n=[],r=It(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(const e of r.removed)n.push({type:pt.TYPE_REMOVED,description:(0,v.u1)(e)?`Standard scalar ${e.name} was removed because it is not referenced anymore.`:`${e.name} was removed.`});for(const[e,t]of r.persisted)(0,h.EM)(e)&&(0,h.EM)(t)?n.push(...wt(e,t)):(0,h.EN)(e)&&(0,h.EN)(t)?n.push(...Tt(e,t)):(0,h.hL)(e)&&(0,h.hL)(t)?n.push(...Et(e,t)):(0,h.lp)(e)&&(0,h.lp)(t)||(0,h.oT)(e)&&(0,h.oT)(t)?n.push(...St(e,t),...Ct(e,t)):e.constructor!==t.constructor&&n.push({type:pt.TYPE_CHANGED_KIND,description:`${e.name} changed from ${_t(e)} to ${_t(t)}.`});return n}function Et(e,t){const n=[],r=It(Object.values(e.getFields()),Object.values(t.getFields()));for(const t of r.added)(0,h.Wd)(t)?n.push({type:pt.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${t.name} on input type ${e.name} was added.`}):n.push({type:ht.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${t.name} on input type ${e.name} was added.`});for(const t of r.removed)n.push({type:pt.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(const[t,i]of r.persisted)kt(t.type,i.type)||n.push({type:pt.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`});return n}function Tt(e,t){const n=[],r=It(e.getTypes(),t.getTypes());for(const t of r.added)n.push({type:ht.TYPE_ADDED_TO_UNION,description:`${t.name} was added to union type ${e.name}.`});for(const t of r.removed)n.push({type:pt.TYPE_REMOVED_FROM_UNION,description:`${t.name} was removed from union type ${e.name}.`});return n}function wt(e,t){const n=[],r=It(e.getValues(),t.getValues());for(const t of r.added)n.push({type:ht.VALUE_ADDED_TO_ENUM,description:`${t.name} was added to enum type ${e.name}.`});for(const t of r.removed)n.push({type:pt.VALUE_REMOVED_FROM_ENUM,description:`${t.name} was removed from enum type ${e.name}.`});return n}function Ct(e,t){const n=[],r=It(e.getInterfaces(),t.getInterfaces());for(const t of r.added)n.push({type:ht.IMPLEMENTED_INTERFACE_ADDED,description:`${t.name} added to interfaces implemented by ${e.name}.`});for(const t of r.removed)n.push({type:pt.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${t.name}.`});return n}function St(e,t){const n=[],r=It(Object.values(e.getFields()),Object.values(t.getFields()));for(const t of r.removed)n.push({type:pt.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(const[t,i]of r.persisted)n.push(...xt(e,t,i)),Nt(t.type,i.type)||n.push({type:pt.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`});return n}function xt(e,t,n){const r=[],i=It(t.args,n.args);for(const n of i.removed)r.push({type:pt.ARG_REMOVED,description:`${e.name}.${t.name} arg ${n.name} was removed.`});for(const[n,o]of i.persisted)if(kt(n.type,o.type)){if(void 0!==n.defaultValue)if(void 0===o.defaultValue)r.push({type:ht.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} defaultValue was removed.`});else{const i=Ot(n.defaultValue,n.type),a=Ot(o.defaultValue,o.type);i!==a&&r.push({type:ht.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} has changed defaultValue from ${i} to ${a}.`})}}else r.push({type:pt.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${n.name} has changed type from ${String(n.type)} to ${String(o.type)}.`});for(const n of i.added)(0,h.dK)(n)?r.push({type:pt.REQUIRED_ARG_ADDED,description:`A required arg ${n.name} on ${e.name}.${t.name} was added.`}):r.push({type:ht.OPTIONAL_ARG_ADDED,description:`An optional arg ${n.name} on ${e.name}.${t.name} was added.`});return r}function Nt(e,t){return(0,h.HG)(e)?(0,h.HG)(t)&&Nt(e.ofType,t.ofType)||(0,h.zM)(t)&&Nt(e,t.ofType):(0,h.zM)(e)?(0,h.zM)(t)&&Nt(e.ofType,t.ofType):(0,h.Zs)(t)&&e.name===t.name||(0,h.zM)(t)&&Nt(e,t.ofType)}function kt(e,t){return(0,h.HG)(e)?(0,h.HG)(t)&&kt(e.ofType,t.ofType):(0,h.zM)(e)?(0,h.zM)(t)&&kt(e.ofType,t.ofType)||!(0,h.zM)(t)&&kt(e.ofType,t):(0,h.Zs)(t)&&e.name===t.name}function _t(e){return(0,h.KA)(e)?"a Scalar type":(0,h.lp)(e)?"an Object type":(0,h.oT)(e)?"an Interface type":(0,h.EN)(e)?"a Union type":(0,h.EM)(e)?"an Enum type":(0,h.hL)(e)?"an Input type":void(0,M.k)(!1,"Unexpected type: "+(0,xe.X)(e))}function Ot(e,t){const n=(0,Ge.J)(e,t);return null!=n||(0,M.k)(!1),(0,N.S)((0,ft.n)(n))}function It(e,t){const n=[],r=[],i=[],o=(0,Ie.P)(e,(({name:e})=>e)),a=(0,Ie.P)(t,(({name:e})=>e));for(const t of e){const e=a[t.name];void 0===e?r.push(t):i.push([t,e])}for(const e of t)void 0===o[e.name]&&n.push(e);return{added:n,persisted:i,removed:r}}!function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"}(pt||(pt={})),function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"}(ht||(ht={}));var Dt=n(9458),Lt=n(5998),At=n(9426),Mt=n(1409),Rt=n(5925),Ft=n(2984)},9878:function(e,t,n){"use strict";function r(e,t,n){return{prev:e,key:t,typename:n}}function i(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}n.d(t,{N:function(){return i},Q:function(){return r}})},1172:function(e,t,n){"use strict";function r(e,t){if(!Boolean(e))throw new Error(t)}n.d(t,{a:function(){return r}})},8063:function(e,t,n){"use strict";n.d(t,{l:function(){return i}});const r=5;function i(e,t){const[n,i]=t?[e,t]:[void 0,e];let o=" Did you mean ";n&&(o+=n+" ");const a=i.map((e=>`"${e}"`));switch(a.length){case 0:return"";case 1:return o+a[0]+"?";case 2:return o+a[0]+" or "+a[1]+"?"}const s=a.slice(0,r),l=s.pop();return o+s.join(", ")+", or "+l+"?"}},5839:function(e,t,n){"use strict";function r(e,t){const n=new Map;for(const r of e){const e=t(r),i=n.get(e);void 0===i?n.set(e,[r]):i.push(r)}return n}n.d(t,{v:function(){return r}})},5648:function(e,t,n){"use strict";n.d(t,{X:function(){return o}});const r=10,i=2;function o(e){return a(e,[])}function a(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:a(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>i)return"[Array]";const n=Math.min(r,e.length),o=e.length-n,s=[];for(let r=0;r1&&s.push(`... ${o} more items`),"["+s.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>i)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map((([e,n])=>e+": "+a(n,t)));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}},1513:function(e,t,n){"use strict";n.d(t,{n:function(){return r}});const r=function(e,t){return e instanceof t}},5052:function(e,t,n){"use strict";function r(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}n.d(t,{k:function(){return r}})},2910:function(e,t,n){"use strict";function r(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}n.d(t,{i:function(){return r}})},1315:function(e,t,n){"use strict";function r(e){return"object"==typeof e&&null!==e}n.d(t,{y:function(){return r}})},1864:function(e,t,n){"use strict";function r(e){return"function"==typeof(null==e?void 0:e.then)}n.d(t,{t:function(){return r}})},9815:function(e,t,n){"use strict";function r(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}n.d(t,{P:function(){return r}})},8240:function(e,t,n){"use strict";function r(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}n.d(t,{w:function(){return r}})},9997:function(e,t,n){"use strict";function r(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}n.d(t,{j:function(){return r}})},6625:function(e,t,n){"use strict";function r(e,t){let n=0,r=0;for(;n0);let u=0;do{++r,u=10*u+s-i,s=t.charCodeAt(r)}while(a(s)&&u>0);if(lu)return 1}else{if(os)return 1;++n,++r}}return e.length-t.length}n.d(t,{K:function(){return r}});const i=48,o=57;function a(e){return!isNaN(e)&&i<=e&&e<=o}},4987:function(e,t,n){"use strict";function r(e){return e.map((e=>"number"==typeof e?"["+e.toString()+"]":"."+e)).join("")}n.d(t,{F:function(){return r}})},3492:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(6625);function i(e,t){const n=Object.create(null),i=new o(e),a=Math.floor(.4*e.length)+1;for(const e of t){const t=i.measure(e,a);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const i=n[e]-n[t];return 0!==i?i:(0,r.K)(e,t)}))}class o{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=a(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=a(n),i=this._inputArray;if(r.lengtht)return;const l=this._rows;for(let e=0;e<=s;e++)l[0][e]=e;for(let e=1;e<=o;e++){const n=l[(e-1)%3],o=l[e%3];let a=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=l[(e-2)%3][t-2];u=Math.min(u,n+1)}ut)return}const u=l[o%3][s];return u<=t?u:void 0}}function a(e){const t=e.length,n=new Array(t);for(let r=0;r0===t?e:e.slice(n))).slice(null!==(t=r)&&void 0!==t?t:0,i+1)}function o(e){let t=0;for(;t1&&i.slice(1).every((e=>0===e.length||(0,r.FD)(e.charCodeAt(0)))),s=n.endsWith('\\"""'),l=e.endsWith('"')&&!s,u=e.endsWith("\\"),c=l||u,d=!(null!=t&&t.minimize)&&(!o||e.length>70||c||a||s);let f="";const p=o&&(0,r.FD)(e.charCodeAt(0));return(d&&!p||a)&&(f+="\n"),f+=n,(d||c)&&(f+="\n"),'"""'+f+'"""'}},1117:function(e,t,n){"use strict";function r(e){return 9===e||32===e}function i(e){return e>=48&&e<=57}function o(e){return e>=97&&e<=122||e>=65&&e<=90}function a(e){return o(e)||95===e}function s(e){return o(e)||i(e)||95===e}n.d(t,{FD:function(){return r},HQ:function(){return s},LQ:function(){return a},X1:function(){return i}})},3140:function(e,t,n){"use strict";let r;n.d(t,{B:function(){return r}}),function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(r||(r={}))},3830:function(e,t,n){"use strict";let r;n.d(t,{h:function(){return r}}),function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(r||(r={}))},9230:function(e,t,n){"use strict";n.d(t,{h:function(){return l},u:function(){return u}});var r=n(2024),i=n(3526),o=n(6303),a=n(1117),s=n(5685);class l{constructor(e){const t=new i.WU(s.T.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==s.T.EOF)do{if(e.next)e=e.next;else{const t=g(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===s.T.COMMENT);return e}}function u(e){return e===s.T.BANG||e===s.T.DOLLAR||e===s.T.AMP||e===s.T.PAREN_L||e===s.T.PAREN_R||e===s.T.SPREAD||e===s.T.COLON||e===s.T.EQUALS||e===s.T.AT||e===s.T.BRACKET_L||e===s.T.BRACKET_R||e===s.T.BRACE_L||e===s.T.PIPE||e===s.T.BRACE_R}function c(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function d(e,t){return f(e.charCodeAt(t))&&p(e.charCodeAt(t+1))}function f(e){return e>=55296&&e<=56319}function p(e){return e>=56320&&e<=57343}function h(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return s.T.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function m(e,t,n,r,o){const a=e.line,s=1+n-e.lineStart;return new i.WU(t,n,r,a,s,o)}function g(e,t){const n=e.source.body,i=n.length;let o=t;for(;o=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function x(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,r.h)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function N(e,t){const n=e.source.body,i=n.length;let a=e.lineStart,l=t+3,u=l,f="";const p=[];for(;l=t)break;n=a.index+a[0].length,o+=1}return{line:o,column:t+1-n}}},953:function(e,t,n){"use strict";n.d(t,{H2:function(){return d},Qc:function(){return c},gZ:function(){return p},tl:function(){return f}});var r=n(2024),i=n(3526),o=n(3140),a=n(3830),s=n(9230),l=n(4680),u=n(5685);function c(e,t){return new h(e,t).parseDocument()}function d(e,t){const n=new h(e,t);n.expectToken(u.T.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(u.T.EOF),r}function f(e,t){const n=new h(e,t);n.expectToken(u.T.SOF);const r=n.parseConstValueLiteral();return n.expectToken(u.T.EOF),r}function p(e,t){const n=new h(e,t);n.expectToken(u.T.SOF);const r=n.parseTypeReference();return n.expectToken(u.T.EOF),r}class h{constructor(e,t){const n=(0,l.T)(e)?e:new l.H(e);this._lexer=new s.h(n),this._options=t}parseName(){const e=this.expectToken(u.T.NAME);return this.node(e,{kind:a.h.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:a.h.DOCUMENT,definitions:this.many(u.T.SOF,this.parseDefinition,u.T.EOF)})}parseDefinition(){if(this.peek(u.T.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===u.T.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,r.h)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(u.T.BRACE_L))return this.node(e,{kind:a.h.OPERATION_DEFINITION,operation:i.ku.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(u.T.NAME)&&(n=this.parseName()),this.node(e,{kind:a.h.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(u.T.NAME);switch(e.value){case"query":return i.ku.QUERY;case"mutation":return i.ku.MUTATION;case"subscription":return i.ku.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(u.T.PAREN_L,this.parseVariableDefinition,u.T.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:a.h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(u.T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.T.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(u.T.DOLLAR),this.node(e,{kind:a.h.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:a.h.SELECTION_SET,selections:this.many(u.T.BRACE_L,this.parseSelection,u.T.BRACE_R)})}parseSelection(){return this.peek(u.T.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(u.T.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:a.h.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.T.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.T.PAREN_L,t,u.T.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(u.T.COLON),this.node(t,{kind:a.h.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(u.T.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(u.T.NAME)?this.node(e,{kind:a.h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:a.h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){var e;const t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacyFragmentVariables)?this.node(t,{kind:a.h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:a.h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case u.T.BRACKET_L:return this.parseList(e);case u.T.BRACE_L:return this.parseObject(e);case u.T.INT:return this._lexer.advance(),this.node(t,{kind:a.h.INT,value:t.value});case u.T.FLOAT:return this._lexer.advance(),this.node(t,{kind:a.h.FLOAT,value:t.value});case u.T.STRING:case u.T.BLOCK_STRING:return this.parseStringLiteral();case u.T.NAME:switch(this._lexer.advance(),t.value){case"true":return this.node(t,{kind:a.h.BOOLEAN,value:!0});case"false":return this.node(t,{kind:a.h.BOOLEAN,value:!1});case"null":return this.node(t,{kind:a.h.NULL});default:return this.node(t,{kind:a.h.ENUM,value:t.value})}case u.T.DOLLAR:if(e){if(this.expectToken(u.T.DOLLAR),this._lexer.token.kind===u.T.NAME){const e=this._lexer.token.value;throw(0,r.h)(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this._lexer.advance(),this.node(e,{kind:a.h.STRING,value:e.value,block:e.kind===u.T.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:a.h.LIST,values:this.any(u.T.BRACKET_L,(()=>this.parseValueLiteral(e)),u.T.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:a.h.OBJECT,fields:this.any(u.T.BRACE_L,(()=>this.parseObjectField(e)),u.T.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(u.T.COLON),this.node(t,{kind:a.h.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(u.T.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(u.T.AT),this.node(t,{kind:a.h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(u.T.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(u.T.BRACKET_R),t=this.node(e,{kind:a.h.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(u.T.BANG)?this.node(e,{kind:a.h.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:a.h.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(u.T.STRING)||this.peek(u.T.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(u.T.BRACE_L,this.parseOperationTypeDefinition,u.T.BRACE_R);return this.node(e,{kind:a.h.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(u.T.COLON);const n=this.parseNamedType();return this.node(e,{kind:a.h.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:a.h.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:a.h.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(u.T.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(u.T.BRACE_L,this.parseFieldDefinition,u.T.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(u.T.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:a.h.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(u.T.PAREN_L,this.parseInputValueDef,u.T.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(u.T.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(u.T.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:a.h.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:a.h.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:a.h.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(u.T.EQUALS)?this.delimitedMany(u.T.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:a.h.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(u.T.BRACE_L,this.parseEnumValueDefinition,u.T.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:a.h.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,r.h)(this._lexer.source,this._lexer.token.start,`${m(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:a.h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(u.T.BRACE_L,this.parseInputValueDef,u.T.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===u.T.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(u.T.BRACE_L,this.parseOperationTypeDefinition,u.T.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:a.h.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:a.h.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:a.h.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:a.h.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.h.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.h.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.T.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:a.h.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(u.T.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(o.B,t.value))return t;throw this.unexpected(e)}node(e,t){var n;return!0!==(null===(n=this._options)||void 0===n?void 0:n.noLocation)&&(t.loc=new i.Ye(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw(0,r.h)(this._lexer.source,t.start,`Expected ${g(e)}, found ${m(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this._lexer.advance(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==u.T.NAME||t.value!==e)throw(0,r.h)(this._lexer.source,t.start,`Expected "${e}", found ${m(t)}.`);this._lexer.advance()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===u.T.NAME&&t.value===e&&(this._lexer.advance(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return(0,r.h)(this._lexer.source,t.start,`Unexpected ${m(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}}function m(e){const t=e.value;return g(e.kind)+(null!=t?` "${t}"`:"")}function g(e){return(0,s.u)(e)?`"${e}"`:e}},9615:function(e,t,n){"use strict";n.d(t,{D$:function(){return p},G4:function(){return c},Ir:function(){return i},Of:function(){return l},VB:function(){return u},Wk:function(){return o},aU:function(){return f},nr:function(){return s},pO:function(){return a},zT:function(){return d}});var r=n(3830);function i(e){return o(e)||c(e)||f(e)}function o(e){return e.kind===r.h.OPERATION_DEFINITION||e.kind===r.h.FRAGMENT_DEFINITION}function a(e){return e.kind===r.h.FIELD||e.kind===r.h.FRAGMENT_SPREAD||e.kind===r.h.INLINE_FRAGMENT}function s(e){return e.kind===r.h.VARIABLE||e.kind===r.h.INT||e.kind===r.h.FLOAT||e.kind===r.h.STRING||e.kind===r.h.BOOLEAN||e.kind===r.h.NULL||e.kind===r.h.ENUM||e.kind===r.h.LIST||e.kind===r.h.OBJECT}function l(e){return s(e)&&(e.kind===r.h.LIST?e.values.some(l):e.kind===r.h.OBJECT?e.fields.some((e=>l(e.value))):e.kind!==r.h.VARIABLE)}function u(e){return e.kind===r.h.NAMED_TYPE||e.kind===r.h.LIST_TYPE||e.kind===r.h.NON_NULL_TYPE}function c(e){return e.kind===r.h.SCHEMA_DEFINITION||d(e)||e.kind===r.h.DIRECTIVE_DEFINITION}function d(e){return e.kind===r.h.SCALAR_TYPE_DEFINITION||e.kind===r.h.OBJECT_TYPE_DEFINITION||e.kind===r.h.INTERFACE_TYPE_DEFINITION||e.kind===r.h.UNION_TYPE_DEFINITION||e.kind===r.h.ENUM_TYPE_DEFINITION||e.kind===r.h.INPUT_OBJECT_TYPE_DEFINITION}function f(e){return e.kind===r.h.SCHEMA_EXTENSION||p(e)}function p(e){return e.kind===r.h.SCALAR_TYPE_EXTENSION||e.kind===r.h.OBJECT_TYPE_EXTENSION||e.kind===r.h.INTERFACE_TYPE_EXTENSION||e.kind===r.h.UNION_TYPE_EXTENSION||e.kind===r.h.ENUM_TYPE_EXTENSION||e.kind===r.h.INPUT_OBJECT_TYPE_EXTENSION}},7026:function(e,t,n){"use strict";n.d(t,{Q:function(){return i},z:function(){return o}});var r=n(3302);function i(e){return o(e.source,(0,r.k)(e.source,e.start))}function o(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,l=1===t.line?n:0,u=t.column+l,c=`${e.name}:${s}:${u}\n`,d=r.split(/\r\n|[\n\r]/g),f=d[i];if(f.length>120){const e=Math.floor(u/80),t=u%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return c+a([[s-1+" |",d[i-1]],[`${s} |`,f],["|","^".padStart(u)],[`${s+1} |`,d[i+1]]])}function a(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}},5895:function(e,t,n){"use strict";n.d(t,{S:function(){return l}});var r=n(6303);const i=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function o(e){return a[e.charCodeAt(0)]}const a=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var s=n(9685);function l(e){return(0,s.Vn)(e,u)}const u={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>c(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=f("(",c(e.variableDefinitions,", "),")"),n=c([e.operation,c([e.name,t]),c(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+f(" = ",n)+f(" ",c(r," "))},SelectionSet:{leave:({selections:e})=>d(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=f("",e,": ")+t;let a=o+f("(",c(n,", "),")");return a.length>80&&(a=o+f("(\n",p(c(n,"\n")),"\n)")),c([a,c(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+f(" ",c(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>c(["...",f("on ",e),c(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${f("(",c(n,", "),")")} on ${t} ${f("",c(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,r.LZ)(e):`"${e.replace(i,o)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+c(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+c(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+f("(",c(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>f("",e,"\n")+c(["schema",c(t," "),d(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>f("",e,"\n")+c(["scalar",t,c(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>f("",e,"\n")+c(["type",t,f("implements ",c(n," & ")),c(r," "),d(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>f("",e,"\n")+t+(h(n)?f("(\n",p(c(n,"\n")),"\n)"):f("(",c(n,", "),")"))+": "+r+f(" ",c(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>f("",e,"\n")+c([t+": "+n,f("= ",r),c(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>f("",e,"\n")+c(["interface",t,f("implements ",c(n," & ")),c(r," "),d(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>f("",e,"\n")+c(["union",t,c(n," "),f("= ",c(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>f("",e,"\n")+c(["enum",t,c(n," "),d(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>f("",e,"\n")+c([t,c(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>f("",e,"\n")+c(["input",t,c(n," "),d(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>f("",e,"\n")+"directive @"+t+(h(n)?f("(\n",p(c(n,"\n")),"\n)"):f("(",c(n,", "),")"))+(r?" repeatable":"")+" on "+c(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>c(["extend schema",c(e," "),d(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>c(["extend scalar",e,c(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>c(["extend type",e,f("implements ",c(t," & ")),c(n," "),d(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>c(["extend interface",e,f("implements ",c(t," & ")),c(n," "),d(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>c(["extend union",e,c(t," "),f("= ",c(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>c(["extend enum",e,c(t," "),d(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>c(["extend input",e,c(t," "),d(n)]," ")}};function c(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function d(e){return f("{\n",p(c(e,"\n")),"\n}")}function f(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function p(e){return f(" ",e.replace(/\n/g,"\n "))}function h(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}},4680:function(e,t,n){"use strict";n.d(t,{H:function(){return a},T:function(){return s}});var r=n(1172),i=n(5648),o=n(1513);class a{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||(0,r.a)(!1,`Body must be a string. Received: ${(0,i.X)(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||(0,r.a)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,r.a)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function s(e){return(0,o.n)(e,a)}},5685:function(e,t,n){"use strict";let r;n.d(t,{T:function(){return r}}),function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(r||(r={}))},9685:function(e,t,n){"use strict";n.d(t,{$_:function(){return s},CK:function(){return d},Eu:function(){return c},Vn:function(){return l},j1:function(){return u}});var r=n(1172),i=n(5648),o=n(3526),a=n(3830);const s=Object.freeze({});function l(e,t,n=o.h8){const l=new Map;for(const e of Object.values(a.h))l.set(e,c(t,e));let u,d,f,p=Array.isArray(e),h=[e],m=-1,g=[],v=e;const y=[],b=[];do{m++;const e=m===h.length,a=e&&0!==g.length;if(e){if(d=0===b.length?void 0:y[y.length-1],v=f,f=b.pop(),a)if(p){v=v.slice();let e=0;for(const[t,n]of g){const r=t-e;null===n?(v.splice(r,1),e++):v[r]=n}}else{v=Object.defineProperties({},Object.getOwnPropertyDescriptors(v));for(const[e,t]of g)v[e]=t}m=u.index,h=u.keys,g=u.edits,p=u.inArray,u=u.prev}else if(f){if(d=p?m:h[m],v=f[d],null==v)continue;y.push(d)}let c;if(!Array.isArray(v)){var E,T;(0,o.UG)(v)||(0,r.a)(!1,`Invalid AST Node: ${(0,i.X)(v)}.`);const n=e?null===(E=l.get(v.kind))||void 0===E?void 0:E.leave:null===(T=l.get(v.kind))||void 0===T?void 0:T.enter;if(c=null==n?void 0:n.call(t,v,d,f,y,b),c===s)break;if(!1===c){if(!e){y.pop();continue}}else if(void 0!==c&&(g.push([d,c]),!e)){if(!(0,o.UG)(c)){y.pop();continue}v=c}}var w;void 0===c&&a&&g.push([d,v]),e?y.pop():(u={inArray:p,index:m,keys:h,edits:g,prev:u},p=Array.isArray(v),h=p?v:null!==(w=n[v.kind])&&void 0!==w?w:[],m=-1,g=[],f&&b.push(f),f=v)}while(void 0!==u);return 0!==g.length?g[g.length-1][1]:e}function u(e){const t=new Array(e.length).fill(null),n=Object.create(null);for(const r of Object.values(a.h)){let i=!1;const o=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let t=0;tl((0,v.M)(e,t)),this.extensions=(0,p.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(s=e.extensionASTNodes)&&void 0!==s?s:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||(0,r.a)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,a.X)(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||(0,r.a)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||(0,r.a)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class ae{constructor(e){var t;this.name=(0,y.i)(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=(0,p.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=()=>le(e),this._interfaces=()=>se(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||(0,r.a)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,a.X)(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:de(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function se(e){var t;const n=re(null!==(t=e.interfaces)&&void 0!==t?t:[]);return Array.isArray(n)||(0,r.a)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function le(e){const t=ie(e.fields);return ce(t)||(0,r.a)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,d.j)(t,((t,n)=>{var i;ce(t)||(0,r.a)(!1,`${e.name}.${n} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||(0,r.a)(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${(0,a.X)(t.resolve)}.`);const o=null!==(i=t.args)&&void 0!==i?i:{};return ce(o)||(0,r.a)(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:(0,y.i)(n),description:t.description,type:t.type,args:ue(o),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:(0,p.u)(t.extensions),astNode:t.astNode}}))}function ue(e){return Object.entries(e).map((([e,t])=>({name:(0,y.i)(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:(0,p.u)(t.extensions),astNode:t.astNode})))}function ce(e){return(0,l.y)(e)&&!Array.isArray(e)}function de(e){return(0,d.j)(e,(e=>({description:e.description,type:e.type,args:fe(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function fe(e){return(0,c.w)(e,(e=>e.name),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function pe(e){return R(e.type)&&void 0===e.defaultValue}class he{constructor(e){var t;this.name=(0,y.i)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,p.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=le.bind(void 0,e),this._interfaces=se.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,r.a)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,a.X)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:de(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class me{constructor(e){var t;this.name=(0,y.i)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,p.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._types=ge.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,r.a)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,a.X)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ge(e){const t=re(e.types);return Array.isArray(t)||(0,r.a)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}class ve{constructor(e){var t,n,i;this.name=(0,y.i)(e.name),this.description=e.description,this.extensions=(0,p.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._values=(n=this.name,ce(i=e.values)||(0,r.a)(!1,`${n} values must be an object with value names as keys.`),Object.entries(i).map((([e,t])=>(ce(t)||(0,r.a)(!1,`${n}.${e} must refer to an object with a "value" key representing an internal value but got: ${(0,a.X)(t)}.`),{name:(0,y.g)(e),description:t.description,value:void 0!==t.value?t.value:e,deprecationReason:t.deprecationReason,extensions:(0,p.u)(t.extensions),astNode:t.astNode})))),this._valueLookup=new Map(this._values.map((e=>[e.value,e]))),this._nameLookup=(0,u.P)(this._values,(e=>e.name))}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(e){return this._nameLookup[e]}serialize(e){const t=this._valueLookup.get(e);if(void 0===t)throw new h.__(`Enum "${this.name}" cannot represent value: ${(0,a.X)(e)}`);return t.name}parseValue(e){if("string"!=typeof e){const t=(0,a.X)(e);throw new h.__(`Enum "${this.name}" cannot represent non-string value: ${t}.`+ye(this,t))}const t=this.getValue(e);if(null==t)throw new h.__(`Value "${e}" does not exist in "${this.name}" enum.`+ye(this,e));return t.value}parseLiteral(e,t){if(e.kind!==m.h.ENUM){const t=(0,g.S)(e);throw new h.__(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+ye(this,t),{nodes:e})}const n=this.getValue(e.value);if(null==n){const t=(0,g.S)(e);throw new h.__(`Value "${t}" does not exist in "${this.name}" enum.`+ye(this,t),{nodes:e})}return n.value}toConfig(){const e=(0,c.w)(this.getValues(),(e=>e.name),(e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ye(e,t){const n=e.getValues().map((e=>e.name)),r=(0,f.D)(t,n);return(0,i.l)("the enum value",r)}class be{constructor(e){var t;this.name=(0,y.i)(e.name),this.description=e.description,this.extensions=(0,p.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=Ee.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=(0,d.j)(this.getFields(),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Ee(e){const t=ie(e.fields);return ce(t)||(0,r.a)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,d.j)(t,((t,n)=>(!("resolve"in t)||(0,r.a)(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,y.i)(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:(0,p.u)(t.extensions),astNode:t.astNode})))}function Te(e){return R(e.type)&&void 0===e.defaultValue}},5946:function(e,t,n){"use strict";n.d(t,{CO:function(){return p},NZ:function(){return h},QE:function(){return g},SY:function(){return v},V4:function(){return E},Yf:function(){return m},df:function(){return b},fg:function(){return y},wX:function(){return f},xg:function(){return T}});var r=n(1172),i=n(5648),o=n(1513),a=n(1315),s=n(1140),l=n(3140),u=n(3228),c=n(755),d=n(1774);function f(e){return(0,o.n)(e,h)}function p(e){if(!f(e))throw new Error(`Expected ${(0,i.X)(e)} to be a GraphQL directive.`);return e}class h{constructor(e){var t,n;this.name=(0,u.i)(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!==(t=e.isRepeatable)&&void 0!==t&&t,this.extensions=(0,s.u)(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||(0,r.a)(!1,`@${e.name} locations must be an Array.`);const i=null!==(n=e.args)&&void 0!==n?n:{};(0,a.y)(i)&&!Array.isArray(i)||(0,r.a)(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=(0,c.WO)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,c.DM)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const m=new h({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[l.B.FIELD,l.B.FRAGMENT_SPREAD,l.B.INLINE_FRAGMENT],args:{if:{type:new c.bM(d.EZ),description:"Included when true."}}}),g=new h({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[l.B.FIELD,l.B.FRAGMENT_SPREAD,l.B.INLINE_FRAGMENT],args:{if:{type:new c.bM(d.EZ),description:"Skipped when true."}}}),v="No longer supported",y=new h({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[l.B.FIELD_DEFINITION,l.B.ARGUMENT_DEFINITION,l.B.INPUT_FIELD_DEFINITION,l.B.ENUM_VALUE],args:{reason:{type:d.kH,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:v}}}),b=new h({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[l.B.SCALAR],args:{url:{type:new c.bM(d.kH),description:"The URL that specifies the behavior of this scalar."}}}),E=Object.freeze([m,g,y,b]);function T(e){return E.some((({name:t})=>t===e.name))}},8078:function(e,t,n){"use strict";n.d(t,{Az:function(){return b},PX:function(){return y},TK:function(){return c},XQ:function(){return m},e_:function(){return h},hU:function(){return T},jT:function(){return g},l3:function(){return d},nL:function(){return w},qz:function(){return p},s9:function(){return C},tF:function(){return E},x2:function(){return f},zU:function(){return v}});var r=n(5648),i=n(5052),o=n(3140),a=n(5895),s=n(3190),l=n(755),u=n(1774);const c=new l.h6({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:u.kH,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new l.bM(new l.p2(new l.bM(p))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new l.bM(p),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:p,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:p,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new l.bM(new l.p2(new l.bM(d))),resolve:e=>e.getDirectives()}})}),d=new l.h6({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new l.bM(u.kH),resolve:e=>e.name},description:{type:u.kH,resolve:e=>e.description},isRepeatable:{type:new l.bM(u.EZ),resolve:e=>e.isRepeatable},locations:{type:new l.bM(new l.p2(new l.bM(f))),resolve:e=>e.locations},args:{type:new l.bM(new l.p2(new l.bM(m))),args:{includeDeprecated:{type:u.EZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter((e=>null==e.deprecationReason))}}})}),f=new l.mR({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:o.B.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:o.B.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:o.B.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:o.B.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:o.B.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:o.B.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:o.B.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:o.B.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:o.B.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:o.B.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:o.B.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:o.B.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:o.B.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:o.B.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:o.B.UNION,description:"Location adjacent to a union definition."},ENUM:{value:o.B.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:o.B.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:o.B.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:o.B.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),p=new l.h6({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new l.bM(y),resolve(e){return(0,l.KA)(e)?v.SCALAR:(0,l.lp)(e)?v.OBJECT:(0,l.oT)(e)?v.INTERFACE:(0,l.EN)(e)?v.UNION:(0,l.EM)(e)?v.ENUM:(0,l.hL)(e)?v.INPUT_OBJECT:(0,l.HG)(e)?v.LIST:(0,l.zM)(e)?v.NON_NULL:void(0,i.k)(!1,`Unexpected type: "${(0,r.X)(e)}".`)}},name:{type:u.kH,resolve:e=>"name"in e?e.name:void 0},description:{type:u.kH,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:u.kH,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new l.p2(new l.bM(h)),args:{includeDeprecated:{type:u.EZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,l.lp)(e)||(0,l.oT)(e)){const n=Object.values(e.getFields());return t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new l.p2(new l.bM(p)),resolve(e){if((0,l.lp)(e)||(0,l.oT)(e))return e.getInterfaces()}},possibleTypes:{type:new l.p2(new l.bM(p)),resolve(e,t,n,{schema:r}){if((0,l.m0)(e))return r.getPossibleTypes(e)}},enumValues:{type:new l.p2(new l.bM(g)),args:{includeDeprecated:{type:u.EZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,l.EM)(e)){const n=e.getValues();return t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new l.p2(new l.bM(m)),args:{includeDeprecated:{type:u.EZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,l.hL)(e)){const n=Object.values(e.getFields());return t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:p,resolve:e=>"ofType"in e?e.ofType:void 0}})}),h=new l.h6({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new l.bM(u.kH),resolve:e=>e.name},description:{type:u.kH,resolve:e=>e.description},args:{type:new l.bM(new l.p2(new l.bM(m))),args:{includeDeprecated:{type:u.EZ,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter((e=>null==e.deprecationReason))}},type:{type:new l.bM(p),resolve:e=>e.type},isDeprecated:{type:new l.bM(u.EZ),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:u.kH,resolve:e=>e.deprecationReason}})}),m=new l.h6({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new l.bM(u.kH),resolve:e=>e.name},description:{type:u.kH,resolve:e=>e.description},type:{type:new l.bM(p),resolve:e=>e.type},defaultValue:{type:u.kH,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=(0,s.J)(n,t);return r?(0,a.S)(r):null}},isDeprecated:{type:new l.bM(u.EZ),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:u.kH,resolve:e=>e.deprecationReason}})}),g=new l.h6({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new l.bM(u.kH),resolve:e=>e.name},description:{type:u.kH,resolve:e=>e.description},isDeprecated:{type:new l.bM(u.EZ),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:u.kH,resolve:e=>e.deprecationReason}})});let v;!function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"}(v||(v={}));const y=new l.mR({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:v.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:v.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:v.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:v.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:v.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:v.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:v.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:v.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),b={name:"__schema",type:new l.bM(c),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},E={name:"__type",type:p,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new l.bM(u.kH),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},T={name:"__typename",type:new l.bM(u.kH),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},w=Object.freeze([c,d,f,p,h,m,g,y]);function C(e){return w.some((({name:t})=>e.name===t))}},1774:function(e,t,n){"use strict";n.d(t,{EZ:function(){return h},HI:function(){return u},HS:function(){return g},_o:function(){return d},av:function(){return f},kH:function(){return p},km:function(){return m},st:function(){return c},u1:function(){return v}});var r=n(5648),i=n(1315),o=n(4117),a=n(3830),s=n(5895),l=n(755);const u=2147483647,c=-2147483648,d=new l.n2({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=y(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new o.__(`Int cannot represent non-integer value: ${(0,r.X)(t)}`);if(n>u||nu||eu||te.name===t))}function y(e){if((0,i.y)(e)){if("function"==typeof e.valueOf){const t=e.valueOf();if(!(0,i.y)(t))return t}if("function"==typeof e.toJSON)return e.toJSON()}return e}},773:function(e,t,n){"use strict";n.d(t,{EO:function(){return p},XO:function(){return h},nN:function(){return f}});var r=n(1172),i=n(5648),o=n(1513),a=n(1315),s=n(1140),l=n(3526),u=n(755),c=n(5946),d=n(8078);function f(e){return(0,o.n)(e,h)}function p(e){if(!f(e))throw new Error(`Expected ${(0,i.X)(e)} to be a GraphQL schema.`);return e}class h{constructor(e){var t,n;this.__validationErrors=!0===e.assumeValid?[]:void 0,(0,a.y)(e)||(0,r.a)(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||(0,r.a)(!1,`"types" must be Array if provided but got: ${(0,i.X)(e.types)}.`),!e.directives||Array.isArray(e.directives)||(0,r.a)(!1,`"directives" must be Array if provided but got: ${(0,i.X)(e.directives)}.`),this.description=e.description,this.extensions=(0,s.u)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=null!==(n=e.directives)&&void 0!==n?n:c.V4;const o=new Set(e.types);if(null!=e.types)for(const t of e.types)o.delete(t),m(t,o);null!=this._queryType&&m(this._queryType,o),null!=this._mutationType&&m(this._mutationType,o),null!=this._subscriptionType&&m(this._subscriptionType,o);for(const e of this._directives)if((0,c.wX)(e))for(const t of e.args)m(t.type,o);m(d.TK,o),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const e of o){if(null==e)continue;const t=e.name;if(t||(0,r.a)(!1,"One of the provided types for building the Schema is missing a name."),void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,(0,u.oT)(e)){for(const t of e.getInterfaces())if((0,u.oT)(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if((0,u.lp)(e))for(const t of e.getInterfaces())if((0,u.oT)(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case l.ku.QUERY:return this.getQueryType();case l.ku.MUTATION:return this.getMutationType();case l.ku.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return(0,u.EN)(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){const t=this._implementationsMap[e.name];return null!=t?t:{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap[e.name];if(void 0===n){if(n=Object.create(null),(0,u.EN)(e))for(const t of e.getTypes())n[t.name]=!0;else{const t=this.getImplementations(e);for(const e of t.objects)n[e.name]=!0;for(const e of t.interfaces)n[e.name]=!0}this._subTypeMap[e.name]=n}return void 0!==n[t.name]}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find((t=>t.name===e))}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function m(e,t){const n=(0,u.xC)(e);if(!t.has(n))if(t.add(n),(0,u.EN)(n))for(const e of n.getTypes())m(e,t);else if((0,u.lp)(n)||(0,u.oT)(n)){for(const e of n.getInterfaces())m(e,t);for(const e of Object.values(n.getFields())){m(e.type,t);for(const n of e.args)m(n.type,t)}}else if((0,u.hL)(n))for(const e of Object.values(n.getFields()))m(e.type,t);return t}},8555:function(e,t,n){"use strict";n.d(t,{F:function(){return d},J:function(){return f}});var r=n(5648),i=n(4117),o=n(3526),a=n(2984),s=n(755),l=n(5946),u=n(8078),c=n(773);function d(e){if((0,c.EO)(e),e.__validationErrors)return e.__validationErrors;const t=new p(e);!function(e){const t=e.schema,n=t.getQueryType();if(n){if(!(0,s.lp)(n)){var i;e.reportError(`Query root type must be Object type, it cannot be ${(0,r.X)(n)}.`,null!==(i=h(t,o.ku.QUERY))&&void 0!==i?i:n.astNode)}}else e.reportError("Query root type must be provided.",t.astNode);const a=t.getMutationType();var l;a&&!(0,s.lp)(a)&&e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,r.X)(a)}.`,null!==(l=h(t,o.ku.MUTATION))&&void 0!==l?l:a.astNode);const u=t.getSubscriptionType();var c;u&&!(0,s.lp)(u)&&e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,r.X)(u)}.`,null!==(c=h(t,o.ku.SUBSCRIPTION))&&void 0!==c?c:u.astNode)}(t),function(e){for(const n of e.schema.getDirectives())if((0,l.wX)(n)){m(e,n);for(const i of n.args){var t;m(e,i),(0,s.j$)(i.type)||e.reportError(`The type of @${n.name}(${i.name}:) must be Input Type but got: ${(0,r.X)(i.type)}.`,i.astNode),(0,s.dK)(i)&&null!=i.deprecationReason&&e.reportError(`Required argument @${n.name}(${i.name}:) cannot be deprecated.`,[x(i.astNode),null===(t=i.astNode)||void 0===t?void 0:t.type])}}else e.reportError(`Expected directive but got: ${(0,r.X)(n)}.`,null==n?void 0:n.astNode)}(t),function(e){const t=function(e){const t=Object.create(null),n=[],r=Object.create(null);return function i(o){if(t[o.name])return;t[o.name]=!0,r[o.name]=n.length;const a=Object.values(o.getFields());for(const t of a)if((0,s.zM)(t.type)&&(0,s.hL)(t.type.ofType)){const o=t.type.ofType,a=r[o.name];if(n.push(t),void 0===a)i(o);else{const t=n.slice(a),r=t.map((e=>e.name)).join(".");e.reportError(`Cannot reference Input Object "${o.name}" within itself through a series of non-null fields: "${r}".`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),n=e.schema.getTypeMap();for(const i of Object.values(n))(0,s.Zs)(i)?((0,u.s9)(i)||m(e,i),(0,s.lp)(i)||(0,s.oT)(i)?(g(e,i),v(e,i)):(0,s.EN)(i)?E(e,i):(0,s.EM)(i)?T(e,i):(0,s.hL)(i)&&(w(e,i),t(i))):e.reportError(`Expected GraphQL named type but got: ${(0,r.X)(i)}.`,i.astNode)}(t);const n=t.getErrors();return e.__validationErrors=n,n}function f(e){const t=d(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}class p{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new i.__(e,{nodes:n}))}getErrors(){return this._errors}}function h(e,t){var n;return null===(n=[e.astNode,...e.extensionASTNodes].flatMap((e=>{var t;return null!==(t=null==e?void 0:e.operationTypes)&&void 0!==t?t:[]})).find((e=>e.operation===t)))||void 0===n?void 0:n.type}function m(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function g(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const l of n){var i;m(e,l),(0,s.SZ)(l.type)||e.reportError(`The type of ${t.name}.${l.name} must be Output Type but got: ${(0,r.X)(l.type)}.`,null===(i=l.astNode)||void 0===i?void 0:i.type);for(const n of l.args){const i=n.name;var o,a;m(e,n),(0,s.j$)(n.type)||e.reportError(`The type of ${t.name}.${l.name}(${i}:) must be Input Type but got: ${(0,r.X)(n.type)}.`,null===(o=n.astNode)||void 0===o?void 0:o.type),(0,s.dK)(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${t.name}.${l.name}(${i}:) cannot be deprecated.`,[x(n.astNode),null===(a=n.astNode)||void 0===a?void 0:a.type])}}}function v(e,t){const n=Object.create(null);for(const i of t.getInterfaces())(0,s.oT)(i)?t!==i?n[i.name]?e.reportError(`Type ${t.name} can only implement ${i.name} once.`,C(t,i)):(n[i.name]=!0,b(e,t,i),y(e,t,i)):e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,C(t,i)):e.reportError(`Type ${(0,r.X)(t)} must only implement Interface types, it cannot implement ${(0,r.X)(i)}.`,C(t,i))}function y(e,t,n){const i=t.getFields();for(const d of Object.values(n.getFields())){const f=d.name,p=i[f];if(p){var o,l;(0,a.uJ)(e.schema,p.type,d.type)||e.reportError(`Interface field ${n.name}.${f} expects type ${(0,r.X)(d.type)} but ${t.name}.${f} is type ${(0,r.X)(p.type)}.`,[null===(o=d.astNode)||void 0===o?void 0:o.type,null===(l=p.astNode)||void 0===l?void 0:l.type]);for(const i of d.args){const o=i.name,s=p.args.find((e=>e.name===o));var u,c;s?(0,a._7)(i.type,s.type)||e.reportError(`Interface field argument ${n.name}.${f}(${o}:) expects type ${(0,r.X)(i.type)} but ${t.name}.${f}(${o}:) is type ${(0,r.X)(s.type)}.`,[null===(u=i.astNode)||void 0===u?void 0:u.type,null===(c=s.astNode)||void 0===c?void 0:c.type]):e.reportError(`Interface field argument ${n.name}.${f}(${o}:) expected but ${t.name}.${f} does not provide it.`,[i.astNode,p.astNode])}for(const r of p.args){const i=r.name;!d.args.find((e=>e.name===i))&&(0,s.dK)(r)&&e.reportError(`Object field ${t.name}.${f} includes required argument ${i} that is missing from the Interface field ${n.name}.${f}.`,[r.astNode,d.astNode])}}else e.reportError(`Interface field ${n.name}.${f} expected but ${t.name} does not provide it.`,[d.astNode,t.astNode,...t.extensionASTNodes])}}function b(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...C(n,i),...C(t,n)])}function E(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const i=Object.create(null);for(const o of n)i[o.name]?e.reportError(`Union type ${t.name} can only include type ${o.name} once.`,S(t,o.name)):(i[o.name]=!0,(0,s.lp)(o)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,r.X)(o)}.`,S(t,String(o))))}function T(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)m(e,t)}function w(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const a of n){var i,o;m(e,a),(0,s.j$)(a.type)||e.reportError(`The type of ${t.name}.${a.name} must be Input Type but got: ${(0,r.X)(a.type)}.`,null===(i=a.astNode)||void 0===i?void 0:i.type),(0,s.Wd)(a)&&null!=a.deprecationReason&&e.reportError(`Required input field ${t.name}.${a.name} cannot be deprecated.`,[x(a.astNode),null===(o=a.astNode)||void 0===o?void 0:o.type])}}function C(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>{var t;return null!==(t=e.interfaces)&&void 0!==t?t:[]})).filter((e=>e.name.value===t.name))}function S(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>{var t;return null!==(t=e.types)&&void 0!==t?t:[]})).filter((e=>e.name.value===t))}function x(e){var t;return null==e||null===(t=e.directives)||void 0===t?void 0:t.find((e=>e.name.value===l.fg.name))}},1409:function(e,t,n){"use strict";n.d(t,{a:function(){return u},y:function(){return d}});var r=n(3526),i=n(3830),o=n(9685),a=n(755),s=n(8078),l=n(5998);class u{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=n?n:c,t&&((0,a.j$)(t)&&this._inputTypeStack.push(t),(0,a.Gv)(t)&&this._parentTypeStack.push(t),(0,a.SZ)(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case i.h.SELECTION_SET:{const e=(0,a.xC)(this.getType());this._parentTypeStack.push((0,a.Gv)(e)?e:void 0);break}case i.h.FIELD:{const n=this.getParentType();let r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push((0,a.SZ)(i)?i:void 0);break}case i.h.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case i.h.OPERATION_DEFINITION:{const n=t.getRootType(e.operation);this._typeStack.push((0,a.lp)(n)?n:void 0);break}case i.h.INLINE_FRAGMENT:case i.h.FRAGMENT_DEFINITION:{const n=e.typeCondition,r=n?(0,l._)(t,n):(0,a.xC)(this.getType());this._typeStack.push((0,a.SZ)(r)?r:void 0);break}case i.h.VARIABLE_DEFINITION:{const n=(0,l._)(t,e.type);this._inputTypeStack.push((0,a.j$)(n)?n:void 0);break}case i.h.ARGUMENT:{var n;let t,r;const i=null!==(n=this.getDirective())&&void 0!==n?n:this.getFieldDef();i&&(t=i.args.find((t=>t.name===e.name.value)),t&&(r=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push((0,a.j$)(r)?r:void 0);break}case i.h.LIST:{const e=(0,a.tf)(this.getInputType()),t=(0,a.HG)(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,a.j$)(t)?t:void 0);break}case i.h.OBJECT_FIELD:{const t=(0,a.xC)(this.getInputType());let n,r;(0,a.hL)(t)&&(r=t.getFields()[e.name.value],r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push((0,a.j$)(n)?n:void 0);break}case i.h.ENUM:{const t=(0,a.xC)(this.getInputType());let n;(0,a.EM)(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case i.h.SELECTION_SET:this._parentTypeStack.pop();break;case i.h.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case i.h.DIRECTIVE:this._directive=null;break;case i.h.OPERATION_DEFINITION:case i.h.INLINE_FRAGMENT:case i.h.FRAGMENT_DEFINITION:this._typeStack.pop();break;case i.h.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case i.h.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case i.h.LIST:case i.h.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case i.h.ENUM:this._enumValue=null}}}function c(e,t,n){const r=n.name.value;return r===s.Az.name&&e.getQueryType()===t?s.Az:r===s.tF.name&&e.getQueryType()===t?s.tF:r===s.hU.name&&(0,a.Gv)(t)?s.hU:(0,a.lp)(t)||(0,a.oT)(t)?t.getFields()[r]:void 0}function d(e,t){return{enter(...n){const i=n[0];e.enter(i);const a=(0,o.Eu)(t,i.kind).enter;if(a){const o=a.apply(t,n);return void 0!==o&&(e.leave(i),(0,r.UG)(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=(0,o.Eu)(t,r.kind).leave;let a;return i&&(a=i.apply(t,n)),e.leave(r),a}}}},3190:function(e,t,n){"use strict";n.d(t,{J:function(){return c}});var r=n(5648),i=n(5052),o=n(2910),a=n(1315),s=n(3830),l=n(755),u=n(1774);function c(e,t){if((0,l.zM)(t)){const n=c(e,t.ofType);return(null==n?void 0:n.kind)===s.h.NULL?null:n}if(null===e)return{kind:s.h.NULL};if(void 0===e)return null;if((0,l.HG)(t)){const n=t.ofType;if((0,o.i)(e)){const t=[];for(const r of e){const e=c(r,n);null!=e&&t.push(e)}return{kind:s.h.LIST,values:t}}return c(e,n)}if((0,l.hL)(t)){if(!(0,a.y)(e))return null;const n=[];for(const r of Object.values(t.getFields())){const t=c(e[r.name],r.type);t&&n.push({kind:s.h.OBJECT_FIELD,name:{kind:s.h.NAME,value:r.name},value:t})}return{kind:s.h.OBJECT,fields:n}}if((0,l.UT)(t)){const n=t.serialize(e);if(null==n)return null;if("boolean"==typeof n)return{kind:s.h.BOOLEAN,value:n};if("number"==typeof n&&Number.isFinite(n)){const e=String(n);return d.test(e)?{kind:s.h.INT,value:e}:{kind:s.h.FLOAT,value:e}}if("string"==typeof n)return(0,l.EM)(t)?{kind:s.h.ENUM,value:n}:t===u.km&&d.test(n)?{kind:s.h.INT,value:n}:{kind:s.h.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${(0,r.X)(n)}.`)}(0,i.k)(!1,"Unexpected input type: "+(0,r.X)(t))}const d=/^-?(?:0|[1-9][0-9]*)$/},5925:function(e,t,n){"use strict";n.d(t,{K:function(){return p}});var r=n(8063),i=n(5648),o=n(5052),a=n(2910),s=n(1315),l=n(9878),u=n(4987),c=n(3492),d=n(4117),f=n(755);function p(e,t,n=h){return m(e,t,n,void 0)}function h(e,t,n){let r="Invalid value "+(0,i.X)(t);throw e.length>0&&(r+=` at "value${(0,u.F)(e)}"`),n.message=r+": "+n.message,n}function m(e,t,n,u){if((0,f.zM)(t))return null!=e?m(e,t.ofType,n,u):void n((0,l.N)(u),e,new d.__(`Expected non-nullable type "${(0,i.X)(t)}" not to be null.`));if(null==e)return null;if((0,f.HG)(t)){const r=t.ofType;return(0,a.i)(e)?Array.from(e,((e,t)=>{const i=(0,l.Q)(u,t,void 0);return m(e,r,n,i)})):[m(e,r,n,u)]}if((0,f.hL)(t)){if(!(0,s.y)(e))return void n((0,l.N)(u),e,new d.__(`Expected type "${t.name}" to be an object.`));const o={},a=t.getFields();for(const r of Object.values(a)){const a=e[r.name];if(void 0!==a)o[r.name]=m(a,r.type,n,(0,l.Q)(u,r.name,t.name));else if(void 0!==r.defaultValue)o[r.name]=r.defaultValue;else if((0,f.zM)(r.type)){const t=(0,i.X)(r.type);n((0,l.N)(u),e,new d.__(`Field "${r.name}" of required type "${t}" was not provided.`))}}for(const i of Object.keys(e))if(!a[i]){const o=(0,c.D)(i,Object.keys(t.getFields()));n((0,l.N)(u),e,new d.__(`Field "${i}" is not defined by type "${t.name}".`+(0,r.l)(o)))}return o}if((0,f.UT)(t)){let r;try{r=t.parseValue(e)}catch(r){return void(r instanceof d.__?n((0,l.N)(u),e,r):n((0,l.N)(u),e,new d.__(`Expected type "${t.name}". `+r.message,{originalError:r})))}return void 0===r&&n((0,l.N)(u),e,new d.__(`Expected type "${t.name}".`)),r}(0,o.k)(!1,"Unexpected input type: "+(0,i.X)(t))}},9458:function(e,t,n){"use strict";n.d(t,{S:function(){return i}});var r=n(3830);function i(e,t){let n=null;for(const o of e.definitions){var i;if(o.kind===r.h.OPERATION_DEFINITION)if(null==t){if(n)return null;n=o}else if((null===(i=o.name)||void 0===i?void 0:i.value)===t)return o}return n}},4034:function(e,t,n){"use strict";n.d(t,{n:function(){return o}});var r=n(6625),i=n(3830);function o(e){switch(e.kind){case i.h.OBJECT:return{...e,fields:(t=e.fields,t.map((e=>({...e,value:o(e.value)}))).sort(((e,t)=>(0,r.K)(e.name.value,t.name.value))))};case i.h.LIST:return{...e,values:e.values.map(o)};case i.h.INT:case i.h.FLOAT:case i.h.STRING:case i.h.BOOLEAN:case i.h.NULL:case i.h.ENUM:case i.h.VARIABLE:return e}var t}},2984:function(e,t,n){"use strict";n.d(t,{_7:function(){return i},uJ:function(){return o},zR:function(){return a}});var r=n(755);function i(e,t){return e===t||((0,r.zM)(e)&&(0,r.zM)(t)||!(!(0,r.HG)(e)||!(0,r.HG)(t)))&&i(e.ofType,t.ofType)}function o(e,t,n){return t===n||((0,r.zM)(n)?!!(0,r.zM)(t)&&o(e,t.ofType,n.ofType):(0,r.zM)(t)?o(e,t.ofType,n):(0,r.HG)(n)?!!(0,r.HG)(t)&&o(e,t.ofType,n.ofType):!(0,r.HG)(t)&&(0,r.m0)(n)&&((0,r.oT)(t)||(0,r.lp)(t))&&e.isSubType(n,t))}function a(e,t,n){return t===n||((0,r.m0)(t)?(0,r.m0)(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!(0,r.m0)(n)&&e.isSubType(n,t))}},5998:function(e,t,n){"use strict";n.d(t,{_:function(){return o}});var r=n(3830),i=n(755);function o(e,t){switch(t.kind){case r.h.LIST_TYPE:{const n=o(e,t.type);return n&&new i.p2(n)}case r.h.NON_NULL_TYPE:{const n=o(e,t.type);return n&&new i.bM(n)}case r.h.NAMED_TYPE:return e.getType(t.name.value)}}},5284:function(e,t,n){"use strict";n.d(t,{u:function(){return l}});var r=n(5648),i=n(5052),o=n(9815),a=n(3830),s=n(755);function l(e,t,n){if(e){if(e.kind===a.h.VARIABLE){const r=e.name.value;if(null==n||void 0===n[r])return;const i=n[r];if(null===i&&(0,s.zM)(t))return;return i}if((0,s.zM)(t)){if(e.kind===a.h.NULL)return;return l(e,t.ofType,n)}if(e.kind===a.h.NULL)return null;if((0,s.HG)(t)){const r=t.ofType;if(e.kind===a.h.LIST){const t=[];for(const i of e.values)if(u(i,n)){if((0,s.zM)(r))return;t.push(null)}else{const e=l(i,r,n);if(void 0===e)return;t.push(e)}return t}const i=l(e,r,n);if(void 0===i)return;return[i]}if((0,s.hL)(t)){if(e.kind!==a.h.OBJECT)return;const r=Object.create(null),i=(0,o.P)(e.fields,(e=>e.name.value));for(const e of Object.values(t.getFields())){const t=i[e.name];if(!t||u(t.value,n)){if(void 0!==e.defaultValue)r[e.name]=e.defaultValue;else if((0,s.zM)(e.type))return;continue}const o=l(t.value,e.type,n);if(void 0===o)return;r[e.name]=o}return r}if((0,s.UT)(t)){let r;try{r=t.parseLiteral(e,n)}catch(e){return}if(void 0===r)return;return r}(0,i.k)(!1,"Unexpected input type: "+(0,r.X)(t))}}function u(e,t){return e.kind===a.h.VARIABLE&&(null==t||void 0===t[e.name.value])}},9426:function(e,t,n){"use strict";n.d(t,{M:function(){return o}});var r=n(8240),i=n(3830);function o(e,t){switch(e.kind){case i.h.NULL:return null;case i.h.INT:return parseInt(e.value,10);case i.h.FLOAT:return parseFloat(e.value);case i.h.STRING:case i.h.ENUM:case i.h.BOOLEAN:return e.value;case i.h.LIST:return e.values.map((e=>o(e,t)));case i.h.OBJECT:return(0,r.w)(e.fields,(e=>e.name.value),(e=>o(e.value,t)));case i.h.VARIABLE:return null==t?void 0:t[e.name.value]}}},2716:function(e,t,n){"use strict";n.d(t,{_t:function(){return l},yv:function(){return s}});var r=n(3830),i=n(9685),o=n(1409);class a{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===r.h.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let i;for(;i=n.pop();)for(const e of i.selections)e.kind===r.h.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=Object.create(null),r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!0!==n[i]){n[i]=!0;const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class s extends a{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class l extends a{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new o.a(this._schema);(0,i.Vn)(e,(0,o.y)(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}},3857:function(e,t,n){"use strict";n.d(t,{i:function(){return a}});var r=n(4117),i=n(3830),o=n(9615);function a(e){return{Document(t){for(const n of t.definitions)if(!(0,o.Wk)(n)){const t=n.kind===i.h.SCHEMA_DEFINITION||n.kind===i.h.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new r.__(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}}},1870:function(e,t,n){"use strict";n.d(t,{A:function(){return l}});var r=n(8063),i=n(6625),o=n(3492),a=n(4117),s=n(755);function l(e){return{Field(t){const n=e.getParentType();if(n&&!e.getFieldDef()){const l=e.getSchema(),u=t.name.value;let c=(0,r.l)("to use an inline fragment on",function(e,t,n){if(!(0,s.m0)(t))return[];const r=new Set,o=Object.create(null);for(const i of e.getPossibleTypes(t))if(i.getFields()[n]){r.add(i),o[i.name]=1;for(const e of i.getInterfaces()){var a;e.getFields()[n]&&(r.add(e),o[e.name]=(null!==(a=o[e.name])&&void 0!==a?a:0)+1)}}return[...r].sort(((t,n)=>{const r=o[n.name]-o[t.name];return 0!==r?r:(0,s.oT)(t)&&e.isSubType(t,n)?-1:(0,s.oT)(n)&&e.isSubType(n,t)?1:(0,i.K)(t.name,n.name)})).map((e=>e.name))}(l,n,u));""===c&&(c=(0,r.l)(function(e,t){if((0,s.lp)(e)||(0,s.oT)(e)){const n=Object.keys(e.getFields());return(0,o.D)(t,n)}return[]}(n,u))),e.reportError(new a.__(`Cannot query field "${u}" on type "${n.name}".`+c,{nodes:t}))}}}}},5167:function(e,t,n){"use strict";n.d(t,{T:function(){return s}});var r=n(4117),i=n(5895),o=n(755),a=n(5998);function s(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=(0,a._)(e.getSchema(),n);if(t&&!(0,o.Gv)(t)){const t=(0,i.S)(n);e.reportError(new r.__(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=(0,a._)(e.getSchema(),t.typeCondition);if(n&&!(0,o.Gv)(n)){const n=(0,i.S)(t.typeCondition);e.reportError(new r.__(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}}},4875:function(e,t,n){"use strict";n.d(t,{e:function(){return l},o:function(){return u}});var r=n(8063),i=n(3492),o=n(4117),a=n(3830),s=n(5946);function l(e){return{...u(e),Argument(t){const n=e.getArgument(),a=e.getFieldDef(),s=e.getParentType();if(!n&&a&&s){const n=t.name.value,l=a.args.map((e=>e.name)),u=(0,i.D)(n,l);e.reportError(new o.__(`Unknown argument "${n}" on field "${s.name}.${a.name}".`+(0,r.l)(u),{nodes:t}))}}}}function u(e){const t=Object.create(null),n=e.getSchema(),l=n?n.getDirectives():s.V4;for(const e of l)t[e.name]=e.args.map((e=>e.name));const u=e.getDocument().definitions;for(const e of u)if(e.kind===a.h.DIRECTIVE_DEFINITION){var c;const n=null!==(c=e.arguments)&&void 0!==c?c:[];t[e.name.value]=n.map((e=>e.name.value))}return{Directive(n){const a=n.name.value,s=t[a];if(n.arguments&&s)for(const t of n.arguments){const n=t.name.value;if(!s.includes(n)){const l=(0,i.D)(n,s);e.reportError(new o.__(`Unknown argument "${n}" on directive "@${a}".`+(0,r.l)(l),{nodes:t}))}}return!1}}}},7513:function(e,t,n){"use strict";n.d(t,{J:function(){return c}});var r=n(5648),i=n(5052),o=n(4117),a=n(3526),s=n(3140),l=n(3830),u=n(5946);function c(e){const t=Object.create(null),n=e.getSchema(),c=n?n.getDirectives():u.V4;for(const e of c)t[e.name]=e.locations;const d=e.getDocument().definitions;for(const e of d)e.kind===l.h.DIRECTIVE_DEFINITION&&(t[e.name.value]=e.locations.map((e=>e.value)));return{Directive(n,u,c,d,f){const p=n.name.value,h=t[p];if(!h)return void e.reportError(new o.__(`Unknown directive "@${p}".`,{nodes:n}));const m=function(e){const t=e[e.length-1];switch("kind"in t||(0,i.k)(!1),t.kind){case l.h.OPERATION_DEFINITION:return function(e){switch(e){case a.ku.QUERY:return s.B.QUERY;case a.ku.MUTATION:return s.B.MUTATION;case a.ku.SUBSCRIPTION:return s.B.SUBSCRIPTION}}(t.operation);case l.h.FIELD:return s.B.FIELD;case l.h.FRAGMENT_SPREAD:return s.B.FRAGMENT_SPREAD;case l.h.INLINE_FRAGMENT:return s.B.INLINE_FRAGMENT;case l.h.FRAGMENT_DEFINITION:return s.B.FRAGMENT_DEFINITION;case l.h.VARIABLE_DEFINITION:return s.B.VARIABLE_DEFINITION;case l.h.SCHEMA_DEFINITION:case l.h.SCHEMA_EXTENSION:return s.B.SCHEMA;case l.h.SCALAR_TYPE_DEFINITION:case l.h.SCALAR_TYPE_EXTENSION:return s.B.SCALAR;case l.h.OBJECT_TYPE_DEFINITION:case l.h.OBJECT_TYPE_EXTENSION:return s.B.OBJECT;case l.h.FIELD_DEFINITION:return s.B.FIELD_DEFINITION;case l.h.INTERFACE_TYPE_DEFINITION:case l.h.INTERFACE_TYPE_EXTENSION:return s.B.INTERFACE;case l.h.UNION_TYPE_DEFINITION:case l.h.UNION_TYPE_EXTENSION:return s.B.UNION;case l.h.ENUM_TYPE_DEFINITION:case l.h.ENUM_TYPE_EXTENSION:return s.B.ENUM;case l.h.ENUM_VALUE_DEFINITION:return s.B.ENUM_VALUE;case l.h.INPUT_OBJECT_TYPE_DEFINITION:case l.h.INPUT_OBJECT_TYPE_EXTENSION:return s.B.INPUT_OBJECT;case l.h.INPUT_VALUE_DEFINITION:{const t=e[e.length-3];return"kind"in t||(0,i.k)(!1),t.kind===l.h.INPUT_OBJECT_TYPE_DEFINITION?s.B.INPUT_FIELD_DEFINITION:s.B.ARGUMENT_DEFINITION}default:(0,i.k)(!1,"Unexpected kind: "+(0,r.X)(t.kind))}}(f);m&&!h.includes(m)&&e.reportError(new o.__(`Directive "@${p}" may not be used on ${m}.`,{nodes:n}))}}}},1435:function(e,t,n){"use strict";n.d(t,{a:function(){return i}});var r=n(4117);function i(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new r.__(`Unknown fragment "${n}".`,{nodes:t.name}))}}}},591:function(e,t,n){"use strict";n.d(t,{I:function(){return l}});var r=n(8063),i=n(3492),o=n(4117),a=n(9615),s=n(8078);function l(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),s=Object.create(null);for(const t of e.getDocument().definitions)(0,a.zT)(t)&&(s[t.name.value]=!0);const l=[...Object.keys(n),...Object.keys(s)];return{NamedType(t,c,d,f,p){const h=t.name.value;if(!n[h]&&!s[h]){var m;const n=null!==(m=p[2])&&void 0!==m?m:d,s=null!=n&&"kind"in(g=n)&&((0,a.G4)(g)||(0,a.aU)(g));if(s&&u.includes(h))return;const c=(0,i.D)(h,s?u.concat(l):l);e.reportError(new o.__(`Unknown type "${h}".`+(0,r.l)(c),{nodes:t}))}var g}}}const u=[...n(1774).HS,...s.nL].map((e=>e.name))},831:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var r=n(4117),i=n(3830);function o(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===i.h.OPERATION_DEFINITION)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new r.__("This anonymous operation must be the only defined operation.",{nodes:n}))}}}},3402:function(e,t,n){"use strict";n.d(t,{t:function(){return i}});var r=n(4117);function i(e){var t,n,i;const o=e.getSchema(),a=null!==(t=null!==(n=null!==(i=null==o?void 0:o.astNode)&&void 0!==i?i:null==o?void 0:o.getQueryType())&&void 0!==n?n:null==o?void 0:o.getMutationType())&&void 0!==t?t:null==o?void 0:o.getSubscriptionType();let s=0;return{SchemaDefinition(t){a?e.reportError(new r.__("Cannot define a new schema within a schema extension.",{nodes:t})):(s>0&&e.reportError(new r.__("Must provide only one schema definition.",{nodes:t})),++s)}}}},9316:function(e,t,n){"use strict";n.d(t,{H:function(){return i}});var r=n(4117);function i(e){const t=Object.create(null),n=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(e){return o(e),!1}};function o(a){if(t[a.name.value])return;const s=a.name.value;t[s]=!0;const l=e.getFragmentSpreads(a.selectionSet);if(0!==l.length){i[s]=n.length;for(const t of l){const a=t.name.value,s=i[a];if(n.push(t),void 0===s){const t=e.getFragment(a);t&&o(t)}else{const t=n.slice(s),i=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new r.__(`Cannot spread fragment "${a}" within itself`+(""!==i?` via ${i}.`:"."),{nodes:t}))}n.pop()}i[s]=void 0}}}},9518:function(e,t,n){"use strict";n.d(t,{$:function(){return i}});var r=n(4117);function i(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const i=e.getRecursiveVariableUsages(n);for(const{node:o}of i){const i=o.name.value;!0!==t[i]&&e.reportError(new r.__(n.name?`Variable "$${i}" is not defined by operation "${n.name.value}".`:`Variable "$${i}" is not defined.`,{nodes:[o,n]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}}},3447:function(e,t,n){"use strict";n.d(t,{J:function(){return i}});var r=n(4117);function i(e){const t=[],n=[];return{OperationDefinition(e){return t.push(e),!1},FragmentDefinition(e){return n.push(e),!1},Document:{leave(){const i=Object.create(null);for(const n of t)for(const t of e.getRecursivelyReferencedFragments(n))i[t.name.value]=!0;for(const t of n){const n=t.name.value;!0!==i[n]&&e.reportError(new r.__(`Fragment "${n}" is never used.`,{nodes:t}))}}}}}},7114:function(e,t,n){"use strict";n.d(t,{p:function(){return i}});var r=n(4117);function i(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){const i=Object.create(null),o=e.getRecursiveVariableUsages(n);for(const{node:e}of o)i[e.name.value]=!0;for(const o of t){const t=o.variable.name.value;!0!==i[t]&&e.reportError(new r.__(n.name?`Variable "$${t}" is never used in operation "${n.name.value}".`:`Variable "$${t}" is never used.`,{nodes:o}))}}},VariableDefinition(e){t.push(e)}}}},7163:function(e,t,n){"use strict";n.d(t,{y:function(){return d}});var r=n(5648),i=n(4117),o=n(3830),a=n(5895),s=n(755),l=n(4034),u=n(5998);function c(e){return Array.isArray(e)?e.map((([e,t])=>`subfields "${e}" conflict because `+c(t))).join(" and "):e}function d(e){const t=new T,n=new Map;return{SelectionSet(r){const o=function(e,t,n,r,i){const o=[],[a,s]=y(e,t,r,i);if(function(e,t,n,r,i){for(const[o,a]of Object.entries(i))if(a.length>1)for(let i=0;i0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(r,o,c,b)}}function g(e){var t;const n=null!==(t=e.arguments)&&void 0!==t?t:[],r={kind:o.h.OBJECT,fields:n.map((e=>({kind:o.h.OBJECT_FIELD,name:e.name,value:e.value})))};return(0,a.S)((0,l.n)(r))}function v(e,t){return(0,s.HG)(e)?!(0,s.HG)(t)||v(e.ofType,t.ofType):!!(0,s.HG)(t)||((0,s.zM)(e)?!(0,s.zM)(t)||v(e.ofType,t.ofType):!!(0,s.zM)(t)||!(!(0,s.UT)(e)&&!(0,s.UT)(t))&&e!==t)}function y(e,t,n,r){const i=t.get(r);if(i)return i;const o=Object.create(null),a=Object.create(null);E(e,n,r,o,a);const s=[o,Object.keys(a)];return t.set(r,s),s}function b(e,t,n){const r=t.get(n.selectionSet);if(r)return r;const i=(0,u._)(e.getSchema(),n.typeCondition);return y(e,t,i,n.selectionSet)}function E(e,t,n,r,i){for(const a of n.selections)switch(a.kind){case o.h.FIELD:{const e=a.name.value;let n;((0,s.lp)(t)||(0,s.oT)(t))&&(n=t.getFields()[e]);const i=a.alias?a.alias.value:e;r[i]||(r[i]=[]),r[i].push([t,a,n]);break}case o.h.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case o.h.INLINE_FRAGMENT:{const n=a.typeCondition,o=n?(0,u._)(e.getSchema(),n):t;E(e,o,a.selectionSet,r,i);break}}}class T{constructor(){this._data=new Map}has(e,t,n){var r;const[i,o]=ee.name.value)));for(const n of i.args)if(!a.has(n.name)&&(0,l.dK)(n)){const a=(0,r.X)(n.type);e.reportError(new o.__(`Field "${i.name}" argument "${n.name}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}function d(e){var t;const n=Object.create(null),c=e.getSchema(),d=null!==(t=null==c?void 0:c.getDirectives())&&void 0!==t?t:u.V4;for(const e of d)n[e.name]=(0,i.P)(e.args.filter(l.dK),(e=>e.name));const p=e.getDocument().definitions;for(const e of p)if(e.kind===a.h.DIRECTIVE_DEFINITION){var h;const t=null!==(h=e.arguments)&&void 0!==h?h:[];n[e.name.value]=(0,i.P)(t.filter(f),(e=>e.name.value))}return{Directive:{leave(t){const i=t.name.value,a=n[i];if(a){var u;const n=null!==(u=t.arguments)&&void 0!==u?u:[],c=new Set(n.map((e=>e.name.value)));for(const[n,u]of Object.entries(a))if(!c.has(n)){const a=(0,l.P9)(u.type)?(0,r.X)(u.type):(0,s.S)(u.type);e.reportError(new o.__(`Directive "@${i}" argument "${n}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}}function f(e){return e.type.kind===a.h.NON_NULL_TYPE&&null==e.defaultValue}},3989:function(e,t,n){"use strict";n.d(t,{O:function(){return a}});var r=n(5648),i=n(4117),o=n(755);function a(e){return{Field(t){const n=e.getType(),a=t.selectionSet;if(n)if((0,o.UT)((0,o.xC)(n))){if(a){const o=t.name.value,s=(0,r.X)(n);e.reportError(new i.__(`Field "${o}" must not have a selection since type "${s}" has no subfields.`,{nodes:a}))}}else if(!a){const o=t.name.value,a=(0,r.X)(n);e.reportError(new i.__(`Field "${o}" of type "${a}" must have a selection of subfields. Did you mean "${o} { ... }"?`,{nodes:t}))}}}}},9309:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(4117),i=n(3830),o=n(5267);function a(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),a=n.getSubscriptionType();if(a){const s=t.name?t.name.value:null,l=Object.create(null),u=e.getDocument(),c=Object.create(null);for(const e of u.definitions)e.kind===i.h.FRAGMENT_DEFINITION&&(c[e.name.value]=e);const d=(0,o.g)(n,c,l,a,t.selectionSet);if(d.size>1){const t=[...d.values()].slice(1).flat();e.reportError(new r.__(null!=s?`Subscription "${s}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of d.values())t[0].name.value.startsWith("__")&&e.reportError(new r.__(null!=s?`Subscription "${s}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}}},5947:function(e,t,n){"use strict";n.d(t,{L:function(){return o}});var r=n(5839),i=n(4117);function o(e){return{DirectiveDefinition(e){var t;const r=null!==(t=e.arguments)&&void 0!==t?t:[];return n(`@${e.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t;const r=e.name.value,i=null!==(t=e.fields)&&void 0!==t?t:[];for(const e of i){var o;n(`${r}.${e.name.value}`,null!==(o=e.arguments)&&void 0!==o?o:[])}return!1}function n(t,n){const o=(0,r.v)(n,(e=>e.name.value));for(const[n,r]of o)r.length>1&&e.reportError(new i.__(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:r.map((e=>e.name))}));return!1}}},9168:function(e,t,n){"use strict";n.d(t,{L:function(){return o}});var r=n(5839),i=n(4117);function o(e){return{Field:t,Directive:t};function t(t){var n;const o=null!==(n=t.arguments)&&void 0!==n?n:[],a=(0,r.v)(o,(e=>e.name.value));for(const[t,n]of a)n.length>1&&e.reportError(new i.__(`There can be only one argument named "${t}".`,{nodes:n.map((e=>e.name))}))}}},5681:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var r=n(4117);function i(e){const t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(i){const o=i.name.value;if(null==n||!n.getDirective(o))return t[o]?e.reportError(new r.__(`There can be only one directive named "@${o}".`,{nodes:[t[o],i.name]})):t[o]=i.name,!1;e.reportError(new r.__(`Directive "@${o}" already exists in the schema. It cannot be redefined.`,{nodes:i.name}))}}}},5673:function(e,t,n){"use strict";n.d(t,{k:function(){return s}});var r=n(4117),i=n(3830),o=n(9615),a=n(5946);function s(e){const t=Object.create(null),n=e.getSchema(),s=n?n.getDirectives():a.V4;for(const e of s)t[e.name]=!e.isRepeatable;const l=e.getDocument().definitions;for(const e of l)e.kind===i.h.DIRECTIVE_DEFINITION&&(t[e.name.value]=!e.repeatable);const u=Object.create(null),c=Object.create(null);return{enter(n){if(!("directives"in n)||!n.directives)return;let a;if(n.kind===i.h.SCHEMA_DEFINITION||n.kind===i.h.SCHEMA_EXTENSION)a=u;else if((0,o.zT)(n)||(0,o.D$)(n)){const e=n.name.value;a=c[e],void 0===a&&(c[e]=a=Object.create(null))}else a=Object.create(null);for(const i of n.directives){const n=i.name.value;t[n]&&(a[n]?e.reportError(new r.__(`The directive "@${n}" can only be used once at this location.`,{nodes:[a[n],i]})):a[n]=i)}}}}},4560:function(e,t,n){"use strict";n.d(t,{L:function(){return o}});var r=n(4117),i=n(755);function o(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),o=Object.create(null);return{EnumTypeDefinition:a,EnumTypeExtension:a};function a(t){var a;const s=t.name.value;o[s]||(o[s]=Object.create(null));const l=null!==(a=t.values)&&void 0!==a?a:[],u=o[s];for(const t of l){const o=t.name.value,a=n[s];(0,i.EM)(a)&&a.getValue(o)?e.reportError(new r.__(`Enum value "${s}.${o}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):u[o]?e.reportError(new r.__(`Enum value "${s}.${o}" can only be defined once.`,{nodes:[u[o],t.name]})):u[o]=t.name}return!1}}},5240:function(e,t,n){"use strict";n.d(t,{y:function(){return o}});var r=n(4117),i=n(755);function o(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=Object.create(null);return{InputObjectTypeDefinition:o,InputObjectTypeExtension:o,InterfaceTypeDefinition:o,InterfaceTypeExtension:o,ObjectTypeDefinition:o,ObjectTypeExtension:o};function o(t){var o;const s=t.name.value;i[s]||(i[s]=Object.create(null));const l=null!==(o=t.fields)&&void 0!==o?o:[],u=i[s];for(const t of l){const i=t.name.value;a(n[s],i)?e.reportError(new r.__(`Field "${s}.${i}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):u[i]?e.reportError(new r.__(`Field "${s}.${i}" can only be defined once.`,{nodes:[u[i],t.name]})):u[i]=t.name}return!1}}function a(e,t){return!!((0,i.lp)(e)||(0,i.oT)(e)||(0,i.hL)(e))&&null!=e.getFields()[t]}},614:function(e,t,n){"use strict";n.d(t,{N:function(){return i}});var r=n(4117);function i(e){const t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const i=n.name.value;return t[i]?e.reportError(new r.__(`There can be only one fragment named "${i}".`,{nodes:[t[i],n.name]})):t[i]=n.name,!1}}}},5707:function(e,t,n){"use strict";n.d(t,{P:function(){return o}});var r=n(5052),i=n(4117);function o(e){const t=[];let n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){const e=t.pop();e||(0,r.k)(!1),n=e}},ObjectField(t){const r=t.name.value;n[r]?e.reportError(new i.__(`There can be only one input field named "${r}".`,{nodes:[n[r],t.name]})):n[r]=t.name}}}},2355:function(e,t,n){"use strict";n.d(t,{H:function(){return i}});var r=n(4117);function i(e){const t=Object.create(null);return{OperationDefinition(n){const i=n.name;return i&&(t[i.value]?e.reportError(new r.__(`There can be only one operation named "${i.value}".`,{nodes:[t[i.value],i]})):t[i.value]=i),!1},FragmentDefinition:()=>!1}}},5427:function(e,t,n){"use strict";n.d(t,{q:function(){return i}});var r=n(4117);function i(e){const t=e.getSchema(),n=Object.create(null),i=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:o,SchemaExtension:o};function o(t){var o;const a=null!==(o=t.operationTypes)&&void 0!==o?o:[];for(const t of a){const o=t.operation,a=n[o];i[o]?e.reportError(new r.__(`Type for ${o} already defined in the schema. It cannot be redefined.`,{nodes:t})):a?e.reportError(new r.__(`There can be only one ${o} type in schema.`,{nodes:[a,t]})):n[o]=t}return!1}}},4519:function(e,t,n){"use strict";n.d(t,{P:function(){return i}});var r=n(4117);function i(e){const t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(i){const o=i.name.value;if(null==n||!n.getType(o))return t[o]?e.reportError(new r.__(`There can be only one type named "${o}".`,{nodes:[t[o],i.name]})):t[o]=i.name,!1;e.reportError(new r.__(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}))}}},7417:function(e,t,n){"use strict";n.d(t,{H:function(){return o}});var r=n(5839),i=n(4117);function o(e){return{OperationDefinition(t){var n;const o=null!==(n=t.variableDefinitions)&&void 0!==n?n:[],a=(0,r.v)(o,(e=>e.variable.name.value));for(const[t,n]of a)n.length>1&&e.reportError(new i.__(`There can be only one variable named "$${t}".`,{nodes:n.map((e=>e.variable.name))}))}}}},4697:function(e,t,n){"use strict";n.d(t,{j:function(){return c}});var r=n(8063),i=n(5648),o=n(9815),a=n(3492),s=n(4117),l=n(5895),u=n(755);function c(e){return{ListValue(t){const n=(0,u.tf)(e.getParentInputType());if(!(0,u.HG)(n))return d(e,t),!1},ObjectValue(t){const n=(0,u.xC)(e.getInputType());if(!(0,u.hL)(n))return d(e,t),!1;const r=(0,o.P)(t.fields,(e=>e.name.value));for(const o of Object.values(n.getFields()))if(!r[o.name]&&(0,u.Wd)(o)){const r=(0,i.X)(o.type);e.reportError(new s.__(`Field "${n.name}.${o.name}" of required type "${r}" was not provided.`,{nodes:t}))}},ObjectField(t){const n=(0,u.xC)(e.getParentInputType());if(!e.getInputType()&&(0,u.hL)(n)){const i=(0,a.D)(t.name.value,Object.keys(n.getFields()));e.reportError(new s.__(`Field "${t.name.value}" is not defined by type "${n.name}".`+(0,r.l)(i),{nodes:t}))}},NullValue(t){const n=e.getInputType();(0,u.zM)(n)&&e.reportError(new s.__(`Expected value of type "${(0,i.X)(n)}", found ${(0,l.S)(t)}.`,{nodes:t}))},EnumValue:t=>d(e,t),IntValue:t=>d(e,t),FloatValue:t=>d(e,t),StringValue:t=>d(e,t),BooleanValue:t=>d(e,t)}}function d(e,t){const n=e.getInputType();if(!n)return;const r=(0,u.xC)(n);if((0,u.UT)(r))try{if(void 0===r.parseLiteral(t,void 0)){const r=(0,i.X)(n);e.reportError(new s.__(`Expected value of type "${r}", found ${(0,l.S)(t)}.`,{nodes:t}))}}catch(r){const o=(0,i.X)(n);r instanceof s.__?e.reportError(r):e.reportError(new s.__(`Expected value of type "${o}", found ${(0,l.S)(t)}; `+r.message,{nodes:t,originalError:r}))}else{const r=(0,i.X)(n);e.reportError(new s.__(`Expected value of type "${r}", found ${(0,l.S)(t)}.`,{nodes:t}))}}},6192:function(e,t,n){"use strict";n.d(t,{I:function(){return s}});var r=n(4117),i=n(5895),o=n(755),a=n(5998);function s(e){return{VariableDefinition(t){const n=(0,a._)(e.getSchema(),t.type);if(void 0!==n&&!(0,o.j$)(n)){const n=t.variable.name.value,o=(0,i.S)(t.type);e.reportError(new r.__(`Variable "$${n}" cannot be non-input type "${o}".`,{nodes:t.type}))}}}}},377:function(e,t,n){"use strict";n.d(t,{w:function(){return u}});var r=n(5648),i=n(4117),o=n(3830),a=n(755),s=n(2984),l=n(5998);function u(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const o=e.getRecursiveVariableUsages(n);for(const{node:n,type:a,defaultValue:s}of o){const o=n.name.value,u=t[o];if(u&&a){const t=e.getSchema(),d=(0,l._)(t,u.type);if(d&&!c(t,d,u.defaultValue,a,s)){const t=(0,r.X)(d),s=(0,r.X)(a);e.reportError(new i.__(`Variable "$${o}" of type "${t}" used in position expecting type "${s}".`,{nodes:[u,n]}))}}}}},VariableDefinition(e){t[e.variable.name.value]=e}}}function c(e,t,n,r,i){if((0,a.zM)(r)&&!(0,a.zM)(t)){if((null==n||n.kind===o.h.NULL)&&void 0===i)return!1;const a=r.ofType;return(0,s.uJ)(e,t,a)}return(0,s.uJ)(e,t,r)}},9299:function(e,t,n){"use strict";n.d(t,{M:function(){return j},i:function(){return P}});var r=n(3857),i=n(1870),o=n(5167),a=n(4875),s=n(7513),l=n(1435),u=n(591),c=n(831),d=n(3402),f=n(9316),p=n(9518),h=n(3447),m=n(7114),g=n(7163),v=n(5961),y=n(3721),b=n(16),E=n(3989),T=n(9309),w=n(5947),C=n(9168),S=n(5681),x=n(5673),N=n(4560),k=n(5240),_=n(614),O=n(5707),I=n(2355),D=n(5427),L=n(4519),A=n(7417),M=n(4697),R=n(6192),F=n(377);const P=Object.freeze([r.i,I.H,c.F,T.Z,u.I,o.T,R.I,E.O,i.A,_.N,l.a,h.J,v.a,f.H,A.H,p.$,m.p,s.J,x.k,a.e,C.L,M.j,b.s,F.w,g.y,O.P]),j=Object.freeze([d.t,D.q,L.P,N.L,k.y,w.L,S.o,u.I,s.J,x.k,y.g,a.o,C.L,O.P,b.c])},2780:function(e,t,n){"use strict";n.d(t,{ED:function(){return p},Gu:function(){return c},zo:function(){return f}});var r=n(1172),i=n(4117),o=n(9685),a=n(8555),s=n(1409),l=n(9299),u=n(2716);function c(e,t,n=l.i,c,d=new s.a(e)){var f;const p=null!==(f=null==c?void 0:c.maxErrors)&&void 0!==f?f:100;t||(0,r.a)(!1,"Must provide document."),(0,a.J)(e);const h=Object.freeze({}),m=[],g=new u._t(e,t,d,(e=>{if(m.length>=p)throw m.push(new i.__("Too many validation errors, error limit reached. Validation aborted.")),h;m.push(e)})),v=(0,o.j1)(n.map((e=>e(g))));try{(0,o.Vn)(t,(0,s.y)(d,v))}catch(e){if(e!==h)throw e}return m}function d(e,t,n=l.M){const r=[],i=new u.yv(e,t,(e=>{r.push(e)})),a=n.map((e=>e(i)));return(0,o.Vn)(e,(0,o.j1)(a)),r}function f(e){const t=d(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))}function p(e,t){const n=d(e,t);if(0!==n.length)throw new Error(n.map((e=>e.message)).join("\n\n"))}},8488:function(e,t,n){"use strict";n.r(t),n.d(t,{meros:function(){return o}});const r="\r\n\r\n",i=new TextDecoder;async function o(e,t){if(!e.ok||!e.body||e.bodyUsed)return e;const n=e.headers.get("content-type");if(!n||!~n.indexOf("multipart/mixed"))return e;const o=n.indexOf("boundary=");return async function*(e,t,n){const o=e.getReader(),a=!n||!n.multiple;let s="",l=!0,u=[];try{let e;e:for(;!(e=await o.read()).done;){const n=i.decode(e.value),o=n.indexOf(t);let c=s.length;for(s+=n,~o?c+=o:c=s.indexOf(t),u=[];~c;){const e=s.substring(0,c),n=s.substring(c+t.length);if(l)l=!1;else{const t={},i=e.indexOf(r),o=s.slice(0,i).toString().trim().split(/\r\n/);let l;for(;l=o.shift();)l=l.split(": "),t[l.shift().toLowerCase()]=l.join(": ");let c=e.substring(i+r.length,e.lastIndexOf("\r\n")),d=!1;if(l=t["content-type"],l&&~l.indexOf("application/json"))try{c=JSON.parse(c),d=!0}catch(e){}if(l={headers:t,body:c,json:d},a?yield l:u.push(l),"--"===n.substring(0,2))break e}s=n,c=s.indexOf(t)}u.length&&(yield u)}}finally{u.length&&(yield u),o.releaseLock()}}(e.body,`--${~o?n.substring(o+9).trim().replace(/['"]/g,""):"-"}`,t)}},6785:function(e,t,n){"use strict";n.r(t)},5605:function(e,t,n){"use strict";n.r(t)},2162:function(e,t,n){"use strict";n.r(t)},5251:function(e,t,n){"use strict";n.r(t)},9196:function(e){"use strict";e.exports=window.React},1850:function(e){"use strict";e.exports=window.ReactDOM}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e].call(o.exports,o,o.exports,i),o.exports}t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},i.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);i.r(o);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((function(e){a[e]=function(){return n[e]}}));return a.default=function(){return n},i.d(o,a),o},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0;var o=i(6676);window.GraphiQL=o.default}(); -//# sourceMappingURL=graphiql.min.js.map \ No newline at end of file diff --git a/app/assets/javascripts/graphiql/rails/graphiql-3.1.1.js b/app/assets/javascripts/graphiql/rails/graphiql-3.1.1.js new file mode 100644 index 0000000..a90bd0e --- /dev/null +++ b/app/assets/javascripts/graphiql/rails/graphiql-3.1.1.js @@ -0,0 +1,83731 @@ +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js": +/*!**************************************************************************************!*\ + !*** ../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js ***! + \**************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _memoize = _interopRequireDefault(__webpack_require__(/*! @emotion/memoize */ "../../../node_modules/@emotion/memoize/dist/memoize.browser.esm.js")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 + +var index = (0, _memoize.default)(function (prop) { + return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 + /* o */ && prop.charCodeAt(1) === 110 + /* n */ && prop.charCodeAt(2) < 91; +} +/* Z+1 */); +var _default = index; +exports["default"] = _default; + +/***/ }), + +/***/ "../../../node_modules/@emotion/memoize/dist/memoize.browser.esm.js": +/*!**************************************************************************!*\ + !*** ../../../node_modules/@emotion/memoize/dist/memoize.browser.esm.js ***! + \**************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +function memoize(fn) { + var cache = {}; + return function (arg) { + if (cache[arg] === undefined) cache[arg] = fn(arg); + return cache[arg]; + }; +} +var _default = memoize; +exports["default"] = _default; + +/***/ }), + +/***/ "../../../node_modules/@floating-ui/core/dist/floating-ui.core.esm.js": +/*!****************************************************************************!*\ + !*** ../../../node_modules/@floating-ui/core/dist/floating-ui.core.esm.js ***! + \****************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.computePosition = exports.autoPlacement = exports.arrow = void 0; +exports.detectOverflow = detectOverflow; +exports.offset = exports.limitShift = exports.inline = exports.hide = exports.flip = void 0; +exports.rectToClientRect = rectToClientRect; +exports.size = exports.shift = void 0; +function getAlignment(placement) { + return placement.split('-')[1]; +} +function getLengthFromAxis(axis) { + return axis === 'y' ? 'height' : 'width'; +} +function getSide(placement) { + return placement.split('-')[0]; +} +function getMainAxisFromPlacement(placement) { + return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y'; +} +function computeCoordsFromPlacement(_ref, placement, rtl) { + let { + reference, + floating + } = _ref; + const commonX = reference.x + reference.width / 2 - floating.width / 2; + const commonY = reference.y + reference.height / 2 - floating.height / 2; + const mainAxis = getMainAxisFromPlacement(placement); + const length = getLengthFromAxis(mainAxis); + const commonAlign = reference[length] / 2 - floating[length] / 2; + const side = getSide(placement); + const isVertical = mainAxis === 'x'; + let coords; + switch (side) { + case 'top': + coords = { + x: commonX, + y: reference.y - floating.height + }; + break; + case 'bottom': + coords = { + x: commonX, + y: reference.y + reference.height + }; + break; + case 'right': + coords = { + x: reference.x + reference.width, + y: commonY + }; + break; + case 'left': + coords = { + x: reference.x - floating.width, + y: commonY + }; + break; + default: + coords = { + x: reference.x, + y: reference.y + }; + } + switch (getAlignment(placement)) { + case 'start': + coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); + break; + case 'end': + coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1); + break; + } + return coords; +} + +/** + * Computes the `x` and `y` coordinates that will place the floating element + * next to a reference element when it is given a certain positioning strategy. + * + * This export does not have any `platform` interface logic. You will need to + * write one for the platform you are using Floating UI with. + */ +const computePosition = async (reference, floating, config) => { + const { + placement = 'bottom', + strategy = 'absolute', + middleware = [], + platform + } = config; + const validMiddleware = middleware.filter(Boolean); + const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); + let rects = await platform.getElementRects({ + reference, + floating, + strategy + }); + let { + x, + y + } = computeCoordsFromPlacement(rects, placement, rtl); + let statefulPlacement = placement; + let middlewareData = {}; + let resetCount = 0; + for (let i = 0; i < validMiddleware.length; i++) { + const { + name, + fn + } = validMiddleware[i]; + const { + x: nextX, + y: nextY, + data, + reset + } = await fn({ + x, + y, + initialPlacement: placement, + placement: statefulPlacement, + strategy, + middlewareData, + rects, + platform, + elements: { + reference, + floating + } + }); + x = nextX != null ? nextX : x; + y = nextY != null ? nextY : y; + middlewareData = { + ...middlewareData, + [name]: { + ...middlewareData[name], + ...data + } + }; + if (reset && resetCount <= 50) { + resetCount++; + if (typeof reset === 'object') { + if (reset.placement) { + statefulPlacement = reset.placement; + } + if (reset.rects) { + rects = reset.rects === true ? await platform.getElementRects({ + reference, + floating, + strategy + }) : reset.rects; + } + ({ + x, + y + } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); + } + i = -1; + continue; + } + } + return { + x, + y, + placement: statefulPlacement, + strategy, + middlewareData + }; +}; +exports.computePosition = computePosition; +function evaluate(value, param) { + return typeof value === 'function' ? value(param) : value; +} +function expandPaddingObject(padding) { + return { + top: 0, + right: 0, + bottom: 0, + left: 0, + ...padding + }; +} +function getSideObjectFromPadding(padding) { + return typeof padding !== 'number' ? expandPaddingObject(padding) : { + top: padding, + right: padding, + bottom: padding, + left: padding + }; +} +function rectToClientRect(rect) { + return { + ...rect, + top: rect.y, + left: rect.x, + right: rect.x + rect.width, + bottom: rect.y + rect.height + }; +} + +/** + * Resolves with an object of overflow side offsets that determine how much the + * element is overflowing a given clipping boundary on each side. + * - positive = overflowing the boundary by that number of pixels + * - negative = how many pixels left before it will overflow + * - 0 = lies flush with the boundary + * @see https://floating-ui.com/docs/detectOverflow + */ +async function detectOverflow(state, options) { + var _await$platform$isEle; + if (options === void 0) { + options = {}; + } + const { + x, + y, + platform, + rects, + elements, + strategy + } = state; + const { + boundary = 'clippingAncestors', + rootBoundary = 'viewport', + elementContext = 'floating', + altBoundary = false, + padding = 0 + } = evaluate(options, state); + const paddingObject = getSideObjectFromPadding(padding); + const altContext = elementContext === 'floating' ? 'reference' : 'floating'; + const element = elements[altBoundary ? altContext : elementContext]; + const clippingClientRect = rectToClientRect(await platform.getClippingRect({ + element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), + boundary, + rootBoundary, + strategy + })); + const rect = elementContext === 'floating' ? { + ...rects.floating, + x, + y + } : rects.reference; + const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); + const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { + x: 1, + y: 1 + } : { + x: 1, + y: 1 + }; + const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ + rect, + offsetParent, + strategy + }) : rect); + return { + top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, + bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, + left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, + right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x + }; +} +const min = Math.min; +const max = Math.max; +function within(min$1, value, max$1) { + return max(min$1, min(value, max$1)); +} + +/** + * Provides data to position an inner element of the floating element so that it + * appears centered to the reference element. + * @see https://floating-ui.com/docs/arrow + */ +const arrow = options => ({ + name: 'arrow', + options, + async fn(state) { + const { + x, + y, + placement, + rects, + platform, + elements + } = state; + // Since `element` is required, we don't Partial<> the type. + const { + element, + padding = 0 + } = evaluate(options, state) || {}; + if (element == null) { + return {}; + } + const paddingObject = getSideObjectFromPadding(padding); + const coords = { + x, + y + }; + const axis = getMainAxisFromPlacement(placement); + const length = getLengthFromAxis(axis); + const arrowDimensions = await platform.getDimensions(element); + const isYAxis = axis === 'y'; + const minProp = isYAxis ? 'top' : 'left'; + const maxProp = isYAxis ? 'bottom' : 'right'; + const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; + const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; + const startDiff = coords[axis] - rects.reference[axis]; + const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); + let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; + + // DOM platform can return `window` as the `offsetParent`. + if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { + clientSize = elements.floating[clientProp] || rects.floating[length]; + } + const centerToReference = endDiff / 2 - startDiff / 2; + + // If the padding is large enough that it causes the arrow to no longer be + // centered, modify the padding so that it is centered. + const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; + const minPadding = min(paddingObject[minProp], largestPossiblePadding); + const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); + + // Make sure the arrow doesn't overflow the floating element if the center + // point is outside the floating element's bounds. + const min$1 = minPadding; + const max = clientSize - arrowDimensions[length] - maxPadding; + const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; + const offset = within(min$1, center, max); + + // If the reference is small enough that the arrow's padding causes it to + // to point to nothing for an aligned placement, adjust the offset of the + // floating element itself. This stops `shift()` from taking action, but can + // be worked around by calling it again after the `arrow()` if desired. + const shouldAddOffset = getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; + const alignmentOffset = shouldAddOffset ? center < min$1 ? min$1 - center : max - center : 0; + return { + [axis]: coords[axis] - alignmentOffset, + data: { + [axis]: offset, + centerOffset: center - offset + } + }; + } +}); +exports.arrow = arrow; +const sides = ['top', 'right', 'bottom', 'left']; +const allPlacements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-start", side + "-end"), []); +const oppositeSideMap = { + left: 'right', + right: 'left', + bottom: 'top', + top: 'bottom' +}; +function getOppositePlacement(placement) { + return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); +} +function getAlignmentSides(placement, rects, rtl) { + if (rtl === void 0) { + rtl = false; + } + const alignment = getAlignment(placement); + const mainAxis = getMainAxisFromPlacement(placement); + const length = getLengthFromAxis(mainAxis); + let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; + if (rects.reference[length] > rects.floating[length]) { + mainAlignmentSide = getOppositePlacement(mainAlignmentSide); + } + return { + main: mainAlignmentSide, + cross: getOppositePlacement(mainAlignmentSide) + }; +} +const oppositeAlignmentMap = { + start: 'end', + end: 'start' +}; +function getOppositeAlignmentPlacement(placement) { + return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); +} +function getPlacementList(alignment, autoAlignment, allowedPlacements) { + const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement); + return allowedPlacementsSortedByAlignment.filter(placement => { + if (alignment) { + return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false); + } + return true; + }); +} +/** + * Optimizes the visibility of the floating element by choosing the placement + * that has the most space available automatically, without needing to specify a + * preferred placement. Alternative to `flip`. + * @see https://floating-ui.com/docs/autoPlacement + */ +const autoPlacement = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'autoPlacement', + options, + async fn(state) { + var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; + const { + rects, + middlewareData, + placement, + platform, + elements + } = state; + const { + crossAxis = false, + alignment, + allowedPlacements = allPlacements, + autoAlignment = true, + ...detectOverflowOptions + } = evaluate(options, state); + const placements = alignment !== undefined || allowedPlacements === allPlacements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; + const overflow = await detectOverflow(state, detectOverflowOptions); + const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; + const currentPlacement = placements[currentIndex]; + if (currentPlacement == null) { + return {}; + } + const { + main, + cross + } = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); + + // Make `computeCoords` start from the right place. + if (placement !== currentPlacement) { + return { + reset: { + placement: placements[0] + } + }; + } + const currentOverflows = [overflow[getSide(currentPlacement)], overflow[main], overflow[cross]]; + const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { + placement: currentPlacement, + overflows: currentOverflows + }]; + const nextPlacement = placements[currentIndex + 1]; + + // There are more placements to check. + if (nextPlacement) { + return { + data: { + index: currentIndex + 1, + overflows: allOverflows + }, + reset: { + placement: nextPlacement + } + }; + } + const placementsSortedByMostSpace = allOverflows.map(d => { + const alignment = getAlignment(d.placement); + return [d.placement, alignment && crossAxis ? + // Check along the mainAxis and main crossAxis side. + d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : + // Check only the mainAxis. + d.overflows[0], d.overflows]; + }).sort((a, b) => a[1] - b[1]); + const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, + // Aligned placements should not check their opposite crossAxis + // side. + getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); + const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; + if (resetPlacement !== placement) { + return { + data: { + index: currentIndex + 1, + overflows: allOverflows + }, + reset: { + placement: resetPlacement + } + }; + } + return {}; + } + }; +}; +exports.autoPlacement = autoPlacement; +function getExpandedPlacements(placement) { + const oppositePlacement = getOppositePlacement(placement); + return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; +} +function getSideList(side, isStart, rtl) { + const lr = ['left', 'right']; + const rl = ['right', 'left']; + const tb = ['top', 'bottom']; + const bt = ['bottom', 'top']; + switch (side) { + case 'top': + case 'bottom': + if (rtl) return isStart ? rl : lr; + return isStart ? lr : rl; + case 'left': + case 'right': + return isStart ? tb : bt; + default: + return []; + } +} +function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { + const alignment = getAlignment(placement); + let list = getSideList(getSide(placement), direction === 'start', rtl); + if (alignment) { + list = list.map(side => side + "-" + alignment); + if (flipAlignment) { + list = list.concat(list.map(getOppositeAlignmentPlacement)); + } + } + return list; +} + +/** + * Optimizes the visibility of the floating element by flipping the `placement` + * in order to keep it in view when the preferred placement(s) will overflow the + * clipping boundary. Alternative to `autoPlacement`. + * @see https://floating-ui.com/docs/flip + */ +const flip = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'flip', + options, + async fn(state) { + var _middlewareData$flip; + const { + placement, + middlewareData, + rects, + initialPlacement, + platform, + elements + } = state; + const { + mainAxis: checkMainAxis = true, + crossAxis: checkCrossAxis = true, + fallbackPlacements: specifiedFallbackPlacements, + fallbackStrategy = 'bestFit', + fallbackAxisSideDirection = 'none', + flipAlignment = true, + ...detectOverflowOptions + } = evaluate(options, state); + const side = getSide(placement); + const isBasePlacement = getSide(initialPlacement) === initialPlacement; + const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); + const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); + if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') { + fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); + } + const placements = [initialPlacement, ...fallbackPlacements]; + const overflow = await detectOverflow(state, detectOverflowOptions); + const overflows = []; + let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; + if (checkMainAxis) { + overflows.push(overflow[side]); + } + if (checkCrossAxis) { + const { + main, + cross + } = getAlignmentSides(placement, rects, rtl); + overflows.push(overflow[main], overflow[cross]); + } + overflowsData = [...overflowsData, { + placement, + overflows + }]; + + // One or more sides is overflowing. + if (!overflows.every(side => side <= 0)) { + var _middlewareData$flip2, _overflowsData$filter; + const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; + const nextPlacement = placements[nextIndex]; + if (nextPlacement) { + // Try next placement and re-run the lifecycle. + return { + data: { + index: nextIndex, + overflows: overflowsData + }, + reset: { + placement: nextPlacement + } + }; + } + + // First, find the candidates that fit on the mainAxis side of overflow, + // then find the placement that fits the best on the main crossAxis side. + let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; + + // Otherwise fallback. + if (!resetPlacement) { + switch (fallbackStrategy) { + case 'bestFit': + { + var _overflowsData$map$so; + const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0]; + if (placement) { + resetPlacement = placement; + } + break; + } + case 'initialPlacement': + resetPlacement = initialPlacement; + break; + } + } + if (placement !== resetPlacement) { + return { + reset: { + placement: resetPlacement + } + }; + } + } + return {}; + } + }; +}; +exports.flip = flip; +function getSideOffsets(overflow, rect) { + return { + top: overflow.top - rect.height, + right: overflow.right - rect.width, + bottom: overflow.bottom - rect.height, + left: overflow.left - rect.width + }; +} +function isAnySideFullyClipped(overflow) { + return sides.some(side => overflow[side] >= 0); +} +/** + * Provides data to hide the floating element in applicable situations, such as + * when it is not in the same clipping context as the reference element. + * @see https://floating-ui.com/docs/hide + */ +const hide = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'hide', + options, + async fn(state) { + const { + rects + } = state; + const { + strategy = 'referenceHidden', + ...detectOverflowOptions + } = evaluate(options, state); + switch (strategy) { + case 'referenceHidden': + { + const overflow = await detectOverflow(state, { + ...detectOverflowOptions, + elementContext: 'reference' + }); + const offsets = getSideOffsets(overflow, rects.reference); + return { + data: { + referenceHiddenOffsets: offsets, + referenceHidden: isAnySideFullyClipped(offsets) + } + }; + } + case 'escaped': + { + const overflow = await detectOverflow(state, { + ...detectOverflowOptions, + altBoundary: true + }); + const offsets = getSideOffsets(overflow, rects.floating); + return { + data: { + escapedOffsets: offsets, + escaped: isAnySideFullyClipped(offsets) + } + }; + } + default: + { + return {}; + } + } + } + }; +}; +exports.hide = hide; +function getBoundingRect(rects) { + const minX = min(...rects.map(rect => rect.left)); + const minY = min(...rects.map(rect => rect.top)); + const maxX = max(...rects.map(rect => rect.right)); + const maxY = max(...rects.map(rect => rect.bottom)); + return { + x: minX, + y: minY, + width: maxX - minX, + height: maxY - minY + }; +} +function getRectsByLine(rects) { + const sortedRects = rects.slice().sort((a, b) => a.y - b.y); + const groups = []; + let prevRect = null; + for (let i = 0; i < sortedRects.length; i++) { + const rect = sortedRects[i]; + if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { + groups.push([rect]); + } else { + groups[groups.length - 1].push(rect); + } + prevRect = rect; + } + return groups.map(rect => rectToClientRect(getBoundingRect(rect))); +} +/** + * Provides improved positioning for inline reference elements that can span + * over multiple lines, such as hyperlinks or range selections. + * @see https://floating-ui.com/docs/inline + */ +const inline = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'inline', + options, + async fn(state) { + const { + placement, + elements, + rects, + platform, + strategy + } = state; + // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a + // ClientRect's bounds, despite the event listener being triggered. A + // padding of 2 seems to handle this issue. + const { + padding = 2, + x, + y + } = evaluate(options, state); + const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); + const clientRects = getRectsByLine(nativeClientRects); + const fallback = rectToClientRect(getBoundingRect(nativeClientRects)); + const paddingObject = getSideObjectFromPadding(padding); + function getBoundingClientRect() { + // There are two rects and they are disjoined. + if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { + // Find the first rect in which the point is fully inside. + return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; + } + + // There are 2 or more connected rects. + if (clientRects.length >= 2) { + if (getMainAxisFromPlacement(placement) === 'x') { + const firstRect = clientRects[0]; + const lastRect = clientRects[clientRects.length - 1]; + const isTop = getSide(placement) === 'top'; + const top = firstRect.top; + const bottom = lastRect.bottom; + const left = isTop ? firstRect.left : lastRect.left; + const right = isTop ? firstRect.right : lastRect.right; + const width = right - left; + const height = bottom - top; + return { + top, + bottom, + left, + right, + width, + height, + x: left, + y: top + }; + } + const isLeftSide = getSide(placement) === 'left'; + const maxRight = max(...clientRects.map(rect => rect.right)); + const minLeft = min(...clientRects.map(rect => rect.left)); + const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); + const top = measureRects[0].top; + const bottom = measureRects[measureRects.length - 1].bottom; + const left = minLeft; + const right = maxRight; + const width = right - left; + const height = bottom - top; + return { + top, + bottom, + left, + right, + width, + height, + x: left, + y: top + }; + } + return fallback; + } + const resetRects = await platform.getElementRects({ + reference: { + getBoundingClientRect + }, + floating: elements.floating, + strategy + }); + if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { + return { + reset: { + rects: resetRects + } + }; + } + return {}; + } + }; +}; +exports.inline = inline; +async function convertValueToCoords(state, options) { + const { + placement, + platform, + elements + } = state; + const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); + const side = getSide(placement); + const alignment = getAlignment(placement); + const isVertical = getMainAxisFromPlacement(placement) === 'x'; + const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1; + const crossAxisMulti = rtl && isVertical ? -1 : 1; + const rawValue = evaluate(options, state); + + // eslint-disable-next-line prefer-const + let { + mainAxis, + crossAxis, + alignmentAxis + } = typeof rawValue === 'number' ? { + mainAxis: rawValue, + crossAxis: 0, + alignmentAxis: null + } : { + mainAxis: 0, + crossAxis: 0, + alignmentAxis: null, + ...rawValue + }; + if (alignment && typeof alignmentAxis === 'number') { + crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; + } + return isVertical ? { + x: crossAxis * crossAxisMulti, + y: mainAxis * mainAxisMulti + } : { + x: mainAxis * mainAxisMulti, + y: crossAxis * crossAxisMulti + }; +} + +/** + * Modifies the placement by translating the floating element along the + * specified axes. + * A number (shorthand for `mainAxis` or distance), or an axes configuration + * object may be passed. + * @see https://floating-ui.com/docs/offset + */ +const offset = function (options) { + if (options === void 0) { + options = 0; + } + return { + name: 'offset', + options, + async fn(state) { + const { + x, + y + } = state; + const diffCoords = await convertValueToCoords(state, options); + return { + x: x + diffCoords.x, + y: y + diffCoords.y, + data: diffCoords + }; + } + }; +}; +exports.offset = offset; +function getCrossAxis(axis) { + return axis === 'x' ? 'y' : 'x'; +} + +/** + * Optimizes the visibility of the floating element by shifting it in order to + * keep it in view when it will overflow the clipping boundary. + * @see https://floating-ui.com/docs/shift + */ +const shift = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'shift', + options, + async fn(state) { + const { + x, + y, + placement + } = state; + const { + mainAxis: checkMainAxis = true, + crossAxis: checkCrossAxis = false, + limiter = { + fn: _ref => { + let { + x, + y + } = _ref; + return { + x, + y + }; + } + }, + ...detectOverflowOptions + } = evaluate(options, state); + const coords = { + x, + y + }; + const overflow = await detectOverflow(state, detectOverflowOptions); + const mainAxis = getMainAxisFromPlacement(getSide(placement)); + const crossAxis = getCrossAxis(mainAxis); + let mainAxisCoord = coords[mainAxis]; + let crossAxisCoord = coords[crossAxis]; + if (checkMainAxis) { + const minSide = mainAxis === 'y' ? 'top' : 'left'; + const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; + const min = mainAxisCoord + overflow[minSide]; + const max = mainAxisCoord - overflow[maxSide]; + mainAxisCoord = within(min, mainAxisCoord, max); + } + if (checkCrossAxis) { + const minSide = crossAxis === 'y' ? 'top' : 'left'; + const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; + const min = crossAxisCoord + overflow[minSide]; + const max = crossAxisCoord - overflow[maxSide]; + crossAxisCoord = within(min, crossAxisCoord, max); + } + const limitedCoords = limiter.fn({ + ...state, + [mainAxis]: mainAxisCoord, + [crossAxis]: crossAxisCoord + }); + return { + ...limitedCoords, + data: { + x: limitedCoords.x - x, + y: limitedCoords.y - y + } + }; + } + }; +}; +/** + * Built-in `limiter` that will stop `shift()` at a certain point. + */ +exports.shift = shift; +const limitShift = function (options) { + if (options === void 0) { + options = {}; + } + return { + options, + fn(state) { + const { + x, + y, + placement, + rects, + middlewareData + } = state; + const { + offset = 0, + mainAxis: checkMainAxis = true, + crossAxis: checkCrossAxis = true + } = evaluate(options, state); + const coords = { + x, + y + }; + const mainAxis = getMainAxisFromPlacement(placement); + const crossAxis = getCrossAxis(mainAxis); + let mainAxisCoord = coords[mainAxis]; + let crossAxisCoord = coords[crossAxis]; + const rawOffset = evaluate(offset, state); + const computedOffset = typeof rawOffset === 'number' ? { + mainAxis: rawOffset, + crossAxis: 0 + } : { + mainAxis: 0, + crossAxis: 0, + ...rawOffset + }; + if (checkMainAxis) { + const len = mainAxis === 'y' ? 'height' : 'width'; + const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; + const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; + if (mainAxisCoord < limitMin) { + mainAxisCoord = limitMin; + } else if (mainAxisCoord > limitMax) { + mainAxisCoord = limitMax; + } + } + if (checkCrossAxis) { + var _middlewareData$offse, _middlewareData$offse2; + const len = mainAxis === 'y' ? 'width' : 'height'; + const isOriginSide = ['top', 'left'].includes(getSide(placement)); + const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); + const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); + if (crossAxisCoord < limitMin) { + crossAxisCoord = limitMin; + } else if (crossAxisCoord > limitMax) { + crossAxisCoord = limitMax; + } + } + return { + [mainAxis]: mainAxisCoord, + [crossAxis]: crossAxisCoord + }; + } + }; +}; + +/** + * Provides data that allows you to change the size of the floating element — + * for instance, prevent it from overflowing the clipping boundary or match the + * width of the reference element. + * @see https://floating-ui.com/docs/size + */ +exports.limitShift = limitShift; +const size = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'size', + options, + async fn(state) { + const { + placement, + rects, + platform, + elements + } = state; + const { + apply = () => {}, + ...detectOverflowOptions + } = evaluate(options, state); + const overflow = await detectOverflow(state, detectOverflowOptions); + const side = getSide(placement); + const alignment = getAlignment(placement); + const axis = getMainAxisFromPlacement(placement); + const isXAxis = axis === 'x'; + const { + width, + height + } = rects.floating; + let heightSide; + let widthSide; + if (side === 'top' || side === 'bottom') { + heightSide = side; + widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; + } else { + widthSide = side; + heightSide = alignment === 'end' ? 'top' : 'bottom'; + } + const overflowAvailableHeight = height - overflow[heightSide]; + const overflowAvailableWidth = width - overflow[widthSide]; + const noShift = !state.middlewareData.shift; + let availableHeight = overflowAvailableHeight; + let availableWidth = overflowAvailableWidth; + if (isXAxis) { + const maximumClippingWidth = width - overflow.left - overflow.right; + availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth; + } else { + const maximumClippingHeight = height - overflow.top - overflow.bottom; + availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight; + } + if (noShift && !alignment) { + const xMin = max(overflow.left, 0); + const xMax = max(overflow.right, 0); + const yMin = max(overflow.top, 0); + const yMax = max(overflow.bottom, 0); + if (isXAxis) { + availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); + } else { + availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); + } + } + await apply({ + ...state, + availableWidth, + availableHeight + }); + const nextDimensions = await platform.getDimensions(elements.floating); + if (width !== nextDimensions.width || height !== nextDimensions.height) { + return { + reset: { + rects: true + } + }; + } + return {}; + } + }; +}; +exports.size = size; + +/***/ }), + +/***/ "../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js": +/*!**************************************************************************!*\ + !*** ../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js ***! + \**************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "arrow", ({ + enumerable: true, + get: function () { + return _core.arrow; + } +})); +Object.defineProperty(exports, "autoPlacement", ({ + enumerable: true, + get: function () { + return _core.autoPlacement; + } +})); +exports.autoUpdate = autoUpdate; +exports.computePosition = void 0; +Object.defineProperty(exports, "detectOverflow", ({ + enumerable: true, + get: function () { + return _core.detectOverflow; + } +})); +Object.defineProperty(exports, "flip", ({ + enumerable: true, + get: function () { + return _core.flip; + } +})); +exports.getOverflowAncestors = getOverflowAncestors; +Object.defineProperty(exports, "hide", ({ + enumerable: true, + get: function () { + return _core.hide; + } +})); +Object.defineProperty(exports, "inline", ({ + enumerable: true, + get: function () { + return _core.inline; + } +})); +Object.defineProperty(exports, "limitShift", ({ + enumerable: true, + get: function () { + return _core.limitShift; + } +})); +Object.defineProperty(exports, "offset", ({ + enumerable: true, + get: function () { + return _core.offset; + } +})); +exports.platform = void 0; +Object.defineProperty(exports, "shift", ({ + enumerable: true, + get: function () { + return _core.shift; + } +})); +Object.defineProperty(exports, "size", ({ + enumerable: true, + get: function () { + return _core.size; + } +})); +var _core = __webpack_require__(/*! @floating-ui/core */ "../../../node_modules/@floating-ui/core/dist/floating-ui.core.esm.js"); +function getWindow(node) { + var _node$ownerDocument; + return ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; +} +function getComputedStyle$1(element) { + return getWindow(element).getComputedStyle(element); +} +function isNode(value) { + return value instanceof getWindow(value).Node; +} +function getNodeName(node) { + return isNode(node) ? (node.nodeName || '').toLowerCase() : ''; +} +function isHTMLElement(value) { + return value instanceof getWindow(value).HTMLElement; +} +function isElement(value) { + return value instanceof getWindow(value).Element; +} +function isShadowRoot(node) { + // Browsers without `ShadowRoot` support. + if (typeof ShadowRoot === 'undefined') { + return false; + } + const OwnElement = getWindow(node).ShadowRoot; + return node instanceof OwnElement || node instanceof ShadowRoot; +} +function isOverflowElement(element) { + const { + overflow, + overflowX, + overflowY, + display + } = getComputedStyle$1(element); + return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display); +} +function isTableElement(element) { + return ['table', 'td', 'th'].includes(getNodeName(element)); +} +function isContainingBlock(element) { + const safari = isSafari(); + const css = getComputedStyle$1(element); + + // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block + return css.transform !== 'none' || css.perspective !== 'none' || !safari && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !safari && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value)); +} +function isSafari() { + if (typeof CSS === 'undefined' || !CSS.supports) return false; + return CSS.supports('-webkit-backdrop-filter', 'none'); +} +function isLastTraversableNode(node) { + return ['html', 'body', '#document'].includes(getNodeName(node)); +} +const min = Math.min; +const max = Math.max; +const round = Math.round; +function getCssDimensions(element) { + const css = getComputedStyle$1(element); + // In testing environments, the `width` and `height` properties are empty + // strings for SVG elements, returning NaN. Fallback to `0` in this case. + let width = parseFloat(css.width) || 0; + let height = parseFloat(css.height) || 0; + const hasOffset = isHTMLElement(element); + const offsetWidth = hasOffset ? element.offsetWidth : width; + const offsetHeight = hasOffset ? element.offsetHeight : height; + const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; + if (shouldFallback) { + width = offsetWidth; + height = offsetHeight; + } + return { + width, + height, + fallback: shouldFallback + }; +} +function unwrapElement(element) { + return !isElement(element) ? element.contextElement : element; +} +const FALLBACK_SCALE = { + x: 1, + y: 1 +}; +function getScale(element) { + const domElement = unwrapElement(element); + if (!isHTMLElement(domElement)) { + return FALLBACK_SCALE; + } + const rect = domElement.getBoundingClientRect(); + const { + width, + height, + fallback + } = getCssDimensions(domElement); + let x = (fallback ? round(rect.width) : rect.width) / width; + let y = (fallback ? round(rect.height) : rect.height) / height; + + // 0, NaN, or Infinity should always fallback to 1. + + if (!x || !Number.isFinite(x)) { + x = 1; + } + if (!y || !Number.isFinite(y)) { + y = 1; + } + return { + x, + y + }; +} +const noOffsets = { + x: 0, + y: 0 +}; +function getVisualOffsets(element, isFixed, floatingOffsetParent) { + var _win$visualViewport, _win$visualViewport2; + if (isFixed === void 0) { + isFixed = true; + } + if (!isSafari()) { + return noOffsets; + } + const win = element ? getWindow(element) : window; + if (!floatingOffsetParent || isFixed && floatingOffsetParent !== win) { + return noOffsets; + } + return { + x: ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0, + y: ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 + }; +} +function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { + if (includeScale === void 0) { + includeScale = false; + } + if (isFixedStrategy === void 0) { + isFixedStrategy = false; + } + const clientRect = element.getBoundingClientRect(); + const domElement = unwrapElement(element); + let scale = FALLBACK_SCALE; + if (includeScale) { + if (offsetParent) { + if (isElement(offsetParent)) { + scale = getScale(offsetParent); + } + } else { + scale = getScale(element); + } + } + const visualOffsets = getVisualOffsets(domElement, isFixedStrategy, offsetParent); + let x = (clientRect.left + visualOffsets.x) / scale.x; + let y = (clientRect.top + visualOffsets.y) / scale.y; + let width = clientRect.width / scale.x; + let height = clientRect.height / scale.y; + if (domElement) { + const win = getWindow(domElement); + const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; + let currentIFrame = win.frameElement; + while (currentIFrame && offsetParent && offsetWin !== win) { + const iframeScale = getScale(currentIFrame); + const iframeRect = currentIFrame.getBoundingClientRect(); + const css = getComputedStyle(currentIFrame); + iframeRect.x += (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; + iframeRect.y += (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; + x *= iframeScale.x; + y *= iframeScale.y; + width *= iframeScale.x; + height *= iframeScale.y; + x += iframeRect.x; + y += iframeRect.y; + currentIFrame = getWindow(currentIFrame).frameElement; + } + } + return (0, _core.rectToClientRect)({ + width, + height, + x, + y + }); +} +function getDocumentElement(node) { + return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement; +} +function getNodeScroll(element) { + if (isElement(element)) { + return { + scrollLeft: element.scrollLeft, + scrollTop: element.scrollTop + }; + } + return { + scrollLeft: element.pageXOffset, + scrollTop: element.pageYOffset + }; +} +function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { + let { + rect, + offsetParent, + strategy + } = _ref; + const isOffsetParentAnElement = isHTMLElement(offsetParent); + const documentElement = getDocumentElement(offsetParent); + if (offsetParent === documentElement) { + return rect; + } + let scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + let scale = { + x: 1, + y: 1 + }; + const offsets = { + x: 0, + y: 0 + }; + if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') { + if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { + scroll = getNodeScroll(offsetParent); + } + if (isHTMLElement(offsetParent)) { + const offsetRect = getBoundingClientRect(offsetParent); + scale = getScale(offsetParent); + offsets.x = offsetRect.x + offsetParent.clientLeft; + offsets.y = offsetRect.y + offsetParent.clientTop; + } + } + return { + width: rect.width * scale.x, + height: rect.height * scale.y, + x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x, + y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + }; +} +function getWindowScrollBarX(element) { + // If has a CSS width greater than the viewport, then this will be + // incorrect for RTL. + return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft; +} + +// Gets the entire size of the scrollable document area, even extending outside +// of the `` and `` rect bounds if horizontally scrollable. +function getDocumentRect(element) { + const html = getDocumentElement(element); + const scroll = getNodeScroll(element); + const body = element.ownerDocument.body; + const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); + const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); + let x = -scroll.scrollLeft + getWindowScrollBarX(element); + const y = -scroll.scrollTop; + if (getComputedStyle$1(body).direction === 'rtl') { + x += max(html.clientWidth, body.clientWidth) - width; + } + return { + width, + height, + x, + y + }; +} +function getParentNode(node) { + if (getNodeName(node) === 'html') { + return node; + } + const result = + // Step into the shadow DOM of the parent of a slotted node. + node.assignedSlot || + // DOM Element detected. + node.parentNode || + // ShadowRoot detected. + isShadowRoot(node) && node.host || + // Fallback. + getDocumentElement(node); + return isShadowRoot(result) ? result.host : result; +} +function getNearestOverflowAncestor(node) { + const parentNode = getParentNode(node); + if (isLastTraversableNode(parentNode)) { + // `getParentNode` will never return a `Document` due to the fallback + // check, so it's either the or element. + return parentNode.ownerDocument.body; + } + if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { + return parentNode; + } + return getNearestOverflowAncestor(parentNode); +} +function getOverflowAncestors(node, list) { + var _node$ownerDocument; + if (list === void 0) { + list = []; + } + const scrollableAncestor = getNearestOverflowAncestor(node); + const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body); + const win = getWindow(scrollableAncestor); + if (isBody) { + return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []); + } + return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor)); +} +function getViewportRect(element, strategy) { + const win = getWindow(element); + const html = getDocumentElement(element); + const visualViewport = win.visualViewport; + let width = html.clientWidth; + let height = html.clientHeight; + let x = 0; + let y = 0; + if (visualViewport) { + width = visualViewport.width; + height = visualViewport.height; + const visualViewportBased = isSafari(); + if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { + x = visualViewport.offsetLeft; + y = visualViewport.offsetTop; + } + } + return { + width, + height, + x, + y + }; +} + +// Returns the inner client rect, subtracting scrollbars if present. +function getInnerBoundingClientRect(element, strategy) { + const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); + const top = clientRect.top + element.clientTop; + const left = clientRect.left + element.clientLeft; + const scale = isHTMLElement(element) ? getScale(element) : { + x: 1, + y: 1 + }; + const width = element.clientWidth * scale.x; + const height = element.clientHeight * scale.y; + const x = left * scale.x; + const y = top * scale.y; + return { + width, + height, + x, + y + }; +} +function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { + let rect; + if (clippingAncestor === 'viewport') { + rect = getViewportRect(element, strategy); + } else if (clippingAncestor === 'document') { + rect = getDocumentRect(getDocumentElement(element)); + } else if (isElement(clippingAncestor)) { + rect = getInnerBoundingClientRect(clippingAncestor, strategy); + } else { + const visualOffsets = getVisualOffsets(element); + rect = { + ...clippingAncestor, + x: clippingAncestor.x - visualOffsets.x, + y: clippingAncestor.y - visualOffsets.y + }; + } + return (0, _core.rectToClientRect)(rect); +} +function hasFixedPositionAncestor(element, stopNode) { + const parentNode = getParentNode(element); + if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { + return false; + } + return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); +} + +// A "clipping ancestor" is an `overflow` element with the characteristic of +// clipping (or hiding) child elements. This returns all clipping ancestors +// of the given element up the tree. +function getClippingElementAncestors(element, cache) { + const cachedResult = cache.get(element); + if (cachedResult) { + return cachedResult; + } + let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body'); + let currentContainingBlockComputedStyle = null; + const elementIsFixed = getComputedStyle$1(element).position === 'fixed'; + let currentNode = elementIsFixed ? getParentNode(element) : element; + + // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block + while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { + const computedStyle = getComputedStyle$1(currentNode); + const currentNodeIsContaining = isContainingBlock(currentNode); + if (!currentNodeIsContaining && computedStyle.position === 'fixed') { + currentContainingBlockComputedStyle = null; + } + const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); + if (shouldDropCurrentNode) { + // Drop non-containing blocks. + result = result.filter(ancestor => ancestor !== currentNode); + } else { + // Record last containing block for next iteration. + currentContainingBlockComputedStyle = computedStyle; + } + currentNode = getParentNode(currentNode); + } + cache.set(element, result); + return result; +} + +// Gets the maximum area that the element is visible in due to any number of +// clipping ancestors. +function getClippingRect(_ref) { + let { + element, + boundary, + rootBoundary, + strategy + } = _ref; + const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary); + const clippingAncestors = [...elementClippingAncestors, rootBoundary]; + const firstClippingAncestor = clippingAncestors[0]; + const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { + const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); + accRect.top = max(rect.top, accRect.top); + accRect.right = min(rect.right, accRect.right); + accRect.bottom = min(rect.bottom, accRect.bottom); + accRect.left = max(rect.left, accRect.left); + return accRect; + }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); + return { + width: clippingRect.right - clippingRect.left, + height: clippingRect.bottom - clippingRect.top, + x: clippingRect.left, + y: clippingRect.top + }; +} +function getDimensions(element) { + return getCssDimensions(element); +} +function getTrueOffsetParent(element, polyfill) { + if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') { + return null; + } + if (polyfill) { + return polyfill(element); + } + return element.offsetParent; +} +function getContainingBlock(element) { + let currentNode = getParentNode(element); + while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { + if (isContainingBlock(currentNode)) { + return currentNode; + } else { + currentNode = getParentNode(currentNode); + } + } + return null; +} + +// Gets the closest ancestor positioned element. Handles some edge cases, +// such as table ancestors and cross browser bugs. +function getOffsetParent(element, polyfill) { + const window = getWindow(element); + if (!isHTMLElement(element)) { + return window; + } + let offsetParent = getTrueOffsetParent(element, polyfill); + while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') { + offsetParent = getTrueOffsetParent(offsetParent, polyfill); + } + if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) { + return window; + } + return offsetParent || getContainingBlock(element) || window; +} +function getRectRelativeToOffsetParent(element, offsetParent, strategy) { + const isOffsetParentAnElement = isHTMLElement(offsetParent); + const documentElement = getDocumentElement(offsetParent); + const isFixed = strategy === 'fixed'; + const rect = getBoundingClientRect(element, true, isFixed, offsetParent); + let scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + const offsets = { + x: 0, + y: 0 + }; + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { + scroll = getNodeScroll(offsetParent); + } + if (isHTMLElement(offsetParent)) { + const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); + offsets.x = offsetRect.x + offsetParent.clientLeft; + offsets.y = offsetRect.y + offsetParent.clientTop; + } else if (documentElement) { + offsets.x = getWindowScrollBarX(documentElement); + } + } + return { + x: rect.left + scroll.scrollLeft - offsets.x, + y: rect.top + scroll.scrollTop - offsets.y, + width: rect.width, + height: rect.height + }; +} +const platform = { + getClippingRect, + convertOffsetParentRelativeRectToViewportRelativeRect, + isElement, + getDimensions, + getOffsetParent, + getDocumentElement, + getScale, + async getElementRects(_ref) { + let { + reference, + floating, + strategy + } = _ref; + const getOffsetParentFn = this.getOffsetParent || getOffsetParent; + const getDimensionsFn = this.getDimensions; + return { + reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy), + floating: { + x: 0, + y: 0, + ...(await getDimensionsFn(floating)) + } + }; + }, + getClientRects: element => Array.from(element.getClientRects()), + isRTL: element => getComputedStyle$1(element).direction === 'rtl' +}; + +/** + * Automatically updates the position of the floating element when necessary. + * Should only be called when the floating element is mounted on the DOM or + * visible on the screen. + * @returns cleanup function that should be invoked when the floating element is + * removed from the DOM or hidden from the screen. + * @see https://floating-ui.com/docs/autoUpdate + */ +exports.platform = platform; +function autoUpdate(reference, floating, update, options) { + if (options === void 0) { + options = {}; + } + const { + ancestorScroll = true, + ancestorResize = true, + elementResize = true, + animationFrame = false + } = options; + const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : reference.contextElement ? getOverflowAncestors(reference.contextElement) : []), ...getOverflowAncestors(floating)] : []; + ancestors.forEach(ancestor => { + // ignores Window, checks for [object VisualViewport] + const isVisualViewport = !isElement(ancestor) && ancestor.toString().includes('V'); + if (ancestorScroll && (animationFrame ? isVisualViewport : true)) { + ancestor.addEventListener('scroll', update, { + passive: true + }); + } + ancestorResize && ancestor.addEventListener('resize', update); + }); + let observer = null; + if (elementResize) { + observer = new ResizeObserver(() => { + update(); + }); + isElement(reference) && !animationFrame && observer.observe(reference); + if (!isElement(reference) && reference.contextElement && !animationFrame) { + observer.observe(reference.contextElement); + } + observer.observe(floating); + } + let frameId; + let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; + if (animationFrame) { + frameLoop(); + } + function frameLoop() { + const nextRefRect = getBoundingClientRect(reference); + if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) { + update(); + } + prevRefRect = nextRefRect; + frameId = requestAnimationFrame(frameLoop); + } + update(); + return () => { + var _observer; + ancestors.forEach(ancestor => { + ancestorScroll && ancestor.removeEventListener('scroll', update); + ancestorResize && ancestor.removeEventListener('resize', update); + }); + (_observer = observer) == null ? void 0 : _observer.disconnect(); + observer = null; + if (animationFrame) { + cancelAnimationFrame(frameId); + } + }; +} + +/** + * Computes the `x` and `y` coordinates that will place the floating element + * next to a reference element when it is given a certain CSS positioning + * strategy. + */ +const computePosition = (reference, floating, options) => { + // This caches the expensive `getClippingElementAncestors` function so that + // multiple lifecycle resets re-use the same result. It only lives for a + // single call. If other functions become expensive, we can add them as well. + const cache = new Map(); + const mergedOptions = { + platform, + ...options + }; + const platformWithCache = { + ...mergedOptions.platform, + _c: cache + }; + return (0, _core.computePosition)(reference, floating, { + ...mergedOptions, + platform: platformWithCache + }); +}; +exports.computePosition = computePosition; + +/***/ }), + +/***/ "../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js": +/*!**************************************************************************************!*\ + !*** ../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js ***! + \**************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.arrow = void 0; +Object.defineProperty(exports, "autoPlacement", ({ + enumerable: true, + get: function () { + return _dom.autoPlacement; + } +})); +Object.defineProperty(exports, "autoUpdate", ({ + enumerable: true, + get: function () { + return _dom.autoUpdate; + } +})); +Object.defineProperty(exports, "computePosition", ({ + enumerable: true, + get: function () { + return _dom.computePosition; + } +})); +Object.defineProperty(exports, "detectOverflow", ({ + enumerable: true, + get: function () { + return _dom.detectOverflow; + } +})); +Object.defineProperty(exports, "flip", ({ + enumerable: true, + get: function () { + return _dom.flip; + } +})); +Object.defineProperty(exports, "getOverflowAncestors", ({ + enumerable: true, + get: function () { + return _dom.getOverflowAncestors; + } +})); +Object.defineProperty(exports, "hide", ({ + enumerable: true, + get: function () { + return _dom.hide; + } +})); +Object.defineProperty(exports, "inline", ({ + enumerable: true, + get: function () { + return _dom.inline; + } +})); +Object.defineProperty(exports, "limitShift", ({ + enumerable: true, + get: function () { + return _dom.limitShift; + } +})); +Object.defineProperty(exports, "offset", ({ + enumerable: true, + get: function () { + return _dom.offset; + } +})); +Object.defineProperty(exports, "platform", ({ + enumerable: true, + get: function () { + return _dom.platform; + } +})); +Object.defineProperty(exports, "shift", ({ + enumerable: true, + get: function () { + return _dom.shift; + } +})); +Object.defineProperty(exports, "size", ({ + enumerable: true, + get: function () { + return _dom.size; + } +})); +exports.useFloating = useFloating; +var _dom = __webpack_require__(/*! @floating-ui/dom */ "../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js"); +var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var ReactDOM = _interopRequireWildcard(__webpack_require__(/*! react-dom */ "react-dom")); +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +/** + * Provides data to position an inner element of the floating element so that it + * appears centered to the reference element. + * This wraps the core `arrow` middleware to allow React refs as the element. + * @see https://floating-ui.com/docs/arrow + */ +const arrow = options => { + function isRef(value) { + return {}.hasOwnProperty.call(value, 'current'); + } + return { + name: 'arrow', + options, + fn(state) { + const { + element, + padding + } = typeof options === 'function' ? options(state) : options; + if (element && isRef(element)) { + if (element.current != null) { + return (0, _dom.arrow)({ + element: element.current, + padding + }).fn(state); + } + return {}; + } else if (element) { + return (0, _dom.arrow)({ + element, + padding + }).fn(state); + } + return {}; + } + }; +}; +exports.arrow = arrow; +var index = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect; + +// Fork of `fast-deep-equal` that only does the comparisons we need and compares +// functions +function deepEqual(a, b) { + if (a === b) { + return true; + } + if (typeof a !== typeof b) { + return false; + } + if (typeof a === 'function' && a.toString() === b.toString()) { + return true; + } + let length, i, keys; + if (a && b && typeof a == 'object') { + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) { + if (!deepEqual(a[i], b[i])) { + return false; + } + } + return true; + } + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) { + return false; + } + for (i = length; i-- !== 0;) { + if (!{}.hasOwnProperty.call(b, keys[i])) { + return false; + } + } + for (i = length; i-- !== 0;) { + const key = keys[i]; + if (key === '_owner' && a.$$typeof) { + continue; + } + if (!deepEqual(a[key], b[key])) { + return false; + } + } + return true; + } + return a !== a && b !== b; +} +function getDPR(element) { + if (typeof window === 'undefined') { + return 1; + } + const win = element.ownerDocument.defaultView || window; + return win.devicePixelRatio || 1; +} +function roundByDPR(element, value) { + const dpr = getDPR(element); + return Math.round(value * dpr) / dpr; +} +function useLatestRef(value) { + const ref = React.useRef(value); + index(() => { + ref.current = value; + }); + return ref; +} + +/** + * Provides data to position a floating element. + * @see https://floating-ui.com/docs/react + */ +function useFloating(options) { + if (options === void 0) { + options = {}; + } + const { + placement = 'bottom', + strategy = 'absolute', + middleware = [], + platform, + elements: { + reference: externalReference, + floating: externalFloating + } = {}, + transform = true, + whileElementsMounted, + open + } = options; + const [data, setData] = React.useState({ + x: 0, + y: 0, + strategy, + placement, + middlewareData: {}, + isPositioned: false + }); + const [latestMiddleware, setLatestMiddleware] = React.useState(middleware); + if (!deepEqual(latestMiddleware, middleware)) { + setLatestMiddleware(middleware); + } + const [_reference, _setReference] = React.useState(null); + const [_floating, _setFloating] = React.useState(null); + const setReference = React.useCallback(node => { + if (node != referenceRef.current) { + referenceRef.current = node; + _setReference(node); + } + }, [_setReference]); + const setFloating = React.useCallback(node => { + if (node !== floatingRef.current) { + floatingRef.current = node; + _setFloating(node); + } + }, [_setFloating]); + const referenceEl = externalReference || _reference; + const floatingEl = externalFloating || _floating; + const referenceRef = React.useRef(null); + const floatingRef = React.useRef(null); + const dataRef = React.useRef(data); + const whileElementsMountedRef = useLatestRef(whileElementsMounted); + const platformRef = useLatestRef(platform); + const update = React.useCallback(() => { + if (!referenceRef.current || !floatingRef.current) { + return; + } + const config = { + placement, + strategy, + middleware: latestMiddleware + }; + if (platformRef.current) { + config.platform = platformRef.current; + } + (0, _dom.computePosition)(referenceRef.current, floatingRef.current, config).then(data => { + const fullData = { + ...data, + isPositioned: true + }; + if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { + dataRef.current = fullData; + ReactDOM.flushSync(() => { + setData(fullData); + }); + } + }); + }, [latestMiddleware, placement, strategy, platformRef]); + index(() => { + if (open === false && dataRef.current.isPositioned) { + dataRef.current.isPositioned = false; + setData(data => ({ + ...data, + isPositioned: false + })); + } + }, [open]); + const isMountedRef = React.useRef(false); + index(() => { + isMountedRef.current = true; + return () => { + isMountedRef.current = false; + }; + }, []); + index(() => { + if (referenceEl) referenceRef.current = referenceEl; + if (floatingEl) floatingRef.current = floatingEl; + if (referenceEl && floatingEl) { + if (whileElementsMountedRef.current) { + return whileElementsMountedRef.current(referenceEl, floatingEl, update); + } else { + update(); + } + } + }, [referenceEl, floatingEl, update, whileElementsMountedRef]); + const refs = React.useMemo(() => ({ + reference: referenceRef, + floating: floatingRef, + setReference, + setFloating + }), [setReference, setFloating]); + const elements = React.useMemo(() => ({ + reference: referenceEl, + floating: floatingEl + }), [referenceEl, floatingEl]); + const floatingStyles = React.useMemo(() => { + const initialStyles = { + position: strategy, + left: 0, + top: 0 + }; + if (!elements.floating) { + return initialStyles; + } + const x = roundByDPR(elements.floating, data.x); + const y = roundByDPR(elements.floating, data.y); + if (transform) { + return { + ...initialStyles, + transform: "translate(" + x + "px, " + y + "px)", + ...(getDPR(elements.floating) >= 1.5 && { + willChange: 'transform' + }) + }; + } + return { + position: strategy, + left: x, + top: y + }; + }, [strategy, transform, elements.floating, data.x, data.y]); + return React.useMemo(() => ({ + ...data, + update, + refs, + elements, + floatingStyles + }), [data, update, refs, elements, floatingStyles]); +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/animation/dist/Animation.es.js": +/*!***********************************************************************!*\ + !*** ../../../node_modules/@motionone/animation/dist/Animation.es.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Animation = void 0; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _easingEs = __webpack_require__(/*! ./utils/easing.es.js */ "../../../node_modules/@motionone/animation/dist/utils/easing.es.js"); +class Animation { + constructor(output) { + let keyframes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 1]; + let { + easing, + duration: initialDuration = _utils.defaults.duration, + delay = _utils.defaults.delay, + endDelay = _utils.defaults.endDelay, + repeat = _utils.defaults.repeat, + offset, + direction = "normal" + } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + this.startTime = null; + this.rate = 1; + this.t = 0; + this.cancelTimestamp = null; + this.easing = _utils.noopReturn; + this.duration = 0; + this.totalDuration = 0; + this.repeat = 0; + this.playState = "idle"; + this.finished = new Promise((resolve, reject) => { + this.resolve = resolve; + this.reject = reject; + }); + easing = easing || _utils.defaults.easing; + if ((0, _utils.isEasingGenerator)(easing)) { + const custom = easing.createAnimation(keyframes); + easing = custom.easing; + keyframes = custom.keyframes || keyframes; + initialDuration = custom.duration || initialDuration; + } + this.repeat = repeat; + this.easing = (0, _utils.isEasingList)(easing) ? _utils.noopReturn : (0, _easingEs.getEasingFunction)(easing); + this.updateDuration(initialDuration); + const interpolate$1 = (0, _utils.interpolate)(keyframes, offset, (0, _utils.isEasingList)(easing) ? easing.map(_easingEs.getEasingFunction) : _utils.noopReturn); + this.tick = timestamp => { + var _a; + // TODO: Temporary fix for OptionsResolver typing + delay = delay; + let t = 0; + if (this.pauseTime !== undefined) { + t = this.pauseTime; + } else { + t = (timestamp - this.startTime) * this.rate; + } + this.t = t; + // Convert to seconds + t /= 1000; + // Rebase on delay + t = Math.max(t - delay, 0); + /** + * If this animation has finished, set the current time + * to the total duration. + */ + if (this.playState === "finished" && this.pauseTime === undefined) { + t = this.totalDuration; + } + /** + * Get the current progress (0-1) of the animation. If t is > + * than duration we'll get values like 2.5 (midway through the + * third iteration) + */ + const progress = t / this.duration; + // TODO progress += iterationStart + /** + * Get the current iteration (0 indexed). For instance the floor of + * 2.5 is 2. + */ + let currentIteration = Math.floor(progress); + /** + * Get the current progress of the iteration by taking the remainder + * so 2.5 is 0.5 through iteration 2 + */ + let iterationProgress = progress % 1.0; + if (!iterationProgress && progress >= 1) { + iterationProgress = 1; + } + /** + * If iteration progress is 1 we count that as the end + * of the previous iteration. + */ + iterationProgress === 1 && currentIteration--; + /** + * Reverse progress if we're not running in "normal" direction + */ + const iterationIsOdd = currentIteration % 2; + if (direction === "reverse" || direction === "alternate" && iterationIsOdd || direction === "alternate-reverse" && !iterationIsOdd) { + iterationProgress = 1 - iterationProgress; + } + const p = t >= this.totalDuration ? 1 : Math.min(iterationProgress, 1); + const latest = interpolate$1(this.easing(p)); + output(latest); + const isAnimationFinished = this.pauseTime === undefined && (this.playState === "finished" || t >= this.totalDuration + endDelay); + if (isAnimationFinished) { + this.playState = "finished"; + (_a = this.resolve) === null || _a === void 0 ? void 0 : _a.call(this, latest); + } else if (this.playState !== "idle") { + this.frameRequestId = requestAnimationFrame(this.tick); + } + }; + this.play(); + } + play() { + const now = performance.now(); + this.playState = "running"; + if (this.pauseTime !== undefined) { + this.startTime = now - this.pauseTime; + } else if (!this.startTime) { + this.startTime = now; + } + this.cancelTimestamp = this.startTime; + this.pauseTime = undefined; + this.frameRequestId = requestAnimationFrame(this.tick); + } + pause() { + this.playState = "paused"; + this.pauseTime = this.t; + } + finish() { + this.playState = "finished"; + this.tick(0); + } + stop() { + var _a; + this.playState = "idle"; + if (this.frameRequestId !== undefined) { + cancelAnimationFrame(this.frameRequestId); + } + (_a = this.reject) === null || _a === void 0 ? void 0 : _a.call(this, false); + } + cancel() { + this.stop(); + this.tick(this.cancelTimestamp); + } + reverse() { + this.rate *= -1; + } + commitStyles() {} + updateDuration(duration) { + this.duration = duration; + this.totalDuration = duration * (this.repeat + 1); + } + get currentTime() { + return this.t; + } + set currentTime(t) { + if (this.pauseTime !== undefined || this.rate === 0) { + this.pauseTime = t; + } else { + this.startTime = performance.now() - t / this.rate; + } + } + get playbackRate() { + return this.rate; + } + set playbackRate(rate) { + this.rate = rate; + } +} +exports.Animation = Animation; + +/***/ }), + +/***/ "../../../node_modules/@motionone/animation/dist/index.es.js": +/*!*******************************************************************!*\ + !*** ../../../node_modules/@motionone/animation/dist/index.es.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "Animation", ({ + enumerable: true, + get: function () { + return _AnimationEs.Animation; + } +})); +Object.defineProperty(exports, "getEasingFunction", ({ + enumerable: true, + get: function () { + return _easingEs.getEasingFunction; + } +})); +var _AnimationEs = __webpack_require__(/*! ./Animation.es.js */ "../../../node_modules/@motionone/animation/dist/Animation.es.js"); +var _easingEs = __webpack_require__(/*! ./utils/easing.es.js */ "../../../node_modules/@motionone/animation/dist/utils/easing.es.js"); + +/***/ }), + +/***/ "../../../node_modules/@motionone/animation/dist/utils/easing.es.js": +/*!**************************************************************************!*\ + !*** ../../../node_modules/@motionone/animation/dist/utils/easing.es.js ***! + \**************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getEasingFunction = getEasingFunction; +var _easing = __webpack_require__(/*! @motionone/easing */ "../../../node_modules/@motionone/easing/dist/index.es.js"); +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +const namedEasings = { + ease: (0, _easing.cubicBezier)(0.25, 0.1, 0.25, 1.0), + "ease-in": (0, _easing.cubicBezier)(0.42, 0.0, 1.0, 1.0), + "ease-in-out": (0, _easing.cubicBezier)(0.42, 0.0, 0.58, 1.0), + "ease-out": (0, _easing.cubicBezier)(0.0, 0.0, 0.58, 1.0) +}; +const functionArgsRegex = /\((.*?)\)/; +function getEasingFunction(definition) { + // If already an easing function, return + if ((0, _utils.isFunction)(definition)) return definition; + // If an easing curve definition, return bezier function + if ((0, _utils.isCubicBezier)(definition)) return (0, _easing.cubicBezier)(...definition); + // If we have a predefined easing function, return + if (namedEasings[definition]) return namedEasings[definition]; + // If this is a steps function, attempt to create easing curve + if (definition.startsWith("steps")) { + const args = functionArgsRegex.exec(definition); + if (args) { + const argsArray = args[1].split(","); + return (0, _easing.steps)(parseFloat(argsArray[0]), argsArray[1].trim()); + } + } + return _utils.noopReturn; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/animate-style.es.js": +/*!*****************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/animate-style.es.js ***! + \*****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.animateStyle = animateStyle; +var _dataEs = __webpack_require__(/*! ./data.es.js */ "../../../node_modules/@motionone/dom/dist/animate/data.es.js"); +var _cssVarEs = __webpack_require__(/*! ./utils/css-var.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/css-var.es.js"); +var _animation = __webpack_require__(/*! @motionone/animation */ "../../../node_modules/@motionone/animation/dist/index.es.js"); +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _transformsEs = __webpack_require__(/*! ./utils/transforms.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js"); +var _easingEs = __webpack_require__(/*! ./utils/easing.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/easing.es.js"); +var _featureDetectionEs = __webpack_require__(/*! ./utils/feature-detection.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/feature-detection.es.js"); +var _keyframesEs = __webpack_require__(/*! ./utils/keyframes.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/keyframes.es.js"); +var _styleEs = __webpack_require__(/*! ./style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/style.es.js"); +var _getStyleNameEs = __webpack_require__(/*! ./utils/get-style-name.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/get-style-name.es.js"); +var _stopAnimationEs = __webpack_require__(/*! ./utils/stop-animation.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/stop-animation.es.js"); +function getDevToolsRecord() { + return window.__MOTION_DEV_TOOLS_RECORD; +} +function animateStyle(element, key, keyframesDefinition) { + let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + const record = getDevToolsRecord(); + const isRecording = options.record !== false && record; + let animation; + let { + duration = _utils.defaults.duration, + delay = _utils.defaults.delay, + endDelay = _utils.defaults.endDelay, + repeat = _utils.defaults.repeat, + easing = _utils.defaults.easing, + direction, + offset, + allowWebkitAcceleration = false + } = options; + const data = (0, _dataEs.getAnimationData)(element); + let canAnimateNatively = _featureDetectionEs.supports.waapi(); + const valueIsTransform = (0, _transformsEs.isTransform)(key); + /** + * If this is an individual transform, we need to map its + * key to a CSS variable and update the element's transform style + */ + valueIsTransform && (0, _transformsEs.addTransformToElement)(element, key); + const name = (0, _getStyleNameEs.getStyleName)(key); + const motionValue = (0, _dataEs.getMotionValue)(data.values, name); + /** + * Get definition of value, this will be used to convert numerical + * keyframes into the default value type. + */ + const definition = _transformsEs.transformDefinitions.get(name); + /** + * Stop the current animation, if any. Because this will trigger + * commitStyles (DOM writes) and we might later trigger DOM reads, + * this is fired now and we return a factory function to create + * the actual animation that can get called in batch, + */ + (0, _stopAnimationEs.stopAnimation)(motionValue.animation, !((0, _utils.isEasingGenerator)(easing) && motionValue.generator) && options.record !== false); + /** + * Batchable factory function containing all DOM reads. + */ + return () => { + const readInitialValue = () => { + var _a, _b; + return (_b = (_a = _styleEs.style.get(element, name)) !== null && _a !== void 0 ? _a : definition === null || definition === void 0 ? void 0 : definition.initialValue) !== null && _b !== void 0 ? _b : 0; + }; + /** + * Replace null values with the previous keyframe value, or read + * it from the DOM if it's the first keyframe. + */ + let keyframes = (0, _keyframesEs.hydrateKeyframes)((0, _keyframesEs.keyframesList)(keyframesDefinition), readInitialValue); + if ((0, _utils.isEasingGenerator)(easing)) { + const custom = easing.createAnimation(keyframes, readInitialValue, valueIsTransform, name, motionValue); + easing = custom.easing; + if (custom.keyframes !== undefined) keyframes = custom.keyframes; + if (custom.duration !== undefined) duration = custom.duration; + } + /** + * If this is a CSS variable we need to register it with the browser + * before it can be animated natively. We also set it with setProperty + * rather than directly onto the element.style object. + */ + if ((0, _cssVarEs.isCssVar)(name)) { + if (_featureDetectionEs.supports.cssRegisterProperty()) { + (0, _cssVarEs.registerCssVariable)(name); + } else { + canAnimateNatively = false; + } + } + /** + * If we can animate this value with WAAPI, do so. Currently this only + * feature detects CSS.registerProperty but could check WAAPI too. + */ + if (canAnimateNatively) { + /** + * Convert numbers to default value types. Currently this only supports + * transforms but it could also support other value types. + */ + if (definition) { + keyframes = keyframes.map(value => (0, _utils.isNumber)(value) ? definition.toDefaultUnit(value) : value); + } + /** + * If this browser doesn't support partial/implicit keyframes we need to + * explicitly provide one. + */ + if (keyframes.length === 1 && (!_featureDetectionEs.supports.partialKeyframes() || isRecording)) { + keyframes.unshift(readInitialValue()); + } + const animationOptions = { + delay: _utils.time.ms(delay), + duration: _utils.time.ms(duration), + endDelay: _utils.time.ms(endDelay), + easing: !(0, _utils.isEasingList)(easing) ? (0, _easingEs.convertEasing)(easing) : undefined, + direction, + iterations: repeat + 1, + fill: "both" + }; + animation = element.animate({ + [name]: keyframes, + offset, + easing: (0, _utils.isEasingList)(easing) ? easing.map(_easingEs.convertEasing) : undefined + }, animationOptions); + /** + * Polyfill finished Promise in browsers that don't support it + */ + if (!animation.finished) { + animation.finished = new Promise((resolve, reject) => { + animation.onfinish = resolve; + animation.oncancel = reject; + }); + } + const target = keyframes[keyframes.length - 1]; + animation.finished.then(() => { + // Apply styles to target + _styleEs.style.set(element, name, target); + // Ensure fill modes don't persist + animation.cancel(); + }).catch(_utils.noop); + /** + * This forces Webkit to run animations on the main thread by exploiting + * this condition: + * https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp?rev=281238#L1099 + * + * This fixes Webkit's timing bugs, like accelerated animations falling + * out of sync with main thread animations and massive delays in starting + * accelerated animations in WKWebView. + */ + if (!allowWebkitAcceleration) animation.playbackRate = 1.000001; + /** + * If we can't animate the value natively then we can fallback to the numbers-only + * polyfill for transforms. + */ + } else if (valueIsTransform) { + /** + * If any keyframe is a string (because we measured it from the DOM), we need to convert + * it into a number before passing to the Animation polyfill. + */ + keyframes = keyframes.map(value => typeof value === "string" ? parseFloat(value) : value); + /** + * If we only have a single keyframe, we need to create an initial keyframe by reading + * the current value from the DOM. + */ + if (keyframes.length === 1) { + keyframes.unshift(parseFloat(readInitialValue())); + } + const render = latest => { + if (definition) latest = definition.toDefaultUnit(latest); + _styleEs.style.set(element, name, latest); + }; + animation = new _animation.Animation(render, keyframes, Object.assign(Object.assign({}, options), { + duration, + easing + })); + } else { + const target = keyframes[keyframes.length - 1]; + _styleEs.style.set(element, name, definition && (0, _utils.isNumber)(target) ? definition.toDefaultUnit(target) : target); + } + if (isRecording) { + record(element, key, keyframes, { + duration, + delay: delay, + easing, + repeat, + offset + }, "motion-one"); + } + motionValue.setAnimation(animation); + return animation; + }; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/data.es.js": +/*!********************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/data.es.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getAnimationData = getAnimationData; +exports.getMotionValue = getMotionValue; +var _types = __webpack_require__(/*! @motionone/types */ "../../../node_modules/@motionone/types/dist/index.es.js"); +const data = new WeakMap(); +function getAnimationData(element) { + if (!data.has(element)) { + data.set(element, { + transforms: [], + values: new Map() + }); + } + return data.get(element); +} +function getMotionValue(motionValues, name) { + if (!motionValues.has(name)) { + motionValues.set(name, new _types.MotionValue()); + } + return motionValues.get(name); +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/index.es.js": +/*!*********************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/index.es.js ***! + \*********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.animate = animate; +var _animateStyleEs = __webpack_require__(/*! ./animate-style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/animate-style.es.js"); +var _optionsEs = __webpack_require__(/*! ./utils/options.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/options.es.js"); +var _resolveElementsEs = __webpack_require__(/*! ../utils/resolve-elements.es.js */ "../../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js"); +var _controlsEs = __webpack_require__(/*! ./utils/controls.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/controls.es.js"); +var _staggerEs = __webpack_require__(/*! ../utils/stagger.es.js */ "../../../node_modules/@motionone/dom/dist/utils/stagger.es.js"); +function animate(elements, keyframes) { + let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + elements = (0, _resolveElementsEs.resolveElements)(elements); + const numElements = elements.length; + /** + * Create and start new animations + */ + const animationFactories = []; + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + for (const key in keyframes) { + const valueOptions = (0, _optionsEs.getOptions)(options, key); + valueOptions.delay = (0, _staggerEs.resolveOption)(valueOptions.delay, i, numElements); + const animation = (0, _animateStyleEs.animateStyle)(element, key, keyframes[key], valueOptions); + animationFactories.push(animation); + } + } + return (0, _controlsEs.withControls)(animationFactories, options, + /** + * TODO: + * If easing is set to spring or glide, duration will be dynamically + * generated. Ideally we would dynamically generate this from + * animation.effect.getComputedTiming().duration but this isn't + * supported in iOS13 or our number polyfill. Perhaps it's possible + * to Proxy animations returned from animateStyle that has duration + * as a getter. + */ + options.duration); +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/style.es.js": +/*!*********************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/style.es.js ***! + \*********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.style = void 0; +var _cssVarEs = __webpack_require__(/*! ./utils/css-var.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/css-var.es.js"); +var _getStyleNameEs = __webpack_require__(/*! ./utils/get-style-name.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/get-style-name.es.js"); +var _transformsEs = __webpack_require__(/*! ./utils/transforms.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js"); +const style = { + get: (element, name) => { + name = (0, _getStyleNameEs.getStyleName)(name); + let value = (0, _cssVarEs.isCssVar)(name) ? element.style.getPropertyValue(name) : getComputedStyle(element)[name]; + if (!value && value !== 0) { + const definition = _transformsEs.transformDefinitions.get(name); + if (definition) value = definition.initialValue; + } + return value; + }, + set: (element, name, value) => { + name = (0, _getStyleNameEs.getStyleName)(name); + if ((0, _cssVarEs.isCssVar)(name)) { + element.style.setProperty(name, value); + } else { + element.style[name] = value; + } + } +}; +exports.style = style; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/utils/controls.es.js": +/*!******************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/utils/controls.es.js ***! + \******************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.withControls = exports.controls = void 0; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _stopAnimationEs = __webpack_require__(/*! ./stop-animation.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/stop-animation.es.js"); +const createAnimation = factory => factory(); +const withControls = function (animationFactory, options) { + let duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _utils.defaults.duration; + return new Proxy({ + animations: animationFactory.map(createAnimation).filter(Boolean), + duration, + options + }, controls); +}; +/** + * TODO: + * Currently this returns the first animation, ideally it would return + * the first active animation. + */ +exports.withControls = withControls; +const getActiveAnimation = state => state.animations[0]; +const controls = { + get: (target, key) => { + const activeAnimation = getActiveAnimation(target); + switch (key) { + case "duration": + return target.duration; + case "currentTime": + return _utils.time.s((activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]) || 0); + case "playbackRate": + case "playState": + return activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]; + case "finished": + if (!target.finished) { + target.finished = Promise.all(target.animations.map(selectFinished)).catch(_utils.noop); + } + return target.finished; + case "stop": + return () => { + target.animations.forEach(animation => (0, _stopAnimationEs.stopAnimation)(animation)); + }; + case "forEachNative": + /** + * This is for internal use only, fire a callback for each + * underlying animation. + */ + return callback => { + target.animations.forEach(animation => callback(animation, target)); + }; + default: + return typeof (activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]) === "undefined" ? undefined : () => target.animations.forEach(animation => animation[key]()); + } + }, + set: (target, key, value) => { + switch (key) { + case "currentTime": + value = _utils.time.ms(value); + case "currentTime": + case "playbackRate": + for (let i = 0; i < target.animations.length; i++) { + target.animations[i][key] = value; + } + return true; + } + return false; + } +}; +exports.controls = controls; +const selectFinished = animation => animation.finished; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/utils/css-var.es.js": +/*!*****************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/utils/css-var.es.js ***! + \*****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isCssVar = void 0; +exports.registerCssVariable = registerCssVariable; +exports.registeredProperties = void 0; +var _transformsEs = __webpack_require__(/*! ./transforms.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js"); +const isCssVar = name => name.startsWith("--"); +exports.isCssVar = isCssVar; +const registeredProperties = new Set(); +exports.registeredProperties = registeredProperties; +function registerCssVariable(name) { + if (registeredProperties.has(name)) return; + registeredProperties.add(name); + try { + const { + syntax, + initialValue + } = _transformsEs.transformDefinitions.has(name) ? _transformsEs.transformDefinitions.get(name) : {}; + CSS.registerProperty({ + name, + inherits: false, + syntax, + initialValue + }); + } catch (e) {} +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/utils/easing.es.js": +/*!****************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/utils/easing.es.js ***! + \****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.cubicBezierAsString = exports.convertEasing = void 0; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +const convertEasing = easing => (0, _utils.isCubicBezier)(easing) ? cubicBezierAsString(easing) : easing; +exports.convertEasing = convertEasing; +const cubicBezierAsString = _ref => { + let [a, b, c, d] = _ref; + return `cubic-bezier(${a}, ${b}, ${c}, ${d})`; +}; +exports.cubicBezierAsString = cubicBezierAsString; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/utils/feature-detection.es.js": +/*!***************************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/utils/feature-detection.es.js ***! + \***************************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.supports = void 0; +const testAnimation = keyframes => document.createElement("div").animate(keyframes, { + duration: 0.001 +}); +const featureTests = { + cssRegisterProperty: () => typeof CSS !== "undefined" && Object.hasOwnProperty.call(CSS, "registerProperty"), + waapi: () => Object.hasOwnProperty.call(Element.prototype, "animate"), + partialKeyframes: () => { + try { + testAnimation({ + opacity: [1] + }); + } catch (e) { + return false; + } + return true; + }, + finished: () => Boolean(testAnimation({ + opacity: [0, 1] + }).finished) +}; +const results = {}; +const supports = {}; +exports.supports = supports; +for (const key in featureTests) { + supports[key] = () => { + if (results[key] === undefined) results[key] = featureTests[key](); + return results[key]; + }; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/utils/get-style-name.es.js": +/*!************************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/utils/get-style-name.es.js ***! + \************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getStyleName = getStyleName; +var _transformsEs = __webpack_require__(/*! ./transforms.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js"); +function getStyleName(key) { + if (_transformsEs.transformAlias[key]) key = _transformsEs.transformAlias[key]; + return (0, _transformsEs.isTransform)(key) ? (0, _transformsEs.asTransformCssVar)(key) : key; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/utils/keyframes.es.js": +/*!*******************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/utils/keyframes.es.js ***! + \*******************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.hydrateKeyframes = hydrateKeyframes; +exports.keyframesList = void 0; +function hydrateKeyframes(keyframes, readInitialValue) { + for (let i = 0; i < keyframes.length; i++) { + if (keyframes[i] === null) { + keyframes[i] = i ? keyframes[i - 1] : readInitialValue(); + } + } + return keyframes; +} +const keyframesList = keyframes => Array.isArray(keyframes) ? keyframes : [keyframes]; +exports.keyframesList = keyframesList; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/utils/options.es.js": +/*!*****************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/utils/options.es.js ***! + \*****************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getOptions = void 0; +const getOptions = (options, key) => +/** + * TODO: Make test for this + * Always return a new object otherwise delay is overwritten by results of stagger + * and this results in no stagger + */ +options[key] ? Object.assign(Object.assign({}, options), options[key]) : Object.assign({}, options); +exports.getOptions = getOptions; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/utils/stop-animation.es.js": +/*!************************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/utils/stop-animation.es.js ***! + \************************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.stopAnimation = stopAnimation; +function stopAnimation(animation) { + let needsCommit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + if (!animation || animation.playState === "finished") return; + // Suppress error thrown by WAAPI + try { + if (animation.stop) { + animation.stop(); + } else { + needsCommit && animation.commitStyles(); + animation.cancel(); + } + } catch (e) {} +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/utils/style-object.es.js": +/*!**********************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/utils/style-object.es.js ***! + \**********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createStyles = createStyles; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _transformsEs = __webpack_require__(/*! ./transforms.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js"); +function createStyles(keyframes) { + const initialKeyframes = {}; + const transformKeys = []; + for (let key in keyframes) { + const value = keyframes[key]; + if ((0, _transformsEs.isTransform)(key)) { + if (_transformsEs.transformAlias[key]) key = _transformsEs.transformAlias[key]; + transformKeys.push(key); + key = (0, _transformsEs.asTransformCssVar)(key); + } + let initialKeyframe = Array.isArray(value) ? value[0] : value; + /** + * If this is a number and we have a default value type, convert the number + * to this type. + */ + const definition = _transformsEs.transformDefinitions.get(key); + if (definition) { + initialKeyframe = (0, _utils.isNumber)(value) ? definition.toDefaultUnit(value) : value; + } + initialKeyframes[key] = initialKeyframe; + } + if (transformKeys.length) { + initialKeyframes.transform = (0, _transformsEs.buildTransformTemplate)(transformKeys); + } + return initialKeyframes; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/utils/style-string.es.js": +/*!**********************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/utils/style-string.es.js ***! + \**********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createStyleString = createStyleString; +var _styleObjectEs = __webpack_require__(/*! ./style-object.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/style-object.es.js"); +const camelLetterToPipeLetter = letter => `-${letter.toLowerCase()}`; +const camelToPipeCase = str => str.replace(/[A-Z]/g, camelLetterToPipeLetter); +function createStyleString() { + let target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const styles = (0, _styleObjectEs.createStyles)(target); + let style = ""; + for (const key in styles) { + style += key.startsWith("--") ? key : camelToPipeCase(key); + style += `: ${styles[key]}; `; + } + return style; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js": +/*!********************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js ***! + \********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.transformDefinitions = exports.transformAlias = exports.isTransform = exports.compareTransformOrder = exports.buildTransformTemplate = exports.axes = exports.asTransformCssVar = exports.addTransformToElement = void 0; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _dataEs = __webpack_require__(/*! ../data.es.js */ "../../../node_modules/@motionone/dom/dist/animate/data.es.js"); +/** + * A list of all transformable axes. We'll use this list to generated a version + * of each axes for each transform. + */ +const axes = ["", "X", "Y", "Z"]; +/** + * An ordered array of each transformable value. By default, transform values + * will be sorted to this order. + */ +exports.axes = axes; +const order = ["translate", "scale", "rotate", "skew"]; +const transformAlias = { + x: "translateX", + y: "translateY", + z: "translateZ" +}; +exports.transformAlias = transformAlias; +const rotation = { + syntax: "", + initialValue: "0deg", + toDefaultUnit: v => v + "deg" +}; +const baseTransformProperties = { + translate: { + syntax: "", + initialValue: "0px", + toDefaultUnit: v => v + "px" + }, + rotate: rotation, + scale: { + syntax: "", + initialValue: 1, + toDefaultUnit: _utils.noopReturn + }, + skew: rotation +}; +const transformDefinitions = new Map(); +exports.transformDefinitions = transformDefinitions; +const asTransformCssVar = name => `--motion-${name}`; +/** + * Generate a list of every possible transform key + */ +exports.asTransformCssVar = asTransformCssVar; +const transforms = ["x", "y", "z"]; +order.forEach(name => { + axes.forEach(axis => { + transforms.push(name + axis); + transformDefinitions.set(asTransformCssVar(name + axis), baseTransformProperties[name]); + }); +}); +/** + * A function to use with Array.sort to sort transform keys by their default order. + */ +const compareTransformOrder = (a, b) => transforms.indexOf(a) - transforms.indexOf(b); +/** + * Provide a quick way to check if a string is the name of a transform + */ +exports.compareTransformOrder = compareTransformOrder; +const transformLookup = new Set(transforms); +const isTransform = name => transformLookup.has(name); +exports.isTransform = isTransform; +const addTransformToElement = (element, name) => { + // Map x to translateX etc + if (transformAlias[name]) name = transformAlias[name]; + const { + transforms + } = (0, _dataEs.getAnimationData)(element); + (0, _utils.addUniqueItem)(transforms, name); + /** + * TODO: An optimisation here could be to cache the transform in element data + * and only update if this has changed. + */ + element.style.transform = buildTransformTemplate(transforms); +}; +exports.addTransformToElement = addTransformToElement; +const buildTransformTemplate = transforms => transforms.sort(compareTransformOrder).reduce(transformListToString, "").trim(); +exports.buildTransformTemplate = buildTransformTemplate; +const transformListToString = (template, name) => `${template} ${name}(var(${asTransformCssVar(name)}))`; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/easing/create-generator-easing.es.js": +/*!**************************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/easing/create-generator-easing.es.js ***! + \**************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createGeneratorEasing = createGeneratorEasing; +var _generators = __webpack_require__(/*! @motionone/generators */ "../../../node_modules/@motionone/generators/dist/index.es.js"); +function createGeneratorEasing(createGenerator) { + const keyframesCache = new WeakMap(); + return function () { + let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const generatorCache = new Map(); + const getGenerator = function () { + let from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100; + let velocity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + let isScale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + const key = `${from}-${to}-${velocity}-${isScale}`; + if (!generatorCache.has(key)) { + generatorCache.set(key, createGenerator(Object.assign({ + from, + to, + velocity, + restSpeed: isScale ? 0.05 : 2, + restDistance: isScale ? 0.01 : 0.5 + }, options))); + } + return generatorCache.get(key); + }; + const getKeyframes = generator => { + if (!keyframesCache.has(generator)) { + keyframesCache.set(generator, (0, _generators.pregenerateKeyframes)(generator)); + } + return keyframesCache.get(generator); + }; + return { + createAnimation: (keyframes, getOrigin, canUseGenerator, name, motionValue) => { + var _a, _b; + let settings; + const numKeyframes = keyframes.length; + let shouldUseGenerator = canUseGenerator && numKeyframes <= 2 && keyframes.every(isNumberOrNull); + if (shouldUseGenerator) { + const target = keyframes[numKeyframes - 1]; + const unresolvedOrigin = numKeyframes === 1 ? null : keyframes[0]; + let velocity = 0; + let origin = 0; + const prevGenerator = motionValue === null || motionValue === void 0 ? void 0 : motionValue.generator; + if (prevGenerator) { + /** + * If we have a generator for this value we can use it to resolve + * the animations's current value and velocity. + */ + const { + animation, + generatorStartTime + } = motionValue; + const startTime = (animation === null || animation === void 0 ? void 0 : animation.startTime) || generatorStartTime || 0; + const currentTime = (animation === null || animation === void 0 ? void 0 : animation.currentTime) || performance.now() - startTime; + const prevGeneratorCurrent = prevGenerator(currentTime).current; + origin = (_a = unresolvedOrigin) !== null && _a !== void 0 ? _a : prevGeneratorCurrent; + if (numKeyframes === 1 || numKeyframes === 2 && keyframes[0] === null) { + velocity = (0, _generators.calcGeneratorVelocity)(t => prevGenerator(t).current, currentTime, prevGeneratorCurrent); + } + } else { + origin = (_b = unresolvedOrigin) !== null && _b !== void 0 ? _b : parseFloat(getOrigin()); + } + const generator = getGenerator(origin, target, velocity, name === null || name === void 0 ? void 0 : name.includes("scale")); + const keyframesMetadata = getKeyframes(generator); + settings = Object.assign(Object.assign({}, keyframesMetadata), { + easing: "linear" + }); + // TODO Add test for this + if (motionValue) { + motionValue.generator = generator; + motionValue.generatorStartTime = performance.now(); + } + } else { + const keyframesMetadata = getKeyframes(getGenerator(0, 100)); + settings = { + easing: "ease", + duration: keyframesMetadata.overshootDuration + }; + } + return settings; + } + }; + }; +} +const isNumberOrNull = value => typeof value !== "string"; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/easing/glide/index.es.js": +/*!**************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/easing/glide/index.es.js ***! + \**************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.glide = void 0; +var _generators = __webpack_require__(/*! @motionone/generators */ "../../../node_modules/@motionone/generators/dist/index.es.js"); +var _createGeneratorEasingEs = __webpack_require__(/*! ../create-generator-easing.es.js */ "../../../node_modules/@motionone/dom/dist/easing/create-generator-easing.es.js"); +const glide = (0, _createGeneratorEasingEs.createGeneratorEasing)(_generators.glide); +exports.glide = glide; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/easing/spring/index.es.js": +/*!***************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/easing/spring/index.es.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.spring = void 0; +var _generators = __webpack_require__(/*! @motionone/generators */ "../../../node_modules/@motionone/generators/dist/index.es.js"); +var _createGeneratorEasingEs = __webpack_require__(/*! ../create-generator-easing.es.js */ "../../../node_modules/@motionone/dom/dist/easing/create-generator-easing.es.js"); +const spring = (0, _createGeneratorEasingEs.createGeneratorEasing)(_generators.spring); +exports.spring = spring; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/gestures/in-view.es.js": +/*!************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/gestures/in-view.es.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.inView = inView; +var _resolveElementsEs = __webpack_require__(/*! ../utils/resolve-elements.es.js */ "../../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js"); +const thresholds = { + any: 0, + all: 1 +}; +function inView(elementOrSelector, onStart) { + let { + root, + margin: rootMargin, + amount = "any" + } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + /** + * If this browser doesn't support IntersectionObserver, return a dummy stop function. + * Default triggering of onStart is tricky - it could be used for starting/stopping + * videos, lazy loading content etc. We could provide an option to enable a fallback, or + * provide a fallback callback option. + */ + if (typeof IntersectionObserver === "undefined") { + return () => {}; + } + const elements = (0, _resolveElementsEs.resolveElements)(elementOrSelector); + const activeIntersections = new WeakMap(); + const onIntersectionChange = entries => { + entries.forEach(entry => { + const onEnd = activeIntersections.get(entry.target); + /** + * If there's no change to the intersection, we don't need to + * do anything here. + */ + if (entry.isIntersecting === Boolean(onEnd)) return; + if (entry.isIntersecting) { + const newOnEnd = onStart(entry); + if (typeof newOnEnd === "function") { + activeIntersections.set(entry.target, newOnEnd); + } else { + observer.unobserve(entry.target); + } + } else if (onEnd) { + onEnd(entry); + activeIntersections.delete(entry.target); + } + }); + }; + const observer = new IntersectionObserver(onIntersectionChange, { + root, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholds[amount] + }); + elements.forEach(element => observer.observe(element)); + return () => observer.disconnect(); +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/gestures/resize/handle-element.es.js": +/*!**************************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/gestures/resize/handle-element.es.js ***! + \**************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.resizeElement = resizeElement; +var _resolveElementsEs = __webpack_require__(/*! ../../utils/resolve-elements.es.js */ "../../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js"); +const resizeHandlers = new WeakMap(); +let observer; +function getElementSize(target, borderBoxSize) { + if (borderBoxSize) { + const { + inlineSize, + blockSize + } = borderBoxSize[0]; + return { + width: inlineSize, + height: blockSize + }; + } else if (target instanceof SVGElement && "getBBox" in target) { + return target.getBBox(); + } else { + return { + width: target.offsetWidth, + height: target.offsetHeight + }; + } +} +function notifyTarget(_ref) { + let { + target, + contentRect, + borderBoxSize + } = _ref; + var _a; + (_a = resizeHandlers.get(target)) === null || _a === void 0 ? void 0 : _a.forEach(handler => { + handler({ + target, + contentSize: contentRect, + get size() { + return getElementSize(target, borderBoxSize); + } + }); + }); +} +function notifyAll(entries) { + entries.forEach(notifyTarget); +} +function createResizeObserver() { + if (typeof ResizeObserver === "undefined") return; + observer = new ResizeObserver(notifyAll); +} +function resizeElement(target, handler) { + if (!observer) createResizeObserver(); + const elements = (0, _resolveElementsEs.resolveElements)(target); + elements.forEach(element => { + let elementHandlers = resizeHandlers.get(element); + if (!elementHandlers) { + elementHandlers = new Set(); + resizeHandlers.set(element, elementHandlers); + } + elementHandlers.add(handler); + observer === null || observer === void 0 ? void 0 : observer.observe(element); + }); + return () => { + elements.forEach(element => { + const elementHandlers = resizeHandlers.get(element); + elementHandlers === null || elementHandlers === void 0 ? void 0 : elementHandlers.delete(handler); + if (!(elementHandlers === null || elementHandlers === void 0 ? void 0 : elementHandlers.size)) { + observer === null || observer === void 0 ? void 0 : observer.unobserve(element); + } + }); + }; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/gestures/resize/handle-window.es.js": +/*!*************************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/gestures/resize/handle-window.es.js ***! + \*************************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.resizeWindow = resizeWindow; +const windowCallbacks = new Set(); +let windowResizeHandler; +function createWindowResizeHandler() { + windowResizeHandler = () => { + const size = { + width: window.innerWidth, + height: window.innerHeight + }; + const info = { + target: window, + size, + contentSize: size + }; + windowCallbacks.forEach(callback => callback(info)); + }; + window.addEventListener("resize", windowResizeHandler); +} +function resizeWindow(callback) { + windowCallbacks.add(callback); + if (!windowResizeHandler) createWindowResizeHandler(); + return () => { + windowCallbacks.delete(callback); + if (!windowCallbacks.size && windowResizeHandler) { + windowResizeHandler = undefined; + } + }; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/gestures/resize/index.es.js": +/*!*****************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/gestures/resize/index.es.js ***! + \*****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.resize = resize; +var _handleElementEs = __webpack_require__(/*! ./handle-element.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/resize/handle-element.es.js"); +var _handleWindowEs = __webpack_require__(/*! ./handle-window.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/resize/handle-window.es.js"); +function resize(a, b) { + return typeof a === "function" ? (0, _handleWindowEs.resizeWindow)(a) : (0, _handleElementEs.resizeElement)(a, b); +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/index.es.js": +/*!*****************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/index.es.js ***! + \*****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.scroll = scroll; +var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js"); +var _indexEs = __webpack_require__(/*! ../resize/index.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/resize/index.es.js"); +var _infoEs = __webpack_require__(/*! ./info.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/info.es.js"); +var _onScrollHandlerEs = __webpack_require__(/*! ./on-scroll-handler.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/on-scroll-handler.es.js"); +const scrollListeners = new WeakMap(); +const resizeListeners = new WeakMap(); +const onScrollHandlers = new WeakMap(); +const getEventTarget = element => element === document.documentElement ? window : element; +function scroll(onScroll) { + let _a = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var { + container = document.documentElement + } = _a, + options = (0, _tslib.__rest)(_a, ["container"]); + let containerHandlers = onScrollHandlers.get(container); + /** + * Get the onScroll handlers for this container. + * If one isn't found, create a new one. + */ + if (!containerHandlers) { + containerHandlers = new Set(); + onScrollHandlers.set(container, containerHandlers); + } + /** + * Create a new onScroll handler for the provided callback. + */ + const info = (0, _infoEs.createScrollInfo)(); + const containerHandler = (0, _onScrollHandlerEs.createOnScrollHandler)(container, onScroll, info, options); + containerHandlers.add(containerHandler); + /** + * Check if there's a scroll event listener for this container. + * If not, create one. + */ + if (!scrollListeners.has(container)) { + const listener = () => { + const time = performance.now(); + for (const handler of containerHandlers) handler.measure(); + for (const handler of containerHandlers) handler.update(time); + for (const handler of containerHandlers) handler.notify(); + }; + scrollListeners.set(container, listener); + const target = getEventTarget(container); + window.addEventListener("resize", listener, { + passive: true + }); + if (container !== document.documentElement) { + resizeListeners.set(container, (0, _indexEs.resize)(container, listener)); + } + target.addEventListener("scroll", listener, { + passive: true + }); + } + const listener = scrollListeners.get(container); + const onLoadProcesss = requestAnimationFrame(listener); + return () => { + var _a; + if (typeof onScroll !== "function") onScroll.stop(); + cancelAnimationFrame(onLoadProcesss); + /** + * Check if we even have any handlers for this container. + */ + const containerHandlers = onScrollHandlers.get(container); + if (!containerHandlers) return; + containerHandlers.delete(containerHandler); + if (containerHandlers.size) return; + /** + * If no more handlers, remove the scroll listener too. + */ + const listener = scrollListeners.get(container); + scrollListeners.delete(container); + if (listener) { + getEventTarget(container).removeEventListener("scroll", listener); + (_a = resizeListeners.get(container)) === null || _a === void 0 ? void 0 : _a(); + window.removeEventListener("resize", listener); + } + }; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/info.es.js": +/*!****************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/info.es.js ***! + \****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createScrollInfo = void 0; +exports.updateScrollInfo = updateScrollInfo; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +/** + * A time in milliseconds, beyond which we consider the scroll velocity to be 0. + */ +const maxElapsed = 50; +const createAxisInfo = () => ({ + current: 0, + offset: [], + progress: 0, + scrollLength: 0, + targetOffset: 0, + targetLength: 0, + containerLength: 0, + velocity: 0 +}); +const createScrollInfo = () => ({ + time: 0, + x: createAxisInfo(), + y: createAxisInfo() +}); +exports.createScrollInfo = createScrollInfo; +const keys = { + x: { + length: "Width", + position: "Left" + }, + y: { + length: "Height", + position: "Top" + } +}; +function updateAxisInfo(element, axisName, info, time) { + const axis = info[axisName]; + const { + length, + position + } = keys[axisName]; + const prev = axis.current; + const prevTime = info.time; + axis.current = element["scroll" + position]; + axis.scrollLength = element["scroll" + length] - element["client" + length]; + axis.offset.length = 0; + axis.offset[0] = 0; + axis.offset[1] = axis.scrollLength; + axis.progress = (0, _utils.progress)(0, axis.scrollLength, axis.current); + const elapsed = time - prevTime; + axis.velocity = elapsed > maxElapsed ? 0 : (0, _utils.velocityPerSecond)(axis.current - prev, elapsed); +} +function updateScrollInfo(element, info, time) { + updateAxisInfo(element, "x", info, time); + updateAxisInfo(element, "y", info, time); + info.time = time; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/edge.es.js": +/*!************************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/edge.es.js ***! + \************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.namedEdges = void 0; +exports.resolveEdge = resolveEdge; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +const namedEdges = { + start: 0, + center: 0.5, + end: 1 +}; +exports.namedEdges = namedEdges; +function resolveEdge(edge, length) { + let inset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + let delta = 0; + /** + * If we have this edge defined as a preset, replace the definition + * with the numerical value. + */ + if (namedEdges[edge] !== undefined) { + edge = namedEdges[edge]; + } + /** + * Handle unit values + */ + if ((0, _utils.isString)(edge)) { + const asNumber = parseFloat(edge); + if (edge.endsWith("px")) { + delta = asNumber; + } else if (edge.endsWith("%")) { + edge = asNumber / 100; + } else if (edge.endsWith("vw")) { + delta = asNumber / 100 * document.documentElement.clientWidth; + } else if (edge.endsWith("vh")) { + delta = asNumber / 100 * document.documentElement.clientHeight; + } else { + edge = asNumber; + } + } + /** + * If the edge is defined as a number, handle as a progress value. + */ + if ((0, _utils.isNumber)(edge)) { + delta = length * edge; + } + return inset + delta; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/index.es.js": +/*!*************************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/index.es.js ***! + \*************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.resolveOffsets = resolveOffsets; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _insetEs = __webpack_require__(/*! ./inset.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/inset.es.js"); +var _presetsEs = __webpack_require__(/*! ./presets.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/presets.es.js"); +var _offsetEs = __webpack_require__(/*! ./offset.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/offset.es.js"); +const point = { + x: 0, + y: 0 +}; +function resolveOffsets(container, info, options) { + let { + offset: offsetDefinition = _presetsEs.ScrollOffset.All + } = options; + const { + target = container, + axis = "y" + } = options; + const lengthLabel = axis === "y" ? "height" : "width"; + const inset = target !== container ? (0, _insetEs.calcInset)(target, container) : point; + /** + * Measure the target and container. If they're the same thing then we + * use the container's scrollWidth/Height as the target, from there + * all other calculations can remain the same. + */ + const targetSize = target === container ? { + width: container.scrollWidth, + height: container.scrollHeight + } : { + width: target.clientWidth, + height: target.clientHeight + }; + const containerSize = { + width: container.clientWidth, + height: container.clientHeight + }; + /** + * Reset the length of the resolved offset array rather than creating a new one. + * TODO: More reusable data structures for targetSize/containerSize would also be good. + */ + info[axis].offset.length = 0; + /** + * Populate the offset array by resolving the user's offset definition into + * a list of pixel scroll offets. + */ + let hasChanged = !info[axis].interpolate; + const numOffsets = offsetDefinition.length; + for (let i = 0; i < numOffsets; i++) { + const offset = (0, _offsetEs.resolveOffset)(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); + if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { + hasChanged = true; + } + info[axis].offset[i] = offset; + } + /** + * If the pixel scroll offsets have changed, create a new interpolator function + * to map scroll value into a progress. + */ + if (hasChanged) { + info[axis].interpolate = (0, _utils.interpolate)((0, _utils.defaultOffset)(numOffsets), info[axis].offset); + info[axis].interpolatorOffsets = [...info[axis].offset]; + } + info[axis].progress = info[axis].interpolate(info[axis].current); +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/inset.es.js": +/*!*************************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/inset.es.js ***! + \*************************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.calcInset = calcInset; +function calcInset(element, container) { + let inset = { + x: 0, + y: 0 + }; + let current = element; + while (current && current !== container) { + if (current instanceof HTMLElement) { + inset.x += current.offsetLeft; + inset.y += current.offsetTop; + current = current.offsetParent; + } else if (current instanceof SVGGraphicsElement && "getBBox" in current) { + const { + top, + left + } = current.getBBox(); + inset.x += left; + inset.y += top; + /** + * Assign the next parent element as the tag. + */ + while (current && current.tagName !== "svg") { + current = current.parentNode; + } + } + } + return inset; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/offset.es.js": +/*!**************************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/offset.es.js ***! + \**************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.resolveOffset = resolveOffset; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _edgeEs = __webpack_require__(/*! ./edge.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/edge.es.js"); +const defaultOffset = [0, 0]; +function resolveOffset(offset, containerLength, targetLength, targetInset) { + let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; + let targetPoint = 0; + let containerPoint = 0; + if ((0, _utils.isNumber)(offset)) { + /** + * If we're provided offset: [0, 0.5, 1] then each number x should become + * [x, x], so we default to the behaviour of mapping 0 => 0 of both target + * and container etc. + */ + offsetDefinition = [offset, offset]; + } else if ((0, _utils.isString)(offset)) { + offset = offset.trim(); + if (offset.includes(" ")) { + offsetDefinition = offset.split(" "); + } else { + /** + * If we're provided a definition like "100px" then we want to apply + * that only to the top of the target point, leaving the container at 0. + * Whereas a named offset like "end" should be applied to both. + */ + offsetDefinition = [offset, _edgeEs.namedEdges[offset] ? offset : `0`]; + } + } + targetPoint = (0, _edgeEs.resolveEdge)(offsetDefinition[0], targetLength, targetInset); + containerPoint = (0, _edgeEs.resolveEdge)(offsetDefinition[1], containerLength); + return targetPoint - containerPoint; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/presets.es.js": +/*!***************************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/presets.es.js ***! + \***************************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.ScrollOffset = void 0; +const ScrollOffset = { + Enter: [[0, 1], [1, 1]], + Exit: [[0, 0], [1, 0]], + Any: [[1, 0], [0, 1]], + All: [[0, 0], [1, 1]] +}; +exports.ScrollOffset = ScrollOffset; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/on-scroll-handler.es.js": +/*!*****************************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/on-scroll-handler.es.js ***! + \*****************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createOnScrollHandler = createOnScrollHandler; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _infoEs = __webpack_require__(/*! ./info.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/info.es.js"); +var _indexEs = __webpack_require__(/*! ./offsets/index.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/index.es.js"); +function measure(container) { + let target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : container; + let info = arguments.length > 2 ? arguments[2] : undefined; + /** + * Find inset of target within scrollable container + */ + info.x.targetOffset = 0; + info.y.targetOffset = 0; + if (target !== container) { + let node = target; + while (node && node != container) { + info.x.targetOffset += node.offsetLeft; + info.y.targetOffset += node.offsetTop; + node = node.offsetParent; + } + } + info.x.targetLength = target === container ? target.scrollWidth : target.clientWidth; + info.y.targetLength = target === container ? target.scrollHeight : target.clientHeight; + info.x.containerLength = container.clientWidth; + info.y.containerLength = container.clientHeight; +} +function createOnScrollHandler(element, onScroll, info) { + let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + const axis = options.axis || "y"; + return { + measure: () => measure(element, options.target, info), + update: time => { + (0, _infoEs.updateScrollInfo)(element, info, time); + if (options.offset || options.target) { + (0, _indexEs.resolveOffsets)(element, info, options); + } + }, + notify: typeof onScroll === "function" ? () => onScroll(info) : scrubAnimation(onScroll, info[axis]) + }; +} +function scrubAnimation(controls, axisInfo) { + controls.pause(); + controls.forEachNative((animation, _ref) => { + let { + easing + } = _ref; + var _a, _b; + if (animation.updateDuration) { + if (!easing) animation.easing = _utils.noopReturn; + animation.updateDuration(1); + } else { + const timingOptions = { + duration: 1000 + }; + if (!easing) timingOptions.easing = "linear"; + (_b = (_a = animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming) === null || _b === void 0 ? void 0 : _b.call(_a, timingOptions); + } + }); + return () => { + controls.currentTime = axisInfo.progress; + }; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/index.es.js": +/*!*************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/index.es.js ***! + \*************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "ScrollOffset", ({ + enumerable: true, + get: function () { + return _presetsEs.ScrollOffset; + } +})); +Object.defineProperty(exports, "animate", ({ + enumerable: true, + get: function () { + return _indexEs.animate; + } +})); +Object.defineProperty(exports, "animateStyle", ({ + enumerable: true, + get: function () { + return _animateStyleEs.animateStyle; + } +})); +Object.defineProperty(exports, "createMotionState", ({ + enumerable: true, + get: function () { + return _indexEs7.createMotionState; + } +})); +Object.defineProperty(exports, "createStyleString", ({ + enumerable: true, + get: function () { + return _styleStringEs.createStyleString; + } +})); +Object.defineProperty(exports, "createStyles", ({ + enumerable: true, + get: function () { + return _styleObjectEs.createStyles; + } +})); +Object.defineProperty(exports, "getAnimationData", ({ + enumerable: true, + get: function () { + return _dataEs.getAnimationData; + } +})); +Object.defineProperty(exports, "getStyleName", ({ + enumerable: true, + get: function () { + return _getStyleNameEs.getStyleName; + } +})); +Object.defineProperty(exports, "glide", ({ + enumerable: true, + get: function () { + return _indexEs4.glide; + } +})); +Object.defineProperty(exports, "inView", ({ + enumerable: true, + get: function () { + return _inViewEs.inView; + } +})); +Object.defineProperty(exports, "mountedStates", ({ + enumerable: true, + get: function () { + return _indexEs7.mountedStates; + } +})); +Object.defineProperty(exports, "resize", ({ + enumerable: true, + get: function () { + return _indexEs5.resize; + } +})); +Object.defineProperty(exports, "scroll", ({ + enumerable: true, + get: function () { + return _indexEs6.scroll; + } +})); +Object.defineProperty(exports, "spring", ({ + enumerable: true, + get: function () { + return _indexEs3.spring; + } +})); +Object.defineProperty(exports, "stagger", ({ + enumerable: true, + get: function () { + return _staggerEs.stagger; + } +})); +Object.defineProperty(exports, "style", ({ + enumerable: true, + get: function () { + return _styleEs.style; + } +})); +Object.defineProperty(exports, "timeline", ({ + enumerable: true, + get: function () { + return _indexEs2.timeline; + } +})); +Object.defineProperty(exports, "withControls", ({ + enumerable: true, + get: function () { + return _controlsEs.withControls; + } +})); +var _indexEs = __webpack_require__(/*! ./animate/index.es.js */ "../../../node_modules/@motionone/dom/dist/animate/index.es.js"); +var _animateStyleEs = __webpack_require__(/*! ./animate/animate-style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/animate-style.es.js"); +var _indexEs2 = __webpack_require__(/*! ./timeline/index.es.js */ "../../../node_modules/@motionone/dom/dist/timeline/index.es.js"); +var _staggerEs = __webpack_require__(/*! ./utils/stagger.es.js */ "../../../node_modules/@motionone/dom/dist/utils/stagger.es.js"); +var _indexEs3 = __webpack_require__(/*! ./easing/spring/index.es.js */ "../../../node_modules/@motionone/dom/dist/easing/spring/index.es.js"); +var _indexEs4 = __webpack_require__(/*! ./easing/glide/index.es.js */ "../../../node_modules/@motionone/dom/dist/easing/glide/index.es.js"); +var _styleEs = __webpack_require__(/*! ./animate/style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/style.es.js"); +var _inViewEs = __webpack_require__(/*! ./gestures/in-view.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/in-view.es.js"); +var _indexEs5 = __webpack_require__(/*! ./gestures/resize/index.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/resize/index.es.js"); +var _indexEs6 = __webpack_require__(/*! ./gestures/scroll/index.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/index.es.js"); +var _presetsEs = __webpack_require__(/*! ./gestures/scroll/offsets/presets.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/presets.es.js"); +var _controlsEs = __webpack_require__(/*! ./animate/utils/controls.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/controls.es.js"); +var _dataEs = __webpack_require__(/*! ./animate/data.es.js */ "../../../node_modules/@motionone/dom/dist/animate/data.es.js"); +var _getStyleNameEs = __webpack_require__(/*! ./animate/utils/get-style-name.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/get-style-name.es.js"); +var _indexEs7 = __webpack_require__(/*! ./state/index.es.js */ "../../../node_modules/@motionone/dom/dist/state/index.es.js"); +var _styleObjectEs = __webpack_require__(/*! ./animate/utils/style-object.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/style-object.es.js"); +var _styleStringEs = __webpack_require__(/*! ./animate/utils/style-string.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/style-string.es.js"); + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/state/gestures/hover.es.js": +/*!****************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/state/gestures/hover.es.js ***! + \****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.hover = void 0; +var _eventsEs = __webpack_require__(/*! ../utils/events.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/events.es.js"); +const mouseEvent = (element, name, action) => event => { + if (event.pointerType && event.pointerType !== "mouse") return; + action(); + (0, _eventsEs.dispatchPointerEvent)(element, name, event); +}; +const hover = { + isActive: options => Boolean(options.hover), + subscribe: (element, _ref) => { + let { + enable, + disable + } = _ref; + const onEnter = mouseEvent(element, "hoverstart", enable); + const onLeave = mouseEvent(element, "hoverend", disable); + element.addEventListener("pointerenter", onEnter); + element.addEventListener("pointerleave", onLeave); + return () => { + element.removeEventListener("pointerenter", onEnter); + element.removeEventListener("pointerleave", onLeave); + }; + } +}; +exports.hover = hover; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/state/gestures/in-view.es.js": +/*!******************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/state/gestures/in-view.es.js ***! + \******************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.inView = void 0; +var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js"); +var _eventsEs = __webpack_require__(/*! ../utils/events.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/events.es.js"); +var _inViewEs = __webpack_require__(/*! ../../gestures/in-view.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/in-view.es.js"); +const inView = { + isActive: options => Boolean(options.inView), + subscribe: (element, _ref, _ref2) => { + let { + enable, + disable + } = _ref; + let { + inViewOptions = {} + } = _ref2; + const { + once + } = inViewOptions, + viewOptions = (0, _tslib.__rest)(inViewOptions, ["once"]); + return (0, _inViewEs.inView)(element, enterEntry => { + enable(); + (0, _eventsEs.dispatchViewEvent)(element, "viewenter", enterEntry); + if (!once) { + return leaveEntry => { + disable(); + (0, _eventsEs.dispatchViewEvent)(element, "viewleave", leaveEntry); + }; + } + }, viewOptions); + } +}; +exports.inView = inView; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/state/gestures/press.es.js": +/*!****************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/state/gestures/press.es.js ***! + \****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.press = void 0; +var _eventsEs = __webpack_require__(/*! ../utils/events.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/events.es.js"); +const press = { + isActive: options => Boolean(options.press), + subscribe: (element, _ref) => { + let { + enable, + disable + } = _ref; + const onPointerUp = event => { + disable(); + (0, _eventsEs.dispatchPointerEvent)(element, "pressend", event); + window.removeEventListener("pointerup", onPointerUp); + }; + const onPointerDown = event => { + enable(); + (0, _eventsEs.dispatchPointerEvent)(element, "pressstart", event); + window.addEventListener("pointerup", onPointerUp); + }; + element.addEventListener("pointerdown", onPointerDown); + return () => { + element.removeEventListener("pointerdown", onPointerDown); + window.removeEventListener("pointerup", onPointerUp); + }; + } +}; +exports.press = press; + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/state/index.es.js": +/*!*******************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/state/index.es.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createMotionState = createMotionState; +exports.mountedStates = void 0; +var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js"); +var _heyListen = __webpack_require__(/*! hey-listen */ "../../../node_modules/hey-listen/dist/hey-listen.es.js"); +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _animateStyleEs = __webpack_require__(/*! ../animate/animate-style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/animate-style.es.js"); +var _styleEs = __webpack_require__(/*! ../animate/style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/style.es.js"); +var _optionsEs = __webpack_require__(/*! ../animate/utils/options.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/options.es.js"); +var _hasChangedEs = __webpack_require__(/*! ./utils/has-changed.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/has-changed.es.js"); +var _resolveVariantEs = __webpack_require__(/*! ./utils/resolve-variant.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/resolve-variant.es.js"); +var _scheduleEs = __webpack_require__(/*! ./utils/schedule.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/schedule.es.js"); +var _inViewEs = __webpack_require__(/*! ./gestures/in-view.es.js */ "../../../node_modules/@motionone/dom/dist/state/gestures/in-view.es.js"); +var _hoverEs = __webpack_require__(/*! ./gestures/hover.es.js */ "../../../node_modules/@motionone/dom/dist/state/gestures/hover.es.js"); +var _pressEs = __webpack_require__(/*! ./gestures/press.es.js */ "../../../node_modules/@motionone/dom/dist/state/gestures/press.es.js"); +var _eventsEs = __webpack_require__(/*! ./utils/events.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/events.es.js"); +const gestures = { + inView: _inViewEs.inView, + hover: _hoverEs.hover, + press: _pressEs.press +}; +/** + * A list of state types, in priority order. If a value is defined in + * a righter-most type, it will override any definition in a lefter-most. + */ +const stateTypes = ["initial", "animate", ...Object.keys(gestures), "exit"]; +/** + * A global store of all generated motion states. This can be used to lookup + * a motion state for a given Element. + */ +const mountedStates = new WeakMap(); +exports.mountedStates = mountedStates; +function createMotionState() { + let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let parent = arguments.length > 1 ? arguments[1] : undefined; + /** + * The element represented by the motion state. This is an empty reference + * when we create the state to support SSR and allow for later mounting + * in view libraries. + * + * @ts-ignore + */ + let element; + /** + * Calculate a depth that we can use to order motion states by tree depth. + */ + let depth = parent ? parent.getDepth() + 1 : 0; + /** + * Track which states are currently active. + */ + const activeStates = { + initial: true, + animate: true + }; + /** + * A map of functions that, when called, will remove event listeners for + * a given gesture. + */ + const gestureSubscriptions = {}; + /** + * Initialise a context to share through motion states. This + * will be populated by variant names (if any). + */ + const context = {}; + for (const name of stateTypes) { + context[name] = typeof options[name] === "string" ? options[name] : parent === null || parent === void 0 ? void 0 : parent.getContext()[name]; + } + /** + * If initial is set to false we use the animate prop as the initial + * animation state. + */ + const initialVariantSource = options.initial === false ? "animate" : "initial"; + /** + * Destructure an initial target out from the resolved initial variant. + */ + let _a = (0, _resolveVariantEs.resolveVariant)(options[initialVariantSource] || context[initialVariantSource], options.variants) || {}, + target = (0, _tslib.__rest)(_a, ["transition"]); + /** + * The base target is a cached map of values that we'll use to animate + * back to if a value is removed from all active state types. This + * is usually the initial value as read from the DOM, for instance if + * it hasn't been defined in initial. + */ + const baseTarget = Object.assign({}, target); + /** + * A generator that will be processed by the global animation scheduler. + * This yeilds when it switches from reading the DOM to writing to it + * to prevent layout thrashing. + */ + function* animateUpdates() { + var _a, _b; + const prevTarget = target; + target = {}; + const animationOptions = {}; + for (const name of stateTypes) { + if (!activeStates[name]) continue; + const variant = (0, _resolveVariantEs.resolveVariant)(options[name]); + if (!variant) continue; + for (const key in variant) { + if (key === "transition") continue; + target[key] = variant[key]; + animationOptions[key] = (0, _optionsEs.getOptions)((_b = (_a = variant.transition) !== null && _a !== void 0 ? _a : options.transition) !== null && _b !== void 0 ? _b : {}, key); + } + } + const allTargetKeys = new Set([...Object.keys(target), ...Object.keys(prevTarget)]); + const animationFactories = []; + allTargetKeys.forEach(key => { + var _a; + if (target[key] === undefined) { + target[key] = baseTarget[key]; + } + if ((0, _hasChangedEs.hasChanged)(prevTarget[key], target[key])) { + (_a = baseTarget[key]) !== null && _a !== void 0 ? _a : baseTarget[key] = _styleEs.style.get(element, key); + animationFactories.push((0, _animateStyleEs.animateStyle)(element, key, target[key], animationOptions[key])); + } + }); + // Wait for all animation states to read from the DOM + yield; + const animations = animationFactories.map(factory => factory()).filter(Boolean); + if (!animations.length) return; + const animationTarget = target; + element.dispatchEvent((0, _eventsEs.motionEvent)("motionstart", animationTarget)); + Promise.all(animations.map(animation => animation.finished)).then(() => { + element.dispatchEvent((0, _eventsEs.motionEvent)("motioncomplete", animationTarget)); + }).catch(_utils.noop); + } + const setGesture = (name, isActive) => () => { + activeStates[name] = isActive; + (0, _scheduleEs.scheduleAnimation)(state); + }; + const updateGestureSubscriptions = () => { + for (const name in gestures) { + const isGestureActive = gestures[name].isActive(options); + const remove = gestureSubscriptions[name]; + if (isGestureActive && !remove) { + gestureSubscriptions[name] = gestures[name].subscribe(element, { + enable: setGesture(name, true), + disable: setGesture(name, false) + }, options); + } else if (!isGestureActive && remove) { + remove(); + delete gestureSubscriptions[name]; + } + } + }; + const state = { + update: newOptions => { + if (!element) return; + options = newOptions; + updateGestureSubscriptions(); + (0, _scheduleEs.scheduleAnimation)(state); + }, + setActive: (name, isActive) => { + if (!element) return; + activeStates[name] = isActive; + (0, _scheduleEs.scheduleAnimation)(state); + }, + animateUpdates, + getDepth: () => depth, + getTarget: () => target, + getOptions: () => options, + getContext: () => context, + mount: newElement => { + (0, _heyListen.invariant)(Boolean(newElement), "Animation state must be mounted with valid Element"); + element = newElement; + mountedStates.set(element, state); + updateGestureSubscriptions(); + return () => { + mountedStates.delete(element); + (0, _scheduleEs.unscheduleAnimation)(state); + for (const key in gestureSubscriptions) { + gestureSubscriptions[key](); + } + }; + }, + isMounted: () => Boolean(element) + }; + return state; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/state/utils/events.es.js": +/*!**************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/state/utils/events.es.js ***! + \**************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.dispatchPointerEvent = dispatchPointerEvent; +exports.dispatchViewEvent = dispatchViewEvent; +exports.motionEvent = void 0; +const motionEvent = (name, target) => new CustomEvent(name, { + detail: { + target + } +}); +exports.motionEvent = motionEvent; +function dispatchPointerEvent(element, name, event) { + element.dispatchEvent(new CustomEvent(name, { + detail: { + originalEvent: event + } + })); +} +function dispatchViewEvent(element, name, entry) { + element.dispatchEvent(new CustomEvent(name, { + detail: { + originalEntry: entry + } + })); +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/state/utils/has-changed.es.js": +/*!*******************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/state/utils/has-changed.es.js ***! + \*******************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.hasChanged = hasChanged; +exports.shallowCompare = shallowCompare; +function hasChanged(a, b) { + if (typeof a !== typeof b) return true; + if (Array.isArray(a) && Array.isArray(b)) return !shallowCompare(a, b); + return a !== b; +} +function shallowCompare(next, prev) { + const prevLength = prev.length; + if (prevLength !== next.length) return false; + for (let i = 0; i < prevLength; i++) { + if (prev[i] !== next[i]) return false; + } + return true; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/state/utils/is-variant.es.js": +/*!******************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/state/utils/is-variant.es.js ***! + \******************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isVariant = isVariant; +function isVariant(definition) { + return typeof definition === "object"; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/state/utils/resolve-variant.es.js": +/*!***********************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/state/utils/resolve-variant.es.js ***! + \***********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.resolveVariant = resolveVariant; +var _isVariantEs = __webpack_require__(/*! ./is-variant.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/is-variant.es.js"); +function resolveVariant(definition, variants) { + if ((0, _isVariantEs.isVariant)(definition)) { + return definition; + } else if (definition && variants) { + return variants[definition]; + } +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/state/utils/schedule.es.js": +/*!****************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/state/utils/schedule.es.js ***! + \****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.scheduleAnimation = scheduleAnimation; +exports.unscheduleAnimation = unscheduleAnimation; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +let scheduled = undefined; +function processScheduledAnimations() { + if (!scheduled) return; + const generators = scheduled.sort(compareByDepth).map(fireAnimateUpdates); + generators.forEach(fireNext); + generators.forEach(fireNext); + scheduled = undefined; +} +function scheduleAnimation(state) { + if (!scheduled) { + scheduled = [state]; + requestAnimationFrame(processScheduledAnimations); + } else { + (0, _utils.addUniqueItem)(scheduled, state); + } +} +function unscheduleAnimation(state) { + scheduled && (0, _utils.removeItem)(scheduled, state); +} +const compareByDepth = (a, b) => a.getDepth() - b.getDepth(); +const fireAnimateUpdates = state => state.animateUpdates(); +const fireNext = iterator => iterator.next(); + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/timeline/index.es.js": +/*!**********************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/timeline/index.es.js ***! + \**********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createAnimationsFromTimeline = createAnimationsFromTimeline; +exports.timeline = timeline; +var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js"); +var _heyListen = __webpack_require__(/*! hey-listen */ "../../../node_modules/hey-listen/dist/hey-listen.es.js"); +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _staggerEs = __webpack_require__(/*! ../utils/stagger.es.js */ "../../../node_modules/@motionone/dom/dist/utils/stagger.es.js"); +var _animateStyleEs = __webpack_require__(/*! ../animate/animate-style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/animate-style.es.js"); +var _controlsEs = __webpack_require__(/*! ../animate/utils/controls.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/controls.es.js"); +var _keyframesEs = __webpack_require__(/*! ../animate/utils/keyframes.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/keyframes.es.js"); +var _optionsEs = __webpack_require__(/*! ../animate/utils/options.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/options.es.js"); +var _resolveElementsEs = __webpack_require__(/*! ../utils/resolve-elements.es.js */ "../../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js"); +var _transformsEs = __webpack_require__(/*! ../animate/utils/transforms.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js"); +var _calcTimeEs = __webpack_require__(/*! ./utils/calc-time.es.js */ "../../../node_modules/@motionone/dom/dist/timeline/utils/calc-time.es.js"); +var _editEs = __webpack_require__(/*! ./utils/edit.es.js */ "../../../node_modules/@motionone/dom/dist/timeline/utils/edit.es.js"); +var _sortEs = __webpack_require__(/*! ./utils/sort.es.js */ "../../../node_modules/@motionone/dom/dist/timeline/utils/sort.es.js"); +function timeline(definition) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var _a; + const animationDefinitions = createAnimationsFromTimeline(definition, options); + /** + * Create and start animations + */ + const animationFactories = animationDefinitions.map(definition => (0, _animateStyleEs.animateStyle)(...definition)).filter(Boolean); + return (0, _controlsEs.withControls)(animationFactories, options, + // Get the duration from the first animation definition + (_a = animationDefinitions[0]) === null || _a === void 0 ? void 0 : _a[3].duration); +} +function createAnimationsFromTimeline(definition) { + let _a = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var { + defaultOptions = {} + } = _a, + timelineOptions = (0, _tslib.__rest)(_a, ["defaultOptions"]); + const animationDefinitions = []; + const elementSequences = new Map(); + const elementCache = {}; + const timeLabels = new Map(); + let prevTime = 0; + let currentTime = 0; + let totalDuration = 0; + /** + * Build the timeline by mapping over the definition array and converting + * the definitions into keyframes and offsets with absolute time values. + * These will later get converted into relative offsets in a second pass. + */ + for (let i = 0; i < definition.length; i++) { + const segment = definition[i]; + /** + * If this is a timeline label, mark it and skip the rest of this iteration. + */ + if ((0, _utils.isString)(segment)) { + timeLabels.set(segment, currentTime); + continue; + } else if (!Array.isArray(segment)) { + timeLabels.set(segment.name, (0, _calcTimeEs.calcNextTime)(currentTime, segment.at, prevTime, timeLabels)); + continue; + } + const [elementDefinition, keyframes, options = {}] = segment; + /** + * If a relative or absolute time value has been specified we need to resolve + * it in relation to the currentTime. + */ + if (options.at !== undefined) { + currentTime = (0, _calcTimeEs.calcNextTime)(currentTime, options.at, prevTime, timeLabels); + } + /** + * Keep track of the maximum duration in this definition. This will be + * applied to currentTime once the definition has been parsed. + */ + let maxDuration = 0; + /** + * Find all the elements specified in the definition and parse value + * keyframes from their timeline definitions. + */ + const elements = (0, _resolveElementsEs.resolveElements)(elementDefinition, elementCache); + const numElements = elements.length; + for (let elementIndex = 0; elementIndex < numElements; elementIndex++) { + const element = elements[elementIndex]; + const elementSequence = getElementSequence(element, elementSequences); + for (const key in keyframes) { + const valueSequence = getValueSequence(key, elementSequence); + let valueKeyframes = (0, _keyframesEs.keyframesList)(keyframes[key]); + const valueOptions = (0, _optionsEs.getOptions)(options, key); + let { + duration = defaultOptions.duration || _utils.defaults.duration, + easing = defaultOptions.easing || _utils.defaults.easing + } = valueOptions; + if ((0, _utils.isEasingGenerator)(easing)) { + const valueIsTransform = (0, _transformsEs.isTransform)(key); + (0, _heyListen.invariant)(valueKeyframes.length === 2 || !valueIsTransform, "spring must be provided 2 keyframes within timeline"); + const custom = easing.createAnimation(valueKeyframes, + // TODO We currently only support explicit keyframes + // so this doesn't currently read from the DOM + () => "0", valueIsTransform); + easing = custom.easing; + if (custom.keyframes !== undefined) valueKeyframes = custom.keyframes; + if (custom.duration !== undefined) duration = custom.duration; + } + const delay = (0, _staggerEs.resolveOption)(options.delay, elementIndex, numElements) || 0; + const startTime = currentTime + delay; + const targetTime = startTime + duration; + /** + * + */ + let { + offset = (0, _utils.defaultOffset)(valueKeyframes.length) + } = valueOptions; + /** + * If there's only one offset of 0, fill in a second with length 1 + * + * TODO: Ensure there's a test that covers this removal + */ + if (offset.length === 1 && offset[0] === 0) { + offset[1] = 1; + } + /** + * Fill out if offset if fewer offsets than keyframes + */ + const remainder = length - valueKeyframes.length; + remainder > 0 && (0, _utils.fillOffset)(offset, remainder); + /** + * If only one value has been set, ie [1], push a null to the start of + * the keyframe array. This will let us mark a keyframe at this point + * that will later be hydrated with the previous value. + */ + valueKeyframes.length === 1 && valueKeyframes.unshift(null); + /** + * Add keyframes, mapping offsets to absolute time. + */ + (0, _editEs.addKeyframes)(valueSequence, valueKeyframes, easing, offset, startTime, targetTime); + maxDuration = Math.max(delay + duration, maxDuration); + totalDuration = Math.max(targetTime, totalDuration); + } + } + prevTime = currentTime; + currentTime += maxDuration; + } + /** + * For every element and value combination create a new animation. + */ + elementSequences.forEach((valueSequences, element) => { + for (const key in valueSequences) { + const valueSequence = valueSequences[key]; + /** + * Arrange all the keyframes in ascending time order. + */ + valueSequence.sort(_sortEs.compareByTime); + const keyframes = []; + const valueOffset = []; + const valueEasing = []; + /** + * For each keyframe, translate absolute times into + * relative offsets based on the total duration of the timeline. + */ + for (let i = 0; i < valueSequence.length; i++) { + const { + at, + value, + easing + } = valueSequence[i]; + keyframes.push(value); + valueOffset.push((0, _utils.progress)(0, totalDuration, at)); + valueEasing.push(easing || _utils.defaults.easing); + } + /** + * If the first keyframe doesn't land on offset: 0 + * provide one by duplicating the initial keyframe. This ensures + * it snaps to the first keyframe when the animation starts. + */ + if (valueOffset[0] !== 0) { + valueOffset.unshift(0); + keyframes.unshift(keyframes[0]); + valueEasing.unshift("linear"); + } + /** + * If the last keyframe doesn't land on offset: 1 + * provide one with a null wildcard value. This will ensure it + * stays static until the end of the animation. + */ + if (valueOffset[valueOffset.length - 1] !== 1) { + valueOffset.push(1); + keyframes.push(null); + } + animationDefinitions.push([element, key, keyframes, Object.assign(Object.assign(Object.assign({}, defaultOptions), { + duration: totalDuration, + easing: valueEasing, + offset: valueOffset + }), timelineOptions)]); + } + }); + return animationDefinitions; +} +function getElementSequence(element, sequences) { + !sequences.has(element) && sequences.set(element, {}); + return sequences.get(element); +} +function getValueSequence(name, sequences) { + if (!sequences[name]) sequences[name] = []; + return sequences[name]; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/timeline/utils/calc-time.es.js": +/*!********************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/timeline/utils/calc-time.es.js ***! + \********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.calcNextTime = calcNextTime; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +function calcNextTime(current, next, prev, labels) { + var _a; + if ((0, _utils.isNumber)(next)) { + return next; + } else if (next.startsWith("-") || next.startsWith("+")) { + return Math.max(0, current + parseFloat(next)); + } else if (next === "<") { + return prev; + } else { + return (_a = labels.get(next)) !== null && _a !== void 0 ? _a : current; + } +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/timeline/utils/edit.es.js": +/*!***************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/timeline/utils/edit.es.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.addKeyframes = addKeyframes; +exports.eraseKeyframes = eraseKeyframes; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +function eraseKeyframes(sequence, startTime, endTime) { + for (let i = 0; i < sequence.length; i++) { + const keyframe = sequence[i]; + if (keyframe.at > startTime && keyframe.at < endTime) { + (0, _utils.removeItem)(sequence, keyframe); + // If we remove this item we have to push the pointer back one + i--; + } + } +} +function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { + /** + * Erase every existing value between currentTime and targetTime, + * this will essentially splice this timeline into any currently + * defined ones. + */ + eraseKeyframes(sequence, startTime, endTime); + for (let i = 0; i < keyframes.length; i++) { + sequence.push({ + value: keyframes[i], + at: (0, _utils.mix)(startTime, endTime, offset[i]), + easing: (0, _utils.getEasingForSegment)(easing, i) + }); + } +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/timeline/utils/sort.es.js": +/*!***************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/timeline/utils/sort.es.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.compareByTime = compareByTime; +function compareByTime(a, b) { + if (a.at === b.at) { + return a.value === null ? 1 : -1; + } else { + return a.at - b.at; + } +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js": +/*!******************************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js ***! + \******************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.resolveElements = resolveElements; +function resolveElements(elements, selectorCache) { + var _a; + if (typeof elements === "string") { + if (selectorCache) { + (_a = selectorCache[elements]) !== null && _a !== void 0 ? _a : selectorCache[elements] = document.querySelectorAll(elements); + elements = selectorCache[elements]; + } else { + elements = document.querySelectorAll(elements); + } + } else if (elements instanceof Element) { + elements = [elements]; + } + /** + * Return an empty array + */ + return Array.from(elements || []); +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/dom/dist/utils/stagger.es.js": +/*!*********************************************************************!*\ + !*** ../../../node_modules/@motionone/dom/dist/utils/stagger.es.js ***! + \*********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getFromIndex = getFromIndex; +exports.resolveOption = resolveOption; +exports.stagger = stagger; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _animation = __webpack_require__(/*! @motionone/animation */ "../../../node_modules/@motionone/animation/dist/index.es.js"); +function stagger() { + let duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.1; + let { + start = 0, + from = 0, + easing + } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return (i, total) => { + const fromIndex = (0, _utils.isNumber)(from) ? from : getFromIndex(from, total); + const distance = Math.abs(fromIndex - i); + let delay = duration * distance; + if (easing) { + const maxDelay = total * duration; + const easingFunction = (0, _animation.getEasingFunction)(easing); + delay = easingFunction(delay / maxDelay) * maxDelay; + } + return start + delay; + }; +} +function getFromIndex(from, total) { + if (from === "first") { + return 0; + } else { + const lastIndex = total - 1; + return from === "last" ? lastIndex : lastIndex / 2; + } +} +function resolveOption(option, i, total) { + return typeof option === "function" ? option(i, total) : option; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/easing/dist/cubic-bezier.es.js": +/*!***********************************************************************!*\ + !*** ../../../node_modules/@motionone/easing/dist/cubic-bezier.es.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.cubicBezier = cubicBezier; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +/* + Bezier function generator + + This has been modified from Gaëtan Renaudeau's BezierEasing + https://github.com/gre/bezier-easing/blob/master/src/index.js + https://github.com/gre/bezier-easing/blob/master/LICENSE + + I've removed the newtonRaphsonIterate algo because in benchmarking it + wasn't noticiably faster than binarySubdivision, indeed removing it + usually improved times, depending on the curve. + + I also removed the lookup table, as for the added bundle size and loop we're + only cutting ~4 or so subdivision iterations. I bumped the max iterations up + to 12 to compensate and this still tended to be faster for no perceivable + loss in accuracy. + + Usage + const easeOut = cubicBezier(.17,.67,.83,.67); + const x = easeOut(0.5); // returns 0.627... +*/ +// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. +const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * t; +const subdivisionPrecision = 0.0000001; +const subdivisionMaxIterations = 12; +function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { + let currentX; + let currentT; + let i = 0; + do { + currentT = lowerBound + (upperBound - lowerBound) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - x; + if (currentX > 0.0) { + upperBound = currentT; + } else { + lowerBound = currentT; + } + } while (Math.abs(currentX) > subdivisionPrecision && ++i < subdivisionMaxIterations); + return currentT; +} +function cubicBezier(mX1, mY1, mX2, mY2) { + // If this is a linear gradient, return linear easing + if (mX1 === mY1 && mX2 === mY2) return _utils.noopReturn; + const getTForX = aX => binarySubdivide(aX, 0, 1, mX1, mX2); + // If animation is at start/end, return t without easing + return t => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/easing/dist/index.es.js": +/*!****************************************************************!*\ + !*** ../../../node_modules/@motionone/easing/dist/index.es.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "cubicBezier", ({ + enumerable: true, + get: function () { + return _cubicBezierEs.cubicBezier; + } +})); +Object.defineProperty(exports, "steps", ({ + enumerable: true, + get: function () { + return _stepsEs.steps; + } +})); +var _cubicBezierEs = __webpack_require__(/*! ./cubic-bezier.es.js */ "../../../node_modules/@motionone/easing/dist/cubic-bezier.es.js"); +var _stepsEs = __webpack_require__(/*! ./steps.es.js */ "../../../node_modules/@motionone/easing/dist/steps.es.js"); + +/***/ }), + +/***/ "../../../node_modules/@motionone/easing/dist/steps.es.js": +/*!****************************************************************!*\ + !*** ../../../node_modules/@motionone/easing/dist/steps.es.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.steps = void 0; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +const steps = function (steps) { + let direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "end"; + return progress => { + progress = direction === "end" ? Math.min(progress, 0.999) : Math.max(progress, 0.001); + const expanded = progress * steps; + const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); + return (0, _utils.clamp)(0, 1, rounded / steps); + }; +}; +exports.steps = steps; + +/***/ }), + +/***/ "../../../node_modules/@motionone/generators/dist/glide/index.es.js": +/*!**************************************************************************!*\ + !*** ../../../node_modules/@motionone/generators/dist/glide/index.es.js ***! + \**************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.glide = void 0; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _velocityEs = __webpack_require__(/*! ../utils/velocity.es.js */ "../../../node_modules/@motionone/generators/dist/utils/velocity.es.js"); +var _indexEs = __webpack_require__(/*! ../spring/index.es.js */ "../../../node_modules/@motionone/generators/dist/spring/index.es.js"); +const glide = _ref => { + let { + from = 0, + velocity = 0.0, + power = 0.8, + decay = 0.325, + bounceDamping, + bounceStiffness, + changeTarget, + min, + max, + restDistance = 0.5, + restSpeed + } = _ref; + decay = _utils.time.ms(decay); + const state = { + hasReachedTarget: false, + done: false, + current: from, + target: from + }; + const isOutOfBounds = v => min !== undefined && v < min || max !== undefined && v > max; + const nearestBoundary = v => { + if (min === undefined) return max; + if (max === undefined) return min; + return Math.abs(min - v) < Math.abs(max - v) ? min : max; + }; + let amplitude = power * velocity; + const ideal = from + amplitude; + const target = changeTarget === undefined ? ideal : changeTarget(ideal); + state.target = target; + /** + * If the target has changed we need to re-calculate the amplitude, otherwise + * the animation will start from the wrong position. + */ + if (target !== ideal) amplitude = target - from; + const calcDelta = t => -amplitude * Math.exp(-t / decay); + const calcLatest = t => target + calcDelta(t); + const applyFriction = t => { + const delta = calcDelta(t); + const latest = calcLatest(t); + state.done = Math.abs(delta) <= restDistance; + state.current = state.done ? target : latest; + }; + /** + * Ideally this would resolve for t in a stateless way, we could + * do that by always precalculating the animation but as we know + * this will be done anyway we can assume that spring will + * be discovered during that. + */ + let timeReachedBoundary; + let spring$1; + const checkCatchBoundary = t => { + if (!isOutOfBounds(state.current)) return; + timeReachedBoundary = t; + spring$1 = (0, _indexEs.spring)({ + from: state.current, + to: nearestBoundary(state.current), + velocity: (0, _velocityEs.calcGeneratorVelocity)(calcLatest, t, state.current), + damping: bounceDamping, + stiffness: bounceStiffness, + restDistance, + restSpeed + }); + }; + checkCatchBoundary(0); + return t => { + /** + * We need to resolve the friction to figure out if we need a + * spring but we don't want to do this twice per frame. So here + * we flag if we updated for this frame and later if we did + * we can skip doing it again. + */ + let hasUpdatedFrame = false; + if (!spring$1 && timeReachedBoundary === undefined) { + hasUpdatedFrame = true; + applyFriction(t); + checkCatchBoundary(t); + } + /** + * If we have a spring and the provided t is beyond the moment the friction + * animation crossed the min/max boundary, use the spring. + */ + if (timeReachedBoundary !== undefined && t > timeReachedBoundary) { + state.hasReachedTarget = true; + return spring$1(t - timeReachedBoundary); + } else { + state.hasReachedTarget = false; + !hasUpdatedFrame && applyFriction(t); + return state; + } + }; +}; +exports.glide = glide; + +/***/ }), + +/***/ "../../../node_modules/@motionone/generators/dist/index.es.js": +/*!********************************************************************!*\ + !*** ../../../node_modules/@motionone/generators/dist/index.es.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "calcGeneratorVelocity", ({ + enumerable: true, + get: function () { + return _velocityEs.calcGeneratorVelocity; + } +})); +Object.defineProperty(exports, "glide", ({ + enumerable: true, + get: function () { + return _indexEs.glide; + } +})); +Object.defineProperty(exports, "pregenerateKeyframes", ({ + enumerable: true, + get: function () { + return _pregenerateKeyframesEs.pregenerateKeyframes; + } +})); +Object.defineProperty(exports, "spring", ({ + enumerable: true, + get: function () { + return _indexEs2.spring; + } +})); +var _indexEs = __webpack_require__(/*! ./glide/index.es.js */ "../../../node_modules/@motionone/generators/dist/glide/index.es.js"); +var _indexEs2 = __webpack_require__(/*! ./spring/index.es.js */ "../../../node_modules/@motionone/generators/dist/spring/index.es.js"); +var _pregenerateKeyframesEs = __webpack_require__(/*! ./utils/pregenerate-keyframes.es.js */ "../../../node_modules/@motionone/generators/dist/utils/pregenerate-keyframes.es.js"); +var _velocityEs = __webpack_require__(/*! ./utils/velocity.es.js */ "../../../node_modules/@motionone/generators/dist/utils/velocity.es.js"); + +/***/ }), + +/***/ "../../../node_modules/@motionone/generators/dist/spring/defaults.es.js": +/*!******************************************************************************!*\ + !*** ../../../node_modules/@motionone/generators/dist/spring/defaults.es.js ***! + \******************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.defaults = void 0; +const defaults = { + stiffness: 100.0, + damping: 10.0, + mass: 1.0 +}; +exports.defaults = defaults; + +/***/ }), + +/***/ "../../../node_modules/@motionone/generators/dist/spring/index.es.js": +/*!***************************************************************************!*\ + !*** ../../../node_modules/@motionone/generators/dist/spring/index.es.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.spring = void 0; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +var _defaultsEs = __webpack_require__(/*! ./defaults.es.js */ "../../../node_modules/@motionone/generators/dist/spring/defaults.es.js"); +var _utilsEs = __webpack_require__(/*! ./utils.es.js */ "../../../node_modules/@motionone/generators/dist/spring/utils.es.js"); +var _hasReachedTargetEs = __webpack_require__(/*! ../utils/has-reached-target.es.js */ "../../../node_modules/@motionone/generators/dist/utils/has-reached-target.es.js"); +var _velocityEs = __webpack_require__(/*! ../utils/velocity.es.js */ "../../../node_modules/@motionone/generators/dist/utils/velocity.es.js"); +const spring = function () { + let { + stiffness = _defaultsEs.defaults.stiffness, + damping = _defaultsEs.defaults.damping, + mass = _defaultsEs.defaults.mass, + from = 0, + to = 1, + velocity = 0.0, + restSpeed = 2, + restDistance = 0.5 + } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + velocity = velocity ? _utils.time.s(velocity) : 0.0; + const state = { + done: false, + hasReachedTarget: false, + current: from, + target: to + }; + const initialDelta = to - from; + const undampedAngularFreq = Math.sqrt(stiffness / mass) / 1000; + const dampingRatio = (0, _utilsEs.calcDampingRatio)(stiffness, damping, mass); + let resolveSpring; + if (dampingRatio < 1) { + const angularFreq = undampedAngularFreq * Math.sqrt(1 - dampingRatio * dampingRatio); + // Underdamped spring (bouncy) + resolveSpring = t => to - Math.exp(-dampingRatio * undampedAngularFreq * t) * ((-velocity + dampingRatio * undampedAngularFreq * initialDelta) / angularFreq * Math.sin(angularFreq * t) + initialDelta * Math.cos(angularFreq * t)); + } else { + // Critically damped spring + resolveSpring = t => { + return to - Math.exp(-undampedAngularFreq * t) * (initialDelta + (-velocity + undampedAngularFreq * initialDelta) * t); + }; + } + return t => { + state.current = resolveSpring(t); + const currentVelocity = t === 0 ? velocity : (0, _velocityEs.calcGeneratorVelocity)(resolveSpring, t, state.current); + const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; + const isBelowDisplacementThreshold = Math.abs(to - state.current) <= restDistance; + state.done = isBelowVelocityThreshold && isBelowDisplacementThreshold; + state.hasReachedTarget = (0, _hasReachedTargetEs.hasReachedTarget)(from, to, state.current); + return state; + }; +}; +exports.spring = spring; + +/***/ }), + +/***/ "../../../node_modules/@motionone/generators/dist/spring/utils.es.js": +/*!***************************************************************************!*\ + !*** ../../../node_modules/@motionone/generators/dist/spring/utils.es.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.calcDampingRatio = void 0; +var _defaultsEs = __webpack_require__(/*! ./defaults.es.js */ "../../../node_modules/@motionone/generators/dist/spring/defaults.es.js"); +const calcDampingRatio = function () { + let stiffness = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _defaultsEs.defaults.stiffness; + let damping = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _defaultsEs.defaults.damping; + let mass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _defaultsEs.defaults.mass; + return damping / (2 * Math.sqrt(stiffness * mass)); +}; +exports.calcDampingRatio = calcDampingRatio; + +/***/ }), + +/***/ "../../../node_modules/@motionone/generators/dist/utils/has-reached-target.es.js": +/*!***************************************************************************************!*\ + !*** ../../../node_modules/@motionone/generators/dist/utils/has-reached-target.es.js ***! + \***************************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.hasReachedTarget = hasReachedTarget; +function hasReachedTarget(origin, target, current) { + return origin < target && current >= target || origin > target && current <= target; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/generators/dist/utils/pregenerate-keyframes.es.js": +/*!******************************************************************************************!*\ + !*** ../../../node_modules/@motionone/generators/dist/utils/pregenerate-keyframes.es.js ***! + \******************************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.pregenerateKeyframes = pregenerateKeyframes; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +const timeStep = 10; +const maxDuration = 10000; +function pregenerateKeyframes(generator) { + let toUnit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noopReturn; + let overshootDuration = undefined; + let timestamp = timeStep; + let state = generator(0); + const keyframes = [toUnit(state.current)]; + while (!state.done && timestamp < maxDuration) { + state = generator(timestamp); + keyframes.push(toUnit(state.done ? state.target : state.current)); + if (overshootDuration === undefined && state.hasReachedTarget) { + overshootDuration = timestamp; + } + timestamp += timeStep; + } + const duration = timestamp - timeStep; + /** + * If generating an animation that didn't actually move, + * generate a second keyframe so we have an origin and target. + */ + if (keyframes.length === 1) keyframes.push(state.current); + return { + keyframes, + duration: duration / 1000, + overshootDuration: (overshootDuration !== null && overshootDuration !== void 0 ? overshootDuration : duration) / 1000 + }; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/generators/dist/utils/velocity.es.js": +/*!*****************************************************************************!*\ + !*** ../../../node_modules/@motionone/generators/dist/utils/velocity.es.js ***! + \*****************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.calcGeneratorVelocity = calcGeneratorVelocity; +var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); +const sampleT = 5; // ms +function calcGeneratorVelocity(resolveValue, t, current) { + const prevT = Math.max(t - sampleT, 0); + return (0, _utils.velocityPerSecond)(current - resolveValue(prevT), t - prevT); +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/types/dist/MotionValue.es.js": +/*!*********************************************************************!*\ + !*** ../../../node_modules/@motionone/types/dist/MotionValue.es.js ***! + \*********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.MotionValue = void 0; +/** + * The MotionValue tracks the state of a single animatable + * value. Currently, updatedAt and current are unused. The + * long term idea is to use this to minimise the number + * of DOM reads, and to abstract the DOM interactions here. + */ +class MotionValue { + setAnimation(animation) { + this.animation = animation; + animation === null || animation === void 0 ? void 0 : animation.finished.then(() => this.clearAnimation()).catch(() => {}); + } + clearAnimation() { + this.animation = this.generator = undefined; + } +} +exports.MotionValue = MotionValue; + +/***/ }), + +/***/ "../../../node_modules/@motionone/types/dist/index.es.js": +/*!***************************************************************!*\ + !*** ../../../node_modules/@motionone/types/dist/index.es.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "MotionValue", ({ + enumerable: true, + get: function () { + return _MotionValueEs.MotionValue; + } +})); +var _MotionValueEs = __webpack_require__(/*! ./MotionValue.es.js */ "../../../node_modules/@motionone/types/dist/MotionValue.es.js"); + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/array.es.js": +/*!***************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/array.es.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.addUniqueItem = addUniqueItem; +exports.removeItem = removeItem; +function addUniqueItem(array, item) { + array.indexOf(item) === -1 && array.push(item); +} +function removeItem(arr, item) { + const index = arr.indexOf(item); + index > -1 && arr.splice(index, 1); +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/clamp.es.js": +/*!***************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/clamp.es.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.clamp = void 0; +const clamp = (min, max, v) => Math.min(Math.max(v, min), max); +exports.clamp = clamp; + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/defaults.es.js": +/*!******************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/defaults.es.js ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.defaults = void 0; +const defaults = { + duration: 0.3, + delay: 0, + endDelay: 0, + repeat: 0, + easing: "ease" +}; +exports.defaults = defaults; + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/easing.es.js": +/*!****************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/easing.es.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getEasingForSegment = getEasingForSegment; +var _isEasingListEs = __webpack_require__(/*! ./is-easing-list.es.js */ "../../../node_modules/@motionone/utils/dist/is-easing-list.es.js"); +var _wrapEs = __webpack_require__(/*! ./wrap.es.js */ "../../../node_modules/@motionone/utils/dist/wrap.es.js"); +function getEasingForSegment(easing, i) { + return (0, _isEasingListEs.isEasingList)(easing) ? easing[(0, _wrapEs.wrap)(0, easing.length, i)] : easing; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/index.es.js": +/*!***************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/index.es.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "addUniqueItem", ({ + enumerable: true, + get: function () { + return _arrayEs.addUniqueItem; + } +})); +Object.defineProperty(exports, "clamp", ({ + enumerable: true, + get: function () { + return _clampEs.clamp; + } +})); +Object.defineProperty(exports, "defaultOffset", ({ + enumerable: true, + get: function () { + return _offsetEs.defaultOffset; + } +})); +Object.defineProperty(exports, "defaults", ({ + enumerable: true, + get: function () { + return _defaultsEs.defaults; + } +})); +Object.defineProperty(exports, "fillOffset", ({ + enumerable: true, + get: function () { + return _offsetEs.fillOffset; + } +})); +Object.defineProperty(exports, "getEasingForSegment", ({ + enumerable: true, + get: function () { + return _easingEs.getEasingForSegment; + } +})); +Object.defineProperty(exports, "interpolate", ({ + enumerable: true, + get: function () { + return _interpolateEs.interpolate; + } +})); +Object.defineProperty(exports, "isCubicBezier", ({ + enumerable: true, + get: function () { + return _isCubicBezierEs.isCubicBezier; + } +})); +Object.defineProperty(exports, "isEasingGenerator", ({ + enumerable: true, + get: function () { + return _isEasingGeneratorEs.isEasingGenerator; + } +})); +Object.defineProperty(exports, "isEasingList", ({ + enumerable: true, + get: function () { + return _isEasingListEs.isEasingList; + } +})); +Object.defineProperty(exports, "isFunction", ({ + enumerable: true, + get: function () { + return _isFunctionEs.isFunction; + } +})); +Object.defineProperty(exports, "isNumber", ({ + enumerable: true, + get: function () { + return _isNumberEs.isNumber; + } +})); +Object.defineProperty(exports, "isString", ({ + enumerable: true, + get: function () { + return _isStringEs.isString; + } +})); +Object.defineProperty(exports, "mix", ({ + enumerable: true, + get: function () { + return _mixEs.mix; + } +})); +Object.defineProperty(exports, "noop", ({ + enumerable: true, + get: function () { + return _noopEs.noop; + } +})); +Object.defineProperty(exports, "noopReturn", ({ + enumerable: true, + get: function () { + return _noopEs.noopReturn; + } +})); +Object.defineProperty(exports, "progress", ({ + enumerable: true, + get: function () { + return _progressEs.progress; + } +})); +Object.defineProperty(exports, "removeItem", ({ + enumerable: true, + get: function () { + return _arrayEs.removeItem; + } +})); +Object.defineProperty(exports, "time", ({ + enumerable: true, + get: function () { + return _timeEs.time; + } +})); +Object.defineProperty(exports, "velocityPerSecond", ({ + enumerable: true, + get: function () { + return _velocityEs.velocityPerSecond; + } +})); +Object.defineProperty(exports, "wrap", ({ + enumerable: true, + get: function () { + return _wrapEs.wrap; + } +})); +var _arrayEs = __webpack_require__(/*! ./array.es.js */ "../../../node_modules/@motionone/utils/dist/array.es.js"); +var _clampEs = __webpack_require__(/*! ./clamp.es.js */ "../../../node_modules/@motionone/utils/dist/clamp.es.js"); +var _defaultsEs = __webpack_require__(/*! ./defaults.es.js */ "../../../node_modules/@motionone/utils/dist/defaults.es.js"); +var _easingEs = __webpack_require__(/*! ./easing.es.js */ "../../../node_modules/@motionone/utils/dist/easing.es.js"); +var _interpolateEs = __webpack_require__(/*! ./interpolate.es.js */ "../../../node_modules/@motionone/utils/dist/interpolate.es.js"); +var _isCubicBezierEs = __webpack_require__(/*! ./is-cubic-bezier.es.js */ "../../../node_modules/@motionone/utils/dist/is-cubic-bezier.es.js"); +var _isEasingGeneratorEs = __webpack_require__(/*! ./is-easing-generator.es.js */ "../../../node_modules/@motionone/utils/dist/is-easing-generator.es.js"); +var _isEasingListEs = __webpack_require__(/*! ./is-easing-list.es.js */ "../../../node_modules/@motionone/utils/dist/is-easing-list.es.js"); +var _isFunctionEs = __webpack_require__(/*! ./is-function.es.js */ "../../../node_modules/@motionone/utils/dist/is-function.es.js"); +var _isNumberEs = __webpack_require__(/*! ./is-number.es.js */ "../../../node_modules/@motionone/utils/dist/is-number.es.js"); +var _isStringEs = __webpack_require__(/*! ./is-string.es.js */ "../../../node_modules/@motionone/utils/dist/is-string.es.js"); +var _mixEs = __webpack_require__(/*! ./mix.es.js */ "../../../node_modules/@motionone/utils/dist/mix.es.js"); +var _noopEs = __webpack_require__(/*! ./noop.es.js */ "../../../node_modules/@motionone/utils/dist/noop.es.js"); +var _offsetEs = __webpack_require__(/*! ./offset.es.js */ "../../../node_modules/@motionone/utils/dist/offset.es.js"); +var _progressEs = __webpack_require__(/*! ./progress.es.js */ "../../../node_modules/@motionone/utils/dist/progress.es.js"); +var _timeEs = __webpack_require__(/*! ./time.es.js */ "../../../node_modules/@motionone/utils/dist/time.es.js"); +var _velocityEs = __webpack_require__(/*! ./velocity.es.js */ "../../../node_modules/@motionone/utils/dist/velocity.es.js"); +var _wrapEs = __webpack_require__(/*! ./wrap.es.js */ "../../../node_modules/@motionone/utils/dist/wrap.es.js"); + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/interpolate.es.js": +/*!*********************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/interpolate.es.js ***! + \*********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.interpolate = interpolate; +var _mixEs = __webpack_require__(/*! ./mix.es.js */ "../../../node_modules/@motionone/utils/dist/mix.es.js"); +var _noopEs = __webpack_require__(/*! ./noop.es.js */ "../../../node_modules/@motionone/utils/dist/noop.es.js"); +var _offsetEs = __webpack_require__(/*! ./offset.es.js */ "../../../node_modules/@motionone/utils/dist/offset.es.js"); +var _progressEs = __webpack_require__(/*! ./progress.es.js */ "../../../node_modules/@motionone/utils/dist/progress.es.js"); +var _easingEs = __webpack_require__(/*! ./easing.es.js */ "../../../node_modules/@motionone/utils/dist/easing.es.js"); +var _clampEs = __webpack_require__(/*! ./clamp.es.js */ "../../../node_modules/@motionone/utils/dist/clamp.es.js"); +function interpolate(output) { + let input = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _offsetEs.defaultOffset)(output.length); + let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _noopEs.noopReturn; + const length = output.length; + /** + * If the input length is lower than the output we + * fill the input to match. This currently assumes the input + * is an animation progress value so is a good candidate for + * moving outside the function. + */ + const remainder = length - input.length; + remainder > 0 && (0, _offsetEs.fillOffset)(input, remainder); + return t => { + let i = 0; + for (; i < length - 2; i++) { + if (t < input[i + 1]) break; + } + let progressInRange = (0, _clampEs.clamp)(0, 1, (0, _progressEs.progress)(input[i], input[i + 1], t)); + const segmentEasing = (0, _easingEs.getEasingForSegment)(easing, i); + progressInRange = segmentEasing(progressInRange); + return (0, _mixEs.mix)(output[i], output[i + 1], progressInRange); + }; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/is-cubic-bezier.es.js": +/*!*************************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/is-cubic-bezier.es.js ***! + \*************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isCubicBezier = void 0; +var _isNumberEs = __webpack_require__(/*! ./is-number.es.js */ "../../../node_modules/@motionone/utils/dist/is-number.es.js"); +const isCubicBezier = easing => Array.isArray(easing) && (0, _isNumberEs.isNumber)(easing[0]); +exports.isCubicBezier = isCubicBezier; + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/is-easing-generator.es.js": +/*!*****************************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/is-easing-generator.es.js ***! + \*****************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isEasingGenerator = void 0; +const isEasingGenerator = easing => typeof easing === "object" && Boolean(easing.createAnimation); +exports.isEasingGenerator = isEasingGenerator; + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/is-easing-list.es.js": +/*!************************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/is-easing-list.es.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isEasingList = void 0; +var _isNumberEs = __webpack_require__(/*! ./is-number.es.js */ "../../../node_modules/@motionone/utils/dist/is-number.es.js"); +const isEasingList = easing => Array.isArray(easing) && !(0, _isNumberEs.isNumber)(easing[0]); +exports.isEasingList = isEasingList; + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/is-function.es.js": +/*!*********************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/is-function.es.js ***! + \*********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isFunction = void 0; +const isFunction = value => typeof value === "function"; +exports.isFunction = isFunction; + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/is-number.es.js": +/*!*******************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/is-number.es.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isNumber = void 0; +const isNumber = value => typeof value === "number"; +exports.isNumber = isNumber; + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/is-string.es.js": +/*!*******************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/is-string.es.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isString = void 0; +const isString = value => typeof value === "string"; +exports.isString = isString; + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/mix.es.js": +/*!*************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/mix.es.js ***! + \*************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.mix = void 0; +const mix = (min, max, progress) => -progress * min + progress * max + min; +exports.mix = mix; + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/noop.es.js": +/*!**************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/noop.es.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.noopReturn = exports.noop = void 0; +const noop = () => {}; +exports.noop = noop; +const noopReturn = v => v; +exports.noopReturn = noopReturn; + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/offset.es.js": +/*!****************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/offset.es.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.defaultOffset = defaultOffset; +exports.fillOffset = fillOffset; +var _mixEs = __webpack_require__(/*! ./mix.es.js */ "../../../node_modules/@motionone/utils/dist/mix.es.js"); +var _progressEs = __webpack_require__(/*! ./progress.es.js */ "../../../node_modules/@motionone/utils/dist/progress.es.js"); +function fillOffset(offset, remaining) { + const min = offset[offset.length - 1]; + for (let i = 1; i <= remaining; i++) { + const offsetProgress = (0, _progressEs.progress)(0, remaining, i); + offset.push((0, _mixEs.mix)(min, 1, offsetProgress)); + } +} +function defaultOffset(length) { + const offset = [0]; + fillOffset(offset, length - 1); + return offset; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/progress.es.js": +/*!******************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/progress.es.js ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.progress = void 0; +const progress = (min, max, value) => max - min === 0 ? 1 : (value - min) / (max - min); +exports.progress = progress; + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/time.es.js": +/*!**************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/time.es.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.time = void 0; +const time = { + ms: seconds => seconds * 1000, + s: milliseconds => milliseconds / 1000 +}; +exports.time = time; + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/velocity.es.js": +/*!******************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/velocity.es.js ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.velocityPerSecond = velocityPerSecond; +/* + Convert velocity into velocity per second + + @param [number]: Unit per frame + @param [number]: Frame duration in ms +*/ +function velocityPerSecond(velocity, frameDuration) { + return frameDuration ? velocity * (1000 / frameDuration) : 0; +} + +/***/ }), + +/***/ "../../../node_modules/@motionone/utils/dist/wrap.es.js": +/*!**************************************************************!*\ + !*** ../../../node_modules/@motionone/utils/dist/wrap.es.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.wrap = void 0; +const wrap = (min, max, v) => { + const rangeSize = max - min; + return ((v - min) % rangeSize + rangeSize) % rangeSize + min; +}; +exports.wrap = wrap; + +/***/ }), + +/***/ "../../../node_modules/@n1ru4l/push-pull-async-iterable-iterator/index.js": +/*!********************************************************************************!*\ + !*** ../../../node_modules/@n1ru4l/push-pull-async-iterable-iterator/index.js ***! + \********************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +function createDeferred() { + const d = {}; + d.promise = new Promise((resolve, reject) => { + d.resolve = resolve; + d.reject = reject; + }); + return d; +} +const SYMBOL_FINISHED = Symbol(); +const SYMBOL_NEW_VALUE = Symbol(); +/** + * makePushPullAsyncIterableIterator + * + * The iterable will publish values until return or throw is called. + * Afterwards it is in the completed state and cannot be used for publishing any further values. + * It will handle back-pressure and keep pushed values until they are consumed by a source. + */ +function makePushPullAsyncIterableIterator() { + let isRunning = true; + const values = []; + let newValueD = createDeferred(); + const finishedD = createDeferred(); + const asyncIterableIterator = async function* PushPullAsyncIterableIterator() { + while (true) { + if (values.length > 0) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + yield values.shift(); + } else { + const result = await Promise.race([newValueD.promise, finishedD.promise]); + if (result === SYMBOL_FINISHED) { + break; + } + if (result !== SYMBOL_NEW_VALUE) { + throw result; + } + } + } + }(); + function pushValue(value) { + if (isRunning === false) { + // TODO: Should this throw? + return; + } + values.push(value); + newValueD.resolve(SYMBOL_NEW_VALUE); + newValueD = createDeferred(); + } + // We monkey patch the original generator for clean-up + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const originalReturn = asyncIterableIterator.return.bind(asyncIterableIterator); + asyncIterableIterator.return = function () { + isRunning = false; + finishedD.resolve(SYMBOL_FINISHED); + return originalReturn(...arguments); + }; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const originalThrow = asyncIterableIterator.throw.bind(asyncIterableIterator); + asyncIterableIterator.throw = err => { + isRunning = false; + finishedD.resolve(err); + return originalThrow(err); + }; + return { + pushValue, + asyncIterableIterator + }; +} +const makeAsyncIterableIteratorFromSink = make => { + const { + pushValue, + asyncIterableIterator + } = makePushPullAsyncIterableIterator(); + const dispose = make({ + next: value => { + pushValue(value); + }, + complete: () => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + asyncIterableIterator.return(); + }, + error: err => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + asyncIterableIterator.throw(err); + } + }); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const originalReturn = asyncIterableIterator.return; + let returnValue = undefined; + asyncIterableIterator.return = () => { + if (returnValue === undefined) { + dispose(); + returnValue = originalReturn(); + } + return returnValue; + }; + return asyncIterableIterator; +}; +function applyAsyncIterableIteratorToSink(asyncIterableIterator, sink) { + const run = async () => { + try { + for await (const value of asyncIterableIterator) { + sink.next(value); + } + sink.complete(); + } catch (err) { + sink.error(err); + } + }; + run(); + return () => { + var _a; + (_a = asyncIterableIterator.return) === null || _a === void 0 ? void 0 : _a.call(asyncIterableIterator); + }; +} +function isAsyncIterable(input) { + return typeof input === "object" && input !== null && ( + // The AsyncGenerator check is for Safari on iOS which currently does not have + // Symbol.asyncIterator implemented + // That means every custom AsyncIterable must be built using a AsyncGeneratorFunction (async function * () {}) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + input[Symbol.toStringTag] === "AsyncGenerator" || Symbol.asyncIterator && Symbol.asyncIterator in input); +} +exports.applyAsyncIterableIteratorToSink = applyAsyncIterableIteratorToSink; +exports.isAsyncIterable = isAsyncIterable; +exports.makeAsyncIterableIteratorFromSink = makeAsyncIterableIteratorFromSink; +exports.makePushPullAsyncIterableIterator = makePushPullAsyncIterableIterator; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/primitive/dist/index.js": +/*!***************************************************************!*\ + !*** ../../../node_modules/@radix-ui/primitive/dist/index.js ***! + \***************************************************************/ +/***/ (function(module) { + + + +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +$parcel$export(module.exports, "composeEventHandlers", () => $1a6a90a521dcd173$export$b9ecd428b558ff10); +function $1a6a90a521dcd173$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler) { + let { + checkForDefaultPrevented = true + } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return function handleEvent(event) { + originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event); + if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event); + }; +} + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-arrow/dist/index.js": +/*!*****************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-arrow/dist/index.js ***! + \*****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $eQpDd$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $eQpDd$react = __webpack_require__(/*! react */ "react"); +var $eQpDd$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "Arrow", () => $09f4ad68a9251bc3$export$21b07c8f274aebd5); +$parcel$export(module.exports, "Root", () => $09f4ad68a9251bc3$export$be92b6f5f03c0fe9); + +/* ------------------------------------------------------------------------------------------------- + * Arrow + * -----------------------------------------------------------------------------------------------*/ +const $09f4ad68a9251bc3$var$NAME = 'Arrow'; +const $09f4ad68a9251bc3$export$21b07c8f274aebd5 = /*#__PURE__*/$eQpDd$react.forwardRef((props, forwardedRef) => { + const { + children: children, + width = 10, + height = 5, + ...arrowProps + } = props; + return /*#__PURE__*/$eQpDd$react.createElement($eQpDd$radixuireactprimitive.Primitive.svg, $parcel$interopDefault($eQpDd$babelruntimehelpersextends)({}, arrowProps, { + ref: forwardedRef, + width: width, + height: height, + viewBox: "0 0 30 10", + preserveAspectRatio: "none" + }), props.asChild ? children : /*#__PURE__*/$eQpDd$react.createElement("polygon", { + points: "0,0 30,0 15,10" + })); +}); +/*#__PURE__*/ +Object.assign($09f4ad68a9251bc3$export$21b07c8f274aebd5, { + displayName: $09f4ad68a9251bc3$var$NAME +}); +/* -----------------------------------------------------------------------------------------------*/ +const $09f4ad68a9251bc3$export$be92b6f5f03c0fe9 = $09f4ad68a9251bc3$export$21b07c8f274aebd5; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-collection/dist/index.js": +/*!**********************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-collection/dist/index.js ***! + \**********************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $hnlpS$react = __webpack_require__(/*! react */ "react"); +var $hnlpS$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); +var $hnlpS$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); +var $hnlpS$radixuireactslot = __webpack_require__(/*! @radix-ui/react-slot */ "../../../node_modules/@radix-ui/react-slot/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "createCollection", () => $1a96635ec239608b$export$c74125a8e3af6bb2); + +// We have resorted to returning slots directly rather than exposing primitives that can then +// be slotted like ``. +// This is because we encountered issues with generic types that cannot be statically analysed +// due to creating them dynamically via createCollection. +function $1a96635ec239608b$export$c74125a8e3af6bb2(name) { + /* ----------------------------------------------------------------------------------------------- + * CollectionProvider + * ---------------------------------------------------------------------------------------------*/ + const PROVIDER_NAME = name + 'CollectionProvider'; + const [createCollectionContext, createCollectionScope] = $hnlpS$radixuireactcontext.createContextScope(PROVIDER_NAME); + const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, { + collectionRef: { + current: null + }, + itemMap: new Map() + }); + const CollectionProvider = props => { + const { + scope: scope, + children: children + } = props; + const ref = $parcel$interopDefault($hnlpS$react).useRef(null); + const itemMap = $parcel$interopDefault($hnlpS$react).useRef(new Map()).current; + return /*#__PURE__*/$parcel$interopDefault($hnlpS$react).createElement(CollectionProviderImpl, { + scope: scope, + itemMap: itemMap, + collectionRef: ref + }, children); + }; + /*#__PURE__*/ + Object.assign(CollectionProvider, { + displayName: PROVIDER_NAME + }); + /* ----------------------------------------------------------------------------------------------- + * CollectionSlot + * ---------------------------------------------------------------------------------------------*/ + const COLLECTION_SLOT_NAME = name + 'CollectionSlot'; + const CollectionSlot = /*#__PURE__*/$parcel$interopDefault($hnlpS$react).forwardRef((props, forwardedRef) => { + const { + scope: scope, + children: children + } = props; + const context = useCollectionContext(COLLECTION_SLOT_NAME, scope); + const composedRefs = $hnlpS$radixuireactcomposerefs.useComposedRefs(forwardedRef, context.collectionRef); + return /*#__PURE__*/$parcel$interopDefault($hnlpS$react).createElement($hnlpS$radixuireactslot.Slot, { + ref: composedRefs + }, children); + }); + /*#__PURE__*/ + Object.assign(CollectionSlot, { + displayName: COLLECTION_SLOT_NAME + }); + /* ----------------------------------------------------------------------------------------------- + * CollectionItem + * ---------------------------------------------------------------------------------------------*/ + const ITEM_SLOT_NAME = name + 'CollectionItemSlot'; + const ITEM_DATA_ATTR = 'data-radix-collection-item'; + const CollectionItemSlot = /*#__PURE__*/$parcel$interopDefault($hnlpS$react).forwardRef((props, forwardedRef) => { + const { + scope: scope, + children: children, + ...itemData + } = props; + const ref = $parcel$interopDefault($hnlpS$react).useRef(null); + const composedRefs = $hnlpS$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); + const context = useCollectionContext(ITEM_SLOT_NAME, scope); + $parcel$interopDefault($hnlpS$react).useEffect(() => { + context.itemMap.set(ref, { + ref: ref, + ...itemData + }); + return () => void context.itemMap.delete(ref); + }); + return /*#__PURE__*/$parcel$interopDefault($hnlpS$react).createElement($hnlpS$radixuireactslot.Slot, { + [ITEM_DATA_ATTR]: '', + ref: composedRefs + }, children); + }); + /*#__PURE__*/ + Object.assign(CollectionItemSlot, { + displayName: ITEM_SLOT_NAME + }); + /* ----------------------------------------------------------------------------------------------- + * useCollection + * ---------------------------------------------------------------------------------------------*/ + function useCollection(scope) { + const context = useCollectionContext(name + 'CollectionConsumer', scope); + const getItems = $parcel$interopDefault($hnlpS$react).useCallback(() => { + const collectionNode = context.collectionRef.current; + if (!collectionNode) return []; + const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`)); + const items = Array.from(context.itemMap.values()); + const orderedItems = items.sort((a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)); + return orderedItems; + }, [context.collectionRef, context.itemMap]); + return getItems; + } + return [{ + Provider: CollectionProvider, + Slot: CollectionSlot, + ItemSlot: CollectionItemSlot + }, useCollection, createCollectionScope]; +} + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js": +/*!************************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-compose-refs/dist/index.js ***! + \************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $dJwbH$react = __webpack_require__(/*! react */ "react"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +$parcel$export(module.exports, "composeRefs", () => $9c2aaba23466b352$export$43e446d32b3d21af); +$parcel$export(module.exports, "useComposedRefs", () => $9c2aaba23466b352$export$c7b2cbe3552a0d05); + +/** + * Set a given ref to a given value + * This utility takes care of different types of refs: callback refs and RefObject(s) + */ +function $9c2aaba23466b352$var$setRef(ref, value) { + if (typeof ref === 'function') ref(value);else if (ref !== null && ref !== undefined) ref.current = value; +} +/** + * A utility to compose multiple refs together + * Accepts callback refs and RefObject(s) + */ +function $9c2aaba23466b352$export$43e446d32b3d21af() { + for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { + refs[_key] = arguments[_key]; + } + return node => refs.forEach(ref => $9c2aaba23466b352$var$setRef(ref, node)); +} +/** + * A custom hook that composes multiple refs + * Accepts callback refs and RefObject(s) + */ +function $9c2aaba23466b352$export$c7b2cbe3552a0d05() { + for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + refs[_key2] = arguments[_key2]; + } + // eslint-disable-next-line react-hooks/exhaustive-deps + return $dJwbH$react.useCallback($9c2aaba23466b352$export$43e446d32b3d21af(...refs), refs); +} + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-context/dist/index.js": +/*!*******************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-context/dist/index.js ***! + \*******************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $4O1Ne$react = __webpack_require__(/*! react */ "react"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +$parcel$export(module.exports, "createContext", () => $dec3cc0142d4f286$export$fd42f52fd3ae1109); +$parcel$export(module.exports, "createContextScope", () => $dec3cc0142d4f286$export$50c7b4e9d9f19c1); +function $dec3cc0142d4f286$export$fd42f52fd3ae1109(rootComponentName, defaultContext) { + const Context = /*#__PURE__*/$4O1Ne$react.createContext(defaultContext); + function Provider(props) { + const { + children: children, + ...context + } = props; // Only re-memoize when prop values change + // eslint-disable-next-line react-hooks/exhaustive-deps + const value = $4O1Ne$react.useMemo(() => context, Object.values(context)); + return /*#__PURE__*/$4O1Ne$react.createElement(Context.Provider, { + value: value + }, children); + } + function useContext(consumerName) { + const context = $4O1Ne$react.useContext(Context); + if (context) return context; + if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context. + throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); + } + Provider.displayName = rootComponentName + 'Provider'; + return [Provider, useContext]; +} +/* ------------------------------------------------------------------------------------------------- + * createContextScope + * -----------------------------------------------------------------------------------------------*/ +function $dec3cc0142d4f286$export$50c7b4e9d9f19c1(scopeName) { + let createContextScopeDeps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + let defaultContexts = []; + /* ----------------------------------------------------------------------------------------------- + * createContext + * ---------------------------------------------------------------------------------------------*/ + function $dec3cc0142d4f286$export$fd42f52fd3ae1109(rootComponentName, defaultContext) { + const BaseContext = /*#__PURE__*/$4O1Ne$react.createContext(defaultContext); + const index = defaultContexts.length; + defaultContexts = [...defaultContexts, defaultContext]; + function Provider(props) { + const { + scope: scope, + children: children, + ...context + } = props; + const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change + // eslint-disable-next-line react-hooks/exhaustive-deps + const value = $4O1Ne$react.useMemo(() => context, Object.values(context)); + return /*#__PURE__*/$4O1Ne$react.createElement(Context.Provider, { + value: value + }, children); + } + function useContext(consumerName, scope) { + const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; + const context = $4O1Ne$react.useContext(Context); + if (context) return context; + if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context. + throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); + } + Provider.displayName = rootComponentName + 'Provider'; + return [Provider, useContext]; + } + /* ----------------------------------------------------------------------------------------------- + * createScope + * ---------------------------------------------------------------------------------------------*/ + const createScope = () => { + const scopeContexts = defaultContexts.map(defaultContext => { + return /*#__PURE__*/$4O1Ne$react.createContext(defaultContext); + }); + return function useScope(scope) { + const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts; + return $4O1Ne$react.useMemo(() => ({ + [`__scope${scopeName}`]: { + ...scope, + [scopeName]: contexts + } + }), [scope, contexts]); + }; + }; + createScope.scopeName = scopeName; + return [$dec3cc0142d4f286$export$fd42f52fd3ae1109, $dec3cc0142d4f286$var$composeContextScopes(createScope, ...createContextScopeDeps)]; +} +/* ------------------------------------------------------------------------------------------------- + * composeContextScopes + * -----------------------------------------------------------------------------------------------*/ +function $dec3cc0142d4f286$var$composeContextScopes() { + for (var _len = arguments.length, scopes = new Array(_len), _key = 0; _key < _len; _key++) { + scopes[_key] = arguments[_key]; + } + const baseScope = scopes[0]; + if (scopes.length === 1) return baseScope; + const createScope1 = () => { + const scopeHooks = scopes.map(createScope => ({ + useScope: createScope(), + scopeName: createScope.scopeName + })); + return function useComposedScopes(overrideScopes) { + const nextScopes1 = scopeHooks.reduce((nextScopes, _ref) => { + let { + useScope: useScope, + scopeName: scopeName + } = _ref; + // We are calling a hook inside a callback which React warns against to avoid inconsistent + // renders, however, scoping doesn't have render side effects so we ignore the rule. + // eslint-disable-next-line react-hooks/rules-of-hooks + const scopeProps = useScope(overrideScopes); + const currentScope = scopeProps[`__scope${scopeName}`]; + return { + ...nextScopes, + ...currentScope + }; + }, {}); + return $4O1Ne$react.useMemo(() => ({ + [`__scope${baseScope.scopeName}`]: nextScopes1 + }), [nextScopes1]); + }; + }; + createScope1.scopeName = baseScope.scopeName; + return createScope1; +} + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-dialog/dist/index.js": +/*!******************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-dialog/dist/index.js ***! + \******************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $aJCrN$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $aJCrN$react = __webpack_require__(/*! react */ "react"); +var $aJCrN$radixuiprimitive = __webpack_require__(/*! @radix-ui/primitive */ "../../../node_modules/@radix-ui/primitive/dist/index.js"); +var $aJCrN$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); +var $aJCrN$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); +var $aJCrN$radixuireactid = __webpack_require__(/*! @radix-ui/react-id */ "../../../node_modules/@radix-ui/react-id/dist/index.js"); +var $aJCrN$radixuireactusecontrollablestate = __webpack_require__(/*! @radix-ui/react-use-controllable-state */ "../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js"); +var $aJCrN$radixuireactdismissablelayer = __webpack_require__(/*! @radix-ui/react-dismissable-layer */ "../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.js"); +var $aJCrN$radixuireactfocusscope = __webpack_require__(/*! @radix-ui/react-focus-scope */ "../../../node_modules/@radix-ui/react-focus-scope/dist/index.js"); +var $aJCrN$radixuireactportal = __webpack_require__(/*! @radix-ui/react-portal */ "../../../node_modules/@radix-ui/react-portal/dist/index.js"); +var $aJCrN$radixuireactpresence = __webpack_require__(/*! @radix-ui/react-presence */ "../../../node_modules/@radix-ui/react-presence/dist/index.js"); +var $aJCrN$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); +var $aJCrN$radixuireactfocusguards = __webpack_require__(/*! @radix-ui/react-focus-guards */ "../../../node_modules/@radix-ui/react-focus-guards/dist/index.js"); +var $aJCrN$reactremovescroll = __webpack_require__(/*! react-remove-scroll */ "../../../node_modules/react-remove-scroll/dist/es2015/index.js"); +var $aJCrN$ariahidden = __webpack_require__(/*! aria-hidden */ "../../../node_modules/aria-hidden/dist/es2015/index.js"); +var $aJCrN$radixuireactslot = __webpack_require__(/*! @radix-ui/react-slot */ "../../../node_modules/@radix-ui/react-slot/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "createDialogScope", () => $f4833395aa1bca1a$export$cc702773b8ea3e41); +$parcel$export(module.exports, "Dialog", () => $f4833395aa1bca1a$export$3ddf2d174ce01153); +$parcel$export(module.exports, "DialogTrigger", () => $f4833395aa1bca1a$export$2e1e1122cf0cba88); +$parcel$export(module.exports, "DialogPortal", () => $f4833395aa1bca1a$export$dad7c95542bacce0); +$parcel$export(module.exports, "DialogOverlay", () => $f4833395aa1bca1a$export$bd1d06c79be19e17); +$parcel$export(module.exports, "DialogContent", () => $f4833395aa1bca1a$export$b6d9565de1e068cf); +$parcel$export(module.exports, "DialogTitle", () => $f4833395aa1bca1a$export$16f7638e4a34b909); +$parcel$export(module.exports, "DialogDescription", () => $f4833395aa1bca1a$export$94e94c2ec2c954d5); +$parcel$export(module.exports, "DialogClose", () => $f4833395aa1bca1a$export$fba2fb7cd781b7ac); +$parcel$export(module.exports, "Root", () => $f4833395aa1bca1a$export$be92b6f5f03c0fe9); +$parcel$export(module.exports, "Trigger", () => $f4833395aa1bca1a$export$41fb9f06171c75f4); +$parcel$export(module.exports, "Portal", () => $f4833395aa1bca1a$export$602eac185826482c); +$parcel$export(module.exports, "Overlay", () => $f4833395aa1bca1a$export$c6fdb837b070b4ff); +$parcel$export(module.exports, "Content", () => $f4833395aa1bca1a$export$7c6e2c02157bb7d2); +$parcel$export(module.exports, "Title", () => $f4833395aa1bca1a$export$f99233281efd08a0); +$parcel$export(module.exports, "Description", () => $f4833395aa1bca1a$export$393edc798c47379d); +$parcel$export(module.exports, "Close", () => $f4833395aa1bca1a$export$f39c2d165cd861fe); +$parcel$export(module.exports, "WarningProvider", () => $f4833395aa1bca1a$export$69b62a49393917d6); + +/* ------------------------------------------------------------------------------------------------- + * Dialog + * -----------------------------------------------------------------------------------------------*/ +const $f4833395aa1bca1a$var$DIALOG_NAME = 'Dialog'; +const [$f4833395aa1bca1a$var$createDialogContext, $f4833395aa1bca1a$export$cc702773b8ea3e41] = $aJCrN$radixuireactcontext.createContextScope($f4833395aa1bca1a$var$DIALOG_NAME); +const [$f4833395aa1bca1a$var$DialogProvider, $f4833395aa1bca1a$var$useDialogContext] = $f4833395aa1bca1a$var$createDialogContext($f4833395aa1bca1a$var$DIALOG_NAME); +const $f4833395aa1bca1a$export$3ddf2d174ce01153 = props => { + const { + __scopeDialog: __scopeDialog, + children: children, + open: openProp, + defaultOpen: defaultOpen, + onOpenChange: onOpenChange, + modal = true + } = props; + const triggerRef = $aJCrN$react.useRef(null); + const contentRef = $aJCrN$react.useRef(null); + const [open = false, setOpen] = $aJCrN$radixuireactusecontrollablestate.useControllableState({ + prop: openProp, + defaultProp: defaultOpen, + onChange: onOpenChange + }); + return /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$DialogProvider, { + scope: __scopeDialog, + triggerRef: triggerRef, + contentRef: contentRef, + contentId: $aJCrN$radixuireactid.useId(), + titleId: $aJCrN$radixuireactid.useId(), + descriptionId: $aJCrN$radixuireactid.useId(), + open: open, + onOpenChange: setOpen, + onOpenToggle: $aJCrN$react.useCallback(() => setOpen(prevOpen => !prevOpen), [setOpen]), + modal: modal + }, children); +}; +/*#__PURE__*/ +Object.assign($f4833395aa1bca1a$export$3ddf2d174ce01153, { + displayName: $f4833395aa1bca1a$var$DIALOG_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DialogTrigger + * -----------------------------------------------------------------------------------------------*/ +const $f4833395aa1bca1a$var$TRIGGER_NAME = 'DialogTrigger'; +const $f4833395aa1bca1a$export$2e1e1122cf0cba88 = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { + const { + __scopeDialog: __scopeDialog, + ...triggerProps + } = props; + const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$TRIGGER_NAME, __scopeDialog); + const composedTriggerRef = $aJCrN$radixuireactcomposerefs.useComposedRefs(forwardedRef, context.triggerRef); + return /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.button, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({ + type: "button", + "aria-haspopup": "dialog", + "aria-expanded": context.open, + "aria-controls": context.contentId, + "data-state": $f4833395aa1bca1a$var$getState(context.open) + }, triggerProps, { + ref: composedTriggerRef, + onClick: $aJCrN$radixuiprimitive.composeEventHandlers(props.onClick, context.onOpenToggle) + })); +}); +/*#__PURE__*/ +Object.assign($f4833395aa1bca1a$export$2e1e1122cf0cba88, { + displayName: $f4833395aa1bca1a$var$TRIGGER_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DialogPortal + * -----------------------------------------------------------------------------------------------*/ +const $f4833395aa1bca1a$var$PORTAL_NAME = 'DialogPortal'; +const [$f4833395aa1bca1a$var$PortalProvider, $f4833395aa1bca1a$var$usePortalContext] = $f4833395aa1bca1a$var$createDialogContext($f4833395aa1bca1a$var$PORTAL_NAME, { + forceMount: undefined +}); +const $f4833395aa1bca1a$export$dad7c95542bacce0 = props => { + const { + __scopeDialog: __scopeDialog, + forceMount: forceMount, + children: children, + container: container + } = props; + const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$PORTAL_NAME, __scopeDialog); + return /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$PortalProvider, { + scope: __scopeDialog, + forceMount: forceMount + }, $aJCrN$react.Children.map(children, child => /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactpresence.Presence, { + present: forceMount || context.open + }, /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactportal.Portal, { + asChild: true, + container: container + }, child)))); +}; +/*#__PURE__*/ +Object.assign($f4833395aa1bca1a$export$dad7c95542bacce0, { + displayName: $f4833395aa1bca1a$var$PORTAL_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DialogOverlay + * -----------------------------------------------------------------------------------------------*/ +const $f4833395aa1bca1a$var$OVERLAY_NAME = 'DialogOverlay'; +const $f4833395aa1bca1a$export$bd1d06c79be19e17 = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { + const portalContext = $f4833395aa1bca1a$var$usePortalContext($f4833395aa1bca1a$var$OVERLAY_NAME, props.__scopeDialog); + const { + forceMount = portalContext.forceMount, + ...overlayProps + } = props; + const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$OVERLAY_NAME, props.__scopeDialog); + return context.modal ? /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactpresence.Presence, { + present: forceMount || context.open + }, /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$DialogOverlayImpl, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({}, overlayProps, { + ref: forwardedRef + }))) : null; +}); +/*#__PURE__*/ +Object.assign($f4833395aa1bca1a$export$bd1d06c79be19e17, { + displayName: $f4833395aa1bca1a$var$OVERLAY_NAME +}); +const $f4833395aa1bca1a$var$DialogOverlayImpl = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { + const { + __scopeDialog: __scopeDialog, + ...overlayProps + } = props; + const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$OVERLAY_NAME, __scopeDialog); + return /*#__PURE__*/ (// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll` + // ie. when `Overlay` and `Content` are siblings + $aJCrN$react.createElement($aJCrN$reactremovescroll.RemoveScroll, { + as: $aJCrN$radixuireactslot.Slot, + allowPinchZoom: true, + shards: [context.contentRef] + }, /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.div, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({ + "data-state": $f4833395aa1bca1a$var$getState(context.open) + }, overlayProps, { + ref: forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay. + , + + style: { + pointerEvents: 'auto', + ...overlayProps.style + } + }))) + ); +}); +/* ------------------------------------------------------------------------------------------------- + * DialogContent + * -----------------------------------------------------------------------------------------------*/ +const $f4833395aa1bca1a$var$CONTENT_NAME = 'DialogContent'; +const $f4833395aa1bca1a$export$b6d9565de1e068cf = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { + const portalContext = $f4833395aa1bca1a$var$usePortalContext($f4833395aa1bca1a$var$CONTENT_NAME, props.__scopeDialog); + const { + forceMount = portalContext.forceMount, + ...contentProps + } = props; + const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CONTENT_NAME, props.__scopeDialog); + return /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactpresence.Presence, { + present: forceMount || context.open + }, context.modal ? /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$DialogContentModal, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({}, contentProps, { + ref: forwardedRef + })) : /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$DialogContentNonModal, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({}, contentProps, { + ref: forwardedRef + }))); +}); +/*#__PURE__*/ +Object.assign($f4833395aa1bca1a$export$b6d9565de1e068cf, { + displayName: $f4833395aa1bca1a$var$CONTENT_NAME +}); +/* -----------------------------------------------------------------------------------------------*/ +const $f4833395aa1bca1a$var$DialogContentModal = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { + const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CONTENT_NAME, props.__scopeDialog); + const contentRef = $aJCrN$react.useRef(null); + const composedRefs = $aJCrN$radixuireactcomposerefs.useComposedRefs(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal) + $aJCrN$react.useEffect(() => { + const content = contentRef.current; + if (content) return $aJCrN$ariahidden.hideOthers(content); + }, []); + return /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$DialogContentImpl, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({}, props, { + ref: composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed + , + + trapFocus: context.open, + disableOutsidePointerEvents: true, + onCloseAutoFocus: $aJCrN$radixuiprimitive.composeEventHandlers(props.onCloseAutoFocus, event => { + var _context$triggerRef$c; + event.preventDefault(); + (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus(); + }), + onPointerDownOutside: $aJCrN$radixuiprimitive.composeEventHandlers(props.onPointerDownOutside, event => { + const originalEvent = event.detail.originalEvent; + const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; + const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because + // it is effectively as if we right-clicked the `Overlay`. + if (isRightClick) event.preventDefault(); + }) // When focus is trapped, a `focusout` event may still happen. + , + + onFocusOutside: $aJCrN$radixuiprimitive.composeEventHandlers(props.onFocusOutside, event => event.preventDefault()) + })); +}); +/* -----------------------------------------------------------------------------------------------*/ +const $f4833395aa1bca1a$var$DialogContentNonModal = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { + const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CONTENT_NAME, props.__scopeDialog); + const hasInteractedOutsideRef = $aJCrN$react.useRef(false); + const hasPointerDownOutsideRef = $aJCrN$react.useRef(false); + return /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$DialogContentImpl, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({}, props, { + ref: forwardedRef, + trapFocus: false, + disableOutsidePointerEvents: false, + onCloseAutoFocus: event => { + var _props$onCloseAutoFoc; + (_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event); + if (!event.defaultPrevented) { + var _context$triggerRef$c2; + if (!hasInteractedOutsideRef.current) (_context$triggerRef$c2 = context.triggerRef.current) === null || _context$triggerRef$c2 === void 0 || _context$triggerRef$c2.focus(); // Always prevent auto focus because we either focus manually or want user agent focus + event.preventDefault(); + } + hasInteractedOutsideRef.current = false; + hasPointerDownOutsideRef.current = false; + }, + onInteractOutside: event => { + var _props$onInteractOuts, _context$triggerRef$c3; + (_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event); + if (!event.defaultPrevented) { + hasInteractedOutsideRef.current = true; + if (event.detail.originalEvent.type === 'pointerdown') hasPointerDownOutsideRef.current = true; + } // Prevent dismissing when clicking the trigger. + // As the trigger is already setup to close, without doing so would + // cause it to close and immediately open. + const target = event.target; + const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target); + if (targetIsTrigger) event.preventDefault(); // On Safari if the trigger is inside a container with tabIndex={0}, when clicked + // we will get the pointer down outside event on the trigger, but then a subsequent + // focus outside event on the container, we ignore any focus outside event when we've + // already had a pointer down outside event. + if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) event.preventDefault(); + } + })); +}); +/* -----------------------------------------------------------------------------------------------*/ +const $f4833395aa1bca1a$var$DialogContentImpl = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { + const { + __scopeDialog: __scopeDialog, + trapFocus: trapFocus, + onOpenAutoFocus: onOpenAutoFocus, + onCloseAutoFocus: onCloseAutoFocus, + ...contentProps + } = props; + const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CONTENT_NAME, __scopeDialog); + const contentRef = $aJCrN$react.useRef(null); + const composedRefs = $aJCrN$radixuireactcomposerefs.useComposedRefs(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be + // the last element in the DOM (beacuse of the `Portal`) + $aJCrN$radixuireactfocusguards.useFocusGuards(); + return /*#__PURE__*/$aJCrN$react.createElement($aJCrN$react.Fragment, null, /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactfocusscope.FocusScope, { + asChild: true, + loop: true, + trapped: trapFocus, + onMountAutoFocus: onOpenAutoFocus, + onUnmountAutoFocus: onCloseAutoFocus + }, /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactdismissablelayer.DismissableLayer, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({ + role: "dialog", + id: context.contentId, + "aria-describedby": context.descriptionId, + "aria-labelledby": context.titleId, + "data-state": $f4833395aa1bca1a$var$getState(context.open) + }, contentProps, { + ref: composedRefs, + onDismiss: () => context.onOpenChange(false) + }))), false); +}); +/* ------------------------------------------------------------------------------------------------- + * DialogTitle + * -----------------------------------------------------------------------------------------------*/ +const $f4833395aa1bca1a$var$TITLE_NAME = 'DialogTitle'; +const $f4833395aa1bca1a$export$16f7638e4a34b909 = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { + const { + __scopeDialog: __scopeDialog, + ...titleProps + } = props; + const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$TITLE_NAME, __scopeDialog); + return /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.h2, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({ + id: context.titleId + }, titleProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($f4833395aa1bca1a$export$16f7638e4a34b909, { + displayName: $f4833395aa1bca1a$var$TITLE_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DialogDescription + * -----------------------------------------------------------------------------------------------*/ +const $f4833395aa1bca1a$var$DESCRIPTION_NAME = 'DialogDescription'; +const $f4833395aa1bca1a$export$94e94c2ec2c954d5 = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { + const { + __scopeDialog: __scopeDialog, + ...descriptionProps + } = props; + const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$DESCRIPTION_NAME, __scopeDialog); + return /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.p, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({ + id: context.descriptionId + }, descriptionProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($f4833395aa1bca1a$export$94e94c2ec2c954d5, { + displayName: $f4833395aa1bca1a$var$DESCRIPTION_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DialogClose + * -----------------------------------------------------------------------------------------------*/ +const $f4833395aa1bca1a$var$CLOSE_NAME = 'DialogClose'; +const $f4833395aa1bca1a$export$fba2fb7cd781b7ac = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { + const { + __scopeDialog: __scopeDialog, + ...closeProps + } = props; + const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CLOSE_NAME, __scopeDialog); + return /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.button, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({ + type: "button" + }, closeProps, { + ref: forwardedRef, + onClick: $aJCrN$radixuiprimitive.composeEventHandlers(props.onClick, () => context.onOpenChange(false)) + })); +}); +/*#__PURE__*/ +Object.assign($f4833395aa1bca1a$export$fba2fb7cd781b7ac, { + displayName: $f4833395aa1bca1a$var$CLOSE_NAME +}); +/* -----------------------------------------------------------------------------------------------*/ +function $f4833395aa1bca1a$var$getState(open) { + return open ? 'open' : 'closed'; +} +const $f4833395aa1bca1a$var$TITLE_WARNING_NAME = 'DialogTitleWarning'; +const [$f4833395aa1bca1a$export$69b62a49393917d6, $f4833395aa1bca1a$var$useWarningContext] = $aJCrN$radixuireactcontext.createContext($f4833395aa1bca1a$var$TITLE_WARNING_NAME, { + contentName: $f4833395aa1bca1a$var$CONTENT_NAME, + titleName: $f4833395aa1bca1a$var$TITLE_NAME, + docsSlug: 'dialog' +}); +const $f4833395aa1bca1a$var$TitleWarning = _ref => { + let { + titleId: titleId + } = _ref; + const titleWarningContext = $f4833395aa1bca1a$var$useWarningContext($f4833395aa1bca1a$var$TITLE_WARNING_NAME); + const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`; + $aJCrN$react.useEffect(() => { + if (titleId) { + const hasTitle = document.getElementById(titleId); + if (!hasTitle) throw new Error(MESSAGE); + } + }, [MESSAGE, titleId]); + return null; +}; +const $f4833395aa1bca1a$var$DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning'; +const $f4833395aa1bca1a$var$DescriptionWarning = _ref2 => { + let { + contentRef: contentRef, + descriptionId: descriptionId + } = _ref2; + const descriptionWarningContext = $f4833395aa1bca1a$var$useWarningContext($f4833395aa1bca1a$var$DESCRIPTION_WARNING_NAME); + const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`; + $aJCrN$react.useEffect(() => { + var _contentRef$current; + const describedById = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.getAttribute('aria-describedby'); // if we have an id and the user hasn't set aria-describedby={undefined} + if (descriptionId && describedById) { + const hasDescription = document.getElementById(descriptionId); + if (!hasDescription) console.warn(MESSAGE); + } + }, [MESSAGE, contentRef, descriptionId]); + return null; +}; +const $f4833395aa1bca1a$export$be92b6f5f03c0fe9 = $f4833395aa1bca1a$export$3ddf2d174ce01153; +const $f4833395aa1bca1a$export$41fb9f06171c75f4 = $f4833395aa1bca1a$export$2e1e1122cf0cba88; +const $f4833395aa1bca1a$export$602eac185826482c = $f4833395aa1bca1a$export$dad7c95542bacce0; +const $f4833395aa1bca1a$export$c6fdb837b070b4ff = $f4833395aa1bca1a$export$bd1d06c79be19e17; +const $f4833395aa1bca1a$export$7c6e2c02157bb7d2 = $f4833395aa1bca1a$export$b6d9565de1e068cf; +const $f4833395aa1bca1a$export$f99233281efd08a0 = $f4833395aa1bca1a$export$16f7638e4a34b909; +const $f4833395aa1bca1a$export$393edc798c47379d = $f4833395aa1bca1a$export$94e94c2ec2c954d5; +const $f4833395aa1bca1a$export$f39c2d165cd861fe = $f4833395aa1bca1a$export$fba2fb7cd781b7ac; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-direction/dist/index.js": +/*!*********************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-direction/dist/index.js ***! + \*********************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $9g4ps$react = __webpack_require__(/*! react */ "react"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +$parcel$export(module.exports, "useDirection", () => $cc45c1b701a63adc$export$b39126d51d94e6f3); +$parcel$export(module.exports, "Provider", () => $cc45c1b701a63adc$export$2881499e37b75b9a); +$parcel$export(module.exports, "DirectionProvider", () => $cc45c1b701a63adc$export$c760c09fdd558351); +const $cc45c1b701a63adc$var$DirectionContext = /*#__PURE__*/$9g4ps$react.createContext(undefined); +/* ------------------------------------------------------------------------------------------------- + * Direction + * -----------------------------------------------------------------------------------------------*/ +const $cc45c1b701a63adc$export$c760c09fdd558351 = props => { + const { + dir: dir, + children: children + } = props; + return /*#__PURE__*/$9g4ps$react.createElement($cc45c1b701a63adc$var$DirectionContext.Provider, { + value: dir + }, children); +}; +/* -----------------------------------------------------------------------------------------------*/ +function $cc45c1b701a63adc$export$b39126d51d94e6f3(localDir) { + const globalDir = $9g4ps$react.useContext($cc45c1b701a63adc$var$DirectionContext); + return localDir || globalDir || 'ltr'; +} +const $cc45c1b701a63adc$export$2881499e37b75b9a = $cc45c1b701a63adc$export$c760c09fdd558351; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.js": +/*!*****************************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.js ***! + \*****************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $g2vWm$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $g2vWm$react = __webpack_require__(/*! react */ "react"); +var $g2vWm$radixuiprimitive = __webpack_require__(/*! @radix-ui/primitive */ "../../../node_modules/@radix-ui/primitive/dist/index.js"); +var $g2vWm$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); +var $g2vWm$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); +var $g2vWm$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); +var $g2vWm$radixuireactuseescapekeydown = __webpack_require__(/*! @radix-ui/react-use-escape-keydown */ "../../../node_modules/@radix-ui/react-use-escape-keydown/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "DismissableLayer", () => $d715e0554b679f1f$export$177fb62ff3ec1f22); +$parcel$export(module.exports, "DismissableLayerBranch", () => $d715e0554b679f1f$export$4d5eb2109db14228); +$parcel$export(module.exports, "Root", () => $d715e0554b679f1f$export$be92b6f5f03c0fe9); +$parcel$export(module.exports, "Branch", () => $d715e0554b679f1f$export$aecb2ddcb55c95be); + +/* ------------------------------------------------------------------------------------------------- + * DismissableLayer + * -----------------------------------------------------------------------------------------------*/ +const $d715e0554b679f1f$var$DISMISSABLE_LAYER_NAME = 'DismissableLayer'; +const $d715e0554b679f1f$var$CONTEXT_UPDATE = 'dismissableLayer.update'; +const $d715e0554b679f1f$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside'; +const $d715e0554b679f1f$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside'; +let $d715e0554b679f1f$var$originalBodyPointerEvents; +const $d715e0554b679f1f$var$DismissableLayerContext = /*#__PURE__*/$g2vWm$react.createContext({ + layers: new Set(), + layersWithOutsidePointerEventsDisabled: new Set(), + branches: new Set() +}); +const $d715e0554b679f1f$export$177fb62ff3ec1f22 = /*#__PURE__*/$g2vWm$react.forwardRef((props, forwardedRef) => { + var _node$ownerDocument; + const { + disableOutsidePointerEvents = false, + onEscapeKeyDown: onEscapeKeyDown, + onPointerDownOutside: onPointerDownOutside, + onFocusOutside: onFocusOutside, + onInteractOutside: onInteractOutside, + onDismiss: onDismiss, + ...layerProps + } = props; + const context = $g2vWm$react.useContext($d715e0554b679f1f$var$DismissableLayerContext); + const [node1, setNode] = $g2vWm$react.useState(null); + const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document; + const [, force] = $g2vWm$react.useState({}); + const composedRefs = $g2vWm$radixuireactcomposerefs.useComposedRefs(forwardedRef, node => setNode(node)); + const layers = Array.from(context.layers); + const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); // prettier-ignore + const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore + const index = node1 ? layers.indexOf(node1) : -1; + const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0; + const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; + const pointerDownOutside = $d715e0554b679f1f$var$usePointerDownOutside(event => { + const target = event.target; + const isPointerDownOnBranch = [...context.branches].some(branch => branch.contains(target)); + if (!isPointerEventsEnabled || isPointerDownOnBranch) return; + onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event); + onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event); + if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss(); + }, ownerDocument); + const focusOutside = $d715e0554b679f1f$var$useFocusOutside(event => { + const target = event.target; + const isFocusInBranch = [...context.branches].some(branch => branch.contains(target)); + if (isFocusInBranch) return; + onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event); + onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event); + if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss(); + }, ownerDocument); + $g2vWm$radixuireactuseescapekeydown.useEscapeKeydown(event => { + const isHighestLayer = index === context.layers.size - 1; + if (!isHighestLayer) return; + onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event); + if (!event.defaultPrevented && onDismiss) { + event.preventDefault(); + onDismiss(); + } + }, ownerDocument); + $g2vWm$react.useEffect(() => { + if (!node1) return; + if (disableOutsidePointerEvents) { + if (context.layersWithOutsidePointerEventsDisabled.size === 0) { + $d715e0554b679f1f$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; + ownerDocument.body.style.pointerEvents = 'none'; + } + context.layersWithOutsidePointerEventsDisabled.add(node1); + } + context.layers.add(node1); + $d715e0554b679f1f$var$dispatchUpdate(); + return () => { + if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $d715e0554b679f1f$var$originalBodyPointerEvents; + }; + }, [node1, ownerDocument, disableOutsidePointerEvents, context]); + /** + * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect + * because a change to `disableOutsidePointerEvents` would remove this layer from the stack + * and add it to the end again so the layering order wouldn't be _creation order_. + * We only want them to be removed from context stacks when unmounted. + */ + $g2vWm$react.useEffect(() => { + return () => { + if (!node1) return; + context.layers.delete(node1); + context.layersWithOutsidePointerEventsDisabled.delete(node1); + $d715e0554b679f1f$var$dispatchUpdate(); + }; + }, [node1, context]); + $g2vWm$react.useEffect(() => { + const handleUpdate = () => force({}); + document.addEventListener($d715e0554b679f1f$var$CONTEXT_UPDATE, handleUpdate); + return () => document.removeEventListener($d715e0554b679f1f$var$CONTEXT_UPDATE, handleUpdate); + }, []); + return /*#__PURE__*/$g2vWm$react.createElement($g2vWm$radixuireactprimitive.Primitive.div, $parcel$interopDefault($g2vWm$babelruntimehelpersextends)({}, layerProps, { + ref: composedRefs, + style: { + pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined, + ...props.style + }, + onFocusCapture: $g2vWm$radixuiprimitive.composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture), + onBlurCapture: $g2vWm$radixuiprimitive.composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture), + onPointerDownCapture: $g2vWm$radixuiprimitive.composeEventHandlers(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture) + })); +}); +/*#__PURE__*/ +Object.assign($d715e0554b679f1f$export$177fb62ff3ec1f22, { + displayName: $d715e0554b679f1f$var$DISMISSABLE_LAYER_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DismissableLayerBranch + * -----------------------------------------------------------------------------------------------*/ +const $d715e0554b679f1f$var$BRANCH_NAME = 'DismissableLayerBranch'; +const $d715e0554b679f1f$export$4d5eb2109db14228 = /*#__PURE__*/$g2vWm$react.forwardRef((props, forwardedRef) => { + const context = $g2vWm$react.useContext($d715e0554b679f1f$var$DismissableLayerContext); + const ref = $g2vWm$react.useRef(null); + const composedRefs = $g2vWm$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); + $g2vWm$react.useEffect(() => { + const node = ref.current; + if (node) { + context.branches.add(node); + return () => { + context.branches.delete(node); + }; + } + }, [context.branches]); + return /*#__PURE__*/$g2vWm$react.createElement($g2vWm$radixuireactprimitive.Primitive.div, $parcel$interopDefault($g2vWm$babelruntimehelpersextends)({}, props, { + ref: composedRefs + })); +}); +/*#__PURE__*/ +Object.assign($d715e0554b679f1f$export$4d5eb2109db14228, { + displayName: $d715e0554b679f1f$var$BRANCH_NAME +}); +/* -----------------------------------------------------------------------------------------------*/ /** + * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup` + * to mimic layer dismissing behaviour present in OS. + * Returns props to pass to the node we want to check for outside events. + */ +function $d715e0554b679f1f$var$usePointerDownOutside(onPointerDownOutside) { + let ownerDocument = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document; + const handlePointerDownOutside = $g2vWm$radixuireactusecallbackref.useCallbackRef(onPointerDownOutside); + const isPointerInsideReactTreeRef = $g2vWm$react.useRef(false); + const handleClickRef = $g2vWm$react.useRef(() => {}); + $g2vWm$react.useEffect(() => { + const handlePointerDown = event => { + if (event.target && !isPointerInsideReactTreeRef.current) { + const eventDetail = { + originalEvent: event + }; + function handleAndDispatchPointerDownOutsideEvent() { + $d715e0554b679f1f$var$handleAndDispatchCustomEvent($d715e0554b679f1f$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, { + discrete: true + }); + } + /** + * On touch devices, we need to wait for a click event because browsers implement + * a ~350ms delay between the time the user stops touching the display and when the + * browser executres events. We need to ensure we don't reactivate pointer-events within + * this timeframe otherwise the browser may execute events that should have been prevented. + * + * Additionally, this also lets us deal automatically with cancellations when a click event + * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc. + * + * This is why we also continuously remove the previous listener, because we cannot be + * certain that it was raised, and therefore cleaned-up. + */ + if (event.pointerType === 'touch') { + ownerDocument.removeEventListener('click', handleClickRef.current); + handleClickRef.current = handleAndDispatchPointerDownOutsideEvent; + ownerDocument.addEventListener('click', handleClickRef.current, { + once: true + }); + } else handleAndDispatchPointerDownOutsideEvent(); + } + isPointerInsideReactTreeRef.current = false; + }; + /** + * if this hook executes in a component that mounts via a `pointerdown` event, the event + * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid + * this by delaying the event listener registration on the document. + * This is not React specific, but rather how the DOM works, ie: + * ``` + * button.addEventListener('pointerdown', () => { + * console.log('I will log'); + * document.addEventListener('pointerdown', () => { + * console.log('I will also log'); + * }) + * }); + */ + const timerId = window.setTimeout(() => { + ownerDocument.addEventListener('pointerdown', handlePointerDown); + }, 0); + return () => { + window.clearTimeout(timerId); + ownerDocument.removeEventListener('pointerdown', handlePointerDown); + ownerDocument.removeEventListener('click', handleClickRef.current); + }; + }, [ownerDocument, handlePointerDownOutside]); + return { + // ensures we check React component tree (not just DOM tree) + onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true + }; +} +/** + * Listens for when focus happens outside a react subtree. + * Returns props to pass to the root (node) of the subtree we want to check. + */ +function $d715e0554b679f1f$var$useFocusOutside(onFocusOutside) { + let ownerDocument = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document; + const handleFocusOutside = $g2vWm$radixuireactusecallbackref.useCallbackRef(onFocusOutside); + const isFocusInsideReactTreeRef = $g2vWm$react.useRef(false); + $g2vWm$react.useEffect(() => { + const handleFocus = event => { + if (event.target && !isFocusInsideReactTreeRef.current) { + const eventDetail = { + originalEvent: event + }; + $d715e0554b679f1f$var$handleAndDispatchCustomEvent($d715e0554b679f1f$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { + discrete: false + }); + } + }; + ownerDocument.addEventListener('focusin', handleFocus); + return () => ownerDocument.removeEventListener('focusin', handleFocus); + }, [ownerDocument, handleFocusOutside]); + return { + onFocusCapture: () => isFocusInsideReactTreeRef.current = true, + onBlurCapture: () => isFocusInsideReactTreeRef.current = false + }; +} +function $d715e0554b679f1f$var$dispatchUpdate() { + const event = new CustomEvent($d715e0554b679f1f$var$CONTEXT_UPDATE); + document.dispatchEvent(event); +} +function $d715e0554b679f1f$var$handleAndDispatchCustomEvent(name, handler, detail, _ref) { + let { + discrete: discrete + } = _ref; + const target = detail.originalEvent.target; + const event = new CustomEvent(name, { + bubbles: false, + cancelable: true, + detail: detail + }); + if (handler) target.addEventListener(name, handler, { + once: true + }); + if (discrete) $g2vWm$radixuireactprimitive.dispatchDiscreteCustomEvent(target, event);else target.dispatchEvent(event); +} +const $d715e0554b679f1f$export$be92b6f5f03c0fe9 = $d715e0554b679f1f$export$177fb62ff3ec1f22; +const $d715e0554b679f1f$export$aecb2ddcb55c95be = $d715e0554b679f1f$export$4d5eb2109db14228; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-dropdown-menu/dist/index.js": +/*!*************************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-dropdown-menu/dist/index.js ***! + \*************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $7dQ7Q$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $7dQ7Q$react = __webpack_require__(/*! react */ "react"); +var $7dQ7Q$radixuiprimitive = __webpack_require__(/*! @radix-ui/primitive */ "../../../node_modules/@radix-ui/primitive/dist/index.js"); +var $7dQ7Q$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); +var $7dQ7Q$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); +var $7dQ7Q$radixuireactusecontrollablestate = __webpack_require__(/*! @radix-ui/react-use-controllable-state */ "../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js"); +var $7dQ7Q$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); +var $7dQ7Q$radixuireactmenu = __webpack_require__(/*! @radix-ui/react-menu */ "../../../node_modules/@radix-ui/react-menu/dist/index.js"); +var $7dQ7Q$radixuireactid = __webpack_require__(/*! @radix-ui/react-id */ "../../../node_modules/@radix-ui/react-id/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "createDropdownMenuScope", () => $d1bf075a6b218014$export$c0623cd925aeb687); +$parcel$export(module.exports, "DropdownMenu", () => $d1bf075a6b218014$export$e44a253a59704894); +$parcel$export(module.exports, "DropdownMenuTrigger", () => $d1bf075a6b218014$export$d2469213b3befba9); +$parcel$export(module.exports, "DropdownMenuPortal", () => $d1bf075a6b218014$export$cd369b4d4d54efc9); +$parcel$export(module.exports, "DropdownMenuContent", () => $d1bf075a6b218014$export$6e76d93a37c01248); +$parcel$export(module.exports, "DropdownMenuGroup", () => $d1bf075a6b218014$export$246bebaba3a2f70e); +$parcel$export(module.exports, "DropdownMenuLabel", () => $d1bf075a6b218014$export$76e48c5b57f24495); +$parcel$export(module.exports, "DropdownMenuItem", () => $d1bf075a6b218014$export$ed97964d1871885d); +$parcel$export(module.exports, "DropdownMenuCheckboxItem", () => $d1bf075a6b218014$export$53a69729da201fa9); +$parcel$export(module.exports, "DropdownMenuRadioGroup", () => $d1bf075a6b218014$export$3323ad73d55f587e); +$parcel$export(module.exports, "DropdownMenuRadioItem", () => $d1bf075a6b218014$export$e4f69b41b1637536); +$parcel$export(module.exports, "DropdownMenuItemIndicator", () => $d1bf075a6b218014$export$42355ae145153fb6); +$parcel$export(module.exports, "DropdownMenuSeparator", () => $d1bf075a6b218014$export$da160178fd3bc7e9); +$parcel$export(module.exports, "DropdownMenuArrow", () => $d1bf075a6b218014$export$34b8980744021ec5); +$parcel$export(module.exports, "DropdownMenuSub", () => $d1bf075a6b218014$export$2f307d81a64f5442); +$parcel$export(module.exports, "DropdownMenuSubTrigger", () => $d1bf075a6b218014$export$21dcb7ec56f874cf); +$parcel$export(module.exports, "DropdownMenuSubContent", () => $d1bf075a6b218014$export$f34ec8bc2482cc5f); +$parcel$export(module.exports, "Root", () => $d1bf075a6b218014$export$be92b6f5f03c0fe9); +$parcel$export(module.exports, "Trigger", () => $d1bf075a6b218014$export$41fb9f06171c75f4); +$parcel$export(module.exports, "Portal", () => $d1bf075a6b218014$export$602eac185826482c); +$parcel$export(module.exports, "Content", () => $d1bf075a6b218014$export$7c6e2c02157bb7d2); +$parcel$export(module.exports, "Group", () => $d1bf075a6b218014$export$eb2fcfdbd7ba97d4); +$parcel$export(module.exports, "Label", () => $d1bf075a6b218014$export$b04be29aa201d4f5); +$parcel$export(module.exports, "Item", () => $d1bf075a6b218014$export$6d08773d2e66f8f2); +$parcel$export(module.exports, "CheckboxItem", () => $d1bf075a6b218014$export$16ce288f89fa631c); +$parcel$export(module.exports, "RadioGroup", () => $d1bf075a6b218014$export$a98f0dcb43a68a25); +$parcel$export(module.exports, "RadioItem", () => $d1bf075a6b218014$export$371ab307eab489c0); +$parcel$export(module.exports, "ItemIndicator", () => $d1bf075a6b218014$export$c3468e2714d175fa); +$parcel$export(module.exports, "Separator", () => $d1bf075a6b218014$export$1ff3c3f08ae963c0); +$parcel$export(module.exports, "Arrow", () => $d1bf075a6b218014$export$21b07c8f274aebd5); +$parcel$export(module.exports, "Sub", () => $d1bf075a6b218014$export$d7a01e11500dfb6f); +$parcel$export(module.exports, "SubTrigger", () => $d1bf075a6b218014$export$2ea8a7a591ac5eac); +$parcel$export(module.exports, "SubContent", () => $d1bf075a6b218014$export$6d4de93b380beddf); + +/* ------------------------------------------------------------------------------------------------- + * DropdownMenu + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$DROPDOWN_MENU_NAME = 'DropdownMenu'; +const [$d1bf075a6b218014$var$createDropdownMenuContext, $d1bf075a6b218014$export$c0623cd925aeb687] = $7dQ7Q$radixuireactcontext.createContextScope($d1bf075a6b218014$var$DROPDOWN_MENU_NAME, [$7dQ7Q$radixuireactmenu.createMenuScope]); +const $d1bf075a6b218014$var$useMenuScope = $7dQ7Q$radixuireactmenu.createMenuScope(); +const [$d1bf075a6b218014$var$DropdownMenuProvider, $d1bf075a6b218014$var$useDropdownMenuContext] = $d1bf075a6b218014$var$createDropdownMenuContext($d1bf075a6b218014$var$DROPDOWN_MENU_NAME); +const $d1bf075a6b218014$export$e44a253a59704894 = props => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + children: children, + dir: dir, + open: openProp, + defaultOpen: defaultOpen, + onOpenChange: onOpenChange, + modal = true + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + const triggerRef = $7dQ7Q$react.useRef(null); + const [open = false, setOpen] = $7dQ7Q$radixuireactusecontrollablestate.useControllableState({ + prop: openProp, + defaultProp: defaultOpen, + onChange: onOpenChange + }); + return /*#__PURE__*/$7dQ7Q$react.createElement($d1bf075a6b218014$var$DropdownMenuProvider, { + scope: __scopeDropdownMenu, + triggerId: $7dQ7Q$radixuireactid.useId(), + triggerRef: triggerRef, + contentId: $7dQ7Q$radixuireactid.useId(), + open: open, + onOpenChange: setOpen, + onOpenToggle: $7dQ7Q$react.useCallback(() => setOpen(prevOpen => !prevOpen), [setOpen]), + modal: modal + }, /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Root, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, { + open: open, + onOpenChange: setOpen, + dir: dir, + modal: modal + }), children)); +}; +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$e44a253a59704894, { + displayName: $d1bf075a6b218014$var$DROPDOWN_MENU_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuTrigger + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$TRIGGER_NAME = 'DropdownMenuTrigger'; +const $d1bf075a6b218014$export$d2469213b3befba9 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + disabled = false, + ...triggerProps + } = props; + const context = $d1bf075a6b218014$var$useDropdownMenuContext($d1bf075a6b218014$var$TRIGGER_NAME, __scopeDropdownMenu); + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Anchor, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({ + asChild: true + }, menuScope), /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactprimitive.Primitive.button, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({ + type: "button", + id: context.triggerId, + "aria-haspopup": "menu", + "aria-expanded": context.open, + "aria-controls": context.open ? context.contentId : undefined, + "data-state": context.open ? 'open' : 'closed', + "data-disabled": disabled ? '' : undefined, + disabled: disabled + }, triggerProps, { + ref: $7dQ7Q$radixuireactcomposerefs.composeRefs(forwardedRef, context.triggerRef), + onPointerDown: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onPointerDown, event => { + // only call handler if it's the left button (mousedown gets triggered by all mouse buttons) + // but not when the control key is pressed (avoiding MacOS right click) + if (!disabled && event.button === 0 && event.ctrlKey === false) { + context.onOpenToggle(); // prevent trigger focusing when opening + // this allows the content to be given focus without competition + if (!context.open) event.preventDefault(); + } + }), + onKeyDown: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onKeyDown, event => { + if (disabled) return; + if (['Enter', ' '].includes(event.key)) context.onOpenToggle(); + if (event.key === 'ArrowDown') context.onOpenChange(true); // prevent keydown from scrolling window / first focused item to execute + // that keydown (inadvertently closing the menu) + if (['Enter', ' ', 'ArrowDown'].includes(event.key)) event.preventDefault(); + }) + }))); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$d2469213b3befba9, { + displayName: $d1bf075a6b218014$var$TRIGGER_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuPortal + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$PORTAL_NAME = 'DropdownMenuPortal'; +const $d1bf075a6b218014$export$cd369b4d4d54efc9 = props => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...portalProps + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Portal, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, portalProps)); +}; +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$cd369b4d4d54efc9, { + displayName: $d1bf075a6b218014$var$PORTAL_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuContent + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$CONTENT_NAME = 'DropdownMenuContent'; +const $d1bf075a6b218014$export$6e76d93a37c01248 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...contentProps + } = props; + const context = $d1bf075a6b218014$var$useDropdownMenuContext($d1bf075a6b218014$var$CONTENT_NAME, __scopeDropdownMenu); + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + const hasInteractedOutsideRef = $7dQ7Q$react.useRef(false); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Content, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({ + id: context.contentId, + "aria-labelledby": context.triggerId + }, menuScope, contentProps, { + ref: forwardedRef, + onCloseAutoFocus: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onCloseAutoFocus, event => { + var _context$triggerRef$c; + if (!hasInteractedOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus(); + hasInteractedOutsideRef.current = false; // Always prevent auto focus because we either focus manually or want user agent focus + event.preventDefault(); + }), + onInteractOutside: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onInteractOutside, event => { + const originalEvent = event.detail.originalEvent; + const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; + const isRightClick = originalEvent.button === 2 || ctrlLeftClick; + if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true; + }), + style: { + ...props.style, + '--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)', + '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)', + '--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)', + '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)', + '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)' + } + })); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$6e76d93a37c01248, { + displayName: $d1bf075a6b218014$var$CONTENT_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuGroup + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$GROUP_NAME = 'DropdownMenuGroup'; +const $d1bf075a6b218014$export$246bebaba3a2f70e = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...groupProps + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Group, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, groupProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$246bebaba3a2f70e, { + displayName: $d1bf075a6b218014$var$GROUP_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuLabel + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$LABEL_NAME = 'DropdownMenuLabel'; +const $d1bf075a6b218014$export$76e48c5b57f24495 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...labelProps + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Label, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, labelProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$76e48c5b57f24495, { + displayName: $d1bf075a6b218014$var$LABEL_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuItem + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$ITEM_NAME = 'DropdownMenuItem'; +const $d1bf075a6b218014$export$ed97964d1871885d = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...itemProps + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Item, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, itemProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$ed97964d1871885d, { + displayName: $d1bf075a6b218014$var$ITEM_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuCheckboxItem + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem'; +const $d1bf075a6b218014$export$53a69729da201fa9 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...checkboxItemProps + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.CheckboxItem, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, checkboxItemProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$53a69729da201fa9, { + displayName: $d1bf075a6b218014$var$CHECKBOX_ITEM_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuRadioGroup + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$RADIO_GROUP_NAME = 'DropdownMenuRadioGroup'; +const $d1bf075a6b218014$export$3323ad73d55f587e = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...radioGroupProps + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.RadioGroup, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, radioGroupProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$3323ad73d55f587e, { + displayName: $d1bf075a6b218014$var$RADIO_GROUP_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuRadioItem + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$RADIO_ITEM_NAME = 'DropdownMenuRadioItem'; +const $d1bf075a6b218014$export$e4f69b41b1637536 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...radioItemProps + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.RadioItem, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, radioItemProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$e4f69b41b1637536, { + displayName: $d1bf075a6b218014$var$RADIO_ITEM_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuItemIndicator + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$INDICATOR_NAME = 'DropdownMenuItemIndicator'; +const $d1bf075a6b218014$export$42355ae145153fb6 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...itemIndicatorProps + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.ItemIndicator, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, itemIndicatorProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$42355ae145153fb6, { + displayName: $d1bf075a6b218014$var$INDICATOR_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuSeparator + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$SEPARATOR_NAME = 'DropdownMenuSeparator'; +const $d1bf075a6b218014$export$da160178fd3bc7e9 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...separatorProps + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Separator, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, separatorProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$da160178fd3bc7e9, { + displayName: $d1bf075a6b218014$var$SEPARATOR_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuArrow + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$ARROW_NAME = 'DropdownMenuArrow'; +const $d1bf075a6b218014$export$34b8980744021ec5 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...arrowProps + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Arrow, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, arrowProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$34b8980744021ec5, { + displayName: $d1bf075a6b218014$var$ARROW_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuSub + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$export$2f307d81a64f5442 = props => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + children: children, + open: openProp, + onOpenChange: onOpenChange, + defaultOpen: defaultOpen + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + const [open = false, setOpen] = $7dQ7Q$radixuireactusecontrollablestate.useControllableState({ + prop: openProp, + defaultProp: defaultOpen, + onChange: onOpenChange + }); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Sub, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, { + open: open, + onOpenChange: setOpen + }), children); +}; +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuSubTrigger + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$SUB_TRIGGER_NAME = 'DropdownMenuSubTrigger'; +const $d1bf075a6b218014$export$21dcb7ec56f874cf = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...subTriggerProps + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.SubTrigger, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, subTriggerProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$21dcb7ec56f874cf, { + displayName: $d1bf075a6b218014$var$SUB_TRIGGER_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * DropdownMenuSubContent + * -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$var$SUB_CONTENT_NAME = 'DropdownMenuSubContent'; +const $d1bf075a6b218014$export$f34ec8bc2482cc5f = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { + const { + __scopeDropdownMenu: __scopeDropdownMenu, + ...subContentProps + } = props; + const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); + return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.SubContent, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, subContentProps, { + ref: forwardedRef, + style: { + ...props.style, + '--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)', + '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)', + '--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)', + '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)', + '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)' + } + })); +}); +/*#__PURE__*/ +Object.assign($d1bf075a6b218014$export$f34ec8bc2482cc5f, { + displayName: $d1bf075a6b218014$var$SUB_CONTENT_NAME +}); +/* -----------------------------------------------------------------------------------------------*/ +const $d1bf075a6b218014$export$be92b6f5f03c0fe9 = $d1bf075a6b218014$export$e44a253a59704894; +const $d1bf075a6b218014$export$41fb9f06171c75f4 = $d1bf075a6b218014$export$d2469213b3befba9; +const $d1bf075a6b218014$export$602eac185826482c = $d1bf075a6b218014$export$cd369b4d4d54efc9; +const $d1bf075a6b218014$export$7c6e2c02157bb7d2 = $d1bf075a6b218014$export$6e76d93a37c01248; +const $d1bf075a6b218014$export$eb2fcfdbd7ba97d4 = $d1bf075a6b218014$export$246bebaba3a2f70e; +const $d1bf075a6b218014$export$b04be29aa201d4f5 = $d1bf075a6b218014$export$76e48c5b57f24495; +const $d1bf075a6b218014$export$6d08773d2e66f8f2 = $d1bf075a6b218014$export$ed97964d1871885d; +const $d1bf075a6b218014$export$16ce288f89fa631c = $d1bf075a6b218014$export$53a69729da201fa9; +const $d1bf075a6b218014$export$a98f0dcb43a68a25 = $d1bf075a6b218014$export$3323ad73d55f587e; +const $d1bf075a6b218014$export$371ab307eab489c0 = $d1bf075a6b218014$export$e4f69b41b1637536; +const $d1bf075a6b218014$export$c3468e2714d175fa = $d1bf075a6b218014$export$42355ae145153fb6; +const $d1bf075a6b218014$export$1ff3c3f08ae963c0 = $d1bf075a6b218014$export$da160178fd3bc7e9; +const $d1bf075a6b218014$export$21b07c8f274aebd5 = $d1bf075a6b218014$export$34b8980744021ec5; +const $d1bf075a6b218014$export$d7a01e11500dfb6f = $d1bf075a6b218014$export$2f307d81a64f5442; +const $d1bf075a6b218014$export$2ea8a7a591ac5eac = $d1bf075a6b218014$export$21dcb7ec56f874cf; +const $d1bf075a6b218014$export$6d4de93b380beddf = $d1bf075a6b218014$export$f34ec8bc2482cc5f; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-focus-guards/dist/index.js": +/*!************************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-focus-guards/dist/index.js ***! + \************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $cnctE$react = __webpack_require__(/*! react */ "react"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +$parcel$export(module.exports, "FocusGuards", () => $71476a6ed7dbbaf3$export$ac5b58043b79449b); +$parcel$export(module.exports, "Root", () => $71476a6ed7dbbaf3$export$be92b6f5f03c0fe9); +$parcel$export(module.exports, "useFocusGuards", () => $71476a6ed7dbbaf3$export$b7ece24a22aeda8c); + +/** Number of components which have requested interest to have focus guards */ +let $71476a6ed7dbbaf3$var$count = 0; +function $71476a6ed7dbbaf3$export$ac5b58043b79449b(props) { + $71476a6ed7dbbaf3$export$b7ece24a22aeda8c(); + return props.children; +} +/** + * Injects a pair of focus guards at the edges of the whole DOM tree + * to ensure `focusin` & `focusout` events can be caught consistently. + */ +function $71476a6ed7dbbaf3$export$b7ece24a22aeda8c() { + $cnctE$react.useEffect(() => { + var _edgeGuards$, _edgeGuards$2; + const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]'); + document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $71476a6ed7dbbaf3$var$createFocusGuard()); + document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $71476a6ed7dbbaf3$var$createFocusGuard()); + $71476a6ed7dbbaf3$var$count++; + return () => { + if ($71476a6ed7dbbaf3$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach(node => node.remove()); + $71476a6ed7dbbaf3$var$count--; + }; + }, []); +} +function $71476a6ed7dbbaf3$var$createFocusGuard() { + const element = document.createElement('span'); + element.setAttribute('data-radix-focus-guard', ''); + element.tabIndex = 0; + element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none'; + return element; +} +const $71476a6ed7dbbaf3$export$be92b6f5f03c0fe9 = $71476a6ed7dbbaf3$export$ac5b58043b79449b; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-focus-scope/dist/index.js": +/*!***********************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-focus-scope/dist/index.js ***! + \***********************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $buum9$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $buum9$react = __webpack_require__(/*! react */ "react"); +var $buum9$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); +var $buum9$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); +var $buum9$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "FocusScope", () => $2bc01e66e04aa9ed$export$20e40289641fbbb6); +$parcel$export(module.exports, "Root", () => $2bc01e66e04aa9ed$export$be92b6f5f03c0fe9); +const $2bc01e66e04aa9ed$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount'; +const $2bc01e66e04aa9ed$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount'; +const $2bc01e66e04aa9ed$var$EVENT_OPTIONS = { + bubbles: false, + cancelable: true +}; +/* ------------------------------------------------------------------------------------------------- + * FocusScope + * -----------------------------------------------------------------------------------------------*/ +const $2bc01e66e04aa9ed$var$FOCUS_SCOPE_NAME = 'FocusScope'; +const $2bc01e66e04aa9ed$export$20e40289641fbbb6 = /*#__PURE__*/$buum9$react.forwardRef((props, forwardedRef) => { + const { + loop = false, + trapped = false, + onMountAutoFocus: onMountAutoFocusProp, + onUnmountAutoFocus: onUnmountAutoFocusProp, + ...scopeProps + } = props; + const [container1, setContainer] = $buum9$react.useState(null); + const onMountAutoFocus = $buum9$radixuireactusecallbackref.useCallbackRef(onMountAutoFocusProp); + const onUnmountAutoFocus = $buum9$radixuireactusecallbackref.useCallbackRef(onUnmountAutoFocusProp); + const lastFocusedElementRef = $buum9$react.useRef(null); + const composedRefs = $buum9$radixuireactcomposerefs.useComposedRefs(forwardedRef, node => setContainer(node)); + const focusScope = $buum9$react.useRef({ + paused: false, + pause() { + this.paused = true; + }, + resume() { + this.paused = false; + } + }).current; // Takes care of trapping focus if focus is moved outside programmatically for example + $buum9$react.useEffect(() => { + if (trapped) { + function handleFocusIn(event) { + if (focusScope.paused || !container1) return; + const target = event.target; + if (container1.contains(target)) lastFocusedElementRef.current = target;else $2bc01e66e04aa9ed$var$focus(lastFocusedElementRef.current, { + select: true + }); + } + function handleFocusOut(event) { + if (focusScope.paused || !container1) return; + const relatedTarget = event.relatedTarget; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases: + // + // 1. When the user switches app/tabs/windows/the browser itself loses focus. + // 2. In Google Chrome, when the focused element is removed from the DOM. + // + // We let the browser do its thing here because: + // + // 1. The browser already keeps a memory of what's focused for when the page gets refocused. + // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it + // throws the CPU to 100%, so we avoid doing anything for this reason here too. + if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`) + // that is outside the container, we move focus to the last valid focused element inside. + if (!container1.contains(relatedTarget)) $2bc01e66e04aa9ed$var$focus(lastFocusedElementRef.current, { + select: true + }); + } // When the focused element gets removed from the DOM, browsers move focus + // back to the document.body. In this case, we move focus to the container + // to keep focus trapped correctly. + function handleMutations(mutations) { + const focusedElement = document.activeElement; + for (const mutation of mutations) { + if (mutation.removedNodes.length > 0) { + if (!(container1 !== null && container1 !== void 0 && container1.contains(focusedElement))) $2bc01e66e04aa9ed$var$focus(container1); + } + } + } + document.addEventListener('focusin', handleFocusIn); + document.addEventListener('focusout', handleFocusOut); + const mutationObserver = new MutationObserver(handleMutations); + if (container1) mutationObserver.observe(container1, { + childList: true, + subtree: true + }); + return () => { + document.removeEventListener('focusin', handleFocusIn); + document.removeEventListener('focusout', handleFocusOut); + mutationObserver.disconnect(); + }; + } + }, [trapped, container1, focusScope.paused]); + $buum9$react.useEffect(() => { + if (container1) { + $2bc01e66e04aa9ed$var$focusScopesStack.add(focusScope); + const previouslyFocusedElement = document.activeElement; + const hasFocusedCandidate = container1.contains(previouslyFocusedElement); + if (!hasFocusedCandidate) { + const mountEvent = new CustomEvent($2bc01e66e04aa9ed$var$AUTOFOCUS_ON_MOUNT, $2bc01e66e04aa9ed$var$EVENT_OPTIONS); + container1.addEventListener($2bc01e66e04aa9ed$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); + container1.dispatchEvent(mountEvent); + if (!mountEvent.defaultPrevented) { + $2bc01e66e04aa9ed$var$focusFirst($2bc01e66e04aa9ed$var$removeLinks($2bc01e66e04aa9ed$var$getTabbableCandidates(container1)), { + select: true + }); + if (document.activeElement === previouslyFocusedElement) $2bc01e66e04aa9ed$var$focus(container1); + } + } + return () => { + container1.removeEventListener($2bc01e66e04aa9ed$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount. + // We need to delay the focus a little to get around it for now. + // See: https://github.com/facebook/react/issues/17894 + setTimeout(() => { + const unmountEvent = new CustomEvent($2bc01e66e04aa9ed$var$AUTOFOCUS_ON_UNMOUNT, $2bc01e66e04aa9ed$var$EVENT_OPTIONS); + container1.addEventListener($2bc01e66e04aa9ed$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); + container1.dispatchEvent(unmountEvent); + if (!unmountEvent.defaultPrevented) $2bc01e66e04aa9ed$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, { + select: true + }); + // we need to remove the listener after we `dispatchEvent` + container1.removeEventListener($2bc01e66e04aa9ed$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); + $2bc01e66e04aa9ed$var$focusScopesStack.remove(focusScope); + }, 0); + }; + } + }, [container1, onMountAutoFocus, onUnmountAutoFocus, focusScope]); // Takes care of looping focus (when tabbing whilst at the edges) + const handleKeyDown = $buum9$react.useCallback(event => { + if (!loop && !trapped) return; + if (focusScope.paused) return; + const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey; + const focusedElement = document.activeElement; + if (isTabKey && focusedElement) { + const container = event.currentTarget; + const [first, last] = $2bc01e66e04aa9ed$var$getTabbableEdges(container); + const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges + if (!hasTabbableElementsInside) { + if (focusedElement === container) event.preventDefault(); + } else { + if (!event.shiftKey && focusedElement === last) { + event.preventDefault(); + if (loop) $2bc01e66e04aa9ed$var$focus(first, { + select: true + }); + } else if (event.shiftKey && focusedElement === first) { + event.preventDefault(); + if (loop) $2bc01e66e04aa9ed$var$focus(last, { + select: true + }); + } + } + } + }, [loop, trapped, focusScope.paused]); + return /*#__PURE__*/$buum9$react.createElement($buum9$radixuireactprimitive.Primitive.div, $parcel$interopDefault($buum9$babelruntimehelpersextends)({ + tabIndex: -1 + }, scopeProps, { + ref: composedRefs, + onKeyDown: handleKeyDown + })); +}); +/*#__PURE__*/ +Object.assign($2bc01e66e04aa9ed$export$20e40289641fbbb6, { + displayName: $2bc01e66e04aa9ed$var$FOCUS_SCOPE_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * Utils + * -----------------------------------------------------------------------------------------------*/ /** + * Attempts focusing the first element in a list of candidates. + * Stops when focus has actually moved. + */ +function $2bc01e66e04aa9ed$var$focusFirst(candidates) { + let { + select = false + } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const previouslyFocusedElement = document.activeElement; + for (const candidate of candidates) { + $2bc01e66e04aa9ed$var$focus(candidate, { + select: select + }); + if (document.activeElement !== previouslyFocusedElement) return; + } +} +/** + * Returns the first and last tabbable elements inside a container. + */ +function $2bc01e66e04aa9ed$var$getTabbableEdges(container) { + const candidates = $2bc01e66e04aa9ed$var$getTabbableCandidates(container); + const first = $2bc01e66e04aa9ed$var$findVisible(candidates, container); + const last = $2bc01e66e04aa9ed$var$findVisible(candidates.reverse(), container); + return [first, last]; +} +/** + * Returns a list of potential tabbable candidates. + * + * NOTE: This is only a close approximation. For example it doesn't take into account cases like when + * elements are not visible. This cannot be worked out easily by just reading a property, but rather + * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately. + * + * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker + * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1 + */ +function $2bc01e66e04aa9ed$var$getTabbableCandidates(container) { + const nodes = []; + const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { + acceptNode: node => { + const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden'; + if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the + // runtime's understanding of tabbability, so this automatically accounts + // for any kind of element that could be tabbed to. + return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; + } + }); + while (walker.nextNode()) nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it + // hinders accessibility to have tab order different from visual order. + return nodes; +} +/** + * Returns the first visible element in a list. + * NOTE: Only checks visibility up to the `container`. + */ +function $2bc01e66e04aa9ed$var$findVisible(elements, container) { + for (const element of elements) { + // we stop checking if it's hidden at the `container` level (excluding) + if (!$2bc01e66e04aa9ed$var$isHidden(element, { + upTo: container + })) return element; + } +} +function $2bc01e66e04aa9ed$var$isHidden(node, _ref) { + let { + upTo: upTo + } = _ref; + if (getComputedStyle(node).visibility === 'hidden') return true; + while (node) { + // we stop at `upTo` (excluding it) + if (upTo !== undefined && node === upTo) return false; + if (getComputedStyle(node).display === 'none') return true; + node = node.parentElement; + } + return false; +} +function $2bc01e66e04aa9ed$var$isSelectableInput(element) { + return element instanceof HTMLInputElement && 'select' in element; +} +function $2bc01e66e04aa9ed$var$focus(element) { + let { + select = false + } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + // only focus if that element is focusable + if (element && element.focus) { + const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users + element.focus({ + preventScroll: true + }); // only select if its not the same element, it supports selection and we need to select + if (element !== previouslyFocusedElement && $2bc01e66e04aa9ed$var$isSelectableInput(element) && select) element.select(); + } +} +/* ------------------------------------------------------------------------------------------------- + * FocusScope stack + * -----------------------------------------------------------------------------------------------*/ +const $2bc01e66e04aa9ed$var$focusScopesStack = $2bc01e66e04aa9ed$var$createFocusScopesStack(); +function $2bc01e66e04aa9ed$var$createFocusScopesStack() { + /** A stack of focus scopes, with the active one at the top */let stack = []; + return { + add(focusScope) { + // pause the currently active focus scope (at the top of the stack) + const activeFocusScope = stack[0]; + if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause(); + // remove in case it already exists (because we'll re-add it at the top of the stack) + stack = $2bc01e66e04aa9ed$var$arrayRemove(stack, focusScope); + stack.unshift(focusScope); + }, + remove(focusScope) { + var _stack$; + stack = $2bc01e66e04aa9ed$var$arrayRemove(stack, focusScope); + (_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume(); + } + }; +} +function $2bc01e66e04aa9ed$var$arrayRemove(array, item) { + const updatedArray = [...array]; + const index = updatedArray.indexOf(item); + if (index !== -1) updatedArray.splice(index, 1); + return updatedArray; +} +function $2bc01e66e04aa9ed$var$removeLinks(items) { + return items.filter(item => item.tagName !== 'A'); +} +const $2bc01e66e04aa9ed$export$be92b6f5f03c0fe9 = $2bc01e66e04aa9ed$export$20e40289641fbbb6; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-id/dist/index.js": +/*!**************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-id/dist/index.js ***! + \**************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $47woD$react = __webpack_require__(/*! react */ "react"); +var $47woD$radixuireactuselayouteffect = __webpack_require__(/*! @radix-ui/react-use-layout-effect */ "../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +$parcel$export(module.exports, "useId", () => $dc478e4659f630c5$export$f680877a34711e37); +const $dc478e4659f630c5$var$useReactId = $47woD$react['useId'.toString()] || (() => undefined); +let $dc478e4659f630c5$var$count = 0; +function $dc478e4659f630c5$export$f680877a34711e37(deterministicId) { + const [id, setId] = $47woD$react.useState($dc478e4659f630c5$var$useReactId()); // React versions older than 18 will have client-side ids only. + $47woD$radixuireactuselayouteffect.useLayoutEffect(() => { + if (!deterministicId) setId(reactId => reactId !== null && reactId !== void 0 ? reactId : String($dc478e4659f630c5$var$count++)); + }, [deterministicId]); + return deterministicId || (id ? `radix-${id}` : ''); +} + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-menu/dist/index.js": +/*!****************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-menu/dist/index.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $cnSS2$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $cnSS2$react = __webpack_require__(/*! react */ "react"); +var $cnSS2$radixuiprimitive = __webpack_require__(/*! @radix-ui/primitive */ "../../../node_modules/@radix-ui/primitive/dist/index.js"); +var $cnSS2$radixuireactcollection = __webpack_require__(/*! @radix-ui/react-collection */ "../../../node_modules/@radix-ui/react-collection/dist/index.js"); +var $cnSS2$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); +var $cnSS2$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); +var $cnSS2$radixuireactdirection = __webpack_require__(/*! @radix-ui/react-direction */ "../../../node_modules/@radix-ui/react-direction/dist/index.js"); +var $cnSS2$radixuireactdismissablelayer = __webpack_require__(/*! @radix-ui/react-dismissable-layer */ "../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.js"); +var $cnSS2$radixuireactfocusguards = __webpack_require__(/*! @radix-ui/react-focus-guards */ "../../../node_modules/@radix-ui/react-focus-guards/dist/index.js"); +var $cnSS2$radixuireactfocusscope = __webpack_require__(/*! @radix-ui/react-focus-scope */ "../../../node_modules/@radix-ui/react-focus-scope/dist/index.js"); +var $cnSS2$radixuireactid = __webpack_require__(/*! @radix-ui/react-id */ "../../../node_modules/@radix-ui/react-id/dist/index.js"); +var $cnSS2$radixuireactpopper = __webpack_require__(/*! @radix-ui/react-popper */ "../../../node_modules/@radix-ui/react-popper/dist/index.js"); +var $cnSS2$radixuireactportal = __webpack_require__(/*! @radix-ui/react-portal */ "../../../node_modules/@radix-ui/react-portal/dist/index.js"); +var $cnSS2$radixuireactpresence = __webpack_require__(/*! @radix-ui/react-presence */ "../../../node_modules/@radix-ui/react-presence/dist/index.js"); +var $cnSS2$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); +var $cnSS2$radixuireactrovingfocus = __webpack_require__(/*! @radix-ui/react-roving-focus */ "../../../node_modules/@radix-ui/react-roving-focus/dist/index.js"); +var $cnSS2$radixuireactslot = __webpack_require__(/*! @radix-ui/react-slot */ "../../../node_modules/@radix-ui/react-slot/dist/index.js"); +var $cnSS2$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); +var $cnSS2$ariahidden = __webpack_require__(/*! aria-hidden */ "../../../node_modules/aria-hidden/dist/es2015/index.js"); +var $cnSS2$reactremovescroll = __webpack_require__(/*! react-remove-scroll */ "../../../node_modules/react-remove-scroll/dist/es2015/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "createMenuScope", () => $213e4d2df823067d$export$4027731b685e72eb); +$parcel$export(module.exports, "Menu", () => $213e4d2df823067d$export$d9b273488cd8ce6f); +$parcel$export(module.exports, "MenuAnchor", () => $213e4d2df823067d$export$9fa5ebd18bee4d43); +$parcel$export(module.exports, "MenuPortal", () => $213e4d2df823067d$export$793392f970497feb); +$parcel$export(module.exports, "MenuContent", () => $213e4d2df823067d$export$479f0f2f71193efe); +$parcel$export(module.exports, "MenuGroup", () => $213e4d2df823067d$export$22a631d1f72787bb); +$parcel$export(module.exports, "MenuLabel", () => $213e4d2df823067d$export$dd37bec0e8a99143); +$parcel$export(module.exports, "MenuItem", () => $213e4d2df823067d$export$2ce376c2cc3355c8); +$parcel$export(module.exports, "MenuCheckboxItem", () => $213e4d2df823067d$export$f6f243521332502d); +$parcel$export(module.exports, "MenuRadioGroup", () => $213e4d2df823067d$export$ea2200c9eee416b3); +$parcel$export(module.exports, "MenuRadioItem", () => $213e4d2df823067d$export$69bd225e9817f6d0); +$parcel$export(module.exports, "MenuItemIndicator", () => $213e4d2df823067d$export$a2593e23056970a3); +$parcel$export(module.exports, "MenuSeparator", () => $213e4d2df823067d$export$1cec7dcdd713e220); +$parcel$export(module.exports, "MenuArrow", () => $213e4d2df823067d$export$bcdda4773debf5fa); +$parcel$export(module.exports, "MenuSub", () => $213e4d2df823067d$export$71bdb9d1e2909932); +$parcel$export(module.exports, "MenuSubTrigger", () => $213e4d2df823067d$export$5fbbb3ba7297405f); +$parcel$export(module.exports, "MenuSubContent", () => $213e4d2df823067d$export$e7142ab31822bde6); +$parcel$export(module.exports, "Root", () => $213e4d2df823067d$export$be92b6f5f03c0fe9); +$parcel$export(module.exports, "Anchor", () => $213e4d2df823067d$export$b688253958b8dfe7); +$parcel$export(module.exports, "Portal", () => $213e4d2df823067d$export$602eac185826482c); +$parcel$export(module.exports, "Content", () => $213e4d2df823067d$export$7c6e2c02157bb7d2); +$parcel$export(module.exports, "Group", () => $213e4d2df823067d$export$eb2fcfdbd7ba97d4); +$parcel$export(module.exports, "Label", () => $213e4d2df823067d$export$b04be29aa201d4f5); +$parcel$export(module.exports, "Item", () => $213e4d2df823067d$export$6d08773d2e66f8f2); +$parcel$export(module.exports, "CheckboxItem", () => $213e4d2df823067d$export$16ce288f89fa631c); +$parcel$export(module.exports, "RadioGroup", () => $213e4d2df823067d$export$a98f0dcb43a68a25); +$parcel$export(module.exports, "RadioItem", () => $213e4d2df823067d$export$371ab307eab489c0); +$parcel$export(module.exports, "ItemIndicator", () => $213e4d2df823067d$export$c3468e2714d175fa); +$parcel$export(module.exports, "Separator", () => $213e4d2df823067d$export$1ff3c3f08ae963c0); +$parcel$export(module.exports, "Arrow", () => $213e4d2df823067d$export$21b07c8f274aebd5); +$parcel$export(module.exports, "Sub", () => $213e4d2df823067d$export$d7a01e11500dfb6f); +$parcel$export(module.exports, "SubTrigger", () => $213e4d2df823067d$export$2ea8a7a591ac5eac); +$parcel$export(module.exports, "SubContent", () => $213e4d2df823067d$export$6d4de93b380beddf); +const $213e4d2df823067d$var$SELECTION_KEYS = ['Enter', ' ']; +const $213e4d2df823067d$var$FIRST_KEYS = ['ArrowDown', 'PageUp', 'Home']; +const $213e4d2df823067d$var$LAST_KEYS = ['ArrowUp', 'PageDown', 'End']; +const $213e4d2df823067d$var$FIRST_LAST_KEYS = [...$213e4d2df823067d$var$FIRST_KEYS, ...$213e4d2df823067d$var$LAST_KEYS]; +const $213e4d2df823067d$var$SUB_OPEN_KEYS = { + ltr: [...$213e4d2df823067d$var$SELECTION_KEYS, 'ArrowRight'], + rtl: [...$213e4d2df823067d$var$SELECTION_KEYS, 'ArrowLeft'] +}; +const $213e4d2df823067d$var$SUB_CLOSE_KEYS = { + ltr: ['ArrowLeft'], + rtl: ['ArrowRight'] +}; +/* ------------------------------------------------------------------------------------------------- + * Menu + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$MENU_NAME = 'Menu'; +const [$213e4d2df823067d$var$Collection, $213e4d2df823067d$var$useCollection, $213e4d2df823067d$var$createCollectionScope] = $cnSS2$radixuireactcollection.createCollection($213e4d2df823067d$var$MENU_NAME); +const [$213e4d2df823067d$var$createMenuContext, $213e4d2df823067d$export$4027731b685e72eb] = $cnSS2$radixuireactcontext.createContextScope($213e4d2df823067d$var$MENU_NAME, [$213e4d2df823067d$var$createCollectionScope, $cnSS2$radixuireactpopper.createPopperScope, $cnSS2$radixuireactrovingfocus.createRovingFocusGroupScope]); +const $213e4d2df823067d$var$usePopperScope = $cnSS2$radixuireactpopper.createPopperScope(); +const $213e4d2df823067d$var$useRovingFocusGroupScope = $cnSS2$radixuireactrovingfocus.createRovingFocusGroupScope(); +const [$213e4d2df823067d$var$MenuProvider, $213e4d2df823067d$var$useMenuContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$MENU_NAME); +const [$213e4d2df823067d$var$MenuRootProvider, $213e4d2df823067d$var$useMenuRootContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$MENU_NAME); +const $213e4d2df823067d$export$d9b273488cd8ce6f = props => { + const { + __scopeMenu: __scopeMenu, + open = false, + children: children, + dir: dir, + onOpenChange: onOpenChange, + modal = true + } = props; + const popperScope = $213e4d2df823067d$var$usePopperScope(__scopeMenu); + const [content, setContent] = $cnSS2$react.useState(null); + const isUsingKeyboardRef = $cnSS2$react.useRef(false); + const handleOpenChange = $cnSS2$radixuireactusecallbackref.useCallbackRef(onOpenChange); + const direction = $cnSS2$radixuireactdirection.useDirection(dir); + $cnSS2$react.useEffect(() => { + // Capture phase ensures we set the boolean before any side effects execute + // in response to the key or pointer event as they might depend on this value. + const handleKeyDown = () => { + isUsingKeyboardRef.current = true; + document.addEventListener('pointerdown', handlePointer, { + capture: true, + once: true + }); + document.addEventListener('pointermove', handlePointer, { + capture: true, + once: true + }); + }; + const handlePointer = () => isUsingKeyboardRef.current = false; + document.addEventListener('keydown', handleKeyDown, { + capture: true + }); + return () => { + document.removeEventListener('keydown', handleKeyDown, { + capture: true + }); + document.removeEventListener('pointerdown', handlePointer, { + capture: true + }); + document.removeEventListener('pointermove', handlePointer, { + capture: true + }); + }; + }, []); + return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpopper.Root, popperScope, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuProvider, { + scope: __scopeMenu, + open: open, + onOpenChange: handleOpenChange, + content: content, + onContentChange: setContent + }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuRootProvider, { + scope: __scopeMenu, + onClose: $cnSS2$react.useCallback(() => handleOpenChange(false), [handleOpenChange]), + isUsingKeyboardRef: isUsingKeyboardRef, + dir: direction, + modal: modal + }, children))); +}; +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$d9b273488cd8ce6f, { + displayName: $213e4d2df823067d$var$MENU_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuAnchor + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$ANCHOR_NAME = 'MenuAnchor'; +const $213e4d2df823067d$export$9fa5ebd18bee4d43 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const { + __scopeMenu: __scopeMenu, + ...anchorProps + } = props; + const popperScope = $213e4d2df823067d$var$usePopperScope(__scopeMenu); + return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpopper.Anchor, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, popperScope, anchorProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$9fa5ebd18bee4d43, { + displayName: $213e4d2df823067d$var$ANCHOR_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuPortal + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$PORTAL_NAME = 'MenuPortal'; +const [$213e4d2df823067d$var$PortalProvider, $213e4d2df823067d$var$usePortalContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$PORTAL_NAME, { + forceMount: undefined +}); +const $213e4d2df823067d$export$793392f970497feb = props => { + const { + __scopeMenu: __scopeMenu, + forceMount: forceMount, + children: children, + container: container + } = props; + const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$PORTAL_NAME, __scopeMenu); + return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$PortalProvider, { + scope: __scopeMenu, + forceMount: forceMount + }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpresence.Presence, { + present: forceMount || context.open + }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactportal.Portal, { + asChild: true, + container: container + }, children))); +}; +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$793392f970497feb, { + displayName: $213e4d2df823067d$var$PORTAL_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuContent + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$CONTENT_NAME = 'MenuContent'; +const [$213e4d2df823067d$var$MenuContentProvider, $213e4d2df823067d$var$useMenuContentContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$CONTENT_NAME); +const $213e4d2df823067d$export$479f0f2f71193efe = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const portalContext = $213e4d2df823067d$var$usePortalContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); + const { + forceMount = portalContext.forceMount, + ...contentProps + } = props; + const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); + const rootContext = $213e4d2df823067d$var$useMenuRootContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); + return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$Collection.Provider, { + scope: props.__scopeMenu + }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpresence.Presence, { + present: forceMount || context.open + }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$Collection.Slot, { + scope: props.__scopeMenu + }, rootContext.modal ? /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuRootContentModal, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, contentProps, { + ref: forwardedRef + })) : /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuRootContentNonModal, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, contentProps, { + ref: forwardedRef + }))))); +}); +/* ---------------------------------------------------------------------------------------------- */ +const $213e4d2df823067d$var$MenuRootContentModal = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); + const ref = $cnSS2$react.useRef(null); + const composedRefs = $cnSS2$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); // Hide everything from ARIA except the `MenuContent` + $cnSS2$react.useEffect(() => { + const content = ref.current; + if (content) return $cnSS2$ariahidden.hideOthers(content); + }, []); + return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuContentImpl, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, props, { + ref: composedRefs // we make sure we're not trapping once it's been closed + , + + trapFocus: context.open // make sure to only disable pointer events when open + , + + disableOutsidePointerEvents: context.open, + disableOutsideScroll: true // When focus is trapped, a `focusout` event may still happen. + , + + onFocusOutside: $cnSS2$radixuiprimitive.composeEventHandlers(props.onFocusOutside, event => event.preventDefault(), { + checkForDefaultPrevented: false + }), + onDismiss: () => context.onOpenChange(false) + })); +}); +const $213e4d2df823067d$var$MenuRootContentNonModal = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); + return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuContentImpl, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, props, { + ref: forwardedRef, + trapFocus: false, + disableOutsidePointerEvents: false, + disableOutsideScroll: false, + onDismiss: () => context.onOpenChange(false) + })); +}); +/* ---------------------------------------------------------------------------------------------- */ +const $213e4d2df823067d$var$MenuContentImpl = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const { + __scopeMenu: __scopeMenu, + loop = false, + trapFocus: trapFocus, + onOpenAutoFocus: onOpenAutoFocus, + onCloseAutoFocus: onCloseAutoFocus, + disableOutsidePointerEvents: disableOutsidePointerEvents, + onEntryFocus: onEntryFocus, + onEscapeKeyDown: onEscapeKeyDown, + onPointerDownOutside: onPointerDownOutside, + onFocusOutside: onFocusOutside, + onInteractOutside: onInteractOutside, + onDismiss: onDismiss, + disableOutsideScroll: disableOutsideScroll, + ...contentProps + } = props; + const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$CONTENT_NAME, __scopeMenu); + const rootContext = $213e4d2df823067d$var$useMenuRootContext($213e4d2df823067d$var$CONTENT_NAME, __scopeMenu); + const popperScope = $213e4d2df823067d$var$usePopperScope(__scopeMenu); + const rovingFocusGroupScope = $213e4d2df823067d$var$useRovingFocusGroupScope(__scopeMenu); + const getItems = $213e4d2df823067d$var$useCollection(__scopeMenu); + const [currentItemId, setCurrentItemId] = $cnSS2$react.useState(null); + const contentRef = $cnSS2$react.useRef(null); + const composedRefs = $cnSS2$radixuireactcomposerefs.useComposedRefs(forwardedRef, contentRef, context.onContentChange); + const timerRef = $cnSS2$react.useRef(0); + const searchRef = $cnSS2$react.useRef(''); + const pointerGraceTimerRef = $cnSS2$react.useRef(0); + const pointerGraceIntentRef = $cnSS2$react.useRef(null); + const pointerDirRef = $cnSS2$react.useRef('right'); + const lastPointerXRef = $cnSS2$react.useRef(0); + const ScrollLockWrapper = disableOutsideScroll ? $cnSS2$reactremovescroll.RemoveScroll : $cnSS2$react.Fragment; + const scrollLockWrapperProps = disableOutsideScroll ? { + as: $cnSS2$radixuireactslot.Slot, + allowPinchZoom: true + } : undefined; + const handleTypeaheadSearch = key => { + var _items$find, _items$find2; + const search = searchRef.current + key; + const items = getItems().filter(item => !item.disabled); + const currentItem = document.activeElement; + const currentMatch = (_items$find = items.find(item => item.ref.current === currentItem)) === null || _items$find === void 0 ? void 0 : _items$find.textValue; + const values = items.map(item => item.textValue); + const nextMatch = $213e4d2df823067d$var$getNextMatch(values, search, currentMatch); + const newItem = (_items$find2 = items.find(item => item.textValue === nextMatch)) === null || _items$find2 === void 0 ? void 0 : _items$find2.ref.current; // Reset `searchRef` 1 second after it was last updated + (function updateSearch(value) { + searchRef.current = value; + window.clearTimeout(timerRef.current); + if (value !== '') timerRef.current = window.setTimeout(() => updateSearch(''), 1000); + })(search); + if (newItem) + /** + * Imperative focus during keydown is risky so we prevent React's batching updates + * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332 + */ + setTimeout(() => newItem.focus()); + }; + $cnSS2$react.useEffect(() => { + return () => window.clearTimeout(timerRef.current); + }, []); // Make sure the whole tree has focus guards as our `MenuContent` may be + // the last element in the DOM (beacuse of the `Portal`) + $cnSS2$radixuireactfocusguards.useFocusGuards(); + const isPointerMovingToSubmenu = $cnSS2$react.useCallback(event => { + var _pointerGraceIntentRe, _pointerGraceIntentRe2; + const isMovingTowards = pointerDirRef.current === ((_pointerGraceIntentRe = pointerGraceIntentRef.current) === null || _pointerGraceIntentRe === void 0 ? void 0 : _pointerGraceIntentRe.side); + return isMovingTowards && $213e4d2df823067d$var$isPointerInGraceArea(event, (_pointerGraceIntentRe2 = pointerGraceIntentRef.current) === null || _pointerGraceIntentRe2 === void 0 ? void 0 : _pointerGraceIntentRe2.area); + }, []); + return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuContentProvider, { + scope: __scopeMenu, + searchRef: searchRef, + onItemEnter: $cnSS2$react.useCallback(event => { + if (isPointerMovingToSubmenu(event)) event.preventDefault(); + }, [isPointerMovingToSubmenu]), + onItemLeave: $cnSS2$react.useCallback(event => { + var _contentRef$current; + if (isPointerMovingToSubmenu(event)) return; + (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 || _contentRef$current.focus(); + setCurrentItemId(null); + }, [isPointerMovingToSubmenu]), + onTriggerLeave: $cnSS2$react.useCallback(event => { + if (isPointerMovingToSubmenu(event)) event.preventDefault(); + }, [isPointerMovingToSubmenu]), + pointerGraceTimerRef: pointerGraceTimerRef, + onPointerGraceIntentChange: $cnSS2$react.useCallback(intent => { + pointerGraceIntentRef.current = intent; + }, []) + }, /*#__PURE__*/$cnSS2$react.createElement(ScrollLockWrapper, scrollLockWrapperProps, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactfocusscope.FocusScope, { + asChild: true, + trapped: trapFocus, + onMountAutoFocus: $cnSS2$radixuiprimitive.composeEventHandlers(onOpenAutoFocus, event => { + var _contentRef$current2; + // when opening, explicitly focus the content area only and leave + // `onEntryFocus` in control of focusing first item + event.preventDefault(); + (_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 || _contentRef$current2.focus(); + }), + onUnmountAutoFocus: onCloseAutoFocus + }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactdismissablelayer.DismissableLayer, { + asChild: true, + disableOutsidePointerEvents: disableOutsidePointerEvents, + onEscapeKeyDown: onEscapeKeyDown, + onPointerDownOutside: onPointerDownOutside, + onFocusOutside: onFocusOutside, + onInteractOutside: onInteractOutside, + onDismiss: onDismiss + }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactrovingfocus.Root, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ + asChild: true + }, rovingFocusGroupScope, { + dir: rootContext.dir, + orientation: "vertical", + loop: loop, + currentTabStopId: currentItemId, + onCurrentTabStopIdChange: setCurrentItemId, + onEntryFocus: $cnSS2$radixuiprimitive.composeEventHandlers(onEntryFocus, event => { + // only focus first item when using keyboard + if (!rootContext.isUsingKeyboardRef.current) event.preventDefault(); + }) + }), /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpopper.Content, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ + role: "menu", + "aria-orientation": "vertical", + "data-state": $213e4d2df823067d$var$getOpenState(context.open), + "data-radix-menu-content": "", + dir: rootContext.dir + }, popperScope, contentProps, { + ref: composedRefs, + style: { + outline: 'none', + ...contentProps.style + }, + onKeyDown: $cnSS2$radixuiprimitive.composeEventHandlers(contentProps.onKeyDown, event => { + // submenu key events bubble through portals. We only care about keys in this menu. + const target = event.target; + const isKeyDownInside = target.closest('[data-radix-menu-content]') === event.currentTarget; + const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; + const isCharacterKey = event.key.length === 1; + if (isKeyDownInside) { + // menus should not be navigated using tab key so we prevent it + if (event.key === 'Tab') event.preventDefault(); + if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key); + } // focus first/last item based on key pressed + const content = contentRef.current; + if (event.target !== content) return; + if (!$213e4d2df823067d$var$FIRST_LAST_KEYS.includes(event.key)) return; + event.preventDefault(); + const items = getItems().filter(item => !item.disabled); + const candidateNodes = items.map(item => item.ref.current); + if ($213e4d2df823067d$var$LAST_KEYS.includes(event.key)) candidateNodes.reverse(); + $213e4d2df823067d$var$focusFirst(candidateNodes); + }), + onBlur: $cnSS2$radixuiprimitive.composeEventHandlers(props.onBlur, event => { + // clear search buffer when leaving the menu + if (!event.currentTarget.contains(event.target)) { + window.clearTimeout(timerRef.current); + searchRef.current = ''; + } + }), + onPointerMove: $cnSS2$radixuiprimitive.composeEventHandlers(props.onPointerMove, $213e4d2df823067d$var$whenMouse(event => { + const target = event.target; + const pointerXHasChanged = lastPointerXRef.current !== event.clientX; // We don't use `event.movementX` for this check because Safari will + // always return `0` on a pointer event. + if (event.currentTarget.contains(target) && pointerXHasChanged) { + const newDir = event.clientX > lastPointerXRef.current ? 'right' : 'left'; + pointerDirRef.current = newDir; + lastPointerXRef.current = event.clientX; + } + })) + }))))))); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$479f0f2f71193efe, { + displayName: $213e4d2df823067d$var$CONTENT_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuGroup + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$GROUP_NAME = 'MenuGroup'; +const $213e4d2df823067d$export$22a631d1f72787bb = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const { + __scopeMenu: __scopeMenu, + ...groupProps + } = props; + return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactprimitive.Primitive.div, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ + role: "group" + }, groupProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$22a631d1f72787bb, { + displayName: $213e4d2df823067d$var$GROUP_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuLabel + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$LABEL_NAME = 'MenuLabel'; +const $213e4d2df823067d$export$dd37bec0e8a99143 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const { + __scopeMenu: __scopeMenu, + ...labelProps + } = props; + return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactprimitive.Primitive.div, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, labelProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$dd37bec0e8a99143, { + displayName: $213e4d2df823067d$var$LABEL_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuItem + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$ITEM_NAME = 'MenuItem'; +const $213e4d2df823067d$var$ITEM_SELECT = 'menu.itemSelect'; +const $213e4d2df823067d$export$2ce376c2cc3355c8 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const { + disabled = false, + onSelect: onSelect, + ...itemProps + } = props; + const ref = $cnSS2$react.useRef(null); + const rootContext = $213e4d2df823067d$var$useMenuRootContext($213e4d2df823067d$var$ITEM_NAME, props.__scopeMenu); + const contentContext = $213e4d2df823067d$var$useMenuContentContext($213e4d2df823067d$var$ITEM_NAME, props.__scopeMenu); + const composedRefs = $cnSS2$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); + const isPointerDownRef = $cnSS2$react.useRef(false); + const handleSelect = () => { + const menuItem = ref.current; + if (!disabled && menuItem) { + const itemSelectEvent = new CustomEvent($213e4d2df823067d$var$ITEM_SELECT, { + bubbles: true, + cancelable: true + }); + menuItem.addEventListener($213e4d2df823067d$var$ITEM_SELECT, event => onSelect === null || onSelect === void 0 ? void 0 : onSelect(event), { + once: true + }); + $cnSS2$radixuireactprimitive.dispatchDiscreteCustomEvent(menuItem, itemSelectEvent); + if (itemSelectEvent.defaultPrevented) isPointerDownRef.current = false;else rootContext.onClose(); + } + }; + return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuItemImpl, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, itemProps, { + ref: composedRefs, + disabled: disabled, + onClick: $cnSS2$radixuiprimitive.composeEventHandlers(props.onClick, handleSelect), + onPointerDown: event => { + var _props$onPointerDown; + (_props$onPointerDown = props.onPointerDown) === null || _props$onPointerDown === void 0 || _props$onPointerDown.call(props, event); + isPointerDownRef.current = true; + }, + onPointerUp: $cnSS2$radixuiprimitive.composeEventHandlers(props.onPointerUp, event => { + var _event$currentTarget; + // Pointer down can move to a different menu item which should activate it on pointer up. + // We dispatch a click for selection to allow composition with click based triggers and to + // prevent Firefox from getting stuck in text selection mode when the menu closes. + if (!isPointerDownRef.current) (_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || _event$currentTarget.click(); + }), + onKeyDown: $cnSS2$radixuiprimitive.composeEventHandlers(props.onKeyDown, event => { + const isTypingAhead = contentContext.searchRef.current !== ''; + if (disabled || isTypingAhead && event.key === ' ') return; + if ($213e4d2df823067d$var$SELECTION_KEYS.includes(event.key)) { + event.currentTarget.click(); + /** + * We prevent default browser behaviour for selection keys as they should trigger + * a selection only: + * - prevents space from scrolling the page. + * - if keydown causes focus to move, prevents keydown from firing on the new target. + */ + event.preventDefault(); + } + }) + })); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$2ce376c2cc3355c8, { + displayName: $213e4d2df823067d$var$ITEM_NAME +}); +/* ---------------------------------------------------------------------------------------------- */ +const $213e4d2df823067d$var$MenuItemImpl = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const { + __scopeMenu: __scopeMenu, + disabled = false, + textValue: textValue, + ...itemProps + } = props; + const contentContext = $213e4d2df823067d$var$useMenuContentContext($213e4d2df823067d$var$ITEM_NAME, __scopeMenu); + const rovingFocusGroupScope = $213e4d2df823067d$var$useRovingFocusGroupScope(__scopeMenu); + const ref = $cnSS2$react.useRef(null); + const composedRefs = $cnSS2$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); + const [isFocused, setIsFocused] = $cnSS2$react.useState(false); // get the item's `.textContent` as default strategy for typeahead `textValue` + const [textContent, setTextContent] = $cnSS2$react.useState(''); + $cnSS2$react.useEffect(() => { + const menuItem = ref.current; + if (menuItem) { + var _menuItem$textContent; + setTextContent(((_menuItem$textContent = menuItem.textContent) !== null && _menuItem$textContent !== void 0 ? _menuItem$textContent : '').trim()); + } + }, [itemProps.children]); + return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$Collection.ItemSlot, { + scope: __scopeMenu, + disabled: disabled, + textValue: textValue !== null && textValue !== void 0 ? textValue : textContent + }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactrovingfocus.Item, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ + asChild: true + }, rovingFocusGroupScope, { + focusable: !disabled + }), /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactprimitive.Primitive.div, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ + role: "menuitem", + "data-highlighted": isFocused ? '' : undefined, + "aria-disabled": disabled || undefined, + "data-disabled": disabled ? '' : undefined + }, itemProps, { + ref: composedRefs, + onPointerMove: $cnSS2$radixuiprimitive.composeEventHandlers(props.onPointerMove, $213e4d2df823067d$var$whenMouse(event => { + if (disabled) contentContext.onItemLeave(event);else { + contentContext.onItemEnter(event); + if (!event.defaultPrevented) { + const item = event.currentTarget; + item.focus(); + } + } + })), + onPointerLeave: $cnSS2$radixuiprimitive.composeEventHandlers(props.onPointerLeave, $213e4d2df823067d$var$whenMouse(event => contentContext.onItemLeave(event))), + onFocus: $cnSS2$radixuiprimitive.composeEventHandlers(props.onFocus, () => setIsFocused(true)), + onBlur: $cnSS2$radixuiprimitive.composeEventHandlers(props.onBlur, () => setIsFocused(false)) + })))); +}); +/* ------------------------------------------------------------------------------------------------- + * MenuCheckboxItem + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$CHECKBOX_ITEM_NAME = 'MenuCheckboxItem'; +const $213e4d2df823067d$export$f6f243521332502d = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const { + checked = false, + onCheckedChange: onCheckedChange, + ...checkboxItemProps + } = props; + return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$ItemIndicatorProvider, { + scope: props.__scopeMenu, + checked: checked + }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$export$2ce376c2cc3355c8, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ + role: "menuitemcheckbox", + "aria-checked": $213e4d2df823067d$var$isIndeterminate(checked) ? 'mixed' : checked + }, checkboxItemProps, { + ref: forwardedRef, + "data-state": $213e4d2df823067d$var$getCheckedState(checked), + onSelect: $cnSS2$radixuiprimitive.composeEventHandlers(checkboxItemProps.onSelect, () => onCheckedChange === null || onCheckedChange === void 0 ? void 0 : onCheckedChange($213e4d2df823067d$var$isIndeterminate(checked) ? true : !checked), { + checkForDefaultPrevented: false + }) + }))); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$f6f243521332502d, { + displayName: $213e4d2df823067d$var$CHECKBOX_ITEM_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuRadioGroup + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$RADIO_GROUP_NAME = 'MenuRadioGroup'; +const [$213e4d2df823067d$var$RadioGroupProvider, $213e4d2df823067d$var$useRadioGroupContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$RADIO_GROUP_NAME, { + value: undefined, + onValueChange: () => {} +}); +const $213e4d2df823067d$export$ea2200c9eee416b3 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const { + value: value, + onValueChange: onValueChange, + ...groupProps + } = props; + const handleValueChange = $cnSS2$radixuireactusecallbackref.useCallbackRef(onValueChange); + return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$RadioGroupProvider, { + scope: props.__scopeMenu, + value: value, + onValueChange: handleValueChange + }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$export$22a631d1f72787bb, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, groupProps, { + ref: forwardedRef + }))); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$ea2200c9eee416b3, { + displayName: $213e4d2df823067d$var$RADIO_GROUP_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuRadioItem + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$RADIO_ITEM_NAME = 'MenuRadioItem'; +const $213e4d2df823067d$export$69bd225e9817f6d0 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const { + value: value, + ...radioItemProps + } = props; + const context = $213e4d2df823067d$var$useRadioGroupContext($213e4d2df823067d$var$RADIO_ITEM_NAME, props.__scopeMenu); + const checked = value === context.value; + return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$ItemIndicatorProvider, { + scope: props.__scopeMenu, + checked: checked + }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$export$2ce376c2cc3355c8, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ + role: "menuitemradio", + "aria-checked": checked + }, radioItemProps, { + ref: forwardedRef, + "data-state": $213e4d2df823067d$var$getCheckedState(checked), + onSelect: $cnSS2$radixuiprimitive.composeEventHandlers(radioItemProps.onSelect, () => { + var _context$onValueChang; + return (_context$onValueChang = context.onValueChange) === null || _context$onValueChang === void 0 ? void 0 : _context$onValueChang.call(context, value); + }, { + checkForDefaultPrevented: false + }) + }))); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$69bd225e9817f6d0, { + displayName: $213e4d2df823067d$var$RADIO_ITEM_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuItemIndicator + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$ITEM_INDICATOR_NAME = 'MenuItemIndicator'; +const [$213e4d2df823067d$var$ItemIndicatorProvider, $213e4d2df823067d$var$useItemIndicatorContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$ITEM_INDICATOR_NAME, { + checked: false +}); +const $213e4d2df823067d$export$a2593e23056970a3 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const { + __scopeMenu: __scopeMenu, + forceMount: forceMount, + ...itemIndicatorProps + } = props; + const indicatorContext = $213e4d2df823067d$var$useItemIndicatorContext($213e4d2df823067d$var$ITEM_INDICATOR_NAME, __scopeMenu); + return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpresence.Presence, { + present: forceMount || $213e4d2df823067d$var$isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true + }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactprimitive.Primitive.span, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, itemIndicatorProps, { + ref: forwardedRef, + "data-state": $213e4d2df823067d$var$getCheckedState(indicatorContext.checked) + }))); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$a2593e23056970a3, { + displayName: $213e4d2df823067d$var$ITEM_INDICATOR_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuSeparator + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$SEPARATOR_NAME = 'MenuSeparator'; +const $213e4d2df823067d$export$1cec7dcdd713e220 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const { + __scopeMenu: __scopeMenu, + ...separatorProps + } = props; + return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactprimitive.Primitive.div, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ + role: "separator", + "aria-orientation": "horizontal" + }, separatorProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$1cec7dcdd713e220, { + displayName: $213e4d2df823067d$var$SEPARATOR_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuArrow + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$ARROW_NAME = 'MenuArrow'; +const $213e4d2df823067d$export$bcdda4773debf5fa = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const { + __scopeMenu: __scopeMenu, + ...arrowProps + } = props; + const popperScope = $213e4d2df823067d$var$usePopperScope(__scopeMenu); + return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpopper.Arrow, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, popperScope, arrowProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$bcdda4773debf5fa, { + displayName: $213e4d2df823067d$var$ARROW_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuSub + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$SUB_NAME = 'MenuSub'; +const [$213e4d2df823067d$var$MenuSubProvider, $213e4d2df823067d$var$useMenuSubContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$SUB_NAME); +const $213e4d2df823067d$export$71bdb9d1e2909932 = props => { + const { + __scopeMenu: __scopeMenu, + children: children, + open = false, + onOpenChange: onOpenChange + } = props; + const parentMenuContext = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$SUB_NAME, __scopeMenu); + const popperScope = $213e4d2df823067d$var$usePopperScope(__scopeMenu); + const [trigger, setTrigger] = $cnSS2$react.useState(null); + const [content, setContent] = $cnSS2$react.useState(null); + const handleOpenChange = $cnSS2$radixuireactusecallbackref.useCallbackRef(onOpenChange); // Prevent the parent menu from reopening with open submenus. + $cnSS2$react.useEffect(() => { + if (parentMenuContext.open === false) handleOpenChange(false); + return () => handleOpenChange(false); + }, [parentMenuContext.open, handleOpenChange]); + return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpopper.Root, popperScope, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuProvider, { + scope: __scopeMenu, + open: open, + onOpenChange: handleOpenChange, + content: content, + onContentChange: setContent + }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuSubProvider, { + scope: __scopeMenu, + contentId: $cnSS2$radixuireactid.useId(), + triggerId: $cnSS2$radixuireactid.useId(), + trigger: trigger, + onTriggerChange: setTrigger + }, children))); +}; +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$71bdb9d1e2909932, { + displayName: $213e4d2df823067d$var$SUB_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuSubTrigger + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$SUB_TRIGGER_NAME = 'MenuSubTrigger'; +const $213e4d2df823067d$export$5fbbb3ba7297405f = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$SUB_TRIGGER_NAME, props.__scopeMenu); + const rootContext = $213e4d2df823067d$var$useMenuRootContext($213e4d2df823067d$var$SUB_TRIGGER_NAME, props.__scopeMenu); + const subContext = $213e4d2df823067d$var$useMenuSubContext($213e4d2df823067d$var$SUB_TRIGGER_NAME, props.__scopeMenu); + const contentContext = $213e4d2df823067d$var$useMenuContentContext($213e4d2df823067d$var$SUB_TRIGGER_NAME, props.__scopeMenu); + const openTimerRef = $cnSS2$react.useRef(null); + const { + pointerGraceTimerRef: pointerGraceTimerRef, + onPointerGraceIntentChange: onPointerGraceIntentChange + } = contentContext; + const scope = { + __scopeMenu: props.__scopeMenu + }; + const clearOpenTimer = $cnSS2$react.useCallback(() => { + if (openTimerRef.current) window.clearTimeout(openTimerRef.current); + openTimerRef.current = null; + }, []); + $cnSS2$react.useEffect(() => clearOpenTimer, [clearOpenTimer]); + $cnSS2$react.useEffect(() => { + const pointerGraceTimer = pointerGraceTimerRef.current; + return () => { + window.clearTimeout(pointerGraceTimer); + onPointerGraceIntentChange(null); + }; + }, [pointerGraceTimerRef, onPointerGraceIntentChange]); + return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$export$9fa5ebd18bee4d43, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ + asChild: true + }, scope), /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuItemImpl, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ + id: subContext.triggerId, + "aria-haspopup": "menu", + "aria-expanded": context.open, + "aria-controls": subContext.contentId, + "data-state": $213e4d2df823067d$var$getOpenState(context.open) + }, props, { + ref: $cnSS2$radixuireactcomposerefs.composeRefs(forwardedRef, subContext.onTriggerChange) // This is redundant for mouse users but we cannot determine pointer type from + , + + onClick: event => { + var _props$onClick; + (_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, event); + if (props.disabled || event.defaultPrevented) return; + /** + * We manually focus because iOS Safari doesn't always focus on click (e.g. buttons) + * and we rely heavily on `onFocusOutside` for submenus to close when switching + * between separate submenus. + */ + event.currentTarget.focus(); + if (!context.open) context.onOpenChange(true); + }, + onPointerMove: $cnSS2$radixuiprimitive.composeEventHandlers(props.onPointerMove, $213e4d2df823067d$var$whenMouse(event => { + contentContext.onItemEnter(event); + if (event.defaultPrevented) return; + if (!props.disabled && !context.open && !openTimerRef.current) { + contentContext.onPointerGraceIntentChange(null); + openTimerRef.current = window.setTimeout(() => { + context.onOpenChange(true); + clearOpenTimer(); + }, 100); + } + })), + onPointerLeave: $cnSS2$radixuiprimitive.composeEventHandlers(props.onPointerLeave, $213e4d2df823067d$var$whenMouse(event => { + var _context$content; + clearOpenTimer(); + const contentRect = (_context$content = context.content) === null || _context$content === void 0 ? void 0 : _context$content.getBoundingClientRect(); + if (contentRect) { + var _context$content2; + // TODO: make sure to update this when we change positioning logic + const side = (_context$content2 = context.content) === null || _context$content2 === void 0 ? void 0 : _context$content2.dataset.side; + const rightSide = side === 'right'; + const bleed = rightSide ? -5 : 5; + const contentNearEdge = contentRect[rightSide ? 'left' : 'right']; + const contentFarEdge = contentRect[rightSide ? 'right' : 'left']; + contentContext.onPointerGraceIntentChange({ + area: [ + // consistently within polygon bounds + { + x: event.clientX + bleed, + y: event.clientY + }, { + x: contentNearEdge, + y: contentRect.top + }, { + x: contentFarEdge, + y: contentRect.top + }, { + x: contentFarEdge, + y: contentRect.bottom + }, { + x: contentNearEdge, + y: contentRect.bottom + }], + side: side + }); + window.clearTimeout(pointerGraceTimerRef.current); + pointerGraceTimerRef.current = window.setTimeout(() => contentContext.onPointerGraceIntentChange(null), 300); + } else { + contentContext.onTriggerLeave(event); + if (event.defaultPrevented) return; // There's 100ms where the user may leave an item before the submenu was opened. + contentContext.onPointerGraceIntentChange(null); + } + })), + onKeyDown: $cnSS2$radixuiprimitive.composeEventHandlers(props.onKeyDown, event => { + const isTypingAhead = contentContext.searchRef.current !== ''; + if (props.disabled || isTypingAhead && event.key === ' ') return; + if ($213e4d2df823067d$var$SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) { + var _context$content3; + context.onOpenChange(true); // The trigger may hold focus if opened via pointer interaction + // so we ensure content is given focus again when switching to keyboard. + (_context$content3 = context.content) === null || _context$content3 === void 0 || _context$content3.focus(); // prevent window from scrolling + event.preventDefault(); + } + }) + }))); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$5fbbb3ba7297405f, { + displayName: $213e4d2df823067d$var$SUB_TRIGGER_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * MenuSubContent + * -----------------------------------------------------------------------------------------------*/ +const $213e4d2df823067d$var$SUB_CONTENT_NAME = 'MenuSubContent'; +const $213e4d2df823067d$export$e7142ab31822bde6 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { + const portalContext = $213e4d2df823067d$var$usePortalContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); + const { + forceMount = portalContext.forceMount, + ...subContentProps + } = props; + const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); + const rootContext = $213e4d2df823067d$var$useMenuRootContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); + const subContext = $213e4d2df823067d$var$useMenuSubContext($213e4d2df823067d$var$SUB_CONTENT_NAME, props.__scopeMenu); + const ref = $cnSS2$react.useRef(null); + const composedRefs = $cnSS2$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); + return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$Collection.Provider, { + scope: props.__scopeMenu + }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpresence.Presence, { + present: forceMount || context.open + }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$Collection.Slot, { + scope: props.__scopeMenu + }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuContentImpl, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ + id: subContext.contentId, + "aria-labelledby": subContext.triggerId + }, subContentProps, { + ref: composedRefs, + align: "start", + side: rootContext.dir === 'rtl' ? 'left' : 'right', + disableOutsidePointerEvents: false, + disableOutsideScroll: false, + trapFocus: false, + onOpenAutoFocus: event => { + var _ref$current; + // when opening a submenu, focus content for keyboard users only + if (rootContext.isUsingKeyboardRef.current) (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus(); + event.preventDefault(); + } // The menu might close because of focusing another menu item in the parent menu. We + , + + onCloseAutoFocus: event => event.preventDefault(), + onFocusOutside: $cnSS2$radixuiprimitive.composeEventHandlers(props.onFocusOutside, event => { + // We prevent closing when the trigger is focused to avoid triggering a re-open animation + // on pointer interaction. + if (event.target !== subContext.trigger) context.onOpenChange(false); + }), + onEscapeKeyDown: $cnSS2$radixuiprimitive.composeEventHandlers(props.onEscapeKeyDown, event => { + rootContext.onClose(); // ensure pressing escape in submenu doesn't escape full screen mode + event.preventDefault(); + }), + onKeyDown: $cnSS2$radixuiprimitive.composeEventHandlers(props.onKeyDown, event => { + // Submenu key events bubble through portals. We only care about keys in this menu. + const isKeyDownInside = event.currentTarget.contains(event.target); + const isCloseKey = $213e4d2df823067d$var$SUB_CLOSE_KEYS[rootContext.dir].includes(event.key); + if (isKeyDownInside && isCloseKey) { + var _subContext$trigger; + context.onOpenChange(false); // We focus manually because we prevented it in `onCloseAutoFocus` + (_subContext$trigger = subContext.trigger) === null || _subContext$trigger === void 0 || _subContext$trigger.focus(); // prevent window from scrolling + event.preventDefault(); + } + }) + }))))); +}); +/*#__PURE__*/ +Object.assign($213e4d2df823067d$export$e7142ab31822bde6, { + displayName: $213e4d2df823067d$var$SUB_CONTENT_NAME +}); +/* -----------------------------------------------------------------------------------------------*/ +function $213e4d2df823067d$var$getOpenState(open) { + return open ? 'open' : 'closed'; +} +function $213e4d2df823067d$var$isIndeterminate(checked) { + return checked === 'indeterminate'; +} +function $213e4d2df823067d$var$getCheckedState(checked) { + return $213e4d2df823067d$var$isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked'; +} +function $213e4d2df823067d$var$focusFirst(candidates) { + const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; + for (const candidate of candidates) { + // if focus is already where we want to go, we don't want to keep going through the candidates + if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; + candidate.focus(); + if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; + } +} +/** + * Wraps an array around itself at a given start index + * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']` + */ +function $213e4d2df823067d$var$wrapArray(array, startIndex) { + return array.map((_, index) => array[(startIndex + index) % array.length]); +} +/** + * This is the "meat" of the typeahead matching logic. It takes in all the values, + * the search and the current match, and returns the next match (or `undefined`). + * + * We normalize the search because if a user has repeatedly pressed a character, + * we want the exact same behavior as if we only had that one character + * (ie. cycle through options starting with that character) + * + * We also reorder the values by wrapping the array around the current match. + * This is so we always look forward from the current match, and picking the first + * match will always be the correct one. + * + * Finally, if the normalized search is exactly one character, we exclude the + * current match from the values because otherwise it would be the first to match always + * and focus would never move. This is as opposed to the regular case, where we + * don't want focus to move if the current match still matches. + */ +function $213e4d2df823067d$var$getNextMatch(values, search, currentMatch) { + const isRepeated = search.length > 1 && Array.from(search).every(char => char === search[0]); + const normalizedSearch = isRepeated ? search[0] : search; + const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1; + let wrappedValues = $213e4d2df823067d$var$wrapArray(values, Math.max(currentMatchIndex, 0)); + const excludeCurrentMatch = normalizedSearch.length === 1; + if (excludeCurrentMatch) wrappedValues = wrappedValues.filter(v => v !== currentMatch); + const nextMatch = wrappedValues.find(value => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())); + return nextMatch !== currentMatch ? nextMatch : undefined; +} +// Determine if a point is inside of a polygon. +// Based on https://github.com/substack/point-in-polygon +function $213e4d2df823067d$var$isPointInPolygon(point, polygon) { + const { + x: x, + y: y + } = point; + let inside = false; + for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { + const xi = polygon[i].x; + const yi = polygon[i].y; + const xj = polygon[j].x; + const yj = polygon[j].y; // prettier-ignore + const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi; + if (intersect) inside = !inside; + } + return inside; +} +function $213e4d2df823067d$var$isPointerInGraceArea(event, area) { + if (!area) return false; + const cursorPos = { + x: event.clientX, + y: event.clientY + }; + return $213e4d2df823067d$var$isPointInPolygon(cursorPos, area); +} +function $213e4d2df823067d$var$whenMouse(handler) { + return event => event.pointerType === 'mouse' ? handler(event) : undefined; +} +const $213e4d2df823067d$export$be92b6f5f03c0fe9 = $213e4d2df823067d$export$d9b273488cd8ce6f; +const $213e4d2df823067d$export$b688253958b8dfe7 = $213e4d2df823067d$export$9fa5ebd18bee4d43; +const $213e4d2df823067d$export$602eac185826482c = $213e4d2df823067d$export$793392f970497feb; +const $213e4d2df823067d$export$7c6e2c02157bb7d2 = $213e4d2df823067d$export$479f0f2f71193efe; +const $213e4d2df823067d$export$eb2fcfdbd7ba97d4 = $213e4d2df823067d$export$22a631d1f72787bb; +const $213e4d2df823067d$export$b04be29aa201d4f5 = $213e4d2df823067d$export$dd37bec0e8a99143; +const $213e4d2df823067d$export$6d08773d2e66f8f2 = $213e4d2df823067d$export$2ce376c2cc3355c8; +const $213e4d2df823067d$export$16ce288f89fa631c = $213e4d2df823067d$export$f6f243521332502d; +const $213e4d2df823067d$export$a98f0dcb43a68a25 = $213e4d2df823067d$export$ea2200c9eee416b3; +const $213e4d2df823067d$export$371ab307eab489c0 = $213e4d2df823067d$export$69bd225e9817f6d0; +const $213e4d2df823067d$export$c3468e2714d175fa = $213e4d2df823067d$export$a2593e23056970a3; +const $213e4d2df823067d$export$1ff3c3f08ae963c0 = $213e4d2df823067d$export$1cec7dcdd713e220; +const $213e4d2df823067d$export$21b07c8f274aebd5 = $213e4d2df823067d$export$bcdda4773debf5fa; +const $213e4d2df823067d$export$d7a01e11500dfb6f = $213e4d2df823067d$export$71bdb9d1e2909932; +const $213e4d2df823067d$export$2ea8a7a591ac5eac = $213e4d2df823067d$export$5fbbb3ba7297405f; +const $213e4d2df823067d$export$6d4de93b380beddf = $213e4d2df823067d$export$e7142ab31822bde6; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-popper/dist/index.js": +/*!******************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-popper/dist/index.js ***! + \******************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $50Iv9$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $50Iv9$react = __webpack_require__(/*! react */ "react"); +var $50Iv9$floatinguireactdom = __webpack_require__(/*! @floating-ui/react-dom */ "../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js"); +var $50Iv9$radixuireactarrow = __webpack_require__(/*! @radix-ui/react-arrow */ "../../../node_modules/@radix-ui/react-arrow/dist/index.js"); +var $50Iv9$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); +var $50Iv9$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); +var $50Iv9$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); +var $50Iv9$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); +var $50Iv9$radixuireactuselayouteffect = __webpack_require__(/*! @radix-ui/react-use-layout-effect */ "../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.js"); +var $50Iv9$radixuireactusesize = __webpack_require__(/*! @radix-ui/react-use-size */ "../../../node_modules/@radix-ui/react-use-size/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "createPopperScope", () => $34310caa050a8d63$export$722aac194ae923); +$parcel$export(module.exports, "Popper", () => $34310caa050a8d63$export$badac9ada3a0bdf9); +$parcel$export(module.exports, "PopperAnchor", () => $34310caa050a8d63$export$ecd4e1ccab6ed6d); +$parcel$export(module.exports, "PopperContent", () => $34310caa050a8d63$export$bc4ae5855d3c4fc); +$parcel$export(module.exports, "PopperArrow", () => $34310caa050a8d63$export$79d62cd4e10a3fd0); +$parcel$export(module.exports, "Root", () => $34310caa050a8d63$export$be92b6f5f03c0fe9); +$parcel$export(module.exports, "Anchor", () => $34310caa050a8d63$export$b688253958b8dfe7); +$parcel$export(module.exports, "Content", () => $34310caa050a8d63$export$7c6e2c02157bb7d2); +$parcel$export(module.exports, "Arrow", () => $34310caa050a8d63$export$21b07c8f274aebd5); +$parcel$export(module.exports, "SIDE_OPTIONS", () => $34310caa050a8d63$export$36f0086da09c4b9f); +$parcel$export(module.exports, "ALIGN_OPTIONS", () => $34310caa050a8d63$export$3671ffab7b302fc9); +const $34310caa050a8d63$export$36f0086da09c4b9f = ['top', 'right', 'bottom', 'left']; +const $34310caa050a8d63$export$3671ffab7b302fc9 = ['start', 'center', 'end']; +/* ------------------------------------------------------------------------------------------------- + * Popper + * -----------------------------------------------------------------------------------------------*/ +const $34310caa050a8d63$var$POPPER_NAME = 'Popper'; +const [$34310caa050a8d63$var$createPopperContext, $34310caa050a8d63$export$722aac194ae923] = $50Iv9$radixuireactcontext.createContextScope($34310caa050a8d63$var$POPPER_NAME); +const [$34310caa050a8d63$var$PopperProvider, $34310caa050a8d63$var$usePopperContext] = $34310caa050a8d63$var$createPopperContext($34310caa050a8d63$var$POPPER_NAME); +const $34310caa050a8d63$export$badac9ada3a0bdf9 = props => { + const { + __scopePopper: __scopePopper, + children: children + } = props; + const [anchor, setAnchor] = $50Iv9$react.useState(null); + return /*#__PURE__*/$50Iv9$react.createElement($34310caa050a8d63$var$PopperProvider, { + scope: __scopePopper, + anchor: anchor, + onAnchorChange: setAnchor + }, children); +}; +/*#__PURE__*/ +Object.assign($34310caa050a8d63$export$badac9ada3a0bdf9, { + displayName: $34310caa050a8d63$var$POPPER_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * PopperAnchor + * -----------------------------------------------------------------------------------------------*/ +const $34310caa050a8d63$var$ANCHOR_NAME = 'PopperAnchor'; +const $34310caa050a8d63$export$ecd4e1ccab6ed6d = /*#__PURE__*/$50Iv9$react.forwardRef((props, forwardedRef) => { + const { + __scopePopper: __scopePopper, + virtualRef: virtualRef, + ...anchorProps + } = props; + const context = $34310caa050a8d63$var$usePopperContext($34310caa050a8d63$var$ANCHOR_NAME, __scopePopper); + const ref = $50Iv9$react.useRef(null); + const composedRefs = $50Iv9$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); + $50Iv9$react.useEffect(() => { + // Consumer can anchor the popper to something that isn't + // a DOM node e.g. pointer position, so we override the + // `anchorRef` with their virtual ref in this case. + context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current); + }); + return virtualRef ? null : /*#__PURE__*/$50Iv9$react.createElement($50Iv9$radixuireactprimitive.Primitive.div, $parcel$interopDefault($50Iv9$babelruntimehelpersextends)({}, anchorProps, { + ref: composedRefs + })); +}); +/*#__PURE__*/ +Object.assign($34310caa050a8d63$export$ecd4e1ccab6ed6d, { + displayName: $34310caa050a8d63$var$ANCHOR_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * PopperContent + * -----------------------------------------------------------------------------------------------*/ +const $34310caa050a8d63$var$CONTENT_NAME = 'PopperContent'; +const [$34310caa050a8d63$var$PopperContentProvider, $34310caa050a8d63$var$useContentContext] = $34310caa050a8d63$var$createPopperContext($34310caa050a8d63$var$CONTENT_NAME); +const $34310caa050a8d63$export$bc4ae5855d3c4fc = /*#__PURE__*/$50Iv9$react.forwardRef((props, forwardedRef) => { + var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$trans, _middlewareData$trans2, _middlewareData$hide; + const { + __scopePopper: __scopePopper, + side = 'bottom', + sideOffset = 0, + align = 'center', + alignOffset = 0, + arrowPadding = 0, + collisionBoundary = [], + collisionPadding: collisionPaddingProp = 0, + sticky = 'partial', + hideWhenDetached = false, + avoidCollisions = true, + onPlaced: onPlaced, + ...contentProps + } = props; + const context = $34310caa050a8d63$var$usePopperContext($34310caa050a8d63$var$CONTENT_NAME, __scopePopper); + const [content, setContent] = $50Iv9$react.useState(null); + const composedRefs = $50Iv9$radixuireactcomposerefs.useComposedRefs(forwardedRef, node => setContent(node)); + const [arrow, setArrow] = $50Iv9$react.useState(null); + const arrowSize = $50Iv9$radixuireactusesize.useSize(arrow); + const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0; + const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0; + const desiredPlacement = side + (align !== 'center' ? '-' + align : ''); + const collisionPadding = typeof collisionPaddingProp === 'number' ? collisionPaddingProp : { + top: 0, + right: 0, + bottom: 0, + left: 0, + ...collisionPaddingProp + }; + const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary]; + const hasExplicitBoundaries = boundary.length > 0; + const detectOverflowOptions = { + padding: collisionPadding, + boundary: boundary.filter($34310caa050a8d63$var$isNotNull), + // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries + altBoundary: hasExplicitBoundaries + }; + const { + refs: refs, + floatingStyles: floatingStyles, + placement: placement, + isPositioned: isPositioned, + middlewareData: middlewareData + } = $50Iv9$floatinguireactdom.useFloating({ + // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues + strategy: 'fixed', + placement: desiredPlacement, + whileElementsMounted: $50Iv9$floatinguireactdom.autoUpdate, + elements: { + reference: context.anchor + }, + middleware: [$50Iv9$floatinguireactdom.offset({ + mainAxis: sideOffset + arrowHeight, + alignmentAxis: alignOffset + }), avoidCollisions && $50Iv9$floatinguireactdom.shift({ + mainAxis: true, + crossAxis: false, + limiter: sticky === 'partial' ? $50Iv9$floatinguireactdom.limitShift() : undefined, + ...detectOverflowOptions + }), avoidCollisions && $50Iv9$floatinguireactdom.flip({ + ...detectOverflowOptions + }), $50Iv9$floatinguireactdom.size({ + ...detectOverflowOptions, + apply: _ref => { + let { + elements: elements, + rects: rects, + availableWidth: availableWidth, + availableHeight: availableHeight + } = _ref; + const { + width: anchorWidth, + height: anchorHeight + } = rects.reference; + const contentStyle = elements.floating.style; + contentStyle.setProperty('--radix-popper-available-width', `${availableWidth}px`); + contentStyle.setProperty('--radix-popper-available-height', `${availableHeight}px`); + contentStyle.setProperty('--radix-popper-anchor-width', `${anchorWidth}px`); + contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`); + } + }), arrow && $50Iv9$floatinguireactdom.arrow({ + element: arrow, + padding: arrowPadding + }), $34310caa050a8d63$var$transformOrigin({ + arrowWidth: arrowWidth, + arrowHeight: arrowHeight + }), hideWhenDetached && $50Iv9$floatinguireactdom.hide({ + strategy: 'referenceHidden' + })] + }); + const [placedSide, placedAlign] = $34310caa050a8d63$var$getSideAndAlignFromPlacement(placement); + const handlePlaced = $50Iv9$radixuireactusecallbackref.useCallbackRef(onPlaced); + $50Iv9$radixuireactuselayouteffect.useLayoutEffect(() => { + if (isPositioned) handlePlaced === null || handlePlaced === void 0 || handlePlaced(); + }, [isPositioned, handlePlaced]); + const arrowX = (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x; + const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y; + const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0; + const [contentZIndex, setContentZIndex] = $50Iv9$react.useState(); + $50Iv9$radixuireactuselayouteffect.useLayoutEffect(() => { + if (content) setContentZIndex(window.getComputedStyle(content).zIndex); + }, [content]); + return /*#__PURE__*/$50Iv9$react.createElement("div", { + ref: refs.setFloating, + "data-radix-popper-content-wrapper": "", + style: { + ...floatingStyles, + transform: isPositioned ? floatingStyles.transform : 'translate(0, -200%)', + // keep off the page when measuring + minWidth: 'max-content', + zIndex: contentZIndex, + ['--radix-popper-transform-origin']: [(_middlewareData$trans = middlewareData.transformOrigin) === null || _middlewareData$trans === void 0 ? void 0 : _middlewareData$trans.x, (_middlewareData$trans2 = middlewareData.transformOrigin) === null || _middlewareData$trans2 === void 0 ? void 0 : _middlewareData$trans2.y].join(' ') + } // Floating UI interally calculates logical alignment based the `dir` attribute on + , + + dir: props.dir + }, /*#__PURE__*/$50Iv9$react.createElement($34310caa050a8d63$var$PopperContentProvider, { + scope: __scopePopper, + placedSide: placedSide, + onArrowChange: setArrow, + arrowX: arrowX, + arrowY: arrowY, + shouldHideArrow: cannotCenterArrow + }, /*#__PURE__*/$50Iv9$react.createElement($50Iv9$radixuireactprimitive.Primitive.div, $parcel$interopDefault($50Iv9$babelruntimehelpersextends)({ + "data-side": placedSide, + "data-align": placedAlign + }, contentProps, { + ref: composedRefs, + style: { + ...contentProps.style, + // if the PopperContent hasn't been placed yet (not all measurements done) + // we prevent animations so that users's animation don't kick in too early referring wrong sides + animation: !isPositioned ? 'none' : undefined, + // hide the content if using the hide middleware and should be hidden + opacity: (_middlewareData$hide = middlewareData.hide) !== null && _middlewareData$hide !== void 0 && _middlewareData$hide.referenceHidden ? 0 : undefined + } + })))); +}); +/*#__PURE__*/ +Object.assign($34310caa050a8d63$export$bc4ae5855d3c4fc, { + displayName: $34310caa050a8d63$var$CONTENT_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * PopperArrow + * -----------------------------------------------------------------------------------------------*/ +const $34310caa050a8d63$var$ARROW_NAME = 'PopperArrow'; +const $34310caa050a8d63$var$OPPOSITE_SIDE = { + top: 'bottom', + right: 'left', + bottom: 'top', + left: 'right' +}; +const $34310caa050a8d63$export$79d62cd4e10a3fd0 = /*#__PURE__*/$50Iv9$react.forwardRef(function $34310caa050a8d63$export$79d62cd4e10a3fd0(props, forwardedRef) { + const { + __scopePopper: __scopePopper, + ...arrowProps + } = props; + const contentContext = $34310caa050a8d63$var$useContentContext($34310caa050a8d63$var$ARROW_NAME, __scopePopper); + const baseSide = $34310caa050a8d63$var$OPPOSITE_SIDE[contentContext.placedSide]; + return /*#__PURE__*/ (// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`) + // doesn't report size as we'd expect on SVG elements. + // it reports their bounding box which is effectively the largest path inside the SVG. + $50Iv9$react.createElement("span", { + ref: contentContext.onArrowChange, + style: { + position: 'absolute', + left: contentContext.arrowX, + top: contentContext.arrowY, + [baseSide]: 0, + transformOrigin: { + top: '', + right: '0 0', + bottom: 'center 0', + left: '100% 0' + }[contentContext.placedSide], + transform: { + top: 'translateY(100%)', + right: 'translateY(50%) rotate(90deg) translateX(-50%)', + bottom: `rotate(180deg)`, + left: 'translateY(50%) rotate(-90deg) translateX(50%)' + }[contentContext.placedSide], + visibility: contentContext.shouldHideArrow ? 'hidden' : undefined + } + }, /*#__PURE__*/$50Iv9$react.createElement($50Iv9$radixuireactarrow.Root, $parcel$interopDefault($50Iv9$babelruntimehelpersextends)({}, arrowProps, { + ref: forwardedRef, + style: { + ...arrowProps.style, + // ensures the element can be measured correctly (mostly for if SVG) + display: 'block' + } + }))) + ); +}); +/*#__PURE__*/ +Object.assign($34310caa050a8d63$export$79d62cd4e10a3fd0, { + displayName: $34310caa050a8d63$var$ARROW_NAME +}); +/* -----------------------------------------------------------------------------------------------*/ +function $34310caa050a8d63$var$isNotNull(value) { + return value !== null; +} +const $34310caa050a8d63$var$transformOrigin = options => ({ + name: 'transformOrigin', + options: options, + fn(data) { + var _middlewareData$arrow4, _middlewareData$arrow5, _middlewareData$arrow6, _middlewareData$arrow7, _middlewareData$arrow8; + const { + placement: placement, + rects: rects, + middlewareData: middlewareData + } = data; + const cannotCenterArrow = ((_middlewareData$arrow4 = middlewareData.arrow) === null || _middlewareData$arrow4 === void 0 ? void 0 : _middlewareData$arrow4.centerOffset) !== 0; + const isArrowHidden = cannotCenterArrow; + const arrowWidth = isArrowHidden ? 0 : options.arrowWidth; + const arrowHeight = isArrowHidden ? 0 : options.arrowHeight; + const [placedSide, placedAlign] = $34310caa050a8d63$var$getSideAndAlignFromPlacement(placement); + const noArrowAlign = { + start: '0%', + center: '50%', + end: '100%' + }[placedAlign]; + const arrowXCenter = ((_middlewareData$arrow5 = (_middlewareData$arrow6 = middlewareData.arrow) === null || _middlewareData$arrow6 === void 0 ? void 0 : _middlewareData$arrow6.x) !== null && _middlewareData$arrow5 !== void 0 ? _middlewareData$arrow5 : 0) + arrowWidth / 2; + const arrowYCenter = ((_middlewareData$arrow7 = (_middlewareData$arrow8 = middlewareData.arrow) === null || _middlewareData$arrow8 === void 0 ? void 0 : _middlewareData$arrow8.y) !== null && _middlewareData$arrow7 !== void 0 ? _middlewareData$arrow7 : 0) + arrowHeight / 2; + let x = ''; + let y = ''; + if (placedSide === 'bottom') { + x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`; + y = `${-arrowHeight}px`; + } else if (placedSide === 'top') { + x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`; + y = `${rects.floating.height + arrowHeight}px`; + } else if (placedSide === 'right') { + x = `${-arrowHeight}px`; + y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`; + } else if (placedSide === 'left') { + x = `${rects.floating.width + arrowHeight}px`; + y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`; + } + return { + data: { + x: x, + y: y + } + }; + } +}); +function $34310caa050a8d63$var$getSideAndAlignFromPlacement(placement) { + const [side, align = 'center'] = placement.split('-'); + return [side, align]; +} +const $34310caa050a8d63$export$be92b6f5f03c0fe9 = $34310caa050a8d63$export$badac9ada3a0bdf9; +const $34310caa050a8d63$export$b688253958b8dfe7 = $34310caa050a8d63$export$ecd4e1ccab6ed6d; +const $34310caa050a8d63$export$7c6e2c02157bb7d2 = $34310caa050a8d63$export$bc4ae5855d3c4fc; +const $34310caa050a8d63$export$21b07c8f274aebd5 = $34310caa050a8d63$export$79d62cd4e10a3fd0; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-portal/dist/index.js": +/*!******************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-portal/dist/index.js ***! + \******************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $amzHf$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $amzHf$react = __webpack_require__(/*! react */ "react"); +var $amzHf$reactdom = __webpack_require__(/*! react-dom */ "react-dom"); +var $amzHf$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "Portal", () => $913a70b877676c16$export$602eac185826482c); +$parcel$export(module.exports, "Root", () => $913a70b877676c16$export$be92b6f5f03c0fe9); + +/* ------------------------------------------------------------------------------------------------- + * Portal + * -----------------------------------------------------------------------------------------------*/ +const $913a70b877676c16$var$PORTAL_NAME = 'Portal'; +const $913a70b877676c16$export$602eac185826482c = /*#__PURE__*/$amzHf$react.forwardRef((props, forwardedRef) => { + var _globalThis$document; + const { + container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body, + ...portalProps + } = props; + return container ? /*#__PURE__*/$parcel$interopDefault($amzHf$reactdom).createPortal( /*#__PURE__*/$amzHf$react.createElement($amzHf$radixuireactprimitive.Primitive.div, $parcel$interopDefault($amzHf$babelruntimehelpersextends)({}, portalProps, { + ref: forwardedRef + })), container) : null; +}); +/*#__PURE__*/ +Object.assign($913a70b877676c16$export$602eac185826482c, { + displayName: $913a70b877676c16$var$PORTAL_NAME +}); +/* -----------------------------------------------------------------------------------------------*/ +const $913a70b877676c16$export$be92b6f5f03c0fe9 = $913a70b877676c16$export$602eac185826482c; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-presence/dist/index.js": +/*!********************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-presence/dist/index.js ***! + \********************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $fnLeV$react = __webpack_require__(/*! react */ "react"); +var $fnLeV$reactdom = __webpack_require__(/*! react-dom */ "react-dom"); +var $fnLeV$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); +var $fnLeV$radixuireactuselayouteffect = __webpack_require__(/*! @radix-ui/react-use-layout-effect */ "../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +$parcel$export(module.exports, "Presence", () => $a2fa0214bb2735a1$export$99c2b779aa4e8b8b); +function $8f63844556d0d3cd$export$3e6543de14f8614f(initialState, machine) { + return $fnLeV$react.useReducer((state, event) => { + const nextState = machine[state][event]; + return nextState !== null && nextState !== void 0 ? nextState : state; + }, initialState); +} +const $a2fa0214bb2735a1$export$99c2b779aa4e8b8b = props => { + const { + present: present, + children: children + } = props; + const presence = $a2fa0214bb2735a1$var$usePresence(present); + const child = typeof children === 'function' ? children({ + present: presence.isPresent + }) : $fnLeV$react.Children.only(children); + const ref = $fnLeV$radixuireactcomposerefs.useComposedRefs(presence.ref, child.ref); + const forceMount = typeof children === 'function'; + return forceMount || presence.isPresent ? /*#__PURE__*/$fnLeV$react.cloneElement(child, { + ref: ref + }) : null; +}; +$a2fa0214bb2735a1$export$99c2b779aa4e8b8b.displayName = 'Presence'; +/* ------------------------------------------------------------------------------------------------- + * usePresence + * -----------------------------------------------------------------------------------------------*/ +function $a2fa0214bb2735a1$var$usePresence(present) { + const [node1, setNode] = $fnLeV$react.useState(); + const stylesRef = $fnLeV$react.useRef({}); + const prevPresentRef = $fnLeV$react.useRef(present); + const prevAnimationNameRef = $fnLeV$react.useRef('none'); + const initialState = present ? 'mounted' : 'unmounted'; + const [state, send] = $8f63844556d0d3cd$export$3e6543de14f8614f(initialState, { + mounted: { + UNMOUNT: 'unmounted', + ANIMATION_OUT: 'unmountSuspended' + }, + unmountSuspended: { + MOUNT: 'mounted', + ANIMATION_END: 'unmounted' + }, + unmounted: { + MOUNT: 'mounted' + } + }); + $fnLeV$react.useEffect(() => { + const currentAnimationName = $a2fa0214bb2735a1$var$getAnimationName(stylesRef.current); + prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none'; + }, [state]); + $fnLeV$radixuireactuselayouteffect.useLayoutEffect(() => { + const styles = stylesRef.current; + const wasPresent = prevPresentRef.current; + const hasPresentChanged = wasPresent !== present; + if (hasPresentChanged) { + const prevAnimationName = prevAnimationNameRef.current; + const currentAnimationName = $a2fa0214bb2735a1$var$getAnimationName(styles); + if (present) send('MOUNT');else if (currentAnimationName === 'none' || (styles === null || styles === void 0 ? void 0 : styles.display) === 'none') + // If there is no exit animation or the element is hidden, animations won't run + // so we unmount instantly + send('UNMOUNT');else { + /** + * When `present` changes to `false`, we check changes to animation-name to + * determine whether an animation has started. We chose this approach (reading + * computed styles) because there is no `animationrun` event and `animationstart` + * fires after `animation-delay` has expired which would be too late. + */ + const isAnimating = prevAnimationName !== currentAnimationName; + if (wasPresent && isAnimating) send('ANIMATION_OUT');else send('UNMOUNT'); + } + prevPresentRef.current = present; + } + }, [present, send]); + $fnLeV$radixuireactuselayouteffect.useLayoutEffect(() => { + if (node1) { + /** + * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel` + * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we + * make sure we only trigger ANIMATION_END for the currently active animation. + */ + const handleAnimationEnd = event => { + const currentAnimationName = $a2fa0214bb2735a1$var$getAnimationName(stylesRef.current); + const isCurrentAnimation = currentAnimationName.includes(event.animationName); + if (event.target === node1 && isCurrentAnimation) + // With React 18 concurrency this update is applied + // a frame after the animation ends, creating a flash of visible content. + // By manually flushing we ensure they sync within a frame, removing the flash. + $fnLeV$reactdom.flushSync(() => send('ANIMATION_END')); + }; + const handleAnimationStart = event => { + if (event.target === node1) + // if animation occurred, store its name as the previous animation. + prevAnimationNameRef.current = $a2fa0214bb2735a1$var$getAnimationName(stylesRef.current); + }; + node1.addEventListener('animationstart', handleAnimationStart); + node1.addEventListener('animationcancel', handleAnimationEnd); + node1.addEventListener('animationend', handleAnimationEnd); + return () => { + node1.removeEventListener('animationstart', handleAnimationStart); + node1.removeEventListener('animationcancel', handleAnimationEnd); + node1.removeEventListener('animationend', handleAnimationEnd); + }; + } else + // Transition to the unmounted state if the node is removed prematurely. + // We avoid doing so during cleanup as the node may change but still exist. + send('ANIMATION_END'); + }, [node1, send]); + return { + isPresent: ['mounted', 'unmountSuspended'].includes(state), + ref: $fnLeV$react.useCallback(node => { + if (node) stylesRef.current = getComputedStyle(node); + setNode(node); + }, []) + }; +} +/* -----------------------------------------------------------------------------------------------*/ +function $a2fa0214bb2735a1$var$getAnimationName(styles) { + return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none'; +} + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-primitive/dist/index.js": +/*!*********************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-primitive/dist/index.js ***! + \*********************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $iMixA$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $iMixA$react = __webpack_require__(/*! react */ "react"); +var $iMixA$reactdom = __webpack_require__(/*! react-dom */ "react-dom"); +var $iMixA$radixuireactslot = __webpack_require__(/*! @radix-ui/react-slot */ "../../../node_modules/@radix-ui/react-slot/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "Primitive", () => $c3def6332c2749a6$export$250ffa63cdc0d034); +$parcel$export(module.exports, "Root", () => $c3def6332c2749a6$export$be92b6f5f03c0fe9); +$parcel$export(module.exports, "dispatchDiscreteCustomEvent", () => $c3def6332c2749a6$export$6d1a0317bde7de7f); +const $c3def6332c2749a6$var$NODES = ['a', 'button', 'div', 'form', 'h2', 'h3', 'img', 'input', 'label', 'li', 'nav', 'ol', 'p', 'span', 'svg', 'ul']; // Temporary while we await merge of this fix: +// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396 +// prettier-ignore +/* ------------------------------------------------------------------------------------------------- + * Primitive + * -----------------------------------------------------------------------------------------------*/ +const $c3def6332c2749a6$export$250ffa63cdc0d034 = $c3def6332c2749a6$var$NODES.reduce((primitive, node) => { + const Node = /*#__PURE__*/$iMixA$react.forwardRef((props, forwardedRef) => { + const { + asChild: asChild, + ...primitiveProps + } = props; + const Comp = asChild ? $iMixA$radixuireactslot.Slot : node; + $iMixA$react.useEffect(() => { + window[Symbol.for('radix-ui')] = true; + }, []); + return /*#__PURE__*/$iMixA$react.createElement(Comp, $parcel$interopDefault($iMixA$babelruntimehelpersextends)({}, primitiveProps, { + ref: forwardedRef + })); + }); + Node.displayName = `Primitive.${node}`; + return { + ...primitive, + [node]: Node + }; +}, {}); +/* ------------------------------------------------------------------------------------------------- + * Utils + * -----------------------------------------------------------------------------------------------*/ /** + * Flush custom event dispatch + * https://github.com/radix-ui/primitives/pull/1378 + * + * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types. + * + * Internally, React prioritises events in the following order: + * - discrete + * - continuous + * - default + * + * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350 + * + * `discrete` is an important distinction as updates within these events are applied immediately. + * React however, is not able to infer the priority of custom event types due to how they are detected internally. + * Because of this, it's possible for updates from custom events to be unexpectedly batched when + * dispatched by another `discrete` event. + * + * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch. + * This utility should be used when dispatching a custom event from within another `discrete` event, this utility + * is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event. + * For example: + * + * dispatching a known click 👎 + * target.dispatchEvent(new Event(‘click’)) + * + * dispatching a custom type within a non-discrete event 👎 + * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))} + * + * dispatching a custom type within a `discrete` event 👍 + * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))} + * + * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use + * this utility with them. This is because it's possible for those handlers to be called implicitly during render + * e.g. when focus is within a component as it is unmounted, or when managing focus on mount. + */ +function $c3def6332c2749a6$export$6d1a0317bde7de7f(target, event) { + if (target) $iMixA$reactdom.flushSync(() => target.dispatchEvent(event)); +} +/* -----------------------------------------------------------------------------------------------*/ +const $c3def6332c2749a6$export$be92b6f5f03c0fe9 = $c3def6332c2749a6$export$250ffa63cdc0d034; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-roving-focus/dist/index.js": +/*!************************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-roving-focus/dist/index.js ***! + \************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $9QJ9Y$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $9QJ9Y$react = __webpack_require__(/*! react */ "react"); +var $9QJ9Y$radixuiprimitive = __webpack_require__(/*! @radix-ui/primitive */ "../../../node_modules/@radix-ui/primitive/dist/index.js"); +var $9QJ9Y$radixuireactcollection = __webpack_require__(/*! @radix-ui/react-collection */ "../../../node_modules/@radix-ui/react-collection/dist/index.js"); +var $9QJ9Y$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); +var $9QJ9Y$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); +var $9QJ9Y$radixuireactid = __webpack_require__(/*! @radix-ui/react-id */ "../../../node_modules/@radix-ui/react-id/dist/index.js"); +var $9QJ9Y$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); +var $9QJ9Y$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); +var $9QJ9Y$radixuireactusecontrollablestate = __webpack_require__(/*! @radix-ui/react-use-controllable-state */ "../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js"); +var $9QJ9Y$radixuireactdirection = __webpack_require__(/*! @radix-ui/react-direction */ "../../../node_modules/@radix-ui/react-direction/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "createRovingFocusGroupScope", () => $0063afae63b3fa70$export$c7109489551a4f4); +$parcel$export(module.exports, "RovingFocusGroup", () => $0063afae63b3fa70$export$8699f7c8af148338); +$parcel$export(module.exports, "RovingFocusGroupItem", () => $0063afae63b3fa70$export$ab9df7c53fe8454); +$parcel$export(module.exports, "Root", () => $0063afae63b3fa70$export$be92b6f5f03c0fe9); +$parcel$export(module.exports, "Item", () => $0063afae63b3fa70$export$6d08773d2e66f8f2); +const $0063afae63b3fa70$var$ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus'; +const $0063afae63b3fa70$var$EVENT_OPTIONS = { + bubbles: false, + cancelable: true +}; +/* ------------------------------------------------------------------------------------------------- + * RovingFocusGroup + * -----------------------------------------------------------------------------------------------*/ +const $0063afae63b3fa70$var$GROUP_NAME = 'RovingFocusGroup'; +const [$0063afae63b3fa70$var$Collection, $0063afae63b3fa70$var$useCollection, $0063afae63b3fa70$var$createCollectionScope] = $9QJ9Y$radixuireactcollection.createCollection($0063afae63b3fa70$var$GROUP_NAME); +const [$0063afae63b3fa70$var$createRovingFocusGroupContext, $0063afae63b3fa70$export$c7109489551a4f4] = $9QJ9Y$radixuireactcontext.createContextScope($0063afae63b3fa70$var$GROUP_NAME, [$0063afae63b3fa70$var$createCollectionScope]); +const [$0063afae63b3fa70$var$RovingFocusProvider, $0063afae63b3fa70$var$useRovingFocusContext] = $0063afae63b3fa70$var$createRovingFocusGroupContext($0063afae63b3fa70$var$GROUP_NAME); +const $0063afae63b3fa70$export$8699f7c8af148338 = /*#__PURE__*/$9QJ9Y$react.forwardRef((props, forwardedRef) => { + return /*#__PURE__*/$9QJ9Y$react.createElement($0063afae63b3fa70$var$Collection.Provider, { + scope: props.__scopeRovingFocusGroup + }, /*#__PURE__*/$9QJ9Y$react.createElement($0063afae63b3fa70$var$Collection.Slot, { + scope: props.__scopeRovingFocusGroup + }, /*#__PURE__*/$9QJ9Y$react.createElement($0063afae63b3fa70$var$RovingFocusGroupImpl, $parcel$interopDefault($9QJ9Y$babelruntimehelpersextends)({}, props, { + ref: forwardedRef + })))); +}); +/*#__PURE__*/ +Object.assign($0063afae63b3fa70$export$8699f7c8af148338, { + displayName: $0063afae63b3fa70$var$GROUP_NAME +}); +/* -----------------------------------------------------------------------------------------------*/ +const $0063afae63b3fa70$var$RovingFocusGroupImpl = /*#__PURE__*/$9QJ9Y$react.forwardRef((props, forwardedRef) => { + const { + __scopeRovingFocusGroup: __scopeRovingFocusGroup, + orientation: orientation, + loop = false, + dir: dir, + currentTabStopId: currentTabStopIdProp, + defaultCurrentTabStopId: defaultCurrentTabStopId, + onCurrentTabStopIdChange: onCurrentTabStopIdChange, + onEntryFocus: onEntryFocus, + ...groupProps + } = props; + const ref = $9QJ9Y$react.useRef(null); + const composedRefs = $9QJ9Y$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); + const direction = $9QJ9Y$radixuireactdirection.useDirection(dir); + const [currentTabStopId = null, setCurrentTabStopId] = $9QJ9Y$radixuireactusecontrollablestate.useControllableState({ + prop: currentTabStopIdProp, + defaultProp: defaultCurrentTabStopId, + onChange: onCurrentTabStopIdChange + }); + const [isTabbingBackOut, setIsTabbingBackOut] = $9QJ9Y$react.useState(false); + const handleEntryFocus = $9QJ9Y$radixuireactusecallbackref.useCallbackRef(onEntryFocus); + const getItems = $0063afae63b3fa70$var$useCollection(__scopeRovingFocusGroup); + const isClickFocusRef = $9QJ9Y$react.useRef(false); + const [focusableItemsCount, setFocusableItemsCount] = $9QJ9Y$react.useState(0); + $9QJ9Y$react.useEffect(() => { + const node = ref.current; + if (node) { + node.addEventListener($0063afae63b3fa70$var$ENTRY_FOCUS, handleEntryFocus); + return () => node.removeEventListener($0063afae63b3fa70$var$ENTRY_FOCUS, handleEntryFocus); + } + }, [handleEntryFocus]); + return /*#__PURE__*/$9QJ9Y$react.createElement($0063afae63b3fa70$var$RovingFocusProvider, { + scope: __scopeRovingFocusGroup, + orientation: orientation, + dir: direction, + loop: loop, + currentTabStopId: currentTabStopId, + onItemFocus: $9QJ9Y$react.useCallback(tabStopId => setCurrentTabStopId(tabStopId), [setCurrentTabStopId]), + onItemShiftTab: $9QJ9Y$react.useCallback(() => setIsTabbingBackOut(true), []), + onFocusableItemAdd: $9QJ9Y$react.useCallback(() => setFocusableItemsCount(prevCount => prevCount + 1), []), + onFocusableItemRemove: $9QJ9Y$react.useCallback(() => setFocusableItemsCount(prevCount => prevCount - 1), []) + }, /*#__PURE__*/$9QJ9Y$react.createElement($9QJ9Y$radixuireactprimitive.Primitive.div, $parcel$interopDefault($9QJ9Y$babelruntimehelpersextends)({ + tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0, + "data-orientation": orientation + }, groupProps, { + ref: composedRefs, + style: { + outline: 'none', + ...props.style + }, + onMouseDown: $9QJ9Y$radixuiprimitive.composeEventHandlers(props.onMouseDown, () => { + isClickFocusRef.current = true; + }), + onFocus: $9QJ9Y$radixuiprimitive.composeEventHandlers(props.onFocus, event => { + // We normally wouldn't need this check, because we already check + // that the focus is on the current target and not bubbling to it. + // We do this because Safari doesn't focus buttons when clicked, and + // instead, the wrapper will get focused and not through a bubbling event. + const isKeyboardFocus = !isClickFocusRef.current; + if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) { + const entryFocusEvent = new CustomEvent($0063afae63b3fa70$var$ENTRY_FOCUS, $0063afae63b3fa70$var$EVENT_OPTIONS); + event.currentTarget.dispatchEvent(entryFocusEvent); + if (!entryFocusEvent.defaultPrevented) { + const items = getItems().filter(item => item.focusable); + const activeItem = items.find(item => item.active); + const currentItem = items.find(item => item.id === currentTabStopId); + const candidateItems = [activeItem, currentItem, ...items].filter(Boolean); + const candidateNodes = candidateItems.map(item => item.ref.current); + $0063afae63b3fa70$var$focusFirst(candidateNodes); + } + } + isClickFocusRef.current = false; + }), + onBlur: $9QJ9Y$radixuiprimitive.composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false)) + }))); +}); +/* ------------------------------------------------------------------------------------------------- + * RovingFocusGroupItem + * -----------------------------------------------------------------------------------------------*/ +const $0063afae63b3fa70$var$ITEM_NAME = 'RovingFocusGroupItem'; +const $0063afae63b3fa70$export$ab9df7c53fe8454 = /*#__PURE__*/$9QJ9Y$react.forwardRef((props, forwardedRef) => { + const { + __scopeRovingFocusGroup: __scopeRovingFocusGroup, + focusable = true, + active = false, + tabStopId: tabStopId, + ...itemProps + } = props; + const autoId = $9QJ9Y$radixuireactid.useId(); + const id = tabStopId || autoId; + const context = $0063afae63b3fa70$var$useRovingFocusContext($0063afae63b3fa70$var$ITEM_NAME, __scopeRovingFocusGroup); + const isCurrentTabStop = context.currentTabStopId === id; + const getItems = $0063afae63b3fa70$var$useCollection(__scopeRovingFocusGroup); + const { + onFocusableItemAdd: onFocusableItemAdd, + onFocusableItemRemove: onFocusableItemRemove + } = context; + $9QJ9Y$react.useEffect(() => { + if (focusable) { + onFocusableItemAdd(); + return () => onFocusableItemRemove(); + } + }, [focusable, onFocusableItemAdd, onFocusableItemRemove]); + return /*#__PURE__*/$9QJ9Y$react.createElement($0063afae63b3fa70$var$Collection.ItemSlot, { + scope: __scopeRovingFocusGroup, + id: id, + focusable: focusable, + active: active + }, /*#__PURE__*/$9QJ9Y$react.createElement($9QJ9Y$radixuireactprimitive.Primitive.span, $parcel$interopDefault($9QJ9Y$babelruntimehelpersextends)({ + tabIndex: isCurrentTabStop ? 0 : -1, + "data-orientation": context.orientation + }, itemProps, { + ref: forwardedRef, + onMouseDown: $9QJ9Y$radixuiprimitive.composeEventHandlers(props.onMouseDown, event => { + // We prevent focusing non-focusable items on `mousedown`. + // Even though the item has tabIndex={-1}, that only means take it out of the tab order. + if (!focusable) event.preventDefault(); // Safari doesn't focus a button when clicked so we run our logic on mousedown also + else context.onItemFocus(id); + }), + onFocus: $9QJ9Y$radixuiprimitive.composeEventHandlers(props.onFocus, () => context.onItemFocus(id)), + onKeyDown: $9QJ9Y$radixuiprimitive.composeEventHandlers(props.onKeyDown, event => { + if (event.key === 'Tab' && event.shiftKey) { + context.onItemShiftTab(); + return; + } + if (event.target !== event.currentTarget) return; + const focusIntent = $0063afae63b3fa70$var$getFocusIntent(event, context.orientation, context.dir); + if (focusIntent !== undefined) { + event.preventDefault(); + const items = getItems().filter(item => item.focusable); + let candidateNodes = items.map(item => item.ref.current); + if (focusIntent === 'last') candidateNodes.reverse();else if (focusIntent === 'prev' || focusIntent === 'next') { + if (focusIntent === 'prev') candidateNodes.reverse(); + const currentIndex = candidateNodes.indexOf(event.currentTarget); + candidateNodes = context.loop ? $0063afae63b3fa70$var$wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1); + } + /** + * Imperative focus during keydown is risky so we prevent React's batching updates + * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332 + */ + setTimeout(() => $0063afae63b3fa70$var$focusFirst(candidateNodes)); + } + }) + }))); +}); +/*#__PURE__*/ +Object.assign($0063afae63b3fa70$export$ab9df7c53fe8454, { + displayName: $0063afae63b3fa70$var$ITEM_NAME +}); +/* -----------------------------------------------------------------------------------------------*/ // prettier-ignore +const $0063afae63b3fa70$var$MAP_KEY_TO_FOCUS_INTENT = { + ArrowLeft: 'prev', + ArrowUp: 'prev', + ArrowRight: 'next', + ArrowDown: 'next', + PageUp: 'first', + Home: 'first', + PageDown: 'last', + End: 'last' +}; +function $0063afae63b3fa70$var$getDirectionAwareKey(key, dir) { + if (dir !== 'rtl') return key; + return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key; +} +function $0063afae63b3fa70$var$getFocusIntent(event, orientation, dir) { + const key = $0063afae63b3fa70$var$getDirectionAwareKey(event.key, dir); + if (orientation === 'vertical' && ['ArrowLeft', 'ArrowRight'].includes(key)) return undefined; + if (orientation === 'horizontal' && ['ArrowUp', 'ArrowDown'].includes(key)) return undefined; + return $0063afae63b3fa70$var$MAP_KEY_TO_FOCUS_INTENT[key]; +} +function $0063afae63b3fa70$var$focusFirst(candidates) { + const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; + for (const candidate of candidates) { + // if focus is already where we want to go, we don't want to keep going through the candidates + if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; + candidate.focus(); + if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; + } +} +/** + * Wraps an array around itself at a given start index + * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']` + */ +function $0063afae63b3fa70$var$wrapArray(array, startIndex) { + return array.map((_, index) => array[(startIndex + index) % array.length]); +} +const $0063afae63b3fa70$export$be92b6f5f03c0fe9 = $0063afae63b3fa70$export$8699f7c8af148338; +const $0063afae63b3fa70$export$6d08773d2e66f8f2 = $0063afae63b3fa70$export$ab9df7c53fe8454; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-slot/dist/index.js": +/*!****************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-slot/dist/index.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $dAvBt$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $dAvBt$react = __webpack_require__(/*! react */ "react"); +var $dAvBt$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "Slot", () => $82dc8d030dec7549$export$8c6ed5c666ac1360); +$parcel$export(module.exports, "Slottable", () => $82dc8d030dec7549$export$d9f1ccf0bdb05d45); +$parcel$export(module.exports, "Root", () => $82dc8d030dec7549$export$be92b6f5f03c0fe9); + +/* ------------------------------------------------------------------------------------------------- + * Slot + * -----------------------------------------------------------------------------------------------*/ +const $82dc8d030dec7549$export$8c6ed5c666ac1360 = /*#__PURE__*/$dAvBt$react.forwardRef((props, forwardedRef) => { + const { + children: children, + ...slotProps + } = props; + const childrenArray = $dAvBt$react.Children.toArray(children); + const slottable = childrenArray.find($82dc8d030dec7549$var$isSlottable); + if (slottable) { + // the new element to render is the one passed as a child of `Slottable` + const newElement = slottable.props.children; + const newChildren = childrenArray.map(child => { + if (child === slottable) { + // because the new element will be the one rendered, we are only interested + // in grabbing its children (`newElement.props.children`) + if ($dAvBt$react.Children.count(newElement) > 1) return $dAvBt$react.Children.only(null); + return /*#__PURE__*/$dAvBt$react.isValidElement(newElement) ? newElement.props.children : null; + } else return child; + }); + return /*#__PURE__*/$dAvBt$react.createElement($82dc8d030dec7549$var$SlotClone, $parcel$interopDefault($dAvBt$babelruntimehelpersextends)({}, slotProps, { + ref: forwardedRef + }), /*#__PURE__*/$dAvBt$react.isValidElement(newElement) ? /*#__PURE__*/$dAvBt$react.cloneElement(newElement, undefined, newChildren) : null); + } + return /*#__PURE__*/$dAvBt$react.createElement($82dc8d030dec7549$var$SlotClone, $parcel$interopDefault($dAvBt$babelruntimehelpersextends)({}, slotProps, { + ref: forwardedRef + }), children); +}); +$82dc8d030dec7549$export$8c6ed5c666ac1360.displayName = 'Slot'; +/* ------------------------------------------------------------------------------------------------- + * SlotClone + * -----------------------------------------------------------------------------------------------*/ +const $82dc8d030dec7549$var$SlotClone = /*#__PURE__*/$dAvBt$react.forwardRef((props, forwardedRef) => { + const { + children: children, + ...slotProps + } = props; + if ( /*#__PURE__*/$dAvBt$react.isValidElement(children)) return /*#__PURE__*/$dAvBt$react.cloneElement(children, { + ...$82dc8d030dec7549$var$mergeProps(slotProps, children.props), + ref: forwardedRef ? $dAvBt$radixuireactcomposerefs.composeRefs(forwardedRef, children.ref) : children.ref + }); + return $dAvBt$react.Children.count(children) > 1 ? $dAvBt$react.Children.only(null) : null; +}); +$82dc8d030dec7549$var$SlotClone.displayName = 'SlotClone'; +/* ------------------------------------------------------------------------------------------------- + * Slottable + * -----------------------------------------------------------------------------------------------*/ +const $82dc8d030dec7549$export$d9f1ccf0bdb05d45 = _ref => { + let { + children: children + } = _ref; + return /*#__PURE__*/$dAvBt$react.createElement($dAvBt$react.Fragment, null, children); +}; +/* ---------------------------------------------------------------------------------------------- */ +function $82dc8d030dec7549$var$isSlottable(child) { + return /*#__PURE__*/$dAvBt$react.isValidElement(child) && child.type === $82dc8d030dec7549$export$d9f1ccf0bdb05d45; +} +function $82dc8d030dec7549$var$mergeProps(slotProps, childProps) { + // all child props should override + const overrideProps = { + ...childProps + }; + for (const propName in childProps) { + const slotPropValue = slotProps[propName]; + const childPropValue = childProps[propName]; + const isHandler = /^on[A-Z]/.test(propName); + if (isHandler) { + // if the handler exists on both, we compose them + if (slotPropValue && childPropValue) overrideProps[propName] = function () { + childPropValue(...arguments); + slotPropValue(...arguments); + };else if (slotPropValue) overrideProps[propName] = slotPropValue; + } else if (propName === 'style') overrideProps[propName] = { + ...slotPropValue, + ...childPropValue + };else if (propName === 'className') overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' '); + } + return { + ...slotProps, + ...overrideProps + }; +} +const $82dc8d030dec7549$export$be92b6f5f03c0fe9 = $82dc8d030dec7549$export$8c6ed5c666ac1360; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-tooltip/dist/index.js": +/*!*******************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-tooltip/dist/index.js ***! + \*******************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $iVrL9$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $iVrL9$react = __webpack_require__(/*! react */ "react"); +var $iVrL9$radixuiprimitive = __webpack_require__(/*! @radix-ui/primitive */ "../../../node_modules/@radix-ui/primitive/dist/index.js"); +var $iVrL9$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); +var $iVrL9$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); +var $iVrL9$radixuireactdismissablelayer = __webpack_require__(/*! @radix-ui/react-dismissable-layer */ "../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.js"); +var $iVrL9$radixuireactid = __webpack_require__(/*! @radix-ui/react-id */ "../../../node_modules/@radix-ui/react-id/dist/index.js"); +var $iVrL9$radixuireactpopper = __webpack_require__(/*! @radix-ui/react-popper */ "../../../node_modules/@radix-ui/react-popper/dist/index.js"); +var $iVrL9$radixuireactportal = __webpack_require__(/*! @radix-ui/react-portal */ "../../../node_modules/@radix-ui/react-portal/dist/index.js"); +var $iVrL9$radixuireactpresence = __webpack_require__(/*! @radix-ui/react-presence */ "../../../node_modules/@radix-ui/react-presence/dist/index.js"); +var $iVrL9$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); +var $iVrL9$radixuireactslot = __webpack_require__(/*! @radix-ui/react-slot */ "../../../node_modules/@radix-ui/react-slot/dist/index.js"); +var $iVrL9$radixuireactusecontrollablestate = __webpack_require__(/*! @radix-ui/react-use-controllable-state */ "../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js"); +var $iVrL9$radixuireactvisuallyhidden = __webpack_require__(/*! @radix-ui/react-visually-hidden */ "../../../node_modules/@radix-ui/react-visually-hidden/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "createTooltipScope", () => $c34afbc43c90cc6f$export$1c540a2224f0d865); +$parcel$export(module.exports, "TooltipProvider", () => $c34afbc43c90cc6f$export$f78649fb9ca566b8); +$parcel$export(module.exports, "Tooltip", () => $c34afbc43c90cc6f$export$28c660c63b792dea); +$parcel$export(module.exports, "TooltipTrigger", () => $c34afbc43c90cc6f$export$8c610744efcf8a1d); +$parcel$export(module.exports, "TooltipPortal", () => $c34afbc43c90cc6f$export$7b36b8f925ab7497); +$parcel$export(module.exports, "TooltipContent", () => $c34afbc43c90cc6f$export$e9003e2be37ec060); +$parcel$export(module.exports, "TooltipArrow", () => $c34afbc43c90cc6f$export$c27ee0ad710f7559); +$parcel$export(module.exports, "Provider", () => $c34afbc43c90cc6f$export$2881499e37b75b9a); +$parcel$export(module.exports, "Root", () => $c34afbc43c90cc6f$export$be92b6f5f03c0fe9); +$parcel$export(module.exports, "Trigger", () => $c34afbc43c90cc6f$export$41fb9f06171c75f4); +$parcel$export(module.exports, "Portal", () => $c34afbc43c90cc6f$export$602eac185826482c); +$parcel$export(module.exports, "Content", () => $c34afbc43c90cc6f$export$7c6e2c02157bb7d2); +$parcel$export(module.exports, "Arrow", () => $c34afbc43c90cc6f$export$21b07c8f274aebd5); +const [$c34afbc43c90cc6f$var$createTooltipContext, $c34afbc43c90cc6f$export$1c540a2224f0d865] = $iVrL9$radixuireactcontext.createContextScope('Tooltip', [$iVrL9$radixuireactpopper.createPopperScope]); +const $c34afbc43c90cc6f$var$usePopperScope = $iVrL9$radixuireactpopper.createPopperScope(); +/* ------------------------------------------------------------------------------------------------- + * TooltipProvider + * -----------------------------------------------------------------------------------------------*/ +const $c34afbc43c90cc6f$var$PROVIDER_NAME = 'TooltipProvider'; +const $c34afbc43c90cc6f$var$DEFAULT_DELAY_DURATION = 700; +const $c34afbc43c90cc6f$var$TOOLTIP_OPEN = 'tooltip.open'; +const [$c34afbc43c90cc6f$var$TooltipProviderContextProvider, $c34afbc43c90cc6f$var$useTooltipProviderContext] = $c34afbc43c90cc6f$var$createTooltipContext($c34afbc43c90cc6f$var$PROVIDER_NAME); +const $c34afbc43c90cc6f$export$f78649fb9ca566b8 = props => { + const { + __scopeTooltip: __scopeTooltip, + delayDuration = $c34afbc43c90cc6f$var$DEFAULT_DELAY_DURATION, + skipDelayDuration = 300, + disableHoverableContent = false, + children: children + } = props; + const [isOpenDelayed, setIsOpenDelayed] = $iVrL9$react.useState(true); + const isPointerInTransitRef = $iVrL9$react.useRef(false); + const skipDelayTimerRef = $iVrL9$react.useRef(0); + $iVrL9$react.useEffect(() => { + const skipDelayTimer = skipDelayTimerRef.current; + return () => window.clearTimeout(skipDelayTimer); + }, []); + return /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$TooltipProviderContextProvider, { + scope: __scopeTooltip, + isOpenDelayed: isOpenDelayed, + delayDuration: delayDuration, + onOpen: $iVrL9$react.useCallback(() => { + window.clearTimeout(skipDelayTimerRef.current); + setIsOpenDelayed(false); + }, []), + onClose: $iVrL9$react.useCallback(() => { + window.clearTimeout(skipDelayTimerRef.current); + skipDelayTimerRef.current = window.setTimeout(() => setIsOpenDelayed(true), skipDelayDuration); + }, [skipDelayDuration]), + isPointerInTransitRef: isPointerInTransitRef, + onPointerInTransitChange: $iVrL9$react.useCallback(inTransit => { + isPointerInTransitRef.current = inTransit; + }, []), + disableHoverableContent: disableHoverableContent + }, children); +}; +/*#__PURE__*/ +Object.assign($c34afbc43c90cc6f$export$f78649fb9ca566b8, { + displayName: $c34afbc43c90cc6f$var$PROVIDER_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * Tooltip + * -----------------------------------------------------------------------------------------------*/ +const $c34afbc43c90cc6f$var$TOOLTIP_NAME = 'Tooltip'; +const [$c34afbc43c90cc6f$var$TooltipContextProvider, $c34afbc43c90cc6f$var$useTooltipContext] = $c34afbc43c90cc6f$var$createTooltipContext($c34afbc43c90cc6f$var$TOOLTIP_NAME); +const $c34afbc43c90cc6f$export$28c660c63b792dea = props => { + const { + __scopeTooltip: __scopeTooltip, + children: children, + open: openProp, + defaultOpen = false, + onOpenChange: onOpenChange, + disableHoverableContent: disableHoverableContentProp, + delayDuration: delayDurationProp + } = props; + const providerContext = $c34afbc43c90cc6f$var$useTooltipProviderContext($c34afbc43c90cc6f$var$TOOLTIP_NAME, props.__scopeTooltip); + const popperScope = $c34afbc43c90cc6f$var$usePopperScope(__scopeTooltip); + const [trigger, setTrigger] = $iVrL9$react.useState(null); + const contentId = $iVrL9$radixuireactid.useId(); + const openTimerRef = $iVrL9$react.useRef(0); + const disableHoverableContent = disableHoverableContentProp !== null && disableHoverableContentProp !== void 0 ? disableHoverableContentProp : providerContext.disableHoverableContent; + const delayDuration = delayDurationProp !== null && delayDurationProp !== void 0 ? delayDurationProp : providerContext.delayDuration; + const wasOpenDelayedRef = $iVrL9$react.useRef(false); + const [open1 = false, setOpen] = $iVrL9$radixuireactusecontrollablestate.useControllableState({ + prop: openProp, + defaultProp: defaultOpen, + onChange: open => { + if (open) { + providerContext.onOpen(); // as `onChange` is called within a lifecycle method we + // avoid dispatching via `dispatchDiscreteCustomEvent`. + document.dispatchEvent(new CustomEvent($c34afbc43c90cc6f$var$TOOLTIP_OPEN)); + } else providerContext.onClose(); + onOpenChange === null || onOpenChange === void 0 || onOpenChange(open); + } + }); + const stateAttribute = $iVrL9$react.useMemo(() => { + return open1 ? wasOpenDelayedRef.current ? 'delayed-open' : 'instant-open' : 'closed'; + }, [open1]); + const handleOpen = $iVrL9$react.useCallback(() => { + window.clearTimeout(openTimerRef.current); + wasOpenDelayedRef.current = false; + setOpen(true); + }, [setOpen]); + const handleClose = $iVrL9$react.useCallback(() => { + window.clearTimeout(openTimerRef.current); + setOpen(false); + }, [setOpen]); + const handleDelayedOpen = $iVrL9$react.useCallback(() => { + window.clearTimeout(openTimerRef.current); + openTimerRef.current = window.setTimeout(() => { + wasOpenDelayedRef.current = true; + setOpen(true); + }, delayDuration); + }, [delayDuration, setOpen]); + $iVrL9$react.useEffect(() => { + return () => window.clearTimeout(openTimerRef.current); + }, []); + return /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactpopper.Root, popperScope, /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$TooltipContextProvider, { + scope: __scopeTooltip, + contentId: contentId, + open: open1, + stateAttribute: stateAttribute, + trigger: trigger, + onTriggerChange: setTrigger, + onTriggerEnter: $iVrL9$react.useCallback(() => { + if (providerContext.isOpenDelayed) handleDelayedOpen();else handleOpen(); + }, [providerContext.isOpenDelayed, handleDelayedOpen, handleOpen]), + onTriggerLeave: $iVrL9$react.useCallback(() => { + if (disableHoverableContent) handleClose();else + // Clear the timer in case the pointer leaves the trigger before the tooltip is opened. + window.clearTimeout(openTimerRef.current); + }, [handleClose, disableHoverableContent]), + onOpen: handleOpen, + onClose: handleClose, + disableHoverableContent: disableHoverableContent + }, children)); +}; +/*#__PURE__*/ +Object.assign($c34afbc43c90cc6f$export$28c660c63b792dea, { + displayName: $c34afbc43c90cc6f$var$TOOLTIP_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * TooltipTrigger + * -----------------------------------------------------------------------------------------------*/ +const $c34afbc43c90cc6f$var$TRIGGER_NAME = 'TooltipTrigger'; +const $c34afbc43c90cc6f$export$8c610744efcf8a1d = /*#__PURE__*/$iVrL9$react.forwardRef((props, forwardedRef) => { + const { + __scopeTooltip: __scopeTooltip, + ...triggerProps + } = props; + const context = $c34afbc43c90cc6f$var$useTooltipContext($c34afbc43c90cc6f$var$TRIGGER_NAME, __scopeTooltip); + const providerContext = $c34afbc43c90cc6f$var$useTooltipProviderContext($c34afbc43c90cc6f$var$TRIGGER_NAME, __scopeTooltip); + const popperScope = $c34afbc43c90cc6f$var$usePopperScope(__scopeTooltip); + const ref = $iVrL9$react.useRef(null); + const composedRefs = $iVrL9$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref, context.onTriggerChange); + const isPointerDownRef = $iVrL9$react.useRef(false); + const hasPointerMoveOpenedRef = $iVrL9$react.useRef(false); + const handlePointerUp = $iVrL9$react.useCallback(() => isPointerDownRef.current = false, []); + $iVrL9$react.useEffect(() => { + return () => document.removeEventListener('pointerup', handlePointerUp); + }, [handlePointerUp]); + return /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactpopper.Anchor, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({ + asChild: true + }, popperScope), /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactprimitive.Primitive.button, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({ + // We purposefully avoid adding `type=button` here because tooltip triggers are also + // commonly anchors and the anchor `type` attribute signifies MIME type. + "aria-describedby": context.open ? context.contentId : undefined, + "data-state": context.stateAttribute + }, triggerProps, { + ref: composedRefs, + onPointerMove: $iVrL9$radixuiprimitive.composeEventHandlers(props.onPointerMove, event => { + if (event.pointerType === 'touch') return; + if (!hasPointerMoveOpenedRef.current && !providerContext.isPointerInTransitRef.current) { + context.onTriggerEnter(); + hasPointerMoveOpenedRef.current = true; + } + }), + onPointerLeave: $iVrL9$radixuiprimitive.composeEventHandlers(props.onPointerLeave, () => { + context.onTriggerLeave(); + hasPointerMoveOpenedRef.current = false; + }), + onPointerDown: $iVrL9$radixuiprimitive.composeEventHandlers(props.onPointerDown, () => { + isPointerDownRef.current = true; + document.addEventListener('pointerup', handlePointerUp, { + once: true + }); + }), + onFocus: $iVrL9$radixuiprimitive.composeEventHandlers(props.onFocus, () => { + if (!isPointerDownRef.current) context.onOpen(); + }), + onBlur: $iVrL9$radixuiprimitive.composeEventHandlers(props.onBlur, context.onClose), + onClick: $iVrL9$radixuiprimitive.composeEventHandlers(props.onClick, context.onClose) + }))); +}); +/*#__PURE__*/ +Object.assign($c34afbc43c90cc6f$export$8c610744efcf8a1d, { + displayName: $c34afbc43c90cc6f$var$TRIGGER_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * TooltipPortal + * -----------------------------------------------------------------------------------------------*/ +const $c34afbc43c90cc6f$var$PORTAL_NAME = 'TooltipPortal'; +const [$c34afbc43c90cc6f$var$PortalProvider, $c34afbc43c90cc6f$var$usePortalContext] = $c34afbc43c90cc6f$var$createTooltipContext($c34afbc43c90cc6f$var$PORTAL_NAME, { + forceMount: undefined +}); +const $c34afbc43c90cc6f$export$7b36b8f925ab7497 = props => { + const { + __scopeTooltip: __scopeTooltip, + forceMount: forceMount, + children: children, + container: container + } = props; + const context = $c34afbc43c90cc6f$var$useTooltipContext($c34afbc43c90cc6f$var$PORTAL_NAME, __scopeTooltip); + return /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$PortalProvider, { + scope: __scopeTooltip, + forceMount: forceMount + }, /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactpresence.Presence, { + present: forceMount || context.open + }, /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactportal.Portal, { + asChild: true, + container: container + }, children))); +}; +/*#__PURE__*/ +Object.assign($c34afbc43c90cc6f$export$7b36b8f925ab7497, { + displayName: $c34afbc43c90cc6f$var$PORTAL_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * TooltipContent + * -----------------------------------------------------------------------------------------------*/ +const $c34afbc43c90cc6f$var$CONTENT_NAME = 'TooltipContent'; +const $c34afbc43c90cc6f$export$e9003e2be37ec060 = /*#__PURE__*/$iVrL9$react.forwardRef((props, forwardedRef) => { + const portalContext = $c34afbc43c90cc6f$var$usePortalContext($c34afbc43c90cc6f$var$CONTENT_NAME, props.__scopeTooltip); + const { + forceMount = portalContext.forceMount, + side = 'top', + ...contentProps + } = props; + const context = $c34afbc43c90cc6f$var$useTooltipContext($c34afbc43c90cc6f$var$CONTENT_NAME, props.__scopeTooltip); + return /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactpresence.Presence, { + present: forceMount || context.open + }, context.disableHoverableContent ? /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$TooltipContentImpl, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({ + side: side + }, contentProps, { + ref: forwardedRef + })) : /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$TooltipContentHoverable, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({ + side: side + }, contentProps, { + ref: forwardedRef + }))); +}); +const $c34afbc43c90cc6f$var$TooltipContentHoverable = /*#__PURE__*/$iVrL9$react.forwardRef((props, forwardedRef) => { + const context = $c34afbc43c90cc6f$var$useTooltipContext($c34afbc43c90cc6f$var$CONTENT_NAME, props.__scopeTooltip); + const providerContext = $c34afbc43c90cc6f$var$useTooltipProviderContext($c34afbc43c90cc6f$var$CONTENT_NAME, props.__scopeTooltip); + const ref = $iVrL9$react.useRef(null); + const composedRefs = $iVrL9$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); + const [pointerGraceArea, setPointerGraceArea] = $iVrL9$react.useState(null); + const { + trigger: trigger, + onClose: onClose + } = context; + const content = ref.current; + const { + onPointerInTransitChange: onPointerInTransitChange + } = providerContext; + const handleRemoveGraceArea = $iVrL9$react.useCallback(() => { + setPointerGraceArea(null); + onPointerInTransitChange(false); + }, [onPointerInTransitChange]); + const handleCreateGraceArea = $iVrL9$react.useCallback((event, hoverTarget) => { + const currentTarget = event.currentTarget; + const exitPoint = { + x: event.clientX, + y: event.clientY + }; + const exitSide = $c34afbc43c90cc6f$var$getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect()); + const paddedExitPoints = $c34afbc43c90cc6f$var$getPaddedExitPoints(exitPoint, exitSide); + const hoverTargetPoints = $c34afbc43c90cc6f$var$getPointsFromRect(hoverTarget.getBoundingClientRect()); + const graceArea = $c34afbc43c90cc6f$var$getHull([...paddedExitPoints, ...hoverTargetPoints]); + setPointerGraceArea(graceArea); + onPointerInTransitChange(true); + }, [onPointerInTransitChange]); + $iVrL9$react.useEffect(() => { + return () => handleRemoveGraceArea(); + }, [handleRemoveGraceArea]); + $iVrL9$react.useEffect(() => { + if (trigger && content) { + const handleTriggerLeave = event => handleCreateGraceArea(event, content); + const handleContentLeave = event => handleCreateGraceArea(event, trigger); + trigger.addEventListener('pointerleave', handleTriggerLeave); + content.addEventListener('pointerleave', handleContentLeave); + return () => { + trigger.removeEventListener('pointerleave', handleTriggerLeave); + content.removeEventListener('pointerleave', handleContentLeave); + }; + } + }, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]); + $iVrL9$react.useEffect(() => { + if (pointerGraceArea) { + const handleTrackPointerGrace = event => { + const target = event.target; + const pointerPosition = { + x: event.clientX, + y: event.clientY + }; + const hasEnteredTarget = (trigger === null || trigger === void 0 ? void 0 : trigger.contains(target)) || (content === null || content === void 0 ? void 0 : content.contains(target)); + const isPointerOutsideGraceArea = !$c34afbc43c90cc6f$var$isPointInPolygon(pointerPosition, pointerGraceArea); + if (hasEnteredTarget) handleRemoveGraceArea();else if (isPointerOutsideGraceArea) { + handleRemoveGraceArea(); + onClose(); + } + }; + document.addEventListener('pointermove', handleTrackPointerGrace); + return () => document.removeEventListener('pointermove', handleTrackPointerGrace); + } + }, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]); + return /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$TooltipContentImpl, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({}, props, { + ref: composedRefs + })); +}); +const [$c34afbc43c90cc6f$var$VisuallyHiddenContentContextProvider, $c34afbc43c90cc6f$var$useVisuallyHiddenContentContext] = $c34afbc43c90cc6f$var$createTooltipContext($c34afbc43c90cc6f$var$TOOLTIP_NAME, { + isInside: false +}); +const $c34afbc43c90cc6f$var$TooltipContentImpl = /*#__PURE__*/$iVrL9$react.forwardRef((props, forwardedRef) => { + const { + __scopeTooltip: __scopeTooltip, + children: children, + 'aria-label': ariaLabel, + onEscapeKeyDown: onEscapeKeyDown, + onPointerDownOutside: onPointerDownOutside, + ...contentProps + } = props; + const context = $c34afbc43c90cc6f$var$useTooltipContext($c34afbc43c90cc6f$var$CONTENT_NAME, __scopeTooltip); + const popperScope = $c34afbc43c90cc6f$var$usePopperScope(__scopeTooltip); + const { + onClose: onClose + } = context; // Close this tooltip if another one opens + $iVrL9$react.useEffect(() => { + document.addEventListener($c34afbc43c90cc6f$var$TOOLTIP_OPEN, onClose); + return () => document.removeEventListener($c34afbc43c90cc6f$var$TOOLTIP_OPEN, onClose); + }, [onClose]); // Close the tooltip if the trigger is scrolled + $iVrL9$react.useEffect(() => { + if (context.trigger) { + const handleScroll = event => { + const target = event.target; + if (target !== null && target !== void 0 && target.contains(context.trigger)) onClose(); + }; + window.addEventListener('scroll', handleScroll, { + capture: true + }); + return () => window.removeEventListener('scroll', handleScroll, { + capture: true + }); + } + }, [context.trigger, onClose]); + return /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactdismissablelayer.DismissableLayer, { + asChild: true, + disableOutsidePointerEvents: false, + onEscapeKeyDown: onEscapeKeyDown, + onPointerDownOutside: onPointerDownOutside, + onFocusOutside: event => event.preventDefault(), + onDismiss: onClose + }, /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactpopper.Content, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({ + "data-state": context.stateAttribute + }, popperScope, contentProps, { + ref: forwardedRef, + style: { + ...contentProps.style, + '--radix-tooltip-content-transform-origin': 'var(--radix-popper-transform-origin)', + '--radix-tooltip-content-available-width': 'var(--radix-popper-available-width)', + '--radix-tooltip-content-available-height': 'var(--radix-popper-available-height)', + '--radix-tooltip-trigger-width': 'var(--radix-popper-anchor-width)', + '--radix-tooltip-trigger-height': 'var(--radix-popper-anchor-height)' + } + }), /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactslot.Slottable, null, children), /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$VisuallyHiddenContentContextProvider, { + scope: __scopeTooltip, + isInside: true + }, /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactvisuallyhidden.Root, { + id: context.contentId, + role: "tooltip" + }, ariaLabel || children)))); +}); +/*#__PURE__*/ +Object.assign($c34afbc43c90cc6f$export$e9003e2be37ec060, { + displayName: $c34afbc43c90cc6f$var$CONTENT_NAME +}); +/* ------------------------------------------------------------------------------------------------- + * TooltipArrow + * -----------------------------------------------------------------------------------------------*/ +const $c34afbc43c90cc6f$var$ARROW_NAME = 'TooltipArrow'; +const $c34afbc43c90cc6f$export$c27ee0ad710f7559 = /*#__PURE__*/$iVrL9$react.forwardRef((props, forwardedRef) => { + const { + __scopeTooltip: __scopeTooltip, + ...arrowProps + } = props; + const popperScope = $c34afbc43c90cc6f$var$usePopperScope(__scopeTooltip); + const visuallyHiddenContentContext = $c34afbc43c90cc6f$var$useVisuallyHiddenContentContext($c34afbc43c90cc6f$var$ARROW_NAME, __scopeTooltip); // if the arrow is inside the `VisuallyHidden`, we don't want to render it all to + // prevent issues in positioning the arrow due to the duplicate + return visuallyHiddenContentContext.isInside ? null : /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactpopper.Arrow, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({}, popperScope, arrowProps, { + ref: forwardedRef + })); +}); +/*#__PURE__*/ +Object.assign($c34afbc43c90cc6f$export$c27ee0ad710f7559, { + displayName: $c34afbc43c90cc6f$var$ARROW_NAME +}); +/* -----------------------------------------------------------------------------------------------*/ +function $c34afbc43c90cc6f$var$getExitSideFromRect(point, rect) { + const top = Math.abs(rect.top - point.y); + const bottom = Math.abs(rect.bottom - point.y); + const right = Math.abs(rect.right - point.x); + const left = Math.abs(rect.left - point.x); + switch (Math.min(top, bottom, right, left)) { + case left: + return 'left'; + case right: + return 'right'; + case top: + return 'top'; + case bottom: + return 'bottom'; + default: + throw new Error('unreachable'); + } +} +function $c34afbc43c90cc6f$var$getPaddedExitPoints(exitPoint, exitSide) { + let padding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5; + const paddedExitPoints = []; + switch (exitSide) { + case 'top': + paddedExitPoints.push({ + x: exitPoint.x - padding, + y: exitPoint.y + padding + }, { + x: exitPoint.x + padding, + y: exitPoint.y + padding + }); + break; + case 'bottom': + paddedExitPoints.push({ + x: exitPoint.x - padding, + y: exitPoint.y - padding + }, { + x: exitPoint.x + padding, + y: exitPoint.y - padding + }); + break; + case 'left': + paddedExitPoints.push({ + x: exitPoint.x + padding, + y: exitPoint.y - padding + }, { + x: exitPoint.x + padding, + y: exitPoint.y + padding + }); + break; + case 'right': + paddedExitPoints.push({ + x: exitPoint.x - padding, + y: exitPoint.y - padding + }, { + x: exitPoint.x - padding, + y: exitPoint.y + padding + }); + break; + } + return paddedExitPoints; +} +function $c34afbc43c90cc6f$var$getPointsFromRect(rect) { + const { + top: top, + right: right, + bottom: bottom, + left: left + } = rect; + return [{ + x: left, + y: top + }, { + x: right, + y: top + }, { + x: right, + y: bottom + }, { + x: left, + y: bottom + }]; +} // Determine if a point is inside of a polygon. +// Based on https://github.com/substack/point-in-polygon +function $c34afbc43c90cc6f$var$isPointInPolygon(point, polygon) { + const { + x: x, + y: y + } = point; + let inside = false; + for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { + const xi = polygon[i].x; + const yi = polygon[i].y; + const xj = polygon[j].x; + const yj = polygon[j].y; // prettier-ignore + const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi; + if (intersect) inside = !inside; + } + return inside; +} // Returns a new array of points representing the convex hull of the given set of points. +// https://www.nayuki.io/page/convex-hull-algorithm +function $c34afbc43c90cc6f$var$getHull(points) { + const newPoints = points.slice(); + newPoints.sort((a, b) => { + if (a.x < b.x) return -1;else if (a.x > b.x) return 1;else if (a.y < b.y) return -1;else if (a.y > b.y) return 1;else return 0; + }); + return $c34afbc43c90cc6f$var$getHullPresorted(newPoints); +} // Returns the convex hull, assuming that each points[i] <= points[i + 1]. Runs in O(n) time. +function $c34afbc43c90cc6f$var$getHullPresorted(points) { + if (points.length <= 1) return points.slice(); + const upperHull = []; + for (let i = 0; i < points.length; i++) { + const p = points[i]; + while (upperHull.length >= 2) { + const q = upperHull[upperHull.length - 1]; + const r = upperHull[upperHull.length - 2]; + if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) upperHull.pop();else break; + } + upperHull.push(p); + } + upperHull.pop(); + const lowerHull = []; + for (let i1 = points.length - 1; i1 >= 0; i1--) { + const p = points[i1]; + while (lowerHull.length >= 2) { + const q = lowerHull[lowerHull.length - 1]; + const r = lowerHull[lowerHull.length - 2]; + if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) lowerHull.pop();else break; + } + lowerHull.push(p); + } + lowerHull.pop(); + if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) return upperHull;else return upperHull.concat(lowerHull); +} +const $c34afbc43c90cc6f$export$2881499e37b75b9a = $c34afbc43c90cc6f$export$f78649fb9ca566b8; +const $c34afbc43c90cc6f$export$be92b6f5f03c0fe9 = $c34afbc43c90cc6f$export$28c660c63b792dea; +const $c34afbc43c90cc6f$export$41fb9f06171c75f4 = $c34afbc43c90cc6f$export$8c610744efcf8a1d; +const $c34afbc43c90cc6f$export$602eac185826482c = $c34afbc43c90cc6f$export$7b36b8f925ab7497; +const $c34afbc43c90cc6f$export$7c6e2c02157bb7d2 = $c34afbc43c90cc6f$export$e9003e2be37ec060; +const $c34afbc43c90cc6f$export$21b07c8f274aebd5 = $c34afbc43c90cc6f$export$c27ee0ad710f7559; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js": +/*!****************************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js ***! + \****************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $92muK$react = __webpack_require__(/*! react */ "react"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +$parcel$export(module.exports, "useCallbackRef", () => $28e03942f763e819$export$25bec8c6f54ee79a); + +/** + * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a + * prop or avoid re-executing effects when passed as a dependency + */ +function $28e03942f763e819$export$25bec8c6f54ee79a(callback) { + const callbackRef = $92muK$react.useRef(callback); + $92muK$react.useEffect(() => { + callbackRef.current = callback; + }); // https://github.com/facebook/react/issues/19240 + return $92muK$react.useMemo(() => function () { + var _callbackRef$current; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args); + }, []); +} + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js": +/*!**********************************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js ***! + \**********************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $ijazI$react = __webpack_require__(/*! react */ "react"); +var $ijazI$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +$parcel$export(module.exports, "useControllableState", () => $b84d42d44371bff7$export$6f32135080cb4c3); +function $b84d42d44371bff7$export$6f32135080cb4c3(_ref) { + let { + prop: prop, + defaultProp: defaultProp, + onChange = () => {} + } = _ref; + const [uncontrolledProp, setUncontrolledProp] = $b84d42d44371bff7$var$useUncontrolledState({ + defaultProp: defaultProp, + onChange: onChange + }); + const isControlled = prop !== undefined; + const value1 = isControlled ? prop : uncontrolledProp; + const handleChange = $ijazI$radixuireactusecallbackref.useCallbackRef(onChange); + const setValue = $ijazI$react.useCallback(nextValue => { + if (isControlled) { + const setter = nextValue; + const value = typeof nextValue === 'function' ? setter(prop) : nextValue; + if (value !== prop) handleChange(value); + } else setUncontrolledProp(nextValue); + }, [isControlled, prop, setUncontrolledProp, handleChange]); + return [value1, setValue]; +} +function $b84d42d44371bff7$var$useUncontrolledState(_ref2) { + let { + defaultProp: defaultProp, + onChange: onChange + } = _ref2; + const uncontrolledState = $ijazI$react.useState(defaultProp); + const [value] = uncontrolledState; + const prevValueRef = $ijazI$react.useRef(value); + const handleChange = $ijazI$radixuireactusecallbackref.useCallbackRef(onChange); + $ijazI$react.useEffect(() => { + if (prevValueRef.current !== value) { + handleChange(value); + prevValueRef.current = value; + } + }, [value, prevValueRef, handleChange]); + return uncontrolledState; +} + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-use-escape-keydown/dist/index.js": +/*!******************************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-use-escape-keydown/dist/index.js ***! + \******************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $b0gz3$react = __webpack_require__(/*! react */ "react"); +var $b0gz3$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +$parcel$export(module.exports, "useEscapeKeydown", () => $24c84e9f83c4454f$export$3a72a57244d6e765); + +/** + * Listens for when the escape key is down + */ +function $24c84e9f83c4454f$export$3a72a57244d6e765(onEscapeKeyDownProp) { + let ownerDocument = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document; + const onEscapeKeyDown = $b0gz3$radixuireactusecallbackref.useCallbackRef(onEscapeKeyDownProp); + $b0gz3$react.useEffect(() => { + const handleKeyDown = event => { + if (event.key === 'Escape') onEscapeKeyDown(event); + }; + ownerDocument.addEventListener('keydown', handleKeyDown); + return () => ownerDocument.removeEventListener('keydown', handleKeyDown); + }, [onEscapeKeyDown, ownerDocument]); +} + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.js": +/*!*****************************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.js ***! + \*****************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $caHyQ$react = __webpack_require__(/*! react */ "react"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +$parcel$export(module.exports, "useLayoutEffect", () => $ca21affb0542a8a4$export$e5c5a5f917a5871c); + +/** + * On the server, React emits a warning when calling `useLayoutEffect`. + * This is because neither `useLayoutEffect` nor `useEffect` run on the server. + * We use this safe version which suppresses the warning by replacing it with a noop on the server. + * + * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect + */ +const $ca21affb0542a8a4$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? $caHyQ$react.useLayoutEffect : () => {}; + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-use-size/dist/index.js": +/*!********************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-use-size/dist/index.js ***! + \********************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $ksDzM$react = __webpack_require__(/*! react */ "react"); +var $ksDzM$radixuireactuselayouteffect = __webpack_require__(/*! @radix-ui/react-use-layout-effect */ "../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +$parcel$export(module.exports, "useSize", () => $d2c1d285af17635b$export$1ab7ae714698c4b8); +function $d2c1d285af17635b$export$1ab7ae714698c4b8(element) { + const [size, setSize] = $ksDzM$react.useState(undefined); + $ksDzM$radixuireactuselayouteffect.useLayoutEffect(() => { + if (element) { + // provide size as early as possible + setSize({ + width: element.offsetWidth, + height: element.offsetHeight + }); + const resizeObserver = new ResizeObserver(entries => { + if (!Array.isArray(entries)) return; + // Since we only observe the one element, we don't need to loop over the + // array + if (!entries.length) return; + const entry = entries[0]; + let width; + let height; + if ('borderBoxSize' in entry) { + const borderSizeEntry = entry['borderBoxSize']; // iron out differences between browsers + const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry; + width = borderSize['inlineSize']; + height = borderSize['blockSize']; + } else { + // for browsers that don't support `borderBoxSize` + // we calculate it ourselves to get the correct border box. + width = element.offsetWidth; + height = element.offsetHeight; + } + setSize({ + width: width, + height: height + }); + }); + resizeObserver.observe(element, { + box: 'border-box' + }); + return () => resizeObserver.unobserve(element); + } else + // We only want to reset to `undefined` when the element becomes `null`, + // not if it changes to another element. + setSize(undefined); + }, [element]); + return size; +} + +/***/ }), + +/***/ "../../../node_modules/@radix-ui/react-visually-hidden/dist/index.js": +/*!***************************************************************************!*\ + !*** ../../../node_modules/@radix-ui/react-visually-hidden/dist/index.js ***! + \***************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var $awrN2$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); +var $awrN2$react = __webpack_require__(/*! react */ "react"); +var $awrN2$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); +function $parcel$export(e, n, v, s) { + Object.defineProperty(e, n, { + get: v, + set: s, + enumerable: true, + configurable: true + }); +} +function $parcel$interopDefault(a) { + return a && a.__esModule ? a.default : a; +} +$parcel$export(module.exports, "VisuallyHidden", () => $685371e9c20848e2$export$439d29a4e110a164); +$parcel$export(module.exports, "Root", () => $685371e9c20848e2$export$be92b6f5f03c0fe9); + +/* ------------------------------------------------------------------------------------------------- + * VisuallyHidden + * -----------------------------------------------------------------------------------------------*/ +const $685371e9c20848e2$var$NAME = 'VisuallyHidden'; +const $685371e9c20848e2$export$439d29a4e110a164 = /*#__PURE__*/$awrN2$react.forwardRef((props, forwardedRef) => { + return /*#__PURE__*/$awrN2$react.createElement($awrN2$radixuireactprimitive.Primitive.span, $parcel$interopDefault($awrN2$babelruntimehelpersextends)({}, props, { + ref: forwardedRef, + style: { + // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss + position: 'absolute', + border: 0, + width: 1, + height: 1, + padding: 0, + margin: -1, + overflow: 'hidden', + clip: 'rect(0, 0, 0, 0)', + whiteSpace: 'nowrap', + wordWrap: 'normal', + ...props.style + } + })); +}); +/*#__PURE__*/ +Object.assign($685371e9c20848e2$export$439d29a4e110a164, { + displayName: $685371e9c20848e2$var$NAME +}); +/* -----------------------------------------------------------------------------------------------*/ +const $685371e9c20848e2$export$be92b6f5f03c0fe9 = $685371e9c20848e2$export$439d29a4e110a164; + +/***/ }), + +/***/ "../../../node_modules/aria-hidden/dist/es2015/index.js": +/*!**************************************************************!*\ + !*** ../../../node_modules/aria-hidden/dist/es2015/index.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.suppressOthers = exports.supportsInert = exports.inertOthers = exports.hideOthers = void 0; +var getDefaultParent = function (originalTarget) { + if (typeof document === 'undefined') { + return null; + } + var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; + return sampleTarget.ownerDocument.body; +}; +var counterMap = new WeakMap(); +var uncontrolledNodes = new WeakMap(); +var markerMap = {}; +var lockCount = 0; +var unwrapHost = function (node) { + return node && (node.host || unwrapHost(node.parentNode)); +}; +var correctTargets = function (parent, targets) { + return targets.map(function (target) { + if (parent.contains(target)) { + return target; + } + var correctedTarget = unwrapHost(target); + if (correctedTarget && parent.contains(correctedTarget)) { + return correctedTarget; + } + console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); + return null; + }).filter(function (x) { + return Boolean(x); + }); +}; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @param {String} [controlAttribute] - html Attribute to control + * @return {Undo} undo command + */ +var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) { + var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + if (!markerMap[markerName]) { + markerMap[markerName] = new WeakMap(); + } + var markerCounter = markerMap[markerName]; + var hiddenNodes = []; + var elementsToKeep = new Set(); + var elementsToStop = new Set(targets); + var keep = function (el) { + if (!el || elementsToKeep.has(el)) { + return; + } + elementsToKeep.add(el); + keep(el.parentNode); + }; + targets.forEach(keep); + var deep = function (parent) { + if (!parent || elementsToStop.has(parent)) { + return; + } + Array.prototype.forEach.call(parent.children, function (node) { + if (elementsToKeep.has(node)) { + deep(node); + } else { + var attr = node.getAttribute(controlAttribute); + var alreadyHidden = attr !== null && attr !== 'false'; + var counterValue = (counterMap.get(node) || 0) + 1; + var markerValue = (markerCounter.get(node) || 0) + 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + hiddenNodes.push(node); + if (counterValue === 1 && alreadyHidden) { + uncontrolledNodes.set(node, true); + } + if (markerValue === 1) { + node.setAttribute(markerName, 'true'); + } + if (!alreadyHidden) { + node.setAttribute(controlAttribute, 'true'); + } + } + }); + }; + deep(parentNode); + elementsToKeep.clear(); + lockCount++; + return function () { + hiddenNodes.forEach(function (node) { + var counterValue = counterMap.get(node) - 1; + var markerValue = markerCounter.get(node) - 1; + counterMap.set(node, counterValue); + markerCounter.set(node, markerValue); + if (!counterValue) { + if (!uncontrolledNodes.has(node)) { + node.removeAttribute(controlAttribute); + } + uncontrolledNodes.delete(node); + } + if (!markerValue) { + node.removeAttribute(markerName); + } + }); + lockCount--; + if (!lockCount) { + // clear + counterMap = new WeakMap(); + counterMap = new WeakMap(); + uncontrolledNodes = new WeakMap(); + markerMap = {}; + } + }; +}; +/** + * Marks everything except given node(or nodes) as aria-hidden + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +var hideOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { + markerName = 'data-aria-hidden'; + } + var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); + var activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return function () { + return null; + }; + } + // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10 + targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]'))); + return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); +}; +/** + * Marks everything except given node(or nodes) as inert + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +exports.hideOthers = hideOthers; +var inertOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { + markerName = 'data-inert-ed'; + } + var activeParentNode = parentNode || getDefaultParent(originalTarget); + if (!activeParentNode) { + return function () { + return null; + }; + } + return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert'); +}; +/** + * @returns if current browser supports inert + */ +exports.inertOthers = inertOthers; +var supportsInert = function () { + return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert'); +}; +/** + * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way + * @param {Element | Element[]} originalTarget - elements to keep on the page + * @param [parentNode] - top element, defaults to document.body + * @param {String} [markerName] - a special attribute to mark every node + * @return {Undo} undo command + */ +exports.supportsInert = supportsInert; +var suppressOthers = function (originalTarget, parentNode, markerName) { + if (markerName === void 0) { + markerName = 'data-suppressed'; + } + return (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName); +}; +exports.suppressOthers = suppressOthers; + +/***/ }), + +/***/ "../../../node_modules/clsx/dist/clsx.m.js": +/*!*************************************************!*\ + !*** ../../../node_modules/clsx/dist/clsx.m.js ***! + \*************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.clsx = clsx; +exports["default"] = void 0; +function r(e) { + var t, + f, + n = ""; + if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);else for (t in e) e[t] && (n && (n += " "), n += t); + return n; +} +function clsx() { + for (var e, t, f = 0, n = ""; f < arguments.length;) (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t); + return n; +} +var _default = clsx; +exports["default"] = _default; + +/***/ }), + +/***/ "../../../node_modules/copy-to-clipboard/index.js": +/*!********************************************************!*\ + !*** ../../../node_modules/copy-to-clipboard/index.js ***! + \********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var deselectCurrent = __webpack_require__(/*! toggle-selection */ "../../../node_modules/toggle-selection/index.js"); +var clipboardToIE11Formatting = { + "text/plain": "Text", + "text/html": "Url", + "default": "Text" +}; +var defaultMessage = "Copy to clipboard: #{key}, Enter"; +function format(message) { + var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C"; + return message.replace(/#{\s*key\s*}/g, copyKey); +} +function copy(text, options) { + var debug, + message, + reselectPrevious, + range, + selection, + mark, + success = false; + if (!options) { + options = {}; + } + debug = options.debug || false; + try { + reselectPrevious = deselectCurrent(); + range = document.createRange(); + selection = document.getSelection(); + mark = document.createElement("span"); + mark.textContent = text; + // avoid screen readers from reading out loud the text + mark.ariaHidden = "true"; + // reset user styles for span element + mark.style.all = "unset"; + // prevents scrolling to the end of the page + mark.style.position = "fixed"; + mark.style.top = 0; + mark.style.clip = "rect(0, 0, 0, 0)"; + // used to preserve spaces and line breaks + mark.style.whiteSpace = "pre"; + // do not inherit user-select (it may be `none`) + mark.style.webkitUserSelect = "text"; + mark.style.MozUserSelect = "text"; + mark.style.msUserSelect = "text"; + mark.style.userSelect = "text"; + mark.addEventListener("copy", function (e) { + e.stopPropagation(); + if (options.format) { + e.preventDefault(); + if (typeof e.clipboardData === "undefined") { + // IE 11 + debug && console.warn("unable to use e.clipboardData"); + debug && console.warn("trying IE specific stuff"); + window.clipboardData.clearData(); + var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"]; + window.clipboardData.setData(format, text); + } else { + // all other browsers + e.clipboardData.clearData(); + e.clipboardData.setData(options.format, text); + } + } + if (options.onCopy) { + e.preventDefault(); + options.onCopy(e.clipboardData); + } + }); + document.body.appendChild(mark); + range.selectNodeContents(mark); + selection.addRange(range); + var successful = document.execCommand("copy"); + if (!successful) { + throw new Error("copy command was unsuccessful"); + } + success = true; + } catch (err) { + debug && console.error("unable to copy using execCommand: ", err); + debug && console.warn("trying IE specific stuff"); + try { + window.clipboardData.setData(options.format || "text", text); + options.onCopy && options.onCopy(window.clipboardData); + success = true; + } catch (err) { + debug && console.error("unable to copy using clipboardData: ", err); + debug && console.error("falling back to prompt"); + message = format("message" in options ? options.message : defaultMessage); + window.prompt(message, text); + } + } finally { + if (selection) { + if (typeof selection.removeRange == "function") { + selection.removeRange(range); + } else { + selection.removeAllRanges(); + } + } + if (mark) { + document.body.removeChild(mark); + } + reselectPrevious(); + } + return success; +} +module.exports = copy; + +/***/ }), + +/***/ "../../../node_modules/detect-node-es/esm/browser.js": +/*!***********************************************************!*\ + !*** ../../../node_modules/detect-node-es/esm/browser.js ***! + \***********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isNode = void 0; +const isNode = false; +exports.isNode = isNode; + +/***/ }), + +/***/ "../../../node_modules/framer-motion/dist/cjs/index.js": +/*!*************************************************************!*\ + !*** ../../../node_modules/framer-motion/dist/cjs/index.js ***! + \*************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js"); +var React = __webpack_require__(/*! react */ "react"); +var heyListen = __webpack_require__(/*! hey-listen */ "../../../node_modules/hey-listen/dist/hey-listen.es.js"); +var styleValueTypes = __webpack_require__(/*! style-value-types */ "../../../node_modules/style-value-types/dist/valueTypes.cjs.js"); +var popmotion = __webpack_require__(/*! popmotion */ "../../../node_modules/popmotion/dist/popmotion.cjs.js"); +var sync = __webpack_require__(/*! framesync */ "../../../node_modules/framesync/dist/framesync.cjs.js"); +var dom = __webpack_require__(/*! @motionone/dom */ "../../../node_modules/@motionone/dom/dist/index.es.js"); +function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : { + 'default': e + }; +} +function _interopNamespace(e) { + if (e && e.__esModule) return e; + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { + return e[k]; + } + }); + } + }); + } + n["default"] = e; + return Object.freeze(n); +} +var React__namespace = /*#__PURE__*/_interopNamespace(React); +var React__default = /*#__PURE__*/_interopDefaultLegacy(React); +var sync__default = /*#__PURE__*/_interopDefaultLegacy(sync); + +/** + * Browser-safe usage of process + */ +var defaultEnvironment = "production"; +var env = typeof process === "undefined" || process.env === undefined ? defaultEnvironment : "development" || 0; +var createDefinition = function (propNames) { + return { + isEnabled: function (props) { + return propNames.some(function (name) { + return !!props[name]; + }); + } + }; +}; +var featureDefinitions = { + measureLayout: createDefinition(["layout", "layoutId", "drag"]), + animation: createDefinition(["animate", "exit", "variants", "whileHover", "whileTap", "whileFocus", "whileDrag", "whileInView"]), + exit: createDefinition(["exit"]), + drag: createDefinition(["drag", "dragControls"]), + focus: createDefinition(["whileFocus"]), + hover: createDefinition(["whileHover", "onHoverStart", "onHoverEnd"]), + tap: createDefinition(["whileTap", "onTap", "onTapStart", "onTapCancel"]), + pan: createDefinition(["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"]), + inView: createDefinition(["whileInView", "onViewportEnter", "onViewportLeave"]) +}; +function loadFeatures(features) { + for (var key in features) { + if (features[key] === null) continue; + if (key === "projectionNodeConstructor") { + featureDefinitions.projectionNodeConstructor = features[key]; + } else { + featureDefinitions[key].Component = features[key]; + } + } +} +var LazyContext = React.createContext({ + strict: false +}); +var featureNames = Object.keys(featureDefinitions); +var numFeatures = featureNames.length; +/** + * Load features via renderless components based on the provided MotionProps. + */ +function useFeatures(props, visualElement, preloadedFeatures) { + var features = []; + var lazyContext = React.useContext(LazyContext); + if (!visualElement) return null; + /** + * If we're in development mode, check to make sure we're not rendering a motion component + * as a child of LazyMotion, as this will break the file-size benefits of using it. + */ + if (env !== "production" && preloadedFeatures && lazyContext.strict) { + heyListen.invariant(false, "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."); + } + for (var i = 0; i < numFeatures; i++) { + var name_1 = featureNames[i]; + var _a = featureDefinitions[name_1], + isEnabled = _a.isEnabled, + Component = _a.Component; + /** + * It might be possible in the future to use this moment to + * dynamically request functionality. In initial tests this + * was producing a lot of duplication amongst bundles. + */ + if (isEnabled(props) && Component) { + features.push(React__namespace.createElement(Component, tslib.__assign({ + key: name_1 + }, props, { + visualElement: visualElement + }))); + } + } + return features; +} + +/** + * @public + */ +var MotionConfigContext = React.createContext({ + transformPagePoint: function (p) { + return p; + }, + isStatic: false, + reducedMotion: "never" +}); +var MotionContext = React.createContext({}); +function useVisualElementContext() { + return React.useContext(MotionContext).visualElement; +} + +/** + * @public + */ +var PresenceContext = React.createContext(null); +var isBrowser = typeof document !== "undefined"; +var useIsomorphicLayoutEffect = isBrowser ? React.useLayoutEffect : React.useEffect; + +// Does this device prefer reduced motion? Returns `null` server-side. +var prefersReducedMotion = { + current: null +}; +var hasDetected = false; +function initPrefersReducedMotion() { + hasDetected = true; + if (!isBrowser) return; + if (window.matchMedia) { + var motionMediaQuery_1 = window.matchMedia("(prefers-reduced-motion)"); + var setReducedMotionPreferences = function () { + return prefersReducedMotion.current = motionMediaQuery_1.matches; + }; + motionMediaQuery_1.addListener(setReducedMotionPreferences); + setReducedMotionPreferences(); + } else { + prefersReducedMotion.current = false; + } +} +/** + * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. + * + * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing + * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. + * + * It will actively respond to changes and re-render your components with the latest setting. + * + * ```jsx + * export function Sidebar({ isOpen }) { + * const shouldReduceMotion = useReducedMotion() + * const closedX = shouldReduceMotion ? 0 : "-100%" + * + * return ( + * + * ) + * } + * ``` + * + * @return boolean + * + * @public + */ +function useReducedMotion() { + /** + * Lazy initialisation of prefersReducedMotion + */ + !hasDetected && initPrefersReducedMotion(); + var _a = tslib.__read(React.useState(prefersReducedMotion.current), 1), + shouldReduceMotion = _a[0]; + /** + * TODO See if people miss automatically updating shouldReduceMotion setting + */ + return shouldReduceMotion; +} +function useReducedMotionConfig() { + var reducedMotionPreference = useReducedMotion(); + var reducedMotion = React.useContext(MotionConfigContext).reducedMotion; + if (reducedMotion === "never") { + return false; + } else if (reducedMotion === "always") { + return true; + } else { + return reducedMotionPreference; + } +} +function useVisualElement(Component, visualState, props, createVisualElement) { + var lazyContext = React.useContext(LazyContext); + var parent = useVisualElementContext(); + var presenceContext = React.useContext(PresenceContext); + var shouldReduceMotion = useReducedMotionConfig(); + var visualElementRef = React.useRef(undefined); + /** + * If we haven't preloaded a renderer, check to see if we have one lazy-loaded + */ + if (!createVisualElement) createVisualElement = lazyContext.renderer; + if (!visualElementRef.current && createVisualElement) { + visualElementRef.current = createVisualElement(Component, { + visualState: visualState, + parent: parent, + props: props, + presenceId: presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.id, + blockInitialAnimation: (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false, + shouldReduceMotion: shouldReduceMotion + }); + } + var visualElement = visualElementRef.current; + useIsomorphicLayoutEffect(function () { + visualElement === null || visualElement === void 0 ? void 0 : visualElement.syncRender(); + }); + React.useEffect(function () { + var _a; + (_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.animationState) === null || _a === void 0 ? void 0 : _a.animateChanges(); + }); + useIsomorphicLayoutEffect(function () { + return function () { + return visualElement === null || visualElement === void 0 ? void 0 : visualElement.notifyUnmount(); + }; + }, []); + return visualElement; +} +function isRefObject(ref) { + return typeof ref === "object" && Object.prototype.hasOwnProperty.call(ref, "current"); +} + +/** + * Creates a ref function that, when called, hydrates the provided + * external ref and VisualElement. + */ +function useMotionRef(visualState, visualElement, externalRef) { + return React.useCallback(function (instance) { + var _a; + instance && ((_a = visualState.mount) === null || _a === void 0 ? void 0 : _a.call(visualState, instance)); + if (visualElement) { + instance ? visualElement.mount(instance) : visualElement.unmount(); + } + if (externalRef) { + if (typeof externalRef === "function") { + externalRef(instance); + } else if (isRefObject(externalRef)) { + externalRef.current = instance; + } + } + }, + /** + * Only pass a new ref callback to React if we've received a visual element + * factory. Otherwise we'll be mounting/remounting every time externalRef + * or other dependencies change. + */ + [visualElement]); +} + +/** + * Decides if the supplied variable is an array of variant labels + */ +function isVariantLabels(v) { + return Array.isArray(v); +} +/** + * Decides if the supplied variable is variant label + */ +function isVariantLabel(v) { + return typeof v === "string" || isVariantLabels(v); +} +/** + * Creates an object containing the latest state of every MotionValue on a VisualElement + */ +function getCurrent(visualElement) { + var current = {}; + visualElement.forEachValue(function (value, key) { + return current[key] = value.get(); + }); + return current; +} +/** + * Creates an object containing the latest velocity of every MotionValue on a VisualElement + */ +function getVelocity$1(visualElement) { + var velocity = {}; + visualElement.forEachValue(function (value, key) { + return velocity[key] = value.getVelocity(); + }); + return velocity; +} +function resolveVariantFromProps(props, definition, custom, currentValues, currentVelocity) { + var _a; + if (currentValues === void 0) { + currentValues = {}; + } + if (currentVelocity === void 0) { + currentVelocity = {}; + } + /** + * If the variant definition is a function, resolve. + */ + if (typeof definition === "function") { + definition = definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity); + } + /** + * If the variant definition is a variant label, or + * the function returned a variant label, resolve. + */ + if (typeof definition === "string") { + definition = (_a = props.variants) === null || _a === void 0 ? void 0 : _a[definition]; + } + /** + * At this point we've resolved both functions and variant labels, + * but the resolved variant label might itself have been a function. + * If so, resolve. This can only have returned a valid target object. + */ + if (typeof definition === "function") { + definition = definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity); + } + return definition; +} +function resolveVariant(visualElement, definition, custom) { + var props = visualElement.getProps(); + return resolveVariantFromProps(props, definition, custom !== null && custom !== void 0 ? custom : props.custom, getCurrent(visualElement), getVelocity$1(visualElement)); +} +function checkIfControllingVariants(props) { + var _a; + return typeof ((_a = props.animate) === null || _a === void 0 ? void 0 : _a.start) === "function" || isVariantLabel(props.initial) || isVariantLabel(props.animate) || isVariantLabel(props.whileHover) || isVariantLabel(props.whileDrag) || isVariantLabel(props.whileTap) || isVariantLabel(props.whileFocus) || isVariantLabel(props.exit); +} +function checkIfVariantNode(props) { + return Boolean(checkIfControllingVariants(props) || props.variants); +} +function getCurrentTreeVariants(props, context) { + if (checkIfControllingVariants(props)) { + var initial = props.initial, + animate = props.animate; + return { + initial: initial === false || isVariantLabel(initial) ? initial : undefined, + animate: isVariantLabel(animate) ? animate : undefined + }; + } + return props.inherit !== false ? context : {}; +} +function useCreateMotionContext(props) { + var _a = getCurrentTreeVariants(props, React.useContext(MotionContext)), + initial = _a.initial, + animate = _a.animate; + return React.useMemo(function () { + return { + initial: initial, + animate: animate + }; + }, [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); +} +function variantLabelsAsDependency(prop) { + return Array.isArray(prop) ? prop.join(" ") : prop; +} + +/** + * Creates a constant value over the lifecycle of a component. + * + * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer + * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` + * you can ensure that initialisers don't execute twice or more. + */ +function useConstant(init) { + var ref = React.useRef(null); + if (ref.current === null) { + ref.current = init(); + } + return ref.current; +} + +/** + * This should only ever be modified on the client otherwise it'll + * persist through server requests. If we need instanced states we + * could lazy-init via root. + */ +var globalProjectionState = { + /** + * Global flag as to whether the tree has animated since the last time + * we resized the window + */ + hasAnimatedSinceResize: true, + /** + * We set this to true once, on the first update. Any nodes added to the tree beyond that + * update will be given a `data-projection-id` attribute. + */ + hasEverUpdated: false +}; +var id$1 = 1; +function useProjectionId() { + return useConstant(function () { + if (globalProjectionState.hasEverUpdated) { + return id$1++; + } + }); +} +var LayoutGroupContext = React.createContext({}); + +/** + * Internal, exported only for usage in Framer + */ +var SwitchLayoutGroupContext = React.createContext({}); +function useProjection(projectionId, _a, visualElement, ProjectionNodeConstructor) { + var _b; + var layoutId = _a.layoutId, + layout = _a.layout, + drag = _a.drag, + dragConstraints = _a.dragConstraints, + layoutScroll = _a.layoutScroll; + var initialPromotionConfig = React.useContext(SwitchLayoutGroupContext); + if (!ProjectionNodeConstructor || !visualElement || (visualElement === null || visualElement === void 0 ? void 0 : visualElement.projection)) { + return; + } + visualElement.projection = new ProjectionNodeConstructor(projectionId, visualElement.getLatestValues(), (_b = visualElement.parent) === null || _b === void 0 ? void 0 : _b.projection); + visualElement.projection.setOptions({ + layoutId: layoutId, + layout: layout, + alwaysMeasureLayout: Boolean(drag) || dragConstraints && isRefObject(dragConstraints), + visualElement: visualElement, + scheduleRender: function () { + return visualElement.scheduleRender(); + }, + /** + * TODO: Update options in an effect. This could be tricky as it'll be too late + * to update by the time layout animations run. + * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, + * ensuring it gets called if there's no potential layout animations. + * + */ + animationType: typeof layout === "string" ? layout : "both", + initialPromotionConfig: initialPromotionConfig, + layoutScroll: layoutScroll + }); +} +var VisualElementHandler = /** @class */function (_super) { + tslib.__extends(VisualElementHandler, _super); + function VisualElementHandler() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Update visual element props as soon as we know this update is going to be commited. + */ + VisualElementHandler.prototype.getSnapshotBeforeUpdate = function () { + this.updateProps(); + return null; + }; + VisualElementHandler.prototype.componentDidUpdate = function () {}; + VisualElementHandler.prototype.updateProps = function () { + var _a = this.props, + visualElement = _a.visualElement, + props = _a.props; + if (visualElement) visualElement.setProps(props); + }; + VisualElementHandler.prototype.render = function () { + return this.props.children; + }; + return VisualElementHandler; +}(React__default["default"].Component); + +/** + * Create a `motion` component. + * + * This function accepts a Component argument, which can be either a string (ie "div" + * for `motion.div`), or an actual React component. + * + * Alongside this is a config option which provides a way of rendering the provided + * component "offline", or outside the React render cycle. + */ +function createMotionComponent(_a) { + var preloadedFeatures = _a.preloadedFeatures, + createVisualElement = _a.createVisualElement, + projectionNodeConstructor = _a.projectionNodeConstructor, + useRender = _a.useRender, + useVisualState = _a.useVisualState, + Component = _a.Component; + preloadedFeatures && loadFeatures(preloadedFeatures); + function MotionComponent(props, externalRef) { + var layoutId = useLayoutId(props); + props = tslib.__assign(tslib.__assign({}, props), { + layoutId: layoutId + }); + /** + * If we're rendering in a static environment, we only visually update the component + * as a result of a React-rerender rather than interactions or animations. This + * means we don't need to load additional memory structures like VisualElement, + * or any gesture/animation features. + */ + var config = React.useContext(MotionConfigContext); + var features = null; + var context = useCreateMotionContext(props); + /** + * Create a unique projection ID for this component. If a new component is added + * during a layout animation we'll use this to query the DOM and hydrate its ref early, allowing + * us to measure it as soon as any layout effect flushes pending layout animations. + * + * Performance note: It'd be better not to have to search the DOM for these elements. + * For newly-entering components it could be enough to only correct treeScale, in which + * case we could mount in a scale-correction mode. This wouldn't be enough for + * shared element transitions however. Perhaps for those we could revert to a root node + * that gets forceRendered and layout animations are triggered on its layout effect. + */ + var projectionId = config.isStatic ? undefined : useProjectionId(); + /** + * + */ + var visualState = useVisualState(props, config.isStatic); + if (!config.isStatic && isBrowser) { + /** + * Create a VisualElement for this component. A VisualElement provides a common + * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as + * providing a way of rendering to these APIs outside of the React render loop + * for more performant animations and interactions + */ + context.visualElement = useVisualElement(Component, visualState, tslib.__assign(tslib.__assign({}, config), props), createVisualElement); + useProjection(projectionId, props, context.visualElement, projectionNodeConstructor || featureDefinitions.projectionNodeConstructor); + /** + * Load Motion gesture and animation features. These are rendered as renderless + * components so each feature can optionally make use of React lifecycle methods. + */ + features = useFeatures(props, context.visualElement, preloadedFeatures); + } + /** + * The mount order and hierarchy is specific to ensure our element ref + * is hydrated by the time features fire their effects. + */ + return React__namespace.createElement(VisualElementHandler, { + visualElement: context.visualElement, + props: tslib.__assign(tslib.__assign({}, config), props) + }, features, React__namespace.createElement(MotionContext.Provider, { + value: context + }, useRender(Component, props, projectionId, useMotionRef(visualState, context.visualElement, externalRef), visualState, config.isStatic, context.visualElement))); + } + return React.forwardRef(MotionComponent); +} +function useLayoutId(_a) { + var _b; + var layoutId = _a.layoutId; + var layoutGroupId = (_b = React.useContext(LayoutGroupContext)) === null || _b === void 0 ? void 0 : _b.id; + return layoutGroupId && layoutId !== undefined ? layoutGroupId + "-" + layoutId : layoutId; +} + +/** + * Convert any React component into a `motion` component. The provided component + * **must** use `React.forwardRef` to the underlying DOM component you want to animate. + * + * ```jsx + * const Component = React.forwardRef((props, ref) => { + * return
+ * }) + * + * const MotionComponent = motion(Component) + * ``` + * + * @public + */ +function createMotionProxy(createConfig) { + function custom(Component, customMotionComponentConfig) { + if (customMotionComponentConfig === void 0) { + customMotionComponentConfig = {}; + } + return createMotionComponent(createConfig(Component, customMotionComponentConfig)); + } + if (typeof Proxy === "undefined") { + return custom; + } + /** + * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. + * Rather than generating them anew every render. + */ + var componentCache = new Map(); + return new Proxy(custom, { + /** + * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. + * The prop name is passed through as `key` and we can use that to generate a `motion` + * DOM component with that name. + */ + get: function (_target, key) { + /** + * If this element doesn't exist in the component cache, create it and cache. + */ + if (!componentCache.has(key)) { + componentCache.set(key, custom(key)); + } + return componentCache.get(key); + } + }); +} + +/** + * We keep these listed seperately as we use the lowercase tag names as part + * of the runtime bundle to detect SVG components + */ +var lowercaseSVGElements = ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view"]; +function isSVGComponent(Component) { + if ( + /** + * If it's not a string, it's a custom React component. Currently we only support + * HTML custom React components. + */ + typeof Component !== "string" || + /** + * If it contains a dash, the element is a custom HTML webcomponent. + */ + Component.includes("-")) { + return false; + } else if ( + /** + * If it's in our list of lowercase SVG tags, it's an SVG component + */ + lowercaseSVGElements.indexOf(Component) > -1 || + /** + * If it contains a capital letter, it's an SVG component + */ + /[A-Z]/.test(Component)) { + return true; + } + return false; +} +var scaleCorrectors = {}; +function addScaleCorrector(correctors) { + Object.assign(scaleCorrectors, correctors); +} + +/** + * A list of all transformable axes. We'll use this list to generated a version + * of each axes for each transform. + */ +var transformAxes = ["", "X", "Y", "Z"]; +/** + * An ordered array of each transformable value. By default, transform values + * will be sorted to this order. + */ +var order = ["translate", "scale", "rotate", "skew"]; +/** + * Generate a list of every possible transform key. + */ +var transformProps = ["transformPerspective", "x", "y", "z"]; +order.forEach(function (operationKey) { + return transformAxes.forEach(function (axesKey) { + return transformProps.push(operationKey + axesKey); + }); +}); +/** + * A function to use with Array.sort to sort transform keys by their default order. + */ +function sortTransformProps(a, b) { + return transformProps.indexOf(a) - transformProps.indexOf(b); +} +/** + * A quick lookup for transform props. + */ +var transformPropSet = new Set(transformProps); +function isTransformProp(key) { + return transformPropSet.has(key); +} +/** + * A quick lookup for transform origin props + */ +var transformOriginProps = new Set(["originX", "originY", "originZ"]); +function isTransformOriginProp(key) { + return transformOriginProps.has(key); +} +function isForcedMotionValue(key, _a) { + var layout = _a.layout, + layoutId = _a.layoutId; + return isTransformProp(key) || isTransformOriginProp(key) || (layout || layoutId !== undefined) && (!!scaleCorrectors[key] || key === "opacity"); +} +var isMotionValue = function (value) { + return Boolean(value !== null && typeof value === "object" && value.getVelocity); +}; +var translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective" +}; +/** + * Build a CSS transform style from individual x/y/scale etc properties. + * + * This outputs with a default order of transforms/scales/rotations, this can be customised by + * providing a transformTemplate function. + */ +function buildTransform(_a, _b, transformIsDefault, transformTemplate) { + var transform = _a.transform, + transformKeys = _a.transformKeys; + var _c = _b.enableHardwareAcceleration, + enableHardwareAcceleration = _c === void 0 ? true : _c, + _d = _b.allowTransformNone, + allowTransformNone = _d === void 0 ? true : _d; + // The transform string we're going to build into. + var transformString = ""; + // Transform keys into their default order - this will determine the output order. + transformKeys.sort(sortTransformProps); + // Track whether the defined transform has a defined z so we don't add a + // second to enable hardware acceleration + var transformHasZ = false; + // Loop over each transform and build them into transformString + var numTransformKeys = transformKeys.length; + for (var i = 0; i < numTransformKeys; i++) { + var key = transformKeys[i]; + transformString += "".concat(translateAlias[key] || key, "(").concat(transform[key], ") "); + if (key === "z") transformHasZ = true; + } + if (!transformHasZ && enableHardwareAcceleration) { + transformString += "translateZ(0)"; + } else { + transformString = transformString.trim(); + } + // If we have a custom `transform` template, pass our transform values and + // generated transformString to that before returning + if (transformTemplate) { + transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); + } else if (allowTransformNone && transformIsDefault) { + transformString = "none"; + } + return transformString; +} +/** + * Build a transformOrigin style. Uses the same defaults as the browser for + * undefined origins. + */ +function buildTransformOrigin(_a) { + var _b = _a.originX, + originX = _b === void 0 ? "50%" : _b, + _c = _a.originY, + originY = _c === void 0 ? "50%" : _c, + _d = _a.originZ, + originZ = _d === void 0 ? 0 : _d; + return "".concat(originX, " ").concat(originY, " ").concat(originZ); +} + +/** + * Returns true if the provided key is a CSS variable + */ +function isCSSVariable$1(key) { + return key.startsWith("--"); +} + +/** + * Provided a value and a ValueType, returns the value as that value type. + */ +var getValueAsType = function (value, type) { + return type && typeof value === "number" ? type.transform(value) : value; +}; +var int = tslib.__assign(tslib.__assign({}, styleValueTypes.number), { + transform: Math.round +}); +var numberValueTypes = { + // Border props + borderWidth: styleValueTypes.px, + borderTopWidth: styleValueTypes.px, + borderRightWidth: styleValueTypes.px, + borderBottomWidth: styleValueTypes.px, + borderLeftWidth: styleValueTypes.px, + borderRadius: styleValueTypes.px, + radius: styleValueTypes.px, + borderTopLeftRadius: styleValueTypes.px, + borderTopRightRadius: styleValueTypes.px, + borderBottomRightRadius: styleValueTypes.px, + borderBottomLeftRadius: styleValueTypes.px, + // Positioning props + width: styleValueTypes.px, + maxWidth: styleValueTypes.px, + height: styleValueTypes.px, + maxHeight: styleValueTypes.px, + size: styleValueTypes.px, + top: styleValueTypes.px, + right: styleValueTypes.px, + bottom: styleValueTypes.px, + left: styleValueTypes.px, + // Spacing props + padding: styleValueTypes.px, + paddingTop: styleValueTypes.px, + paddingRight: styleValueTypes.px, + paddingBottom: styleValueTypes.px, + paddingLeft: styleValueTypes.px, + margin: styleValueTypes.px, + marginTop: styleValueTypes.px, + marginRight: styleValueTypes.px, + marginBottom: styleValueTypes.px, + marginLeft: styleValueTypes.px, + // Transform props + rotate: styleValueTypes.degrees, + rotateX: styleValueTypes.degrees, + rotateY: styleValueTypes.degrees, + rotateZ: styleValueTypes.degrees, + scale: styleValueTypes.scale, + scaleX: styleValueTypes.scale, + scaleY: styleValueTypes.scale, + scaleZ: styleValueTypes.scale, + skew: styleValueTypes.degrees, + skewX: styleValueTypes.degrees, + skewY: styleValueTypes.degrees, + distance: styleValueTypes.px, + translateX: styleValueTypes.px, + translateY: styleValueTypes.px, + translateZ: styleValueTypes.px, + x: styleValueTypes.px, + y: styleValueTypes.px, + z: styleValueTypes.px, + perspective: styleValueTypes.px, + transformPerspective: styleValueTypes.px, + opacity: styleValueTypes.alpha, + originX: styleValueTypes.progressPercentage, + originY: styleValueTypes.progressPercentage, + originZ: styleValueTypes.px, + // Misc + zIndex: int, + // SVG + fillOpacity: styleValueTypes.alpha, + strokeOpacity: styleValueTypes.alpha, + numOctaves: int +}; +function buildHTMLStyles(state, latestValues, options, transformTemplate) { + var _a; + var style = state.style, + vars = state.vars, + transform = state.transform, + transformKeys = state.transformKeys, + transformOrigin = state.transformOrigin; + // Empty the transformKeys array. As we're throwing out refs to its items + // this might not be as cheap as suspected. Maybe using the array as a buffer + // with a manual incrementation would be better. + transformKeys.length = 0; + // Track whether we encounter any transform or transformOrigin values. + var hasTransform = false; + var hasTransformOrigin = false; + // Does the calculated transform essentially equal "none"? + var transformIsNone = true; + /** + * Loop over all our latest animated values and decide whether to handle them + * as a style or CSS variable. + * + * Transforms and transform origins are kept seperately for further processing. + */ + for (var key in latestValues) { + var value = latestValues[key]; + /** + * If this is a CSS variable we don't do any further processing. + */ + if (isCSSVariable$1(key)) { + vars[key] = value; + continue; + } + // Convert the value to its default value type, ie 0 -> "0px" + var valueType = numberValueTypes[key]; + var valueAsType = getValueAsType(value, valueType); + if (isTransformProp(key)) { + // If this is a transform, flag to enable further transform processing + hasTransform = true; + transform[key] = valueAsType; + transformKeys.push(key); + // If we already know we have a non-default transform, early return + if (!transformIsNone) continue; + // Otherwise check to see if this is a default transform + if (value !== ((_a = valueType.default) !== null && _a !== void 0 ? _a : 0)) transformIsNone = false; + } else if (isTransformOriginProp(key)) { + transformOrigin[key] = valueAsType; + // If this is a transform origin, flag and enable further transform-origin processing + hasTransformOrigin = true; + } else { + style[key] = valueAsType; + } + } + if (hasTransform) { + style.transform = buildTransform(state, options, transformIsNone, transformTemplate); + } else if (transformTemplate) { + style.transform = transformTemplate({}, ""); + } else if (!latestValues.transform && style.transform) { + style.transform = "none"; + } + if (hasTransformOrigin) { + style.transformOrigin = buildTransformOrigin(transformOrigin); + } +} +var createHtmlRenderState = function () { + return { + style: {}, + transform: {}, + transformKeys: [], + transformOrigin: {}, + vars: {} + }; +}; +function copyRawValuesOnly(target, source, props) { + for (var key in source) { + if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { + target[key] = source[key]; + } + } +} +function useInitialMotionValues(_a, visualState, isStatic) { + var transformTemplate = _a.transformTemplate; + return React.useMemo(function () { + var state = createHtmlRenderState(); + buildHTMLStyles(state, visualState, { + enableHardwareAcceleration: !isStatic + }, transformTemplate); + var vars = state.vars, + style = state.style; + return tslib.__assign(tslib.__assign({}, vars), style); + }, [visualState]); +} +function useStyle(props, visualState, isStatic) { + var styleProp = props.style || {}; + var style = {}; + /** + * Copy non-Motion Values straight into style + */ + copyRawValuesOnly(style, styleProp, props); + Object.assign(style, useInitialMotionValues(props, visualState, isStatic)); + if (props.transformValues) { + style = props.transformValues(style); + } + return style; +} +function useHTMLProps(props, visualState, isStatic) { + // The `any` isn't ideal but it is the type of createElement props argument + var htmlProps = {}; + var style = useStyle(props, visualState, isStatic); + if (Boolean(props.drag) && props.dragListener !== false) { + // Disable the ghost element when a user drags + htmlProps.draggable = false; + // Disable text selection + style.userSelect = style.WebkitUserSelect = style.WebkitTouchCallout = "none"; + // Disable scrolling on the draggable direction + style.touchAction = props.drag === true ? "none" : "pan-".concat(props.drag === "x" ? "y" : "x"); + } + htmlProps.style = style; + return htmlProps; +} + +/** + * A list of all valid MotionProps. + * + * @privateRemarks + * This doesn't throw if a `MotionProp` name is missing - it should. + */ +var validMotionProps = new Set(["initial", "animate", "exit", "style", "variants", "transition", "transformTemplate", "transformValues", "custom", "inherit", "layout", "layoutId", "layoutDependency", "onLayoutAnimationStart", "onLayoutAnimationComplete", "onLayoutMeasure", "onBeforeLayoutMeasure", "onAnimationStart", "onAnimationComplete", "onUpdate", "onDragStart", "onDrag", "onDragEnd", "onMeasureDragConstraints", "onDirectionLock", "onDragTransitionEnd", "drag", "dragControls", "dragListener", "dragConstraints", "dragDirectionLock", "dragSnapToOrigin", "_dragX", "_dragY", "dragElastic", "dragMomentum", "dragPropagation", "dragTransition", "whileDrag", "onPan", "onPanStart", "onPanEnd", "onPanSessionStart", "onTap", "onTapStart", "onTapCancel", "onHoverStart", "onHoverEnd", "whileFocus", "whileTap", "whileHover", "whileInView", "onViewportEnter", "onViewportLeave", "viewport", "layoutScroll"]); +/** + * Check whether a prop name is a valid `MotionProp` key. + * + * @param key - Name of the property to check + * @returns `true` is key is a valid `MotionProp`. + * + * @public + */ +function isValidMotionProp(key) { + return validMotionProps.has(key); +} +var shouldForward = function (key) { + return !isValidMotionProp(key); +}; +function loadExternalIsValidProp(isValidProp) { + if (!isValidProp) return; + // Explicitly filter our events + shouldForward = function (key) { + return key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); + }; +} +/** + * Emotion and Styled Components both allow users to pass through arbitrary props to their components + * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which + * of these should be passed to the underlying DOM node. + * + * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props + * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props + * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of + * `@emotion/is-prop-valid`, however to fix this problem we need to use it. + * + * By making it an optionalDependency we can offer this functionality only in the situations where it's + * actually required. + */ +try { + /** + * We attempt to import this package but require won't be defined in esm environments, in that case + * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed + * in favour of explicit injection. + */ + loadExternalIsValidProp((__webpack_require__(/*! @emotion/is-prop-valid */ "../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js")["default"])); +} catch (_a) { + // We don't need to actually do anything here - the fallback is the existing `isPropValid`. +} +function filterProps(props, isDom, forwardMotionProps) { + var filteredProps = {}; + for (var key in props) { + if (shouldForward(key) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) || + // If trying to use native HTML drag events, forward drag listeners + props["draggable"] && key.startsWith("onDrag")) { + filteredProps[key] = props[key]; + } + } + return filteredProps; +} +function calcOrigin$1(origin, offset, size) { + return typeof origin === "string" ? origin : styleValueTypes.px.transform(offset + size * origin); +} +/** + * The SVG transform origin defaults are different to CSS and is less intuitive, + * so we use the measured dimensions of the SVG to reconcile these. + */ +function calcSVGTransformOrigin(dimensions, originX, originY) { + var pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width); + var pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height); + return "".concat(pxOriginX, " ").concat(pxOriginY); +} +var dashKeys = { + offset: "stroke-dashoffset", + array: "stroke-dasharray" +}; +var camelKeys = { + offset: "strokeDashoffset", + array: "strokeDasharray" +}; +/** + * Build SVG path properties. Uses the path's measured length to convert + * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset + * and stroke-dasharray attributes. + * + * This function is mutative to reduce per-frame GC. + */ +function buildSVGPath(attrs, length, spacing, offset, useDashCase) { + if (spacing === void 0) { + spacing = 1; + } + if (offset === void 0) { + offset = 0; + } + if (useDashCase === void 0) { + useDashCase = true; + } + // Normalise path length by setting SVG attribute pathLength to 1 + attrs.pathLength = 1; + // We use dash case when setting attributes directly to the DOM node and camel case + // when defining props on a React component. + var keys = useDashCase ? dashKeys : camelKeys; + // Build the dash offset + attrs[keys.offset] = styleValueTypes.px.transform(-offset); + // Build the dash array + var pathLength = styleValueTypes.px.transform(length); + var pathSpacing = styleValueTypes.px.transform(spacing); + attrs[keys.array] = "".concat(pathLength, " ").concat(pathSpacing); +} + +/** + * Build SVG visual attrbutes, like cx and style.transform + */ +function buildSVGAttrs(state, _a, options, transformTemplate) { + var attrX = _a.attrX, + attrY = _a.attrY, + originX = _a.originX, + originY = _a.originY, + pathLength = _a.pathLength, + _b = _a.pathSpacing, + pathSpacing = _b === void 0 ? 1 : _b, + _c = _a.pathOffset, + pathOffset = _c === void 0 ? 0 : _c, + // This is object creation, which we try to avoid per-frame. + latest = tslib.__rest(_a, ["attrX", "attrY", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]); + buildHTMLStyles(state, latest, options, transformTemplate); + state.attrs = state.style; + state.style = {}; + var attrs = state.attrs, + style = state.style, + dimensions = state.dimensions; + /** + * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs + * and copy it into style. + */ + if (attrs.transform) { + if (dimensions) style.transform = attrs.transform; + delete attrs.transform; + } + // Parse transformOrigin + if (dimensions && (originX !== undefined || originY !== undefined || style.transform)) { + style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5); + } + // Treat x/y not as shortcuts but as actual attributes + if (attrX !== undefined) attrs.x = attrX; + if (attrY !== undefined) attrs.y = attrY; + // Build SVG path if one has been defined + if (pathLength !== undefined) { + buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); + } +} +var createSvgRenderState = function () { + return tslib.__assign(tslib.__assign({}, createHtmlRenderState()), { + attrs: {} + }); +}; +function useSVGProps(props, visualState) { + var visualProps = React.useMemo(function () { + var state = createSvgRenderState(); + buildSVGAttrs(state, visualState, { + enableHardwareAcceleration: false + }, props.transformTemplate); + return tslib.__assign(tslib.__assign({}, state.attrs), { + style: tslib.__assign({}, state.style) + }); + }, [visualState]); + if (props.style) { + var rawStyles = {}; + copyRawValuesOnly(rawStyles, props.style, props); + visualProps.style = tslib.__assign(tslib.__assign({}, rawStyles), visualProps.style); + } + return visualProps; +} +function createUseRender(forwardMotionProps) { + if (forwardMotionProps === void 0) { + forwardMotionProps = false; + } + var useRender = function (Component, props, projectionId, ref, _a, isStatic) { + var latestValues = _a.latestValues; + var useVisualProps = isSVGComponent(Component) ? useSVGProps : useHTMLProps; + var visualProps = useVisualProps(props, latestValues, isStatic); + var filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); + var elementProps = tslib.__assign(tslib.__assign(tslib.__assign({}, filteredProps), visualProps), { + ref: ref + }); + if (projectionId) { + elementProps["data-projection-id"] = projectionId; + } + return React.createElement(Component, elementProps); + }; + return useRender; +} +var CAMEL_CASE_PATTERN = /([a-z])([A-Z])/g; +var REPLACE_TEMPLATE = "$1-$2"; +/** + * Convert camelCase to dash-case properties. + */ +var camelToDash = function (str) { + return str.replace(CAMEL_CASE_PATTERN, REPLACE_TEMPLATE).toLowerCase(); +}; +function renderHTML(element, _a, styleProp, projection) { + var style = _a.style, + vars = _a.vars; + Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp)); + // Loop over any CSS variables and assign those. + for (var key in vars) { + element.style.setProperty(key, vars[key]); + } +} + +/** + * A set of attribute names that are always read/written as camel case. + */ +var camelCaseAttributes = new Set(["baseFrequency", "diffuseConstant", "kernelMatrix", "kernelUnitLength", "keySplines", "keyTimes", "limitingConeAngle", "markerHeight", "markerWidth", "numOctaves", "targetX", "targetY", "surfaceScale", "specularConstant", "specularExponent", "stdDeviation", "tableValues", "viewBox", "gradientTransform", "pathLength"]); +function renderSVG(element, renderState, _styleProp, projection) { + renderHTML(element, renderState, undefined, projection); + for (var key in renderState.attrs) { + element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); + } +} +function scrapeMotionValuesFromProps$1(props) { + var style = props.style; + var newValues = {}; + for (var key in style) { + if (isMotionValue(style[key]) || isForcedMotionValue(key, props)) { + newValues[key] = style[key]; + } + } + return newValues; +} +function scrapeMotionValuesFromProps(props) { + var newValues = scrapeMotionValuesFromProps$1(props); + for (var key in props) { + if (isMotionValue(props[key])) { + var targetKey = key === "x" || key === "y" ? "attr" + key.toUpperCase() : key; + newValues[targetKey] = props[key]; + } + } + return newValues; +} +function isAnimationControls(v) { + return typeof v === "object" && typeof v.start === "function"; +} +var isKeyframesTarget = function (v) { + return Array.isArray(v); +}; +var isCustomValue = function (v) { + return Boolean(v && typeof v === "object" && v.mix && v.toValue); +}; +var resolveFinalValueInKeyframes = function (v) { + // TODO maybe throw if v.length - 1 is placeholder token? + return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; +}; + +/** + * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself + * + * TODO: Remove and move to library + */ +function resolveMotionValue(value) { + var unwrappedValue = isMotionValue(value) ? value.get() : value; + return isCustomValue(unwrappedValue) ? unwrappedValue.toValue() : unwrappedValue; +} +function makeState(_a, props, context, presenceContext) { + var scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps, + createRenderState = _a.createRenderState, + onMount = _a.onMount; + var state = { + latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), + renderState: createRenderState() + }; + if (onMount) { + state.mount = function (instance) { + return onMount(props, instance, state); + }; + } + return state; +} +var makeUseVisualState = function (config) { + return function (props, isStatic) { + var context = React.useContext(MotionContext); + var presenceContext = React.useContext(PresenceContext); + return isStatic ? makeState(config, props, context, presenceContext) : useConstant(function () { + return makeState(config, props, context, presenceContext); + }); + }; +}; +function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { + var values = {}; + var blockInitialAnimation = (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false; + var motionValues = scrapeMotionValues(props); + for (var key in motionValues) { + values[key] = resolveMotionValue(motionValues[key]); + } + var initial = props.initial, + animate = props.animate; + var isControllingVariants = checkIfControllingVariants(props); + var isVariantNode = checkIfVariantNode(props); + if (context && isVariantNode && !isControllingVariants && props.inherit !== false) { + initial !== null && initial !== void 0 ? initial : initial = context.initial; + animate !== null && animate !== void 0 ? animate : animate = context.animate; + } + var initialAnimationIsBlocked = blockInitialAnimation || initial === false; + var variantToSet = initialAnimationIsBlocked ? animate : initial; + if (variantToSet && typeof variantToSet !== "boolean" && !isAnimationControls(variantToSet)) { + var list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; + list.forEach(function (definition) { + var resolved = resolveVariantFromProps(props, definition); + if (!resolved) return; + var transitionEnd = resolved.transitionEnd; + resolved.transition; + var target = tslib.__rest(resolved, ["transitionEnd", "transition"]); + for (var key in target) { + var valueTarget = target[key]; + if (Array.isArray(valueTarget)) { + /** + * Take final keyframe if the initial animation is blocked because + * we want to initialise at the end of that blocked animation. + */ + var index = initialAnimationIsBlocked ? valueTarget.length - 1 : 0; + valueTarget = valueTarget[index]; + } + if (valueTarget !== null) { + values[key] = valueTarget; + } + } + for (var key in transitionEnd) values[key] = transitionEnd[key]; + }); + } + return values; +} +var svgMotionConfig = { + useVisualState: makeUseVisualState({ + scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, + createRenderState: createSvgRenderState, + onMount: function (props, instance, _a) { + var renderState = _a.renderState, + latestValues = _a.latestValues; + try { + renderState.dimensions = typeof instance.getBBox === "function" ? instance.getBBox() : instance.getBoundingClientRect(); + } catch (e) { + // Most likely trying to measure an unrendered element under Firefox + renderState.dimensions = { + x: 0, + y: 0, + width: 0, + height: 0 + }; + } + buildSVGAttrs(renderState, latestValues, { + enableHardwareAcceleration: false + }, props.transformTemplate); + renderSVG(instance, renderState); + } + }) +}; +var htmlMotionConfig = { + useVisualState: makeUseVisualState({ + scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1, + createRenderState: createHtmlRenderState + }) +}; +function createDomMotionConfig(Component, _a, preloadedFeatures, createVisualElement, projectionNodeConstructor) { + var _b = _a.forwardMotionProps, + forwardMotionProps = _b === void 0 ? false : _b; + var baseConfig = isSVGComponent(Component) ? svgMotionConfig : htmlMotionConfig; + return tslib.__assign(tslib.__assign({}, baseConfig), { + preloadedFeatures: preloadedFeatures, + useRender: createUseRender(forwardMotionProps), + createVisualElement: createVisualElement, + projectionNodeConstructor: projectionNodeConstructor, + Component: Component + }); +} +exports.AnimationType = void 0; +(function (AnimationType) { + AnimationType["Animate"] = "animate"; + AnimationType["Hover"] = "whileHover"; + AnimationType["Tap"] = "whileTap"; + AnimationType["Drag"] = "whileDrag"; + AnimationType["Focus"] = "whileFocus"; + AnimationType["InView"] = "whileInView"; + AnimationType["Exit"] = "exit"; +})(exports.AnimationType || (exports.AnimationType = {})); +function addDomEvent(target, eventName, handler, options) { + if (options === void 0) { + options = { + passive: true + }; + } + target.addEventListener(eventName, handler, options); + return function () { + return target.removeEventListener(eventName, handler); + }; +} +/** + * Attaches an event listener directly to the provided DOM element. + * + * Bypassing React's event system can be desirable, for instance when attaching non-passive + * event handlers. + * + * ```jsx + * const ref = useRef(null) + * + * useDomEvent(ref, 'wheel', onWheel, { passive: false }) + * + * return
+ * ``` + * + * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. + * @param eventName - Name of the event you want listen for. + * @param handler - Function to fire when receiving the event. + * @param options - Options to pass to `Event.addEventListener`. + * + * @public + */ +function useDomEvent(ref, eventName, handler, options) { + React.useEffect(function () { + var element = ref.current; + if (handler && element) { + return addDomEvent(element, eventName, handler, options); + } + }, [ref, eventName, handler, options]); +} + +/** + * + * @param props + * @param ref + * @internal + */ +function useFocusGesture(_a) { + var whileFocus = _a.whileFocus, + visualElement = _a.visualElement; + var onFocus = function () { + var _a; + (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Focus, true); + }; + var onBlur = function () { + var _a; + (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Focus, false); + }; + useDomEvent(visualElement, "focus", whileFocus ? onFocus : undefined); + useDomEvent(visualElement, "blur", whileFocus ? onBlur : undefined); +} +function isMouseEvent(event) { + // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check. + if (typeof PointerEvent !== "undefined" && event instanceof PointerEvent) { + return !!(event.pointerType === "mouse"); + } + return event instanceof MouseEvent; +} +function isTouchEvent(event) { + var hasTouches = !!event.touches; + return hasTouches; +} + +/** + * Filters out events not attached to the primary pointer (currently left mouse button) + * @param eventHandler + */ +function filterPrimaryPointer(eventHandler) { + return function (event) { + var isMouseEvent = event instanceof MouseEvent; + var isPrimaryPointer = !isMouseEvent || isMouseEvent && event.button === 0; + if (isPrimaryPointer) { + eventHandler(event); + } + }; +} +var defaultPagePoint = { + pageX: 0, + pageY: 0 +}; +function pointFromTouch(e, pointType) { + if (pointType === void 0) { + pointType = "page"; + } + var primaryTouch = e.touches[0] || e.changedTouches[0]; + var point = primaryTouch || defaultPagePoint; + return { + x: point[pointType + "X"], + y: point[pointType + "Y"] + }; +} +function pointFromMouse(point, pointType) { + if (pointType === void 0) { + pointType = "page"; + } + return { + x: point[pointType + "X"], + y: point[pointType + "Y"] + }; +} +function extractEventInfo(event, pointType) { + if (pointType === void 0) { + pointType = "page"; + } + return { + point: isTouchEvent(event) ? pointFromTouch(event, pointType) : pointFromMouse(event, pointType) + }; +} +var wrapHandler = function (handler, shouldFilterPrimaryPointer) { + if (shouldFilterPrimaryPointer === void 0) { + shouldFilterPrimaryPointer = false; + } + var listener = function (event) { + return handler(event, extractEventInfo(event)); + }; + return shouldFilterPrimaryPointer ? filterPrimaryPointer(listener) : listener; +}; + +// We check for event support via functions in case they've been mocked by a testing suite. +var supportsPointerEvents = function () { + return isBrowser && window.onpointerdown === null; +}; +var supportsTouchEvents = function () { + return isBrowser && window.ontouchstart === null; +}; +var supportsMouseEvents = function () { + return isBrowser && window.onmousedown === null; +}; +var mouseEventNames = { + pointerdown: "mousedown", + pointermove: "mousemove", + pointerup: "mouseup", + pointercancel: "mousecancel", + pointerover: "mouseover", + pointerout: "mouseout", + pointerenter: "mouseenter", + pointerleave: "mouseleave" +}; +var touchEventNames = { + pointerdown: "touchstart", + pointermove: "touchmove", + pointerup: "touchend", + pointercancel: "touchcancel" +}; +function getPointerEventName(name) { + if (supportsPointerEvents()) { + return name; + } else if (supportsTouchEvents()) { + return touchEventNames[name]; + } else if (supportsMouseEvents()) { + return mouseEventNames[name]; + } + return name; +} +function addPointerEvent(target, eventName, handler, options) { + return addDomEvent(target, getPointerEventName(eventName), wrapHandler(handler, eventName === "pointerdown"), options); +} +function usePointerEvent(ref, eventName, handler, options) { + return useDomEvent(ref, getPointerEventName(eventName), handler && wrapHandler(handler, eventName === "pointerdown"), options); +} +function createLock(name) { + var lock = null; + return function () { + var openLock = function () { + lock = null; + }; + if (lock === null) { + lock = name; + return openLock; + } + return false; + }; +} +var globalHorizontalLock = createLock("dragHorizontal"); +var globalVerticalLock = createLock("dragVertical"); +function getGlobalLock(drag) { + var lock = false; + if (drag === "y") { + lock = globalVerticalLock(); + } else if (drag === "x") { + lock = globalHorizontalLock(); + } else { + var openHorizontal_1 = globalHorizontalLock(); + var openVertical_1 = globalVerticalLock(); + if (openHorizontal_1 && openVertical_1) { + lock = function () { + openHorizontal_1(); + openVertical_1(); + }; + } else { + // Release the locks because we don't use them + if (openHorizontal_1) openHorizontal_1(); + if (openVertical_1) openVertical_1(); + } + } + return lock; +} +function isDragActive() { + // Check the gesture lock - if we get it, it means no drag gesture is active + // and we can safely fire the tap gesture. + var openGestureLock = getGlobalLock(true); + if (!openGestureLock) return true; + openGestureLock(); + return false; +} +function createHoverEvent(visualElement, isActive, callback) { + return function (event, info) { + var _a; + if (!isMouseEvent(event) || isDragActive()) return; + /** + * Ensure we trigger animations before firing event callback + */ + (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Hover, isActive); + callback === null || callback === void 0 ? void 0 : callback(event, info); + }; +} +function useHoverGesture(_a) { + var onHoverStart = _a.onHoverStart, + onHoverEnd = _a.onHoverEnd, + whileHover = _a.whileHover, + visualElement = _a.visualElement; + usePointerEvent(visualElement, "pointerenter", onHoverStart || whileHover ? createHoverEvent(visualElement, true, onHoverStart) : undefined, { + passive: !onHoverStart + }); + usePointerEvent(visualElement, "pointerleave", onHoverEnd || whileHover ? createHoverEvent(visualElement, false, onHoverEnd) : undefined, { + passive: !onHoverEnd + }); +} + +/** + * Recursively traverse up the tree to check whether the provided child node + * is the parent or a descendant of it. + * + * @param parent - Element to find + * @param child - Element to test against parent + */ +var isNodeOrChild = function (parent, child) { + if (!child) { + return false; + } else if (parent === child) { + return true; + } else { + return isNodeOrChild(parent, child.parentElement); + } +}; +function useUnmountEffect(callback) { + return React.useEffect(function () { + return function () { + return callback(); + }; + }, []); +} + +/** + * @param handlers - + * @internal + */ +function useTapGesture(_a) { + var onTap = _a.onTap, + onTapStart = _a.onTapStart, + onTapCancel = _a.onTapCancel, + whileTap = _a.whileTap, + visualElement = _a.visualElement; + var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap; + var isPressing = React.useRef(false); + var cancelPointerEndListeners = React.useRef(null); + /** + * Only set listener to passive if there are no external listeners. + */ + var eventOptions = { + passive: !(onTapStart || onTap || onTapCancel || onPointerDown) + }; + function removePointerEndListener() { + var _a; + (_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners); + cancelPointerEndListeners.current = null; + } + function checkPointerEnd() { + var _a; + removePointerEndListener(); + isPressing.current = false; + (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Tap, false); + return !isDragActive(); + } + function onPointerUp(event, info) { + if (!checkPointerEnd()) return; + /** + * We only count this as a tap gesture if the event.target is the same + * as, or a child of, this component's element + */ + !isNodeOrChild(visualElement.getInstance(), event.target) ? onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info) : onTap === null || onTap === void 0 ? void 0 : onTap(event, info); + } + function onPointerCancel(event, info) { + if (!checkPointerEnd()) return; + onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info); + } + function onPointerDown(event, info) { + var _a; + removePointerEndListener(); + if (isPressing.current) return; + isPressing.current = true; + cancelPointerEndListeners.current = popmotion.pipe(addPointerEvent(window, "pointerup", onPointerUp, eventOptions), addPointerEvent(window, "pointercancel", onPointerCancel, eventOptions)); + /** + * Ensure we trigger animations before firing event callback + */ + (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Tap, true); + onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info); + } + usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined, eventOptions); + useUnmountEffect(removePointerEndListener); +} +var warned = new Set(); +function warnOnce(condition, message, element) { + if (condition || warned.has(message)) return; + console.warn(message); + if (element) console.warn(element); + warned.add(message); +} + +/** + * Map an IntersectionHandler callback to an element. We only ever make one handler for one + * element, so even though these handlers might all be triggered by different + * observers, we can keep them in the same map. + */ +var observerCallbacks = new WeakMap(); +/** + * Multiple observers can be created for multiple element/document roots. Each with + * different settings. So here we store dictionaries of observers to each root, + * using serialised settings (threshold/margin) as lookup keys. + */ +var observers = new WeakMap(); +var fireObserverCallback = function (entry) { + var _a; + (_a = observerCallbacks.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry); +}; +var fireAllObserverCallbacks = function (entries) { + entries.forEach(fireObserverCallback); +}; +function initIntersectionObserver(_a) { + var root = _a.root, + options = tslib.__rest(_a, ["root"]); + var lookupRoot = root || document; + /** + * If we don't have an observer lookup map for this root, create one. + */ + if (!observers.has(lookupRoot)) { + observers.set(lookupRoot, {}); + } + var rootObservers = observers.get(lookupRoot); + var key = JSON.stringify(options); + /** + * If we don't have an observer for this combination of root and settings, + * create one. + */ + if (!rootObservers[key]) { + rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, tslib.__assign({ + root: root + }, options)); + } + return rootObservers[key]; +} +function observeIntersection(element, options, callback) { + var rootInteresectionObserver = initIntersectionObserver(options); + observerCallbacks.set(element, callback); + rootInteresectionObserver.observe(element); + return function () { + observerCallbacks.delete(element); + rootInteresectionObserver.unobserve(element); + }; +} +function useViewport(_a) { + var visualElement = _a.visualElement, + whileInView = _a.whileInView, + onViewportEnter = _a.onViewportEnter, + onViewportLeave = _a.onViewportLeave, + _b = _a.viewport, + viewport = _b === void 0 ? {} : _b; + var state = React.useRef({ + hasEnteredView: false, + isInView: false + }); + var shouldObserve = Boolean(whileInView || onViewportEnter || onViewportLeave); + if (viewport.once && state.current.hasEnteredView) shouldObserve = false; + var useObserver = typeof IntersectionObserver === "undefined" ? useMissingIntersectionObserver : useIntersectionObserver; + useObserver(shouldObserve, state.current, visualElement, viewport); +} +var thresholdNames = { + some: 0, + all: 1 +}; +function useIntersectionObserver(shouldObserve, state, visualElement, _a) { + var root = _a.root, + rootMargin = _a.margin, + _b = _a.amount, + amount = _b === void 0 ? "some" : _b, + once = _a.once; + React.useEffect(function () { + if (!shouldObserve) return; + var options = { + root: root === null || root === void 0 ? void 0 : root.current, + rootMargin: rootMargin, + threshold: typeof amount === "number" ? amount : thresholdNames[amount] + }; + var intersectionCallback = function (entry) { + var _a; + var isIntersecting = entry.isIntersecting; + /** + * If there's been no change in the viewport state, early return. + */ + if (state.isInView === isIntersecting) return; + state.isInView = isIntersecting; + /** + * Handle hasEnteredView. If this is only meant to run once, and + * element isn't visible, early return. Otherwise set hasEnteredView to true. + */ + if (once && !isIntersecting && state.hasEnteredView) { + return; + } else if (isIntersecting) { + state.hasEnteredView = true; + } + (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.InView, isIntersecting); + /** + * Use the latest committed props rather than the ones in scope + * when this observer is created + */ + var props = visualElement.getProps(); + var callback = isIntersecting ? props.onViewportEnter : props.onViewportLeave; + callback === null || callback === void 0 ? void 0 : callback(entry); + }; + return observeIntersection(visualElement.getInstance(), options, intersectionCallback); + }, [shouldObserve, root, rootMargin, amount]); +} +/** + * If IntersectionObserver is missing, we activate inView and fire onViewportEnter + * on mount. This way, the page will be in the state the author expects users + * to see it in for everyone. + */ +function useMissingIntersectionObserver(shouldObserve, state, visualElement, _a) { + var _b = _a.fallback, + fallback = _b === void 0 ? true : _b; + React.useEffect(function () { + if (!shouldObserve || !fallback) return; + if (env !== "production") { + warnOnce(false, "IntersectionObserver not available on this device. whileInView animations will trigger on mount."); + } + /** + * Fire this in an rAF because, at this point, the animation state + * won't have flushed for the first time and there's certain logic in + * there that behaves differently on the initial animation. + * + * This hook should be quite rarely called so setting this in an rAF + * is preferred to changing the behaviour of the animation state. + */ + requestAnimationFrame(function () { + var _a; + state.hasEnteredView = true; + var onViewportEnter = visualElement.getProps().onViewportEnter; + onViewportEnter === null || onViewportEnter === void 0 ? void 0 : onViewportEnter(null); + (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.InView, true); + }); + }, [shouldObserve]); +} +var makeRenderlessComponent = function (hook) { + return function (props) { + hook(props); + return null; + }; +}; +var gestureAnimations = { + inView: makeRenderlessComponent(useViewport), + tap: makeRenderlessComponent(useTapGesture), + focus: makeRenderlessComponent(useFocusGesture), + hover: makeRenderlessComponent(useHoverGesture) +}; +var counter = 0; +var incrementId = function () { + return counter++; +}; +var useId = function () { + return useConstant(incrementId); +}; +/** + * Ideally we'd use the following code to support React 18 optionally. + * But this fairly fails in Webpack (otherwise treeshaking wouldn't work at all). + * Need to come up with a different way of figuring this out. + */ +// export const useId = (React as any).useId +// ? (React as any).useId +// : () => useConstant(incrementId) + +/** + * When a component is the child of `AnimatePresence`, it can use `usePresence` + * to access information about whether it's still present in the React tree. + * + * ```jsx + * import { usePresence } from "framer-motion" + * + * export const Component = () => { + * const [isPresent, safeToRemove] = usePresence() + * + * useEffect(() => { + * !isPresent && setTimeout(safeToRemove, 1000) + * }, [isPresent]) + * + * return
+ * } + * ``` + * + * If `isPresent` is `false`, it means that a component has been removed the tree, but + * `AnimatePresence` won't really remove it until `safeToRemove` has been called. + * + * @public + */ +function usePresence() { + var context = React.useContext(PresenceContext); + if (context === null) return [true, null]; + var isPresent = context.isPresent, + onExitComplete = context.onExitComplete, + register = context.register; + // It's safe to call the following hooks conditionally (after an early return) because the context will always + // either be null or non-null for the lifespan of the component. + // Replace with useId when released in React + var id = useId(); + React.useEffect(function () { + return register(id); + }, []); + var safeToRemove = function () { + return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id); + }; + return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; +} +/** + * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. + * There is no `safeToRemove` function. + * + * ```jsx + * import { useIsPresent } from "framer-motion" + * + * export const Component = () => { + * const isPresent = useIsPresent() + * + * useEffect(() => { + * !isPresent && console.log("I've been removed!") + * }, [isPresent]) + * + * return
+ * } + * ``` + * + * @public + */ +function useIsPresent() { + return isPresent(React.useContext(PresenceContext)); +} +function isPresent(context) { + return context === null ? true : context.isPresent; +} +function shallowCompare(next, prev) { + if (!Array.isArray(prev)) return false; + var prevLength = prev.length; + if (prevLength !== next.length) return false; + for (var i = 0; i < prevLength; i++) { + if (prev[i] !== next[i]) return false; + } + return true; +} + +/** + * Converts seconds to milliseconds + * + * @param seconds - Time in seconds. + * @return milliseconds - Converted time in milliseconds. + */ +var secondsToMilliseconds = function (seconds) { + return seconds * 1000; +}; +var easingLookup = { + linear: popmotion.linear, + easeIn: popmotion.easeIn, + easeInOut: popmotion.easeInOut, + easeOut: popmotion.easeOut, + circIn: popmotion.circIn, + circInOut: popmotion.circInOut, + circOut: popmotion.circOut, + backIn: popmotion.backIn, + backInOut: popmotion.backInOut, + backOut: popmotion.backOut, + anticipate: popmotion.anticipate, + bounceIn: popmotion.bounceIn, + bounceInOut: popmotion.bounceInOut, + bounceOut: popmotion.bounceOut +}; +var easingDefinitionToFunction = function (definition) { + if (Array.isArray(definition)) { + // If cubic bezier definition, create bezier curve + heyListen.invariant(definition.length === 4, "Cubic bezier arrays must contain four numerical values."); + var _a = tslib.__read(definition, 4), + x1 = _a[0], + y1 = _a[1], + x2 = _a[2], + y2 = _a[3]; + return popmotion.cubicBezier(x1, y1, x2, y2); + } else if (typeof definition === "string") { + // Else lookup from table + heyListen.invariant(easingLookup[definition] !== undefined, "Invalid easing type '".concat(definition, "'")); + return easingLookup[definition]; + } + return definition; +}; +var isEasingArray = function (ease) { + return Array.isArray(ease) && typeof ease[0] !== "number"; +}; + +/** + * Check if a value is animatable. Examples: + * + * ✅: 100, "100px", "#fff" + * ❌: "block", "url(2.jpg)" + * @param value + * + * @internal + */ +var isAnimatable = function (key, value) { + // If the list of keys tat might be non-animatable grows, replace with Set + if (key === "zIndex") return false; + // If it's a number or a keyframes array, we can animate it. We might at some point + // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, + // but for now lets leave it like this for performance reasons + if (typeof value === "number" || Array.isArray(value)) return true; + if (typeof value === "string" && + // It's animatable if we have a string + styleValueTypes.complex.test(value) && + // And it contains numbers and/or colors + !value.startsWith("url(") // Unless it starts with "url(" + ) { + return true; + } + return false; +}; +var underDampedSpring = function () { + return { + type: "spring", + stiffness: 500, + damping: 25, + restSpeed: 10 + }; +}; +var criticallyDampedSpring = function (to) { + return { + type: "spring", + stiffness: 550, + damping: to === 0 ? 2 * Math.sqrt(550) : 30, + restSpeed: 10 + }; +}; +var linearTween = function () { + return { + type: "keyframes", + ease: "linear", + duration: 0.3 + }; +}; +var keyframes = function (values) { + return { + type: "keyframes", + duration: 0.8, + values: values + }; +}; +var defaultTransitions = { + x: underDampedSpring, + y: underDampedSpring, + z: underDampedSpring, + rotate: underDampedSpring, + rotateX: underDampedSpring, + rotateY: underDampedSpring, + rotateZ: underDampedSpring, + scaleX: criticallyDampedSpring, + scaleY: criticallyDampedSpring, + scale: criticallyDampedSpring, + opacity: linearTween, + backgroundColor: linearTween, + color: linearTween, + default: criticallyDampedSpring +}; +var getDefaultTransition = function (valueKey, to) { + var transitionFactory; + if (isKeyframesTarget(to)) { + transitionFactory = keyframes; + } else { + transitionFactory = defaultTransitions[valueKey] || defaultTransitions.default; + } + return tslib.__assign({ + to: to + }, transitionFactory(to)); +}; + +/** + * A map of default value types for common values + */ +var defaultValueTypes = tslib.__assign(tslib.__assign({}, numberValueTypes), { + // Color props + color: styleValueTypes.color, + backgroundColor: styleValueTypes.color, + outlineColor: styleValueTypes.color, + fill: styleValueTypes.color, + stroke: styleValueTypes.color, + // Border props + borderColor: styleValueTypes.color, + borderTopColor: styleValueTypes.color, + borderRightColor: styleValueTypes.color, + borderBottomColor: styleValueTypes.color, + borderLeftColor: styleValueTypes.color, + filter: styleValueTypes.filter, + WebkitFilter: styleValueTypes.filter +}); +/** + * Gets the default ValueType for the provided value key + */ +var getDefaultValueType = function (key) { + return defaultValueTypes[key]; +}; +function getAnimatableNone(key, value) { + var _a; + var defaultValueType = getDefaultValueType(key); + if (defaultValueType !== styleValueTypes.filter) defaultValueType = styleValueTypes.complex; + // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target + return (_a = defaultValueType.getAnimatableNone) === null || _a === void 0 ? void 0 : _a.call(defaultValueType, value); +} +var instantAnimationState = { + current: false +}; + +/** + * Decide whether a transition is defined on a given Transition. + * This filters out orchestration options and returns true + * if any options are left. + */ +function isTransitionDefined(_a) { + _a.when; + _a.delay; + _a.delayChildren; + _a.staggerChildren; + _a.staggerDirection; + _a.repeat; + _a.repeatType; + _a.repeatDelay; + _a.from; + var transition = tslib.__rest(_a, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from"]); + return !!Object.keys(transition).length; +} +var legacyRepeatWarning = false; +/** + * Convert Framer Motion's Transition type into Popmotion-compatible options. + */ +function convertTransitionToAnimationOptions(_a) { + var ease = _a.ease, + times = _a.times, + yoyo = _a.yoyo, + flip = _a.flip, + loop = _a.loop, + transition = tslib.__rest(_a, ["ease", "times", "yoyo", "flip", "loop"]); + var options = tslib.__assign({}, transition); + if (times) options["offset"] = times; + /** + * Convert any existing durations from seconds to milliseconds + */ + if (transition.duration) options["duration"] = secondsToMilliseconds(transition.duration); + if (transition.repeatDelay) options.repeatDelay = secondsToMilliseconds(transition.repeatDelay); + /** + * Map easing names to Popmotion's easing functions + */ + if (ease) { + options["ease"] = isEasingArray(ease) ? ease.map(easingDefinitionToFunction) : easingDefinitionToFunction(ease); + } + /** + * Support legacy transition API + */ + if (transition.type === "tween") options.type = "keyframes"; + /** + * TODO: These options are officially removed from the API. + */ + if (yoyo || loop || flip) { + heyListen.warning(!legacyRepeatWarning, "yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."); + legacyRepeatWarning = true; + if (yoyo) { + options.repeatType = "reverse"; + } else if (loop) { + options.repeatType = "loop"; + } else if (flip) { + options.repeatType = "mirror"; + } + options.repeat = loop || yoyo || flip || transition.repeat; + } + /** + * TODO: Popmotion 9 has the ability to automatically detect whether to use + * a keyframes or spring animation, but does so by detecting velocity and other spring options. + * It'd be good to introduce a similar thing here. + */ + if (transition.type !== "spring") options.type = "keyframes"; + return options; +} +/** + * Get the delay for a value by checking Transition with decreasing specificity. + */ +function getDelayFromTransition(transition, key) { + var _a, _b; + var valueTransition = getValueTransition(transition, key) || {}; + return (_b = (_a = valueTransition.delay) !== null && _a !== void 0 ? _a : transition.delay) !== null && _b !== void 0 ? _b : 0; +} +function hydrateKeyframes(options) { + if (Array.isArray(options.to) && options.to[0] === null) { + options.to = tslib.__spreadArray([], tslib.__read(options.to), false); + options.to[0] = options.from; + } + return options; +} +function getPopmotionAnimationOptions(transition, options, key) { + var _a; + if (Array.isArray(options.to)) { + (_a = transition.duration) !== null && _a !== void 0 ? _a : transition.duration = 0.8; + } + hydrateKeyframes(options); + /** + * Get a default transition if none is determined to be defined. + */ + if (!isTransitionDefined(transition)) { + transition = tslib.__assign(tslib.__assign({}, transition), getDefaultTransition(key, options.to)); + } + return tslib.__assign(tslib.__assign({}, options), convertTransitionToAnimationOptions(transition)); +} +/** + * + */ +function getAnimation(key, value, target, transition, onComplete) { + var _a; + var valueTransition = getValueTransition(transition, key); + var origin = (_a = valueTransition.from) !== null && _a !== void 0 ? _a : value.get(); + var isTargetAnimatable = isAnimatable(key, target); + if (origin === "none" && isTargetAnimatable && typeof target === "string") { + /** + * If we're trying to animate from "none", try and get an animatable version + * of the target. This could be improved to work both ways. + */ + origin = getAnimatableNone(key, target); + } else if (isZero(origin) && typeof target === "string") { + origin = getZeroUnit(target); + } else if (!Array.isArray(target) && isZero(target) && typeof origin === "string") { + target = getZeroUnit(origin); + } + var isOriginAnimatable = isAnimatable(key, origin); + heyListen.warning(isOriginAnimatable === isTargetAnimatable, "You are trying to animate ".concat(key, " from \"").concat(origin, "\" to \"").concat(target, "\". ").concat(origin, " is not an animatable value - to enable this animation set ").concat(origin, " to a value animatable to ").concat(target, " via the `style` property.")); + function start() { + var options = { + from: origin, + to: target, + velocity: value.getVelocity(), + onComplete: onComplete, + onUpdate: function (v) { + return value.set(v); + } + }; + return valueTransition.type === "inertia" || valueTransition.type === "decay" ? popmotion.inertia(tslib.__assign(tslib.__assign({}, options), valueTransition)) : popmotion.animate(tslib.__assign(tslib.__assign({}, getPopmotionAnimationOptions(valueTransition, options, key)), { + onUpdate: function (v) { + var _a; + options.onUpdate(v); + (_a = valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, v); + }, + onComplete: function () { + var _a; + options.onComplete(); + (_a = valueTransition.onComplete) === null || _a === void 0 ? void 0 : _a.call(valueTransition); + } + })); + } + function set() { + var _a, _b; + var finalTarget = resolveFinalValueInKeyframes(target); + value.set(finalTarget); + onComplete(); + (_a = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, finalTarget); + (_b = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onComplete) === null || _b === void 0 ? void 0 : _b.call(valueTransition); + return { + stop: function () {} + }; + } + return !isOriginAnimatable || !isTargetAnimatable || valueTransition.type === false ? set : start; +} +function isZero(value) { + return value === 0 || typeof value === "string" && parseFloat(value) === 0 && value.indexOf(" ") === -1; +} +function getZeroUnit(potentialUnitType) { + return typeof potentialUnitType === "number" ? 0 : getAnimatableNone("", potentialUnitType); +} +function getValueTransition(transition, key) { + return transition[key] || transition["default"] || transition; +} +/** + * Start animation on a MotionValue. This function is an interface between + * Framer Motion and Popmotion + */ +function startAnimation(key, value, target, transition) { + if (transition === void 0) { + transition = {}; + } + if (instantAnimationState.current) { + transition = { + type: false + }; + } + return value.start(function (onComplete) { + var delayTimer; + var controls; + var animation = getAnimation(key, value, target, transition, onComplete); + var delay = getDelayFromTransition(transition, key); + var start = function () { + return controls = animation(); + }; + if (delay) { + delayTimer = window.setTimeout(start, secondsToMilliseconds(delay)); + } else { + start(); + } + return function () { + clearTimeout(delayTimer); + controls === null || controls === void 0 ? void 0 : controls.stop(); + }; + }); +} + +/** + * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" + */ +var isNumericalString = function (v) { + return /^\-?\d*\.?\d+$/.test(v); +}; + +/** + * Check if the value is a zero value string like "0px" or "0%" + */ +var isZeroValueString = function (v) { + return /^0[^.\s]+$/.test(v); +}; +function addUniqueItem(arr, item) { + arr.indexOf(item) === -1 && arr.push(item); +} +function removeItem(arr, item) { + var index = arr.indexOf(item); + index > -1 && arr.splice(index, 1); +} +// Adapted from array-move +function moveItem(_a, fromIndex, toIndex) { + var _b = tslib.__read(_a), + arr = _b.slice(0); + var startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; + if (startIndex >= 0 && startIndex < arr.length) { + var endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; + var _c = tslib.__read(arr.splice(fromIndex, 1), 1), + item = _c[0]; + arr.splice(endIndex, 0, item); + } + return arr; +} +var SubscriptionManager = /** @class */function () { + function SubscriptionManager() { + this.subscriptions = []; + } + SubscriptionManager.prototype.add = function (handler) { + var _this = this; + addUniqueItem(this.subscriptions, handler); + return function () { + return removeItem(_this.subscriptions, handler); + }; + }; + SubscriptionManager.prototype.notify = function (a, b, c) { + var numSubscriptions = this.subscriptions.length; + if (!numSubscriptions) return; + if (numSubscriptions === 1) { + /** + * If there's only a single handler we can just call it without invoking a loop. + */ + this.subscriptions[0](a, b, c); + } else { + for (var i = 0; i < numSubscriptions; i++) { + /** + * Check whether the handler exists before firing as it's possible + * the subscriptions were modified during this loop running. + */ + var handler = this.subscriptions[i]; + handler && handler(a, b, c); + } + } + }; + SubscriptionManager.prototype.getSize = function () { + return this.subscriptions.length; + }; + SubscriptionManager.prototype.clear = function () { + this.subscriptions.length = 0; + }; + return SubscriptionManager; +}(); +var isFloat = function (value) { + return !isNaN(parseFloat(value)); +}; +/** + * `MotionValue` is used to track the state and velocity of motion values. + * + * @public + */ +var MotionValue = /** @class */function () { + /** + * @param init - The initiating value + * @param config - Optional configuration options + * + * - `transformer`: A function to transform incoming values with. + * + * @internal + */ + function MotionValue(init) { + var _this = this; + /** + * This will be replaced by the build step with the latest version number. + * When MotionValues are provided to motion components, warn if versions are mixed. + */ + this.version = "6.5.1"; + /** + * Duration, in milliseconds, since last updating frame. + * + * @internal + */ + this.timeDelta = 0; + /** + * Timestamp of the last time this `MotionValue` was updated. + * + * @internal + */ + this.lastUpdated = 0; + /** + * Functions to notify when the `MotionValue` updates. + * + * @internal + */ + this.updateSubscribers = new SubscriptionManager(); + /** + * Functions to notify when the velocity updates. + * + * @internal + */ + this.velocityUpdateSubscribers = new SubscriptionManager(); + /** + * Functions to notify when the `MotionValue` updates and `render` is set to `true`. + * + * @internal + */ + this.renderSubscribers = new SubscriptionManager(); + /** + * Tracks whether this value can output a velocity. Currently this is only true + * if the value is numerical, but we might be able to widen the scope here and support + * other value types. + * + * @internal + */ + this.canTrackVelocity = false; + this.updateAndNotify = function (v, render) { + if (render === void 0) { + render = true; + } + _this.prev = _this.current; + _this.current = v; + // Update timestamp + var _a = sync.getFrameData(), + delta = _a.delta, + timestamp = _a.timestamp; + if (_this.lastUpdated !== timestamp) { + _this.timeDelta = delta; + _this.lastUpdated = timestamp; + sync__default["default"].postRender(_this.scheduleVelocityCheck); + } + // Update update subscribers + if (_this.prev !== _this.current) { + _this.updateSubscribers.notify(_this.current); + } + // Update velocity subscribers + if (_this.velocityUpdateSubscribers.getSize()) { + _this.velocityUpdateSubscribers.notify(_this.getVelocity()); + } + // Update render subscribers + if (render) { + _this.renderSubscribers.notify(_this.current); + } + }; + /** + * Schedule a velocity check for the next frame. + * + * This is an instanced and bound function to prevent generating a new + * function once per frame. + * + * @internal + */ + this.scheduleVelocityCheck = function () { + return sync__default["default"].postRender(_this.velocityCheck); + }; + /** + * Updates `prev` with `current` if the value hasn't been updated this frame. + * This ensures velocity calculations return `0`. + * + * This is an instanced and bound function to prevent generating a new + * function once per frame. + * + * @internal + */ + this.velocityCheck = function (_a) { + var timestamp = _a.timestamp; + if (timestamp !== _this.lastUpdated) { + _this.prev = _this.current; + _this.velocityUpdateSubscribers.notify(_this.getVelocity()); + } + }; + this.hasAnimated = false; + this.prev = this.current = init; + this.canTrackVelocity = isFloat(this.current); + } + /** + * Adds a function that will be notified when the `MotionValue` is updated. + * + * It returns a function that, when called, will cancel the subscription. + * + * When calling `onChange` inside a React component, it should be wrapped with the + * `useEffect` hook. As it returns an unsubscribe function, this should be returned + * from the `useEffect` function to ensure you don't add duplicate subscribers.. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const opacity = useMotionValue(1) + * + * useEffect(() => { + * function updateOpacity() { + * const maxXY = Math.max(x.get(), y.get()) + * const newOpacity = transform(maxXY, [0, 100], [1, 0]) + * opacity.set(newOpacity) + * } + * + * const unsubscribeX = x.onChange(updateOpacity) + * const unsubscribeY = y.onChange(updateOpacity) + * + * return () => { + * unsubscribeX() + * unsubscribeY() + * } + * }, []) + * + * return + * } + * ``` + * + * @privateRemarks + * + * We could look into a `useOnChange` hook if the above lifecycle management proves confusing. + * + * ```jsx + * useOnChange(x, () => {}) + * ``` + * + * @param subscriber - A function that receives the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @public + */ + MotionValue.prototype.onChange = function (subscription) { + return this.updateSubscribers.add(subscription); + }; + MotionValue.prototype.clearListeners = function () { + this.updateSubscribers.clear(); + }; + /** + * Adds a function that will be notified when the `MotionValue` requests a render. + * + * @param subscriber - A function that's provided the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @internal + */ + MotionValue.prototype.onRenderRequest = function (subscription) { + // Render immediately + subscription(this.get()); + return this.renderSubscribers.add(subscription); + }; + /** + * Attaches a passive effect to the `MotionValue`. + * + * @internal + */ + MotionValue.prototype.attach = function (passiveEffect) { + this.passiveEffect = passiveEffect; + }; + /** + * Sets the state of the `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useMotionValue(0) + * x.set(10) + * ``` + * + * @param latest - Latest value to set. + * @param render - Whether to notify render subscribers. Defaults to `true` + * + * @public + */ + MotionValue.prototype.set = function (v, render) { + if (render === void 0) { + render = true; + } + if (!render || !this.passiveEffect) { + this.updateAndNotify(v, render); + } else { + this.passiveEffect(v, this.updateAndNotify); + } + }; + /** + * Returns the latest state of `MotionValue` + * + * @returns - The latest state of `MotionValue` + * + * @public + */ + MotionValue.prototype.get = function () { + return this.current; + }; + /** + * @public + */ + MotionValue.prototype.getPrevious = function () { + return this.prev; + }; + /** + * Returns the latest velocity of `MotionValue` + * + * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. + * + * @public + */ + MotionValue.prototype.getVelocity = function () { + // This could be isFloat(this.prev) && isFloat(this.current), but that would be wasteful + return this.canTrackVelocity ? + // These casts could be avoided if parseFloat would be typed better + popmotion.velocityPerSecond(parseFloat(this.current) - parseFloat(this.prev), this.timeDelta) : 0; + }; + /** + * Registers a new animation to control this `MotionValue`. Only one + * animation can drive a `MotionValue` at one time. + * + * ```jsx + * value.start() + * ``` + * + * @param animation - A function that starts the provided animation + * + * @internal + */ + MotionValue.prototype.start = function (animation) { + var _this = this; + this.stop(); + return new Promise(function (resolve) { + _this.hasAnimated = true; + _this.stopAnimation = animation(resolve); + }).then(function () { + return _this.clearAnimation(); + }); + }; + /** + * Stop the currently active animation. + * + * @public + */ + MotionValue.prototype.stop = function () { + if (this.stopAnimation) this.stopAnimation(); + this.clearAnimation(); + }; + /** + * Returns `true` if this value is currently animating. + * + * @public + */ + MotionValue.prototype.isAnimating = function () { + return !!this.stopAnimation; + }; + MotionValue.prototype.clearAnimation = function () { + this.stopAnimation = null; + }; + /** + * Destroy and clean up subscribers to this `MotionValue`. + * + * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically + * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually + * created a `MotionValue` via the `motionValue` function. + * + * @public + */ + MotionValue.prototype.destroy = function () { + this.updateSubscribers.clear(); + this.renderSubscribers.clear(); + this.stop(); + }; + return MotionValue; +}(); +function motionValue(init) { + return new MotionValue(init); +} + +/** + * Tests a provided value against a ValueType + */ +var testValueType = function (v) { + return function (type) { + return type.test(v); + }; +}; + +/** + * ValueType for "auto" + */ +var auto = { + test: function (v) { + return v === "auto"; + }, + parse: function (v) { + return v; + } +}; + +/** + * A list of value types commonly used for dimensions + */ +var dimensionValueTypes = [styleValueTypes.number, styleValueTypes.px, styleValueTypes.percent, styleValueTypes.degrees, styleValueTypes.vw, styleValueTypes.vh, auto]; +/** + * Tests a dimensional value against the list of dimension ValueTypes + */ +var findDimensionValueType = function (v) { + return dimensionValueTypes.find(testValueType(v)); +}; + +/** + * A list of all ValueTypes + */ +var valueTypes = tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(dimensionValueTypes), false), [styleValueTypes.color, styleValueTypes.complex], false); +/** + * Tests a value against the list of ValueTypes + */ +var findValueType = function (v) { + return valueTypes.find(testValueType(v)); +}; + +/** + * Set VisualElement's MotionValue, creating a new MotionValue for it if + * it doesn't exist. + */ +function setMotionValue(visualElement, key, value) { + if (visualElement.hasValue(key)) { + visualElement.getValue(key).set(value); + } else { + visualElement.addValue(key, motionValue(value)); + } +} +function setTarget(visualElement, definition) { + var resolved = resolveVariant(visualElement, definition); + var _a = resolved ? visualElement.makeTargetAnimatable(resolved, false) : {}, + _b = _a.transitionEnd, + transitionEnd = _b === void 0 ? {} : _b; + _a.transition; + var target = tslib.__rest(_a, ["transitionEnd", "transition"]); + target = tslib.__assign(tslib.__assign({}, target), transitionEnd); + for (var key in target) { + var value = resolveFinalValueInKeyframes(target[key]); + setMotionValue(visualElement, key, value); + } +} +function setVariants(visualElement, variantLabels) { + var reversedLabels = tslib.__spreadArray([], tslib.__read(variantLabels), false).reverse(); + reversedLabels.forEach(function (key) { + var _a; + var variant = visualElement.getVariant(key); + variant && setTarget(visualElement, variant); + (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { + setVariants(child, variantLabels); + }); + }); +} +function setValues(visualElement, definition) { + if (Array.isArray(definition)) { + return setVariants(visualElement, definition); + } else if (typeof definition === "string") { + return setVariants(visualElement, [definition]); + } else { + setTarget(visualElement, definition); + } +} +function checkTargetForNewValues(visualElement, target, origin) { + var _a, _b, _c; + var _d; + var newValueKeys = Object.keys(target).filter(function (key) { + return !visualElement.hasValue(key); + }); + var numNewValues = newValueKeys.length; + if (!numNewValues) return; + for (var i = 0; i < numNewValues; i++) { + var key = newValueKeys[i]; + var targetValue = target[key]; + var value = null; + /** + * If the target is a series of keyframes, we can use the first value + * in the array. If this first value is null, we'll still need to read from the DOM. + */ + if (Array.isArray(targetValue)) { + value = targetValue[0]; + } + /** + * If the target isn't keyframes, or the first keyframe was null, we need to + * first check if an origin value was explicitly defined in the transition as "from", + * if not read the value from the DOM. As an absolute fallback, take the defined target value. + */ + if (value === null) { + value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key]; + } + /** + * If value is still undefined or null, ignore it. Preferably this would throw, + * but this was causing issues in Framer. + */ + if (value === undefined || value === null) continue; + if (typeof value === "string" && (isNumericalString(value) || isZeroValueString(value))) { + // If this is a number read as a string, ie "0" or "200", convert it to a number + value = parseFloat(value); + } else if (!findValueType(value) && styleValueTypes.complex.test(targetValue)) { + value = getAnimatableNone(key, targetValue); + } + visualElement.addValue(key, motionValue(value)); + (_c = (_d = origin)[key]) !== null && _c !== void 0 ? _c : _d[key] = value; + visualElement.setBaseTarget(key, value); + } +} +function getOriginFromTransition(key, transition) { + if (!transition) return; + var valueTransition = transition[key] || transition["default"] || transition; + return valueTransition.from; +} +function getOrigin(target, transition, visualElement) { + var _a, _b; + var origin = {}; + for (var key in target) { + origin[key] = (_a = getOriginFromTransition(key, transition)) !== null && _a !== void 0 ? _a : (_b = visualElement.getValue(key)) === null || _b === void 0 ? void 0 : _b.get(); + } + return origin; +} +function animateVisualElement(visualElement, definition, options) { + if (options === void 0) { + options = {}; + } + visualElement.notifyAnimationStart(definition); + var animation; + if (Array.isArray(definition)) { + var animations = definition.map(function (variant) { + return animateVariant(visualElement, variant, options); + }); + animation = Promise.all(animations); + } else if (typeof definition === "string") { + animation = animateVariant(visualElement, definition, options); + } else { + var resolvedDefinition = typeof definition === "function" ? resolveVariant(visualElement, definition, options.custom) : definition; + animation = animateTarget(visualElement, resolvedDefinition, options); + } + return animation.then(function () { + return visualElement.notifyAnimationComplete(definition); + }); +} +function animateVariant(visualElement, variant, options) { + var _a; + if (options === void 0) { + options = {}; + } + var resolved = resolveVariant(visualElement, variant, options.custom); + var _b = (resolved || {}).transition, + transition = _b === void 0 ? visualElement.getDefaultTransition() || {} : _b; + if (options.transitionOverride) { + transition = options.transitionOverride; + } + /** + * If we have a variant, create a callback that runs it as an animation. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + var getAnimation = resolved ? function () { + return animateTarget(visualElement, resolved, options); + } : function () { + return Promise.resolve(); + }; + /** + * If we have children, create a callback that runs all their animations. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + var getChildAnimations = ((_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.size) ? function (forwardDelay) { + if (forwardDelay === void 0) { + forwardDelay = 0; + } + var _a = transition.delayChildren, + delayChildren = _a === void 0 ? 0 : _a, + staggerChildren = transition.staggerChildren, + staggerDirection = transition.staggerDirection; + return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options); + } : function () { + return Promise.resolve(); + }; + /** + * If the transition explicitly defines a "when" option, we need to resolve either + * this animation or all children animations before playing the other. + */ + var when = transition.when; + if (when) { + var _c = tslib.__read(when === "beforeChildren" ? [getAnimation, getChildAnimations] : [getChildAnimations, getAnimation], 2), + first = _c[0], + last = _c[1]; + return first().then(last); + } else { + return Promise.all([getAnimation(), getChildAnimations(options.delay)]); + } +} +/** + * @internal + */ +function animateTarget(visualElement, definition, _a) { + var _b; + var _c = _a === void 0 ? {} : _a, + _d = _c.delay, + delay = _d === void 0 ? 0 : _d, + transitionOverride = _c.transitionOverride, + type = _c.type; + var _e = visualElement.makeTargetAnimatable(definition), + _f = _e.transition, + transition = _f === void 0 ? visualElement.getDefaultTransition() : _f, + transitionEnd = _e.transitionEnd, + target = tslib.__rest(_e, ["transition", "transitionEnd"]); + if (transitionOverride) transition = transitionOverride; + var animations = []; + var animationTypeState = type && ((_b = visualElement.animationState) === null || _b === void 0 ? void 0 : _b.getState()[type]); + for (var key in target) { + var value = visualElement.getValue(key); + var valueTarget = target[key]; + if (!value || valueTarget === undefined || animationTypeState && shouldBlockAnimation(animationTypeState, key)) { + continue; + } + var valueTransition = tslib.__assign({ + delay: delay + }, transition); + /** + * Make animation instant if this is a transform prop and we should reduce motion. + */ + if (visualElement.shouldReduceMotion && isTransformProp(key)) { + valueTransition = tslib.__assign(tslib.__assign({}, valueTransition), { + type: false, + delay: 0 + }); + } + var animation = startAnimation(key, value, valueTarget, valueTransition); + animations.push(animation); + } + return Promise.all(animations).then(function () { + transitionEnd && setTarget(visualElement, transitionEnd); + }); +} +function animateChildren(visualElement, variant, delayChildren, staggerChildren, staggerDirection, options) { + if (delayChildren === void 0) { + delayChildren = 0; + } + if (staggerChildren === void 0) { + staggerChildren = 0; + } + if (staggerDirection === void 0) { + staggerDirection = 1; + } + var animations = []; + var maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren; + var generateStaggerDuration = staggerDirection === 1 ? function (i) { + if (i === void 0) { + i = 0; + } + return i * staggerChildren; + } : function (i) { + if (i === void 0) { + i = 0; + } + return maxStaggerDuration - i * staggerChildren; + }; + Array.from(visualElement.variantChildren).sort(sortByTreeOrder).forEach(function (child, i) { + animations.push(animateVariant(child, variant, tslib.__assign(tslib.__assign({}, options), { + delay: delayChildren + generateStaggerDuration(i) + })).then(function () { + return child.notifyAnimationComplete(variant); + })); + }); + return Promise.all(animations); +} +function stopAnimation(visualElement) { + visualElement.forEachValue(function (value) { + return value.stop(); + }); +} +function sortByTreeOrder(a, b) { + return a.sortNodePosition(b); +} +/** + * Decide whether we should block this animation. Previously, we achieved this + * just by checking whether the key was listed in protectedKeys, but this + * posed problems if an animation was triggered by afterChildren and protectedKeys + * had been set to true in the meantime. + */ +function shouldBlockAnimation(_a, key) { + var protectedKeys = _a.protectedKeys, + needsAnimating = _a.needsAnimating; + var shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; + needsAnimating[key] = false; + return shouldBlock; +} +var variantPriorityOrder = [exports.AnimationType.Animate, exports.AnimationType.InView, exports.AnimationType.Focus, exports.AnimationType.Hover, exports.AnimationType.Tap, exports.AnimationType.Drag, exports.AnimationType.Exit]; +var reversePriorityOrder = tslib.__spreadArray([], tslib.__read(variantPriorityOrder), false).reverse(); +var numAnimationTypes = variantPriorityOrder.length; +function animateList(visualElement) { + return function (animations) { + return Promise.all(animations.map(function (_a) { + var animation = _a.animation, + options = _a.options; + return animateVisualElement(visualElement, animation, options); + })); + }; +} +function createAnimationState(visualElement) { + var animate = animateList(visualElement); + var state = createState(); + var allAnimatedKeys = {}; + var isInitialRender = true; + /** + * This function will be used to reduce the animation definitions for + * each active animation type into an object of resolved values for it. + */ + var buildResolvedTypeValues = function (acc, definition) { + var resolved = resolveVariant(visualElement, definition); + if (resolved) { + resolved.transition; + var transitionEnd = resolved.transitionEnd, + target = tslib.__rest(resolved, ["transition", "transitionEnd"]); + acc = tslib.__assign(tslib.__assign(tslib.__assign({}, acc), target), transitionEnd); + } + return acc; + }; + function isAnimated(key) { + return allAnimatedKeys[key] !== undefined; + } + /** + * This just allows us to inject mocked animation functions + * @internal + */ + function setAnimateFunction(makeAnimator) { + animate = makeAnimator(visualElement); + } + /** + * When we receive new props, we need to: + * 1. Create a list of protected keys for each type. This is a directory of + * value keys that are currently being "handled" by types of a higher priority + * so that whenever an animation is played of a given type, these values are + * protected from being animated. + * 2. Determine if an animation type needs animating. + * 3. Determine if any values have been removed from a type and figure out + * what to animate those to. + */ + function animateChanges(options, changedActiveType) { + var _a; + var props = visualElement.getProps(); + var context = visualElement.getVariantContext(true) || {}; + /** + * A list of animations that we'll build into as we iterate through the animation + * types. This will get executed at the end of the function. + */ + var animations = []; + /** + * Keep track of which values have been removed. Then, as we hit lower priority + * animation types, we can check if they contain removed values and animate to that. + */ + var removedKeys = new Set(); + /** + * A dictionary of all encountered keys. This is an object to let us build into and + * copy it without iteration. Each time we hit an animation type we set its protected + * keys - the keys its not allowed to animate - to the latest version of this object. + */ + var encounteredKeys = {}; + /** + * If a variant has been removed at a given index, and this component is controlling + * variant animations, we want to ensure lower-priority variants are forced to animate. + */ + var removedVariantIndex = Infinity; + var _loop_1 = function (i) { + var type = reversePriorityOrder[i]; + var typeState = state[type]; + var prop = (_a = props[type]) !== null && _a !== void 0 ? _a : context[type]; + var propIsVariant = isVariantLabel(prop); + /** + * If this type has *just* changed isActive status, set activeDelta + * to that status. Otherwise set to null. + */ + var activeDelta = type === changedActiveType ? typeState.isActive : null; + if (activeDelta === false) removedVariantIndex = i; + /** + * If this prop is an inherited variant, rather than been set directly on the + * component itself, we want to make sure we allow the parent to trigger animations. + * + * TODO: Can probably change this to a !isControllingVariants check + */ + var isInherited = prop === context[type] && prop !== props[type] && propIsVariant; + /** + * + */ + if (isInherited && isInitialRender && visualElement.manuallyAnimateOnMount) { + isInherited = false; + } + /** + * Set all encountered keys so far as the protected keys for this type. This will + * be any key that has been animated or otherwise handled by active, higher-priortiy types. + */ + typeState.protectedKeys = tslib.__assign({}, encounteredKeys); + // Check if we can skip analysing this prop early + if ( + // If it isn't active and hasn't *just* been set as inactive + !typeState.isActive && activeDelta === null || + // If we didn't and don't have any defined prop for this animation type + !prop && !typeState.prevProp || + // Or if the prop doesn't define an animation + isAnimationControls(prop) || typeof prop === "boolean") { + return "continue"; + } + /** + * As we go look through the values defined on this type, if we detect + * a changed value or a value that was removed in a higher priority, we set + * this to true and add this prop to the animation list. + */ + var variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); + var shouldAnimateType = variantDidChange || + // If we're making this variant active, we want to always make it active + type === changedActiveType && typeState.isActive && !isInherited && propIsVariant || + // If we removed a higher-priority variant (i is in reverse order) + i > removedVariantIndex && propIsVariant; + /** + * As animations can be set as variant lists, variants or target objects, we + * coerce everything to an array if it isn't one already + */ + var definitionList = Array.isArray(prop) ? prop : [prop]; + /** + * Build an object of all the resolved values. We'll use this in the subsequent + * animateChanges calls to determine whether a value has changed. + */ + var resolvedValues = definitionList.reduce(buildResolvedTypeValues, {}); + if (activeDelta === false) resolvedValues = {}; + /** + * Now we need to loop through all the keys in the prev prop and this prop, + * and decide: + * 1. If the value has changed, and needs animating + * 2. If it has been removed, and needs adding to the removedKeys set + * 3. If it has been removed in a higher priority type and needs animating + * 4. If it hasn't been removed in a higher priority but hasn't changed, and + * needs adding to the type's protectedKeys list. + */ + var _b = typeState.prevResolvedValues, + prevResolvedValues = _b === void 0 ? {} : _b; + var allKeys = tslib.__assign(tslib.__assign({}, prevResolvedValues), resolvedValues); + var markToAnimate = function (key) { + shouldAnimateType = true; + removedKeys.delete(key); + typeState.needsAnimating[key] = true; + }; + for (var key in allKeys) { + var next = resolvedValues[key]; + var prev = prevResolvedValues[key]; + // If we've already handled this we can just skip ahead + if (encounteredKeys.hasOwnProperty(key)) continue; + /** + * If the value has changed, we probably want to animate it. + */ + if (next !== prev) { + /** + * If both values are keyframes, we need to shallow compare them to + * detect whether any value has changed. If it has, we animate it. + */ + if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { + if (!shallowCompare(next, prev) || variantDidChange) { + markToAnimate(key); + } else { + /** + * If it hasn't changed, we want to ensure it doesn't animate by + * adding it to the list of protected keys. + */ + typeState.protectedKeys[key] = true; + } + } else if (next !== undefined) { + // If next is defined and doesn't equal prev, it needs animating + markToAnimate(key); + } else { + // If it's undefined, it's been removed. + removedKeys.add(key); + } + } else if (next !== undefined && removedKeys.has(key)) { + /** + * If next hasn't changed and it isn't undefined, we want to check if it's + * been removed by a higher priority + */ + markToAnimate(key); + } else { + /** + * If it hasn't changed, we add it to the list of protected values + * to ensure it doesn't get animated. + */ + typeState.protectedKeys[key] = true; + } + } + /** + * Update the typeState so next time animateChanges is called we can compare the + * latest prop and resolvedValues to these. + */ + typeState.prevProp = prop; + typeState.prevResolvedValues = resolvedValues; + /** + * + */ + if (typeState.isActive) { + encounteredKeys = tslib.__assign(tslib.__assign({}, encounteredKeys), resolvedValues); + } + if (isInitialRender && visualElement.blockInitialAnimation) { + shouldAnimateType = false; + } + /** + * If this is an inherited prop we want to hard-block animations + * TODO: Test as this should probably still handle animations triggered + * by removed values? + */ + if (shouldAnimateType && !isInherited) { + animations.push.apply(animations, tslib.__spreadArray([], tslib.__read(definitionList.map(function (animation) { + return { + animation: animation, + options: tslib.__assign({ + type: type + }, options) + }; + })), false)); + } + }; + /** + * Iterate through all animation types in reverse priority order. For each, we want to + * detect which values it's handling and whether or not they've changed (and therefore + * need to be animated). If any values have been removed, we want to detect those in + * lower priority props and flag for animation. + */ + for (var i = 0; i < numAnimationTypes; i++) { + _loop_1(i); + } + allAnimatedKeys = tslib.__assign({}, encounteredKeys); + /** + * If there are some removed value that haven't been dealt with, + * we need to create a new animation that falls back either to the value + * defined in the style prop, or the last read value. + */ + if (removedKeys.size) { + var fallbackAnimation_1 = {}; + removedKeys.forEach(function (key) { + var fallbackTarget = visualElement.getBaseTarget(key); + if (fallbackTarget !== undefined) { + fallbackAnimation_1[key] = fallbackTarget; + } + }); + animations.push({ + animation: fallbackAnimation_1 + }); + } + var shouldAnimate = Boolean(animations.length); + if (isInitialRender && props.initial === false && !visualElement.manuallyAnimateOnMount) { + shouldAnimate = false; + } + isInitialRender = false; + return shouldAnimate ? animate(animations) : Promise.resolve(); + } + /** + * Change whether a certain animation type is active. + */ + function setActive(type, isActive, options) { + var _a; + // If the active state hasn't changed, we can safely do nothing here + if (state[type].isActive === isActive) return Promise.resolve(); + // Propagate active change to children + (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { + var _a; + return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); + }); + state[type].isActive = isActive; + var animations = animateChanges(options, type); + for (var key in state) { + state[key].protectedKeys = {}; + } + return animations; + } + return { + isAnimated: isAnimated, + animateChanges: animateChanges, + setActive: setActive, + setAnimateFunction: setAnimateFunction, + getState: function () { + return state; + } + }; +} +function checkVariantsDidChange(prev, next) { + if (typeof next === "string") { + return next !== prev; + } else if (isVariantLabels(next)) { + return !shallowCompare(next, prev); + } + return false; +} +function createTypeState(isActive) { + if (isActive === void 0) { + isActive = false; + } + return { + isActive: isActive, + protectedKeys: {}, + needsAnimating: {}, + prevResolvedValues: {} + }; +} +function createState() { + var _a; + return _a = {}, _a[exports.AnimationType.Animate] = createTypeState(true), _a[exports.AnimationType.InView] = createTypeState(), _a[exports.AnimationType.Hover] = createTypeState(), _a[exports.AnimationType.Tap] = createTypeState(), _a[exports.AnimationType.Drag] = createTypeState(), _a[exports.AnimationType.Focus] = createTypeState(), _a[exports.AnimationType.Exit] = createTypeState(), _a; +} +var animations = { + animation: makeRenderlessComponent(function (_a) { + var visualElement = _a.visualElement, + animate = _a.animate; + /** + * We dynamically generate the AnimationState manager as it contains a reference + * to the underlying animation library. We only want to load that if we load this, + * so people can optionally code split it out using the `m` component. + */ + visualElement.animationState || (visualElement.animationState = createAnimationState(visualElement)); + /** + * Subscribe any provided AnimationControls to the component's VisualElement + */ + if (isAnimationControls(animate)) { + React.useEffect(function () { + return animate.subscribe(visualElement); + }, [animate]); + } + }), + exit: makeRenderlessComponent(function (props) { + var custom = props.custom, + visualElement = props.visualElement; + var _a = tslib.__read(usePresence(), 2), + isPresent = _a[0], + safeToRemove = _a[1]; + var presenceContext = React.useContext(PresenceContext); + React.useEffect(function () { + var _a, _b; + visualElement.isPresent = isPresent; + var animation = (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Exit, !isPresent, { + custom: (_b = presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.custom) !== null && _b !== void 0 ? _b : custom + }); + !isPresent && (animation === null || animation === void 0 ? void 0 : animation.then(safeToRemove)); + }, [isPresent]); + }) +}; + +/** + * @internal + */ +var PanSession = /** @class */function () { + function PanSession(event, handlers, _a) { + var _this = this; + var _b = _a === void 0 ? {} : _a, + transformPagePoint = _b.transformPagePoint; + /** + * @internal + */ + this.startEvent = null; + /** + * @internal + */ + this.lastMoveEvent = null; + /** + * @internal + */ + this.lastMoveEventInfo = null; + /** + * @internal + */ + this.handlers = {}; + this.updatePoint = function () { + if (!(_this.lastMoveEvent && _this.lastMoveEventInfo)) return; + var info = getPanInfo(_this.lastMoveEventInfo, _this.history); + var isPanStarted = _this.startEvent !== null; + // Only start panning if the offset is larger than 3 pixels. If we make it + // any larger than this we'll want to reset the pointer history + // on the first update to avoid visual snapping to the cursoe. + var isDistancePastThreshold = popmotion.distance(info.offset, { + x: 0, + y: 0 + }) >= 3; + if (!isPanStarted && !isDistancePastThreshold) return; + var point = info.point; + var timestamp = sync.getFrameData().timestamp; + _this.history.push(tslib.__assign(tslib.__assign({}, point), { + timestamp: timestamp + })); + var _a = _this.handlers, + onStart = _a.onStart, + onMove = _a.onMove; + if (!isPanStarted) { + onStart && onStart(_this.lastMoveEvent, info); + _this.startEvent = _this.lastMoveEvent; + } + onMove && onMove(_this.lastMoveEvent, info); + }; + this.handlePointerMove = function (event, info) { + _this.lastMoveEvent = event; + _this.lastMoveEventInfo = transformPoint(info, _this.transformPagePoint); + // Because Safari doesn't trigger mouseup events when it's above a ` ' + e.phrase("(Use line:column or scroll% syntax)") + ""; + } + c(i, "getJumpDialog"); + function a(e, r) { + var n = Number(r); + return /^[-+]/.test(r) ? e.getCursor().line + n : n - 1; + } + c(a, "interpretLine"), o.commands.jumpToLine = function (e) { + var r = e.getCursor(); + s(e, i(e), e.phrase("Jump to line:"), r.line + 1 + ":" + r.ch, function (n) { + if (n) { + var t; + if (t = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(n)) e.setCursor(a(e, t[1]), Number(t[2]));else if (t = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(n)) { + var l = Math.round(e.lineCount() * Number(t[1]) / 100); + /^[-+]/.test(t[1]) && (l = r.line + l + 1), e.setCursor(l - 1, r.ch); + } else (t = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(n)) && e.setCursor(a(e, t[1]), r.ch); + } + }); + }, o.keyMap.default["Alt-G"] = "jumpToLine"; + }); +})(); +var d = b.exports; +const j = f.getDefaultExportFromCjs(d), + y = h({ + __proto__: null, + default: j + }, [d]); +exports.jumpToLine = y; + +/***/ }), + +/***/ "../../graphiql-react/dist/jump.cjs.js": +/*!*********************************************!*\ + !*** ../../graphiql-react/dist/jump.cjs.js ***! + \*********************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + + +var c = Object.defineProperty; +var s = (e, r) => c(e, "name", { + value: r, + configurable: !0 +}); +const u = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"), + d = __webpack_require__(/*! ./SchemaReference.cjs.js */ "../../graphiql-react/dist/SchemaReference.cjs.js"); +__webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); +__webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +__webpack_require__(/*! ./forEachState.cjs.js */ "../../graphiql-react/dist/forEachState.cjs.js"); +u.CodeMirror.defineOption("jump", !1, (e, r, n) => { + if (n && n !== u.CodeMirror.Init) { + const t = e.state.jump.onMouseOver; + u.CodeMirror.off(e.getWrapperElement(), "mouseover", t); + const i = e.state.jump.onMouseOut; + u.CodeMirror.off(e.getWrapperElement(), "mouseout", i), u.CodeMirror.off(document, "keydown", e.state.jump.onKeyDown), delete e.state.jump; + } + if (r) { + const t = e.state.jump = { + options: r, + onMouseOver: M.bind(null, e), + onMouseOut: m.bind(null, e), + onKeyDown: g.bind(null, e) + }; + u.CodeMirror.on(e.getWrapperElement(), "mouseover", t.onMouseOver), u.CodeMirror.on(e.getWrapperElement(), "mouseout", t.onMouseOut), u.CodeMirror.on(document, "keydown", t.onKeyDown); + } +}); +function M(e, r) { + const n = r.target || r.srcElement; + if (!(n instanceof HTMLElement) || (n == null ? void 0 : n.nodeName) !== "SPAN") return; + const t = n.getBoundingClientRect(), + i = { + left: (t.left + t.right) / 2, + top: (t.top + t.bottom) / 2 + }; + e.state.jump.cursor = i, e.state.jump.isHoldingModifier && l(e); +} +s(M, "onMouseOver"); +function m(e) { + if (!e.state.jump.isHoldingModifier && e.state.jump.cursor) { + e.state.jump.cursor = null; + return; + } + e.state.jump.isHoldingModifier && e.state.jump.marker && p(e); +} +s(m, "onMouseOut"); +function g(e, r) { + if (e.state.jump.isHoldingModifier || !k(r.key)) return; + e.state.jump.isHoldingModifier = !0, e.state.jump.cursor && l(e); + const n = s(o => { + o.code === r.code && (e.state.jump.isHoldingModifier = !1, e.state.jump.marker && p(e), u.CodeMirror.off(document, "keyup", n), u.CodeMirror.off(document, "click", t), e.off("mousedown", i)); + }, "onKeyUp"), + t = s(o => { + const { + destination: a, + options: f + } = e.state.jump; + a && f.onClick(a, o); + }, "onClick"), + i = s((o, a) => { + e.state.jump.destination && (a.codemirrorIgnore = !0); + }, "onMouseDown"); + u.CodeMirror.on(document, "keyup", n), u.CodeMirror.on(document, "click", t), e.on("mousedown", i); +} +s(g, "onKeyDown"); +const j = typeof navigator < "u" && navigator && navigator.appVersion.includes("Mac"); +function k(e) { + return e === (j ? "Meta" : "Control"); +} +s(k, "isJumpModifier"); +function l(e) { + if (e.state.jump.marker) return; + const { + cursor: r, + options: n + } = e.state.jump, + t = e.coordsChar(r), + i = e.getTokenAt(t, !0), + o = n.getDestination || e.getHelper(t, "jump"); + if (o) { + const a = o(i, n, e); + if (a) { + const f = e.markText({ + line: t.line, + ch: i.start + }, { + line: t.line, + ch: i.end + }, { + className: "CodeMirror-jump-token" + }); + e.state.jump.marker = f, e.state.jump.destination = a; + } + } +} +s(l, "enableJumpMode"); +function p(e) { + const { + marker: r + } = e.state.jump; + e.state.jump.marker = null, e.state.jump.destination = null, r.clear(); +} +s(p, "disableJumpMode"); +u.CodeMirror.registerHelper("jump", "graphql", (e, r) => { + if (!r.schema || !r.onClick || !e.state) return; + const { + state: n + } = e, + { + kind: t, + step: i + } = n, + o = d.getTypeInfo(r.schema, n); + if (t === "Field" && i === 0 && o.fieldDef || t === "AliasedField" && i === 2 && o.fieldDef) return d.getFieldReference(o); + if (t === "Directive" && i === 1 && o.directiveDef) return d.getDirectiveReference(o); + if (t === "Argument" && i === 0 && o.argDef) return d.getArgumentReference(o); + if (t === "EnumValue" && o.enumValue) return d.getEnumValueReference(o); + if (t === "NamedType" && o.type) return d.getTypeReference(o); +}); + +/***/ }), + +/***/ "../../graphiql-react/dist/lint.cjs.js": +/*!*********************************************!*\ + !*** ../../graphiql-react/dist/lint.cjs.js ***! + \*********************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +var W = Object.defineProperty; +var s = (h, v) => W(h, "name", { + value: v, + configurable: !0 +}); +const x = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); +function q(h, v) { + for (var l = 0; l < v.length; l++) { + const u = v[l]; + if (typeof u != "string" && !Array.isArray(u)) { + for (const g in u) if (g !== "default" && !(g in h)) { + const c = Object.getOwnPropertyDescriptor(u, g); + c && Object.defineProperty(h, g, c.get ? c : { + enumerable: !0, + get: () => u[g] + }); + } + } + } + return Object.freeze(Object.defineProperty(h, Symbol.toStringTag, { + value: "Module" + })); +} +s(q, "_mergeNamespaces"); +var B = { + exports: {} +}; +(function (h, v) { + (function (l) { + l(x.requireCodemirror()); + })(function (l) { + var u = "CodeMirror-lint-markers", + g = "CodeMirror-lint-line-"; + function c(t, e, r) { + var n = document.createElement("div"); + n.className = "CodeMirror-lint-tooltip cm-s-" + t.options.theme, n.appendChild(r.cloneNode(!0)), t.state.lint.options.selfContain ? t.getWrapperElement().appendChild(n) : document.body.appendChild(n); + function i(o) { + if (!n.parentNode) return l.off(document, "mousemove", i); + n.style.top = Math.max(0, o.clientY - n.offsetHeight - 5) + "px", n.style.left = o.clientX + 5 + "px"; + } + return s(i, "position"), l.on(document, "mousemove", i), i(e), n.style.opacity != null && (n.style.opacity = 1), n; + } + s(c, "showTooltip"); + function L(t) { + t.parentNode && t.parentNode.removeChild(t); + } + s(L, "rm"); + function A(t) { + t.parentNode && (t.style.opacity == null && L(t), t.style.opacity = 0, setTimeout(function () { + L(t); + }, 600)); + } + s(A, "hideTooltip"); + function M(t, e, r, n) { + var i = c(t, e, r); + function o() { + l.off(n, "mouseout", o), i && (A(i), i = null); + } + s(o, "hide"); + var a = setInterval(function () { + if (i) for (var f = n;; f = f.parentNode) { + if (f && f.nodeType == 11 && (f = f.host), f == document.body) return; + if (!f) { + o(); + break; + } + } + if (!i) return clearInterval(a); + }, 400); + l.on(n, "mouseout", o); + } + s(M, "showTooltipFor"); + function F(t, e, r) { + this.marked = [], e instanceof Function && (e = { + getAnnotations: e + }), (!e || e === !0) && (e = {}), this.options = {}, this.linterOptions = e.options || {}; + for (var n in C) this.options[n] = C[n]; + for (var n in e) C.hasOwnProperty(n) ? e[n] != null && (this.options[n] = e[n]) : e.options || (this.linterOptions[n] = e[n]); + this.timeout = null, this.hasGutter = r, this.onMouseOver = function (i) { + U(t, i); + }, this.waitingFor = 0; + } + s(F, "LintState"); + var C = { + highlightLines: !1, + tooltips: !0, + delay: 500, + lintOnChange: !0, + getAnnotations: null, + async: !1, + selfContain: null, + formatAnnotation: null, + onUpdateLinting: null + }; + function E(t) { + var e = t.state.lint; + e.hasGutter && t.clearGutter(u), e.options.highlightLines && G(t); + for (var r = 0; r < e.marked.length; ++r) e.marked[r].clear(); + e.marked.length = 0; + } + s(E, "clearMarks"); + function G(t) { + t.eachLine(function (e) { + var r = e.wrapClass && /\bCodeMirror-lint-line-\w+\b/.exec(e.wrapClass); + r && t.removeLineClass(e, "wrap", r[0]); + }); + } + s(G, "clearErrorLines"); + function I(t, e, r, n, i) { + var o = document.createElement("div"), + a = o; + return o.className = "CodeMirror-lint-marker CodeMirror-lint-marker-" + r, n && (a = o.appendChild(document.createElement("div")), a.className = "CodeMirror-lint-marker CodeMirror-lint-marker-multiple"), i != !1 && l.on(a, "mouseover", function (f) { + M(t, f, e, a); + }), o; + } + s(I, "makeMarker"); + function D(t, e) { + return t == "error" ? t : e; + } + s(D, "getMaxSeverity"); + function j(t) { + for (var e = [], r = 0; r < t.length; ++r) { + var n = t[r], + i = n.from.line; + (e[i] || (e[i] = [])).push(n); + } + return e; + } + s(j, "groupByLine"); + function N(t) { + var e = t.severity; + e || (e = "error"); + var r = document.createElement("div"); + return r.className = "CodeMirror-lint-message CodeMirror-lint-message-" + e, typeof t.messageHTML < "u" ? r.innerHTML = t.messageHTML : r.appendChild(document.createTextNode(t.message)), r; + } + s(N, "annotationTooltip"); + function H(t, e) { + var r = t.state.lint, + n = ++r.waitingFor; + function i() { + n = -1, t.off("change", i); + } + s(i, "abort"), t.on("change", i), e(t.getValue(), function (o, a) { + t.off("change", i), r.waitingFor == n && (a && o instanceof l && (o = a), t.operation(function () { + O(t, o); + })); + }, r.linterOptions, t); + } + s(H, "lintAsync"); + function k(t) { + var e = t.state.lint; + if (e) { + var r = e.options, + n = r.getAnnotations || t.getHelper(l.Pos(0, 0), "lint"); + if (n) if (r.async || n.async) H(t, n);else { + var i = n(t.getValue(), e.linterOptions, t); + if (!i) return; + i.then ? i.then(function (o) { + t.operation(function () { + O(t, o); + }); + }) : t.operation(function () { + O(t, i); + }); + } + } + } + s(k, "startLinting"); + function O(t, e) { + var r = t.state.lint; + if (r) { + var n = r.options; + E(t); + for (var i = j(e), o = 0; o < i.length; ++o) { + var a = i[o]; + if (a) { + var f = []; + a = a.filter(function (w) { + return f.indexOf(w.message) > -1 ? !1 : f.push(w.message); + }); + for (var p = null, m = r.hasGutter && document.createDocumentFragment(), T = 0; T < a.length; ++T) { + var d = a[T], + y = d.severity; + y || (y = "error"), p = D(p, y), n.formatAnnotation && (d = n.formatAnnotation(d)), r.hasGutter && m.appendChild(N(d)), d.to && r.marked.push(t.markText(d.from, d.to, { + className: "CodeMirror-lint-mark CodeMirror-lint-mark-" + y, + __annotation: d + })); + } + r.hasGutter && t.setGutterMarker(o, u, I(t, m, p, i[o].length > 1, n.tooltips)), n.highlightLines && t.addLineClass(o, "wrap", g + p); + } + } + n.onUpdateLinting && n.onUpdateLinting(e, i, t); + } + } + s(O, "updateLinting"); + function b(t) { + var e = t.state.lint; + e && (clearTimeout(e.timeout), e.timeout = setTimeout(function () { + k(t); + }, e.options.delay)); + } + s(b, "onChange"); + function P(t, e, r) { + for (var n = r.target || r.srcElement, i = document.createDocumentFragment(), o = 0; o < e.length; o++) { + var a = e[o]; + i.appendChild(N(a)); + } + M(t, r, i, n); + } + s(P, "popupTooltips"); + function U(t, e) { + var r = e.target || e.srcElement; + if (/\bCodeMirror-lint-mark-/.test(r.className)) { + for (var n = r.getBoundingClientRect(), i = (n.left + n.right) / 2, o = (n.top + n.bottom) / 2, a = t.findMarksAt(t.coordsChar({ + left: i, + top: o + }, "client")), f = [], p = 0; p < a.length; ++p) { + var m = a[p].__annotation; + m && f.push(m); + } + f.length && P(t, f, e); + } + } + s(U, "onMouseOver"), l.defineOption("lint", !1, function (t, e, r) { + if (r && r != l.Init && (E(t), t.state.lint.options.lintOnChange !== !1 && t.off("change", b), l.off(t.getWrapperElement(), "mouseover", t.state.lint.onMouseOver), clearTimeout(t.state.lint.timeout), delete t.state.lint), e) { + for (var n = t.getOption("gutters"), i = !1, o = 0; o < n.length; ++o) n[o] == u && (i = !0); + var a = t.state.lint = new F(t, e, i); + a.options.lintOnChange && t.on("change", b), a.options.tooltips != !1 && a.options.tooltips != "gutter" && l.on(t.getWrapperElement(), "mouseover", a.onMouseOver), k(t); + } + }), l.defineExtension("performLint", function () { + k(this); + }); + }); +})(); +var _ = B.exports; +const R = x.getDefaultExportFromCjs(_), + V = q({ + __proto__: null, + default: R + }, [_]); +exports.lint = V; + +/***/ }), + +/***/ "../../graphiql-react/dist/lint.cjs2.js": +/*!**********************************************!*\ + !*** ../../graphiql-react/dist/lint.cjs2.js ***! + \**********************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + + +const t = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"), + c = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"); +__webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); +const a = ["error", "warning", "information", "hint"], + g = { + "GraphQL: Validation": "validation", + "GraphQL: Deprecation": "deprecation", + "GraphQL: Syntax": "syntax" + }; +t.CodeMirror.registerHelper("lint", "graphql", (n, s) => { + const { + schema: r, + validationRules: i, + externalFragments: o + } = s; + return c.getDiagnostics(n, r, i, void 0, o).map(e => ({ + message: e.message, + severity: e.severity ? a[e.severity - 1] : a[0], + type: e.source ? g[e.source] : void 0, + from: t.CodeMirror.Pos(e.range.start.line, e.range.start.character), + to: t.CodeMirror.Pos(e.range.end.line, e.range.end.character) + })); +}); + +/***/ }), + +/***/ "../../graphiql-react/dist/lint.cjs3.js": +/*!**********************************************!*\ + !*** ../../graphiql-react/dist/lint.cjs3.js ***! + \**********************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + + +var V = Object.defineProperty; +var t = (e, n) => V(e, "name", { + value: n, + configurable: !0 +}); +const I = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"), + b = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +__webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); +function C(e) { + d = e, E = e.length, s = u = N = -1, o(), y(); + const n = q(); + return p("EOF"), n; +} +t(C, "jsonParse"); +let d, E, s, u, N, r, l; +function q() { + const e = s, + n = []; + if (p("{"), !x("}")) { + do n.push(M()); while (x(",")); + p("}"); + } + return { + kind: "Object", + start: e, + end: N, + members: n + }; +} +t(q, "parseObj"); +function M() { + const e = s, + n = l === "String" ? G() : null; + p("String"), p(":"); + const i = B(); + return { + kind: "Member", + start: e, + end: N, + key: n, + value: i + }; +} +t(M, "parseMember"); +function v() { + const e = s, + n = []; + if (p("["), !x("]")) { + do n.push(B()); while (x(",")); + p("]"); + } + return { + kind: "Array", + start: e, + end: N, + values: n + }; +} +t(v, "parseArr"); +function B() { + switch (l) { + case "[": + return v(); + case "{": + return q(); + case "String": + case "Number": + case "Boolean": + case "Null": + const e = G(); + return y(), e; + } + p("Value"); +} +t(B, "parseVal"); +function G() { + return { + kind: l, + start: s, + end: u, + value: JSON.parse(d.slice(s, u)) + }; +} +t(G, "curToken"); +function p(e) { + if (l === e) { + y(); + return; + } + let n; + if (l === "EOF") n = "[end of file]";else if (u - s > 1) n = "`" + d.slice(s, u) + "`";else { + const i = d.slice(s).match(/^.+?\b/); + n = "`" + (i ? i[0] : d[s]) + "`"; + } + throw k(`Expected ${e} but found ${n}.`); +} +t(p, "expect"); +class j extends Error { + constructor(n, i) { + super(n), this.position = i; + } +} +t(j, "JSONSyntaxError"); +function k(e) { + return new j(e, { + start: s, + end: u + }); +} +t(k, "syntaxError"); +function x(e) { + if (l === e) return y(), !0; +} +t(x, "skip"); +function o() { + return u < E && (u++, r = u === E ? 0 : d.charCodeAt(u)), r; +} +t(o, "ch"); +function y() { + for (N = u; r === 9 || r === 10 || r === 13 || r === 32;) o(); + if (r === 0) { + l = "EOF"; + return; + } + switch (s = u, r) { + case 34: + return l = "String", D(); + case 45: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return l = "Number", H(); + case 102: + if (d.slice(s, s + 5) !== "false") break; + u += 4, o(), l = "Boolean"; + return; + case 110: + if (d.slice(s, s + 4) !== "null") break; + u += 3, o(), l = "Null"; + return; + case 116: + if (d.slice(s, s + 4) !== "true") break; + u += 3, o(), l = "Boolean"; + return; + } + l = d[s], o(); +} +t(y, "lex"); +function D() { + for (o(); r !== 34 && r > 31;) if (r === 92) switch (r = o(), r) { + case 34: + case 47: + case 92: + case 98: + case 102: + case 110: + case 114: + case 116: + o(); + break; + case 117: + o(), w(), w(), w(), w(); + break; + default: + throw k("Bad character escape sequence."); + } else { + if (u === E) throw k("Unterminated string."); + o(); + } + if (r === 34) { + o(); + return; + } + throw k("Unterminated string."); +} +t(D, "readString"); +function w() { + if (r >= 48 && r <= 57 || r >= 65 && r <= 70 || r >= 97 && r <= 102) return o(); + throw k("Expected hexadecimal digit."); +} +t(w, "readHex"); +function H() { + r === 45 && o(), r === 48 ? o() : $(), r === 46 && (o(), $()), (r === 69 || r === 101) && (r = o(), (r === 43 || r === 45) && o(), $()); +} +t(H, "readNumber"); +function $() { + if (r < 48 || r > 57) throw k("Expected decimal digit."); + do o(); while (r >= 48 && r <= 57); +} +t($, "readDigits"); +I.CodeMirror.registerHelper("lint", "graphql-variables", (e, n, i) => { + if (!e) return []; + let f; + try { + f = C(e); + } catch (c) { + if (c instanceof j) return [F(i, c.position, c.message)]; + throw c; + } + const { + variableToType: a + } = n; + return a ? U(i, a, f) : []; +}); +function U(e, n, i) { + var f; + const a = []; + for (const c of i.members) if (c) { + const h = (f = c.key) === null || f === void 0 ? void 0 : f.value, + m = n[h]; + if (m) for (const [O, Q] of g(m, c.value)) a.push(F(e, O, Q));else a.push(F(e, c.key, `Variable "$${h}" does not appear in any GraphQL query.`)); + } + return a; +} +t(U, "validateVariables"); +function g(e, n) { + if (!e || !n) return []; + if (e instanceof b.GraphQLNonNull) return n.kind === "Null" ? [[n, `Type "${e}" is non-nullable and cannot be null.`]] : g(e.ofType, n); + if (n.kind === "Null") return []; + if (e instanceof b.GraphQLList) { + const i = e.ofType; + if (n.kind === "Array") { + const f = n.values || []; + return L(f, a => g(i, a)); + } + return g(i, n); + } + if (e instanceof b.GraphQLInputObjectType) { + if (n.kind !== "Object") return [[n, `Type "${e}" must be an Object.`]]; + const i = Object.create(null), + f = L(n.members, a => { + var c; + const h = (c = a == null ? void 0 : a.key) === null || c === void 0 ? void 0 : c.value; + i[h] = !0; + const m = e.getFields()[h]; + if (!m) return [[a.key, `Type "${e}" does not have a field "${h}".`]]; + const O = m ? m.type : void 0; + return g(O, a.value); + }); + for (const a of Object.keys(e.getFields())) { + const c = e.getFields()[a]; + !i[a] && c.type instanceof b.GraphQLNonNull && !c.defaultValue && f.push([n, `Object of type "${e}" is missing required field "${a}".`]); + } + return f; + } + return e.name === "Boolean" && n.kind !== "Boolean" || e.name === "String" && n.kind !== "String" || e.name === "ID" && n.kind !== "Number" && n.kind !== "String" || e.name === "Float" && n.kind !== "Number" || e.name === "Int" && (n.kind !== "Number" || (n.value | 0) !== n.value) ? [[n, `Expected value of type "${e}".`]] : (e instanceof b.GraphQLEnumType || e instanceof b.GraphQLScalarType) && (n.kind !== "String" && n.kind !== "Number" && n.kind !== "Boolean" && n.kind !== "Null" || _(e.parseValue(n.value))) ? [[n, `Expected value of type "${e}".`]] : []; +} +t(g, "validateValue"); +function F(e, n, i) { + return { + message: i, + severity: "error", + type: "validation", + from: e.posFromIndex(n.start), + to: e.posFromIndex(n.end) + }; +} +t(F, "lintError"); +function _(e) { + return e == null || e !== e; +} +t(_, "isNullish"); +function L(e, n) { + return Array.prototype.concat.apply([], e.map(n)); +} +t(L, "mapCat"); + +/***/ }), + +/***/ "../../graphiql-react/dist/matchbrackets.cjs.js": +/*!******************************************************!*\ + !*** ../../graphiql-react/dist/matchbrackets.cjs.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +var i = Object.defineProperty; +var s = (e, c) => i(e, "name", { + value: c, + configurable: !0 +}); +const u = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"), + f = __webpack_require__(/*! ./matchbrackets.cjs2.js */ "../../graphiql-react/dist/matchbrackets.cjs2.js"); +function b(e, c) { + for (var o = 0; o < c.length; o++) { + const t = c[o]; + if (typeof t != "string" && !Array.isArray(t)) { + for (const r in t) if (r !== "default" && !(r in e)) { + const a = Object.getOwnPropertyDescriptor(t, r); + a && Object.defineProperty(e, r, a.get ? a : { + enumerable: !0, + get: () => t[r] + }); + } + } + } + return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { + value: "Module" + })); +} +s(b, "_mergeNamespaces"); +var n = f.requireMatchbrackets(); +const l = u.getDefaultExportFromCjs(n), + m = b({ + __proto__: null, + default: l + }, [n]); +exports.matchbrackets = m; + +/***/ }), + +/***/ "../../graphiql-react/dist/matchbrackets.cjs2.js": +/*!*******************************************************!*\ + !*** ../../graphiql-react/dist/matchbrackets.cjs2.js ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +var R = Object.defineProperty; +var f = (L, y) => R(L, "name", { + value: y, + configurable: !0 +}); +const F = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); +var T = { + exports: {} + }, + E; +function I() { + return E || (E = 1, function (L, y) { + (function (o) { + o(F.requireCodemirror()); + })(function (o) { + var S = /MSIE \d/.test(navigator.userAgent) && (document.documentMode == null || document.documentMode < 8), + g = o.Pos, + B = { + "(": ")>", + ")": "(<", + "[": "]>", + "]": "[<", + "{": "}>", + "}": "{<", + "<": ">>", + ">": "<<" + }; + function A(t) { + return t && t.bracketRegex || /[(){}[\]]/; + } + f(A, "bracketRegex"); + function b(t, r, e) { + var s = t.getLineHandle(r.line), + n = r.ch - 1, + h = e && e.afterCursor; + h == null && (h = /(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className)); + var l = A(e), + u = !h && n >= 0 && l.test(s.text.charAt(n)) && B[s.text.charAt(n)] || l.test(s.text.charAt(n + 1)) && B[s.text.charAt(++n)]; + if (!u) return null; + var a = u.charAt(1) == ">" ? 1 : -1; + if (e && e.strict && a > 0 != (n == r.ch)) return null; + var k = t.getTokenTypeAt(g(r.line, n + 1)), + i = H(t, g(r.line, n + (a > 0 ? 1 : 0)), a, k, e); + return i == null ? null : { + from: g(r.line, n), + to: i && i.pos, + match: i && i.ch == u.charAt(0), + forward: a > 0 + }; + } + f(b, "findMatchingBracket"); + function H(t, r, e, s, n) { + for (var h = n && n.maxScanLineLength || 1e4, l = n && n.maxScanLines || 1e3, u = [], a = A(n), k = e > 0 ? Math.min(r.line + l, t.lastLine() + 1) : Math.max(t.firstLine() - 1, r.line - l), i = r.line; i != k; i += e) { + var c = t.getLine(i); + if (c) { + var v = e > 0 ? 0 : c.length - 1, + q = e > 0 ? c.length : -1; + if (!(c.length > h)) for (i == r.line && (v = r.ch - (e < 0 ? 1 : 0)); v != q; v += e) { + var d = c.charAt(v); + if (a.test(d) && (s === void 0 || (t.getTokenTypeAt(g(i, v + 1)) || "") == (s || ""))) { + var m = B[d]; + if (m && m.charAt(1) == ">" == e > 0) u.push(d);else if (u.length) u.pop();else return { + pos: g(i, v), + ch: d + }; + } + } + } + } + return i - e == (e > 0 ? t.lastLine() : t.firstLine()) ? !1 : null; + } + f(H, "scanForBracket"); + function M(t, r, e) { + for (var s = t.state.matchBrackets.maxHighlightLineLength || 1e3, n = e && e.highlightNonMatching, h = [], l = t.listSelections(), u = 0; u < l.length; u++) { + var a = l[u].empty() && b(t, l[u].head, e); + if (a && (a.match || n !== !1) && t.getLine(a.from.line).length <= s) { + var k = a.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; + h.push(t.markText(a.from, g(a.from.line, a.from.ch + 1), { + className: k + })), a.to && t.getLine(a.to.line).length <= s && h.push(t.markText(a.to, g(a.to.line, a.to.ch + 1), { + className: k + })); + } + } + if (h.length) { + S && t.state.focused && t.focus(); + var i = f(function () { + t.operation(function () { + for (var c = 0; c < h.length; c++) h[c].clear(); + }); + }, "clear"); + if (r) setTimeout(i, 800);else return i; + } + } + f(M, "matchBrackets"); + function x(t) { + t.operation(function () { + t.state.matchBrackets.currentlyHighlighted && (t.state.matchBrackets.currentlyHighlighted(), t.state.matchBrackets.currentlyHighlighted = null), t.state.matchBrackets.currentlyHighlighted = M(t, !1, t.state.matchBrackets); + }); + } + f(x, "doMatchBrackets"); + function p(t) { + t.state.matchBrackets && t.state.matchBrackets.currentlyHighlighted && (t.state.matchBrackets.currentlyHighlighted(), t.state.matchBrackets.currentlyHighlighted = null); + } + f(p, "clearHighlighted"), o.defineOption("matchBrackets", !1, function (t, r, e) { + e && e != o.Init && (t.off("cursorActivity", x), t.off("focus", x), t.off("blur", p), p(t)), r && (t.state.matchBrackets = typeof r == "object" ? r : {}, t.on("cursorActivity", x), t.on("focus", x), t.on("blur", p)); + }), o.defineExtension("matchBrackets", function () { + M(this, !0); + }), o.defineExtension("findMatchingBracket", function (t, r, e) { + return (e || typeof r == "boolean") && (e ? (e.strict = r, r = e) : r = r ? { + strict: !0 + } : null), b(this, t, r); + }), o.defineExtension("scanForBracket", function (t, r, e, s) { + return H(this, t, r, e, s); + }); + }); + }()), T.exports; +} +f(I, "requireMatchbrackets"); +exports.requireMatchbrackets = I; + +/***/ }), + +/***/ "../../graphiql-react/dist/mode-indent.cjs.js": +/*!****************************************************!*\ + !*** ../../graphiql-react/dist/mode-indent.cjs.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +var o = Object.defineProperty; +var v = (n, t) => o(n, "name", { + value: t, + configurable: !0 +}); +function s(n, t) { + var e, i; + const { + levels: l, + indentLevel: d + } = n; + return ((!l || l.length === 0 ? d : l.at(-1) - (!((e = this.electricInput) === null || e === void 0) && e.test(t) ? 1 : 0)) || 0) * (((i = this.config) === null || i === void 0 ? void 0 : i.indentUnit) || 0); +} +v(s, "indent"); +exports.indent = s; + +/***/ }), + +/***/ "../../graphiql-react/dist/mode.cjs.js": +/*!*********************************************!*\ + !*** ../../graphiql-react/dist/mode.cjs.js ***! + \*********************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + + +var n = Object.defineProperty; +var s = (e, r) => n(e, "name", { + value: r, + configurable: !0 +}); +const o = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"), + t = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"), + i = __webpack_require__(/*! ./mode-indent.cjs.js */ "../../graphiql-react/dist/mode-indent.cjs.js"); +__webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); +const l = s(e => { + const r = t.onlineParser({ + eatWhitespace: a => a.eatWhile(t.isIgnored), + lexRules: t.LexRules, + parseRules: t.ParseRules, + editorConfig: { + tabSize: e.tabSize + } + }); + return { + config: e, + startState: r.startState, + token: r.token, + indent: i.indent, + electricInput: /^\s*[})\]]/, + fold: "brace", + lineComment: "#", + closeBrackets: { + pairs: '()[]{}""', + explode: "()[]{}" + } + }; +}, "graphqlModeFactory"); +o.CodeMirror.defineMode("graphql", l); + +/***/ }), + +/***/ "../../graphiql-react/dist/mode.cjs2.js": +/*!**********************************************!*\ + !*** ../../graphiql-react/dist/mode.cjs2.js ***! + \**********************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + + +var n = Object.defineProperty; +var u = (t, r) => n(t, "name", { + value: r, + configurable: !0 +}); +const i = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"), + e = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"), + s = __webpack_require__(/*! ./mode-indent.cjs.js */ "../../graphiql-react/dist/mode-indent.cjs.js"); +__webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); +i.CodeMirror.defineMode("graphql-variables", t => { + const r = e.onlineParser({ + eatWhitespace: a => a.eatSpace(), + lexRules: c, + parseRules: o, + editorConfig: { + tabSize: t.tabSize + } + }); + return { + config: t, + startState: r.startState, + token: r.token, + indent: s.indent, + electricInput: /^\s*[}\]]/, + fold: "brace", + closeBrackets: { + pairs: '[]{}""', + explode: "[]{}" + } + }; +}); +const c = { + Punctuation: /^\[|]|\{|\}|:|,/, + Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, + String: /^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/, + Keyword: /^true|false|null/ + }, + o = { + Document: [e.p("{"), e.list("Variable", e.opt(e.p(","))), e.p("}")], + Variable: [l("variable"), e.p(":"), "Value"], + Value(t) { + switch (t.kind) { + case "Number": + return "NumberValue"; + case "String": + return "StringValue"; + case "Punctuation": + switch (t.value) { + case "[": + return "ListValue"; + case "{": + return "ObjectValue"; + } + return null; + case "Keyword": + switch (t.value) { + case "true": + case "false": + return "BooleanValue"; + case "null": + return "NullValue"; + } + return null; + } + }, + NumberValue: [e.t("Number", "number")], + StringValue: [e.t("String", "string")], + BooleanValue: [e.t("Keyword", "builtin")], + NullValue: [e.t("Keyword", "keyword")], + ListValue: [e.p("["), e.list("Value", e.opt(e.p(","))), e.p("]")], + ObjectValue: [e.p("{"), e.list("ObjectField", e.opt(e.p(","))), e.p("}")], + ObjectField: [l("attribute"), e.p(":"), "Value"] + }; +function l(t) { + return { + style: t, + match: r => r.kind === "String", + update(r, a) { + r.name = a.value.slice(1, -1); + } + }; +} +u(l, "namedKey"); + +/***/ }), + +/***/ "../../graphiql-react/dist/mode.cjs3.js": +/*!**********************************************!*\ + !*** ../../graphiql-react/dist/mode.cjs3.js ***! + \**********************************************/ +/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { + + + +const a = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"), + e = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"), + l = __webpack_require__(/*! ./mode-indent.cjs.js */ "../../graphiql-react/dist/mode-indent.cjs.js"); +__webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); +a.CodeMirror.defineMode("graphql-results", r => { + const t = e.onlineParser({ + eatWhitespace: u => u.eatSpace(), + lexRules: n, + parseRules: s, + editorConfig: { + tabSize: r.tabSize + } + }); + return { + config: r, + startState: t.startState, + token: t.token, + indent: l.indent, + electricInput: /^\s*[}\]]/, + fold: "brace", + closeBrackets: { + pairs: '[]{}""', + explode: "[]{}" + } + }; +}); +const n = { + Punctuation: /^\[|]|\{|\}|:|,/, + Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, + String: /^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/, + Keyword: /^true|false|null/ + }, + s = { + Document: [e.p("{"), e.list("Entry", e.p(",")), e.p("}")], + Entry: [e.t("String", "def"), e.p(":"), "Value"], + Value(r) { + switch (r.kind) { + case "Number": + return "NumberValue"; + case "String": + return "StringValue"; + case "Punctuation": + switch (r.value) { + case "[": + return "ListValue"; + case "{": + return "ObjectValue"; + } + return null; + case "Keyword": + switch (r.value) { + case "true": + case "false": + return "BooleanValue"; + case "null": + return "NullValue"; + } + return null; + } + }, + NumberValue: [e.t("Number", "number")], + StringValue: [e.t("String", "string")], + BooleanValue: [e.t("Keyword", "builtin")], + NullValue: [e.t("Keyword", "keyword")], + ListValue: [e.p("["), e.list("Value", e.p(",")), e.p("]")], + ObjectValue: [e.p("{"), e.list("ObjectField", e.p(",")), e.p("}")], + ObjectField: [e.t("String", "property"), e.p(":"), "Value"] + }; + +/***/ }), + +/***/ "../../graphiql-react/dist/search.cjs.js": +/*!***********************************************!*\ + !*** ../../graphiql-react/dist/search.cjs.js ***! + \***********************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +var K = Object.defineProperty; +var a = (S, O) => K(S, "name", { + value: O, + configurable: !0 +}); +const Q = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"), + L = __webpack_require__(/*! ./searchcursor.cjs2.js */ "../../graphiql-react/dist/searchcursor.cjs2.js"), + z = __webpack_require__(/*! ./dialog.cjs.js */ "../../graphiql-react/dist/dialog.cjs.js"); +function U(S, O) { + for (var i = 0; i < O.length; i++) { + const y = O[i]; + if (typeof y != "string" && !Array.isArray(y)) { + for (const v in y) if (v !== "default" && !(v in S)) { + const h = Object.getOwnPropertyDescriptor(y, v); + h && Object.defineProperty(S, v, h.get ? h : { + enumerable: !0, + get: () => y[v] + }); + } + } + } + return Object.freeze(Object.defineProperty(S, Symbol.toStringTag, { + value: "Module" + })); +} +a(U, "_mergeNamespaces"); +var B = { + exports: {} +}; +(function (S, O) { + (function (i) { + i(Q.requireCodemirror(), L.requireSearchcursor(), z.dialogExports); + })(function (i) { + i.defineOption("search", { + bottom: !1 + }); + function y(e, n) { + return typeof e == "string" ? e = new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), n ? "gi" : "g") : e.global || (e = new RegExp(e.source, e.ignoreCase ? "gi" : "g")), { + token: function (t) { + e.lastIndex = t.pos; + var o = e.exec(t.string); + if (o && o.index == t.pos) return t.pos += o[0].length || 1, "searching"; + o ? t.pos = o.index : t.skipToEnd(); + } + }; + } + a(y, "searchOverlay"); + function v() { + this.posFrom = this.posTo = this.lastQuery = this.query = null, this.overlay = null; + } + a(v, "SearchState"); + function h(e) { + return e.state.search || (e.state.search = new v()); + } + a(h, "getSearchState"); + function m(e) { + return typeof e == "string" && e == e.toLowerCase(); + } + a(m, "queryCaseInsensitive"); + function N(e, n, t) { + return e.getSearchCursor(n, t, { + caseFold: m(n), + multiline: !0 + }); + } + a(N, "getSearchCursor"); + function j(e, n, t, o, r) { + e.openDialog(n, o, { + value: t, + selectValueOnOpen: !0, + closeOnEnter: !1, + onClose: function () { + w(e); + }, + onKeyDown: r, + bottom: e.options.search.bottom + }); + } + a(j, "persistentDialog"); + function D(e, n, t, o, r) { + e.openDialog ? e.openDialog(n, r, { + value: o, + selectValueOnOpen: !0, + bottom: e.options.search.bottom + }) : r(prompt(t, o)); + } + a(D, "dialog"); + function k(e, n, t, o) { + e.openConfirm ? e.openConfirm(n, o) : confirm(t) && o[0](); + } + a(k, "confirmDialog"); + function C(e) { + return e.replace(/\\([nrt\\])/g, function (n, t) { + return t == "n" ? ` +` : t == "r" ? "\r" : t == "t" ? " " : t == "\\" ? "\\" : n; + }); + } + a(C, "parseString"); + function T(e) { + var n = e.match(/^\/(.*)\/([a-z]*)$/); + if (n) try { + e = new RegExp(n[1], n[2].indexOf("i") == -1 ? "" : "i"); + } catch {} else e = C(e); + return (typeof e == "string" ? e == "" : e.test("")) && (e = /x^/), e; + } + a(T, "parseQuery"); + function P(e, n, t) { + n.queryText = t, n.query = T(t), e.removeOverlay(n.overlay, m(n.query)), n.overlay = y(n.query, m(n.query)), e.addOverlay(n.overlay), e.showMatchesOnScrollbar && (n.annotate && (n.annotate.clear(), n.annotate = null), n.annotate = e.showMatchesOnScrollbar(n.query, m(n.query))); + } + a(P, "startSearch"); + function b(e, n, t, o) { + var r = h(e); + if (r.query) return R(e, n); + var s = e.getSelection() || r.lastQuery; + if (s instanceof RegExp && s.source == "x^" && (s = null), t && e.openDialog) { + var c = null, + u = a(function (f, x) { + i.e_stop(x), f && (f != r.queryText && (P(e, r, f), r.posFrom = r.posTo = e.getCursor()), c && (c.style.opacity = 1), R(e, x.shiftKey, function (d, g) { + var p; + g.line < 3 && document.querySelector && (p = e.display.wrapper.querySelector(".CodeMirror-dialog")) && p.getBoundingClientRect().bottom - 4 > e.cursorCoords(g, "window").top && ((c = p).style.opacity = .4); + })); + }, "searchNext"); + j(e, E(e), s, u, function (f, x) { + var d = i.keyName(f), + g = e.getOption("extraKeys"), + p = g && g[d] || i.keyMap[e.getOption("keyMap")][d]; + p == "findNext" || p == "findPrev" || p == "findPersistentNext" || p == "findPersistentPrev" ? (i.e_stop(f), P(e, h(e), x), e.execCommand(p)) : (p == "find" || p == "findPersistent") && (i.e_stop(f), u(x, f)); + }), o && s && (P(e, r, s), R(e, n)); + } else D(e, E(e), "Search for:", s, function (f) { + f && !r.query && e.operation(function () { + P(e, r, f), r.posFrom = r.posTo = e.getCursor(), R(e, n); + }); + }); + } + a(b, "doSearch"); + function R(e, n, t) { + e.operation(function () { + var o = h(e), + r = N(e, o.query, n ? o.posFrom : o.posTo); + !r.find(n) && (r = N(e, o.query, n ? i.Pos(e.lastLine()) : i.Pos(e.firstLine(), 0)), !r.find(n)) || (e.setSelection(r.from(), r.to()), e.scrollIntoView({ + from: r.from(), + to: r.to() + }, 20), o.posFrom = r.from(), o.posTo = r.to(), t && t(r.from(), r.to())); + }); + } + a(R, "findNext"); + function w(e) { + e.operation(function () { + var n = h(e); + n.lastQuery = n.query, n.query && (n.query = n.queryText = null, e.removeOverlay(n.overlay), n.annotate && (n.annotate.clear(), n.annotate = null)); + }); + } + a(w, "clearSearch"); + function l(e, n) { + var t = e ? document.createElement(e) : document.createDocumentFragment(); + for (var o in n) t[o] = n[o]; + for (var r = 2; r < arguments.length; r++) { + var s = arguments[r]; + t.appendChild(typeof s == "string" ? document.createTextNode(s) : s); + } + return t; + } + a(l, "el"); + function E(e) { + return l("", null, l("span", { + className: "CodeMirror-search-label" + }, e.phrase("Search:")), " ", l("input", { + type: "text", + style: "width: 10em", + className: "CodeMirror-search-field" + }), " ", l("span", { + style: "color: #888", + className: "CodeMirror-search-hint" + }, e.phrase("(Use /re/ syntax for regexp search)"))); + } + a(E, "getQueryDialog"); + function A(e) { + return l("", null, " ", l("input", { + type: "text", + style: "width: 10em", + className: "CodeMirror-search-field" + }), " ", l("span", { + style: "color: #888", + className: "CodeMirror-search-hint" + }, e.phrase("(Use /re/ syntax for regexp search)"))); + } + a(A, "getReplaceQueryDialog"); + function I(e) { + return l("", null, l("span", { + className: "CodeMirror-search-label" + }, e.phrase("With:")), " ", l("input", { + type: "text", + style: "width: 10em", + className: "CodeMirror-search-field" + })); + } + a(I, "getReplacementQueryDialog"); + function V(e) { + return l("", null, l("span", { + className: "CodeMirror-search-label" + }, e.phrase("Replace?")), " ", l("button", {}, e.phrase("Yes")), " ", l("button", {}, e.phrase("No")), " ", l("button", {}, e.phrase("All")), " ", l("button", {}, e.phrase("Stop"))); + } + a(V, "getDoReplaceConfirm"); + function _(e, n, t) { + e.operation(function () { + for (var o = N(e, n); o.findNext();) if (typeof n != "string") { + var r = e.getRange(o.from(), o.to()).match(n); + o.replace(t.replace(/\$(\d)/g, function (s, c) { + return r[c]; + })); + } else o.replace(t); + }); + } + a(_, "replaceAll"); + function F(e, n) { + if (!e.getOption("readOnly")) { + var t = e.getSelection() || h(e).lastQuery, + o = n ? e.phrase("Replace all:") : e.phrase("Replace:"), + r = l("", null, l("span", { + className: "CodeMirror-search-label" + }, o), A(e)); + D(e, r, o, t, function (s) { + s && (s = T(s), D(e, I(e), e.phrase("Replace with:"), "", function (c) { + if (c = C(c), n) _(e, s, c);else { + w(e); + var u = N(e, s, e.getCursor("from")), + f = a(function () { + var d = u.from(), + g; + !(g = u.findNext()) && (u = N(e, s), !(g = u.findNext()) || d && u.from().line == d.line && u.from().ch == d.ch) || (e.setSelection(u.from(), u.to()), e.scrollIntoView({ + from: u.from(), + to: u.to() + }), k(e, V(e), e.phrase("Replace?"), [function () { + x(g); + }, f, function () { + _(e, s, c); + }])); + }, "advance"), + x = a(function (d) { + u.replace(typeof s == "string" ? c : c.replace(/\$(\d)/g, function (g, p) { + return d[p]; + })), f(); + }, "doReplace"); + f(); + } + })); + }); + } + } + a(F, "replace"), i.commands.find = function (e) { + w(e), b(e); + }, i.commands.findPersistent = function (e) { + w(e), b(e, !1, !0); + }, i.commands.findPersistentNext = function (e) { + b(e, !1, !0, !0); + }, i.commands.findPersistentPrev = function (e) { + b(e, !0, !0, !0); + }, i.commands.findNext = b, i.commands.findPrev = function (e) { + b(e, !0); + }, i.commands.clearSearch = w, i.commands.replace = F, i.commands.replaceAll = function (e) { + F(e, !0); + }; + }); +})(); +var $ = B.exports; +const W = Q.getDefaultExportFromCjs($), + Y = U({ + __proto__: null, + default: W + }, [$]); +exports.search = Y; + +/***/ }), + +/***/ "../../graphiql-react/dist/searchcursor.cjs.js": +/*!*****************************************************!*\ + !*** ../../graphiql-react/dist/searchcursor.cjs.js ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +var n = Object.defineProperty; +var u = (r, o) => n(r, "name", { + value: o, + configurable: !0 +}); +const i = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"), + f = __webpack_require__(/*! ./searchcursor.cjs2.js */ "../../graphiql-react/dist/searchcursor.cjs2.js"); +function l(r, o) { + for (var c = 0; c < o.length; c++) { + const e = o[c]; + if (typeof e != "string" && !Array.isArray(e)) { + for (const t in e) if (t !== "default" && !(t in r)) { + const s = Object.getOwnPropertyDescriptor(e, t); + s && Object.defineProperty(r, t, s.get ? s : { + enumerable: !0, + get: () => e[t] + }); + } + } + } + return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { + value: "Module" + })); +} +u(l, "_mergeNamespaces"); +var a = f.requireSearchcursor(); +const g = i.getDefaultExportFromCjs(a), + p = l({ + __proto__: null, + default: g + }, [a]); +exports.searchcursor = p; + +/***/ }), + +/***/ "../../graphiql-react/dist/searchcursor.cjs2.js": +/*!******************************************************!*\ + !*** ../../graphiql-react/dist/searchcursor.cjs2.js ***! + \******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +var W = Object.defineProperty; +var o = (d, E) => W(d, "name", { + value: E, + configurable: !0 +}); +const G = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); +var N = { + exports: {} + }, + b; +function H() { + return b || (b = 1, function (d, E) { + (function (m) { + m(G.requireCodemirror()); + })(function (m) { + var a = m.Pos; + function B(e) { + var t = e.flags; + return t !== null && t !== void 0 ? t : (e.ignoreCase ? "i" : "") + (e.global ? "g" : "") + (e.multiline ? "m" : ""); + } + o(B, "regexpFlags"); + function F(e, t) { + for (var n = B(e), r = n, l = 0; l < t.length; l++) r.indexOf(t.charAt(l)) == -1 && (r += t.charAt(l)); + return n == r ? e : new RegExp(e.source, r); + } + o(F, "ensureFlags"); + function R(e) { + return /\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source); + } + o(R, "maybeMultiline"); + function I(e, t, n) { + t = F(t, "g"); + for (var r = n.line, l = n.ch, i = e.lastLine(); r <= i; r++, l = 0) { + t.lastIndex = l; + var h = e.getLine(r), + f = t.exec(h); + if (f) return { + from: a(r, f.index), + to: a(r, f.index + f[0].length), + match: f + }; + } + } + o(I, "searchRegexpForward"); + function j(e, t, n) { + if (!R(t)) return I(e, t, n); + t = F(t, "gm"); + for (var r, l = 1, i = n.line, h = e.lastLine(); i <= h;) { + for (var f = 0; f < l && !(i > h); f++) { + var p = e.getLine(i++); + r = r == null ? p : r + ` +` + p; + } + l = l * 2, t.lastIndex = n.ch; + var u = t.exec(r); + if (u) { + var s = r.slice(0, u.index).split(` +`), + c = u[0].split(` +`), + g = n.line + s.length - 1, + v = s[s.length - 1].length; + return { + from: a(g, v), + to: a(g + c.length - 1, c.length == 1 ? v + c[0].length : c[c.length - 1].length), + match: u + }; + } + } + } + o(j, "searchRegexpForwardMultiline"); + function z(e, t, n) { + for (var r, l = 0; l <= e.length;) { + t.lastIndex = l; + var i = t.exec(e); + if (!i) break; + var h = i.index + i[0].length; + if (h > e.length - n) break; + (!r || h > r.index + r[0].length) && (r = i), l = i.index + 1; + } + return r; + } + o(z, "lastMatchIn"); + function D(e, t, n) { + t = F(t, "g"); + for (var r = n.line, l = n.ch, i = e.firstLine(); r >= i; r--, l = -1) { + var h = e.getLine(r), + f = z(h, t, l < 0 ? 0 : h.length - l); + if (f) return { + from: a(r, f.index), + to: a(r, f.index + f[0].length), + match: f + }; + } + } + o(D, "searchRegexpBackward"); + function A(e, t, n) { + if (!R(t)) return D(e, t, n); + t = F(t, "gm"); + for (var r, l = 1, i = e.getLine(n.line).length - n.ch, h = n.line, f = e.firstLine(); h >= f;) { + for (var p = 0; p < l && h >= f; p++) { + var u = e.getLine(h--); + r = r == null ? u : u + ` +` + r; + } + l *= 2; + var s = z(r, t, i); + if (s) { + var c = r.slice(0, s.index).split(` +`), + g = s[0].split(` +`), + v = h + c.length, + x = c[c.length - 1].length; + return { + from: a(v, x), + to: a(v + g.length - 1, g.length == 1 ? x + g[0].length : g[g.length - 1].length), + match: s + }; + } + } + } + o(A, "searchRegexpBackwardMultiline"); + var P, k; + String.prototype.normalize ? (P = o(function (e) { + return e.normalize("NFD").toLowerCase(); + }, "doFold"), k = o(function (e) { + return e.normalize("NFD"); + }, "noFold")) : (P = o(function (e) { + return e.toLowerCase(); + }, "doFold"), k = o(function (e) { + return e; + }, "noFold")); + function L(e, t, n, r) { + if (e.length == t.length) return n; + for (var l = 0, i = n + Math.max(0, e.length - t.length);;) { + if (l == i) return l; + var h = l + i >> 1, + f = r(e.slice(0, h)).length; + if (f == n) return h; + f > n ? i = h : l = h + 1; + } + } + o(L, "adjustPos"); + function y(e, t, n, r) { + if (!t.length) return null; + var l = r ? P : k, + i = l(t).split(/\r|\n\r?/); + t: for (var h = n.line, f = n.ch, p = e.lastLine() + 1 - i.length; h <= p; h++, f = 0) { + var u = e.getLine(h).slice(f), + s = l(u); + if (i.length == 1) { + var c = s.indexOf(i[0]); + if (c == -1) continue t; + var n = L(u, s, c, l) + f; + return { + from: a(h, L(u, s, c, l) + f), + to: a(h, L(u, s, c + i[0].length, l) + f) + }; + } else { + var g = s.length - i[0].length; + if (s.slice(g) != i[0]) continue t; + for (var v = 1; v < i.length - 1; v++) if (l(e.getLine(h + v)) != i[v]) continue t; + var x = e.getLine(h + i.length - 1), + O = l(x), + S = i[i.length - 1]; + if (O.slice(0, S.length) != S) continue t; + return { + from: a(h, L(u, s, g, l) + f), + to: a(h + i.length - 1, L(x, O, S.length, l)) + }; + } + } + } + o(y, "searchStringForward"); + function C(e, t, n, r) { + if (!t.length) return null; + var l = r ? P : k, + i = l(t).split(/\r|\n\r?/); + t: for (var h = n.line, f = n.ch, p = e.firstLine() - 1 + i.length; h >= p; h--, f = -1) { + var u = e.getLine(h); + f > -1 && (u = u.slice(0, f)); + var s = l(u); + if (i.length == 1) { + var c = s.lastIndexOf(i[0]); + if (c == -1) continue t; + return { + from: a(h, L(u, s, c, l)), + to: a(h, L(u, s, c + i[0].length, l)) + }; + } else { + var g = i[i.length - 1]; + if (s.slice(0, g.length) != g) continue t; + for (var v = 1, n = h - i.length + 1; v < i.length - 1; v++) if (l(e.getLine(n + v)) != i[v]) continue t; + var x = e.getLine(h + 1 - i.length), + O = l(x); + if (O.slice(O.length - i[0].length) != i[0]) continue t; + return { + from: a(h + 1 - i.length, L(x, O, x.length - i[0].length, l)), + to: a(h, L(u, s, g.length, l)) + }; + } + } + } + o(C, "searchStringBackward"); + function w(e, t, n, r) { + this.atOccurrence = !1, this.afterEmptyMatch = !1, this.doc = e, n = n ? e.clipPos(n) : a(0, 0), this.pos = { + from: n, + to: n + }; + var l; + typeof r == "object" ? l = r.caseFold : (l = r, r = null), typeof t == "string" ? (l == null && (l = !1), this.matches = function (i, h) { + return (i ? C : y)(e, t, h, l); + }) : (t = F(t, "gm"), !r || r.multiline !== !1 ? this.matches = function (i, h) { + return (i ? A : j)(e, t, h); + } : this.matches = function (i, h) { + return (i ? D : I)(e, t, h); + }); + } + o(w, "SearchCursor"), w.prototype = { + findNext: function () { + return this.find(!1); + }, + findPrevious: function () { + return this.find(!0); + }, + find: function (e) { + var t = this.doc.clipPos(e ? this.pos.from : this.pos.to); + if (this.afterEmptyMatch && this.atOccurrence && (t = a(t.line, t.ch), e ? (t.ch--, t.ch < 0 && (t.line--, t.ch = (this.doc.getLine(t.line) || "").length)) : (t.ch++, t.ch > (this.doc.getLine(t.line) || "").length && (t.ch = 0, t.line++)), m.cmpPos(t, this.doc.clipPos(t)) != 0)) return this.atOccurrence = !1; + var n = this.matches(e, t); + if (this.afterEmptyMatch = n && m.cmpPos(n.from, n.to) == 0, n) return this.pos = n, this.atOccurrence = !0, this.pos.match || !0; + var r = a(e ? this.doc.firstLine() : this.doc.lastLine() + 1, 0); + return this.pos = { + from: r, + to: r + }, this.atOccurrence = !1; + }, + from: function () { + if (this.atOccurrence) return this.pos.from; + }, + to: function () { + if (this.atOccurrence) return this.pos.to; + }, + replace: function (e, t) { + if (this.atOccurrence) { + var n = m.splitLines(e); + this.doc.replaceRange(n, this.pos.from, this.pos.to, t), this.pos.to = a(this.pos.from.line + n.length - 1, n[n.length - 1].length + (n.length == 1 ? this.pos.from.ch : 0)); + } + } + }, m.defineExtension("getSearchCursor", function (e, t, n) { + return new w(this.doc, e, t, n); + }), m.defineDocExtension("getSearchCursor", function (e, t, n) { + return new w(this, e, t, n); + }), m.defineExtension("selectMatches", function (e, t) { + for (var n = [], r = this.getSearchCursor(e, this.getCursor("from"), t); r.findNext() && !(m.cmpPos(r.to(), this.getCursor("to")) > 0);) n.push({ + anchor: r.from(), + head: r.to() + }); + n.length && this.setSelections(n, 0); + }); + }); + }()), N.exports; +} +o(H, "requireSearchcursor"); +exports.requireSearchcursor = H; + +/***/ }), + +/***/ "../../graphiql-react/dist/show-hint.cjs.js": +/*!**************************************************!*\ + !*** ../../graphiql-react/dist/show-hint.cjs.js ***! + \**************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +var ct = Object.defineProperty; +var p = (H, A) => ct(H, "name", { + value: A, + configurable: !0 +}); +const G = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); +function lt(H, A) { + for (var r = 0; r < A.length; r++) { + const w = A[r]; + if (typeof w != "string" && !Array.isArray(w)) { + for (const v in w) if (v !== "default" && !(v in H)) { + const b = Object.getOwnPropertyDescriptor(w, v); + b && Object.defineProperty(H, v, b.get ? b : { + enumerable: !0, + get: () => w[v] + }); + } + } + } + return Object.freeze(Object.defineProperty(H, Symbol.toStringTag, { + value: "Module" + })); +} +p(lt, "_mergeNamespaces"); +var ht = { + exports: {} +}; +(function (H, A) { + (function (r) { + r(G.requireCodemirror()); + })(function (r) { + var w = "CodeMirror-hint", + v = "CodeMirror-hint-active"; + r.showHint = function (t, e, i) { + if (!e) return t.showHint(i); + i && i.async && (e.async = !0); + var n = { + hint: e + }; + if (i) for (var s in i) n[s] = i[s]; + return t.showHint(n); + }, r.defineExtension("showHint", function (t) { + t = tt(this, this.getCursor("start"), t); + var e = this.listSelections(); + if (!(e.length > 1)) { + if (this.somethingSelected()) { + if (!t.hint.supportsSelection) return; + for (var i = 0; i < e.length; i++) if (e[i].head.line != e[i].anchor.line) return; + } + this.state.completionActive && this.state.completionActive.close(); + var n = this.state.completionActive = new b(this, t); + n.options.hint && (r.signal(this, "startCompletion", this), n.update(!0)); + } + }), r.defineExtension("closeHint", function () { + this.state.completionActive && this.state.completionActive.close(); + }); + function b(t, e) { + if (this.cm = t, this.options = e, this.widget = null, this.debounce = 0, this.tick = 0, this.startPos = this.cm.getCursor("start"), this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length, this.options.updateOnCursorActivity) { + var i = this; + t.on("cursorActivity", this.activityFunc = function () { + i.cursorActivity(); + }); + } + } + p(b, "Completion"); + var Q = window.requestAnimationFrame || function (t) { + return setTimeout(t, 1e3 / 60); + }, + Z = window.cancelAnimationFrame || clearTimeout; + b.prototype = { + close: function () { + this.active() && (this.cm.state.completionActive = null, this.tick = null, this.options.updateOnCursorActivity && this.cm.off("cursorActivity", this.activityFunc), this.widget && this.data && r.signal(this.data, "close"), this.widget && this.widget.close(), r.signal(this.cm, "endCompletion", this.cm)); + }, + active: function () { + return this.cm.state.completionActive == this; + }, + pick: function (t, e) { + var i = t.list[e], + n = this; + this.cm.operation(function () { + i.hint ? i.hint(n.cm, t, i) : n.cm.replaceRange(_(i), i.from || t.from, i.to || t.to, "complete"), r.signal(t, "pick", i), n.cm.scrollIntoView(); + }), this.options.closeOnPick && this.close(); + }, + cursorActivity: function () { + this.debounce && (Z(this.debounce), this.debounce = 0); + var t = this.startPos; + this.data && (t = this.data.from); + var e = this.cm.getCursor(), + i = this.cm.getLine(e.line); + if (e.line != this.startPos.line || i.length - e.ch != this.startLen - this.startPos.ch || e.ch < t.ch || this.cm.somethingSelected() || !e.ch || this.options.closeCharacters.test(i.charAt(e.ch - 1))) this.close();else { + var n = this; + this.debounce = Q(function () { + n.update(); + }), this.widget && this.widget.disable(); + } + }, + update: function (t) { + if (this.tick != null) { + var e = this, + i = ++this.tick; + U(this.options.hint, this.cm, this.options, function (n) { + e.tick == i && e.finishUpdate(n, t); + }); + } + }, + finishUpdate: function (t, e) { + this.data && r.signal(this.data, "update"); + var i = this.widget && this.widget.picked || e && this.options.completeSingle; + this.widget && this.widget.close(), this.data = t, t && t.list.length && (i && t.list.length == 1 ? this.pick(t, 0) : (this.widget = new K(this, t), r.signal(t, "shown"))); + } + }; + function tt(t, e, i) { + var n = t.options.hintOptions, + s = {}; + for (var c in D) s[c] = D[c]; + if (n) for (var c in n) n[c] !== void 0 && (s[c] = n[c]); + if (i) for (var c in i) i[c] !== void 0 && (s[c] = i[c]); + return s.hint.resolve && (s.hint = s.hint.resolve(t, e)), s; + } + p(tt, "parseOptions"); + function _(t) { + return typeof t == "string" ? t : t.text; + } + p(_, "getText"); + function et(t, e) { + var i = { + Up: function () { + e.moveFocus(-1); + }, + Down: function () { + e.moveFocus(1); + }, + PageUp: function () { + e.moveFocus(-e.menuSize() + 1, !0); + }, + PageDown: function () { + e.moveFocus(e.menuSize() - 1, !0); + }, + Home: function () { + e.setFocus(0); + }, + End: function () { + e.setFocus(e.length - 1); + }, + Enter: e.pick, + Tab: e.pick, + Esc: e.close + }, + n = /Mac/.test(navigator.platform); + n && (i["Ctrl-P"] = function () { + e.moveFocus(-1); + }, i["Ctrl-N"] = function () { + e.moveFocus(1); + }); + var s = t.options.customKeys, + c = s ? {} : i; + function o(u, l) { + var a; + typeof l != "string" ? a = p(function (S) { + return l(S, e); + }, "bound") : i.hasOwnProperty(l) ? a = i[l] : a = l, c[u] = a; + } + if (p(o, "addBinding"), s) for (var f in s) s.hasOwnProperty(f) && o(f, s[f]); + var h = t.options.extraKeys; + if (h) for (var f in h) h.hasOwnProperty(f) && o(f, h[f]); + return c; + } + p(et, "buildKeyMap"); + function B(t, e) { + for (; e && e != t;) { + if (e.nodeName.toUpperCase() === "LI" && e.parentNode == t) return e; + e = e.parentNode; + } + } + p(B, "getHintElement"); + function K(t, e) { + this.id = "cm-complete-" + Math.floor(Math.random(1e6)), this.completion = t, this.data = e, this.picked = !1; + var i = this, + n = t.cm, + s = n.getInputField().ownerDocument, + c = s.defaultView || s.parentWindow, + o = this.hints = s.createElement("ul"); + o.setAttribute("role", "listbox"), o.setAttribute("aria-expanded", "true"), o.id = this.id; + var f = t.cm.options.theme; + o.className = "CodeMirror-hints " + f, this.selectedHint = e.selectedHint || 0; + for (var h = e.list, u = 0; u < h.length; ++u) { + var l = o.appendChild(s.createElement("li")), + a = h[u], + S = w + (u != this.selectedHint ? "" : " " + v); + a.className != null && (S = a.className + " " + S), l.className = S, u == this.selectedHint && l.setAttribute("aria-selected", "true"), l.id = this.id + "-" + u, l.setAttribute("role", "option"), a.render ? a.render(l, e, a) : l.appendChild(s.createTextNode(a.displayText || _(a))), l.hintId = u; + } + var T = t.options.container || s.body, + y = n.cursorCoords(t.options.alignWithWord ? e.from : null), + k = y.left, + O = y.bottom, + j = !0, + F = 0, + E = 0; + if (T !== s.body) { + var st = ["absolute", "relative", "fixed"].indexOf(c.getComputedStyle(T).position) !== -1, + W = st ? T : T.offsetParent, + M = W.getBoundingClientRect(), + q = s.body.getBoundingClientRect(); + F = M.left - q.left - W.scrollLeft, E = M.top - q.top - W.scrollTop; + } + o.style.left = k - F + "px", o.style.top = O - E + "px"; + var N = c.innerWidth || Math.max(s.body.offsetWidth, s.documentElement.offsetWidth), + L = c.innerHeight || Math.max(s.body.offsetHeight, s.documentElement.offsetHeight); + T.appendChild(o), n.getInputField().setAttribute("aria-autocomplete", "list"), n.getInputField().setAttribute("aria-owns", this.id), n.getInputField().setAttribute("aria-activedescendant", this.id + "-" + this.selectedHint); + var m = t.options.moveOnOverlap ? o.getBoundingClientRect() : new DOMRect(), + z = t.options.paddingForScrollbar ? o.scrollHeight > o.clientHeight + 1 : !1, + x; + setTimeout(function () { + x = n.getScrollInfo(); + }); + var ot = m.bottom - L; + if (ot > 0) { + var P = m.bottom - m.top, + rt = y.top - (y.bottom - m.top); + if (rt - P > 0) o.style.top = (O = y.top - P - E) + "px", j = !1;else if (P > L) { + o.style.height = L - 5 + "px", o.style.top = (O = y.bottom - m.top - E) + "px"; + var V = n.getCursor(); + e.from.ch != V.ch && (y = n.cursorCoords(V), o.style.left = (k = y.left - F) + "px", m = o.getBoundingClientRect()); + } + } + var C = m.right - N; + if (z && (C += n.display.nativeBarWidth), C > 0 && (m.right - m.left > N && (o.style.width = N - 5 + "px", C -= m.right - m.left - N), o.style.left = (k = y.left - C - F) + "px"), z) for (var I = o.firstChild; I; I = I.nextSibling) I.style.paddingRight = n.display.nativeBarWidth + "px"; + if (n.addKeyMap(this.keyMap = et(t, { + moveFocus: function (d, g) { + i.changeActive(i.selectedHint + d, g); + }, + setFocus: function (d) { + i.changeActive(d); + }, + menuSize: function () { + return i.screenAmount(); + }, + length: h.length, + close: function () { + t.close(); + }, + pick: function () { + i.pick(); + }, + data: e + })), t.options.closeOnUnfocus) { + var Y; + n.on("blur", this.onBlur = function () { + Y = setTimeout(function () { + t.close(); + }, 100); + }), n.on("focus", this.onFocus = function () { + clearTimeout(Y); + }); + } + n.on("scroll", this.onScroll = function () { + var d = n.getScrollInfo(), + g = n.getWrapperElement().getBoundingClientRect(); + x || (x = n.getScrollInfo()); + var X = O + x.top - d.top, + R = X - (c.pageYOffset || (s.documentElement || s.body).scrollTop); + if (j || (R += o.offsetHeight), R <= g.top || R >= g.bottom) return t.close(); + o.style.top = X + "px", o.style.left = k + x.left - d.left + "px"; + }), r.on(o, "dblclick", function (d) { + var g = B(o, d.target || d.srcElement); + g && g.hintId != null && (i.changeActive(g.hintId), i.pick()); + }), r.on(o, "click", function (d) { + var g = B(o, d.target || d.srcElement); + g && g.hintId != null && (i.changeActive(g.hintId), t.options.completeOnSingleClick && i.pick()); + }), r.on(o, "mousedown", function () { + setTimeout(function () { + n.focus(); + }, 20); + }); + var $ = this.getSelectedHintRange(); + return ($.from !== 0 || $.to !== 0) && this.scrollToActive(), r.signal(e, "select", h[this.selectedHint], o.childNodes[this.selectedHint]), !0; + } + p(K, "Widget"), K.prototype = { + close: function () { + if (this.completion.widget == this) { + this.completion.widget = null, this.hints.parentNode && this.hints.parentNode.removeChild(this.hints), this.completion.cm.removeKeyMap(this.keyMap); + var t = this.completion.cm.getInputField(); + t.removeAttribute("aria-activedescendant"), t.removeAttribute("aria-owns"); + var e = this.completion.cm; + this.completion.options.closeOnUnfocus && (e.off("blur", this.onBlur), e.off("focus", this.onFocus)), e.off("scroll", this.onScroll); + } + }, + disable: function () { + this.completion.cm.removeKeyMap(this.keyMap); + var t = this; + this.keyMap = { + Enter: function () { + t.picked = !0; + } + }, this.completion.cm.addKeyMap(this.keyMap); + }, + pick: function () { + this.completion.pick(this.data, this.selectedHint); + }, + changeActive: function (t, e) { + if (t >= this.data.list.length ? t = e ? this.data.list.length - 1 : 0 : t < 0 && (t = e ? 0 : this.data.list.length - 1), this.selectedHint != t) { + var i = this.hints.childNodes[this.selectedHint]; + i && (i.className = i.className.replace(" " + v, ""), i.removeAttribute("aria-selected")), i = this.hints.childNodes[this.selectedHint = t], i.className += " " + v, i.setAttribute("aria-selected", "true"), this.completion.cm.getInputField().setAttribute("aria-activedescendant", i.id), this.scrollToActive(), r.signal(this.data, "select", this.data.list[this.selectedHint], i); + } + }, + scrollToActive: function () { + var t = this.getSelectedHintRange(), + e = this.hints.childNodes[t.from], + i = this.hints.childNodes[t.to], + n = this.hints.firstChild; + e.offsetTop < this.hints.scrollTop ? this.hints.scrollTop = e.offsetTop - n.offsetTop : i.offsetTop + i.offsetHeight > this.hints.scrollTop + this.hints.clientHeight && (this.hints.scrollTop = i.offsetTop + i.offsetHeight - this.hints.clientHeight + n.offsetTop); + }, + screenAmount: function () { + return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1; + }, + getSelectedHintRange: function () { + var t = this.completion.options.scrollMargin || 0; + return { + from: Math.max(0, this.selectedHint - t), + to: Math.min(this.data.list.length - 1, this.selectedHint + t) + }; + } + }; + function it(t, e) { + if (!t.somethingSelected()) return e; + for (var i = [], n = 0; n < e.length; n++) e[n].supportsSelection && i.push(e[n]); + return i; + } + p(it, "applicableHelpers"); + function U(t, e, i, n) { + if (t.async) t(e, n, i);else { + var s = t(e, i); + s && s.then ? s.then(n) : n(s); + } + } + p(U, "fetchHints"); + function nt(t, e) { + var i = t.getHelpers(e, "hint"), + n; + if (i.length) { + var s = p(function (c, o, f) { + var h = it(c, i); + function u(l) { + if (l == h.length) return o(null); + U(h[l], c, f, function (a) { + a && a.list.length > 0 ? o(a) : u(l + 1); + }); + } + p(u, "run"), u(0); + }, "resolved"); + return s.async = !0, s.supportsSelection = !0, s; + } else return (n = t.getHelper(t.getCursor(), "hintWords")) ? function (c) { + return r.hint.fromList(c, { + words: n + }); + } : r.hint.anyword ? function (c, o) { + return r.hint.anyword(c, o); + } : function () {}; + } + p(nt, "resolveAutoHints"), r.registerHelper("hint", "auto", { + resolve: nt + }), r.registerHelper("hint", "fromList", function (t, e) { + var i = t.getCursor(), + n = t.getTokenAt(i), + s, + c = r.Pos(i.line, n.start), + o = i; + n.start < i.ch && /\w/.test(n.string.charAt(i.ch - n.start - 1)) ? s = n.string.substr(0, i.ch - n.start) : (s = "", c = i); + for (var f = [], h = 0; h < e.words.length; h++) { + var u = e.words[h]; + u.slice(0, s.length) == s && f.push(u); + } + if (f.length) return { + list: f, + from: c, + to: o + }; + }), r.commands.autocomplete = r.showHint; + var D = { + hint: r.hint.auto, + completeSingle: !0, + alignWithWord: !0, + closeCharacters: /[\s()\[\]{};:>,]/, + closeOnPick: !0, + closeOnUnfocus: !0, + updateOnCursorActivity: !0, + completeOnSingleClick: !0, + container: null, + customKeys: null, + extraKeys: null, + paddingForScrollbar: !0, + moveOnOverlap: !0 + }; + r.defineOption("hintOptions", null); + }); +})(); +var J = ht.exports; +const at = G.getDefaultExportFromCjs(J), + ft = lt({ + __proto__: null, + default: at + }, [J]); +exports.showHint = ft; + +/***/ }), + +/***/ "../../graphiql-react/dist/sublime.cjs.js": +/*!************************************************!*\ + !*** ../../graphiql-react/dist/sublime.cjs.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +var _ = Object.defineProperty; +var v = (m, B) => _(m, "name", { + value: B, + configurable: !0 +}); +const E = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"), + Y = __webpack_require__(/*! ./searchcursor.cjs2.js */ "../../graphiql-react/dist/searchcursor.cjs2.js"), + z = __webpack_require__(/*! ./matchbrackets.cjs2.js */ "../../graphiql-react/dist/matchbrackets.cjs2.js"); +function J(m, B) { + for (var h = 0; h < B.length; h++) { + const a = B[h]; + if (typeof a != "string" && !Array.isArray(a)) { + for (const f in a) if (f !== "default" && !(f in m)) { + const A = Object.getOwnPropertyDescriptor(a, f); + A && Object.defineProperty(m, f, A.get ? A : { + enumerable: !0, + get: () => a[f] + }); + } + } + } + return Object.freeze(Object.defineProperty(m, Symbol.toStringTag, { + value: "Module" + })); +} +v(J, "_mergeNamespaces"); +var G = { + exports: {} +}; +(function (m, B) { + (function (h) { + h(E.requireCodemirror(), Y.requireSearchcursor(), z.requireMatchbrackets()); + })(function (h) { + var a = h.commands, + f = h.Pos; + function A(e, t, n) { + if (n < 0 && t.ch == 0) return e.clipPos(f(t.line - 1)); + var r = e.getLine(t.line); + if (n > 0 && t.ch >= r.length) return e.clipPos(f(t.line + 1, 0)); + for (var l = "start", i, o = t.ch, s = o, u = n < 0 ? 0 : r.length, d = 0; s != u; s += n, d++) { + var p = r.charAt(n < 0 ? s - 1 : s), + c = p != "_" && h.isWordChar(p) ? "w" : "o"; + if (c == "w" && p.toUpperCase() == p && (c = "W"), l == "start") c != "o" ? (l = "in", i = c) : o = s + n;else if (l == "in" && i != c) { + if (i == "w" && c == "W" && n < 0 && s--, i == "W" && c == "w" && n > 0) if (s == o + 1) { + i = "w"; + continue; + } else s--; + break; + } + } + return f(t.line, s); + } + v(A, "findPosSubword"); + function T(e, t) { + e.extendSelectionsBy(function (n) { + return e.display.shift || e.doc.extend || n.empty() ? A(e.doc, n.head, t) : t < 0 ? n.from() : n.to(); + }); + } + v(T, "moveSubword"), a.goSubwordLeft = function (e) { + T(e, -1); + }, a.goSubwordRight = function (e) { + T(e, 1); + }, a.scrollLineUp = function (e) { + var t = e.getScrollInfo(); + if (!e.somethingSelected()) { + var n = e.lineAtHeight(t.top + t.clientHeight, "local"); + e.getCursor().line >= n && e.execCommand("goLineUp"); + } + e.scrollTo(null, t.top - e.defaultTextHeight()); + }, a.scrollLineDown = function (e) { + var t = e.getScrollInfo(); + if (!e.somethingSelected()) { + var n = e.lineAtHeight(t.top, "local") + 1; + e.getCursor().line <= n && e.execCommand("goLineDown"); + } + e.scrollTo(null, t.top + e.defaultTextHeight()); + }, a.splitSelectionByLine = function (e) { + for (var t = e.listSelections(), n = [], r = 0; r < t.length; r++) for (var l = t[r].from(), i = t[r].to(), o = l.line; o <= i.line; ++o) i.line > l.line && o == i.line && i.ch == 0 || n.push({ + anchor: o == l.line ? l : f(o, 0), + head: o == i.line ? i : f(o) + }); + e.setSelections(n, 0); + }, a.singleSelectionTop = function (e) { + var t = e.listSelections()[0]; + e.setSelection(t.anchor, t.head, { + scroll: !1 + }); + }, a.selectLine = function (e) { + for (var t = e.listSelections(), n = [], r = 0; r < t.length; r++) { + var l = t[r]; + n.push({ + anchor: f(l.from().line, 0), + head: f(l.to().line + 1, 0) + }); + } + e.setSelections(n); + }; + function x(e, t) { + if (e.isReadOnly()) return h.Pass; + e.operation(function () { + for (var n = e.listSelections().length, r = [], l = -1, i = 0; i < n; i++) { + var o = e.listSelections()[i].head; + if (!(o.line <= l)) { + var s = f(o.line + (t ? 0 : 1), 0); + e.replaceRange(` +`, s, null, "+insertLine"), e.indentLine(s.line, null, !0), r.push({ + head: s, + anchor: s + }), l = o.line + 1; + } + } + e.setSelections(r); + }), e.execCommand("indentAuto"); + } + v(x, "insertLine"), a.insertLineAfter = function (e) { + return x(e, !1); + }, a.insertLineBefore = function (e) { + return x(e, !0); + }; + function K(e, t) { + for (var n = t.ch, r = n, l = e.getLine(t.line); n && h.isWordChar(l.charAt(n - 1));) --n; + for (; r < l.length && h.isWordChar(l.charAt(r));) ++r; + return { + from: f(t.line, n), + to: f(t.line, r), + word: l.slice(n, r) + }; + } + v(K, "wordAt"), a.selectNextOccurrence = function (e) { + var t = e.getCursor("from"), + n = e.getCursor("to"), + r = e.state.sublimeFindFullWord == e.doc.sel; + if (h.cmpPos(t, n) == 0) { + var l = K(e, t); + if (!l.word) return; + e.setSelection(l.from, l.to), r = !0; + } else { + var i = e.getRange(t, n), + o = r ? new RegExp("\\b" + i + "\\b") : i, + s = e.getSearchCursor(o, n), + u = s.findNext(); + if (u || (s = e.getSearchCursor(o, f(e.firstLine(), 0)), u = s.findNext()), !u || H(e.listSelections(), s.from(), s.to())) return; + e.addSelection(s.from(), s.to()); + } + r && (e.state.sublimeFindFullWord = e.doc.sel); + }, a.skipAndSelectNextOccurrence = function (e) { + var t = e.getCursor("anchor"), + n = e.getCursor("head"); + a.selectNextOccurrence(e), h.cmpPos(t, n) != 0 && e.doc.setSelections(e.doc.listSelections().filter(function (r) { + return r.anchor != t || r.head != n; + })); + }; + function y(e, t) { + for (var n = e.listSelections(), r = [], l = 0; l < n.length; l++) { + var i = n[l], + o = e.findPosV(i.anchor, t, "line", i.anchor.goalColumn), + s = e.findPosV(i.head, t, "line", i.head.goalColumn); + o.goalColumn = i.anchor.goalColumn != null ? i.anchor.goalColumn : e.cursorCoords(i.anchor, "div").left, s.goalColumn = i.head.goalColumn != null ? i.head.goalColumn : e.cursorCoords(i.head, "div").left; + var u = { + anchor: o, + head: s + }; + r.push(i), r.push(u); + } + e.setSelections(r); + } + v(y, "addCursorToSelection"), a.addCursorToPrevLine = function (e) { + y(e, -1); + }, a.addCursorToNextLine = function (e) { + y(e, 1); + }; + function H(e, t, n) { + for (var r = 0; r < e.length; r++) if (h.cmpPos(e[r].from(), t) == 0 && h.cmpPos(e[r].to(), n) == 0) return !0; + return !1; + } + v(H, "isSelectedRange"); + var P = "(){}[]"; + function U(e) { + for (var t = e.listSelections(), n = [], r = 0; r < t.length; r++) { + var l = t[r], + i = l.head, + o = e.scanForBracket(i, -1); + if (!o) return !1; + for (;;) { + var s = e.scanForBracket(i, 1); + if (!s) return !1; + if (s.ch == P.charAt(P.indexOf(o.ch) + 1)) { + var u = f(o.pos.line, o.pos.ch + 1); + if (h.cmpPos(u, l.from()) == 0 && h.cmpPos(s.pos, l.to()) == 0) { + if (o = e.scanForBracket(o.pos, -1), !o) return !1; + } else { + n.push({ + anchor: u, + head: s.pos + }); + break; + } + } + i = f(s.pos.line, s.pos.ch + 1); + } + } + return e.setSelections(n), !0; + } + v(U, "selectBetweenBrackets"), a.selectScope = function (e) { + U(e) || e.execCommand("selectAll"); + }, a.selectBetweenBrackets = function (e) { + if (!U(e)) return h.Pass; + }; + function I(e) { + return e ? /\bpunctuation\b/.test(e) ? e : void 0 : null; + } + v(I, "puncType"), a.goToBracket = function (e) { + e.extendSelectionsBy(function (t) { + var n = e.scanForBracket(t.head, 1, I(e.getTokenTypeAt(t.head))); + if (n && h.cmpPos(n.pos, t.head) != 0) return n.pos; + var r = e.scanForBracket(t.head, -1, I(e.getTokenTypeAt(f(t.head.line, t.head.ch + 1)))); + return r && f(r.pos.line, r.pos.ch + 1) || t.head; + }); + }, a.swapLineUp = function (e) { + if (e.isReadOnly()) return h.Pass; + for (var t = e.listSelections(), n = [], r = e.firstLine() - 1, l = [], i = 0; i < t.length; i++) { + var o = t[i], + s = o.from().line - 1, + u = o.to().line; + l.push({ + anchor: f(o.anchor.line - 1, o.anchor.ch), + head: f(o.head.line - 1, o.head.ch) + }), o.to().ch == 0 && !o.empty() && --u, s > r ? n.push(s, u) : n.length && (n[n.length - 1] = u), r = u; + } + e.operation(function () { + for (var d = 0; d < n.length; d += 2) { + var p = n[d], + c = n[d + 1], + b = e.getLine(p); + e.replaceRange("", f(p, 0), f(p + 1, 0), "+swapLine"), c > e.lastLine() ? e.replaceRange(` +` + b, f(e.lastLine()), null, "+swapLine") : e.replaceRange(b + ` +`, f(c, 0), null, "+swapLine"); + } + e.setSelections(l), e.scrollIntoView(); + }); + }, a.swapLineDown = function (e) { + if (e.isReadOnly()) return h.Pass; + for (var t = e.listSelections(), n = [], r = e.lastLine() + 1, l = t.length - 1; l >= 0; l--) { + var i = t[l], + o = i.to().line + 1, + s = i.from().line; + i.to().ch == 0 && !i.empty() && o--, o < r ? n.push(o, s) : n.length && (n[n.length - 1] = s), r = s; + } + e.operation(function () { + for (var u = n.length - 2; u >= 0; u -= 2) { + var d = n[u], + p = n[u + 1], + c = e.getLine(d); + d == e.lastLine() ? e.replaceRange("", f(d - 1), f(d), "+swapLine") : e.replaceRange("", f(d, 0), f(d + 1, 0), "+swapLine"), e.replaceRange(c + ` +`, f(p, 0), null, "+swapLine"); + } + e.scrollIntoView(); + }); + }, a.toggleCommentIndented = function (e) { + e.toggleComment({ + indent: !0 + }); + }, a.joinLines = function (e) { + for (var t = e.listSelections(), n = [], r = 0; r < t.length; r++) { + for (var l = t[r], i = l.from(), o = i.line, s = l.to().line; r < t.length - 1 && t[r + 1].from().line == s;) s = t[++r].to().line; + n.push({ + start: o, + end: s, + anchor: !l.empty() && i + }); + } + e.operation(function () { + for (var u = 0, d = [], p = 0; p < n.length; p++) { + for (var c = n[p], b = c.anchor && f(c.anchor.line - u, c.anchor.ch), w, g = c.start; g <= c.end; g++) { + var S = g - u; + g == c.end && (w = f(S, e.getLine(S).length + 1)), S < e.lastLine() && (e.replaceRange(" ", f(S), f(S + 1, /^\s*/.exec(e.getLine(S + 1))[0].length)), ++u); + } + d.push({ + anchor: b || w, + head: w + }); + } + e.setSelections(d, 0); + }); + }, a.duplicateLine = function (e) { + e.operation(function () { + for (var t = e.listSelections().length, n = 0; n < t; n++) { + var r = e.listSelections()[n]; + r.empty() ? e.replaceRange(e.getLine(r.head.line) + ` +`, f(r.head.line, 0)) : e.replaceRange(e.getRange(r.from(), r.to()), r.from()); + } + e.scrollIntoView(); + }); + }; + function R(e, t, n) { + if (e.isReadOnly()) return h.Pass; + for (var r = e.listSelections(), l = [], i, o = 0; o < r.length; o++) { + var s = r[o]; + if (!s.empty()) { + for (var u = s.from().line, d = s.to().line; o < r.length - 1 && r[o + 1].from().line == d;) d = r[++o].to().line; + r[o].to().ch || d--, l.push(u, d); + } + } + l.length ? i = !0 : l.push(e.firstLine(), e.lastLine()), e.operation(function () { + for (var p = [], c = 0; c < l.length; c += 2) { + var b = l[c], + w = l[c + 1], + g = f(b, 0), + S = f(w), + F = e.getRange(g, S, !1); + t ? F.sort(function (k, L) { + return k < L ? -n : k == L ? 0 : n; + }) : F.sort(function (k, L) { + var W = k.toUpperCase(), + M = L.toUpperCase(); + return W != M && (k = W, L = M), k < L ? -n : k == L ? 0 : n; + }), e.replaceRange(F, g, S), i && p.push({ + anchor: g, + head: f(w + 1, 0) + }); + } + i && e.setSelections(p, 0); + }); + } + v(R, "sortLines"), a.sortLines = function (e) { + R(e, !0, 1); + }, a.reverseSortLines = function (e) { + R(e, !0, -1); + }, a.sortLinesInsensitive = function (e) { + R(e, !1, 1); + }, a.reverseSortLinesInsensitive = function (e) { + R(e, !1, -1); + }, a.nextBookmark = function (e) { + var t = e.state.sublimeBookmarks; + if (t) for (; t.length;) { + var n = t.shift(), + r = n.find(); + if (r) return t.push(n), e.setSelection(r.from, r.to); + } + }, a.prevBookmark = function (e) { + var t = e.state.sublimeBookmarks; + if (t) for (; t.length;) { + t.unshift(t.pop()); + var n = t[t.length - 1].find(); + if (!n) t.pop();else return e.setSelection(n.from, n.to); + } + }, a.toggleBookmark = function (e) { + for (var t = e.listSelections(), n = e.state.sublimeBookmarks || (e.state.sublimeBookmarks = []), r = 0; r < t.length; r++) { + for (var l = t[r].from(), i = t[r].to(), o = t[r].empty() ? e.findMarksAt(l) : e.findMarks(l, i), s = 0; s < o.length; s++) if (o[s].sublimeBookmark) { + o[s].clear(); + for (var u = 0; u < n.length; u++) n[u] == o[s] && n.splice(u--, 1); + break; + } + s == o.length && n.push(e.markText(l, i, { + sublimeBookmark: !0, + clearWhenEmpty: !1 + })); + } + }, a.clearBookmarks = function (e) { + var t = e.state.sublimeBookmarks; + if (t) for (var n = 0; n < t.length; n++) t[n].clear(); + t.length = 0; + }, a.selectBookmarks = function (e) { + var t = e.state.sublimeBookmarks, + n = []; + if (t) for (var r = 0; r < t.length; r++) { + var l = t[r].find(); + l ? n.push({ + anchor: l.from, + head: l.to + }) : t.splice(r--, 0); + } + n.length && e.setSelections(n, 0); + }; + function D(e, t) { + e.operation(function () { + for (var n = e.listSelections(), r = [], l = [], i = 0; i < n.length; i++) { + var o = n[i]; + o.empty() ? (r.push(i), l.push("")) : l.push(t(e.getRange(o.from(), o.to()))); + } + e.replaceSelections(l, "around", "case"); + for (var i = r.length - 1, s; i >= 0; i--) { + var o = n[r[i]]; + if (!(s && h.cmpPos(o.head, s) > 0)) { + var u = K(e, o.head); + s = u.from, e.replaceRange(t(u.word), u.from, u.to); + } + } + }); + } + v(D, "modifyWordOrSelection"), a.smartBackspace = function (e) { + if (e.somethingSelected()) return h.Pass; + e.operation(function () { + for (var t = e.listSelections(), n = e.getOption("indentUnit"), r = t.length - 1; r >= 0; r--) { + var l = t[r].head, + i = e.getRange({ + line: l.line, + ch: 0 + }, l), + o = h.countColumn(i, null, e.getOption("tabSize")), + s = e.findPosH(l, -1, "char", !1); + if (i && !/\S/.test(i) && o % n == 0) { + var u = new f(l.line, h.findColumn(i, o - n, n)); + u.ch != l.ch && (s = u); + } + e.replaceRange("", s, l, "+delete"); + } + }); + }, a.delLineRight = function (e) { + e.operation(function () { + for (var t = e.listSelections(), n = t.length - 1; n >= 0; n--) e.replaceRange("", t[n].anchor, f(t[n].to().line), "+delete"); + e.scrollIntoView(); + }); + }, a.upcaseAtCursor = function (e) { + D(e, function (t) { + return t.toUpperCase(); + }); + }, a.downcaseAtCursor = function (e) { + D(e, function (t) { + return t.toLowerCase(); + }); + }, a.setSublimeMark = function (e) { + e.state.sublimeMark && e.state.sublimeMark.clear(), e.state.sublimeMark = e.setBookmark(e.getCursor()); + }, a.selectToSublimeMark = function (e) { + var t = e.state.sublimeMark && e.state.sublimeMark.find(); + t && e.setSelection(e.getCursor(), t); + }, a.deleteToSublimeMark = function (e) { + var t = e.state.sublimeMark && e.state.sublimeMark.find(); + if (t) { + var n = e.getCursor(), + r = t; + if (h.cmpPos(n, r) > 0) { + var l = r; + r = n, n = l; + } + e.state.sublimeKilled = e.getRange(n, r), e.replaceRange("", n, r); + } + }, a.swapWithSublimeMark = function (e) { + var t = e.state.sublimeMark && e.state.sublimeMark.find(); + t && (e.state.sublimeMark.clear(), e.state.sublimeMark = e.setBookmark(e.getCursor()), e.setCursor(t)); + }, a.sublimeYank = function (e) { + e.state.sublimeKilled != null && e.replaceSelection(e.state.sublimeKilled, null, "paste"); + }, a.showInCenter = function (e) { + var t = e.cursorCoords(null, "local"); + e.scrollTo(null, (t.top + t.bottom) / 2 - e.getScrollInfo().clientHeight / 2); + }; + function N(e) { + var t = e.getCursor("from"), + n = e.getCursor("to"); + if (h.cmpPos(t, n) == 0) { + var r = K(e, t); + if (!r.word) return; + t = r.from, n = r.to; + } + return { + from: t, + to: n, + query: e.getRange(t, n), + word: r + }; + } + v(N, "getTarget"); + function O(e, t) { + var n = N(e); + if (n) { + var r = n.query, + l = e.getSearchCursor(r, t ? n.to : n.from); + (t ? l.findNext() : l.findPrevious()) ? e.setSelection(l.from(), l.to()) : (l = e.getSearchCursor(r, t ? f(e.firstLine(), 0) : e.clipPos(f(e.lastLine()))), (t ? l.findNext() : l.findPrevious()) ? e.setSelection(l.from(), l.to()) : n.word && e.setSelection(n.from, n.to)); + } + } + v(O, "findAndGoTo"), a.findUnder = function (e) { + O(e, !0); + }, a.findUnderPrevious = function (e) { + O(e, !1); + }, a.findAllUnder = function (e) { + var t = N(e); + if (t) { + for (var n = e.getSearchCursor(t.query), r = [], l = -1; n.findNext();) r.push({ + anchor: n.from(), + head: n.to() + }), n.from().line <= t.from.line && n.from().ch <= t.from.ch && l++; + e.setSelections(r, l); + } + }; + var C = h.keyMap; + C.macSublime = { + "Cmd-Left": "goLineStartSmart", + "Shift-Tab": "indentLess", + "Shift-Ctrl-K": "deleteLine", + "Alt-Q": "wrapLines", + "Ctrl-Left": "goSubwordLeft", + "Ctrl-Right": "goSubwordRight", + "Ctrl-Alt-Up": "scrollLineUp", + "Ctrl-Alt-Down": "scrollLineDown", + "Cmd-L": "selectLine", + "Shift-Cmd-L": "splitSelectionByLine", + Esc: "singleSelectionTop", + "Cmd-Enter": "insertLineAfter", + "Shift-Cmd-Enter": "insertLineBefore", + "Cmd-D": "selectNextOccurrence", + "Shift-Cmd-Space": "selectScope", + "Shift-Cmd-M": "selectBetweenBrackets", + "Cmd-M": "goToBracket", + "Cmd-Ctrl-Up": "swapLineUp", + "Cmd-Ctrl-Down": "swapLineDown", + "Cmd-/": "toggleCommentIndented", + "Cmd-J": "joinLines", + "Shift-Cmd-D": "duplicateLine", + F5: "sortLines", + "Shift-F5": "reverseSortLines", + "Cmd-F5": "sortLinesInsensitive", + "Shift-Cmd-F5": "reverseSortLinesInsensitive", + F2: "nextBookmark", + "Shift-F2": "prevBookmark", + "Cmd-F2": "toggleBookmark", + "Shift-Cmd-F2": "clearBookmarks", + "Alt-F2": "selectBookmarks", + Backspace: "smartBackspace", + "Cmd-K Cmd-D": "skipAndSelectNextOccurrence", + "Cmd-K Cmd-K": "delLineRight", + "Cmd-K Cmd-U": "upcaseAtCursor", + "Cmd-K Cmd-L": "downcaseAtCursor", + "Cmd-K Cmd-Space": "setSublimeMark", + "Cmd-K Cmd-A": "selectToSublimeMark", + "Cmd-K Cmd-W": "deleteToSublimeMark", + "Cmd-K Cmd-X": "swapWithSublimeMark", + "Cmd-K Cmd-Y": "sublimeYank", + "Cmd-K Cmd-C": "showInCenter", + "Cmd-K Cmd-G": "clearBookmarks", + "Cmd-K Cmd-Backspace": "delLineLeft", + "Cmd-K Cmd-1": "foldAll", + "Cmd-K Cmd-0": "unfoldAll", + "Cmd-K Cmd-J": "unfoldAll", + "Ctrl-Shift-Up": "addCursorToPrevLine", + "Ctrl-Shift-Down": "addCursorToNextLine", + "Cmd-F3": "findUnder", + "Shift-Cmd-F3": "findUnderPrevious", + "Alt-F3": "findAllUnder", + "Shift-Cmd-[": "fold", + "Shift-Cmd-]": "unfold", + "Cmd-I": "findIncremental", + "Shift-Cmd-I": "findIncrementalReverse", + "Cmd-H": "replace", + F3: "findNext", + "Shift-F3": "findPrev", + fallthrough: "macDefault" + }, h.normalizeKeyMap(C.macSublime), C.pcSublime = { + "Shift-Tab": "indentLess", + "Shift-Ctrl-K": "deleteLine", + "Alt-Q": "wrapLines", + "Ctrl-T": "transposeChars", + "Alt-Left": "goSubwordLeft", + "Alt-Right": "goSubwordRight", + "Ctrl-Up": "scrollLineUp", + "Ctrl-Down": "scrollLineDown", + "Ctrl-L": "selectLine", + "Shift-Ctrl-L": "splitSelectionByLine", + Esc: "singleSelectionTop", + "Ctrl-Enter": "insertLineAfter", + "Shift-Ctrl-Enter": "insertLineBefore", + "Ctrl-D": "selectNextOccurrence", + "Shift-Ctrl-Space": "selectScope", + "Shift-Ctrl-M": "selectBetweenBrackets", + "Ctrl-M": "goToBracket", + "Shift-Ctrl-Up": "swapLineUp", + "Shift-Ctrl-Down": "swapLineDown", + "Ctrl-/": "toggleCommentIndented", + "Ctrl-J": "joinLines", + "Shift-Ctrl-D": "duplicateLine", + F9: "sortLines", + "Shift-F9": "reverseSortLines", + "Ctrl-F9": "sortLinesInsensitive", + "Shift-Ctrl-F9": "reverseSortLinesInsensitive", + F2: "nextBookmark", + "Shift-F2": "prevBookmark", + "Ctrl-F2": "toggleBookmark", + "Shift-Ctrl-F2": "clearBookmarks", + "Alt-F2": "selectBookmarks", + Backspace: "smartBackspace", + "Ctrl-K Ctrl-D": "skipAndSelectNextOccurrence", + "Ctrl-K Ctrl-K": "delLineRight", + "Ctrl-K Ctrl-U": "upcaseAtCursor", + "Ctrl-K Ctrl-L": "downcaseAtCursor", + "Ctrl-K Ctrl-Space": "setSublimeMark", + "Ctrl-K Ctrl-A": "selectToSublimeMark", + "Ctrl-K Ctrl-W": "deleteToSublimeMark", + "Ctrl-K Ctrl-X": "swapWithSublimeMark", + "Ctrl-K Ctrl-Y": "sublimeYank", + "Ctrl-K Ctrl-C": "showInCenter", + "Ctrl-K Ctrl-G": "clearBookmarks", + "Ctrl-K Ctrl-Backspace": "delLineLeft", + "Ctrl-K Ctrl-1": "foldAll", + "Ctrl-K Ctrl-0": "unfoldAll", + "Ctrl-K Ctrl-J": "unfoldAll", + "Ctrl-Alt-Up": "addCursorToPrevLine", + "Ctrl-Alt-Down": "addCursorToNextLine", + "Ctrl-F3": "findUnder", + "Shift-Ctrl-F3": "findUnderPrevious", + "Alt-F3": "findAllUnder", + "Shift-Ctrl-[": "fold", + "Shift-Ctrl-]": "unfold", + "Ctrl-I": "findIncremental", + "Shift-Ctrl-I": "findIncrementalReverse", + "Ctrl-H": "replace", + F3: "findNext", + "Shift-F3": "findPrev", + fallthrough: "pcDefault" + }, h.normalizeKeyMap(C.pcSublime); + var V = C.default == C.macDefault; + C.sublime = V ? C.macSublime : C.pcSublime; + }); +})(); +var q = G.exports; +const Q = E.getDefaultExportFromCjs(q), + X = J({ + __proto__: null, + default: Q + }, [q]); +exports.sublime = X; + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/async-helpers/index.js": +/*!*********************************************************!*\ + !*** ../../graphiql-toolkit/esm/async-helpers/index.js ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.fetcherReturnToPromise = fetcherReturnToPromise; +exports.isAsyncIterable = isAsyncIterable; +exports.isObservable = isObservable; +exports.isPromise = isPromise; +var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function isPromise(value) { + return typeof value === 'object' && value !== null && typeof value.then === 'function'; +} +function observableToPromise(observable) { + return new Promise((resolve, reject) => { + const subscription = observable.subscribe({ + next(v) { + resolve(v); + subscription.unsubscribe(); + }, + error: reject, + complete() { + reject(new Error('no value resolved')); + } + }); + }); +} +function isObservable(value) { + return typeof value === 'object' && value !== null && 'subscribe' in value && typeof value.subscribe === 'function'; +} +function isAsyncIterable(input) { + return typeof input === 'object' && input !== null && (input[Symbol.toStringTag] === 'AsyncGenerator' || Symbol.asyncIterator in input); +} +function asyncIterableToPromise(input) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const iteratorReturn = (_a = ('return' in input ? input : input[Symbol.asyncIterator]()).return) === null || _a === void 0 ? void 0 : _a.bind(input); + const iteratorNext = ('next' in input ? input : input[Symbol.asyncIterator]()).next.bind(input); + const result = yield iteratorNext(); + void (iteratorReturn === null || iteratorReturn === void 0 ? void 0 : iteratorReturn()); + return result.value; + }); +} +function fetcherReturnToPromise(fetcherResult) { + return __awaiter(this, void 0, void 0, function* () { + const result = yield fetcherResult; + if (isAsyncIterable(result)) { + return asyncIterableToPromise(result); + } + if (isObservable(result)) { + return observableToPromise(result); + } + return result; + }); +} + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/create-fetcher/createFetcher.js": +/*!******************************************************************!*\ + !*** ../../graphiql-toolkit/esm/create-fetcher/createFetcher.js ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createGraphiQLFetcher = createGraphiQLFetcher; +var _lib = __webpack_require__(/*! ./lib */ "../../graphiql-toolkit/esm/create-fetcher/lib.js"); +function createGraphiQLFetcher(options) { + let httpFetch; + if (typeof window !== 'undefined' && window.fetch) { + httpFetch = window.fetch; + } + if ((options === null || options === void 0 ? void 0 : options.enableIncrementalDelivery) === null || options.enableIncrementalDelivery !== false) { + options.enableIncrementalDelivery = true; + } + if (options.fetch) { + httpFetch = options.fetch; + } + if (!httpFetch) { + throw new Error('No valid fetcher implementation available'); + } + const simpleFetcher = (0, _lib.createSimpleFetcher)(options, httpFetch); + const httpFetcher = options.enableIncrementalDelivery ? (0, _lib.createMultipartFetcher)(options, httpFetch) : simpleFetcher; + return (graphQLParams, fetcherOpts) => { + if (graphQLParams.operationName === 'IntrospectionQuery') { + return (options.schemaFetcher || simpleFetcher)(graphQLParams, fetcherOpts); + } + const isSubscription = (fetcherOpts === null || fetcherOpts === void 0 ? void 0 : fetcherOpts.documentAST) ? (0, _lib.isSubscriptionWithName)(fetcherOpts.documentAST, graphQLParams.operationName || undefined) : false; + if (isSubscription) { + const wsFetcher = (0, _lib.getWsFetcher)(options, fetcherOpts); + if (!wsFetcher) { + throw new Error(`Your GraphiQL createFetcher is not properly configured for websocket subscriptions yet. ${options.subscriptionUrl ? `Provided URL ${options.subscriptionUrl} failed` : 'Please provide subscriptionUrl, wsClient or legacyClient option first.'}`); + } + return wsFetcher(graphQLParams); + } + return httpFetcher(graphQLParams, fetcherOpts); + }; +} + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/create-fetcher/index.js": +/*!**********************************************************!*\ + !*** ../../graphiql-toolkit/esm/create-fetcher/index.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _exportNames = { + createGraphiQLFetcher: true +}; +Object.defineProperty(exports, "createGraphiQLFetcher", ({ + enumerable: true, + get: function () { + return _createFetcher.createGraphiQLFetcher; + } +})); +var _types = __webpack_require__(/*! ./types */ "../../graphiql-toolkit/esm/create-fetcher/types.js"); +Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _types[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _types[key]; + } + }); +}); +var _createFetcher = __webpack_require__(/*! ./createFetcher */ "../../graphiql-toolkit/esm/create-fetcher/createFetcher.js"); + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/create-fetcher/lib.js": +/*!********************************************************!*\ + !*** ../../graphiql-toolkit/esm/create-fetcher/lib.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isSubscriptionWithName = exports.getWsFetcher = exports.createWebsocketsFetcherFromUrl = exports.createWebsocketsFetcherFromClient = exports.createSimpleFetcher = exports.createMultipartFetcher = exports.createLegacyWebsocketsFetcher = void 0; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _meros = __webpack_require__(/*! meros */ "../../../node_modules/meros/browser/index.mjs"); +var _pushPullAsyncIterableIterator = __webpack_require__(/*! @n1ru4l/push-pull-async-iterable-iterator */ "../../../node_modules/@n1ru4l/push-pull-async-iterable-iterator/index.js"); +var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __await = void 0 && (void 0).__await || function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +}; +var __asyncValues = void 0 && (void 0).__asyncValues || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], + i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { + return this; + }, i); + function verb(n) { + i[n] = o[n] && function (v) { + return new Promise(function (resolve, reject) { + v = o[n](v), settle(resolve, reject, v.done, v.value); + }); + }; + } + function settle(resolve, reject, d, v) { + Promise.resolve(v).then(function (v) { + resolve({ + value: v, + done: d + }); + }, reject); + } +}; +var __asyncGenerator = void 0 && (void 0).__asyncGenerator || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), + i, + q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function (v) { + return new Promise(function (a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; + } + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); + } + } + function step(r) { + r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + } + function fulfill(value) { + resume("next", value); + } + function reject(value) { + resume("throw", value); + } + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + } +}; +const errorHasCode = err => { + return typeof err === 'object' && err !== null && 'code' in err; +}; +const isSubscriptionWithName = (document, name) => { + let isSubscription = false; + (0, _graphql.visit)(document, { + OperationDefinition(node) { + var _a; + if (name === ((_a = node.name) === null || _a === void 0 ? void 0 : _a.value) && node.operation === 'subscription') { + isSubscription = true; + } + } + }); + return isSubscription; +}; +exports.isSubscriptionWithName = isSubscriptionWithName; +const createSimpleFetcher = (options, httpFetch) => (graphQLParams, fetcherOpts) => __awaiter(void 0, void 0, void 0, function* () { + const data = yield httpFetch(options.url, { + method: 'POST', + body: JSON.stringify(graphQLParams), + headers: Object.assign(Object.assign({ + 'content-type': 'application/json' + }, options.headers), fetcherOpts === null || fetcherOpts === void 0 ? void 0 : fetcherOpts.headers) + }); + return data.json(); +}); +exports.createSimpleFetcher = createSimpleFetcher; +const createWebsocketsFetcherFromUrl = (url, connectionParams) => { + let wsClient; + try { + const { + createClient + } = __webpack_require__(/*! graphql-ws */ "../../../node_modules/graphql-ws/lib/index.js"); + wsClient = createClient({ + url, + connectionParams + }); + return createWebsocketsFetcherFromClient(wsClient); + } catch (err) { + if (errorHasCode(err) && err.code === 'MODULE_NOT_FOUND') { + throw new Error("You need to install the 'graphql-ws' package to use websockets when passing a 'subscriptionUrl'"); + } + console.error(`Error creating websocket client for ${url}`, err); + } +}; +exports.createWebsocketsFetcherFromUrl = createWebsocketsFetcherFromUrl; +const createWebsocketsFetcherFromClient = wsClient => graphQLParams => (0, _pushPullAsyncIterableIterator.makeAsyncIterableIteratorFromSink)(sink => wsClient.subscribe(graphQLParams, Object.assign(Object.assign({}, sink), { + error(err) { + if (err instanceof CloseEvent) { + sink.error(new Error(`Socket closed with event ${err.code} ${err.reason || ''}`.trim())); + } else { + sink.error(err); + } + } +}))); +exports.createWebsocketsFetcherFromClient = createWebsocketsFetcherFromClient; +const createLegacyWebsocketsFetcher = legacyWsClient => graphQLParams => { + const observable = legacyWsClient.request(graphQLParams); + return (0, _pushPullAsyncIterableIterator.makeAsyncIterableIteratorFromSink)(sink => observable.subscribe(sink).unsubscribe); +}; +exports.createLegacyWebsocketsFetcher = createLegacyWebsocketsFetcher; +const createMultipartFetcher = (options, httpFetch) => function (graphQLParams, fetcherOpts) { + return __asyncGenerator(this, arguments, function* () { + var e_1, _a; + const response = yield __await(httpFetch(options.url, { + method: 'POST', + body: JSON.stringify(graphQLParams), + headers: Object.assign(Object.assign({ + 'content-type': 'application/json', + accept: 'application/json, multipart/mixed' + }, options.headers), fetcherOpts === null || fetcherOpts === void 0 ? void 0 : fetcherOpts.headers) + }).then(r => (0, _meros.meros)(r, { + multiple: true + }))); + if (!(0, _pushPullAsyncIterableIterator.isAsyncIterable)(response)) { + return yield __await(yield yield __await(response.json())); + } + try { + for (var response_1 = __asyncValues(response), response_1_1; response_1_1 = yield __await(response_1.next()), !response_1_1.done;) { + const chunk = response_1_1.value; + if (chunk.some(part => !part.json)) { + const message = chunk.map(part => `Headers::\n${part.headers}\n\nBody::\n${part.body}`); + throw new Error(`Expected multipart chunks to be of json type. got:\n${message}`); + } + yield yield __await(chunk.map(part => part.body)); + } + } catch (e_1_1) { + e_1 = { + error: e_1_1 + }; + } finally { + try { + if (response_1_1 && !response_1_1.done && (_a = response_1.return)) yield __await(_a.call(response_1)); + } finally { + if (e_1) throw e_1.error; + } + } + }); +}; +exports.createMultipartFetcher = createMultipartFetcher; +const getWsFetcher = (options, fetcherOpts) => { + if (options.wsClient) { + return createWebsocketsFetcherFromClient(options.wsClient); + } + if (options.subscriptionUrl) { + return createWebsocketsFetcherFromUrl(options.subscriptionUrl, Object.assign(Object.assign({}, options.wsConnectionParams), fetcherOpts === null || fetcherOpts === void 0 ? void 0 : fetcherOpts.headers)); + } + const legacyWebsocketsClient = options.legacyClient || options.legacyWsClient; + if (legacyWebsocketsClient) { + return createLegacyWebsocketsFetcher(legacyWebsocketsClient); + } +}; +exports.getWsFetcher = getWsFetcher; + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/create-fetcher/types.js": +/*!**********************************************************!*\ + !*** ../../graphiql-toolkit/esm/create-fetcher/types.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/format/index.js": +/*!**************************************************!*\ + !*** ../../graphiql-toolkit/esm/format/index.js ***! + \**************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.formatError = formatError; +exports.formatResult = formatResult; +function stringify(obj) { + return JSON.stringify(obj, null, 2); +} +function formatSingleError(error) { + return Object.assign(Object.assign({}, error), { + message: error.message, + stack: error.stack + }); +} +function handleSingleError(error) { + if (error instanceof Error) { + return formatSingleError(error); + } + return error; +} +function formatError(error) { + if (Array.isArray(error)) { + return stringify({ + errors: error.map(e => handleSingleError(e)) + }); + } + return stringify({ + errors: [handleSingleError(error)] + }); +} +function formatResult(result) { + return stringify(result); +} + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/graphql-helpers/auto-complete.js": +/*!*******************************************************************!*\ + !*** ../../graphiql-toolkit/esm/graphql-helpers/auto-complete.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.fillLeafs = fillLeafs; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +function fillLeafs(schema, docString, getDefaultFieldNames) { + const insertions = []; + if (!schema || !docString) { + return { + insertions, + result: docString + }; + } + let ast; + try { + ast = (0, _graphql.parse)(docString); + } catch (_a) { + return { + insertions, + result: docString + }; + } + const fieldNameFn = getDefaultFieldNames || defaultGetDefaultFieldNames; + const typeInfo = new _graphql.TypeInfo(schema); + (0, _graphql.visit)(ast, { + leave(node) { + typeInfo.leave(node); + }, + enter(node) { + typeInfo.enter(node); + if (node.kind === 'Field' && !node.selectionSet) { + const fieldType = typeInfo.getType(); + const selectionSet = buildSelectionSet(isFieldType(fieldType), fieldNameFn); + if (selectionSet && node.loc) { + const indent = getIndentation(docString, node.loc.start); + insertions.push({ + index: node.loc.end, + string: ' ' + (0, _graphql.print)(selectionSet).replaceAll('\n', '\n' + indent) + }); + } + } + } + }); + return { + insertions, + result: withInsertions(docString, insertions) + }; +} +function defaultGetDefaultFieldNames(type) { + if (!('getFields' in type)) { + return []; + } + const fields = type.getFields(); + if (fields.id) { + return ['id']; + } + if (fields.edges) { + return ['edges']; + } + if (fields.node) { + return ['node']; + } + const leafFieldNames = []; + for (const fieldName of Object.keys(fields)) { + if ((0, _graphql.isLeafType)(fields[fieldName].type)) { + leafFieldNames.push(fieldName); + } + } + return leafFieldNames; +} +function buildSelectionSet(type, getDefaultFieldNames) { + const namedType = (0, _graphql.getNamedType)(type); + if (!type || (0, _graphql.isLeafType)(type)) { + return; + } + const fieldNames = getDefaultFieldNames(namedType); + if (!Array.isArray(fieldNames) || fieldNames.length === 0 || !('getFields' in namedType)) { + return; + } + return { + kind: _graphql.Kind.SELECTION_SET, + selections: fieldNames.map(fieldName => { + const fieldDef = namedType.getFields()[fieldName]; + const fieldType = fieldDef ? fieldDef.type : null; + return { + kind: _graphql.Kind.FIELD, + name: { + kind: _graphql.Kind.NAME, + value: fieldName + }, + selectionSet: buildSelectionSet(fieldType, getDefaultFieldNames) + }; + }) + }; +} +function withInsertions(initial, insertions) { + if (insertions.length === 0) { + return initial; + } + let edited = ''; + let prevIndex = 0; + for (const { + index, + string + } of insertions) { + edited += initial.slice(prevIndex, index) + string; + prevIndex = index; + } + edited += initial.slice(prevIndex); + return edited; +} +function getIndentation(str, index) { + let indentStart = index; + let indentEnd = index; + while (indentStart) { + const c = str.charCodeAt(indentStart - 1); + if (c === 10 || c === 13 || c === 0x2028 || c === 0x2029) { + break; + } + indentStart--; + if (c !== 9 && c !== 11 && c !== 12 && c !== 32 && c !== 160) { + indentEnd = indentStart; + } + } + return str.slice(indentStart, indentEnd); +} +function isFieldType(fieldType) { + if (fieldType) { + return fieldType; + } +} + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/graphql-helpers/index.js": +/*!***********************************************************!*\ + !*** ../../graphiql-toolkit/esm/graphql-helpers/index.js ***! + \***********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _autoComplete = __webpack_require__(/*! ./auto-complete */ "../../graphiql-toolkit/esm/graphql-helpers/auto-complete.js"); +Object.keys(_autoComplete).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _autoComplete[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _autoComplete[key]; + } + }); +}); +var _mergeAst = __webpack_require__(/*! ./merge-ast */ "../../graphiql-toolkit/esm/graphql-helpers/merge-ast.js"); +Object.keys(_mergeAst).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _mergeAst[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _mergeAst[key]; + } + }); +}); +var _operationName = __webpack_require__(/*! ./operation-name */ "../../graphiql-toolkit/esm/graphql-helpers/operation-name.js"); +Object.keys(_operationName).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _operationName[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _operationName[key]; + } + }); +}); + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/graphql-helpers/merge-ast.js": +/*!***************************************************************!*\ + !*** ../../graphiql-toolkit/esm/graphql-helpers/merge-ast.js ***! + \***************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.mergeAst = mergeAst; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +function uniqueBy(array, iteratee) { + var _a; + const FilteredMap = new Map(); + const result = []; + for (const item of array) { + if (item.kind === 'Field') { + const uniqueValue = iteratee(item); + const existing = FilteredMap.get(uniqueValue); + if ((_a = item.directives) === null || _a === void 0 ? void 0 : _a.length) { + const itemClone = Object.assign({}, item); + result.push(itemClone); + } else if ((existing === null || existing === void 0 ? void 0 : existing.selectionSet) && item.selectionSet) { + existing.selectionSet.selections = [...existing.selectionSet.selections, ...item.selectionSet.selections]; + } else if (!existing) { + const itemClone = Object.assign({}, item); + FilteredMap.set(uniqueValue, itemClone); + result.push(itemClone); + } + } else { + result.push(item); + } + } + return result; +} +function inlineRelevantFragmentSpreads(fragmentDefinitions, selections, selectionSetType) { + var _a; + const selectionSetTypeName = selectionSetType ? (0, _graphql.getNamedType)(selectionSetType).name : null; + const outputSelections = []; + const seenSpreads = []; + for (let selection of selections) { + if (selection.kind === 'FragmentSpread') { + const fragmentName = selection.name.value; + if (!selection.directives || selection.directives.length === 0) { + if (seenSpreads.includes(fragmentName)) { + continue; + } else { + seenSpreads.push(fragmentName); + } + } + const fragmentDefinition = fragmentDefinitions[selection.name.value]; + if (fragmentDefinition) { + const { + typeCondition, + directives, + selectionSet + } = fragmentDefinition; + selection = { + kind: _graphql.Kind.INLINE_FRAGMENT, + typeCondition, + directives, + selectionSet + }; + } + } + if (selection.kind === _graphql.Kind.INLINE_FRAGMENT && (!selection.directives || ((_a = selection.directives) === null || _a === void 0 ? void 0 : _a.length) === 0)) { + const fragmentTypeName = selection.typeCondition ? selection.typeCondition.name.value : null; + if (!fragmentTypeName || fragmentTypeName === selectionSetTypeName) { + outputSelections.push(...inlineRelevantFragmentSpreads(fragmentDefinitions, selection.selectionSet.selections, selectionSetType)); + continue; + } + } + outputSelections.push(selection); + } + return outputSelections; +} +function mergeAst(documentAST, schema) { + const typeInfo = schema ? new _graphql.TypeInfo(schema) : null; + const fragmentDefinitions = Object.create(null); + for (const definition of documentAST.definitions) { + if (definition.kind === _graphql.Kind.FRAGMENT_DEFINITION) { + fragmentDefinitions[definition.name.value] = definition; + } + } + const flattenVisitors = { + SelectionSet(node) { + const selectionSetType = typeInfo ? typeInfo.getParentType() : null; + let { + selections + } = node; + selections = inlineRelevantFragmentSpreads(fragmentDefinitions, selections, selectionSetType); + return Object.assign(Object.assign({}, node), { + selections + }); + }, + FragmentDefinition() { + return null; + } + }; + const flattenedAST = (0, _graphql.visit)(documentAST, typeInfo ? (0, _graphql.visitWithTypeInfo)(typeInfo, flattenVisitors) : flattenVisitors); + const deduplicateVisitors = { + SelectionSet(node) { + let { + selections + } = node; + selections = uniqueBy(selections, selection => selection.alias ? selection.alias.value : selection.name.value); + return Object.assign(Object.assign({}, node), { + selections + }); + }, + FragmentDefinition() { + return null; + } + }; + return (0, _graphql.visit)(flattenedAST, deduplicateVisitors); +} + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/graphql-helpers/operation-name.js": +/*!********************************************************************!*\ + !*** ../../graphiql-toolkit/esm/graphql-helpers/operation-name.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getSelectedOperationName = getSelectedOperationName; +function getSelectedOperationName(prevOperations, prevSelectedOperationName, operations) { + if (!operations || operations.length < 1) { + return; + } + const names = operations.map(op => { + var _a; + return (_a = op.name) === null || _a === void 0 ? void 0 : _a.value; + }); + if (prevSelectedOperationName && names.includes(prevSelectedOperationName)) { + return prevSelectedOperationName; + } + if (prevSelectedOperationName && prevOperations) { + const prevNames = prevOperations.map(op => { + var _a; + return (_a = op.name) === null || _a === void 0 ? void 0 : _a.value; + }); + const prevIndex = prevNames.indexOf(prevSelectedOperationName); + if (prevIndex !== -1 && prevIndex < names.length) { + return names[prevIndex]; + } + } + return names[0]; +} + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/index.js": +/*!*******************************************!*\ + !*** ../../graphiql-toolkit/esm/index.js ***! + \*******************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _asyncHelpers = __webpack_require__(/*! ./async-helpers */ "../../graphiql-toolkit/esm/async-helpers/index.js"); +Object.keys(_asyncHelpers).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _asyncHelpers[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _asyncHelpers[key]; + } + }); +}); +var _createFetcher = __webpack_require__(/*! ./create-fetcher */ "../../graphiql-toolkit/esm/create-fetcher/index.js"); +Object.keys(_createFetcher).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _createFetcher[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _createFetcher[key]; + } + }); +}); +var _format = __webpack_require__(/*! ./format */ "../../graphiql-toolkit/esm/format/index.js"); +Object.keys(_format).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _format[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _format[key]; + } + }); +}); +var _graphqlHelpers = __webpack_require__(/*! ./graphql-helpers */ "../../graphiql-toolkit/esm/graphql-helpers/index.js"); +Object.keys(_graphqlHelpers).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _graphqlHelpers[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _graphqlHelpers[key]; + } + }); +}); +var _storage = __webpack_require__(/*! ./storage */ "../../graphiql-toolkit/esm/storage/index.js"); +Object.keys(_storage).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _storage[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _storage[key]; + } + }); +}); + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/storage/base.js": +/*!**************************************************!*\ + !*** ../../graphiql-toolkit/esm/storage/base.js ***! + \**************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.StorageAPI = void 0; +function isQuotaError(storage, e) { + return e instanceof DOMException && (e.code === 22 || e.code === 1014 || e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') && storage.length !== 0; +} +class StorageAPI { + constructor(storage) { + if (storage) { + this.storage = storage; + } else if (storage === null) { + this.storage = null; + } else if (typeof window === 'undefined') { + this.storage = null; + } else { + this.storage = { + getItem: window.localStorage.getItem.bind(window.localStorage), + setItem: window.localStorage.setItem.bind(window.localStorage), + removeItem: window.localStorage.removeItem.bind(window.localStorage), + get length() { + let keys = 0; + for (const key in window.localStorage) { + if (key.indexOf(`${STORAGE_NAMESPACE}:`) === 0) { + keys += 1; + } + } + return keys; + }, + clear() { + for (const key in window.localStorage) { + if (key.indexOf(`${STORAGE_NAMESPACE}:`) === 0) { + window.localStorage.removeItem(key); + } + } + } + }; + } + } + get(name) { + if (!this.storage) { + return null; + } + const key = `${STORAGE_NAMESPACE}:${name}`; + const value = this.storage.getItem(key); + if (value === 'null' || value === 'undefined') { + this.storage.removeItem(key); + return null; + } + return value || null; + } + set(name, value) { + let quotaError = false; + let error = null; + if (this.storage) { + const key = `${STORAGE_NAMESPACE}:${name}`; + if (value) { + try { + this.storage.setItem(key, value); + } catch (e) { + error = e instanceof Error ? e : new Error(`${e}`); + quotaError = isQuotaError(this.storage, e); + } + } else { + this.storage.removeItem(key); + } + } + return { + isQuotaError: quotaError, + error + }; + } + clear() { + if (this.storage) { + this.storage.clear(); + } + } +} +exports.StorageAPI = StorageAPI; +const STORAGE_NAMESPACE = 'graphiql'; + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/storage/custom.js": +/*!****************************************************!*\ + !*** ../../graphiql-toolkit/esm/storage/custom.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.createLocalStorage = createLocalStorage; +function createLocalStorage(_ref) { + let { + namespace + } = _ref; + const storageKeyPrefix = `${namespace}:`; + const getStorageKey = key => `${storageKeyPrefix}${key}`; + const storage = { + setItem: (key, value) => localStorage.setItem(getStorageKey(key), value), + getItem: key => localStorage.getItem(getStorageKey(key)), + removeItem: key => localStorage.removeItem(getStorageKey(key)), + get length() { + let keys = 0; + for (const key in window.localStorage) { + if (key.indexOf(storageKeyPrefix) === 0) { + keys += 1; + } + } + return keys; + }, + clear() { + for (const key in window.localStorage) { + if (key.indexOf(storageKeyPrefix) === 0) { + window.localStorage.removeItem(key); + } + } + } + }; + return storage; +} + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/storage/history.js": +/*!*****************************************************!*\ + !*** ../../graphiql-toolkit/esm/storage/history.js ***! + \*****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.HistoryStore = void 0; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _query = __webpack_require__(/*! ./query */ "../../graphiql-toolkit/esm/storage/query.js"); +const MAX_QUERY_SIZE = 100000; +class HistoryStore { + constructor(storage, maxHistoryLength) { + var _this = this; + this.storage = storage; + this.maxHistoryLength = maxHistoryLength; + this.updateHistory = _ref => { + let { + query, + variables, + headers, + operationName + } = _ref; + if (!this.shouldSaveQuery(query, variables, headers, this.history.fetchRecent())) { + return; + } + this.history.push({ + query, + variables, + headers, + operationName + }); + const historyQueries = this.history.items; + const favoriteQueries = this.favorite.items; + this.queries = historyQueries.concat(favoriteQueries); + }; + this.deleteHistory = function (_ref2) { + let { + query, + variables, + headers, + operationName, + favorite + } = _ref2; + let clearFavorites = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + function deleteFromStore(store) { + const found = store.items.find(x => x.query === query && x.variables === variables && x.headers === headers && x.operationName === operationName); + if (found) { + store.delete(found); + } + } + if (favorite || clearFavorites) { + deleteFromStore(_this.favorite); + } + if (!favorite || clearFavorites) { + deleteFromStore(_this.history); + } + _this.queries = [..._this.history.items, ..._this.favorite.items]; + }; + this.history = new _query.QueryStore('queries', this.storage, this.maxHistoryLength); + this.favorite = new _query.QueryStore('favorites', this.storage, null); + this.queries = [...this.history.fetchAll(), ...this.favorite.fetchAll()]; + } + shouldSaveQuery(query, variables, headers, lastQuerySaved) { + if (!query) { + return false; + } + try { + (0, _graphql.parse)(query); + } catch (_a) { + return false; + } + if (query.length > MAX_QUERY_SIZE) { + return false; + } + if (!lastQuerySaved) { + return true; + } + if (JSON.stringify(query) === JSON.stringify(lastQuerySaved.query)) { + if (JSON.stringify(variables) === JSON.stringify(lastQuerySaved.variables)) { + if (JSON.stringify(headers) === JSON.stringify(lastQuerySaved.headers)) { + return false; + } + if (headers && !lastQuerySaved.headers) { + return false; + } + } + if (variables && !lastQuerySaved.variables) { + return false; + } + } + return true; + } + toggleFavorite(_ref3) { + let { + query, + variables, + headers, + operationName, + label, + favorite + } = _ref3; + const item = { + query, + variables, + headers, + operationName, + label + }; + if (favorite) { + item.favorite = false; + this.favorite.delete(item); + this.history.push(item); + } else { + item.favorite = true; + this.favorite.push(item); + this.history.delete(item); + } + this.queries = [...this.history.items, ...this.favorite.items]; + } + editLabel(_ref4, index) { + let { + query, + variables, + headers, + operationName, + label, + favorite + } = _ref4; + const item = { + query, + variables, + headers, + operationName, + label + }; + if (favorite) { + this.favorite.edit(Object.assign(Object.assign({}, item), { + favorite + }), index); + } else { + this.history.edit(item, index); + } + this.queries = [...this.history.items, ...this.favorite.items]; + } +} +exports.HistoryStore = HistoryStore; + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/storage/index.js": +/*!***************************************************!*\ + !*** ../../graphiql-toolkit/esm/storage/index.js ***! + \***************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _base = __webpack_require__(/*! ./base */ "../../graphiql-toolkit/esm/storage/base.js"); +Object.keys(_base).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _base[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _base[key]; + } + }); +}); +var _history = __webpack_require__(/*! ./history */ "../../graphiql-toolkit/esm/storage/history.js"); +Object.keys(_history).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _history[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _history[key]; + } + }); +}); +var _query = __webpack_require__(/*! ./query */ "../../graphiql-toolkit/esm/storage/query.js"); +Object.keys(_query).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _query[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _query[key]; + } + }); +}); +var _custom = __webpack_require__(/*! ./custom */ "../../graphiql-toolkit/esm/storage/custom.js"); +Object.keys(_custom).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _custom[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _custom[key]; + } + }); +}); + +/***/ }), + +/***/ "../../graphiql-toolkit/esm/storage/query.js": +/*!***************************************************!*\ + !*** ../../graphiql-toolkit/esm/storage/query.js ***! + \***************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.QueryStore = void 0; +class QueryStore { + constructor(key, storage) { + let maxSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + this.key = key; + this.storage = storage; + this.maxSize = maxSize; + this.items = this.fetchAll(); + } + get length() { + return this.items.length; + } + contains(item) { + return this.items.some(x => x.query === item.query && x.variables === item.variables && x.headers === item.headers && x.operationName === item.operationName); + } + edit(item, index) { + if (typeof index === 'number' && this.items[index]) { + const found = this.items[index]; + if (found.query === item.query && found.variables === item.variables && found.headers === item.headers && found.operationName === item.operationName) { + this.items.splice(index, 1, item); + this.save(); + return; + } + } + const itemIndex = this.items.findIndex(x => x.query === item.query && x.variables === item.variables && x.headers === item.headers && x.operationName === item.operationName); + if (itemIndex !== -1) { + this.items.splice(itemIndex, 1, item); + this.save(); + } + } + delete(item) { + const itemIndex = this.items.findIndex(x => x.query === item.query && x.variables === item.variables && x.headers === item.headers && x.operationName === item.operationName); + if (itemIndex !== -1) { + this.items.splice(itemIndex, 1); + this.save(); + } + } + fetchRecent() { + return this.items.at(-1); + } + fetchAll() { + const raw = this.storage.get(this.key); + if (raw) { + return JSON.parse(raw)[this.key]; + } + return []; + } + push(item) { + const items = [...this.items, item]; + if (this.maxSize && items.length > this.maxSize) { + items.shift(); + } + for (let attempts = 0; attempts < 5; attempts++) { + const response = this.storage.set(this.key, JSON.stringify({ + [this.key]: items + })); + if (!(response === null || response === void 0 ? void 0 : response.error)) { + this.items = items; + } else if (response.isQuotaError && this.maxSize) { + items.shift(); + } else { + return; + } + } + } + save() { + this.storage.set(this.key, JSON.stringify({ + [this.key]: this.items + })); + } +} +exports.QueryStore = QueryStore; + +/***/ }), + +/***/ "../node_modules/markdown-it/index.js": +/*!********************************************!*\ + !*** ../node_modules/markdown-it/index.js ***! + \********************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +module.exports = __webpack_require__(/*! ./lib/ */ "../node_modules/markdown-it/lib/index.js"); + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/common/entities.js": +/*!**********************************************************!*\ + !*** ../node_modules/markdown-it/lib/common/entities.js ***! + \**********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// HTML5 entities map: { name -> utf16string } +// + + +/*eslint quotes:0*/ +module.exports = __webpack_require__(/*! entities/lib/maps/entities.json */ "../../../node_modules/entities/lib/maps/entities.json"); + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/common/html_blocks.js": +/*!*************************************************************!*\ + !*** ../node_modules/markdown-it/lib/common/html_blocks.js ***! + \*************************************************************/ +/***/ (function(module) { + +// List of valid html blocks names, accorting to commonmark spec +// http://jgm.github.io/CommonMark/spec.html#html-blocks + + + +module.exports = ['address', 'article', 'aside', 'base', 'basefont', 'blockquote', 'body', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dialog', 'dir', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hr', 'html', 'iframe', 'legend', 'li', 'link', 'main', 'menu', 'menuitem', 'nav', 'noframes', 'ol', 'optgroup', 'option', 'p', 'param', 'section', 'source', 'summary', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul']; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/common/html_re.js": +/*!*********************************************************!*\ + !*** ../node_modules/markdown-it/lib/common/html_re.js ***! + \*********************************************************/ +/***/ (function(module) { + +// Regexps to match html elements + + + +var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; +var unquoted = '[^"\'=<>`\\x00-\\x20]+'; +var single_quoted = "'[^']*'"; +var double_quoted = '"[^"]*"'; +var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')'; +var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)'; +var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; +var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; +var comment = '|'; +var processing = '<[?][\\s\\S]*?[?]>'; +var declaration = ']*>'; +var cdata = ''; +var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment + '|' + processing + '|' + declaration + '|' + cdata + ')'); +var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')'); +module.exports.HTML_TAG_RE = HTML_TAG_RE; +module.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/common/utils.js": +/*!*******************************************************!*\ + !*** ../node_modules/markdown-it/lib/common/utils.js ***! + \*******************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +// Utilities +// + + +function _class(obj) { + return Object.prototype.toString.call(obj); +} +function isString(obj) { + return _class(obj) === '[object String]'; +} +var _hasOwnProperty = Object.prototype.hasOwnProperty; +function has(object, key) { + return _hasOwnProperty.call(object, key); +} + +// Merge objects +// +function assign(obj /*from1, from2, from3, ...*/) { + var sources = Array.prototype.slice.call(arguments, 1); + sources.forEach(function (source) { + if (!source) { + return; + } + if (typeof source !== 'object') { + throw new TypeError(source + 'must be object'); + } + Object.keys(source).forEach(function (key) { + obj[key] = source[key]; + }); + }); + return obj; +} + +// Remove element from array and put another array at those position. +// Useful for some operations with tokens +function arrayReplaceAt(src, pos, newElements) { + return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)); +} + +//////////////////////////////////////////////////////////////////////////////// + +function isValidEntityCode(c) { + /*eslint no-bitwise:0*/ + // broken sequence + if (c >= 0xD800 && c <= 0xDFFF) { + return false; + } + // never used + if (c >= 0xFDD0 && c <= 0xFDEF) { + return false; + } + if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { + return false; + } + // control codes + if (c >= 0x00 && c <= 0x08) { + return false; + } + if (c === 0x0B) { + return false; + } + if (c >= 0x0E && c <= 0x1F) { + return false; + } + if (c >= 0x7F && c <= 0x9F) { + return false; + } + // out of range + if (c > 0x10FFFF) { + return false; + } + return true; +} +function fromCodePoint(c) { + /*eslint no-bitwise:0*/ + if (c > 0xffff) { + c -= 0x10000; + var surrogate1 = 0xd800 + (c >> 10), + surrogate2 = 0xdc00 + (c & 0x3ff); + return String.fromCharCode(surrogate1, surrogate2); + } + return String.fromCharCode(c); +} +var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g; +var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi; +var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi'); +var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i; +var entities = __webpack_require__(/*! ./entities */ "../node_modules/markdown-it/lib/common/entities.js"); +function replaceEntityPattern(match, name) { + var code = 0; + if (has(entities, name)) { + return entities[name]; + } + if (name.charCodeAt(0) === 0x23 /* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) { + code = name[1].toLowerCase() === 'x' ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10); + if (isValidEntityCode(code)) { + return fromCodePoint(code); + } + } + return match; +} + +/*function replaceEntities(str) { + if (str.indexOf('&') < 0) { return str; } + + return str.replace(ENTITY_RE, replaceEntityPattern); +}*/ + +function unescapeMd(str) { + if (str.indexOf('\\') < 0) { + return str; + } + return str.replace(UNESCAPE_MD_RE, '$1'); +} +function unescapeAll(str) { + if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { + return str; + } + return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) { + if (escaped) { + return escaped; + } + return replaceEntityPattern(match, entity); + }); +} + +//////////////////////////////////////////////////////////////////////////////// + +var HTML_ESCAPE_TEST_RE = /[&<>"]/; +var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g; +var HTML_REPLACEMENTS = { + '&': '&', + '<': '<', + '>': '>', + '"': '"' +}; +function replaceUnsafeChar(ch) { + return HTML_REPLACEMENTS[ch]; +} +function escapeHtml(str) { + if (HTML_ESCAPE_TEST_RE.test(str)) { + return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar); + } + return str; +} + +//////////////////////////////////////////////////////////////////////////////// + +var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g; +function escapeRE(str) { + return str.replace(REGEXP_ESCAPE_RE, '\\$&'); +} + +//////////////////////////////////////////////////////////////////////////////// + +function isSpace(code) { + switch (code) { + case 0x09: + case 0x20: + return true; + } + return false; +} + +// Zs (unicode class) || [\t\f\v\r\n] +function isWhiteSpace(code) { + if (code >= 0x2000 && code <= 0x200A) { + return true; + } + switch (code) { + case 0x09: // \t + case 0x0A: // \n + case 0x0B: // \v + case 0x0C: // \f + case 0x0D: // \r + case 0x20: + case 0xA0: + case 0x1680: + case 0x202F: + case 0x205F: + case 0x3000: + return true; + } + return false; +} + +//////////////////////////////////////////////////////////////////////////////// + +/*eslint-disable max-len*/ +var UNICODE_PUNCT_RE = __webpack_require__(/*! uc.micro/categories/P/regex */ "../../../node_modules/uc.micro/categories/P/regex.js"); + +// Currently without astral characters support. +function isPunctChar(ch) { + return UNICODE_PUNCT_RE.test(ch); +} + +// Markdown ASCII punctuation characters. +// +// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ +// http://spec.commonmark.org/0.15/#ascii-punctuation-character +// +// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range. +// +function isMdAsciiPunct(ch) { + switch (ch) { + case 0x21 /* ! */: + case 0x22 /* " */: + case 0x23 /* # */: + case 0x24 /* $ */: + case 0x25 /* % */: + case 0x26 /* & */: + case 0x27 /* ' */: + case 0x28 /* ( */: + case 0x29 /* ) */: + case 0x2A /* * */: + case 0x2B /* + */: + case 0x2C /* , */: + case 0x2D /* - */: + case 0x2E /* . */: + case 0x2F /* / */: + case 0x3A /* : */: + case 0x3B /* ; */: + case 0x3C /* < */: + case 0x3D /* = */: + case 0x3E /* > */: + case 0x3F /* ? */: + case 0x40 /* @ */: + case 0x5B /* [ */: + case 0x5C /* \ */: + case 0x5D /* ] */: + case 0x5E /* ^ */: + case 0x5F /* _ */: + case 0x60 /* ` */: + case 0x7B /* { */: + case 0x7C /* | */: + case 0x7D /* } */: + case 0x7E /* ~ */: + return true; + default: + return false; + } +} + +// Hepler to unify [reference labels]. +// +function normalizeReference(str) { + // Trim and collapse whitespace + // + str = str.trim().replace(/\s+/g, ' '); + + // In node v10 'ẞ'.toLowerCase() === 'Ṿ', which is presumed to be a bug + // fixed in v12 (couldn't find any details). + // + // So treat this one as a special case + // (remove this when node v10 is no longer supported). + // + if ('ẞ'.toLowerCase() === 'Ṿ') { + str = str.replace(/ẞ/g, 'ß'); + } + + // .toLowerCase().toUpperCase() should get rid of all differences + // between letter variants. + // + // Simple .toLowerCase() doesn't normalize 125 code points correctly, + // and .toUpperCase doesn't normalize 6 of them (list of exceptions: + // İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently + // uppercased versions). + // + // Here's an example showing how it happens. Lets take greek letter omega: + // uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ) + // + // Unicode entries: + // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8; + // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398 + // 03D1;GREEK THETA SYMBOL;Ll;0;L; 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398 + // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L; 0398;;;;N;;;;03B8; + // + // Case-insensitive comparison should treat all of them as equivalent. + // + // But .toLowerCase() doesn't change ϑ (it's already lowercase), + // and .toUpperCase() doesn't change ϴ (already uppercase). + // + // Applying first lower then upper case normalizes any character: + // '\u0398\u03f4\u03b8\u03d1'.toLowerCase().toUpperCase() === '\u0398\u0398\u0398\u0398' + // + // Note: this is equivalent to unicode case folding; unicode normalization + // is a different step that is not required here. + // + // Final result should be uppercased, because it's later stored in an object + // (this avoid a conflict with Object.prototype members, + // most notably, `__proto__`) + // + return str.toLowerCase().toUpperCase(); +} + +//////////////////////////////////////////////////////////////////////////////// + +// Re-export libraries commonly used in both markdown-it and its plugins, +// so plugins won't have to depend on them explicitly, which reduces their +// bundled size (e.g. a browser build). +// +exports.lib = {}; +exports.lib.mdurl = __webpack_require__(/*! mdurl */ "../../../node_modules/mdurl/index.js"); +exports.lib.ucmicro = __webpack_require__(/*! uc.micro */ "../../../node_modules/uc.micro/index.js"); +exports.assign = assign; +exports.isString = isString; +exports.has = has; +exports.unescapeMd = unescapeMd; +exports.unescapeAll = unescapeAll; +exports.isValidEntityCode = isValidEntityCode; +exports.fromCodePoint = fromCodePoint; +// exports.replaceEntities = replaceEntities; +exports.escapeHtml = escapeHtml; +exports.arrayReplaceAt = arrayReplaceAt; +exports.isSpace = isSpace; +exports.isWhiteSpace = isWhiteSpace; +exports.isMdAsciiPunct = isMdAsciiPunct; +exports.isPunctChar = isPunctChar; +exports.escapeRE = escapeRE; +exports.normalizeReference = normalizeReference; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/helpers/index.js": +/*!********************************************************!*\ + !*** ../node_modules/markdown-it/lib/helpers/index.js ***! + \********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +// Just a shortcut for bulk export + + +exports.parseLinkLabel = __webpack_require__(/*! ./parse_link_label */ "../node_modules/markdown-it/lib/helpers/parse_link_label.js"); +exports.parseLinkDestination = __webpack_require__(/*! ./parse_link_destination */ "../node_modules/markdown-it/lib/helpers/parse_link_destination.js"); +exports.parseLinkTitle = __webpack_require__(/*! ./parse_link_title */ "../node_modules/markdown-it/lib/helpers/parse_link_title.js"); + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/helpers/parse_link_destination.js": +/*!*************************************************************************!*\ + !*** ../node_modules/markdown-it/lib/helpers/parse_link_destination.js ***! + \*************************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Parse link destination +// + + +var unescapeAll = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").unescapeAll); +module.exports = function parseLinkDestination(str, pos, max) { + var code, + level, + lines = 0, + start = pos, + result = { + ok: false, + pos: 0, + lines: 0, + str: '' + }; + if (str.charCodeAt(pos) === 0x3C /* < */) { + pos++; + while (pos < max) { + code = str.charCodeAt(pos); + if (code === 0x0A /* \n */) { + return result; + } + if (code === 0x3C /* < */) { + return result; + } + if (code === 0x3E /* > */) { + result.pos = pos + 1; + result.str = unescapeAll(str.slice(start + 1, pos)); + result.ok = true; + return result; + } + if (code === 0x5C /* \ */ && pos + 1 < max) { + pos += 2; + continue; + } + pos++; + } + + // no closing '>' + return result; + } + + // this should be ... } else { ... branch + + level = 0; + while (pos < max) { + code = str.charCodeAt(pos); + if (code === 0x20) { + break; + } + + // ascii control characters + if (code < 0x20 || code === 0x7F) { + break; + } + if (code === 0x5C /* \ */ && pos + 1 < max) { + if (str.charCodeAt(pos + 1) === 0x20) { + break; + } + pos += 2; + continue; + } + if (code === 0x28 /* ( */) { + level++; + if (level > 32) { + return result; + } + } + if (code === 0x29 /* ) */) { + if (level === 0) { + break; + } + level--; + } + pos++; + } + if (start === pos) { + return result; + } + if (level !== 0) { + return result; + } + result.str = unescapeAll(str.slice(start, pos)); + result.lines = lines; + result.pos = pos; + result.ok = true; + return result; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/helpers/parse_link_label.js": +/*!*******************************************************************!*\ + !*** ../node_modules/markdown-it/lib/helpers/parse_link_label.js ***! + \*******************************************************************/ +/***/ (function(module) { + +// Parse link label +// +// this function assumes that first character ("[") already matches; +// returns the end of the label +// + + +module.exports = function parseLinkLabel(state, start, disableNested) { + var level, + found, + marker, + prevPos, + labelEnd = -1, + max = state.posMax, + oldPos = state.pos; + state.pos = start + 1; + level = 1; + while (state.pos < max) { + marker = state.src.charCodeAt(state.pos); + if (marker === 0x5D /* ] */) { + level--; + if (level === 0) { + found = true; + break; + } + } + prevPos = state.pos; + state.md.inline.skipToken(state); + if (marker === 0x5B /* [ */) { + if (prevPos === state.pos - 1) { + // increase level if we find text `[`, which is not a part of any token + level++; + } else if (disableNested) { + state.pos = oldPos; + return -1; + } + } + } + if (found) { + labelEnd = state.pos; + } + + // restore old state + state.pos = oldPos; + return labelEnd; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/helpers/parse_link_title.js": +/*!*******************************************************************!*\ + !*** ../node_modules/markdown-it/lib/helpers/parse_link_title.js ***! + \*******************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Parse link title +// + + +var unescapeAll = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").unescapeAll); +module.exports = function parseLinkTitle(str, pos, max) { + var code, + marker, + lines = 0, + start = pos, + result = { + ok: false, + pos: 0, + lines: 0, + str: '' + }; + if (pos >= max) { + return result; + } + marker = str.charCodeAt(pos); + if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { + return result; + } + pos++; + + // if opening marker is "(", switch it to closing marker ")" + if (marker === 0x28) { + marker = 0x29; + } + while (pos < max) { + code = str.charCodeAt(pos); + if (code === marker) { + result.pos = pos + 1; + result.lines = lines; + result.str = unescapeAll(str.slice(start + 1, pos)); + result.ok = true; + return result; + } else if (code === 0x28 /* ( */ && marker === 0x29 /* ) */) { + return result; + } else if (code === 0x0A) { + lines++; + } else if (code === 0x5C /* \ */ && pos + 1 < max) { + pos++; + if (str.charCodeAt(pos) === 0x0A) { + lines++; + } + } + pos++; + } + return result; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/index.js": +/*!************************************************!*\ + !*** ../node_modules/markdown-it/lib/index.js ***! + \************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Main parser class + + + +var utils = __webpack_require__(/*! ./common/utils */ "../node_modules/markdown-it/lib/common/utils.js"); +var helpers = __webpack_require__(/*! ./helpers */ "../node_modules/markdown-it/lib/helpers/index.js"); +var Renderer = __webpack_require__(/*! ./renderer */ "../node_modules/markdown-it/lib/renderer.js"); +var ParserCore = __webpack_require__(/*! ./parser_core */ "../node_modules/markdown-it/lib/parser_core.js"); +var ParserBlock = __webpack_require__(/*! ./parser_block */ "../node_modules/markdown-it/lib/parser_block.js"); +var ParserInline = __webpack_require__(/*! ./parser_inline */ "../node_modules/markdown-it/lib/parser_inline.js"); +var LinkifyIt = __webpack_require__(/*! linkify-it */ "../../../node_modules/linkify-it/index.js"); +var mdurl = __webpack_require__(/*! mdurl */ "../../../node_modules/mdurl/index.js"); +var punycode = __webpack_require__(/*! punycode */ "../../../node_modules/punycode/punycode.es6.js"); +var config = { + default: __webpack_require__(/*! ./presets/default */ "../node_modules/markdown-it/lib/presets/default.js"), + zero: __webpack_require__(/*! ./presets/zero */ "../node_modules/markdown-it/lib/presets/zero.js"), + commonmark: __webpack_require__(/*! ./presets/commonmark */ "../node_modules/markdown-it/lib/presets/commonmark.js") +}; + +//////////////////////////////////////////////////////////////////////////////// +// +// This validator can prohibit more than really needed to prevent XSS. It's a +// tradeoff to keep code simple and to be secure by default. +// +// If you need different setup - override validator method as you wish. Or +// replace it with dummy function and use external sanitizer. +// + +var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/; +var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/; +function validateLink(url) { + // url should be normalized at this point, and existing entities are decoded + var str = url.trim().toLowerCase(); + return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) ? true : false : true; +} + +//////////////////////////////////////////////////////////////////////////////// + +var RECODE_HOSTNAME_FOR = ['http:', 'https:', 'mailto:']; +function normalizeLink(url) { + var parsed = mdurl.parse(url, true); + if (parsed.hostname) { + // Encode hostnames in urls like: + // `http://host/`, `https://host/`, `mailto:user@host`, `//host/` + // + // We don't encode unknown schemas, because it's likely that we encode + // something we shouldn't (e.g. `skype:name` treated as `skype:host`) + // + if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { + try { + parsed.hostname = punycode.toASCII(parsed.hostname); + } catch (er) {/**/} + } + } + return mdurl.encode(mdurl.format(parsed)); +} +function normalizeLinkText(url) { + var parsed = mdurl.parse(url, true); + if (parsed.hostname) { + // Encode hostnames in urls like: + // `http://host/`, `https://host/`, `mailto:user@host`, `//host/` + // + // We don't encode unknown schemas, because it's likely that we encode + // something we shouldn't (e.g. `skype:name` treated as `skype:host`) + // + if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { + try { + parsed.hostname = punycode.toUnicode(parsed.hostname); + } catch (er) {/**/} + } + } + + // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720 + return mdurl.decode(mdurl.format(parsed), mdurl.decode.defaultChars + '%'); +} + +/** + * class MarkdownIt + * + * Main parser/renderer class. + * + * ##### Usage + * + * ```javascript + * // node.js, "classic" way: + * var MarkdownIt = require('markdown-it'), + * md = new MarkdownIt(); + * var result = md.render('# markdown-it rulezz!'); + * + * // node.js, the same, but with sugar: + * var md = require('markdown-it')(); + * var result = md.render('# markdown-it rulezz!'); + * + * // browser without AMD, added to "window" on script load + * // Note, there are no dash. + * var md = window.markdownit(); + * var result = md.render('# markdown-it rulezz!'); + * ``` + * + * Single line rendering, without paragraph wrap: + * + * ```javascript + * var md = require('markdown-it')(); + * var result = md.renderInline('__markdown-it__ rulezz!'); + * ``` + **/ + +/** + * new MarkdownIt([presetName, options]) + * - presetName (String): optional, `commonmark` / `zero` + * - options (Object) + * + * Creates parser instanse with given config. Can be called without `new`. + * + * ##### presetName + * + * MarkdownIt provides named presets as a convenience to quickly + * enable/disable active syntax rules and options for common use cases. + * + * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) - + * configures parser to strict [CommonMark](http://commonmark.org/) mode. + * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) - + * similar to GFM, used when no preset name given. Enables all available rules, + * but still without html, typographer & autolinker. + * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) - + * all rules disabled. Useful to quickly setup your config via `.enable()`. + * For example, when you need only `bold` and `italic` markup and nothing else. + * + * ##### options: + * + * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful! + * That's not safe! You may need external sanitizer to protect output from XSS. + * It's better to extend features via plugins, instead of enabling HTML. + * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags + * (`
`). This is needed only for full CommonMark compatibility. In real + * world you will need HTML output. + * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `
`. + * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks. + * Can be useful for external highlighters. + * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links. + * - __typographer__ - `false`. Set `true` to enable [some language-neutral + * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) + + * quotes beautification (smartquotes). + * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement + * pairs, when typographer enabled and smartquotes on. For example, you can + * use `'«»„“'` for Russian, `'„“‚‘'` for German, and + * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp). + * - __highlight__ - `null`. Highlighter function for fenced code blocks. + * Highlighter `function (str, lang)` should return escaped HTML. It can also + * return empty string if the source was not changed and should be escaped + * externaly. If result starts with `): + * + * ```javascript + * var hljs = require('highlight.js') // https://highlightjs.org/ + * + * // Actual default values + * var md = require('markdown-it')({ + * highlight: function (str, lang) { + * if (lang && hljs.getLanguage(lang)) { + * try { + * return '
' +
+ *                hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
+ *                '
'; + * } catch (__) {} + * } + * + * return '
' + md.utils.escapeHtml(str) + '
'; + * } + * }); + * ``` + * + **/ +function MarkdownIt(presetName, options) { + if (!(this instanceof MarkdownIt)) { + return new MarkdownIt(presetName, options); + } + if (!options) { + if (!utils.isString(presetName)) { + options = presetName || {}; + presetName = 'default'; + } + } + + /** + * MarkdownIt#inline -> ParserInline + * + * Instance of [[ParserInline]]. You may need it to add new rules when + * writing plugins. For simple rules control use [[MarkdownIt.disable]] and + * [[MarkdownIt.enable]]. + **/ + this.inline = new ParserInline(); + + /** + * MarkdownIt#block -> ParserBlock + * + * Instance of [[ParserBlock]]. You may need it to add new rules when + * writing plugins. For simple rules control use [[MarkdownIt.disable]] and + * [[MarkdownIt.enable]]. + **/ + this.block = new ParserBlock(); + + /** + * MarkdownIt#core -> Core + * + * Instance of [[Core]] chain executor. You may need it to add new rules when + * writing plugins. For simple rules control use [[MarkdownIt.disable]] and + * [[MarkdownIt.enable]]. + **/ + this.core = new ParserCore(); + + /** + * MarkdownIt#renderer -> Renderer + * + * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering + * rules for new token types, generated by plugins. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * function myToken(tokens, idx, options, env, self) { + * //... + * return result; + * }; + * + * md.renderer.rules['my_token'] = myToken + * ``` + * + * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js). + **/ + this.renderer = new Renderer(); + + /** + * MarkdownIt#linkify -> LinkifyIt + * + * [linkify-it](https://github.com/markdown-it/linkify-it) instance. + * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js) + * rule. + **/ + this.linkify = new LinkifyIt(); + + /** + * MarkdownIt#validateLink(url) -> Boolean + * + * Link validation function. CommonMark allows too much in links. By default + * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas + * except some embedded image types. + * + * You can change this behaviour: + * + * ```javascript + * var md = require('markdown-it')(); + * // enable everything + * md.validateLink = function () { return true; } + * ``` + **/ + this.validateLink = validateLink; + + /** + * MarkdownIt#normalizeLink(url) -> String + * + * Function used to encode link url to a machine-readable format, + * which includes url-encoding, punycode, etc. + **/ + this.normalizeLink = normalizeLink; + + /** + * MarkdownIt#normalizeLinkText(url) -> String + * + * Function used to decode link url to a human-readable format` + **/ + this.normalizeLinkText = normalizeLinkText; + + // Expose utils & helpers for easy acces from plugins + + /** + * MarkdownIt#utils -> utils + * + * Assorted utility functions, useful to write plugins. See details + * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js). + **/ + this.utils = utils; + + /** + * MarkdownIt#helpers -> helpers + * + * Link components parser functions, useful to write plugins. See details + * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers). + **/ + this.helpers = utils.assign({}, helpers); + this.options = {}; + this.configure(presetName); + if (options) { + this.set(options); + } +} + +/** chainable + * MarkdownIt.set(options) + * + * Set parser options (in the same format as in constructor). Probably, you + * will never need it, but you can change options after constructor call. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')() + * .set({ html: true, breaks: true }) + * .set({ typographer, true }); + * ``` + * + * __Note:__ To achieve the best possible performance, don't modify a + * `markdown-it` instance options on the fly. If you need multiple configurations + * it's best to create multiple instances and initialize each with separate + * config. + **/ +MarkdownIt.prototype.set = function (options) { + utils.assign(this.options, options); + return this; +}; + +/** chainable, internal + * MarkdownIt.configure(presets) + * + * Batch load of all options and compenent settings. This is internal method, + * and you probably will not need it. But if you will - see available presets + * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets) + * + * We strongly recommend to use presets instead of direct config loads. That + * will give better compatibility with next versions. + **/ +MarkdownIt.prototype.configure = function (presets) { + var self = this, + presetName; + if (utils.isString(presets)) { + presetName = presets; + presets = config[presetName]; + if (!presets) { + throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); + } + } + if (!presets) { + throw new Error('Wrong `markdown-it` preset, can\'t be empty'); + } + if (presets.options) { + self.set(presets.options); + } + if (presets.components) { + Object.keys(presets.components).forEach(function (name) { + if (presets.components[name].rules) { + self[name].ruler.enableOnly(presets.components[name].rules); + } + if (presets.components[name].rules2) { + self[name].ruler2.enableOnly(presets.components[name].rules2); + } + }); + } + return this; +}; + +/** chainable + * MarkdownIt.enable(list, ignoreInvalid) + * - list (String|Array): rule name or list of rule names to enable + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Enable list or rules. It will automatically find appropriate components, + * containing rules with given names. If rule not found, and `ignoreInvalid` + * not set - throws exception. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')() + * .enable(['sub', 'sup']) + * .disable('smartquotes'); + * ``` + **/ +MarkdownIt.prototype.enable = function (list, ignoreInvalid) { + var result = []; + if (!Array.isArray(list)) { + list = [list]; + } + ['core', 'block', 'inline'].forEach(function (chain) { + result = result.concat(this[chain].ruler.enable(list, true)); + }, this); + result = result.concat(this.inline.ruler2.enable(list, true)); + var missed = list.filter(function (name) { + return result.indexOf(name) < 0; + }); + if (missed.length && !ignoreInvalid) { + throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed); + } + return this; +}; + +/** chainable + * MarkdownIt.disable(list, ignoreInvalid) + * - list (String|Array): rule name or list of rule names to disable. + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * The same as [[MarkdownIt.enable]], but turn specified rules off. + **/ +MarkdownIt.prototype.disable = function (list, ignoreInvalid) { + var result = []; + if (!Array.isArray(list)) { + list = [list]; + } + ['core', 'block', 'inline'].forEach(function (chain) { + result = result.concat(this[chain].ruler.disable(list, true)); + }, this); + result = result.concat(this.inline.ruler2.disable(list, true)); + var missed = list.filter(function (name) { + return result.indexOf(name) < 0; + }); + if (missed.length && !ignoreInvalid) { + throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed); + } + return this; +}; + +/** chainable + * MarkdownIt.use(plugin, params) + * + * Load specified plugin with given params into current parser instance. + * It's just a sugar to call `plugin(md, params)` with curring. + * + * ##### Example + * + * ```javascript + * var iterator = require('markdown-it-for-inline'); + * var md = require('markdown-it')() + * .use(iterator, 'foo_replace', 'text', function (tokens, idx) { + * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar'); + * }); + * ``` + **/ +MarkdownIt.prototype.use = function (plugin /*, params, ... */) { + var args = [this].concat(Array.prototype.slice.call(arguments, 1)); + plugin.apply(plugin, args); + return this; +}; + +/** internal + * MarkdownIt.parse(src, env) -> Array + * - src (String): source string + * - env (Object): environment sandbox + * + * Parse input string and return list of block tokens (special token type + * "inline" will contain list of inline tokens). You should not call this + * method directly, until you write custom renderer (for example, to produce + * AST). + * + * `env` is used to pass data between "distributed" rules and return additional + * metadata like reference info, needed for the renderer. It also can be used to + * inject data in specific cases. Usually, you will be ok to pass `{}`, + * and then pass updated object to renderer. + **/ +MarkdownIt.prototype.parse = function (src, env) { + if (typeof src !== 'string') { + throw new Error('Input data should be a String'); + } + var state = new this.core.State(src, this, env); + this.core.process(state); + return state.tokens; +}; + +/** + * MarkdownIt.render(src [, env]) -> String + * - src (String): source string + * - env (Object): environment sandbox + * + * Render markdown string into html. It does all magic for you :). + * + * `env` can be used to inject additional metadata (`{}` by default). + * But you will not need it with high probability. See also comment + * in [[MarkdownIt.parse]]. + **/ +MarkdownIt.prototype.render = function (src, env) { + env = env || {}; + return this.renderer.render(this.parse(src, env), this.options, env); +}; + +/** internal + * MarkdownIt.parseInline(src, env) -> Array + * - src (String): source string + * - env (Object): environment sandbox + * + * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the + * block tokens list with the single `inline` element, containing parsed inline + * tokens in `children` property. Also updates `env` object. + **/ +MarkdownIt.prototype.parseInline = function (src, env) { + var state = new this.core.State(src, this, env); + state.inlineMode = true; + this.core.process(state); + return state.tokens; +}; + +/** + * MarkdownIt.renderInline(src [, env]) -> String + * - src (String): source string + * - env (Object): environment sandbox + * + * Similar to [[MarkdownIt.render]] but for single paragraph content. Result + * will NOT be wrapped into `

` tags. + **/ +MarkdownIt.prototype.renderInline = function (src, env) { + env = env || {}; + return this.renderer.render(this.parseInline(src, env), this.options, env); +}; +module.exports = MarkdownIt; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/parser_block.js": +/*!*******************************************************!*\ + !*** ../node_modules/markdown-it/lib/parser_block.js ***! + \*******************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/** internal + * class ParserBlock + * + * Block-level tokenizer. + **/ + + +var Ruler = __webpack_require__(/*! ./ruler */ "../node_modules/markdown-it/lib/ruler.js"); +var _rules = [ +// First 2 params - rule name & source. Secondary array - list of rules, +// which can be terminated by this one. +['table', __webpack_require__(/*! ./rules_block/table */ "../node_modules/markdown-it/lib/rules_block/table.js"), ['paragraph', 'reference']], ['code', __webpack_require__(/*! ./rules_block/code */ "../node_modules/markdown-it/lib/rules_block/code.js")], ['fence', __webpack_require__(/*! ./rules_block/fence */ "../node_modules/markdown-it/lib/rules_block/fence.js"), ['paragraph', 'reference', 'blockquote', 'list']], ['blockquote', __webpack_require__(/*! ./rules_block/blockquote */ "../node_modules/markdown-it/lib/rules_block/blockquote.js"), ['paragraph', 'reference', 'blockquote', 'list']], ['hr', __webpack_require__(/*! ./rules_block/hr */ "../node_modules/markdown-it/lib/rules_block/hr.js"), ['paragraph', 'reference', 'blockquote', 'list']], ['list', __webpack_require__(/*! ./rules_block/list */ "../node_modules/markdown-it/lib/rules_block/list.js"), ['paragraph', 'reference', 'blockquote']], ['reference', __webpack_require__(/*! ./rules_block/reference */ "../node_modules/markdown-it/lib/rules_block/reference.js")], ['html_block', __webpack_require__(/*! ./rules_block/html_block */ "../node_modules/markdown-it/lib/rules_block/html_block.js"), ['paragraph', 'reference', 'blockquote']], ['heading', __webpack_require__(/*! ./rules_block/heading */ "../node_modules/markdown-it/lib/rules_block/heading.js"), ['paragraph', 'reference', 'blockquote']], ['lheading', __webpack_require__(/*! ./rules_block/lheading */ "../node_modules/markdown-it/lib/rules_block/lheading.js")], ['paragraph', __webpack_require__(/*! ./rules_block/paragraph */ "../node_modules/markdown-it/lib/rules_block/paragraph.js")]]; + +/** + * new ParserBlock() + **/ +function ParserBlock() { + /** + * ParserBlock#ruler -> Ruler + * + * [[Ruler]] instance. Keep configuration of block rules. + **/ + this.ruler = new Ruler(); + for (var i = 0; i < _rules.length; i++) { + this.ruler.push(_rules[i][0], _rules[i][1], { + alt: (_rules[i][2] || []).slice() + }); + } +} + +// Generate tokens for input range +// +ParserBlock.prototype.tokenize = function (state, startLine, endLine) { + var ok, + i, + rules = this.ruler.getRules(''), + len = rules.length, + line = startLine, + hasEmptyLines = false, + maxNesting = state.md.options.maxNesting; + while (line < endLine) { + state.line = line = state.skipEmptyLines(line); + if (line >= endLine) { + break; + } + + // Termination condition for nested calls. + // Nested calls currently used for blockquotes & lists + if (state.sCount[line] < state.blkIndent) { + break; + } + + // If nesting level exceeded - skip tail to the end. That's not ordinary + // situation and we should not care about content. + if (state.level >= maxNesting) { + state.line = endLine; + break; + } + + // Try all possible rules. + // On success, rule should: + // + // - update `state.line` + // - update `state.tokens` + // - return true + + for (i = 0; i < len; i++) { + ok = rules[i](state, line, endLine, false); + if (ok) { + break; + } + } + + // set state.tight if we had an empty line before current tag + // i.e. latest empty line should not count + state.tight = !hasEmptyLines; + + // paragraph might "eat" one newline after it in nested lists + if (state.isEmpty(state.line - 1)) { + hasEmptyLines = true; + } + line = state.line; + if (line < endLine && state.isEmpty(line)) { + hasEmptyLines = true; + line++; + state.line = line; + } + } +}; + +/** + * ParserBlock.parse(str, md, env, outTokens) + * + * Process input string and push block tokens into `outTokens` + **/ +ParserBlock.prototype.parse = function (src, md, env, outTokens) { + var state; + if (!src) { + return; + } + state = new this.State(src, md, env, outTokens); + this.tokenize(state, state.line, state.lineMax); +}; +ParserBlock.prototype.State = __webpack_require__(/*! ./rules_block/state_block */ "../node_modules/markdown-it/lib/rules_block/state_block.js"); +module.exports = ParserBlock; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/parser_core.js": +/*!******************************************************!*\ + !*** ../node_modules/markdown-it/lib/parser_core.js ***! + \******************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/** internal + * class Core + * + * Top-level rules executor. Glues block/inline parsers and does intermediate + * transformations. + **/ + + +var Ruler = __webpack_require__(/*! ./ruler */ "../node_modules/markdown-it/lib/ruler.js"); +var _rules = [['normalize', __webpack_require__(/*! ./rules_core/normalize */ "../node_modules/markdown-it/lib/rules_core/normalize.js")], ['block', __webpack_require__(/*! ./rules_core/block */ "../node_modules/markdown-it/lib/rules_core/block.js")], ['inline', __webpack_require__(/*! ./rules_core/inline */ "../node_modules/markdown-it/lib/rules_core/inline.js")], ['linkify', __webpack_require__(/*! ./rules_core/linkify */ "../node_modules/markdown-it/lib/rules_core/linkify.js")], ['replacements', __webpack_require__(/*! ./rules_core/replacements */ "../node_modules/markdown-it/lib/rules_core/replacements.js")], ['smartquotes', __webpack_require__(/*! ./rules_core/smartquotes */ "../node_modules/markdown-it/lib/rules_core/smartquotes.js")]]; + +/** + * new Core() + **/ +function Core() { + /** + * Core#ruler -> Ruler + * + * [[Ruler]] instance. Keep configuration of core rules. + **/ + this.ruler = new Ruler(); + for (var i = 0; i < _rules.length; i++) { + this.ruler.push(_rules[i][0], _rules[i][1]); + } +} + +/** + * Core.process(state) + * + * Executes core chain rules. + **/ +Core.prototype.process = function (state) { + var i, l, rules; + rules = this.ruler.getRules(''); + for (i = 0, l = rules.length; i < l; i++) { + rules[i](state); + } +}; +Core.prototype.State = __webpack_require__(/*! ./rules_core/state_core */ "../node_modules/markdown-it/lib/rules_core/state_core.js"); +module.exports = Core; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/parser_inline.js": +/*!********************************************************!*\ + !*** ../node_modules/markdown-it/lib/parser_inline.js ***! + \********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/** internal + * class ParserInline + * + * Tokenizes paragraph content. + **/ + + +var Ruler = __webpack_require__(/*! ./ruler */ "../node_modules/markdown-it/lib/ruler.js"); + +//////////////////////////////////////////////////////////////////////////////// +// Parser rules + +var _rules = [['text', __webpack_require__(/*! ./rules_inline/text */ "../node_modules/markdown-it/lib/rules_inline/text.js")], ['newline', __webpack_require__(/*! ./rules_inline/newline */ "../node_modules/markdown-it/lib/rules_inline/newline.js")], ['escape', __webpack_require__(/*! ./rules_inline/escape */ "../node_modules/markdown-it/lib/rules_inline/escape.js")], ['backticks', __webpack_require__(/*! ./rules_inline/backticks */ "../node_modules/markdown-it/lib/rules_inline/backticks.js")], ['strikethrough', (__webpack_require__(/*! ./rules_inline/strikethrough */ "../node_modules/markdown-it/lib/rules_inline/strikethrough.js").tokenize)], ['emphasis', (__webpack_require__(/*! ./rules_inline/emphasis */ "../node_modules/markdown-it/lib/rules_inline/emphasis.js").tokenize)], ['link', __webpack_require__(/*! ./rules_inline/link */ "../node_modules/markdown-it/lib/rules_inline/link.js")], ['image', __webpack_require__(/*! ./rules_inline/image */ "../node_modules/markdown-it/lib/rules_inline/image.js")], ['autolink', __webpack_require__(/*! ./rules_inline/autolink */ "../node_modules/markdown-it/lib/rules_inline/autolink.js")], ['html_inline', __webpack_require__(/*! ./rules_inline/html_inline */ "../node_modules/markdown-it/lib/rules_inline/html_inline.js")], ['entity', __webpack_require__(/*! ./rules_inline/entity */ "../node_modules/markdown-it/lib/rules_inline/entity.js")]]; +var _rules2 = [['balance_pairs', __webpack_require__(/*! ./rules_inline/balance_pairs */ "../node_modules/markdown-it/lib/rules_inline/balance_pairs.js")], ['strikethrough', (__webpack_require__(/*! ./rules_inline/strikethrough */ "../node_modules/markdown-it/lib/rules_inline/strikethrough.js").postProcess)], ['emphasis', (__webpack_require__(/*! ./rules_inline/emphasis */ "../node_modules/markdown-it/lib/rules_inline/emphasis.js").postProcess)], ['text_collapse', __webpack_require__(/*! ./rules_inline/text_collapse */ "../node_modules/markdown-it/lib/rules_inline/text_collapse.js")]]; + +/** + * new ParserInline() + **/ +function ParserInline() { + var i; + + /** + * ParserInline#ruler -> Ruler + * + * [[Ruler]] instance. Keep configuration of inline rules. + **/ + this.ruler = new Ruler(); + for (i = 0; i < _rules.length; i++) { + this.ruler.push(_rules[i][0], _rules[i][1]); + } + + /** + * ParserInline#ruler2 -> Ruler + * + * [[Ruler]] instance. Second ruler used for post-processing + * (e.g. in emphasis-like rules). + **/ + this.ruler2 = new Ruler(); + for (i = 0; i < _rules2.length; i++) { + this.ruler2.push(_rules2[i][0], _rules2[i][1]); + } +} + +// Skip single token by running all rules in validation mode; +// returns `true` if any rule reported success +// +ParserInline.prototype.skipToken = function (state) { + var ok, + i, + pos = state.pos, + rules = this.ruler.getRules(''), + len = rules.length, + maxNesting = state.md.options.maxNesting, + cache = state.cache; + if (typeof cache[pos] !== 'undefined') { + state.pos = cache[pos]; + return; + } + if (state.level < maxNesting) { + for (i = 0; i < len; i++) { + // Increment state.level and decrement it later to limit recursion. + // It's harmless to do here, because no tokens are created. But ideally, + // we'd need a separate private state variable for this purpose. + // + state.level++; + ok = rules[i](state, true); + state.level--; + if (ok) { + break; + } + } + } else { + // Too much nesting, just skip until the end of the paragraph. + // + // NOTE: this will cause links to behave incorrectly in the following case, + // when an amount of `[` is exactly equal to `maxNesting + 1`: + // + // [[[[[[[[[[[[[[[[[[[[[foo]() + // + // TODO: remove this workaround when CM standard will allow nested links + // (we can replace it by preventing links from being parsed in + // validation mode) + // + state.pos = state.posMax; + } + if (!ok) { + state.pos++; + } + cache[pos] = state.pos; +}; + +// Generate tokens for input range +// +ParserInline.prototype.tokenize = function (state) { + var ok, + i, + rules = this.ruler.getRules(''), + len = rules.length, + end = state.posMax, + maxNesting = state.md.options.maxNesting; + while (state.pos < end) { + // Try all possible rules. + // On success, rule should: + // + // - update `state.pos` + // - update `state.tokens` + // - return true + + if (state.level < maxNesting) { + for (i = 0; i < len; i++) { + ok = rules[i](state, false); + if (ok) { + break; + } + } + } + if (ok) { + if (state.pos >= end) { + break; + } + continue; + } + state.pending += state.src[state.pos++]; + } + if (state.pending) { + state.pushPending(); + } +}; + +/** + * ParserInline.parse(str, md, env, outTokens) + * + * Process input string and push inline tokens into `outTokens` + **/ +ParserInline.prototype.parse = function (str, md, env, outTokens) { + var i, rules, len; + var state = new this.State(str, md, env, outTokens); + this.tokenize(state); + rules = this.ruler2.getRules(''); + len = rules.length; + for (i = 0; i < len; i++) { + rules[i](state); + } +}; +ParserInline.prototype.State = __webpack_require__(/*! ./rules_inline/state_inline */ "../node_modules/markdown-it/lib/rules_inline/state_inline.js"); +module.exports = ParserInline; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/presets/commonmark.js": +/*!*************************************************************!*\ + !*** ../node_modules/markdown-it/lib/presets/commonmark.js ***! + \*************************************************************/ +/***/ (function(module) { + +// Commonmark default options + + + +module.exports = { + options: { + html: true, + // Enable HTML tags in source + xhtmlOut: true, + // Use '/' to close single tags (
) + breaks: false, + // Convert '\n' in paragraphs into
+ langPrefix: 'language-', + // CSS language prefix for fenced blocks + linkify: false, + // autoconvert URL-like texts to links + + // Enable some language-neutral replacements + quotes beautification + typographer: false, + // Double + single quotes replacement pairs, when typographer enabled, + // and smartquotes on. Could be either a String or an Array. + // + // For example, you can use '«»„“' for Russian, '„“‚‘' for German, + // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). + quotes: '\u201c\u201d\u2018\u2019', + /* “”‘’ */ + + // Highlighter function. Should return escaped HTML, + // or '' if the source string is not changed and should be escaped externaly. + // If result starts with ) + breaks: false, + // Convert '\n' in paragraphs into
+ langPrefix: 'language-', + // CSS language prefix for fenced blocks + linkify: false, + // autoconvert URL-like texts to links + + // Enable some language-neutral replacements + quotes beautification + typographer: false, + // Double + single quotes replacement pairs, when typographer enabled, + // and smartquotes on. Could be either a String or an Array. + // + // For example, you can use '«»„“' for Russian, '„“‚‘' for German, + // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). + quotes: '\u201c\u201d\u2018\u2019', + /* “”‘’ */ + + // Highlighter function. Should return escaped HTML, + // or '' if the source string is not changed and should be escaped externaly. + // If result starts with ) + breaks: false, + // Convert '\n' in paragraphs into
+ langPrefix: 'language-', + // CSS language prefix for fenced blocks + linkify: false, + // autoconvert URL-like texts to links + + // Enable some language-neutral replacements + quotes beautification + typographer: false, + // Double + single quotes replacement pairs, when typographer enabled, + // and smartquotes on. Could be either a String or an Array. + // + // For example, you can use '«»„“' for Russian, '„“‚‘' for German, + // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). + quotes: '\u201c\u201d\u2018\u2019', + /* “”‘’ */ + + // Highlighter function. Should return escaped HTML, + // or '' if the source string is not changed and should be escaped externaly. + // If result starts with ' + escapeHtml(tokens[idx].content) + ''; +}; +default_rules.code_block = function (tokens, idx, options, env, slf) { + var token = tokens[idx]; + return '' + escapeHtml(tokens[idx].content) + '\n'; +}; +default_rules.fence = function (tokens, idx, options, env, slf) { + var token = tokens[idx], + info = token.info ? unescapeAll(token.info).trim() : '', + langName = '', + langAttrs = '', + highlighted, + i, + arr, + tmpAttrs, + tmpToken; + if (info) { + arr = info.split(/(\s+)/g); + langName = arr[0]; + langAttrs = arr.slice(2).join(''); + } + if (options.highlight) { + highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content); + } else { + highlighted = escapeHtml(token.content); + } + if (highlighted.indexOf('' + highlighted + '\n'; + } + return '

' + highlighted + '
\n'; +}; +default_rules.image = function (tokens, idx, options, env, slf) { + var token = tokens[idx]; + + // "alt" attr MUST be set, even if empty. Because it's mandatory and + // should be placed on proper position for tests. + // + // Replace content with actual value + + token.attrs[token.attrIndex('alt')][1] = slf.renderInlineAsText(token.children, options, env); + return slf.renderToken(tokens, idx, options); +}; +default_rules.hardbreak = function (tokens, idx, options /*, env */) { + return options.xhtmlOut ? '
\n' : '
\n'; +}; +default_rules.softbreak = function (tokens, idx, options /*, env */) { + return options.breaks ? options.xhtmlOut ? '
\n' : '
\n' : '\n'; +}; +default_rules.text = function (tokens, idx /*, options, env */) { + return escapeHtml(tokens[idx].content); +}; +default_rules.html_block = function (tokens, idx /*, options, env */) { + return tokens[idx].content; +}; +default_rules.html_inline = function (tokens, idx /*, options, env */) { + return tokens[idx].content; +}; + +/** + * new Renderer() + * + * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults. + **/ +function Renderer() { + /** + * Renderer#rules -> Object + * + * Contains render rules for tokens. Can be updated and extended. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.renderer.rules.strong_open = function () { return ''; }; + * md.renderer.rules.strong_close = function () { return ''; }; + * + * var result = md.renderInline(...); + * ``` + * + * Each rule is called as independent static function with fixed signature: + * + * ```javascript + * function my_token_render(tokens, idx, options, env, renderer) { + * // ... + * return renderedHTML; + * } + * ``` + * + * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js) + * for more details and examples. + **/ + this.rules = assign({}, default_rules); +} + +/** + * Renderer.renderAttrs(token) -> String + * + * Render token attributes to string. + **/ +Renderer.prototype.renderAttrs = function renderAttrs(token) { + var i, l, result; + if (!token.attrs) { + return ''; + } + result = ''; + for (i = 0, l = token.attrs.length; i < l; i++) { + result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"'; + } + return result; +}; + +/** + * Renderer.renderToken(tokens, idx, options) -> String + * - tokens (Array): list of tokens + * - idx (Numbed): token index to render + * - options (Object): params of parser instance + * + * Default token renderer. Can be overriden by custom function + * in [[Renderer#rules]]. + **/ +Renderer.prototype.renderToken = function renderToken(tokens, idx, options) { + var nextToken, + result = '', + needLf = false, + token = tokens[idx]; + + // Tight list paragraphs + if (token.hidden) { + return ''; + } + + // Insert a newline between hidden paragraph and subsequent opening + // block-level tag. + // + // For example, here we should insert a newline before blockquote: + // - a + // > + // + if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) { + result += '\n'; + } + + // Add token name, e.g. ``. + // + needLf = false; + } + } + } + } + result += needLf ? '>\n' : '>'; + return result; +}; + +/** + * Renderer.renderInline(tokens, options, env) -> String + * - tokens (Array): list on block tokens to renter + * - options (Object): params of parser instance + * - env (Object): additional data from parsed input (references, for example) + * + * The same as [[Renderer.render]], but for single token of `inline` type. + **/ +Renderer.prototype.renderInline = function (tokens, options, env) { + var type, + result = '', + rules = this.rules; + for (var i = 0, len = tokens.length; i < len; i++) { + type = tokens[i].type; + if (typeof rules[type] !== 'undefined') { + result += rules[type](tokens, i, options, env, this); + } else { + result += this.renderToken(tokens, i, options); + } + } + return result; +}; + +/** internal + * Renderer.renderInlineAsText(tokens, options, env) -> String + * - tokens (Array): list on block tokens to renter + * - options (Object): params of parser instance + * - env (Object): additional data from parsed input (references, for example) + * + * Special kludge for image `alt` attributes to conform CommonMark spec. + * Don't try to use it! Spec requires to show `alt` content with stripped markup, + * instead of simple escaping. + **/ +Renderer.prototype.renderInlineAsText = function (tokens, options, env) { + var result = ''; + for (var i = 0, len = tokens.length; i < len; i++) { + if (tokens[i].type === 'text') { + result += tokens[i].content; + } else if (tokens[i].type === 'image') { + result += this.renderInlineAsText(tokens[i].children, options, env); + } else if (tokens[i].type === 'softbreak') { + result += '\n'; + } + } + return result; +}; + +/** + * Renderer.render(tokens, options, env) -> String + * - tokens (Array): list on block tokens to renter + * - options (Object): params of parser instance + * - env (Object): additional data from parsed input (references, for example) + * + * Takes token stream and generates HTML. Probably, you will never need to call + * this method directly. + **/ +Renderer.prototype.render = function (tokens, options, env) { + var i, + len, + type, + result = '', + rules = this.rules; + for (i = 0, len = tokens.length; i < len; i++) { + type = tokens[i].type; + if (type === 'inline') { + result += this.renderInline(tokens[i].children, options, env); + } else if (typeof rules[type] !== 'undefined') { + result += rules[tokens[i].type](tokens, i, options, env, this); + } else { + result += this.renderToken(tokens, i, options, env); + } + } + return result; +}; +module.exports = Renderer; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/ruler.js": +/*!************************************************!*\ + !*** ../node_modules/markdown-it/lib/ruler.js ***! + \************************************************/ +/***/ (function(module) { + +/** + * class Ruler + * + * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and + * [[MarkdownIt#inline]] to manage sequences of functions (rules): + * + * - keep rules in defined order + * - assign the name to each rule + * - enable/disable rules + * - add/replace rules + * - allow assign rules to additional named chains (in the same) + * - cacheing lists of active rules + * + * You will not need use this class directly until write plugins. For simple + * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and + * [[MarkdownIt.use]]. + **/ + + +/** + * new Ruler() + **/ +function Ruler() { + // List of added rules. Each element is: + // + // { + // name: XXX, + // enabled: Boolean, + // fn: Function(), + // alt: [ name2, name3 ] + // } + // + this.__rules__ = []; + + // Cached rule chains. + // + // First level - chain name, '' for default. + // Second level - diginal anchor for fast filtering by charcodes. + // + this.__cache__ = null; +} + +//////////////////////////////////////////////////////////////////////////////// +// Helper methods, should not be used directly + +// Find rule index by name +// +Ruler.prototype.__find__ = function (name) { + for (var i = 0; i < this.__rules__.length; i++) { + if (this.__rules__[i].name === name) { + return i; + } + } + return -1; +}; + +// Build rules lookup cache +// +Ruler.prototype.__compile__ = function () { + var self = this; + var chains = ['']; + + // collect unique names + self.__rules__.forEach(function (rule) { + if (!rule.enabled) { + return; + } + rule.alt.forEach(function (altName) { + if (chains.indexOf(altName) < 0) { + chains.push(altName); + } + }); + }); + self.__cache__ = {}; + chains.forEach(function (chain) { + self.__cache__[chain] = []; + self.__rules__.forEach(function (rule) { + if (!rule.enabled) { + return; + } + if (chain && rule.alt.indexOf(chain) < 0) { + return; + } + self.__cache__[chain].push(rule.fn); + }); + }); +}; + +/** + * Ruler.at(name, fn [, options]) + * - name (String): rule name to replace. + * - fn (Function): new rule function. + * - options (Object): new rule options (not mandatory). + * + * Replace rule by name with new function & options. Throws error if name not + * found. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * Replace existing typographer replacement rule with new one: + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.core.ruler.at('replacements', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.at = function (name, fn, options) { + var index = this.__find__(name); + var opt = options || {}; + if (index === -1) { + throw new Error('Parser rule not found: ' + name); + } + this.__rules__[index].fn = fn; + this.__rules__[index].alt = opt.alt || []; + this.__cache__ = null; +}; + +/** + * Ruler.before(beforeName, ruleName, fn [, options]) + * - beforeName (String): new rule will be added before this one. + * - ruleName (String): name of added rule. + * - fn (Function): rule function. + * - options (Object): rule options (not mandatory). + * + * Add new rule to chain before one with given name. See also + * [[Ruler.after]], [[Ruler.push]]. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.block.ruler.before('paragraph', 'my_rule', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.before = function (beforeName, ruleName, fn, options) { + var index = this.__find__(beforeName); + var opt = options || {}; + if (index === -1) { + throw new Error('Parser rule not found: ' + beforeName); + } + this.__rules__.splice(index, 0, { + name: ruleName, + enabled: true, + fn: fn, + alt: opt.alt || [] + }); + this.__cache__ = null; +}; + +/** + * Ruler.after(afterName, ruleName, fn [, options]) + * - afterName (String): new rule will be added after this one. + * - ruleName (String): name of added rule. + * - fn (Function): rule function. + * - options (Object): rule options (not mandatory). + * + * Add new rule to chain after one with given name. See also + * [[Ruler.before]], [[Ruler.push]]. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.inline.ruler.after('text', 'my_rule', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.after = function (afterName, ruleName, fn, options) { + var index = this.__find__(afterName); + var opt = options || {}; + if (index === -1) { + throw new Error('Parser rule not found: ' + afterName); + } + this.__rules__.splice(index + 1, 0, { + name: ruleName, + enabled: true, + fn: fn, + alt: opt.alt || [] + }); + this.__cache__ = null; +}; + +/** + * Ruler.push(ruleName, fn [, options]) + * - ruleName (String): name of added rule. + * - fn (Function): rule function. + * - options (Object): rule options (not mandatory). + * + * Push new rule to the end of chain. See also + * [[Ruler.before]], [[Ruler.after]]. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.core.ruler.push('my_rule', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.push = function (ruleName, fn, options) { + var opt = options || {}; + this.__rules__.push({ + name: ruleName, + enabled: true, + fn: fn, + alt: opt.alt || [] + }); + this.__cache__ = null; +}; + +/** + * Ruler.enable(list [, ignoreInvalid]) -> Array + * - list (String|Array): list of rule names to enable. + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Enable rules with given names. If any rule name not found - throw Error. + * Errors can be disabled by second param. + * + * Returns list of found rule names (if no exception happened). + * + * See also [[Ruler.disable]], [[Ruler.enableOnly]]. + **/ +Ruler.prototype.enable = function (list, ignoreInvalid) { + if (!Array.isArray(list)) { + list = [list]; + } + var result = []; + + // Search by name and enable + list.forEach(function (name) { + var idx = this.__find__(name); + if (idx < 0) { + if (ignoreInvalid) { + return; + } + throw new Error('Rules manager: invalid rule name ' + name); + } + this.__rules__[idx].enabled = true; + result.push(name); + }, this); + this.__cache__ = null; + return result; +}; + +/** + * Ruler.enableOnly(list [, ignoreInvalid]) + * - list (String|Array): list of rule names to enable (whitelist). + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Enable rules with given names, and disable everything else. If any rule name + * not found - throw Error. Errors can be disabled by second param. + * + * See also [[Ruler.disable]], [[Ruler.enable]]. + **/ +Ruler.prototype.enableOnly = function (list, ignoreInvalid) { + if (!Array.isArray(list)) { + list = [list]; + } + this.__rules__.forEach(function (rule) { + rule.enabled = false; + }); + this.enable(list, ignoreInvalid); +}; + +/** + * Ruler.disable(list [, ignoreInvalid]) -> Array + * - list (String|Array): list of rule names to disable. + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Disable rules with given names. If any rule name not found - throw Error. + * Errors can be disabled by second param. + * + * Returns list of found rule names (if no exception happened). + * + * See also [[Ruler.enable]], [[Ruler.enableOnly]]. + **/ +Ruler.prototype.disable = function (list, ignoreInvalid) { + if (!Array.isArray(list)) { + list = [list]; + } + var result = []; + + // Search by name and disable + list.forEach(function (name) { + var idx = this.__find__(name); + if (idx < 0) { + if (ignoreInvalid) { + return; + } + throw new Error('Rules manager: invalid rule name ' + name); + } + this.__rules__[idx].enabled = false; + result.push(name); + }, this); + this.__cache__ = null; + return result; +}; + +/** + * Ruler.getRules(chainName) -> Array + * + * Return array of active functions (rules) for given chain name. It analyzes + * rules configuration, compiles caches if not exists and returns result. + * + * Default chain name is `''` (empty string). It can't be skipped. That's + * done intentionally, to keep signature monomorphic for high speed. + **/ +Ruler.prototype.getRules = function (chainName) { + if (this.__cache__ === null) { + this.__compile__(); + } + + // Chain can be empty, if rules disabled. But we still have to return Array. + return this.__cache__[chainName] || []; +}; +module.exports = Ruler; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_block/blockquote.js": +/*!*****************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_block/blockquote.js ***! + \*****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Block quotes + + + +var isSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isSpace); +module.exports = function blockquote(state, startLine, endLine, silent) { + var adjustTab, + ch, + i, + initial, + l, + lastLineEmpty, + lines, + nextLine, + offset, + oldBMarks, + oldBSCount, + oldIndent, + oldParentType, + oldSCount, + oldTShift, + spaceAfterMarker, + terminate, + terminatorRules, + token, + isOutdented, + oldLineMax = state.lineMax, + pos = state.bMarks[startLine] + state.tShift[startLine], + max = state.eMarks[startLine]; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + + // check the block quote marker + if (state.src.charCodeAt(pos++) !== 0x3E /* > */) { + return false; + } + + // we know that it's going to be a valid blockquote, + // so no point trying to find the end of it in silent mode + if (silent) { + return true; + } + + // set offset past spaces and ">" + initial = offset = state.sCount[startLine] + 1; + + // skip one optional space after '>' + if (state.src.charCodeAt(pos) === 0x20 /* space */) { + // ' > test ' + // ^ -- position start of line here: + pos++; + initial++; + offset++; + adjustTab = false; + spaceAfterMarker = true; + } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) { + spaceAfterMarker = true; + if ((state.bsCount[startLine] + offset) % 4 === 3) { + // ' >\t test ' + // ^ -- position start of line here (tab has width===1) + pos++; + initial++; + offset++; + adjustTab = false; + } else { + // ' >\t test ' + // ^ -- position start of line here + shift bsCount slightly + // to make extra space appear + adjustTab = true; + } + } else { + spaceAfterMarker = false; + } + oldBMarks = [state.bMarks[startLine]]; + state.bMarks[startLine] = pos; + while (pos < max) { + ch = state.src.charCodeAt(pos); + if (isSpace(ch)) { + if (ch === 0x09) { + offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4; + } else { + offset++; + } + } else { + break; + } + pos++; + } + oldBSCount = [state.bsCount[startLine]]; + state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0); + lastLineEmpty = pos >= max; + oldSCount = [state.sCount[startLine]]; + state.sCount[startLine] = offset - initial; + oldTShift = [state.tShift[startLine]]; + state.tShift[startLine] = pos - state.bMarks[startLine]; + terminatorRules = state.md.block.ruler.getRules('blockquote'); + oldParentType = state.parentType; + state.parentType = 'blockquote'; + + // Search the end of the block + // + // Block ends with either: + // 1. an empty line outside: + // ``` + // > test + // + // ``` + // 2. an empty line inside: + // ``` + // > + // test + // ``` + // 3. another tag: + // ``` + // > test + // - - - + // ``` + for (nextLine = startLine + 1; nextLine < endLine; nextLine++) { + // check if it's outdented, i.e. it's inside list item and indented + // less than said list item: + // + // ``` + // 1. anything + // > current blockquote + // 2. checking this line + // ``` + isOutdented = state.sCount[nextLine] < state.blkIndent; + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + if (pos >= max) { + // Case 1: line is not inside the blockquote, and this line is empty. + break; + } + if (state.src.charCodeAt(pos++) === 0x3E /* > */ && !isOutdented) { + // This line is inside the blockquote. + + // set offset past spaces and ">" + initial = offset = state.sCount[nextLine] + 1; + + // skip one optional space after '>' + if (state.src.charCodeAt(pos) === 0x20 /* space */) { + // ' > test ' + // ^ -- position start of line here: + pos++; + initial++; + offset++; + adjustTab = false; + spaceAfterMarker = true; + } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) { + spaceAfterMarker = true; + if ((state.bsCount[nextLine] + offset) % 4 === 3) { + // ' >\t test ' + // ^ -- position start of line here (tab has width===1) + pos++; + initial++; + offset++; + adjustTab = false; + } else { + // ' >\t test ' + // ^ -- position start of line here + shift bsCount slightly + // to make extra space appear + adjustTab = true; + } + } else { + spaceAfterMarker = false; + } + oldBMarks.push(state.bMarks[nextLine]); + state.bMarks[nextLine] = pos; + while (pos < max) { + ch = state.src.charCodeAt(pos); + if (isSpace(ch)) { + if (ch === 0x09) { + offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4; + } else { + offset++; + } + } else { + break; + } + pos++; + } + lastLineEmpty = pos >= max; + oldBSCount.push(state.bsCount[nextLine]); + state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0); + oldSCount.push(state.sCount[nextLine]); + state.sCount[nextLine] = offset - initial; + oldTShift.push(state.tShift[nextLine]); + state.tShift[nextLine] = pos - state.bMarks[nextLine]; + continue; + } + + // Case 2: line is not inside the blockquote, and the last line was empty. + if (lastLineEmpty) { + break; + } + + // Case 3: another tag found. + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + // Quirk to enforce "hard termination mode" for paragraphs; + // normally if you call `tokenize(state, startLine, nextLine)`, + // paragraphs will look below nextLine for paragraph continuation, + // but if blockquote is terminated by another tag, they shouldn't + state.lineMax = nextLine; + if (state.blkIndent !== 0) { + // state.blkIndent was non-zero, we now set it to zero, + // so we need to re-calculate all offsets to appear as + // if indent wasn't changed + oldBMarks.push(state.bMarks[nextLine]); + oldBSCount.push(state.bsCount[nextLine]); + oldTShift.push(state.tShift[nextLine]); + oldSCount.push(state.sCount[nextLine]); + state.sCount[nextLine] -= state.blkIndent; + } + break; + } + oldBMarks.push(state.bMarks[nextLine]); + oldBSCount.push(state.bsCount[nextLine]); + oldTShift.push(state.tShift[nextLine]); + oldSCount.push(state.sCount[nextLine]); + + // A negative indentation means that this is a paragraph continuation + // + state.sCount[nextLine] = -1; + } + oldIndent = state.blkIndent; + state.blkIndent = 0; + token = state.push('blockquote_open', 'blockquote', 1); + token.markup = '>'; + token.map = lines = [startLine, 0]; + state.md.block.tokenize(state, startLine, nextLine); + token = state.push('blockquote_close', 'blockquote', -1); + token.markup = '>'; + state.lineMax = oldLineMax; + state.parentType = oldParentType; + lines[1] = state.line; + + // Restore original tShift; this might not be necessary since the parser + // has already been here, but just to make sure we can do that. + for (i = 0; i < oldTShift.length; i++) { + state.bMarks[i + startLine] = oldBMarks[i]; + state.tShift[i + startLine] = oldTShift[i]; + state.sCount[i + startLine] = oldSCount[i]; + state.bsCount[i + startLine] = oldBSCount[i]; + } + state.blkIndent = oldIndent; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_block/code.js": +/*!***********************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_block/code.js ***! + \***********************************************************/ +/***/ (function(module) { + +// Code block (4 spaces padded) + + + +module.exports = function code(state, startLine, endLine /*, silent*/) { + var nextLine, last, token; + if (state.sCount[startLine] - state.blkIndent < 4) { + return false; + } + last = nextLine = startLine + 1; + while (nextLine < endLine) { + if (state.isEmpty(nextLine)) { + nextLine++; + continue; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + nextLine++; + last = nextLine; + continue; + } + break; + } + state.line = last; + token = state.push('code_block', 'code', 0); + token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\n'; + token.map = [startLine, state.line]; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_block/fence.js": +/*!************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_block/fence.js ***! + \************************************************************/ +/***/ (function(module) { + +// fences (``` lang, ~~~ lang) + + + +module.exports = function fence(state, startLine, endLine, silent) { + var marker, + len, + params, + nextLine, + mem, + token, + markup, + haveEndMarker = false, + pos = state.bMarks[startLine] + state.tShift[startLine], + max = state.eMarks[startLine]; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (pos + 3 > max) { + return false; + } + marker = state.src.charCodeAt(pos); + if (marker !== 0x7E /* ~ */ && marker !== 0x60 /* ` */) { + return false; + } + + // scan marker length + mem = pos; + pos = state.skipChars(pos, marker); + len = pos - mem; + if (len < 3) { + return false; + } + markup = state.src.slice(mem, pos); + params = state.src.slice(pos, max); + if (marker === 0x60 /* ` */) { + if (params.indexOf(String.fromCharCode(marker)) >= 0) { + return false; + } + } + + // Since start is found, we can report success here in validation mode + if (silent) { + return true; + } + + // search end of block + nextLine = startLine; + for (;;) { + nextLine++; + if (nextLine >= endLine) { + // unclosed block should be autoclosed by end of document. + // also block seems to be autoclosed by end of parent + break; + } + pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + if (pos < max && state.sCount[nextLine] < state.blkIndent) { + // non-empty line with negative indent should stop the list: + // - ``` + // test + break; + } + if (state.src.charCodeAt(pos) !== marker) { + continue; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + // closing fence should be indented less than 4 spaces + continue; + } + pos = state.skipChars(pos, marker); + + // closing code fence must be at least as long as the opening one + if (pos - mem < len) { + continue; + } + + // make sure tail has spaces only + pos = state.skipSpaces(pos); + if (pos < max) { + continue; + } + haveEndMarker = true; + // found! + break; + } + + // If a fence has heading spaces, they should be removed from its inner block + len = state.sCount[startLine]; + state.line = nextLine + (haveEndMarker ? 1 : 0); + token = state.push('fence', 'code', 0); + token.info = params; + token.content = state.getLines(startLine + 1, nextLine, len, true); + token.markup = markup; + token.map = [startLine, state.line]; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_block/heading.js": +/*!**************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_block/heading.js ***! + \**************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// heading (#, ##, ...) + + + +var isSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isSpace); +module.exports = function heading(state, startLine, endLine, silent) { + var ch, + level, + tmp, + token, + pos = state.bMarks[startLine] + state.tShift[startLine], + max = state.eMarks[startLine]; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + ch = state.src.charCodeAt(pos); + if (ch !== 0x23 /* # */ || pos >= max) { + return false; + } + + // count heading level + level = 1; + ch = state.src.charCodeAt(++pos); + while (ch === 0x23 /* # */ && pos < max && level <= 6) { + level++; + ch = state.src.charCodeAt(++pos); + } + if (level > 6 || pos < max && !isSpace(ch)) { + return false; + } + if (silent) { + return true; + } + + // Let's cut tails like ' ### ' from the end of string + + max = state.skipSpacesBack(max, pos); + tmp = state.skipCharsBack(max, 0x23, pos); // # + if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) { + max = tmp; + } + state.line = startLine + 1; + token = state.push('heading_open', 'h' + String(level), 1); + token.markup = '########'.slice(0, level); + token.map = [startLine, state.line]; + token = state.push('inline', '', 0); + token.content = state.src.slice(pos, max).trim(); + token.map = [startLine, state.line]; + token.children = []; + token = state.push('heading_close', 'h' + String(level), -1); + token.markup = '########'.slice(0, level); + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_block/hr.js": +/*!*********************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_block/hr.js ***! + \*********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Horizontal rule + + + +var isSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isSpace); +module.exports = function hr(state, startLine, endLine, silent) { + var marker, + cnt, + ch, + token, + pos = state.bMarks[startLine] + state.tShift[startLine], + max = state.eMarks[startLine]; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + marker = state.src.charCodeAt(pos++); + + // Check hr marker + if (marker !== 0x2A /* * */ && marker !== 0x2D /* - */ && marker !== 0x5F /* _ */) { + return false; + } + + // markers can be mixed with spaces, but there should be at least 3 of them + + cnt = 1; + while (pos < max) { + ch = state.src.charCodeAt(pos++); + if (ch !== marker && !isSpace(ch)) { + return false; + } + if (ch === marker) { + cnt++; + } + } + if (cnt < 3) { + return false; + } + if (silent) { + return true; + } + state.line = startLine + 1; + token = state.push('hr', 'hr', 0); + token.map = [startLine, state.line]; + token.markup = Array(cnt + 1).join(String.fromCharCode(marker)); + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_block/html_block.js": +/*!*****************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_block/html_block.js ***! + \*****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// HTML block + + + +var block_names = __webpack_require__(/*! ../common/html_blocks */ "../node_modules/markdown-it/lib/common/html_blocks.js"); +var HTML_OPEN_CLOSE_TAG_RE = (__webpack_require__(/*! ../common/html_re */ "../node_modules/markdown-it/lib/common/html_re.js").HTML_OPEN_CLOSE_TAG_RE); + +// An array of opening and corresponding closing sequences for html tags, +// last argument defines whether it can terminate a paragraph or not +// +var HTML_SEQUENCES = [[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true], [/^/, true], [/^<\?/, /\?>/, true], [/^/, true], [/^/, true], [new RegExp('^|$))', 'i'), /^$/, true], [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false]]; +module.exports = function html_block(state, startLine, endLine, silent) { + var i, + nextLine, + token, + lineText, + pos = state.bMarks[startLine] + state.tShift[startLine], + max = state.eMarks[startLine]; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (!state.md.options.html) { + return false; + } + if (state.src.charCodeAt(pos) !== 0x3C /* < */) { + return false; + } + lineText = state.src.slice(pos, max); + for (i = 0; i < HTML_SEQUENCES.length; i++) { + if (HTML_SEQUENCES[i][0].test(lineText)) { + break; + } + } + if (i === HTML_SEQUENCES.length) { + return false; + } + if (silent) { + // true if this sequence can be a terminator, false otherwise + return HTML_SEQUENCES[i][2]; + } + nextLine = startLine + 1; + + // If we are here - we detected HTML block. + // Let's roll down till block end. + if (!HTML_SEQUENCES[i][1].test(lineText)) { + for (; nextLine < endLine; nextLine++) { + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + lineText = state.src.slice(pos, max); + if (HTML_SEQUENCES[i][1].test(lineText)) { + if (lineText.length !== 0) { + nextLine++; + } + break; + } + } + } + state.line = nextLine; + token = state.push('html_block', '', 0); + token.map = [startLine, nextLine]; + token.content = state.getLines(startLine, nextLine, state.blkIndent, true); + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_block/lheading.js": +/*!***************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_block/lheading.js ***! + \***************************************************************/ +/***/ (function(module) { + +// lheading (---, ===) + + + +module.exports = function lheading(state, startLine, endLine /*, silent*/) { + var content, + terminate, + i, + l, + token, + pos, + max, + level, + marker, + nextLine = startLine + 1, + oldParentType, + terminatorRules = state.md.block.ruler.getRules('paragraph'); + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + oldParentType = state.parentType; + state.parentType = 'paragraph'; // use paragraph to match terminatorRules + + // jump line-by-line until empty one or EOF + for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { + // this would be a code block normally, but after paragraph + // it's considered a lazy continuation regardless of what's there + if (state.sCount[nextLine] - state.blkIndent > 3) { + continue; + } + + // + // Check for underline in setext header + // + if (state.sCount[nextLine] >= state.blkIndent) { + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + if (pos < max) { + marker = state.src.charCodeAt(pos); + if (marker === 0x2D /* - */ || marker === 0x3D /* = */) { + pos = state.skipChars(pos, marker); + pos = state.skipSpaces(pos); + if (pos >= max) { + level = marker === 0x3D /* = */ ? 1 : 2; + break; + } + } + } + } + + // quirk for blockquotes, this line should already be checked by that rule + if (state.sCount[nextLine] < 0) { + continue; + } + + // Some tags can terminate paragraph without empty line. + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + } + if (!level) { + // Didn't find valid underline + return false; + } + content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); + state.line = nextLine + 1; + token = state.push('heading_open', 'h' + String(level), 1); + token.markup = String.fromCharCode(marker); + token.map = [startLine, state.line]; + token = state.push('inline', '', 0); + token.content = content; + token.map = [startLine, state.line - 1]; + token.children = []; + token = state.push('heading_close', 'h' + String(level), -1); + token.markup = String.fromCharCode(marker); + state.parentType = oldParentType; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_block/list.js": +/*!***********************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_block/list.js ***! + \***********************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Lists + + + +var isSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isSpace); + +// Search `[-+*][\n ]`, returns next pos after marker on success +// or -1 on fail. +function skipBulletListMarker(state, startLine) { + var marker, pos, max, ch; + pos = state.bMarks[startLine] + state.tShift[startLine]; + max = state.eMarks[startLine]; + marker = state.src.charCodeAt(pos++); + // Check bullet + if (marker !== 0x2A /* * */ && marker !== 0x2D /* - */ && marker !== 0x2B /* + */) { + return -1; + } + if (pos < max) { + ch = state.src.charCodeAt(pos); + if (!isSpace(ch)) { + // " -test " - is not a list item + return -1; + } + } + return pos; +} + +// Search `\d+[.)][\n ]`, returns next pos after marker on success +// or -1 on fail. +function skipOrderedListMarker(state, startLine) { + var ch, + start = state.bMarks[startLine] + state.tShift[startLine], + pos = start, + max = state.eMarks[startLine]; + + // List marker should have at least 2 chars (digit + dot) + if (pos + 1 >= max) { + return -1; + } + ch = state.src.charCodeAt(pos++); + if (ch < 0x30 /* 0 */ || ch > 0x39 /* 9 */) { + return -1; + } + for (;;) { + // EOL -> fail + if (pos >= max) { + return -1; + } + ch = state.src.charCodeAt(pos++); + if (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) { + // List marker should have no more than 9 digits + // (prevents integer overflow in browsers) + if (pos - start >= 10) { + return -1; + } + continue; + } + + // found valid marker + if (ch === 0x29 /* ) */ || ch === 0x2e /* . */) { + break; + } + return -1; + } + if (pos < max) { + ch = state.src.charCodeAt(pos); + if (!isSpace(ch)) { + // " 1.test " - is not a list item + return -1; + } + } + return pos; +} +function markTightParagraphs(state, idx) { + var i, + l, + level = state.level + 2; + for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) { + if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') { + state.tokens[i + 2].hidden = true; + state.tokens[i].hidden = true; + i += 2; + } + } +} +module.exports = function list(state, startLine, endLine, silent) { + var ch, + contentStart, + i, + indent, + indentAfterMarker, + initial, + isOrdered, + itemLines, + l, + listLines, + listTokIdx, + markerCharCode, + markerValue, + max, + nextLine, + offset, + oldListIndent, + oldParentType, + oldSCount, + oldTShift, + oldTight, + pos, + posAfterMarker, + prevEmptyEnd, + start, + terminate, + terminatorRules, + token, + isTerminatingParagraph = false, + tight = true; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + + // Special case: + // - item 1 + // - item 2 + // - item 3 + // - item 4 + // - this one is a paragraph continuation + if (state.listIndent >= 0 && state.sCount[startLine] - state.listIndent >= 4 && state.sCount[startLine] < state.blkIndent) { + return false; + } + + // limit conditions when list can interrupt + // a paragraph (validation mode only) + if (silent && state.parentType === 'paragraph') { + // Next list item should still terminate previous list item; + // + // This code can fail if plugins use blkIndent as well as lists, + // but I hope the spec gets fixed long before that happens. + // + if (state.tShift[startLine] >= state.blkIndent) { + isTerminatingParagraph = true; + } + } + + // Detect list type and position after marker + if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) { + isOrdered = true; + start = state.bMarks[startLine] + state.tShift[startLine]; + markerValue = Number(state.src.slice(start, posAfterMarker - 1)); + + // If we're starting a new ordered list right after + // a paragraph, it should start with 1. + if (isTerminatingParagraph && markerValue !== 1) return false; + } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) { + isOrdered = false; + } else { + return false; + } + + // If we're starting a new unordered list right after + // a paragraph, first line should not be empty. + if (isTerminatingParagraph) { + if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) return false; + } + + // We should terminate list on style change. Remember first one to compare. + markerCharCode = state.src.charCodeAt(posAfterMarker - 1); + + // For validation mode we can terminate immediately + if (silent) { + return true; + } + + // Start list + listTokIdx = state.tokens.length; + if (isOrdered) { + token = state.push('ordered_list_open', 'ol', 1); + if (markerValue !== 1) { + token.attrs = [['start', markerValue]]; + } + } else { + token = state.push('bullet_list_open', 'ul', 1); + } + token.map = listLines = [startLine, 0]; + token.markup = String.fromCharCode(markerCharCode); + + // + // Iterate list items + // + + nextLine = startLine; + prevEmptyEnd = false; + terminatorRules = state.md.block.ruler.getRules('list'); + oldParentType = state.parentType; + state.parentType = 'list'; + while (nextLine < endLine) { + pos = posAfterMarker; + max = state.eMarks[nextLine]; + initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]); + while (pos < max) { + ch = state.src.charCodeAt(pos); + if (ch === 0x09) { + offset += 4 - (offset + state.bsCount[nextLine]) % 4; + } else if (ch === 0x20) { + offset++; + } else { + break; + } + pos++; + } + contentStart = pos; + if (contentStart >= max) { + // trimming space in "- \n 3" case, indent is 1 here + indentAfterMarker = 1; + } else { + indentAfterMarker = offset - initial; + } + + // If we have more than 4 spaces, the indent is 1 + // (the rest is just indented code block) + if (indentAfterMarker > 4) { + indentAfterMarker = 1; + } + + // " - test" + // ^^^^^ - calculating total length of this thing + indent = initial + indentAfterMarker; + + // Run subparser & write tokens + token = state.push('list_item_open', 'li', 1); + token.markup = String.fromCharCode(markerCharCode); + token.map = itemLines = [startLine, 0]; + if (isOrdered) { + token.info = state.src.slice(start, posAfterMarker - 1); + } + + // change current state, then restore it after parser subcall + oldTight = state.tight; + oldTShift = state.tShift[startLine]; + oldSCount = state.sCount[startLine]; + + // - example list + // ^ listIndent position will be here + // ^ blkIndent position will be here + // + oldListIndent = state.listIndent; + state.listIndent = state.blkIndent; + state.blkIndent = indent; + state.tight = true; + state.tShift[startLine] = contentStart - state.bMarks[startLine]; + state.sCount[startLine] = offset; + if (contentStart >= max && state.isEmpty(startLine + 1)) { + // workaround for this case + // (list item is empty, list terminates before "foo"): + // ~~~~~~~~ + // - + // + // foo + // ~~~~~~~~ + state.line = Math.min(state.line + 2, endLine); + } else { + state.md.block.tokenize(state, startLine, endLine, true); + } + + // If any of list item is tight, mark list as tight + if (!state.tight || prevEmptyEnd) { + tight = false; + } + // Item become loose if finish with empty line, + // but we should filter last element, because it means list finish + prevEmptyEnd = state.line - startLine > 1 && state.isEmpty(state.line - 1); + state.blkIndent = state.listIndent; + state.listIndent = oldListIndent; + state.tShift[startLine] = oldTShift; + state.sCount[startLine] = oldSCount; + state.tight = oldTight; + token = state.push('list_item_close', 'li', -1); + token.markup = String.fromCharCode(markerCharCode); + nextLine = startLine = state.line; + itemLines[1] = nextLine; + contentStart = state.bMarks[startLine]; + if (nextLine >= endLine) { + break; + } + + // + // Try to check if list is terminated or continued. + // + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + break; + } + + // fail if terminating block found + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + + // fail if list has another type + if (isOrdered) { + posAfterMarker = skipOrderedListMarker(state, nextLine); + if (posAfterMarker < 0) { + break; + } + start = state.bMarks[nextLine] + state.tShift[nextLine]; + } else { + posAfterMarker = skipBulletListMarker(state, nextLine); + if (posAfterMarker < 0) { + break; + } + } + if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { + break; + } + } + + // Finalize list + if (isOrdered) { + token = state.push('ordered_list_close', 'ol', -1); + } else { + token = state.push('bullet_list_close', 'ul', -1); + } + token.markup = String.fromCharCode(markerCharCode); + listLines[1] = nextLine; + state.line = nextLine; + state.parentType = oldParentType; + + // mark paragraphs tight if needed + if (tight) { + markTightParagraphs(state, listTokIdx); + } + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_block/paragraph.js": +/*!****************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_block/paragraph.js ***! + \****************************************************************/ +/***/ (function(module) { + +// Paragraph + + + +module.exports = function paragraph(state, startLine /*, endLine*/) { + var content, + terminate, + i, + l, + token, + oldParentType, + nextLine = startLine + 1, + terminatorRules = state.md.block.ruler.getRules('paragraph'), + endLine = state.lineMax; + oldParentType = state.parentType; + state.parentType = 'paragraph'; + + // jump line-by-line until empty one or EOF + for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { + // this would be a code block normally, but after paragraph + // it's considered a lazy continuation regardless of what's there + if (state.sCount[nextLine] - state.blkIndent > 3) { + continue; + } + + // quirk for blockquotes, this line should already be checked by that rule + if (state.sCount[nextLine] < 0) { + continue; + } + + // Some tags can terminate paragraph without empty line. + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + } + content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); + state.line = nextLine; + token = state.push('paragraph_open', 'p', 1); + token.map = [startLine, state.line]; + token = state.push('inline', '', 0); + token.content = content; + token.map = [startLine, state.line]; + token.children = []; + token = state.push('paragraph_close', 'p', -1); + state.parentType = oldParentType; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_block/reference.js": +/*!****************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_block/reference.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var normalizeReference = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").normalizeReference); +var isSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isSpace); +module.exports = function reference(state, startLine, _endLine, silent) { + var ch, + destEndPos, + destEndLineNo, + endLine, + href, + i, + l, + label, + labelEnd, + oldParentType, + res, + start, + str, + terminate, + terminatorRules, + title, + lines = 0, + pos = state.bMarks[startLine] + state.tShift[startLine], + max = state.eMarks[startLine], + nextLine = startLine + 1; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (state.src.charCodeAt(pos) !== 0x5B /* [ */) { + return false; + } + + // Simple check to quickly interrupt scan on [link](url) at the start of line. + // Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54 + while (++pos < max) { + if (state.src.charCodeAt(pos) === 0x5D /* ] */ && state.src.charCodeAt(pos - 1) !== 0x5C /* \ */) { + if (pos + 1 === max) { + return false; + } + if (state.src.charCodeAt(pos + 1) !== 0x3A /* : */) { + return false; + } + break; + } + } + endLine = state.lineMax; + + // jump line-by-line until empty one or EOF + terminatorRules = state.md.block.ruler.getRules('reference'); + oldParentType = state.parentType; + state.parentType = 'reference'; + for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { + // this would be a code block normally, but after paragraph + // it's considered a lazy continuation regardless of what's there + if (state.sCount[nextLine] - state.blkIndent > 3) { + continue; + } + + // quirk for blockquotes, this line should already be checked by that rule + if (state.sCount[nextLine] < 0) { + continue; + } + + // Some tags can terminate paragraph without empty line. + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + } + str = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); + max = str.length; + for (pos = 1; pos < max; pos++) { + ch = str.charCodeAt(pos); + if (ch === 0x5B /* [ */) { + return false; + } else if (ch === 0x5D /* ] */) { + labelEnd = pos; + break; + } else if (ch === 0x0A /* \n */) { + lines++; + } else if (ch === 0x5C /* \ */) { + pos++; + if (pos < max && str.charCodeAt(pos) === 0x0A) { + lines++; + } + } + } + if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A /* : */) { + return false; + } + + // [label]: destination 'title' + // ^^^ skip optional whitespace here + for (pos = labelEnd + 2; pos < max; pos++) { + ch = str.charCodeAt(pos); + if (ch === 0x0A) { + lines++; + } else if (isSpace(ch)) { + /*eslint no-empty:0*/ + } else { + break; + } + } + + // [label]: destination 'title' + // ^^^^^^^^^^^ parse this + res = state.md.helpers.parseLinkDestination(str, pos, max); + if (!res.ok) { + return false; + } + href = state.md.normalizeLink(res.str); + if (!state.md.validateLink(href)) { + return false; + } + pos = res.pos; + lines += res.lines; + + // save cursor state, we could require to rollback later + destEndPos = pos; + destEndLineNo = lines; + + // [label]: destination 'title' + // ^^^ skipping those spaces + start = pos; + for (; pos < max; pos++) { + ch = str.charCodeAt(pos); + if (ch === 0x0A) { + lines++; + } else if (isSpace(ch)) { + /*eslint no-empty:0*/ + } else { + break; + } + } + + // [label]: destination 'title' + // ^^^^^^^ parse this + res = state.md.helpers.parseLinkTitle(str, pos, max); + if (pos < max && start !== pos && res.ok) { + title = res.str; + pos = res.pos; + lines += res.lines; + } else { + title = ''; + pos = destEndPos; + lines = destEndLineNo; + } + + // skip trailing spaces until the rest of the line + while (pos < max) { + ch = str.charCodeAt(pos); + if (!isSpace(ch)) { + break; + } + pos++; + } + if (pos < max && str.charCodeAt(pos) !== 0x0A) { + if (title) { + // garbage at the end of the line after title, + // but it could still be a valid reference if we roll back + title = ''; + pos = destEndPos; + lines = destEndLineNo; + while (pos < max) { + ch = str.charCodeAt(pos); + if (!isSpace(ch)) { + break; + } + pos++; + } + } + } + if (pos < max && str.charCodeAt(pos) !== 0x0A) { + // garbage at the end of the line + return false; + } + label = normalizeReference(str.slice(1, labelEnd)); + if (!label) { + // CommonMark 0.20 disallows empty labels + return false; + } + + // Reference can not terminate anything. This check is for safety only. + /*istanbul ignore if*/ + if (silent) { + return true; + } + if (typeof state.env.references === 'undefined') { + state.env.references = {}; + } + if (typeof state.env.references[label] === 'undefined') { + state.env.references[label] = { + title: title, + href: href + }; + } + state.parentType = oldParentType; + state.line = startLine + lines + 1; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_block/state_block.js": +/*!******************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_block/state_block.js ***! + \******************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Parser state class + + + +var Token = __webpack_require__(/*! ../token */ "../node_modules/markdown-it/lib/token.js"); +var isSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isSpace); +function StateBlock(src, md, env, tokens) { + var ch, s, start, pos, len, indent, offset, indent_found; + this.src = src; + + // link to parser instance + this.md = md; + this.env = env; + + // + // Internal state vartiables + // + + this.tokens = tokens; + this.bMarks = []; // line begin offsets for fast jumps + this.eMarks = []; // line end offsets for fast jumps + this.tShift = []; // offsets of the first non-space characters (tabs not expanded) + this.sCount = []; // indents for each line (tabs expanded) + + // An amount of virtual spaces (tabs expanded) between beginning + // of each line (bMarks) and real beginning of that line. + // + // It exists only as a hack because blockquotes override bMarks + // losing information in the process. + // + // It's used only when expanding tabs, you can think about it as + // an initial tab length, e.g. bsCount=21 applied to string `\t123` + // means first tab should be expanded to 4-21%4 === 3 spaces. + // + this.bsCount = []; + + // block parser variables + this.blkIndent = 0; // required block content indent (for example, if we are + // inside a list, it would be positioned after list marker) + this.line = 0; // line index in src + this.lineMax = 0; // lines count + this.tight = false; // loose/tight mode for lists + this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any) + this.listIndent = -1; // indent of the current list block (-1 if there isn't any) + + // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference' + // used in lists to determine if they interrupt a paragraph + this.parentType = 'root'; + this.level = 0; + + // renderer + this.result = ''; + + // Create caches + // Generate markers. + s = this.src; + indent_found = false; + for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) { + ch = s.charCodeAt(pos); + if (!indent_found) { + if (isSpace(ch)) { + indent++; + if (ch === 0x09) { + offset += 4 - offset % 4; + } else { + offset++; + } + continue; + } else { + indent_found = true; + } + } + if (ch === 0x0A || pos === len - 1) { + if (ch !== 0x0A) { + pos++; + } + this.bMarks.push(start); + this.eMarks.push(pos); + this.tShift.push(indent); + this.sCount.push(offset); + this.bsCount.push(0); + indent_found = false; + indent = 0; + offset = 0; + start = pos + 1; + } + } + + // Push fake entry to simplify cache bounds checks + this.bMarks.push(s.length); + this.eMarks.push(s.length); + this.tShift.push(0); + this.sCount.push(0); + this.bsCount.push(0); + this.lineMax = this.bMarks.length - 1; // don't count last fake line +} + +// Push new token to "stream". +// +StateBlock.prototype.push = function (type, tag, nesting) { + var token = new Token(type, tag, nesting); + token.block = true; + if (nesting < 0) this.level--; // closing tag + token.level = this.level; + if (nesting > 0) this.level++; // opening tag + + this.tokens.push(token); + return token; +}; +StateBlock.prototype.isEmpty = function isEmpty(line) { + return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]; +}; +StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) { + for (var max = this.lineMax; from < max; from++) { + if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) { + break; + } + } + return from; +}; + +// Skip spaces from given position. +StateBlock.prototype.skipSpaces = function skipSpaces(pos) { + var ch; + for (var max = this.src.length; pos < max; pos++) { + ch = this.src.charCodeAt(pos); + if (!isSpace(ch)) { + break; + } + } + return pos; +}; + +// Skip spaces from given position in reverse. +StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) { + if (pos <= min) { + return pos; + } + while (pos > min) { + if (!isSpace(this.src.charCodeAt(--pos))) { + return pos + 1; + } + } + return pos; +}; + +// Skip char codes from given position +StateBlock.prototype.skipChars = function skipChars(pos, code) { + for (var max = this.src.length; pos < max; pos++) { + if (this.src.charCodeAt(pos) !== code) { + break; + } + } + return pos; +}; + +// Skip char codes reverse from given position - 1 +StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) { + if (pos <= min) { + return pos; + } + while (pos > min) { + if (code !== this.src.charCodeAt(--pos)) { + return pos + 1; + } + } + return pos; +}; + +// cut lines range from source. +StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) { + var i, + lineIndent, + ch, + first, + last, + queue, + lineStart, + line = begin; + if (begin >= end) { + return ''; + } + queue = new Array(end - begin); + for (i = 0; line < end; line++, i++) { + lineIndent = 0; + lineStart = first = this.bMarks[line]; + if (line + 1 < end || keepLastLF) { + // No need for bounds check because we have fake entry on tail. + last = this.eMarks[line] + 1; + } else { + last = this.eMarks[line]; + } + while (first < last && lineIndent < indent) { + ch = this.src.charCodeAt(first); + if (isSpace(ch)) { + if (ch === 0x09) { + lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4; + } else { + lineIndent++; + } + } else if (first - lineStart < this.tShift[line]) { + // patched tShift masked characters to look like spaces (blockquotes, list markers) + lineIndent++; + } else { + break; + } + first++; + } + if (lineIndent > indent) { + // partially expanding tabs in code blocks, e.g '\t\tfoobar' + // with indent=2 becomes ' \tfoobar' + queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last); + } else { + queue[i] = this.src.slice(first, last); + } + } + return queue.join(''); +}; + +// re-export Token class to use in block rules +StateBlock.prototype.Token = Token; +module.exports = StateBlock; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_block/table.js": +/*!************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_block/table.js ***! + \************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// GFM table, https://github.github.com/gfm/#tables-extension- + + + +var isSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isSpace); +function getLine(state, line) { + var pos = state.bMarks[line] + state.tShift[line], + max = state.eMarks[line]; + return state.src.substr(pos, max - pos); +} +function escapedSplit(str) { + var result = [], + pos = 0, + max = str.length, + ch, + isEscaped = false, + lastPos = 0, + current = ''; + ch = str.charCodeAt(pos); + while (pos < max) { + if (ch === 0x7c /* | */) { + if (!isEscaped) { + // pipe separating cells, '|' + result.push(current + str.substring(lastPos, pos)); + current = ''; + lastPos = pos + 1; + } else { + // escaped pipe, '\|' + current += str.substring(lastPos, pos - 1); + lastPos = pos; + } + } + isEscaped = ch === 0x5c /* \ */; + pos++; + ch = str.charCodeAt(pos); + } + result.push(current + str.substring(lastPos)); + return result; +} +module.exports = function table(state, startLine, endLine, silent) { + var ch, lineText, pos, i, l, nextLine, columns, columnCount, token, aligns, t, tableLines, tbodyLines, oldParentType, terminate, terminatorRules, firstCh, secondCh; + + // should have at least two lines + if (startLine + 2 > endLine) { + return false; + } + nextLine = startLine + 1; + if (state.sCount[nextLine] < state.blkIndent) { + return false; + } + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[nextLine] - state.blkIndent >= 4) { + return false; + } + + // first character of the second line should be '|', '-', ':', + // and no other characters are allowed but spaces; + // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp + + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + if (pos >= state.eMarks[nextLine]) { + return false; + } + firstCh = state.src.charCodeAt(pos++); + if (firstCh !== 0x7C /* | */ && firstCh !== 0x2D /* - */ && firstCh !== 0x3A /* : */) { + return false; + } + if (pos >= state.eMarks[nextLine]) { + return false; + } + secondCh = state.src.charCodeAt(pos++); + if (secondCh !== 0x7C /* | */ && secondCh !== 0x2D /* - */ && secondCh !== 0x3A /* : */ && !isSpace(secondCh)) { + return false; + } + + // if first character is '-', then second character must not be a space + // (due to parsing ambiguity with list) + if (firstCh === 0x2D /* - */ && isSpace(secondCh)) { + return false; + } + while (pos < state.eMarks[nextLine]) { + ch = state.src.charCodeAt(pos); + if (ch !== 0x7C /* | */ && ch !== 0x2D /* - */ && ch !== 0x3A /* : */ && !isSpace(ch)) { + return false; + } + pos++; + } + lineText = getLine(state, startLine + 1); + columns = lineText.split('|'); + aligns = []; + for (i = 0; i < columns.length; i++) { + t = columns[i].trim(); + if (!t) { + // allow empty columns before and after table, but not in between columns; + // e.g. allow ` |---| `, disallow ` ---||--- ` + if (i === 0 || i === columns.length - 1) { + continue; + } else { + return false; + } + } + if (!/^:?-+:?$/.test(t)) { + return false; + } + if (t.charCodeAt(t.length - 1) === 0x3A /* : */) { + aligns.push(t.charCodeAt(0) === 0x3A /* : */ ? 'center' : 'right'); + } else if (t.charCodeAt(0) === 0x3A /* : */) { + aligns.push('left'); + } else { + aligns.push(''); + } + } + lineText = getLine(state, startLine).trim(); + if (lineText.indexOf('|') === -1) { + return false; + } + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + columns = escapedSplit(lineText); + if (columns.length && columns[0] === '') columns.shift(); + if (columns.length && columns[columns.length - 1] === '') columns.pop(); + + // header row will define an amount of columns in the entire table, + // and align row should be exactly the same (the rest of the rows can differ) + columnCount = columns.length; + if (columnCount === 0 || columnCount !== aligns.length) { + return false; + } + if (silent) { + return true; + } + oldParentType = state.parentType; + state.parentType = 'table'; + + // use 'blockquote' lists for termination because it's + // the most similar to tables + terminatorRules = state.md.block.ruler.getRules('blockquote'); + token = state.push('table_open', 'table', 1); + token.map = tableLines = [startLine, 0]; + token = state.push('thead_open', 'thead', 1); + token.map = [startLine, startLine + 1]; + token = state.push('tr_open', 'tr', 1); + token.map = [startLine, startLine + 1]; + for (i = 0; i < columns.length; i++) { + token = state.push('th_open', 'th', 1); + if (aligns[i]) { + token.attrs = [['style', 'text-align:' + aligns[i]]]; + } + token = state.push('inline', '', 0); + token.content = columns[i].trim(); + token.children = []; + token = state.push('th_close', 'th', -1); + } + token = state.push('tr_close', 'tr', -1); + token = state.push('thead_close', 'thead', -1); + for (nextLine = startLine + 2; nextLine < endLine; nextLine++) { + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + terminate = false; + for (i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + lineText = getLine(state, nextLine).trim(); + if (!lineText) { + break; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + break; + } + columns = escapedSplit(lineText); + if (columns.length && columns[0] === '') columns.shift(); + if (columns.length && columns[columns.length - 1] === '') columns.pop(); + if (nextLine === startLine + 2) { + token = state.push('tbody_open', 'tbody', 1); + token.map = tbodyLines = [startLine + 2, 0]; + } + token = state.push('tr_open', 'tr', 1); + token.map = [nextLine, nextLine + 1]; + for (i = 0; i < columnCount; i++) { + token = state.push('td_open', 'td', 1); + if (aligns[i]) { + token.attrs = [['style', 'text-align:' + aligns[i]]]; + } + token = state.push('inline', '', 0); + token.content = columns[i] ? columns[i].trim() : ''; + token.children = []; + token = state.push('td_close', 'td', -1); + } + token = state.push('tr_close', 'tr', -1); + } + if (tbodyLines) { + token = state.push('tbody_close', 'tbody', -1); + tbodyLines[1] = nextLine; + } + token = state.push('table_close', 'table', -1); + tableLines[1] = nextLine; + state.parentType = oldParentType; + state.line = nextLine; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_core/block.js": +/*!***********************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_core/block.js ***! + \***********************************************************/ +/***/ (function(module) { + + + +module.exports = function block(state) { + var token; + if (state.inlineMode) { + token = new state.Token('inline', '', 0); + token.content = state.src; + token.map = [0, 1]; + token.children = []; + state.tokens.push(token); + } else { + state.md.block.parse(state.src, state.md, state.env, state.tokens); + } +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_core/inline.js": +/*!************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_core/inline.js ***! + \************************************************************/ +/***/ (function(module) { + + + +module.exports = function inline(state) { + var tokens = state.tokens, + tok, + i, + l; + + // Parse inlines + for (i = 0, l = tokens.length; i < l; i++) { + tok = tokens[i]; + if (tok.type === 'inline') { + state.md.inline.parse(tok.content, state.md, state.env, tok.children); + } + } +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_core/linkify.js": +/*!*************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_core/linkify.js ***! + \*************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Replace link-like texts with link nodes. +// +// Currently restricted by `md.validateLink()` to http/https/ftp +// + + +var arrayReplaceAt = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").arrayReplaceAt); +function isLinkOpen(str) { + return /^\s]/i.test(str); +} +function isLinkClose(str) { + return /^<\/a\s*>/i.test(str); +} +module.exports = function linkify(state) { + var i, + j, + l, + tokens, + token, + currentToken, + nodes, + ln, + text, + pos, + lastPos, + level, + htmlLinkLevel, + url, + fullUrl, + urlText, + blockTokens = state.tokens, + links; + if (!state.md.options.linkify) { + return; + } + for (j = 0, l = blockTokens.length; j < l; j++) { + if (blockTokens[j].type !== 'inline' || !state.md.linkify.pretest(blockTokens[j].content)) { + continue; + } + tokens = blockTokens[j].children; + htmlLinkLevel = 0; + + // We scan from the end, to keep position when new tags added. + // Use reversed logic in links start/end match + for (i = tokens.length - 1; i >= 0; i--) { + currentToken = tokens[i]; + + // Skip content of markdown links + if (currentToken.type === 'link_close') { + i--; + while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') { + i--; + } + continue; + } + + // Skip content of html tag links + if (currentToken.type === 'html_inline') { + if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) { + htmlLinkLevel--; + } + if (isLinkClose(currentToken.content)) { + htmlLinkLevel++; + } + } + if (htmlLinkLevel > 0) { + continue; + } + if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) { + text = currentToken.content; + links = state.md.linkify.match(text); + + // Now split string to nodes + nodes = []; + level = currentToken.level; + lastPos = 0; + for (ln = 0; ln < links.length; ln++) { + url = links[ln].url; + fullUrl = state.md.normalizeLink(url); + if (!state.md.validateLink(fullUrl)) { + continue; + } + urlText = links[ln].text; + + // Linkifier might send raw hostnames like "example.com", where url + // starts with domain name. So we prepend http:// in those cases, + // and remove it afterwards. + // + if (!links[ln].schema) { + urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, ''); + } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) { + urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, ''); + } else { + urlText = state.md.normalizeLinkText(urlText); + } + pos = links[ln].index; + if (pos > lastPos) { + token = new state.Token('text', '', 0); + token.content = text.slice(lastPos, pos); + token.level = level; + nodes.push(token); + } + token = new state.Token('link_open', 'a', 1); + token.attrs = [['href', fullUrl]]; + token.level = level++; + token.markup = 'linkify'; + token.info = 'auto'; + nodes.push(token); + token = new state.Token('text', '', 0); + token.content = urlText; + token.level = level; + nodes.push(token); + token = new state.Token('link_close', 'a', -1); + token.level = --level; + token.markup = 'linkify'; + token.info = 'auto'; + nodes.push(token); + lastPos = links[ln].lastIndex; + } + if (lastPos < text.length) { + token = new state.Token('text', '', 0); + token.content = text.slice(lastPos); + token.level = level; + nodes.push(token); + } + + // replace current node + blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes); + } + } + } +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_core/normalize.js": +/*!***************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_core/normalize.js ***! + \***************************************************************/ +/***/ (function(module) { + +// Normalize input string + + + +// https://spec.commonmark.org/0.29/#line-ending +var NEWLINES_RE = /\r\n?|\n/g; +var NULL_RE = /\0/g; +module.exports = function normalize(state) { + var str; + + // Normalize newlines + str = state.src.replace(NEWLINES_RE, '\n'); + + // Replace NULL characters + str = str.replace(NULL_RE, '\uFFFD'); + state.src = str; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_core/replacements.js": +/*!******************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_core/replacements.js ***! + \******************************************************************/ +/***/ (function(module) { + +// Simple typographic replacements +// +// (c) (C) → © +// (tm) (TM) → ™ +// (r) (R) → ® +// +- → ± +// (p) (P) -> § +// ... → … (also ?.... → ?.., !.... → !..) +// ???????? → ???, !!!!! → !!!, `,,` → `,` +// -- → –, --- → — +// + + +// TODO: +// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾ +// - miltiplication 2 x 4 -> 2 × 4 +var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/; + +// Workaround for phantomjs - need regex without /g flag, +// or root check will fail every second time +var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i; +var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig; +var SCOPED_ABBR = { + c: '©', + r: '®', + p: '§', + tm: '™' +}; +function replaceFn(match, name) { + return SCOPED_ABBR[name.toLowerCase()]; +} +function replace_scoped(inlineTokens) { + var i, + token, + inside_autolink = 0; + for (i = inlineTokens.length - 1; i >= 0; i--) { + token = inlineTokens[i]; + if (token.type === 'text' && !inside_autolink) { + token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn); + } + if (token.type === 'link_open' && token.info === 'auto') { + inside_autolink--; + } + if (token.type === 'link_close' && token.info === 'auto') { + inside_autolink++; + } + } +} +function replace_rare(inlineTokens) { + var i, + token, + inside_autolink = 0; + for (i = inlineTokens.length - 1; i >= 0; i--) { + token = inlineTokens[i]; + if (token.type === 'text' && !inside_autolink) { + if (RARE_RE.test(token.content)) { + token.content = token.content.replace(/\+-/g, '±') + // .., ..., ....... -> … + // but ?..... & !..... -> ?.. & !.. + .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..').replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',') + // em-dash + .replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\u2014') + // en-dash + .replace(/(^|\s)--(?=\s|$)/mg, '$1\u2013').replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, '$1\u2013'); + } + } + if (token.type === 'link_open' && token.info === 'auto') { + inside_autolink--; + } + if (token.type === 'link_close' && token.info === 'auto') { + inside_autolink++; + } + } +} +module.exports = function replace(state) { + var blkIdx; + if (!state.md.options.typographer) { + return; + } + for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { + if (state.tokens[blkIdx].type !== 'inline') { + continue; + } + if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) { + replace_scoped(state.tokens[blkIdx].children); + } + if (RARE_RE.test(state.tokens[blkIdx].content)) { + replace_rare(state.tokens[blkIdx].children); + } + } +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_core/smartquotes.js": +/*!*****************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_core/smartquotes.js ***! + \*****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Convert straight quotation marks to typographic ones +// + + +var isWhiteSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isWhiteSpace); +var isPunctChar = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isPunctChar); +var isMdAsciiPunct = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isMdAsciiPunct); +var QUOTE_TEST_RE = /['"]/; +var QUOTE_RE = /['"]/g; +var APOSTROPHE = '\u2019'; /* ’ */ + +function replaceAt(str, index, ch) { + return str.substr(0, index) + ch + str.substr(index + 1); +} +function process_inlines(tokens, state) { + var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar, isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace, canOpen, canClose, j, isSingle, stack, openQuote, closeQuote; + stack = []; + for (i = 0; i < tokens.length; i++) { + token = tokens[i]; + thisLevel = tokens[i].level; + for (j = stack.length - 1; j >= 0; j--) { + if (stack[j].level <= thisLevel) { + break; + } + } + stack.length = j + 1; + if (token.type !== 'text') { + continue; + } + text = token.content; + pos = 0; + max = text.length; + + /*eslint no-labels:0,block-scoped-var:0*/ + OUTER: while (pos < max) { + QUOTE_RE.lastIndex = pos; + t = QUOTE_RE.exec(text); + if (!t) { + break; + } + canOpen = canClose = true; + pos = t.index + 1; + isSingle = t[0] === "'"; + + // Find previous character, + // default to space if it's the beginning of the line + // + lastChar = 0x20; + if (t.index - 1 >= 0) { + lastChar = text.charCodeAt(t.index - 1); + } else { + for (j = i - 1; j >= 0; j--) { + if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // lastChar defaults to 0x20 + if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline' + + lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1); + break; + } + } + + // Find next character, + // default to space if it's the end of the line + // + nextChar = 0x20; + if (pos < max) { + nextChar = text.charCodeAt(pos); + } else { + for (j = i + 1; j < tokens.length; j++) { + if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // nextChar defaults to 0x20 + if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline' + + nextChar = tokens[j].content.charCodeAt(0); + break; + } + } + isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); + isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); + isLastWhiteSpace = isWhiteSpace(lastChar); + isNextWhiteSpace = isWhiteSpace(nextChar); + if (isNextWhiteSpace) { + canOpen = false; + } else if (isNextPunctChar) { + if (!(isLastWhiteSpace || isLastPunctChar)) { + canOpen = false; + } + } + if (isLastWhiteSpace) { + canClose = false; + } else if (isLastPunctChar) { + if (!(isNextWhiteSpace || isNextPunctChar)) { + canClose = false; + } + } + if (nextChar === 0x22 /* " */ && t[0] === '"') { + if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) { + // special case: 1"" - count first quote as an inch + canClose = canOpen = false; + } + } + if (canOpen && canClose) { + // Replace quotes in the middle of punctuation sequence, but not + // in the middle of the words, i.e.: + // + // 1. foo " bar " baz - not replaced + // 2. foo-"-bar-"-baz - replaced + // 3. foo"bar"baz - not replaced + // + canOpen = isLastPunctChar; + canClose = isNextPunctChar; + } + if (!canOpen && !canClose) { + // middle of word + if (isSingle) { + token.content = replaceAt(token.content, t.index, APOSTROPHE); + } + continue; + } + if (canClose) { + // this could be a closing quote, rewind the stack to get a match + for (j = stack.length - 1; j >= 0; j--) { + item = stack[j]; + if (stack[j].level < thisLevel) { + break; + } + if (item.single === isSingle && stack[j].level === thisLevel) { + item = stack[j]; + if (isSingle) { + openQuote = state.md.options.quotes[2]; + closeQuote = state.md.options.quotes[3]; + } else { + openQuote = state.md.options.quotes[0]; + closeQuote = state.md.options.quotes[1]; + } + + // replace token.content *before* tokens[item.token].content, + // because, if they are pointing at the same token, replaceAt + // could mess up indices when quote length != 1 + token.content = replaceAt(token.content, t.index, closeQuote); + tokens[item.token].content = replaceAt(tokens[item.token].content, item.pos, openQuote); + pos += closeQuote.length - 1; + if (item.token === i) { + pos += openQuote.length - 1; + } + text = token.content; + max = text.length; + stack.length = j; + continue OUTER; + } + } + } + if (canOpen) { + stack.push({ + token: i, + pos: t.index, + single: isSingle, + level: thisLevel + }); + } else if (canClose && isSingle) { + token.content = replaceAt(token.content, t.index, APOSTROPHE); + } + } + } +} +module.exports = function smartquotes(state) { + /*eslint max-depth:0*/ + var blkIdx; + if (!state.md.options.typographer) { + return; + } + for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { + if (state.tokens[blkIdx].type !== 'inline' || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) { + continue; + } + process_inlines(state.tokens[blkIdx].children, state); + } +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_core/state_core.js": +/*!****************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_core/state_core.js ***! + \****************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Core state object +// + + +var Token = __webpack_require__(/*! ../token */ "../node_modules/markdown-it/lib/token.js"); +function StateCore(src, md, env) { + this.src = src; + this.env = env; + this.tokens = []; + this.inlineMode = false; + this.md = md; // link to parser instance +} + +// re-export Token class to use in core rules +StateCore.prototype.Token = Token; +module.exports = StateCore; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/autolink.js": +/*!****************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/autolink.js ***! + \****************************************************************/ +/***/ (function(module) { + +// Process autolinks '' + + + +/*eslint max-len:0*/ +var EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/; +var AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/; +module.exports = function autolink(state, silent) { + var url, + fullUrl, + token, + ch, + start, + max, + pos = state.pos; + if (state.src.charCodeAt(pos) !== 0x3C /* < */) { + return false; + } + start = state.pos; + max = state.posMax; + for (;;) { + if (++pos >= max) return false; + ch = state.src.charCodeAt(pos); + if (ch === 0x3C /* < */) return false; + if (ch === 0x3E /* > */) break; + } + url = state.src.slice(start + 1, pos); + if (AUTOLINK_RE.test(url)) { + fullUrl = state.md.normalizeLink(url); + if (!state.md.validateLink(fullUrl)) { + return false; + } + if (!silent) { + token = state.push('link_open', 'a', 1); + token.attrs = [['href', fullUrl]]; + token.markup = 'autolink'; + token.info = 'auto'; + token = state.push('text', '', 0); + token.content = state.md.normalizeLinkText(url); + token = state.push('link_close', 'a', -1); + token.markup = 'autolink'; + token.info = 'auto'; + } + state.pos += url.length + 2; + return true; + } + if (EMAIL_RE.test(url)) { + fullUrl = state.md.normalizeLink('mailto:' + url); + if (!state.md.validateLink(fullUrl)) { + return false; + } + if (!silent) { + token = state.push('link_open', 'a', 1); + token.attrs = [['href', fullUrl]]; + token.markup = 'autolink'; + token.info = 'auto'; + token = state.push('text', '', 0); + token.content = state.md.normalizeLinkText(url); + token = state.push('link_close', 'a', -1); + token.markup = 'autolink'; + token.info = 'auto'; + } + state.pos += url.length + 2; + return true; + } + return false; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/backticks.js": +/*!*****************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/backticks.js ***! + \*****************************************************************/ +/***/ (function(module) { + +// Parse backticks + + + +module.exports = function backtick(state, silent) { + var start, + max, + marker, + token, + matchStart, + matchEnd, + openerLength, + closerLength, + pos = state.pos, + ch = state.src.charCodeAt(pos); + if (ch !== 0x60 /* ` */) { + return false; + } + start = pos; + pos++; + max = state.posMax; + + // scan marker length + while (pos < max && state.src.charCodeAt(pos) === 0x60 /* ` */) { + pos++; + } + marker = state.src.slice(start, pos); + openerLength = marker.length; + if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) { + if (!silent) state.pending += marker; + state.pos += openerLength; + return true; + } + matchStart = matchEnd = pos; + + // Nothing found in the cache, scan until the end of the line (or until marker is found) + while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) { + matchEnd = matchStart + 1; + + // scan marker length + while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60 /* ` */) { + matchEnd++; + } + closerLength = matchEnd - matchStart; + if (closerLength === openerLength) { + // Found matching closer length. + if (!silent) { + token = state.push('code_inline', 'code', 0); + token.markup = marker; + token.content = state.src.slice(pos, matchStart).replace(/\n/g, ' ').replace(/^ (.+) $/, '$1'); + } + state.pos = matchEnd; + return true; + } + + // Some different length found, put it in cache as upper limit of where closer can be found + state.backticks[closerLength] = matchStart; + } + + // Scanned through the end, didn't find anything + state.backticksScanned = true; + if (!silent) state.pending += marker; + state.pos += openerLength; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/balance_pairs.js": +/*!*********************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/balance_pairs.js ***! + \*********************************************************************/ +/***/ (function(module) { + +// For each opening emphasis-like marker find a matching closing one +// + + +function processDelimiters(state, delimiters) { + var closerIdx, + openerIdx, + closer, + opener, + minOpenerIdx, + newMinOpenerIdx, + isOddMatch, + lastJump, + openersBottom = {}, + max = delimiters.length; + for (closerIdx = 0; closerIdx < max; closerIdx++) { + closer = delimiters[closerIdx]; + + // Length is only used for emphasis-specific "rule of 3", + // if it's not defined (in strikethrough or 3rd party plugins), + // we can default it to 0 to disable those checks. + // + closer.length = closer.length || 0; + if (!closer.close) continue; + + // Previously calculated lower bounds (previous fails) + // for each marker, each delimiter length modulo 3, + // and for whether this closer can be an opener; + // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460 + if (!openersBottom.hasOwnProperty(closer.marker)) { + openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]; + } + minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3]; + openerIdx = closerIdx - closer.jump - 1; + + // avoid crash if `closer.jump` is pointing outside of the array, see #742 + if (openerIdx < -1) openerIdx = -1; + newMinOpenerIdx = openerIdx; + for (; openerIdx > minOpenerIdx; openerIdx -= opener.jump + 1) { + opener = delimiters[openerIdx]; + if (opener.marker !== closer.marker) continue; + if (opener.open && opener.end < 0) { + isOddMatch = false; + + // from spec: + // + // If one of the delimiters can both open and close emphasis, then the + // sum of the lengths of the delimiter runs containing the opening and + // closing delimiters must not be a multiple of 3 unless both lengths + // are multiples of 3. + // + if (opener.close || closer.open) { + if ((opener.length + closer.length) % 3 === 0) { + if (opener.length % 3 !== 0 || closer.length % 3 !== 0) { + isOddMatch = true; + } + } + } + if (!isOddMatch) { + // If previous delimiter cannot be an opener, we can safely skip + // the entire sequence in future checks. This is required to make + // sure algorithm has linear complexity (see *_*_*_*_*_... case). + // + lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? delimiters[openerIdx - 1].jump + 1 : 0; + closer.jump = closerIdx - openerIdx + lastJump; + closer.open = false; + opener.end = closerIdx; + opener.jump = lastJump; + opener.close = false; + newMinOpenerIdx = -1; + break; + } + } + } + if (newMinOpenerIdx !== -1) { + // If match for this delimiter run failed, we want to set lower bound for + // future lookups. This is required to make sure algorithm has linear + // complexity. + // + // See details here: + // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442 + // + openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx; + } + } +} +module.exports = function link_pairs(state) { + var curr, + tokens_meta = state.tokens_meta, + max = state.tokens_meta.length; + processDelimiters(state, state.delimiters); + for (curr = 0; curr < max; curr++) { + if (tokens_meta[curr] && tokens_meta[curr].delimiters) { + processDelimiters(state, tokens_meta[curr].delimiters); + } + } +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/emphasis.js": +/*!****************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/emphasis.js ***! + \****************************************************************/ +/***/ (function(module) { + +// Process *this* and _that_ +// + + +// Insert each marker as a separate text token, and add it to delimiter list +// +module.exports.tokenize = function emphasis(state, silent) { + var i, + scanned, + token, + start = state.pos, + marker = state.src.charCodeAt(start); + if (silent) { + return false; + } + if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { + return false; + } + scanned = state.scanDelims(state.pos, marker === 0x2A); + for (i = 0; i < scanned.length; i++) { + token = state.push('text', '', 0); + token.content = String.fromCharCode(marker); + state.delimiters.push({ + // Char code of the starting marker (number). + // + marker: marker, + // Total length of these series of delimiters. + // + length: scanned.length, + // An amount of characters before this one that's equivalent to + // current one. In plain English: if this delimiter does not open + // an emphasis, neither do previous `jump` characters. + // + // Used to skip sequences like "*****" in one step, for 1st asterisk + // value will be 0, for 2nd it's 1 and so on. + // + jump: i, + // A position of the token this delimiter corresponds to. + // + token: state.tokens.length - 1, + // If this delimiter is matched as a valid opener, `end` will be + // equal to its position, otherwise it's `-1`. + // + end: -1, + // Boolean flags that determine if this delimiter could open or close + // an emphasis. + // + open: scanned.can_open, + close: scanned.can_close + }); + } + state.pos += scanned.length; + return true; +}; +function postProcess(state, delimiters) { + var i, + startDelim, + endDelim, + token, + ch, + isStrong, + max = delimiters.length; + for (i = max - 1; i >= 0; i--) { + startDelim = delimiters[i]; + if (startDelim.marker !== 0x5F /* _ */ && startDelim.marker !== 0x2A /* * */) { + continue; + } + + // Process only opening markers + if (startDelim.end === -1) { + continue; + } + endDelim = delimiters[startDelim.end]; + + // If the previous delimiter has the same marker and is adjacent to this one, + // merge those into one strong delimiter. + // + // `whatever` -> `whatever` + // + isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && delimiters[i - 1].token === startDelim.token - 1 && delimiters[startDelim.end + 1].token === endDelim.token + 1 && delimiters[i - 1].marker === startDelim.marker; + ch = String.fromCharCode(startDelim.marker); + token = state.tokens[startDelim.token]; + token.type = isStrong ? 'strong_open' : 'em_open'; + token.tag = isStrong ? 'strong' : 'em'; + token.nesting = 1; + token.markup = isStrong ? ch + ch : ch; + token.content = ''; + token = state.tokens[endDelim.token]; + token.type = isStrong ? 'strong_close' : 'em_close'; + token.tag = isStrong ? 'strong' : 'em'; + token.nesting = -1; + token.markup = isStrong ? ch + ch : ch; + token.content = ''; + if (isStrong) { + state.tokens[delimiters[i - 1].token].content = ''; + state.tokens[delimiters[startDelim.end + 1].token].content = ''; + i--; + } + } +} + +// Walk through delimiter list and replace text tokens with tags +// +module.exports.postProcess = function emphasis(state) { + var curr, + tokens_meta = state.tokens_meta, + max = state.tokens_meta.length; + postProcess(state, state.delimiters); + for (curr = 0; curr < max; curr++) { + if (tokens_meta[curr] && tokens_meta[curr].delimiters) { + postProcess(state, tokens_meta[curr].delimiters); + } + } +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/entity.js": +/*!**************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/entity.js ***! + \**************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Process html entity - {, ¯, ", ... + + + +var entities = __webpack_require__(/*! ../common/entities */ "../node_modules/markdown-it/lib/common/entities.js"); +var has = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").has); +var isValidEntityCode = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isValidEntityCode); +var fromCodePoint = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").fromCodePoint); +var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i; +var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i; +module.exports = function entity(state, silent) { + var ch, + code, + match, + pos = state.pos, + max = state.posMax; + if (state.src.charCodeAt(pos) !== 0x26 /* & */) { + return false; + } + if (pos + 1 < max) { + ch = state.src.charCodeAt(pos + 1); + if (ch === 0x23 /* # */) { + match = state.src.slice(pos).match(DIGITAL_RE); + if (match) { + if (!silent) { + code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10); + state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD); + } + state.pos += match[0].length; + return true; + } + } else { + match = state.src.slice(pos).match(NAMED_RE); + if (match) { + if (has(entities, match[1])) { + if (!silent) { + state.pending += entities[match[1]]; + } + state.pos += match[0].length; + return true; + } + } + } + } + if (!silent) { + state.pending += '&'; + } + state.pos++; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/escape.js": +/*!**************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/escape.js ***! + \**************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Process escaped chars and hardbreaks + + + +var isSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isSpace); +var ESCAPED = []; +for (var i = 0; i < 256; i++) { + ESCAPED.push(0); +} +'\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'.split('').forEach(function (ch) { + ESCAPED[ch.charCodeAt(0)] = 1; +}); +module.exports = function escape(state, silent) { + var ch, + pos = state.pos, + max = state.posMax; + if (state.src.charCodeAt(pos) !== 0x5C /* \ */) { + return false; + } + pos++; + if (pos < max) { + ch = state.src.charCodeAt(pos); + if (ch < 256 && ESCAPED[ch] !== 0) { + if (!silent) { + state.pending += state.src[pos]; + } + state.pos += 2; + return true; + } + if (ch === 0x0A) { + if (!silent) { + state.push('hardbreak', 'br', 0); + } + pos++; + // skip leading whitespaces from next line + while (pos < max) { + ch = state.src.charCodeAt(pos); + if (!isSpace(ch)) { + break; + } + pos++; + } + state.pos = pos; + return true; + } + } + if (!silent) { + state.pending += '\\'; + } + state.pos++; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/html_inline.js": +/*!*******************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/html_inline.js ***! + \*******************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Process html tags + + + +var HTML_TAG_RE = (__webpack_require__(/*! ../common/html_re */ "../node_modules/markdown-it/lib/common/html_re.js").HTML_TAG_RE); +function isLetter(ch) { + /*eslint no-bitwise:0*/ + var lc = ch | 0x20; // to lower case + return lc >= 0x61 /* a */ && lc <= 0x7a /* z */; +} + +module.exports = function html_inline(state, silent) { + var ch, + match, + max, + token, + pos = state.pos; + if (!state.md.options.html) { + return false; + } + + // Check start + max = state.posMax; + if (state.src.charCodeAt(pos) !== 0x3C /* < */ || pos + 2 >= max) { + return false; + } + + // Quick fail on second char + ch = state.src.charCodeAt(pos + 1); + if (ch !== 0x21 /* ! */ && ch !== 0x3F /* ? */ && ch !== 0x2F /* / */ && !isLetter(ch)) { + return false; + } + match = state.src.slice(pos).match(HTML_TAG_RE); + if (!match) { + return false; + } + if (!silent) { + token = state.push('html_inline', '', 0); + token.content = state.src.slice(pos, pos + match[0].length); + } + state.pos += match[0].length; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/image.js": +/*!*************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/image.js ***! + \*************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Process ![image]( "title") + + + +var normalizeReference = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").normalizeReference); +var isSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isSpace); +module.exports = function image(state, silent) { + var attrs, + code, + content, + label, + labelEnd, + labelStart, + pos, + ref, + res, + title, + token, + tokens, + start, + href = '', + oldPos = state.pos, + max = state.posMax; + if (state.src.charCodeAt(state.pos) !== 0x21 /* ! */) { + return false; + } + if (state.src.charCodeAt(state.pos + 1) !== 0x5B /* [ */) { + return false; + } + labelStart = state.pos + 2; + labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false); + + // parser failed to find ']', so it's not a valid link + if (labelEnd < 0) { + return false; + } + pos = labelEnd + 1; + if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) { + // + // Inline link + // + + // [link]( "title" ) + // ^^ skipping these spaces + pos++; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } + } + if (pos >= max) { + return false; + } + + // [link]( "title" ) + // ^^^^^^ parsing link destination + start = pos; + res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); + if (res.ok) { + href = state.md.normalizeLink(res.str); + if (state.md.validateLink(href)) { + pos = res.pos; + } else { + href = ''; + } + } + + // [link]( "title" ) + // ^^ skipping these spaces + start = pos; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } + } + + // [link]( "title" ) + // ^^^^^^^ parsing link title + res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); + if (pos < max && start !== pos && res.ok) { + title = res.str; + pos = res.pos; + + // [link]( "title" ) + // ^^ skipping these spaces + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } + } + } else { + title = ''; + } + if (pos >= max || state.src.charCodeAt(pos) !== 0x29 /* ) */) { + state.pos = oldPos; + return false; + } + pos++; + } else { + // + // Link reference + // + if (typeof state.env.references === 'undefined') { + return false; + } + if (pos < max && state.src.charCodeAt(pos) === 0x5B /* [ */) { + start = pos + 1; + pos = state.md.helpers.parseLinkLabel(state, pos); + if (pos >= 0) { + label = state.src.slice(start, pos++); + } else { + pos = labelEnd + 1; + } + } else { + pos = labelEnd + 1; + } + + // covers label === '' and label === undefined + // (collapsed reference link and shortcut reference link respectively) + if (!label) { + label = state.src.slice(labelStart, labelEnd); + } + ref = state.env.references[normalizeReference(label)]; + if (!ref) { + state.pos = oldPos; + return false; + } + href = ref.href; + title = ref.title; + } + + // + // We found the end of the link, and know for a fact it's a valid link; + // so all that's left to do is to call tokenizer. + // + if (!silent) { + content = state.src.slice(labelStart, labelEnd); + state.md.inline.parse(content, state.md, state.env, tokens = []); + token = state.push('image', 'img', 0); + token.attrs = attrs = [['src', href], ['alt', '']]; + token.children = tokens; + token.content = content; + if (title) { + attrs.push(['title', title]); + } + } + state.pos = pos; + state.posMax = max; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/link.js": +/*!************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/link.js ***! + \************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Process [link]( "stuff") + + + +var normalizeReference = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").normalizeReference); +var isSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isSpace); +module.exports = function link(state, silent) { + var attrs, + code, + label, + labelEnd, + labelStart, + pos, + res, + ref, + token, + href = '', + title = '', + oldPos = state.pos, + max = state.posMax, + start = state.pos, + parseReference = true; + if (state.src.charCodeAt(state.pos) !== 0x5B /* [ */) { + return false; + } + labelStart = state.pos + 1; + labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true); + + // parser failed to find ']', so it's not a valid link + if (labelEnd < 0) { + return false; + } + pos = labelEnd + 1; + if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) { + // + // Inline link + // + + // might have found a valid shortcut link, disable reference parsing + parseReference = false; + + // [link]( "title" ) + // ^^ skipping these spaces + pos++; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } + } + if (pos >= max) { + return false; + } + + // [link]( "title" ) + // ^^^^^^ parsing link destination + start = pos; + res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); + if (res.ok) { + href = state.md.normalizeLink(res.str); + if (state.md.validateLink(href)) { + pos = res.pos; + } else { + href = ''; + } + + // [link]( "title" ) + // ^^ skipping these spaces + start = pos; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } + } + + // [link]( "title" ) + // ^^^^^^^ parsing link title + res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); + if (pos < max && start !== pos && res.ok) { + title = res.str; + pos = res.pos; + + // [link]( "title" ) + // ^^ skipping these spaces + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } + } + } + } + if (pos >= max || state.src.charCodeAt(pos) !== 0x29 /* ) */) { + // parsing a valid shortcut link failed, fallback to reference + parseReference = true; + } + pos++; + } + if (parseReference) { + // + // Link reference + // + if (typeof state.env.references === 'undefined') { + return false; + } + if (pos < max && state.src.charCodeAt(pos) === 0x5B /* [ */) { + start = pos + 1; + pos = state.md.helpers.parseLinkLabel(state, pos); + if (pos >= 0) { + label = state.src.slice(start, pos++); + } else { + pos = labelEnd + 1; + } + } else { + pos = labelEnd + 1; + } + + // covers label === '' and label === undefined + // (collapsed reference link and shortcut reference link respectively) + if (!label) { + label = state.src.slice(labelStart, labelEnd); + } + ref = state.env.references[normalizeReference(label)]; + if (!ref) { + state.pos = oldPos; + return false; + } + href = ref.href; + title = ref.title; + } + + // + // We found the end of the link, and know for a fact it's a valid link; + // so all that's left to do is to call tokenizer. + // + if (!silent) { + state.pos = labelStart; + state.posMax = labelEnd; + token = state.push('link_open', 'a', 1); + token.attrs = attrs = [['href', href]]; + if (title) { + attrs.push(['title', title]); + } + state.md.inline.tokenize(state); + token = state.push('link_close', 'a', -1); + } + state.pos = pos; + state.posMax = max; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/newline.js": +/*!***************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/newline.js ***! + \***************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Proceess '\n' + + + +var isSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isSpace); +module.exports = function newline(state, silent) { + var pmax, + max, + pos = state.pos; + if (state.src.charCodeAt(pos) !== 0x0A /* \n */) { + return false; + } + pmax = state.pending.length - 1; + max = state.posMax; + + // ' \n' -> hardbreak + // Lookup in pending chars is bad practice! Don't copy to other rules! + // Pending string is stored in concat mode, indexed lookups will cause + // convertion to flat mode. + if (!silent) { + if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) { + if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) { + state.pending = state.pending.replace(/ +$/, ''); + state.push('hardbreak', 'br', 0); + } else { + state.pending = state.pending.slice(0, -1); + state.push('softbreak', 'br', 0); + } + } else { + state.push('softbreak', 'br', 0); + } + } + pos++; + + // skip heading spaces for next line + while (pos < max && isSpace(state.src.charCodeAt(pos))) { + pos++; + } + state.pos = pos; + return true; +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/state_inline.js": +/*!********************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/state_inline.js ***! + \********************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +// Inline parser state + + + +var Token = __webpack_require__(/*! ../token */ "../node_modules/markdown-it/lib/token.js"); +var isWhiteSpace = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isWhiteSpace); +var isPunctChar = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isPunctChar); +var isMdAsciiPunct = (__webpack_require__(/*! ../common/utils */ "../node_modules/markdown-it/lib/common/utils.js").isMdAsciiPunct); +function StateInline(src, md, env, outTokens) { + this.src = src; + this.env = env; + this.md = md; + this.tokens = outTokens; + this.tokens_meta = Array(outTokens.length); + this.pos = 0; + this.posMax = this.src.length; + this.level = 0; + this.pending = ''; + this.pendingLevel = 0; + + // Stores { start: end } pairs. Useful for backtrack + // optimization of pairs parse (emphasis, strikes). + this.cache = {}; + + // List of emphasis-like delimiters for current tag + this.delimiters = []; + + // Stack of delimiter lists for upper level tags + this._prev_delimiters = []; + + // backtick length => last seen position + this.backticks = {}; + this.backticksScanned = false; +} + +// Flush pending text +// +StateInline.prototype.pushPending = function () { + var token = new Token('text', '', 0); + token.content = this.pending; + token.level = this.pendingLevel; + this.tokens.push(token); + this.pending = ''; + return token; +}; + +// Push new token to "stream". +// If pending text exists - flush it as text token +// +StateInline.prototype.push = function (type, tag, nesting) { + if (this.pending) { + this.pushPending(); + } + var token = new Token(type, tag, nesting); + var token_meta = null; + if (nesting < 0) { + // closing tag + this.level--; + this.delimiters = this._prev_delimiters.pop(); + } + token.level = this.level; + if (nesting > 0) { + // opening tag + this.level++; + this._prev_delimiters.push(this.delimiters); + this.delimiters = []; + token_meta = { + delimiters: this.delimiters + }; + } + this.pendingLevel = this.level; + this.tokens.push(token); + this.tokens_meta.push(token_meta); + return token; +}; + +// Scan a sequence of emphasis-like markers, and determine whether +// it can start an emphasis sequence or end an emphasis sequence. +// +// - start - position to scan from (it should point at a valid marker); +// - canSplitWord - determine if these markers can be found inside a word +// +StateInline.prototype.scanDelims = function (start, canSplitWord) { + var pos = start, + lastChar, + nextChar, + count, + can_open, + can_close, + isLastWhiteSpace, + isLastPunctChar, + isNextWhiteSpace, + isNextPunctChar, + left_flanking = true, + right_flanking = true, + max = this.posMax, + marker = this.src.charCodeAt(start); + + // treat beginning of the line as a whitespace + lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20; + while (pos < max && this.src.charCodeAt(pos) === marker) { + pos++; + } + count = pos - start; + + // treat end of the line as a whitespace + nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20; + isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); + isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); + isLastWhiteSpace = isWhiteSpace(lastChar); + isNextWhiteSpace = isWhiteSpace(nextChar); + if (isNextWhiteSpace) { + left_flanking = false; + } else if (isNextPunctChar) { + if (!(isLastWhiteSpace || isLastPunctChar)) { + left_flanking = false; + } + } + if (isLastWhiteSpace) { + right_flanking = false; + } else if (isLastPunctChar) { + if (!(isNextWhiteSpace || isNextPunctChar)) { + right_flanking = false; + } + } + if (!canSplitWord) { + can_open = left_flanking && (!right_flanking || isLastPunctChar); + can_close = right_flanking && (!left_flanking || isNextPunctChar); + } else { + can_open = left_flanking; + can_close = right_flanking; + } + return { + can_open: can_open, + can_close: can_close, + length: count + }; +}; + +// re-export Token class to use in block rules +StateInline.prototype.Token = Token; +module.exports = StateInline; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/strikethrough.js": +/*!*********************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/strikethrough.js ***! + \*********************************************************************/ +/***/ (function(module) { + +// ~~strike through~~ +// + + +// Insert each marker as a separate text token, and add it to delimiter list +// +module.exports.tokenize = function strikethrough(state, silent) { + var i, + scanned, + token, + len, + ch, + start = state.pos, + marker = state.src.charCodeAt(start); + if (silent) { + return false; + } + if (marker !== 0x7E /* ~ */) { + return false; + } + scanned = state.scanDelims(state.pos, true); + len = scanned.length; + ch = String.fromCharCode(marker); + if (len < 2) { + return false; + } + if (len % 2) { + token = state.push('text', '', 0); + token.content = ch; + len--; + } + for (i = 0; i < len; i += 2) { + token = state.push('text', '', 0); + token.content = ch + ch; + state.delimiters.push({ + marker: marker, + length: 0, + // disable "rule of 3" length checks meant for emphasis + jump: i / 2, + // for `~~` 1 marker = 2 characters + token: state.tokens.length - 1, + end: -1, + open: scanned.can_open, + close: scanned.can_close + }); + } + state.pos += scanned.length; + return true; +}; +function postProcess(state, delimiters) { + var i, + j, + startDelim, + endDelim, + token, + loneMarkers = [], + max = delimiters.length; + for (i = 0; i < max; i++) { + startDelim = delimiters[i]; + if (startDelim.marker !== 0x7E /* ~ */) { + continue; + } + if (startDelim.end === -1) { + continue; + } + endDelim = delimiters[startDelim.end]; + token = state.tokens[startDelim.token]; + token.type = 's_open'; + token.tag = 's'; + token.nesting = 1; + token.markup = '~~'; + token.content = ''; + token = state.tokens[endDelim.token]; + token.type = 's_close'; + token.tag = 's'; + token.nesting = -1; + token.markup = '~~'; + token.content = ''; + if (state.tokens[endDelim.token - 1].type === 'text' && state.tokens[endDelim.token - 1].content === '~') { + loneMarkers.push(endDelim.token - 1); + } + } + + // If a marker sequence has an odd number of characters, it's splitted + // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the + // start of the sequence. + // + // So, we have to move all those markers after subsequent s_close tags. + // + while (loneMarkers.length) { + i = loneMarkers.pop(); + j = i + 1; + while (j < state.tokens.length && state.tokens[j].type === 's_close') { + j++; + } + j--; + if (i !== j) { + token = state.tokens[j]; + state.tokens[j] = state.tokens[i]; + state.tokens[i] = token; + } + } +} + +// Walk through delimiter list and replace text tokens with tags +// +module.exports.postProcess = function strikethrough(state) { + var curr, + tokens_meta = state.tokens_meta, + max = state.tokens_meta.length; + postProcess(state, state.delimiters); + for (curr = 0; curr < max; curr++) { + if (tokens_meta[curr] && tokens_meta[curr].delimiters) { + postProcess(state, tokens_meta[curr].delimiters); + } + } +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/text.js": +/*!************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/text.js ***! + \************************************************************/ +/***/ (function(module) { + +// Skip text characters for text token, place those to pending buffer +// and increment current pos + + + +// Rule to skip pure text +// '{}$%@~+=:' reserved for extentions + +// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ + +// !!!! Don't confuse with "Markdown ASCII Punctuation" chars +// http://spec.commonmark.org/0.15/#ascii-punctuation-character +function isTerminatorChar(ch) { + switch (ch) { + case 0x0A /* \n */: + case 0x21 /* ! */: + case 0x23 /* # */: + case 0x24 /* $ */: + case 0x25 /* % */: + case 0x26 /* & */: + case 0x2A /* * */: + case 0x2B /* + */: + case 0x2D /* - */: + case 0x3A /* : */: + case 0x3C /* < */: + case 0x3D /* = */: + case 0x3E /* > */: + case 0x40 /* @ */: + case 0x5B /* [ */: + case 0x5C /* \ */: + case 0x5D /* ] */: + case 0x5E /* ^ */: + case 0x5F /* _ */: + case 0x60 /* ` */: + case 0x7B /* { */: + case 0x7D /* } */: + case 0x7E /* ~ */: + return true; + default: + return false; + } +} +module.exports = function text(state, silent) { + var pos = state.pos; + while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) { + pos++; + } + if (pos === state.pos) { + return false; + } + if (!silent) { + state.pending += state.src.slice(state.pos, pos); + } + state.pos = pos; + return true; +}; + +// Alternative implementation, for memory. +// +// It costs 10% of performance, but allows extend terminators list, if place it +// to `ParcerInline` property. Probably, will switch to it sometime, such +// flexibility required. + +/* +var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/; + +module.exports = function text(state, silent) { + var pos = state.pos, + idx = state.src.slice(pos).search(TERMINATOR_RE); + + // first char is terminator -> empty text + if (idx === 0) { return false; } + + // no terminator -> text till end of string + if (idx < 0) { + if (!silent) { state.pending += state.src.slice(pos); } + state.pos = state.src.length; + return true; + } + + if (!silent) { state.pending += state.src.slice(pos, pos + idx); } + + state.pos += idx; + + return true; +};*/ + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/rules_inline/text_collapse.js": +/*!*********************************************************************!*\ + !*** ../node_modules/markdown-it/lib/rules_inline/text_collapse.js ***! + \*********************************************************************/ +/***/ (function(module) { + +// Clean up tokens after emphasis and strikethrough postprocessing: +// merge adjacent text nodes into one and re-calculate all token levels +// +// This is necessary because initially emphasis delimiter markers (*, _, ~) +// are treated as their own separate text tokens. Then emphasis rule either +// leaves them as text (needed to merge with adjacent text) or turns them +// into opening/closing tags (which messes up levels inside). +// + + +module.exports = function text_collapse(state) { + var curr, + last, + level = 0, + tokens = state.tokens, + max = state.tokens.length; + for (curr = last = 0; curr < max; curr++) { + // re-calculate levels after emphasis/strikethrough turns some text nodes + // into opening/closing tags + if (tokens[curr].nesting < 0) level--; // closing tag + tokens[curr].level = level; + if (tokens[curr].nesting > 0) level++; // opening tag + + if (tokens[curr].type === 'text' && curr + 1 < max && tokens[curr + 1].type === 'text') { + // collapse two adjacent text nodes + tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; + } else { + if (curr !== last) { + tokens[last] = tokens[curr]; + } + last++; + } + } + if (curr !== last) { + tokens.length = last; + } +}; + +/***/ }), + +/***/ "../node_modules/markdown-it/lib/token.js": +/*!************************************************!*\ + !*** ../node_modules/markdown-it/lib/token.js ***! + \************************************************/ +/***/ (function(module) { + +// Token class + + + +/** + * class Token + **/ + +/** + * new Token(type, tag, nesting) + * + * Create new token and fill passed properties. + **/ +function Token(type, tag, nesting) { + /** + * Token#type -> String + * + * Type of the token (string, e.g. "paragraph_open") + **/ + this.type = type; + + /** + * Token#tag -> String + * + * html tag name, e.g. "p" + **/ + this.tag = tag; + + /** + * Token#attrs -> Array + * + * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]` + **/ + this.attrs = null; + + /** + * Token#map -> Array + * + * Source map info. Format: `[ line_begin, line_end ]` + **/ + this.map = null; + + /** + * Token#nesting -> Number + * + * Level change (number in {-1, 0, 1} set), where: + * + * - `1` means the tag is opening + * - `0` means the tag is self-closing + * - `-1` means the tag is closing + **/ + this.nesting = nesting; + + /** + * Token#level -> Number + * + * nesting level, the same as `state.level` + **/ + this.level = 0; + + /** + * Token#children -> Array + * + * An array of child nodes (inline and img tokens) + **/ + this.children = null; + + /** + * Token#content -> String + * + * In a case of self-closing tag (code, html, fence, etc.), + * it has contents of this tag. + **/ + this.content = ''; + + /** + * Token#markup -> String + * + * '*' or '_' for emphasis, fence string for fence, etc. + **/ + this.markup = ''; + + /** + * Token#info -> String + * + * Additional information: + * + * - Info string for "fence" tokens + * - The value "auto" for autolink "link_open" and "link_close" tokens + * - The string value of the item marker for ordered-list "list_item_open" tokens + **/ + this.info = ''; + + /** + * Token#meta -> Object + * + * A place for plugins to store an arbitrary data + **/ + this.meta = null; + + /** + * Token#block -> Boolean + * + * True for block-level tokens, false for inline tokens. + * Used in renderer to calculate line breaks + **/ + this.block = false; + + /** + * Token#hidden -> Boolean + * + * If it's true, ignore this element when rendering. Used for tight lists + * to hide paragraphs. + **/ + this.hidden = false; +} + +/** + * Token.attrIndex(name) -> Number + * + * Search attribute index by name. + **/ +Token.prototype.attrIndex = function attrIndex(name) { + var attrs, i, len; + if (!this.attrs) { + return -1; + } + attrs = this.attrs; + for (i = 0, len = attrs.length; i < len; i++) { + if (attrs[i][0] === name) { + return i; + } + } + return -1; +}; + +/** + * Token.attrPush(attrData) + * + * Add `[ name, value ]` attribute to list. Init attrs if necessary + **/ +Token.prototype.attrPush = function attrPush(attrData) { + if (this.attrs) { + this.attrs.push(attrData); + } else { + this.attrs = [attrData]; + } +}; + +/** + * Token.attrSet(name, value) + * + * Set `name` attribute to `value`. Override old value if exists. + **/ +Token.prototype.attrSet = function attrSet(name, value) { + var idx = this.attrIndex(name), + attrData = [name, value]; + if (idx < 0) { + this.attrPush(attrData); + } else { + this.attrs[idx] = attrData; + } +}; + +/** + * Token.attrGet(name) + * + * Get the value of attribute `name`, or null if it does not exist. + **/ +Token.prototype.attrGet = function attrGet(name) { + var idx = this.attrIndex(name), + value = null; + if (idx >= 0) { + value = this.attrs[idx][1]; + } + return value; +}; + +/** + * Token.attrJoin(name, value) + * + * Join value to existing attribute via space. Or create new attribute if not + * exists. Useful to operate with token classes. + **/ +Token.prototype.attrJoin = function attrJoin(name, value) { + var idx = this.attrIndex(name); + if (idx < 0) { + this.attrPush([name, value]); + } else { + this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value; + } +}; +module.exports = Token; + +/***/ }), + +/***/ "./components/GraphiQL.tsx": +/*!*********************************!*\ + !*** ./components/GraphiQL.tsx ***! + \*********************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.GraphiQL = GraphiQL; +exports.GraphiQLInterface = GraphiQLInterface; +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); +var _react2 = __webpack_require__(/*! @graphiql/react */ "../../graphiql-react/dist/index.js"); +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /** + * Copyright (c) 2020 GraphQL Contributors. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +const majorVersion = parseInt(_react.default.version.slice(0, 2), 10); +if (majorVersion < 16) { + throw new Error(['GraphiQL 0.18.0 and after is not compatible with React 15 or below.', 'If you are using a CDN source (jsdelivr, unpkg, etc), follow this example:', 'https://github.com/graphql/graphiql/blob/master/examples/graphiql-cdn/index.html#L49'].join('\n')); +} + +/** + * API docs for this live here: + * + * https://graphiql-test.netlify.app/typedoc/modules/graphiql.html#graphiqlprops + */ + +/** + * The top-level React component for GraphiQL, intended to encompass the entire + * browser viewport. + * + * @see https://github.com/graphql/graphiql#usage + */ + +function GraphiQL(_ref) { + var _props$disableTabs; + let { + dangerouslyAssumeSchemaIsValid, + defaultQuery, + defaultTabs, + externalFragments, + fetcher, + getDefaultFieldNames, + headers, + inputValueDeprecation, + introspectionQueryName, + maxHistoryLength, + onEditOperationName, + onSchemaChange, + onTabChange, + onTogglePluginVisibility, + operationName, + plugins, + query, + response, + schema, + schemaDescription, + shouldPersistHeaders, + storage, + validationRules, + variables, + visiblePlugin, + defaultHeaders, + ...props + } = _ref; + // Ensure props are correct + if (typeof fetcher !== 'function') { + throw new TypeError('The `GraphiQL` component requires a `fetcher` function to be passed as prop.'); + } + return /*#__PURE__*/_react.default.createElement(_react2.GraphiQLProvider, { + getDefaultFieldNames: getDefaultFieldNames, + dangerouslyAssumeSchemaIsValid: dangerouslyAssumeSchemaIsValid, + defaultQuery: defaultQuery, + defaultHeaders: defaultHeaders, + defaultTabs: defaultTabs, + externalFragments: externalFragments, + fetcher: fetcher, + headers: headers, + inputValueDeprecation: inputValueDeprecation, + introspectionQueryName: introspectionQueryName, + maxHistoryLength: maxHistoryLength, + onEditOperationName: onEditOperationName, + onSchemaChange: onSchemaChange, + onTabChange: onTabChange, + onTogglePluginVisibility: onTogglePluginVisibility, + plugins: plugins, + visiblePlugin: visiblePlugin, + operationName: operationName, + query: query, + response: response, + schema: schema, + schemaDescription: schemaDescription, + shouldPersistHeaders: shouldPersistHeaders, + storage: storage, + validationRules: validationRules, + variables: variables + }, /*#__PURE__*/_react.default.createElement(GraphiQLInterface, _extends({ + showPersistHeadersSettings: shouldPersistHeaders !== false, + disableTabs: (_props$disableTabs = props.disableTabs) !== null && _props$disableTabs !== void 0 ? _props$disableTabs : false + }, props))); +} + +// Export main windows/panes to be used separately if desired. +GraphiQL.Logo = GraphiQLLogo; +GraphiQL.Toolbar = GraphiQLToolbar; +GraphiQL.Footer = GraphiQLFooter; +function GraphiQLInterface(props) { + var _props$isHeadersEdito, _pluginContext$visibl, _props$toolbar, _props$toolbar2; + const isHeadersEditorEnabled = (_props$isHeadersEdito = props.isHeadersEditorEnabled) !== null && _props$isHeadersEdito !== void 0 ? _props$isHeadersEdito : true; + const editorContext = (0, _react2.useEditorContext)({ + nonNull: true + }); + const executionContext = (0, _react2.useExecutionContext)({ + nonNull: true + }); + const schemaContext = (0, _react2.useSchemaContext)({ + nonNull: true + }); + const storageContext = (0, _react2.useStorageContext)(); + const pluginContext = (0, _react2.usePluginContext)(); + const copy = (0, _react2.useCopyQuery)({ + onCopyQuery: props.onCopyQuery + }); + const merge = (0, _react2.useMergeQuery)(); + const prettify = (0, _react2.usePrettifyEditors)(); + const { + theme, + setTheme + } = (0, _react2.useTheme)(); + const PluginContent = pluginContext === null || pluginContext === void 0 ? void 0 : (_pluginContext$visibl = pluginContext.visiblePlugin) === null || _pluginContext$visibl === void 0 ? void 0 : _pluginContext$visibl.content; + const pluginResize = (0, _react2.useDragResize)({ + defaultSizeRelation: 1 / 3, + direction: 'horizontal', + initiallyHidden: pluginContext !== null && pluginContext !== void 0 && pluginContext.visiblePlugin ? undefined : 'first', + onHiddenElementChange(resizableElement) { + if (resizableElement === 'first') { + pluginContext === null || pluginContext === void 0 ? void 0 : pluginContext.setVisiblePlugin(null); + } + }, + sizeThresholdSecond: 200, + storageKey: 'docExplorerFlex' + }); + const editorResize = (0, _react2.useDragResize)({ + direction: 'horizontal', + storageKey: 'editorFlex' + }); + const editorToolsResize = (0, _react2.useDragResize)({ + defaultSizeRelation: 3, + direction: 'vertical', + initiallyHidden: (() => { + if (props.defaultEditorToolsVisibility === 'variables' || props.defaultEditorToolsVisibility === 'headers') { + return; + } + if (typeof props.defaultEditorToolsVisibility === 'boolean') { + return props.defaultEditorToolsVisibility ? undefined : 'second'; + } + return editorContext.initialVariables || editorContext.initialHeaders ? undefined : 'second'; + })(), + sizeThresholdSecond: 60, + storageKey: 'secondaryEditorFlex' + }); + const [activeSecondaryEditor, setActiveSecondaryEditor] = (0, _react.useState)(() => { + if (props.defaultEditorToolsVisibility === 'variables' || props.defaultEditorToolsVisibility === 'headers') { + return props.defaultEditorToolsVisibility; + } + return !editorContext.initialVariables && editorContext.initialHeaders && isHeadersEditorEnabled ? 'headers' : 'variables'; + }); + const [showDialog, setShowDialog] = (0, _react.useState)(null); + const [clearStorageStatus, setClearStorageStatus] = (0, _react.useState)(null); + const children = _react.default.Children.toArray(props.children); + const logo = children.find(child => isChildComponentType(child, GraphiQL.Logo)) || /*#__PURE__*/_react.default.createElement(GraphiQL.Logo, null); + const toolbar = children.find(child => isChildComponentType(child, GraphiQL.Toolbar)) || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_react2.ToolbarButton, { + onClick: prettify, + label: "Prettify query (Shift-Ctrl-P)" + }, /*#__PURE__*/_react.default.createElement(_react2.PrettifyIcon, { + className: "graphiql-toolbar-icon", + "aria-hidden": "true" + })), /*#__PURE__*/_react.default.createElement(_react2.ToolbarButton, { + onClick: merge, + label: "Merge fragments into query (Shift-Ctrl-M)" + }, /*#__PURE__*/_react.default.createElement(_react2.MergeIcon, { + className: "graphiql-toolbar-icon", + "aria-hidden": "true" + })), /*#__PURE__*/_react.default.createElement(_react2.ToolbarButton, { + onClick: copy, + label: "Copy query (Shift-Ctrl-C)" + }, /*#__PURE__*/_react.default.createElement(_react2.CopyIcon, { + className: "graphiql-toolbar-icon", + "aria-hidden": "true" + })), ((_props$toolbar = props.toolbar) === null || _props$toolbar === void 0 ? void 0 : _props$toolbar.additionalContent) && props.toolbar.additionalContent, ((_props$toolbar2 = props.toolbar) === null || _props$toolbar2 === void 0 ? void 0 : _props$toolbar2.additionalComponent) && /*#__PURE__*/_react.default.createElement(props.toolbar.additionalComponent, null)); + const footer = children.find(child => isChildComponentType(child, GraphiQL.Footer)); + const onClickReference = (0, _react.useCallback)(() => { + if (pluginResize.hiddenElement === 'first') { + pluginResize.setHiddenElement(null); + } + }, [pluginResize]); + const handleClearData = (0, _react.useCallback)(() => { + try { + storageContext === null || storageContext === void 0 ? void 0 : storageContext.clear(); + setClearStorageStatus('success'); + } catch { + setClearStorageStatus('error'); + } + }, [storageContext]); + const handlePersistHeaders = (0, _react.useCallback)(event => { + editorContext.setShouldPersistHeaders(event.currentTarget.dataset.value === 'true'); + }, [editorContext]); + const handleChangeTheme = (0, _react.useCallback)(event => { + const selectedTheme = event.currentTarget.dataset.theme; + setTheme(selectedTheme || null); + }, [setTheme]); + const handleAddTab = editorContext.addTab; + const handleRefetchSchema = schemaContext.introspect; + const handleReorder = editorContext.moveTab; + const handleShowDialog = (0, _react.useCallback)(event => { + setShowDialog(event.currentTarget.dataset.value); + }, []); + const handlePluginClick = (0, _react.useCallback)(e => { + const context = pluginContext; + const pluginIndex = Number(e.currentTarget.dataset.index); + const plugin = context.plugins.find((_, index) => pluginIndex === index); + const isVisible = plugin === context.visiblePlugin; + if (isVisible) { + context.setVisiblePlugin(null); + pluginResize.setHiddenElement('first'); + } else { + context.setVisiblePlugin(plugin); + pluginResize.setHiddenElement(null); + } + }, [pluginContext, pluginResize]); + const handleToolsTabClick = (0, _react.useCallback)(event => { + if (editorToolsResize.hiddenElement === 'second') { + editorToolsResize.setHiddenElement(null); + } + setActiveSecondaryEditor(event.currentTarget.dataset.name); + }, [editorToolsResize]); + const toggleEditorTools = (0, _react.useCallback)(() => { + editorToolsResize.setHiddenElement(editorToolsResize.hiddenElement === 'second' ? null : 'second'); + }, [editorToolsResize]); + const handleOpenShortKeysDialog = (0, _react.useCallback)(isOpen => { + if (!isOpen) { + setShowDialog(null); + } + }, []); + const handleOpenSettingsDialog = (0, _react.useCallback)(isOpen => { + if (!isOpen) { + setShowDialog(null); + setClearStorageStatus(null); + } + }, []); + const addTab = /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { + label: "Add tab" + }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { + type: "button", + className: "graphiql-tab-add", + onClick: handleAddTab, + "aria-label": "Add tab" + }, /*#__PURE__*/_react.default.createElement(_react2.PlusIcon, { + "aria-hidden": "true" + }))); + return /*#__PURE__*/_react.default.createElement(_react2.Tooltip.Provider, null, /*#__PURE__*/_react.default.createElement("div", { + "data-testid": "graphiql-container", + className: "graphiql-container" + }, /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-sidebar" + }, /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-sidebar-section" + }, pluginContext === null || pluginContext === void 0 ? void 0 : pluginContext.plugins.map((plugin, index) => { + const isVisible = plugin === pluginContext.visiblePlugin; + const label = `${isVisible ? 'Hide' : 'Show'} ${plugin.title}`; + const Icon = plugin.icon; + return /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { + key: plugin.title, + label: label + }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { + type: "button", + className: isVisible ? 'active' : '', + onClick: handlePluginClick, + "data-index": index, + "aria-label": label + }, /*#__PURE__*/_react.default.createElement(Icon, { + "aria-hidden": "true" + }))); + })), /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-sidebar-section" + }, /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { + label: "Re-fetch GraphQL schema" + }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { + type: "button", + disabled: schemaContext.isFetching, + onClick: handleRefetchSchema, + "aria-label": "Re-fetch GraphQL schema" + }, /*#__PURE__*/_react.default.createElement(_react2.ReloadIcon, { + className: schemaContext.isFetching ? 'graphiql-spin' : '', + "aria-hidden": "true" + }))), /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { + label: "Open short keys dialog" + }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { + type: "button", + "data-value": "short-keys", + onClick: handleShowDialog, + "aria-label": "Open short keys dialog" + }, /*#__PURE__*/_react.default.createElement(_react2.KeyboardShortcutIcon, { + "aria-hidden": "true" + }))), /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { + label: "Open settings dialog" + }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { + type: "button", + "data-value": "settings", + onClick: handleShowDialog, + "aria-label": "Open settings dialog" + }, /*#__PURE__*/_react.default.createElement(_react2.SettingsIcon, { + "aria-hidden": "true" + }))))), /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-main" + }, /*#__PURE__*/_react.default.createElement("div", { + ref: pluginResize.firstRef, + style: { + // Make sure the container shrinks when containing long + // non-breaking texts + minWidth: '200px' + } + }, /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-plugin" + }, PluginContent ? /*#__PURE__*/_react.default.createElement(PluginContent, null) : null)), (pluginContext === null || pluginContext === void 0 ? void 0 : pluginContext.visiblePlugin) && /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-horizontal-drag-bar", + ref: pluginResize.dragBarRef + }), /*#__PURE__*/_react.default.createElement("div", { + ref: pluginResize.secondRef, + className: "graphiql-sessions" + }, /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-session-header" + }, props.disableTabs ? null : /*#__PURE__*/_react.default.createElement(_react2.Tabs, { + values: editorContext.tabs, + onReorder: handleReorder, + "aria-label": "Select active operation" + }, editorContext.tabs.length > 1 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, editorContext.tabs.map((tab, index) => /*#__PURE__*/_react.default.createElement(_react2.Tab, { + key: tab.id, + value: tab, + isActive: index === editorContext.activeTabIndex + }, /*#__PURE__*/_react.default.createElement(_react2.Tab.Button, { + "aria-controls": "graphiql-session", + id: `graphiql-session-tab-${index}`, + onClick: () => { + executionContext.stop(); + editorContext.changeTab(index); + } + }, tab.title), /*#__PURE__*/_react.default.createElement(_react2.Tab.Close, { + onClick: () => { + if (editorContext.activeTabIndex === index) { + executionContext.stop(); + } + editorContext.closeTab(index); + } + }))), addTab)), /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-session-header-right" + }, editorContext.tabs.length === 1 && addTab, logo)), /*#__PURE__*/_react.default.createElement("div", { + role: "tabpanel", + id: "graphiql-session", + className: "graphiql-session", + "aria-labelledby": `graphiql-session-tab-${editorContext.activeTabIndex}` + }, /*#__PURE__*/_react.default.createElement("div", { + ref: editorResize.firstRef + }, /*#__PURE__*/_react.default.createElement("div", { + className: `graphiql-editors${editorContext.tabs.length === 1 ? ' full-height' : ''}` + }, /*#__PURE__*/_react.default.createElement("div", { + ref: editorToolsResize.firstRef + }, /*#__PURE__*/_react.default.createElement("section", { + className: "graphiql-query-editor", + "aria-label": "Query Editor" + }, /*#__PURE__*/_react.default.createElement(_react2.QueryEditor, { + editorTheme: props.editorTheme, + keyMap: props.keyMap, + onClickReference: onClickReference, + onCopyQuery: props.onCopyQuery, + onEdit: props.onEditQuery, + readOnly: props.readOnly + }), /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-toolbar", + role: "toolbar", + "aria-label": "Editor Commands" + }, /*#__PURE__*/_react.default.createElement(_react2.ExecuteButton, null), toolbar))), /*#__PURE__*/_react.default.createElement("div", { + ref: editorToolsResize.dragBarRef + }, /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-editor-tools" + }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { + type: "button", + className: activeSecondaryEditor === 'variables' && editorToolsResize.hiddenElement !== 'second' ? 'active' : '', + onClick: handleToolsTabClick, + "data-name": "variables" + }, "Variables"), isHeadersEditorEnabled && /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { + type: "button", + className: activeSecondaryEditor === 'headers' && editorToolsResize.hiddenElement !== 'second' ? 'active' : '', + onClick: handleToolsTabClick, + "data-name": "headers" + }, "Headers"), /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { + label: editorToolsResize.hiddenElement === 'second' ? 'Show editor tools' : 'Hide editor tools' + }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { + type: "button", + onClick: toggleEditorTools, + "aria-label": editorToolsResize.hiddenElement === 'second' ? 'Show editor tools' : 'Hide editor tools', + className: "graphiql-toggle-editor-tools" + }, editorToolsResize.hiddenElement === 'second' ? /*#__PURE__*/_react.default.createElement(_react2.ChevronUpIcon, { + className: "graphiql-chevron-icon", + "aria-hidden": "true" + }) : /*#__PURE__*/_react.default.createElement(_react2.ChevronDownIcon, { + className: "graphiql-chevron-icon", + "aria-hidden": "true" + }))))), /*#__PURE__*/_react.default.createElement("div", { + ref: editorToolsResize.secondRef + }, /*#__PURE__*/_react.default.createElement("section", { + className: "graphiql-editor-tool", + "aria-label": activeSecondaryEditor === 'variables' ? 'Variables' : 'Headers' + }, /*#__PURE__*/_react.default.createElement(_react2.VariableEditor, { + editorTheme: props.editorTheme, + isHidden: activeSecondaryEditor !== 'variables', + keyMap: props.keyMap, + onEdit: props.onEditVariables, + onClickReference: onClickReference, + readOnly: props.readOnly + }), isHeadersEditorEnabled && /*#__PURE__*/_react.default.createElement(_react2.HeaderEditor, { + editorTheme: props.editorTheme, + isHidden: activeSecondaryEditor !== 'headers', + keyMap: props.keyMap, + onEdit: props.onEditHeaders, + readOnly: props.readOnly + }))))), /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-horizontal-drag-bar", + ref: editorResize.dragBarRef + }), /*#__PURE__*/_react.default.createElement("div", { + ref: editorResize.secondRef + }, /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-response" + }, executionContext.isFetching ? /*#__PURE__*/_react.default.createElement(_react2.Spinner, null) : null, /*#__PURE__*/_react.default.createElement(_react2.ResponseEditor, { + editorTheme: props.editorTheme, + responseTooltip: props.responseTooltip, + keyMap: props.keyMap + }), footer))))), /*#__PURE__*/_react.default.createElement(_react2.Dialog, { + open: showDialog === 'short-keys', + onOpenChange: handleOpenShortKeysDialog + }, /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-dialog-header" + }, /*#__PURE__*/_react.default.createElement(_react2.Dialog.Title, { + className: "graphiql-dialog-title" + }, "Short Keys"), /*#__PURE__*/_react.default.createElement(_react2.Dialog.Close, null)), /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-dialog-section" + }, /*#__PURE__*/_react.default.createElement(ShortKeys, { + keyMap: props.keyMap || 'sublime' + }))), /*#__PURE__*/_react.default.createElement(_react2.Dialog, { + open: showDialog === 'settings', + onOpenChange: handleOpenSettingsDialog + }, /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-dialog-header" + }, /*#__PURE__*/_react.default.createElement(_react2.Dialog.Title, { + className: "graphiql-dialog-title" + }, "Settings"), /*#__PURE__*/_react.default.createElement(_react2.Dialog.Close, null)), props.showPersistHeadersSettings ? /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-dialog-section" + }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-dialog-section-title" + }, "Persist headers"), /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-dialog-section-caption" + }, "Save headers upon reloading.", ' ', /*#__PURE__*/_react.default.createElement("span", { + className: "graphiql-warning-text" + }, "Only enable if you trust this device."))), /*#__PURE__*/_react.default.createElement(_react2.ButtonGroup, null, /*#__PURE__*/_react.default.createElement(_react2.Button, { + type: "button", + id: "enable-persist-headers", + className: editorContext.shouldPersistHeaders ? 'active' : '', + "data-value": "true", + onClick: handlePersistHeaders + }, "On"), /*#__PURE__*/_react.default.createElement(_react2.Button, { + type: "button", + id: "disable-persist-headers", + className: editorContext.shouldPersistHeaders ? '' : 'active', + onClick: handlePersistHeaders + }, "Off"))) : null, /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-dialog-section" + }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-dialog-section-title" + }, "Theme"), /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-dialog-section-caption" + }, "Adjust how the interface looks like.")), /*#__PURE__*/_react.default.createElement(_react2.ButtonGroup, null, /*#__PURE__*/_react.default.createElement(_react2.Button, { + type: "button", + className: theme === null ? 'active' : '', + onClick: handleChangeTheme + }, "System"), /*#__PURE__*/_react.default.createElement(_react2.Button, { + type: "button", + className: theme === 'light' ? 'active' : '', + "data-theme": "light", + onClick: handleChangeTheme + }, "Light"), /*#__PURE__*/_react.default.createElement(_react2.Button, { + type: "button", + className: theme === 'dark' ? 'active' : '', + "data-theme": "dark", + onClick: handleChangeTheme + }, "Dark"))), storageContext ? /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-dialog-section" + }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-dialog-section-title" + }, "Clear storage"), /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-dialog-section-caption" + }, "Remove all locally stored data and start fresh.")), /*#__PURE__*/_react.default.createElement(_react2.Button, { + type: "button", + state: clearStorageStatus || undefined, + disabled: clearStorageStatus === 'success', + onClick: handleClearData + }, { + success: 'Cleared data', + error: 'Failed' + }[clearStorageStatus] || 'Clear data')) : null))); +} +const modifier = typeof window !== 'undefined' && window.navigator.platform.toLowerCase().indexOf('mac') === 0 ? 'Cmd' : 'Ctrl'; +const SHORT_KEYS = Object.entries({ + 'Search in editor': [modifier, 'F'], + 'Search in documentation': [modifier, 'K'], + 'Execute query': [modifier, 'Enter'], + 'Prettify editors': ['Ctrl', 'Shift', 'P'], + 'Merge fragments definitions into operation definition': ['Ctrl', 'Shift', 'M'], + 'Copy query': ['Ctrl', 'Shift', 'C'], + 'Re-fetch schema using introspection': ['Ctrl', 'Shift', 'R'] +}); +function ShortKeys(_ref2) { + let { + keyMap + } = _ref2; + return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("table", { + className: "graphiql-table" + }, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("th", null, "Short Key"), /*#__PURE__*/_react.default.createElement("th", null, "Function"))), /*#__PURE__*/_react.default.createElement("tbody", null, SHORT_KEYS.map(_ref3 => { + let [title, keys] = _ref3; + return /*#__PURE__*/_react.default.createElement("tr", { + key: title + }, /*#__PURE__*/_react.default.createElement("td", null, keys.map((key, index, array) => /*#__PURE__*/_react.default.createElement(_react.Fragment, { + key: key + }, /*#__PURE__*/_react.default.createElement("code", { + className: "graphiql-key" + }, key), index !== array.length - 1 && ' + '))), /*#__PURE__*/_react.default.createElement("td", null, title)); + }))), /*#__PURE__*/_react.default.createElement("p", null, "The editors use", ' ', /*#__PURE__*/_react.default.createElement("a", { + href: "https://codemirror.net/5/doc/manual.html#keymaps", + target: "_blank", + rel: "noopener noreferrer" + }, "CodeMirror Key Maps"), ' ', "that add more short keys. This instance of Graph", /*#__PURE__*/_react.default.createElement("em", null, "i"), "QL uses", ' ', /*#__PURE__*/_react.default.createElement("code", null, keyMap), ".")); +} + +// Configure the UI by providing this Component as a child of GraphiQL. +function GraphiQLLogo(props) { + return /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-logo" + }, props.children || /*#__PURE__*/_react.default.createElement("a", { + className: "graphiql-logo-link", + href: "https://github.com/graphql/graphiql", + target: "_blank", + rel: "noreferrer" + }, "Graph", /*#__PURE__*/_react.default.createElement("em", null, "i"), "QL")); +} +GraphiQLLogo.displayName = 'GraphiQLLogo'; + +// Configure the UI by providing this Component as a child of GraphiQL. +function GraphiQLToolbar(props) { + // eslint-disable-next-line react/jsx-no-useless-fragment + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, props.children); +} +GraphiQLToolbar.displayName = 'GraphiQLToolbar'; + +// Configure the UI by providing this Component as a child of GraphiQL. +function GraphiQLFooter(props) { + return /*#__PURE__*/_react.default.createElement("div", { + className: "graphiql-footer" + }, props.children); +} +GraphiQLFooter.displayName = 'GraphiQLFooter'; + +// Determines if the React child is of the same type of the provided React component +function isChildComponentType(child, component) { + var _child$type; + if (child !== null && child !== void 0 && (_child$type = child.type) !== null && _child$type !== void 0 && _child$type.displayName && child.type.displayName === component.displayName) { + return true; + } + return child.type === component; +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/index.js": +/*!***************************************************!*\ + !*** ../../graphql-language-service/esm/index.js ***! + \***************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "CharacterStream", ({ + enumerable: true, + get: function () { + return _parser.CharacterStream; + } +})); +Object.defineProperty(exports, "CompletionItemKind", ({ + enumerable: true, + get: function () { + return _types.CompletionItemKind; + } +})); +Object.defineProperty(exports, "DIAGNOSTIC_SEVERITY", ({ + enumerable: true, + get: function () { + return _interface.DIAGNOSTIC_SEVERITY; + } +})); +Object.defineProperty(exports, "FileChangeTypeKind", ({ + enumerable: true, + get: function () { + return _types.FileChangeTypeKind; + } +})); +Object.defineProperty(exports, "LexRules", ({ + enumerable: true, + get: function () { + return _parser.LexRules; + } +})); +Object.defineProperty(exports, "ParseRules", ({ + enumerable: true, + get: function () { + return _parser.ParseRules; + } +})); +Object.defineProperty(exports, "Position", ({ + enumerable: true, + get: function () { + return _utils.Position; + } +})); +Object.defineProperty(exports, "Range", ({ + enumerable: true, + get: function () { + return _utils.Range; + } +})); +Object.defineProperty(exports, "RuleKinds", ({ + enumerable: true, + get: function () { + return _parser.RuleKinds; + } +})); +Object.defineProperty(exports, "SEVERITY", ({ + enumerable: true, + get: function () { + return _interface.SEVERITY; + } +})); +Object.defineProperty(exports, "SuggestionCommand", ({ + enumerable: true, + get: function () { + return _interface.SuggestionCommand; + } +})); +Object.defineProperty(exports, "canUseDirective", ({ + enumerable: true, + get: function () { + return _interface.canUseDirective; + } +})); +Object.defineProperty(exports, "collectVariables", ({ + enumerable: true, + get: function () { + return _utils.collectVariables; + } +})); +Object.defineProperty(exports, "getASTNodeAtPosition", ({ + enumerable: true, + get: function () { + return _utils.getASTNodeAtPosition; + } +})); +Object.defineProperty(exports, "getAutocompleteSuggestions", ({ + enumerable: true, + get: function () { + return _interface.getAutocompleteSuggestions; + } +})); +Object.defineProperty(exports, "getDefinitionQueryResultForDefinitionNode", ({ + enumerable: true, + get: function () { + return _interface.getDefinitionQueryResultForDefinitionNode; + } +})); +Object.defineProperty(exports, "getDefinitionQueryResultForField", ({ + enumerable: true, + get: function () { + return _interface.getDefinitionQueryResultForField; + } +})); +Object.defineProperty(exports, "getDefinitionQueryResultForFragmentSpread", ({ + enumerable: true, + get: function () { + return _interface.getDefinitionQueryResultForFragmentSpread; + } +})); +Object.defineProperty(exports, "getDefinitionQueryResultForNamedType", ({ + enumerable: true, + get: function () { + return _interface.getDefinitionQueryResultForNamedType; + } +})); +Object.defineProperty(exports, "getDefinitionState", ({ + enumerable: true, + get: function () { + return _interface.getDefinitionState; + } +})); +Object.defineProperty(exports, "getDiagnostics", ({ + enumerable: true, + get: function () { + return _interface.getDiagnostics; + } +})); +Object.defineProperty(exports, "getFieldDef", ({ + enumerable: true, + get: function () { + return _interface.getFieldDef; + } +})); +Object.defineProperty(exports, "getFragmentDefinitions", ({ + enumerable: true, + get: function () { + return _interface.getFragmentDefinitions; + } +})); +Object.defineProperty(exports, "getFragmentDependencies", ({ + enumerable: true, + get: function () { + return _utils.getFragmentDependencies; + } +})); +Object.defineProperty(exports, "getFragmentDependenciesForAST", ({ + enumerable: true, + get: function () { + return _utils.getFragmentDependenciesForAST; + } +})); +Object.defineProperty(exports, "getHoverInformation", ({ + enumerable: true, + get: function () { + return _interface.getHoverInformation; + } +})); +Object.defineProperty(exports, "getOperationASTFacts", ({ + enumerable: true, + get: function () { + return _utils.getOperationASTFacts; + } +})); +Object.defineProperty(exports, "getOperationFacts", ({ + enumerable: true, + get: function () { + return _utils.getOperationFacts; + } +})); +Object.defineProperty(exports, "getOutline", ({ + enumerable: true, + get: function () { + return _interface.getOutline; + } +})); +Object.defineProperty(exports, "getQueryFacts", ({ + enumerable: true, + get: function () { + return _utils.getQueryFacts; + } +})); +Object.defineProperty(exports, "getRange", ({ + enumerable: true, + get: function () { + return _interface.getRange; + } +})); +Object.defineProperty(exports, "getTokenAtPosition", ({ + enumerable: true, + get: function () { + return _interface.getTokenAtPosition; + } +})); +Object.defineProperty(exports, "getTypeInfo", ({ + enumerable: true, + get: function () { + return _interface.getTypeInfo; + } +})); +Object.defineProperty(exports, "getVariableCompletions", ({ + enumerable: true, + get: function () { + return _interface.getVariableCompletions; + } +})); +Object.defineProperty(exports, "getVariablesJSONSchema", ({ + enumerable: true, + get: function () { + return _utils.getVariablesJSONSchema; + } +})); +Object.defineProperty(exports, "isIgnored", ({ + enumerable: true, + get: function () { + return _parser.isIgnored; + } +})); +Object.defineProperty(exports, "list", ({ + enumerable: true, + get: function () { + return _parser.list; + } +})); +Object.defineProperty(exports, "offsetToPosition", ({ + enumerable: true, + get: function () { + return _utils.offsetToPosition; + } +})); +Object.defineProperty(exports, "onlineParser", ({ + enumerable: true, + get: function () { + return _parser.onlineParser; + } +})); +Object.defineProperty(exports, "opt", ({ + enumerable: true, + get: function () { + return _parser.opt; + } +})); +Object.defineProperty(exports, "p", ({ + enumerable: true, + get: function () { + return _parser.p; + } +})); +Object.defineProperty(exports, "pointToOffset", ({ + enumerable: true, + get: function () { + return _utils.pointToOffset; + } +})); +Object.defineProperty(exports, "t", ({ + enumerable: true, + get: function () { + return _parser.t; + } +})); +Object.defineProperty(exports, "validateQuery", ({ + enumerable: true, + get: function () { + return _interface.validateQuery; + } +})); +Object.defineProperty(exports, "validateWithCustomRules", ({ + enumerable: true, + get: function () { + return _utils.validateWithCustomRules; + } +})); +var _interface = __webpack_require__(/*! ./interface */ "../../graphql-language-service/esm/interface/index.js"); +var _parser = __webpack_require__(/*! ./parser */ "../../graphql-language-service/esm/parser/index.js"); +var _types = __webpack_require__(/*! ./types */ "../../graphql-language-service/esm/types.js"); +var _utils = __webpack_require__(/*! ./utils */ "../../graphql-language-service/esm/utils/index.js"); + +/***/ }), + +/***/ "../../graphql-language-service/esm/interface/autocompleteUtils.js": +/*!*************************************************************************!*\ + !*** ../../graphql-language-service/esm/interface/autocompleteUtils.js ***! + \*************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.forEachState = forEachState; +exports.getDefinitionState = getDefinitionState; +exports.getFieldDef = getFieldDef; +exports.hintList = hintList; +exports.objectValues = objectValues; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +function getDefinitionState(tokenState) { + let definitionState; + forEachState(tokenState, state => { + switch (state.kind) { + case 'Query': + case 'ShortQuery': + case 'Mutation': + case 'Subscription': + case 'FragmentDefinition': + definitionState = state; + break; + } + }); + return definitionState; +} +function getFieldDef(schema, type, fieldName) { + if (fieldName === _graphql.SchemaMetaFieldDef.name && schema.getQueryType() === type) { + return _graphql.SchemaMetaFieldDef; + } + if (fieldName === _graphql.TypeMetaFieldDef.name && schema.getQueryType() === type) { + return _graphql.TypeMetaFieldDef; + } + if (fieldName === _graphql.TypeNameMetaFieldDef.name && (0, _graphql.isCompositeType)(type)) { + return _graphql.TypeNameMetaFieldDef; + } + if ('getFields' in type) { + return type.getFields()[fieldName]; + } + return null; +} +function forEachState(stack, fn) { + const reverseStateStack = []; + let state = stack; + while (state === null || state === void 0 ? void 0 : state.kind) { + reverseStateStack.push(state); + state = state.prevState; + } + for (let i = reverseStateStack.length - 1; i >= 0; i--) { + fn(reverseStateStack[i]); + } +} +function objectValues(object) { + const keys = Object.keys(object); + const len = keys.length; + const values = new Array(len); + for (let i = 0; i < len; ++i) { + values[i] = object[keys[i]]; + } + return values; +} +function hintList(token, list) { + return filterAndSortList(list, normalizeText(token.string)); +} +function filterAndSortList(list, text) { + if (!text) { + return filterNonEmpty(list, entry => !entry.isDeprecated); + } + const byProximity = list.map(entry => ({ + proximity: getProximity(normalizeText(entry.label), text), + entry + })); + return filterNonEmpty(filterNonEmpty(byProximity, pair => pair.proximity <= 2), pair => !pair.entry.isDeprecated).sort((a, b) => (a.entry.isDeprecated ? 1 : 0) - (b.entry.isDeprecated ? 1 : 0) || a.proximity - b.proximity || a.entry.label.length - b.entry.label.length).map(pair => pair.entry); +} +function filterNonEmpty(array, predicate) { + const filtered = array.filter(predicate); + return filtered.length === 0 ? array : filtered; +} +function normalizeText(text) { + return text.toLowerCase().replaceAll(/\W/g, ''); +} +function getProximity(suggestion, text) { + let proximity = lexicalDistance(text, suggestion); + if (suggestion.length > text.length) { + proximity -= suggestion.length - text.length - 1; + proximity += suggestion.indexOf(text) === 0 ? 0 : 0.5; + } + return proximity; +} +function lexicalDistance(a, b) { + let i; + let j; + const d = []; + const aLength = a.length; + const bLength = b.length; + for (i = 0; i <= aLength; i++) { + d[i] = [i]; + } + for (j = 1; j <= bLength; j++) { + d[0][j] = j; + } + for (i = 1; i <= aLength; i++) { + for (j = 1; j <= bLength; j++) { + const cost = a[i - 1] === b[j - 1] ? 0 : 1; + d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost); + if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { + d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost); + } + } + } + return d[aLength][bLength]; +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/interface/getAutocompleteSuggestions.js": +/*!**********************************************************************************!*\ + !*** ../../graphql-language-service/esm/interface/getAutocompleteSuggestions.js ***! + \**********************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.SuggestionCommand = exports.GraphQLDocumentMode = void 0; +exports.canUseDirective = canUseDirective; +exports.getAutocompleteSuggestions = getAutocompleteSuggestions; +exports.getFragmentDefinitions = getFragmentDefinitions; +exports.getTokenAtPosition = getTokenAtPosition; +exports.getTypeInfo = getTypeInfo; +exports.getVariableCompletions = getVariableCompletions; +exports.runOnlineParser = runOnlineParser; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _types = __webpack_require__(/*! ../types */ "../../graphql-language-service/esm/types.js"); +var _parser = __webpack_require__(/*! ../parser */ "../../graphql-language-service/esm/parser/index.js"); +var _autocompleteUtils = __webpack_require__(/*! ./autocompleteUtils */ "../../graphql-language-service/esm/interface/autocompleteUtils.js"); +const SuggestionCommand = { + command: 'editor.action.triggerSuggest', + title: 'Suggestions' +}; +exports.SuggestionCommand = SuggestionCommand; +const collectFragmentDefs = op => { + const externalFragments = []; + if (op) { + try { + (0, _graphql.visit)((0, _graphql.parse)(op), { + FragmentDefinition(def) { + externalFragments.push(def); + } + }); + } catch (_a) { + return []; + } + } + return externalFragments; +}; +const typeSystemKinds = [_graphql.Kind.SCHEMA_DEFINITION, _graphql.Kind.OPERATION_TYPE_DEFINITION, _graphql.Kind.SCALAR_TYPE_DEFINITION, _graphql.Kind.OBJECT_TYPE_DEFINITION, _graphql.Kind.INTERFACE_TYPE_DEFINITION, _graphql.Kind.UNION_TYPE_DEFINITION, _graphql.Kind.ENUM_TYPE_DEFINITION, _graphql.Kind.INPUT_OBJECT_TYPE_DEFINITION, _graphql.Kind.DIRECTIVE_DEFINITION, _graphql.Kind.SCHEMA_EXTENSION, _graphql.Kind.SCALAR_TYPE_EXTENSION, _graphql.Kind.OBJECT_TYPE_EXTENSION, _graphql.Kind.INTERFACE_TYPE_EXTENSION, _graphql.Kind.UNION_TYPE_EXTENSION, _graphql.Kind.ENUM_TYPE_EXTENSION, _graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION]; +const hasTypeSystemDefinitions = sdl => { + let hasTypeSystemDef = false; + if (sdl) { + try { + (0, _graphql.visit)((0, _graphql.parse)(sdl), { + enter(node) { + if (node.kind === 'Document') { + return; + } + if (typeSystemKinds.includes(node.kind)) { + hasTypeSystemDef = true; + return _graphql.BREAK; + } + return false; + } + }); + } catch (_a) { + return hasTypeSystemDef; + } + } + return hasTypeSystemDef; +}; +function getAutocompleteSuggestions(schema, queryText, cursor, contextToken, fragmentDefs, options) { + var _a; + const opts = Object.assign(Object.assign({}, options), { + schema + }); + const token = contextToken || getTokenAtPosition(queryText, cursor, 1); + const state = token.state.kind === 'Invalid' ? token.state.prevState : token.state; + const mode = (options === null || options === void 0 ? void 0 : options.mode) || getDocumentMode(queryText, options === null || options === void 0 ? void 0 : options.uri); + if (!state) { + return []; + } + const { + kind, + step, + prevState + } = state; + const typeInfo = getTypeInfo(schema, token.state); + if (kind === _parser.RuleKinds.DOCUMENT) { + if (mode === GraphQLDocumentMode.TYPE_SYSTEM) { + return getSuggestionsForTypeSystemDefinitions(token); + } + return getSuggestionsForExecutableDefinitions(token); + } + if (kind === _parser.RuleKinds.EXTEND_DEF) { + return getSuggestionsForExtensionDefinitions(token); + } + if (((_a = prevState === null || prevState === void 0 ? void 0 : prevState.prevState) === null || _a === void 0 ? void 0 : _a.kind) === _parser.RuleKinds.EXTENSION_DEFINITION && state.name) { + return (0, _autocompleteUtils.hintList)(token, []); + } + if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.SCALAR_TYPE_EXTENSION) { + return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(_graphql.isScalarType).map(type => ({ + label: type.name, + kind: _types.CompletionItemKind.Function + }))); + } + if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.OBJECT_TYPE_EXTENSION) { + return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(type => (0, _graphql.isObjectType)(type) && !type.name.startsWith('__')).map(type => ({ + label: type.name, + kind: _types.CompletionItemKind.Function + }))); + } + if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.INTERFACE_TYPE_EXTENSION) { + return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(_graphql.isInterfaceType).map(type => ({ + label: type.name, + kind: _types.CompletionItemKind.Function + }))); + } + if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.UNION_TYPE_EXTENSION) { + return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(_graphql.isUnionType).map(type => ({ + label: type.name, + kind: _types.CompletionItemKind.Function + }))); + } + if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.ENUM_TYPE_EXTENSION) { + return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(type => (0, _graphql.isEnumType)(type) && !type.name.startsWith('__')).map(type => ({ + label: type.name, + kind: _types.CompletionItemKind.Function + }))); + } + if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION) { + return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(_graphql.isInputObjectType).map(type => ({ + label: type.name, + kind: _types.CompletionItemKind.Function + }))); + } + if (kind === _parser.RuleKinds.IMPLEMENTS || kind === _parser.RuleKinds.NAMED_TYPE && (prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _parser.RuleKinds.IMPLEMENTS) { + return getSuggestionsForImplements(token, state, schema, queryText, typeInfo); + } + if (kind === _parser.RuleKinds.SELECTION_SET || kind === _parser.RuleKinds.FIELD || kind === _parser.RuleKinds.ALIASED_FIELD) { + return getSuggestionsForFieldNames(token, typeInfo, opts); + } + if (kind === _parser.RuleKinds.ARGUMENTS || kind === _parser.RuleKinds.ARGUMENT && step === 0) { + const { + argDefs + } = typeInfo; + if (argDefs) { + return (0, _autocompleteUtils.hintList)(token, argDefs.map(argDef => { + var _a; + return { + label: argDef.name, + insertText: argDef.name + ': ', + command: SuggestionCommand, + detail: String(argDef.type), + documentation: (_a = argDef.description) !== null && _a !== void 0 ? _a : undefined, + kind: _types.CompletionItemKind.Variable, + type: argDef.type + }; + })); + } + } + if ((kind === _parser.RuleKinds.OBJECT_VALUE || kind === _parser.RuleKinds.OBJECT_FIELD && step === 0) && typeInfo.objectFieldDefs) { + const objectFields = (0, _autocompleteUtils.objectValues)(typeInfo.objectFieldDefs); + const completionKind = kind === _parser.RuleKinds.OBJECT_VALUE ? _types.CompletionItemKind.Value : _types.CompletionItemKind.Field; + return (0, _autocompleteUtils.hintList)(token, objectFields.map(field => { + var _a; + return { + label: field.name, + detail: String(field.type), + documentation: (_a = field.description) !== null && _a !== void 0 ? _a : undefined, + kind: completionKind, + type: field.type + }; + })); + } + if (kind === _parser.RuleKinds.ENUM_VALUE || kind === _parser.RuleKinds.LIST_VALUE && step === 1 || kind === _parser.RuleKinds.OBJECT_FIELD && step === 2 || kind === _parser.RuleKinds.ARGUMENT && step === 2) { + return getSuggestionsForInputValues(token, typeInfo, queryText, schema); + } + if (kind === _parser.RuleKinds.VARIABLE && step === 1) { + const namedInputType = (0, _graphql.getNamedType)(typeInfo.inputType); + const variableDefinitions = getVariableCompletions(queryText, schema, token); + return (0, _autocompleteUtils.hintList)(token, variableDefinitions.filter(v => v.detail === (namedInputType === null || namedInputType === void 0 ? void 0 : namedInputType.name))); + } + if (kind === _parser.RuleKinds.TYPE_CONDITION && step === 1 || kind === _parser.RuleKinds.NAMED_TYPE && prevState != null && prevState.kind === _parser.RuleKinds.TYPE_CONDITION) { + return getSuggestionsForFragmentTypeConditions(token, typeInfo, schema, kind); + } + if (kind === _parser.RuleKinds.FRAGMENT_SPREAD && step === 1) { + return getSuggestionsForFragmentSpread(token, typeInfo, schema, queryText, Array.isArray(fragmentDefs) ? fragmentDefs : collectFragmentDefs(fragmentDefs)); + } + const unwrappedState = unwrapType(state); + if (mode === GraphQLDocumentMode.TYPE_SYSTEM && !unwrappedState.needsAdvance && kind === _parser.RuleKinds.NAMED_TYPE || kind === _parser.RuleKinds.LIST_TYPE) { + if (unwrappedState.kind === _parser.RuleKinds.FIELD_DEF) { + return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(type => (0, _graphql.isOutputType)(type) && !type.name.startsWith('__')).map(type => ({ + label: type.name, + kind: _types.CompletionItemKind.Function + }))); + } + if (unwrappedState.kind === _parser.RuleKinds.INPUT_VALUE_DEF) { + return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(type => (0, _graphql.isInputType)(type) && !type.name.startsWith('__')).map(type => ({ + label: type.name, + kind: _types.CompletionItemKind.Function + }))); + } + } + if (kind === _parser.RuleKinds.VARIABLE_DEFINITION && step === 2 || kind === _parser.RuleKinds.LIST_TYPE && step === 1 || kind === _parser.RuleKinds.NAMED_TYPE && prevState && (prevState.kind === _parser.RuleKinds.VARIABLE_DEFINITION || prevState.kind === _parser.RuleKinds.LIST_TYPE || prevState.kind === _parser.RuleKinds.NON_NULL_TYPE)) { + return getSuggestionsForVariableDefinition(token, schema, kind); + } + if (kind === _parser.RuleKinds.DIRECTIVE) { + return getSuggestionsForDirective(token, state, schema, kind); + } + return []; +} +const insertSuffix = ' {\n $1\n}'; +const getInsertText = field => { + const { + type + } = field; + if ((0, _graphql.isCompositeType)(type)) { + return insertSuffix; + } + if ((0, _graphql.isListType)(type) && (0, _graphql.isCompositeType)(type.ofType)) { + return insertSuffix; + } + if ((0, _graphql.isNonNullType)(type)) { + if ((0, _graphql.isCompositeType)(type.ofType)) { + return insertSuffix; + } + if ((0, _graphql.isListType)(type.ofType) && (0, _graphql.isCompositeType)(type.ofType.ofType)) { + return insertSuffix; + } + } + return null; +}; +function getSuggestionsForTypeSystemDefinitions(token) { + return (0, _autocompleteUtils.hintList)(token, [{ + label: 'extend', + kind: _types.CompletionItemKind.Function + }, { + label: 'type', + kind: _types.CompletionItemKind.Function + }, { + label: 'interface', + kind: _types.CompletionItemKind.Function + }, { + label: 'union', + kind: _types.CompletionItemKind.Function + }, { + label: 'input', + kind: _types.CompletionItemKind.Function + }, { + label: 'scalar', + kind: _types.CompletionItemKind.Function + }, { + label: 'schema', + kind: _types.CompletionItemKind.Function + }]); +} +function getSuggestionsForExecutableDefinitions(token) { + return (0, _autocompleteUtils.hintList)(token, [{ + label: 'query', + kind: _types.CompletionItemKind.Function + }, { + label: 'mutation', + kind: _types.CompletionItemKind.Function + }, { + label: 'subscription', + kind: _types.CompletionItemKind.Function + }, { + label: 'fragment', + kind: _types.CompletionItemKind.Function + }, { + label: '{', + kind: _types.CompletionItemKind.Constructor + }]); +} +function getSuggestionsForExtensionDefinitions(token) { + return (0, _autocompleteUtils.hintList)(token, [{ + label: 'type', + kind: _types.CompletionItemKind.Function + }, { + label: 'interface', + kind: _types.CompletionItemKind.Function + }, { + label: 'union', + kind: _types.CompletionItemKind.Function + }, { + label: 'input', + kind: _types.CompletionItemKind.Function + }, { + label: 'scalar', + kind: _types.CompletionItemKind.Function + }, { + label: 'schema', + kind: _types.CompletionItemKind.Function + }]); +} +function getSuggestionsForFieldNames(token, typeInfo, options) { + var _a; + if (typeInfo.parentType) { + const { + parentType + } = typeInfo; + let fields = []; + if ('getFields' in parentType) { + fields = (0, _autocompleteUtils.objectValues)(parentType.getFields()); + } + if ((0, _graphql.isCompositeType)(parentType)) { + fields.push(_graphql.TypeNameMetaFieldDef); + } + if (parentType === ((_a = options === null || options === void 0 ? void 0 : options.schema) === null || _a === void 0 ? void 0 : _a.getQueryType())) { + fields.push(_graphql.SchemaMetaFieldDef, _graphql.TypeMetaFieldDef); + } + return (0, _autocompleteUtils.hintList)(token, fields.map((field, index) => { + var _a; + const suggestion = { + sortText: String(index) + field.name, + label: field.name, + detail: String(field.type), + documentation: (_a = field.description) !== null && _a !== void 0 ? _a : undefined, + deprecated: Boolean(field.deprecationReason), + isDeprecated: Boolean(field.deprecationReason), + deprecationReason: field.deprecationReason, + kind: _types.CompletionItemKind.Field, + type: field.type + }; + if (options === null || options === void 0 ? void 0 : options.fillLeafsOnComplete) { + const insertText = getInsertText(field); + if (insertText) { + suggestion.insertText = field.name + insertText; + suggestion.insertTextFormat = _types.InsertTextFormat.Snippet; + suggestion.command = SuggestionCommand; + } + } + return suggestion; + })); + } + return []; +} +function getSuggestionsForInputValues(token, typeInfo, queryText, schema) { + const namedInputType = (0, _graphql.getNamedType)(typeInfo.inputType); + const queryVariables = getVariableCompletions(queryText, schema, token).filter(v => v.detail === namedInputType.name); + if (namedInputType instanceof _graphql.GraphQLEnumType) { + const values = namedInputType.getValues(); + return (0, _autocompleteUtils.hintList)(token, values.map(value => { + var _a; + return { + label: value.name, + detail: String(namedInputType), + documentation: (_a = value.description) !== null && _a !== void 0 ? _a : undefined, + deprecated: Boolean(value.deprecationReason), + isDeprecated: Boolean(value.deprecationReason), + deprecationReason: value.deprecationReason, + kind: _types.CompletionItemKind.EnumMember, + type: namedInputType + }; + }).concat(queryVariables)); + } + if (namedInputType === _graphql.GraphQLBoolean) { + return (0, _autocompleteUtils.hintList)(token, queryVariables.concat([{ + label: 'true', + detail: String(_graphql.GraphQLBoolean), + documentation: 'Not false.', + kind: _types.CompletionItemKind.Variable, + type: _graphql.GraphQLBoolean + }, { + label: 'false', + detail: String(_graphql.GraphQLBoolean), + documentation: 'Not true.', + kind: _types.CompletionItemKind.Variable, + type: _graphql.GraphQLBoolean + }])); + } + return queryVariables; +} +function getSuggestionsForImplements(token, tokenState, schema, documentText, typeInfo) { + if (tokenState.needsSeparator) { + return []; + } + const typeMap = schema.getTypeMap(); + const schemaInterfaces = (0, _autocompleteUtils.objectValues)(typeMap).filter(_graphql.isInterfaceType); + const schemaInterfaceNames = schemaInterfaces.map(_ref => { + let { + name + } = _ref; + return name; + }); + const inlineInterfaces = new Set(); + runOnlineParser(documentText, (_, state) => { + var _a, _b, _c, _d, _e; + if (state.name) { + if (state.kind === _parser.RuleKinds.INTERFACE_DEF && !schemaInterfaceNames.includes(state.name)) { + inlineInterfaces.add(state.name); + } + if (state.kind === _parser.RuleKinds.NAMED_TYPE && ((_a = state.prevState) === null || _a === void 0 ? void 0 : _a.kind) === _parser.RuleKinds.IMPLEMENTS) { + if (typeInfo.interfaceDef) { + const existingType = (_b = typeInfo.interfaceDef) === null || _b === void 0 ? void 0 : _b.getInterfaces().find(_ref2 => { + let { + name + } = _ref2; + return name === state.name; + }); + if (existingType) { + return; + } + const type = schema.getType(state.name); + const interfaceConfig = (_c = typeInfo.interfaceDef) === null || _c === void 0 ? void 0 : _c.toConfig(); + typeInfo.interfaceDef = new _graphql.GraphQLInterfaceType(Object.assign(Object.assign({}, interfaceConfig), { + interfaces: [...interfaceConfig.interfaces, type || new _graphql.GraphQLInterfaceType({ + name: state.name, + fields: {} + })] + })); + } else if (typeInfo.objectTypeDef) { + const existingType = (_d = typeInfo.objectTypeDef) === null || _d === void 0 ? void 0 : _d.getInterfaces().find(_ref3 => { + let { + name + } = _ref3; + return name === state.name; + }); + if (existingType) { + return; + } + const type = schema.getType(state.name); + const objectTypeConfig = (_e = typeInfo.objectTypeDef) === null || _e === void 0 ? void 0 : _e.toConfig(); + typeInfo.objectTypeDef = new _graphql.GraphQLObjectType(Object.assign(Object.assign({}, objectTypeConfig), { + interfaces: [...objectTypeConfig.interfaces, type || new _graphql.GraphQLInterfaceType({ + name: state.name, + fields: {} + })] + })); + } + } + } + }); + const currentTypeToExtend = typeInfo.interfaceDef || typeInfo.objectTypeDef; + const siblingInterfaces = (currentTypeToExtend === null || currentTypeToExtend === void 0 ? void 0 : currentTypeToExtend.getInterfaces()) || []; + const siblingInterfaceNames = siblingInterfaces.map(_ref4 => { + let { + name + } = _ref4; + return name; + }); + const possibleInterfaces = schemaInterfaces.concat([...inlineInterfaces].map(name => ({ + name + }))).filter(_ref5 => { + let { + name + } = _ref5; + return name !== (currentTypeToExtend === null || currentTypeToExtend === void 0 ? void 0 : currentTypeToExtend.name) && !siblingInterfaceNames.includes(name); + }); + return (0, _autocompleteUtils.hintList)(token, possibleInterfaces.map(type => { + const result = { + label: type.name, + kind: _types.CompletionItemKind.Interface, + type + }; + if (type === null || type === void 0 ? void 0 : type.description) { + result.documentation = type.description; + } + return result; + })); +} +function getSuggestionsForFragmentTypeConditions(token, typeInfo, schema, _kind) { + let possibleTypes; + if (typeInfo.parentType) { + if ((0, _graphql.isAbstractType)(typeInfo.parentType)) { + const abstractType = (0, _graphql.assertAbstractType)(typeInfo.parentType); + const possibleObjTypes = schema.getPossibleTypes(abstractType); + const possibleIfaceMap = Object.create(null); + for (const type of possibleObjTypes) { + for (const iface of type.getInterfaces()) { + possibleIfaceMap[iface.name] = iface; + } + } + possibleTypes = possibleObjTypes.concat((0, _autocompleteUtils.objectValues)(possibleIfaceMap)); + } else { + possibleTypes = [typeInfo.parentType]; + } + } else { + const typeMap = schema.getTypeMap(); + possibleTypes = (0, _autocompleteUtils.objectValues)(typeMap).filter(type => (0, _graphql.isCompositeType)(type) && !type.name.startsWith('__')); + } + return (0, _autocompleteUtils.hintList)(token, possibleTypes.map(type => { + const namedType = (0, _graphql.getNamedType)(type); + return { + label: String(type), + documentation: (namedType === null || namedType === void 0 ? void 0 : namedType.description) || '', + kind: _types.CompletionItemKind.Field + }; + })); +} +function getSuggestionsForFragmentSpread(token, typeInfo, schema, queryText, fragmentDefs) { + if (!queryText) { + return []; + } + const typeMap = schema.getTypeMap(); + const defState = (0, _autocompleteUtils.getDefinitionState)(token.state); + const fragments = getFragmentDefinitions(queryText); + if (fragmentDefs && fragmentDefs.length > 0) { + fragments.push(...fragmentDefs); + } + const relevantFrags = fragments.filter(frag => typeMap[frag.typeCondition.name.value] && !(defState && defState.kind === _parser.RuleKinds.FRAGMENT_DEFINITION && defState.name === frag.name.value) && (0, _graphql.isCompositeType)(typeInfo.parentType) && (0, _graphql.isCompositeType)(typeMap[frag.typeCondition.name.value]) && (0, _graphql.doTypesOverlap)(schema, typeInfo.parentType, typeMap[frag.typeCondition.name.value])); + return (0, _autocompleteUtils.hintList)(token, relevantFrags.map(frag => ({ + label: frag.name.value, + detail: String(typeMap[frag.typeCondition.name.value]), + documentation: `fragment ${frag.name.value} on ${frag.typeCondition.name.value}`, + kind: _types.CompletionItemKind.Field, + type: typeMap[frag.typeCondition.name.value] + }))); +} +const getParentDefinition = (state, kind) => { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; + if (((_a = state.prevState) === null || _a === void 0 ? void 0 : _a.kind) === kind) { + return state.prevState; + } + if (((_c = (_b = state.prevState) === null || _b === void 0 ? void 0 : _b.prevState) === null || _c === void 0 ? void 0 : _c.kind) === kind) { + return state.prevState.prevState; + } + if (((_f = (_e = (_d = state.prevState) === null || _d === void 0 ? void 0 : _d.prevState) === null || _e === void 0 ? void 0 : _e.prevState) === null || _f === void 0 ? void 0 : _f.kind) === kind) { + return state.prevState.prevState.prevState; + } + if (((_k = (_j = (_h = (_g = state.prevState) === null || _g === void 0 ? void 0 : _g.prevState) === null || _h === void 0 ? void 0 : _h.prevState) === null || _j === void 0 ? void 0 : _j.prevState) === null || _k === void 0 ? void 0 : _k.kind) === kind) { + return state.prevState.prevState.prevState.prevState; + } +}; +function getVariableCompletions(queryText, schema, token) { + let variableName = null; + let variableType; + const definitions = Object.create({}); + runOnlineParser(queryText, (_, state) => { + if ((state === null || state === void 0 ? void 0 : state.kind) === _parser.RuleKinds.VARIABLE && state.name) { + variableName = state.name; + } + if ((state === null || state === void 0 ? void 0 : state.kind) === _parser.RuleKinds.NAMED_TYPE && variableName) { + const parentDefinition = getParentDefinition(state, _parser.RuleKinds.TYPE); + if (parentDefinition === null || parentDefinition === void 0 ? void 0 : parentDefinition.type) { + variableType = schema.getType(parentDefinition === null || parentDefinition === void 0 ? void 0 : parentDefinition.type); + } + } + if (variableName && variableType && !definitions[variableName]) { + definitions[variableName] = { + detail: variableType.toString(), + insertText: token.string === '$' ? variableName : '$' + variableName, + label: variableName, + type: variableType, + kind: _types.CompletionItemKind.Variable + }; + variableName = null; + variableType = null; + } + }); + return (0, _autocompleteUtils.objectValues)(definitions); +} +function getFragmentDefinitions(queryText) { + const fragmentDefs = []; + runOnlineParser(queryText, (_, state) => { + if (state.kind === _parser.RuleKinds.FRAGMENT_DEFINITION && state.name && state.type) { + fragmentDefs.push({ + kind: _parser.RuleKinds.FRAGMENT_DEFINITION, + name: { + kind: _graphql.Kind.NAME, + value: state.name + }, + selectionSet: { + kind: _parser.RuleKinds.SELECTION_SET, + selections: [] + }, + typeCondition: { + kind: _parser.RuleKinds.NAMED_TYPE, + name: { + kind: _graphql.Kind.NAME, + value: state.type + } + } + }); + } + }); + return fragmentDefs; +} +function getSuggestionsForVariableDefinition(token, schema, _kind) { + const inputTypeMap = schema.getTypeMap(); + const inputTypes = (0, _autocompleteUtils.objectValues)(inputTypeMap).filter(_graphql.isInputType); + return (0, _autocompleteUtils.hintList)(token, inputTypes.map(type => ({ + label: type.name, + documentation: type.description, + kind: _types.CompletionItemKind.Variable + }))); +} +function getSuggestionsForDirective(token, state, schema, _kind) { + var _a; + if ((_a = state.prevState) === null || _a === void 0 ? void 0 : _a.kind) { + const directives = schema.getDirectives().filter(directive => canUseDirective(state.prevState, directive)); + return (0, _autocompleteUtils.hintList)(token, directives.map(directive => ({ + label: directive.name, + documentation: directive.description || '', + kind: _types.CompletionItemKind.Function + }))); + } + return []; +} +function getTokenAtPosition(queryText, cursor) { + let offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + let styleAtCursor = null; + let stateAtCursor = null; + let stringAtCursor = null; + const token = runOnlineParser(queryText, (stream, state, style, index) => { + if (index !== cursor.line || stream.getCurrentPosition() + offset < cursor.character + 1) { + return; + } + styleAtCursor = style; + stateAtCursor = Object.assign({}, state); + stringAtCursor = stream.current(); + return 'BREAK'; + }); + return { + start: token.start, + end: token.end, + string: stringAtCursor || token.string, + state: stateAtCursor || token.state, + style: styleAtCursor || token.style + }; +} +function runOnlineParser(queryText, callback) { + const lines = queryText.split('\n'); + const parser = (0, _parser.onlineParser)(); + let state = parser.startState(); + let style = ''; + let stream = new _parser.CharacterStream(''); + for (let i = 0; i < lines.length; i++) { + stream = new _parser.CharacterStream(lines[i]); + while (!stream.eol()) { + style = parser.token(stream, state); + const code = callback(stream, state, style, i); + if (code === 'BREAK') { + break; + } + } + callback(stream, state, style, i); + if (!state.kind) { + state = parser.startState(); + } + } + return { + start: stream.getStartOfToken(), + end: stream.getCurrentPosition(), + string: stream.current(), + state, + style + }; +} +function canUseDirective(state, directive) { + if (!(state === null || state === void 0 ? void 0 : state.kind)) { + return false; + } + const { + kind, + prevState + } = state; + const { + locations + } = directive; + switch (kind) { + case _parser.RuleKinds.QUERY: + return locations.includes(_graphql.DirectiveLocation.QUERY); + case _parser.RuleKinds.MUTATION: + return locations.includes(_graphql.DirectiveLocation.MUTATION); + case _parser.RuleKinds.SUBSCRIPTION: + return locations.includes(_graphql.DirectiveLocation.SUBSCRIPTION); + case _parser.RuleKinds.FIELD: + case _parser.RuleKinds.ALIASED_FIELD: + return locations.includes(_graphql.DirectiveLocation.FIELD); + case _parser.RuleKinds.FRAGMENT_DEFINITION: + return locations.includes(_graphql.DirectiveLocation.FRAGMENT_DEFINITION); + case _parser.RuleKinds.FRAGMENT_SPREAD: + return locations.includes(_graphql.DirectiveLocation.FRAGMENT_SPREAD); + case _parser.RuleKinds.INLINE_FRAGMENT: + return locations.includes(_graphql.DirectiveLocation.INLINE_FRAGMENT); + case _parser.RuleKinds.SCHEMA_DEF: + return locations.includes(_graphql.DirectiveLocation.SCHEMA); + case _parser.RuleKinds.SCALAR_DEF: + return locations.includes(_graphql.DirectiveLocation.SCALAR); + case _parser.RuleKinds.OBJECT_TYPE_DEF: + return locations.includes(_graphql.DirectiveLocation.OBJECT); + case _parser.RuleKinds.FIELD_DEF: + return locations.includes(_graphql.DirectiveLocation.FIELD_DEFINITION); + case _parser.RuleKinds.INTERFACE_DEF: + return locations.includes(_graphql.DirectiveLocation.INTERFACE); + case _parser.RuleKinds.UNION_DEF: + return locations.includes(_graphql.DirectiveLocation.UNION); + case _parser.RuleKinds.ENUM_DEF: + return locations.includes(_graphql.DirectiveLocation.ENUM); + case _parser.RuleKinds.ENUM_VALUE: + return locations.includes(_graphql.DirectiveLocation.ENUM_VALUE); + case _parser.RuleKinds.INPUT_DEF: + return locations.includes(_graphql.DirectiveLocation.INPUT_OBJECT); + case _parser.RuleKinds.INPUT_VALUE_DEF: + const prevStateKind = prevState === null || prevState === void 0 ? void 0 : prevState.kind; + switch (prevStateKind) { + case _parser.RuleKinds.ARGUMENTS_DEF: + return locations.includes(_graphql.DirectiveLocation.ARGUMENT_DEFINITION); + case _parser.RuleKinds.INPUT_DEF: + return locations.includes(_graphql.DirectiveLocation.INPUT_FIELD_DEFINITION); + } + } + return false; +} +function getTypeInfo(schema, tokenState) { + let argDef; + let argDefs; + let directiveDef; + let enumValue; + let fieldDef; + let inputType; + let objectTypeDef; + let objectFieldDefs; + let parentType; + let type; + let interfaceDef; + (0, _autocompleteUtils.forEachState)(tokenState, state => { + var _a; + switch (state.kind) { + case _parser.RuleKinds.QUERY: + case 'ShortQuery': + type = schema.getQueryType(); + break; + case _parser.RuleKinds.MUTATION: + type = schema.getMutationType(); + break; + case _parser.RuleKinds.SUBSCRIPTION: + type = schema.getSubscriptionType(); + break; + case _parser.RuleKinds.INLINE_FRAGMENT: + case _parser.RuleKinds.FRAGMENT_DEFINITION: + if (state.type) { + type = schema.getType(state.type); + } + break; + case _parser.RuleKinds.FIELD: + case _parser.RuleKinds.ALIASED_FIELD: + { + if (!type || !state.name) { + fieldDef = null; + } else { + fieldDef = parentType ? (0, _autocompleteUtils.getFieldDef)(schema, parentType, state.name) : null; + type = fieldDef ? fieldDef.type : null; + } + break; + } + case _parser.RuleKinds.SELECTION_SET: + parentType = (0, _graphql.getNamedType)(type); + break; + case _parser.RuleKinds.DIRECTIVE: + directiveDef = state.name ? schema.getDirective(state.name) : null; + break; + case _parser.RuleKinds.INTERFACE_DEF: + if (state.name) { + objectTypeDef = null; + interfaceDef = new _graphql.GraphQLInterfaceType({ + name: state.name, + interfaces: [], + fields: {} + }); + } + break; + case _parser.RuleKinds.OBJECT_TYPE_DEF: + if (state.name) { + interfaceDef = null; + objectTypeDef = new _graphql.GraphQLObjectType({ + name: state.name, + interfaces: [], + fields: {} + }); + } + break; + case _parser.RuleKinds.ARGUMENTS: + { + if (state.prevState) { + switch (state.prevState.kind) { + case _parser.RuleKinds.FIELD: + argDefs = fieldDef && fieldDef.args; + break; + case _parser.RuleKinds.DIRECTIVE: + argDefs = directiveDef && directiveDef.args; + break; + case _parser.RuleKinds.ALIASED_FIELD: + { + const name = (_a = state.prevState) === null || _a === void 0 ? void 0 : _a.name; + if (!name) { + argDefs = null; + break; + } + const field = parentType ? (0, _autocompleteUtils.getFieldDef)(schema, parentType, name) : null; + if (!field) { + argDefs = null; + break; + } + argDefs = field.args; + break; + } + default: + argDefs = null; + break; + } + } else { + argDefs = null; + } + break; + } + case _parser.RuleKinds.ARGUMENT: + if (argDefs) { + for (let i = 0; i < argDefs.length; i++) { + if (argDefs[i].name === state.name) { + argDef = argDefs[i]; + break; + } + } + } + inputType = argDef === null || argDef === void 0 ? void 0 : argDef.type; + break; + case _parser.RuleKinds.ENUM_VALUE: + const enumType = (0, _graphql.getNamedType)(inputType); + enumValue = enumType instanceof _graphql.GraphQLEnumType ? enumType.getValues().find(val => val.value === state.name) : null; + break; + case _parser.RuleKinds.LIST_VALUE: + const nullableType = (0, _graphql.getNullableType)(inputType); + inputType = nullableType instanceof _graphql.GraphQLList ? nullableType.ofType : null; + break; + case _parser.RuleKinds.OBJECT_VALUE: + const objectType = (0, _graphql.getNamedType)(inputType); + objectFieldDefs = objectType instanceof _graphql.GraphQLInputObjectType ? objectType.getFields() : null; + break; + case _parser.RuleKinds.OBJECT_FIELD: + const objectField = state.name && objectFieldDefs ? objectFieldDefs[state.name] : null; + inputType = objectField === null || objectField === void 0 ? void 0 : objectField.type; + break; + case _parser.RuleKinds.NAMED_TYPE: + if (state.name) { + type = schema.getType(state.name); + } + break; + } + }); + return { + argDef, + argDefs, + directiveDef, + enumValue, + fieldDef, + inputType, + objectFieldDefs, + parentType, + type, + interfaceDef, + objectTypeDef + }; +} +var GraphQLDocumentMode; +exports.GraphQLDocumentMode = GraphQLDocumentMode; +(function (GraphQLDocumentMode) { + GraphQLDocumentMode["TYPE_SYSTEM"] = "TYPE_SYSTEM"; + GraphQLDocumentMode["EXECUTABLE"] = "EXECUTABLE"; +})(GraphQLDocumentMode || (exports.GraphQLDocumentMode = GraphQLDocumentMode = {})); +function getDocumentMode(documentText, uri) { + if (uri === null || uri === void 0 ? void 0 : uri.endsWith('.graphqls')) { + return GraphQLDocumentMode.TYPE_SYSTEM; + } + return hasTypeSystemDefinitions(documentText) ? GraphQLDocumentMode.TYPE_SYSTEM : GraphQLDocumentMode.EXECUTABLE; +} +function unwrapType(state) { + if (state.prevState && state.kind && [_parser.RuleKinds.NAMED_TYPE, _parser.RuleKinds.LIST_TYPE, _parser.RuleKinds.TYPE, _parser.RuleKinds.NON_NULL_TYPE].includes(state.kind)) { + return unwrapType(state.prevState); + } + return state; +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/interface/getDefinition.js": +/*!*********************************************************************!*\ + !*** ../../graphql-language-service/esm/interface/getDefinition.js ***! + \*********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.LANGUAGE = void 0; +exports.getDefinitionQueryResultForDefinitionNode = getDefinitionQueryResultForDefinitionNode; +exports.getDefinitionQueryResultForField = getDefinitionQueryResultForField; +exports.getDefinitionQueryResultForFragmentSpread = getDefinitionQueryResultForFragmentSpread; +exports.getDefinitionQueryResultForNamedType = getDefinitionQueryResultForNamedType; +var _utils = __webpack_require__(/*! ../utils */ "../../graphql-language-service/esm/utils/index.js"); +var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +const LANGUAGE = 'GraphQL'; +exports.LANGUAGE = LANGUAGE; +function assert(value, message) { + if (!value) { + throw new Error(message); + } +} +function getRange(text, node) { + const location = node.loc; + assert(location, 'Expected ASTNode to have a location.'); + return (0, _utils.locToRange)(text, location); +} +function getPosition(text, node) { + const location = node.loc; + assert(location, 'Expected ASTNode to have a location.'); + return (0, _utils.offsetToPosition)(text, location.start); +} +function getDefinitionQueryResultForNamedType(text, node, dependencies) { + return __awaiter(this, void 0, void 0, function* () { + const name = node.name.value; + const defNodes = dependencies.filter(_ref => { + let { + definition + } = _ref; + return definition.name && definition.name.value === name; + }); + if (defNodes.length === 0) { + throw new Error(`Definition not found for GraphQL type ${name}`); + } + const definitions = defNodes.map(_ref2 => { + let { + filePath, + content, + definition + } = _ref2; + return getDefinitionForNodeDefinition(filePath || '', content, definition); + }); + return { + definitions, + queryRange: definitions.map(_ => getRange(text, node)) + }; + }); +} +function getDefinitionQueryResultForField(fieldName, typeName, dependencies) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + const defNodes = dependencies.filter(_ref3 => { + let { + definition + } = _ref3; + return definition.name && definition.name.value === typeName; + }); + if (defNodes.length === 0) { + throw new Error(`Definition not found for GraphQL type ${typeName}`); + } + const definitions = []; + for (const { + filePath, + content, + definition + } of defNodes) { + const fieldDefinition = (_a = definition.fields) === null || _a === void 0 ? void 0 : _a.find(item => item.name.value === fieldName); + if (fieldDefinition == null) { + continue; + } + definitions.push(getDefinitionForFieldDefinition(filePath || '', content, fieldDefinition)); + } + return { + definitions, + queryRange: [] + }; + }); +} +function getDefinitionQueryResultForFragmentSpread(text, fragment, dependencies) { + return __awaiter(this, void 0, void 0, function* () { + const name = fragment.name.value; + const defNodes = dependencies.filter(_ref4 => { + let { + definition + } = _ref4; + return definition.name.value === name; + }); + if (defNodes.length === 0) { + throw new Error(`Definition not found for GraphQL fragment ${name}`); + } + const definitions = defNodes.map(_ref5 => { + let { + filePath, + content, + definition + } = _ref5; + return getDefinitionForFragmentDefinition(filePath || '', content, definition); + }); + return { + definitions, + queryRange: definitions.map(_ => getRange(text, fragment)) + }; + }); +} +function getDefinitionQueryResultForDefinitionNode(path, text, definition) { + return { + definitions: [getDefinitionForFragmentDefinition(path, text, definition)], + queryRange: definition.name ? [getRange(text, definition.name)] : [] + }; +} +function getDefinitionForFragmentDefinition(path, text, definition) { + const { + name + } = definition; + if (!name) { + throw new Error('Expected ASTNode to have a Name.'); + } + return { + path, + position: getPosition(text, definition), + range: getRange(text, definition), + name: name.value || '', + language: LANGUAGE, + projectRoot: path + }; +} +function getDefinitionForNodeDefinition(path, text, definition) { + const { + name + } = definition; + assert(name, 'Expected ASTNode to have a Name.'); + return { + path, + position: getPosition(text, definition), + range: getRange(text, definition), + name: name.value || '', + language: LANGUAGE, + projectRoot: path + }; +} +function getDefinitionForFieldDefinition(path, text, definition) { + const { + name + } = definition; + assert(name, 'Expected ASTNode to have a Name.'); + return { + path, + position: getPosition(text, definition), + range: getRange(text, definition), + name: name.value || '', + language: LANGUAGE, + projectRoot: path + }; +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/interface/getDiagnostics.js": +/*!**********************************************************************!*\ + !*** ../../graphql-language-service/esm/interface/getDiagnostics.js ***! + \**********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.SEVERITY = exports.DIAGNOSTIC_SEVERITY = void 0; +exports.getDiagnostics = getDiagnostics; +exports.getRange = getRange; +exports.validateQuery = validateQuery; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _parser = __webpack_require__(/*! ../parser */ "../../graphql-language-service/esm/parser/index.js"); +var _utils = __webpack_require__(/*! ../utils */ "../../graphql-language-service/esm/utils/index.js"); +const SEVERITY = { + Error: 'Error', + Warning: 'Warning', + Information: 'Information', + Hint: 'Hint' +}; +exports.SEVERITY = SEVERITY; +const DIAGNOSTIC_SEVERITY = { + [SEVERITY.Error]: 1, + [SEVERITY.Warning]: 2, + [SEVERITY.Information]: 3, + [SEVERITY.Hint]: 4 +}; +exports.DIAGNOSTIC_SEVERITY = DIAGNOSTIC_SEVERITY; +const invariant = (condition, message) => { + if (!condition) { + throw new Error(message); + } +}; +function getDiagnostics(query) { + let schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let customRules = arguments.length > 2 ? arguments[2] : undefined; + let isRelayCompatMode = arguments.length > 3 ? arguments[3] : undefined; + let externalFragments = arguments.length > 4 ? arguments[4] : undefined; + var _a, _b; + let ast = null; + let fragments = ''; + if (externalFragments) { + fragments = typeof externalFragments === 'string' ? externalFragments : externalFragments.reduce((acc, node) => acc + (0, _graphql.print)(node) + '\n\n', ''); + } + const enhancedQuery = fragments ? `${query}\n\n${fragments}` : query; + try { + ast = (0, _graphql.parse)(enhancedQuery); + } catch (error) { + if (error instanceof _graphql.GraphQLError) { + const range = getRange((_b = (_a = error.locations) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : { + line: 0, + column: 0 + }, enhancedQuery); + return [{ + severity: DIAGNOSTIC_SEVERITY.Error, + message: error.message, + source: 'GraphQL: Syntax', + range + }]; + } + throw error; + } + return validateQuery(ast, schema, customRules, isRelayCompatMode); +} +function validateQuery(ast) { + let schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let customRules = arguments.length > 2 ? arguments[2] : undefined; + let isRelayCompatMode = arguments.length > 3 ? arguments[3] : undefined; + if (!schema) { + return []; + } + const validationErrorAnnotations = (0, _utils.validateWithCustomRules)(schema, ast, customRules, isRelayCompatMode).flatMap(error => annotations(error, DIAGNOSTIC_SEVERITY.Error, 'Validation')); + const deprecationWarningAnnotations = (0, _graphql.validate)(schema, ast, [_graphql.NoDeprecatedCustomRule]).flatMap(error => annotations(error, DIAGNOSTIC_SEVERITY.Warning, 'Deprecation')); + return validationErrorAnnotations.concat(deprecationWarningAnnotations); +} +function annotations(error, severity, type) { + if (!error.nodes) { + return []; + } + const highlightedNodes = []; + for (const [i, node] of error.nodes.entries()) { + const highlightNode = node.kind !== 'Variable' && 'name' in node && node.name !== undefined ? node.name : 'variable' in node && node.variable !== undefined ? node.variable : node; + if (highlightNode) { + invariant(error.locations, 'GraphQL validation error requires locations.'); + const loc = error.locations[i]; + const highlightLoc = getLocation(highlightNode); + const end = loc.column + (highlightLoc.end - highlightLoc.start); + highlightedNodes.push({ + source: `GraphQL: ${type}`, + message: error.message, + severity, + range: new _utils.Range(new _utils.Position(loc.line - 1, loc.column - 1), new _utils.Position(loc.line - 1, end)) + }); + } + } + return highlightedNodes; +} +function getRange(location, queryText) { + const parser = (0, _parser.onlineParser)(); + const state = parser.startState(); + const lines = queryText.split('\n'); + invariant(lines.length >= location.line, 'Query text must have more lines than where the error happened'); + let stream = null; + for (let i = 0; i < location.line; i++) { + stream = new _parser.CharacterStream(lines[i]); + while (!stream.eol()) { + const style = parser.token(stream, state); + if (style === 'invalidchar') { + break; + } + } + } + invariant(stream, 'Expected Parser stream to be available.'); + const line = location.line - 1; + const start = stream.getStartOfToken(); + const end = stream.getCurrentPosition(); + return new _utils.Range(new _utils.Position(line, start), new _utils.Position(line, end)); +} +function getLocation(node) { + const typeCastedNode = node; + const location = typeCastedNode.loc; + invariant(location, 'Expected ASTNode to have a location.'); + return location; +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/interface/getHoverInformation.js": +/*!***************************************************************************!*\ + !*** ../../graphql-language-service/esm/interface/getHoverInformation.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getHoverInformation = getHoverInformation; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _getAutocompleteSuggestions = __webpack_require__(/*! ./getAutocompleteSuggestions */ "../../graphql-language-service/esm/interface/getAutocompleteSuggestions.js"); +function getHoverInformation(schema, queryText, cursor, contextToken, config) { + const token = contextToken || (0, _getAutocompleteSuggestions.getTokenAtPosition)(queryText, cursor); + if (!schema || !token || !token.state) { + return ''; + } + const { + kind, + step + } = token.state; + const typeInfo = (0, _getAutocompleteSuggestions.getTypeInfo)(schema, token.state); + const options = Object.assign(Object.assign({}, config), { + schema + }); + if (kind === 'Field' && step === 0 && typeInfo.fieldDef || kind === 'AliasedField' && step === 2 && typeInfo.fieldDef) { + const into = []; + renderMdCodeStart(into, options); + renderField(into, typeInfo, options); + renderMdCodeEnd(into, options); + renderDescription(into, options, typeInfo.fieldDef); + return into.join('').trim(); + } + if (kind === 'Directive' && step === 1 && typeInfo.directiveDef) { + const into = []; + renderMdCodeStart(into, options); + renderDirective(into, typeInfo, options); + renderMdCodeEnd(into, options); + renderDescription(into, options, typeInfo.directiveDef); + return into.join('').trim(); + } + if (kind === 'Argument' && step === 0 && typeInfo.argDef) { + const into = []; + renderMdCodeStart(into, options); + renderArg(into, typeInfo, options); + renderMdCodeEnd(into, options); + renderDescription(into, options, typeInfo.argDef); + return into.join('').trim(); + } + if (kind === 'EnumValue' && typeInfo.enumValue && 'description' in typeInfo.enumValue) { + const into = []; + renderMdCodeStart(into, options); + renderEnumValue(into, typeInfo, options); + renderMdCodeEnd(into, options); + renderDescription(into, options, typeInfo.enumValue); + return into.join('').trim(); + } + if (kind === 'NamedType' && typeInfo.type && 'description' in typeInfo.type) { + const into = []; + renderMdCodeStart(into, options); + renderType(into, typeInfo, options, typeInfo.type); + renderMdCodeEnd(into, options); + renderDescription(into, options, typeInfo.type); + return into.join('').trim(); + } + return ''; +} +function renderMdCodeStart(into, options) { + if (options.useMarkdown) { + text(into, '```graphql\n'); + } +} +function renderMdCodeEnd(into, options) { + if (options.useMarkdown) { + text(into, '\n```'); + } +} +function renderField(into, typeInfo, options) { + renderQualifiedField(into, typeInfo, options); + renderTypeAnnotation(into, typeInfo, options, typeInfo.type); +} +function renderQualifiedField(into, typeInfo, options) { + if (!typeInfo.fieldDef) { + return; + } + const fieldName = typeInfo.fieldDef.name; + if (fieldName.slice(0, 2) !== '__') { + renderType(into, typeInfo, options, typeInfo.parentType); + text(into, '.'); + } + text(into, fieldName); +} +function renderDirective(into, typeInfo, _options) { + if (!typeInfo.directiveDef) { + return; + } + const name = '@' + typeInfo.directiveDef.name; + text(into, name); +} +function renderArg(into, typeInfo, options) { + if (typeInfo.directiveDef) { + renderDirective(into, typeInfo, options); + } else if (typeInfo.fieldDef) { + renderQualifiedField(into, typeInfo, options); + } + if (!typeInfo.argDef) { + return; + } + const { + name + } = typeInfo.argDef; + text(into, '('); + text(into, name); + renderTypeAnnotation(into, typeInfo, options, typeInfo.inputType); + text(into, ')'); +} +function renderTypeAnnotation(into, typeInfo, options, t) { + text(into, ': '); + renderType(into, typeInfo, options, t); +} +function renderEnumValue(into, typeInfo, options) { + if (!typeInfo.enumValue) { + return; + } + const { + name + } = typeInfo.enumValue; + renderType(into, typeInfo, options, typeInfo.inputType); + text(into, '.'); + text(into, name); +} +function renderType(into, typeInfo, options, t) { + if (!t) { + return; + } + if (t instanceof _graphql.GraphQLNonNull) { + renderType(into, typeInfo, options, t.ofType); + text(into, '!'); + } else if (t instanceof _graphql.GraphQLList) { + text(into, '['); + renderType(into, typeInfo, options, t.ofType); + text(into, ']'); + } else { + text(into, t.name); + } +} +function renderDescription(into, options, def) { + if (!def) { + return; + } + const description = typeof def.description === 'string' ? def.description : null; + if (description) { + text(into, '\n\n'); + text(into, description); + } + renderDeprecation(into, options, def); +} +function renderDeprecation(into, _options, def) { + if (!def) { + return; + } + const reason = def.deprecationReason || null; + if (!reason) { + return; + } + text(into, '\n\n'); + text(into, 'Deprecated: '); + text(into, reason); +} +function text(into, content) { + into.push(content); +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/interface/getOutline.js": +/*!******************************************************************!*\ + !*** ../../graphql-language-service/esm/interface/getOutline.js ***! + \******************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getOutline = getOutline; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _utils = __webpack_require__(/*! ../utils */ "../../graphql-language-service/esm/utils/index.js"); +const { + INLINE_FRAGMENT +} = _graphql.Kind; +const OUTLINEABLE_KINDS = { + Field: true, + OperationDefinition: true, + Document: true, + SelectionSet: true, + Name: true, + FragmentDefinition: true, + FragmentSpread: true, + InlineFragment: true, + ObjectTypeDefinition: true, + InputObjectTypeDefinition: true, + InterfaceTypeDefinition: true, + EnumTypeDefinition: true, + EnumValueDefinition: true, + InputValueDefinition: true, + FieldDefinition: true +}; +function getOutline(documentText) { + let ast; + try { + ast = (0, _graphql.parse)(documentText); + } catch (_a) { + return null; + } + const visitorFns = outlineTreeConverter(documentText); + const outlineTrees = (0, _graphql.visit)(ast, { + leave(node) { + if (visitorFns !== undefined && node.kind in visitorFns) { + return visitorFns[node.kind](node); + } + return null; + } + }); + return { + outlineTrees + }; +} +function outlineTreeConverter(docText) { + const meta = node => { + return { + representativeName: node.name, + startPosition: (0, _utils.offsetToPosition)(docText, node.loc.start), + endPosition: (0, _utils.offsetToPosition)(docText, node.loc.end), + kind: node.kind, + children: node.selectionSet || node.fields || node.values || node.arguments || [] + }; + }; + return { + Field(node) { + const tokenizedText = node.alias ? [buildToken('plain', node.alias), buildToken('plain', ': ')] : []; + tokenizedText.push(buildToken('plain', node.name)); + return Object.assign({ + tokenizedText + }, meta(node)); + }, + OperationDefinition: node => Object.assign({ + tokenizedText: [buildToken('keyword', node.operation), buildToken('whitespace', ' '), buildToken('class-name', node.name)] + }, meta(node)), + Document: node => node.definitions, + SelectionSet: node => concatMap(node.selections, child => { + return child.kind === INLINE_FRAGMENT ? child.selectionSet : child; + }), + Name: node => node.value, + FragmentDefinition: node => Object.assign({ + tokenizedText: [buildToken('keyword', 'fragment'), buildToken('whitespace', ' '), buildToken('class-name', node.name)] + }, meta(node)), + InterfaceTypeDefinition: node => Object.assign({ + tokenizedText: [buildToken('keyword', 'interface'), buildToken('whitespace', ' '), buildToken('class-name', node.name)] + }, meta(node)), + EnumTypeDefinition: node => Object.assign({ + tokenizedText: [buildToken('keyword', 'enum'), buildToken('whitespace', ' '), buildToken('class-name', node.name)] + }, meta(node)), + EnumValueDefinition: node => Object.assign({ + tokenizedText: [buildToken('plain', node.name)] + }, meta(node)), + ObjectTypeDefinition: node => Object.assign({ + tokenizedText: [buildToken('keyword', 'type'), buildToken('whitespace', ' '), buildToken('class-name', node.name)] + }, meta(node)), + InputObjectTypeDefinition: node => Object.assign({ + tokenizedText: [buildToken('keyword', 'input'), buildToken('whitespace', ' '), buildToken('class-name', node.name)] + }, meta(node)), + FragmentSpread: node => Object.assign({ + tokenizedText: [buildToken('plain', '...'), buildToken('class-name', node.name)] + }, meta(node)), + InputValueDefinition(node) { + return Object.assign({ + tokenizedText: [buildToken('plain', node.name)] + }, meta(node)); + }, + FieldDefinition(node) { + return Object.assign({ + tokenizedText: [buildToken('plain', node.name)] + }, meta(node)); + }, + InlineFragment: node => node.selectionSet + }; +} +function buildToken(kind, value) { + return { + kind, + value + }; +} +function concatMap(arr, fn) { + const res = []; + for (let i = 0; i < arr.length; i++) { + const x = fn(arr[i], i); + if (Array.isArray(x)) { + res.push(...x); + } else { + res.push(x); + } + } + return res; +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/interface/index.js": +/*!*************************************************************!*\ + !*** ../../graphql-language-service/esm/interface/index.js ***! + \*************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _exportNames = { + getOutline: true, + getHoverInformation: true +}; +Object.defineProperty(exports, "getHoverInformation", ({ + enumerable: true, + get: function () { + return _getHoverInformation.getHoverInformation; + } +})); +Object.defineProperty(exports, "getOutline", ({ + enumerable: true, + get: function () { + return _getOutline.getOutline; + } +})); +var _autocompleteUtils = __webpack_require__(/*! ./autocompleteUtils */ "../../graphql-language-service/esm/interface/autocompleteUtils.js"); +Object.keys(_autocompleteUtils).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _autocompleteUtils[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _autocompleteUtils[key]; + } + }); +}); +var _getAutocompleteSuggestions = __webpack_require__(/*! ./getAutocompleteSuggestions */ "../../graphql-language-service/esm/interface/getAutocompleteSuggestions.js"); +Object.keys(_getAutocompleteSuggestions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _getAutocompleteSuggestions[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _getAutocompleteSuggestions[key]; + } + }); +}); +var _getDefinition = __webpack_require__(/*! ./getDefinition */ "../../graphql-language-service/esm/interface/getDefinition.js"); +Object.keys(_getDefinition).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _getDefinition[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _getDefinition[key]; + } + }); +}); +var _getDiagnostics = __webpack_require__(/*! ./getDiagnostics */ "../../graphql-language-service/esm/interface/getDiagnostics.js"); +Object.keys(_getDiagnostics).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _getDiagnostics[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _getDiagnostics[key]; + } + }); +}); +var _getOutline = __webpack_require__(/*! ./getOutline */ "../../graphql-language-service/esm/interface/getOutline.js"); +var _getHoverInformation = __webpack_require__(/*! ./getHoverInformation */ "../../graphql-language-service/esm/interface/getHoverInformation.js"); + +/***/ }), + +/***/ "../../graphql-language-service/esm/parser/CharacterStream.js": +/*!********************************************************************!*\ + !*** ../../graphql-language-service/esm/parser/CharacterStream.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +class CharacterStream { + constructor(sourceText) { + var _this = this; + this._start = 0; + this._pos = 0; + this.getStartOfToken = () => this._start; + this.getCurrentPosition = () => this._pos; + this.eol = () => this._sourceText.length === this._pos; + this.sol = () => this._pos === 0; + this.peek = () => { + return this._sourceText.charAt(this._pos) || null; + }; + this.next = () => { + const char = this._sourceText.charAt(this._pos); + this._pos++; + return char; + }; + this.eat = pattern => { + const isMatched = this._testNextCharacter(pattern); + if (isMatched) { + this._start = this._pos; + this._pos++; + return this._sourceText.charAt(this._pos - 1); + } + return undefined; + }; + this.eatWhile = match => { + let isMatched = this._testNextCharacter(match); + let didEat = false; + if (isMatched) { + didEat = isMatched; + this._start = this._pos; + } + while (isMatched) { + this._pos++; + isMatched = this._testNextCharacter(match); + didEat = true; + } + return didEat; + }; + this.eatSpace = () => this.eatWhile(/[\s\u00a0]/); + this.skipToEnd = () => { + this._pos = this._sourceText.length; + }; + this.skipTo = position => { + this._pos = position; + }; + this.match = function (pattern) { + let consume = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + let caseFold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + let token = null; + let match = null; + if (typeof pattern === 'string') { + const regex = new RegExp(pattern, caseFold ? 'i' : 'g'); + match = regex.test(_this._sourceText.slice(_this._pos, _this._pos + pattern.length)); + token = pattern; + } else if (pattern instanceof RegExp) { + match = _this._sourceText.slice(_this._pos).match(pattern); + token = match === null || match === void 0 ? void 0 : match[0]; + } + if (match != null && (typeof pattern === 'string' || match instanceof Array && _this._sourceText.startsWith(match[0], _this._pos))) { + if (consume) { + _this._start = _this._pos; + if (token && token.length) { + _this._pos += token.length; + } + } + return match; + } + return false; + }; + this.backUp = num => { + this._pos -= num; + }; + this.column = () => this._pos; + this.indentation = () => { + const match = this._sourceText.match(/\s*/); + let indent = 0; + if (match && match.length !== 0) { + const whiteSpaces = match[0]; + let pos = 0; + while (whiteSpaces.length > pos) { + if (whiteSpaces.charCodeAt(pos) === 9) { + indent += 2; + } else { + indent++; + } + pos++; + } + } + return indent; + }; + this.current = () => this._sourceText.slice(this._start, this._pos); + this._sourceText = sourceText; + } + _testNextCharacter(pattern) { + const character = this._sourceText.charAt(this._pos); + let isMatched = false; + if (typeof pattern === 'string') { + isMatched = character === pattern; + } else { + isMatched = pattern instanceof RegExp ? pattern.test(character) : pattern(character); + } + return isMatched; + } +} +exports["default"] = CharacterStream; + +/***/ }), + +/***/ "../../graphql-language-service/esm/parser/RuleHelpers.js": +/*!****************************************************************!*\ + !*** ../../graphql-language-service/esm/parser/RuleHelpers.js ***! + \****************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.butNot = butNot; +exports.list = list; +exports.opt = opt; +exports.p = p; +exports.t = t; +function opt(ofRule) { + return { + ofRule + }; +} +function list(ofRule, separator) { + return { + ofRule, + isList: true, + separator + }; +} +function butNot(rule, exclusions) { + const ruleMatch = rule.match; + rule.match = token => { + let check = false; + if (ruleMatch) { + check = ruleMatch(token); + } + return check && exclusions.every(exclusion => exclusion.match && !exclusion.match(token)); + }; + return rule; +} +function t(kind, style) { + return { + style, + match: token => token.kind === kind + }; +} +function p(value, style) { + return { + style: style || 'punctuation', + match: token => token.kind === 'Punctuation' && token.value === value + }; +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/parser/Rules.js": +/*!**********************************************************!*\ + !*** ../../graphql-language-service/esm/parser/Rules.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.isIgnored = exports.ParseRules = exports.LexRules = void 0; +var _RuleHelpers = __webpack_require__(/*! ./RuleHelpers */ "../../graphql-language-service/esm/parser/RuleHelpers.js"); +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +const isIgnored = ch => ch === ' ' || ch === '\t' || ch === ',' || ch === '\n' || ch === '\r' || ch === '\uFEFF' || ch === '\u00A0'; +exports.isIgnored = isIgnored; +const LexRules = { + Name: /^[_A-Za-z][_0-9A-Za-z]*/, + Punctuation: /^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/, + Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, + String: /^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/, + Comment: /^#.*/ +}; +exports.LexRules = LexRules; +const ParseRules = { + Document: [(0, _RuleHelpers.list)('Definition')], + Definition(token) { + switch (token.value) { + case '{': + return 'ShortQuery'; + case 'query': + return 'Query'; + case 'mutation': + return 'Mutation'; + case 'subscription': + return 'Subscription'; + case 'fragment': + return _graphql.Kind.FRAGMENT_DEFINITION; + case 'schema': + return 'SchemaDef'; + case 'scalar': + return 'ScalarDef'; + case 'type': + return 'ObjectTypeDef'; + case 'interface': + return 'InterfaceDef'; + case 'union': + return 'UnionDef'; + case 'enum': + return 'EnumDef'; + case 'input': + return 'InputDef'; + case 'extend': + return 'ExtendDef'; + case 'directive': + return 'DirectiveDef'; + } + }, + ShortQuery: ['SelectionSet'], + Query: [word('query'), (0, _RuleHelpers.opt)(name('def')), (0, _RuleHelpers.opt)('VariableDefinitions'), (0, _RuleHelpers.list)('Directive'), 'SelectionSet'], + Mutation: [word('mutation'), (0, _RuleHelpers.opt)(name('def')), (0, _RuleHelpers.opt)('VariableDefinitions'), (0, _RuleHelpers.list)('Directive'), 'SelectionSet'], + Subscription: [word('subscription'), (0, _RuleHelpers.opt)(name('def')), (0, _RuleHelpers.opt)('VariableDefinitions'), (0, _RuleHelpers.list)('Directive'), 'SelectionSet'], + VariableDefinitions: [(0, _RuleHelpers.p)('('), (0, _RuleHelpers.list)('VariableDefinition'), (0, _RuleHelpers.p)(')')], + VariableDefinition: ['Variable', (0, _RuleHelpers.p)(':'), 'Type', (0, _RuleHelpers.opt)('DefaultValue')], + Variable: [(0, _RuleHelpers.p)('$', 'variable'), name('variable')], + DefaultValue: [(0, _RuleHelpers.p)('='), 'Value'], + SelectionSet: [(0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('Selection'), (0, _RuleHelpers.p)('}')], + Selection(token, stream) { + return token.value === '...' ? stream.match(/[\s\u00a0,]*(on\b|@|{)/, false) ? 'InlineFragment' : 'FragmentSpread' : stream.match(/[\s\u00a0,]*:/, false) ? 'AliasedField' : 'Field'; + }, + AliasedField: [name('property'), (0, _RuleHelpers.p)(':'), name('qualifier'), (0, _RuleHelpers.opt)('Arguments'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.opt)('SelectionSet')], + Field: [name('property'), (0, _RuleHelpers.opt)('Arguments'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.opt)('SelectionSet')], + Arguments: [(0, _RuleHelpers.p)('('), (0, _RuleHelpers.list)('Argument'), (0, _RuleHelpers.p)(')')], + Argument: [name('attribute'), (0, _RuleHelpers.p)(':'), 'Value'], + FragmentSpread: [(0, _RuleHelpers.p)('...'), name('def'), (0, _RuleHelpers.list)('Directive')], + InlineFragment: [(0, _RuleHelpers.p)('...'), (0, _RuleHelpers.opt)('TypeCondition'), (0, _RuleHelpers.list)('Directive'), 'SelectionSet'], + FragmentDefinition: [word('fragment'), (0, _RuleHelpers.opt)((0, _RuleHelpers.butNot)(name('def'), [word('on')])), 'TypeCondition', (0, _RuleHelpers.list)('Directive'), 'SelectionSet'], + TypeCondition: [word('on'), 'NamedType'], + Value(token) { + switch (token.kind) { + case 'Number': + return 'NumberValue'; + case 'String': + return 'StringValue'; + case 'Punctuation': + switch (token.value) { + case '[': + return 'ListValue'; + case '{': + return 'ObjectValue'; + case '$': + return 'Variable'; + case '&': + return 'NamedType'; + } + return null; + case 'Name': + switch (token.value) { + case 'true': + case 'false': + return 'BooleanValue'; + } + if (token.value === 'null') { + return 'NullValue'; + } + return 'EnumValue'; + } + }, + NumberValue: [(0, _RuleHelpers.t)('Number', 'number')], + StringValue: [{ + style: 'string', + match: token => token.kind === 'String', + update(state, token) { + if (token.value.startsWith('"""')) { + state.inBlockstring = !token.value.slice(3).endsWith('"""'); + } + } + }], + BooleanValue: [(0, _RuleHelpers.t)('Name', 'builtin')], + NullValue: [(0, _RuleHelpers.t)('Name', 'keyword')], + EnumValue: [name('string-2')], + ListValue: [(0, _RuleHelpers.p)('['), (0, _RuleHelpers.list)('Value'), (0, _RuleHelpers.p)(']')], + ObjectValue: [(0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('ObjectField'), (0, _RuleHelpers.p)('}')], + ObjectField: [name('attribute'), (0, _RuleHelpers.p)(':'), 'Value'], + Type(token) { + return token.value === '[' ? 'ListType' : 'NonNullType'; + }, + ListType: [(0, _RuleHelpers.p)('['), 'Type', (0, _RuleHelpers.p)(']'), (0, _RuleHelpers.opt)((0, _RuleHelpers.p)('!'))], + NonNullType: ['NamedType', (0, _RuleHelpers.opt)((0, _RuleHelpers.p)('!'))], + NamedType: [type('atom')], + Directive: [(0, _RuleHelpers.p)('@', 'meta'), name('meta'), (0, _RuleHelpers.opt)('Arguments')], + DirectiveDef: [word('directive'), (0, _RuleHelpers.p)('@', 'meta'), name('meta'), (0, _RuleHelpers.opt)('ArgumentsDef'), word('on'), (0, _RuleHelpers.list)('DirectiveLocation', (0, _RuleHelpers.p)('|'))], + InterfaceDef: [word('interface'), name('atom'), (0, _RuleHelpers.opt)('Implements'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('FieldDef'), (0, _RuleHelpers.p)('}')], + Implements: [word('implements'), (0, _RuleHelpers.list)('NamedType', (0, _RuleHelpers.p)('&'))], + DirectiveLocation: [name('string-2')], + SchemaDef: [word('schema'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('OperationTypeDef'), (0, _RuleHelpers.p)('}')], + OperationTypeDef: [name('keyword'), (0, _RuleHelpers.p)(':'), name('atom')], + ScalarDef: [word('scalar'), name('atom'), (0, _RuleHelpers.list)('Directive')], + ObjectTypeDef: [word('type'), name('atom'), (0, _RuleHelpers.opt)('Implements'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('FieldDef'), (0, _RuleHelpers.p)('}')], + FieldDef: [name('property'), (0, _RuleHelpers.opt)('ArgumentsDef'), (0, _RuleHelpers.p)(':'), 'Type', (0, _RuleHelpers.list)('Directive')], + ArgumentsDef: [(0, _RuleHelpers.p)('('), (0, _RuleHelpers.list)('InputValueDef'), (0, _RuleHelpers.p)(')')], + InputValueDef: [name('attribute'), (0, _RuleHelpers.p)(':'), 'Type', (0, _RuleHelpers.opt)('DefaultValue'), (0, _RuleHelpers.list)('Directive')], + UnionDef: [word('union'), name('atom'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.p)('='), (0, _RuleHelpers.list)('UnionMember', (0, _RuleHelpers.p)('|'))], + UnionMember: ['NamedType'], + EnumDef: [word('enum'), name('atom'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('EnumValueDef'), (0, _RuleHelpers.p)('}')], + EnumValueDef: [name('string-2'), (0, _RuleHelpers.list)('Directive')], + InputDef: [word('input'), name('atom'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('InputValueDef'), (0, _RuleHelpers.p)('}')], + ExtendDef: [word('extend'), 'ExtensionDefinition'], + ExtensionDefinition(token) { + switch (token.value) { + case 'schema': + return _graphql.Kind.SCHEMA_EXTENSION; + case 'scalar': + return _graphql.Kind.SCALAR_TYPE_EXTENSION; + case 'type': + return _graphql.Kind.OBJECT_TYPE_EXTENSION; + case 'interface': + return _graphql.Kind.INTERFACE_TYPE_EXTENSION; + case 'union': + return _graphql.Kind.UNION_TYPE_EXTENSION; + case 'enum': + return _graphql.Kind.ENUM_TYPE_EXTENSION; + case 'input': + return _graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION; + } + }, + [_graphql.Kind.SCHEMA_EXTENSION]: ['SchemaDef'], + [_graphql.Kind.SCALAR_TYPE_EXTENSION]: ['ScalarDef'], + [_graphql.Kind.OBJECT_TYPE_EXTENSION]: ['ObjectTypeDef'], + [_graphql.Kind.INTERFACE_TYPE_EXTENSION]: ['InterfaceDef'], + [_graphql.Kind.UNION_TYPE_EXTENSION]: ['UnionDef'], + [_graphql.Kind.ENUM_TYPE_EXTENSION]: ['EnumDef'], + [_graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION]: ['InputDef'] +}; +exports.ParseRules = ParseRules; +function word(value) { + return { + style: 'keyword', + match: token => token.kind === 'Name' && token.value === value + }; +} +function name(style) { + return { + style, + match: token => token.kind === 'Name', + update(state, token) { + state.name = token.value; + } + }; +} +function type(style) { + return { + style, + match: token => token.kind === 'Name', + update(state, token) { + var _a; + if ((_a = state.prevState) === null || _a === void 0 ? void 0 : _a.prevState) { + state.name = token.value; + state.prevState.prevState.type = token.value; + } + } + }; +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/parser/index.js": +/*!**********************************************************!*\ + !*** ../../graphql-language-service/esm/parser/index.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +var _exportNames = { + CharacterStream: true, + LexRules: true, + ParseRules: true, + isIgnored: true, + butNot: true, + list: true, + opt: true, + p: true, + t: true, + onlineParser: true +}; +Object.defineProperty(exports, "CharacterStream", ({ + enumerable: true, + get: function () { + return _CharacterStream.default; + } +})); +Object.defineProperty(exports, "LexRules", ({ + enumerable: true, + get: function () { + return _Rules.LexRules; + } +})); +Object.defineProperty(exports, "ParseRules", ({ + enumerable: true, + get: function () { + return _Rules.ParseRules; + } +})); +Object.defineProperty(exports, "butNot", ({ + enumerable: true, + get: function () { + return _RuleHelpers.butNot; + } +})); +Object.defineProperty(exports, "isIgnored", ({ + enumerable: true, + get: function () { + return _Rules.isIgnored; + } +})); +Object.defineProperty(exports, "list", ({ + enumerable: true, + get: function () { + return _RuleHelpers.list; + } +})); +Object.defineProperty(exports, "onlineParser", ({ + enumerable: true, + get: function () { + return _onlineParser.default; + } +})); +Object.defineProperty(exports, "opt", ({ + enumerable: true, + get: function () { + return _RuleHelpers.opt; + } +})); +Object.defineProperty(exports, "p", ({ + enumerable: true, + get: function () { + return _RuleHelpers.p; + } +})); +Object.defineProperty(exports, "t", ({ + enumerable: true, + get: function () { + return _RuleHelpers.t; + } +})); +var _CharacterStream = _interopRequireDefault(__webpack_require__(/*! ./CharacterStream */ "../../graphql-language-service/esm/parser/CharacterStream.js")); +var _Rules = __webpack_require__(/*! ./Rules */ "../../graphql-language-service/esm/parser/Rules.js"); +var _RuleHelpers = __webpack_require__(/*! ./RuleHelpers */ "../../graphql-language-service/esm/parser/RuleHelpers.js"); +var _onlineParser = _interopRequireDefault(__webpack_require__(/*! ./onlineParser */ "../../graphql-language-service/esm/parser/onlineParser.js")); +var _types = __webpack_require__(/*! ./types */ "../../graphql-language-service/esm/parser/types.js"); +Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _types[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _types[key]; + } + }); +}); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/***/ }), + +/***/ "../../graphql-language-service/esm/parser/onlineParser.js": +/*!*****************************************************************!*\ + !*** ../../graphql-language-service/esm/parser/onlineParser.js ***! + \*****************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = onlineParser; +var _Rules = __webpack_require__(/*! ./Rules */ "../../graphql-language-service/esm/parser/Rules.js"); +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +function onlineParser() { + let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + eatWhitespace: stream => stream.eatWhile(_Rules.isIgnored), + lexRules: _Rules.LexRules, + parseRules: _Rules.ParseRules, + editorConfig: {} + }; + return { + startState() { + const initialState = { + level: 0, + step: 0, + name: null, + kind: null, + type: null, + rule: null, + needsSeparator: false, + prevState: null + }; + pushRule(options.parseRules, initialState, _graphql.Kind.DOCUMENT); + return initialState; + }, + token(stream, state) { + return getToken(stream, state, options); + } + }; +} +function getToken(stream, state, options) { + var _a; + if (state.inBlockstring) { + if (stream.match(/.*"""/)) { + state.inBlockstring = false; + return 'string'; + } + stream.skipToEnd(); + return 'string'; + } + const { + lexRules, + parseRules, + eatWhitespace, + editorConfig + } = options; + if (state.rule && state.rule.length === 0) { + popRule(state); + } else if (state.needsAdvance) { + state.needsAdvance = false; + advanceRule(state, true); + } + if (stream.sol()) { + const tabSize = (editorConfig === null || editorConfig === void 0 ? void 0 : editorConfig.tabSize) || 2; + state.indentLevel = Math.floor(stream.indentation() / tabSize); + } + if (eatWhitespace(stream)) { + return 'ws'; + } + const token = lex(lexRules, stream); + if (!token) { + const matchedSomething = stream.match(/\S+/); + if (!matchedSomething) { + stream.match(/\s/); + } + pushRule(SpecialParseRules, state, 'Invalid'); + return 'invalidchar'; + } + if (token.kind === 'Comment') { + pushRule(SpecialParseRules, state, 'Comment'); + return 'comment'; + } + const backupState = assign({}, state); + if (token.kind === 'Punctuation') { + if (/^[{([]/.test(token.value)) { + if (state.indentLevel !== undefined) { + state.levels = (state.levels || []).concat(state.indentLevel + 1); + } + } else if (/^[})\]]/.test(token.value)) { + const levels = state.levels = (state.levels || []).slice(0, -1); + if (state.indentLevel && levels.length > 0 && levels.at(-1) < state.indentLevel) { + state.indentLevel = levels.at(-1); + } + } + } + while (state.rule) { + let expected = typeof state.rule === 'function' ? state.step === 0 ? state.rule(token, stream) : null : state.rule[state.step]; + if (state.needsSeparator) { + expected = expected === null || expected === void 0 ? void 0 : expected.separator; + } + if (expected) { + if (expected.ofRule) { + expected = expected.ofRule; + } + if (typeof expected === 'string') { + pushRule(parseRules, state, expected); + continue; + } + if ((_a = expected.match) === null || _a === void 0 ? void 0 : _a.call(expected, token)) { + if (expected.update) { + expected.update(state, token); + } + if (token.kind === 'Punctuation') { + advanceRule(state, true); + } else { + state.needsAdvance = true; + } + return expected.style; + } + } + unsuccessful(state); + } + assign(state, backupState); + pushRule(SpecialParseRules, state, 'Invalid'); + return 'invalidchar'; +} +function assign(to, from) { + const keys = Object.keys(from); + for (let i = 0; i < keys.length; i++) { + to[keys[i]] = from[keys[i]]; + } + return to; +} +const SpecialParseRules = { + Invalid: [], + Comment: [] +}; +function pushRule(rules, state, ruleKind) { + if (!rules[ruleKind]) { + throw new TypeError('Unknown rule: ' + ruleKind); + } + state.prevState = Object.assign({}, state); + state.kind = ruleKind; + state.name = null; + state.type = null; + state.rule = rules[ruleKind]; + state.step = 0; + state.needsSeparator = false; +} +function popRule(state) { + if (!state.prevState) { + return; + } + state.kind = state.prevState.kind; + state.name = state.prevState.name; + state.type = state.prevState.type; + state.rule = state.prevState.rule; + state.step = state.prevState.step; + state.needsSeparator = state.prevState.needsSeparator; + state.prevState = state.prevState.prevState; +} +function advanceRule(state, successful) { + var _a; + if (isList(state) && state.rule) { + const step = state.rule[state.step]; + if (step.separator) { + const { + separator + } = step; + state.needsSeparator = !state.needsSeparator; + if (!state.needsSeparator && separator.ofRule) { + return; + } + } + if (successful) { + return; + } + } + state.needsSeparator = false; + state.step++; + while (state.rule && !(Array.isArray(state.rule) && state.step < state.rule.length)) { + popRule(state); + if (state.rule) { + if (isList(state)) { + if ((_a = state.rule) === null || _a === void 0 ? void 0 : _a[state.step].separator) { + state.needsSeparator = !state.needsSeparator; + } + } else { + state.needsSeparator = false; + state.step++; + } + } + } +} +function isList(state) { + const step = Array.isArray(state.rule) && typeof state.rule[state.step] !== 'string' && state.rule[state.step]; + return step && step.isList; +} +function unsuccessful(state) { + while (state.rule && !(Array.isArray(state.rule) && state.rule[state.step].ofRule)) { + popRule(state); + } + if (state.rule) { + advanceRule(state, false); + } +} +function lex(lexRules, stream) { + const kinds = Object.keys(lexRules); + for (let i = 0; i < kinds.length; i++) { + const match = stream.match(lexRules[kinds[i]]); + if (match && match instanceof Array) { + return { + kind: kinds[i], + value: match[0] + }; + } + } +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/parser/types.js": +/*!**********************************************************!*\ + !*** ../../graphql-language-service/esm/parser/types.js ***! + \**********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.RuleKinds = exports.AdditionalRuleKinds = void 0; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +const AdditionalRuleKinds = { + ALIASED_FIELD: 'AliasedField', + ARGUMENTS: 'Arguments', + SHORT_QUERY: 'ShortQuery', + QUERY: 'Query', + MUTATION: 'Mutation', + SUBSCRIPTION: 'Subscription', + TYPE_CONDITION: 'TypeCondition', + INVALID: 'Invalid', + COMMENT: 'Comment', + SCHEMA_DEF: 'SchemaDef', + SCALAR_DEF: 'ScalarDef', + OBJECT_TYPE_DEF: 'ObjectTypeDef', + OBJECT_VALUE: 'ObjectValue', + LIST_VALUE: 'ListValue', + INTERFACE_DEF: 'InterfaceDef', + UNION_DEF: 'UnionDef', + ENUM_DEF: 'EnumDef', + ENUM_VALUE: 'EnumValue', + FIELD_DEF: 'FieldDef', + INPUT_DEF: 'InputDef', + INPUT_VALUE_DEF: 'InputValueDef', + ARGUMENTS_DEF: 'ArgumentsDef', + EXTEND_DEF: 'ExtendDef', + EXTENSION_DEFINITION: 'ExtensionDefinition', + DIRECTIVE_DEF: 'DirectiveDef', + IMPLEMENTS: 'Implements', + VARIABLE_DEFINITIONS: 'VariableDefinitions', + TYPE: 'Type' +}; +exports.AdditionalRuleKinds = AdditionalRuleKinds; +const RuleKinds = Object.assign(Object.assign({}, _graphql.Kind), AdditionalRuleKinds); +exports.RuleKinds = RuleKinds; + +/***/ }), + +/***/ "../../graphql-language-service/esm/types.js": +/*!***************************************************!*\ + !*** ../../graphql-language-service/esm/types.js ***! + \***************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.FileChangeTypeKind = exports.CompletionItemKind = void 0; +Object.defineProperty(exports, "InsertTextFormat", ({ + enumerable: true, + get: function () { + return _vscodeLanguageserverTypes.InsertTextFormat; + } +})); +var _vscodeLanguageserverTypes = __webpack_require__(/*! vscode-languageserver-types */ "../../../node_modules/vscode-languageserver-types/lib/esm/main.js"); +const FileChangeTypeKind = { + Created: 1, + Changed: 2, + Deleted: 3 +}; +exports.FileChangeTypeKind = FileChangeTypeKind; +var CompletionItemKind; +exports.CompletionItemKind = CompletionItemKind; +(function (CompletionItemKind) { + CompletionItemKind.Text = 1; + CompletionItemKind.Method = 2; + CompletionItemKind.Function = 3; + CompletionItemKind.Constructor = 4; + CompletionItemKind.Field = 5; + CompletionItemKind.Variable = 6; + CompletionItemKind.Class = 7; + CompletionItemKind.Interface = 8; + CompletionItemKind.Module = 9; + CompletionItemKind.Property = 10; + CompletionItemKind.Unit = 11; + CompletionItemKind.Value = 12; + CompletionItemKind.Enum = 13; + CompletionItemKind.Keyword = 14; + CompletionItemKind.Snippet = 15; + CompletionItemKind.Color = 16; + CompletionItemKind.File = 17; + CompletionItemKind.Reference = 18; + CompletionItemKind.Folder = 19; + CompletionItemKind.EnumMember = 20; + CompletionItemKind.Constant = 21; + CompletionItemKind.Struct = 22; + CompletionItemKind.Event = 23; + CompletionItemKind.Operator = 24; + CompletionItemKind.TypeParameter = 25; +})(CompletionItemKind || (exports.CompletionItemKind = CompletionItemKind = {})); + +/***/ }), + +/***/ "../../graphql-language-service/esm/utils/Range.js": +/*!*********************************************************!*\ + !*** ../../graphql-language-service/esm/utils/Range.js ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Range = exports.Position = void 0; +exports.locToRange = locToRange; +exports.offsetToPosition = offsetToPosition; +class Range { + constructor(start, end) { + this.containsPosition = position => { + if (this.start.line === position.line) { + return this.start.character <= position.character; + } + if (this.end.line === position.line) { + return this.end.character >= position.character; + } + return this.start.line <= position.line && this.end.line >= position.line; + }; + this.start = start; + this.end = end; + } + setStart(line, character) { + this.start = new Position(line, character); + } + setEnd(line, character) { + this.end = new Position(line, character); + } +} +exports.Range = Range; +class Position { + constructor(line, character) { + this.lessThanOrEqualTo = position => this.line < position.line || this.line === position.line && this.character <= position.character; + this.line = line; + this.character = character; + } + setLine(line) { + this.line = line; + } + setCharacter(character) { + this.character = character; + } +} +exports.Position = Position; +function offsetToPosition(text, loc) { + const EOL = '\n'; + const buf = text.slice(0, loc); + const lines = buf.split(EOL).length - 1; + const lastLineIndex = buf.lastIndexOf(EOL); + return new Position(lines, loc - lastLineIndex - 1); +} +function locToRange(text, loc) { + const start = offsetToPosition(text, loc.start); + const end = offsetToPosition(text, loc.end); + return new Range(start, end); +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/utils/collectVariables.js": +/*!********************************************************************!*\ + !*** ../../graphql-language-service/esm/utils/collectVariables.js ***! + \********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.collectVariables = collectVariables; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +function collectVariables(schema, documentAST) { + const variableToType = Object.create(null); + for (const definition of documentAST.definitions) { + if (definition.kind === 'OperationDefinition') { + const { + variableDefinitions + } = definition; + if (variableDefinitions) { + for (const { + variable, + type + } of variableDefinitions) { + const inputType = (0, _graphql.typeFromAST)(schema, type); + if (inputType) { + variableToType[variable.name.value] = inputType; + } else if (type.kind === _graphql.Kind.NAMED_TYPE && type.name.value === 'Float') { + variableToType[variable.name.value] = _graphql.GraphQLFloat; + } + } + } + } + } + return variableToType; +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/utils/fragmentDependencies.js": +/*!************************************************************************!*\ + !*** ../../graphql-language-service/esm/utils/fragmentDependencies.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getFragmentDependenciesForAST = exports.getFragmentDependencies = void 0; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _nullthrows = _interopRequireDefault(__webpack_require__(/*! nullthrows */ "../../../node_modules/nullthrows/nullthrows.js")); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const getFragmentDependencies = (operationString, fragmentDefinitions) => { + if (!fragmentDefinitions) { + return []; + } + let parsedOperation; + try { + parsedOperation = (0, _graphql.parse)(operationString); + } catch (_a) { + return []; + } + return getFragmentDependenciesForAST(parsedOperation, fragmentDefinitions); +}; +exports.getFragmentDependencies = getFragmentDependencies; +const getFragmentDependenciesForAST = (parsedOperation, fragmentDefinitions) => { + if (!fragmentDefinitions) { + return []; + } + const existingFrags = new Map(); + const referencedFragNames = new Set(); + (0, _graphql.visit)(parsedOperation, { + FragmentDefinition(node) { + existingFrags.set(node.name.value, true); + }, + FragmentSpread(node) { + if (!referencedFragNames.has(node.name.value)) { + referencedFragNames.add(node.name.value); + } + } + }); + const asts = new Set(); + for (const name of referencedFragNames) { + if (!existingFrags.has(name) && fragmentDefinitions.has(name)) { + asts.add((0, _nullthrows.default)(fragmentDefinitions.get(name))); + } + } + const referencedFragments = []; + for (const ast of asts) { + (0, _graphql.visit)(ast, { + FragmentSpread(node) { + if (!referencedFragNames.has(node.name.value) && fragmentDefinitions.get(node.name.value)) { + asts.add((0, _nullthrows.default)(fragmentDefinitions.get(node.name.value))); + referencedFragNames.add(node.name.value); + } + } + }); + if (!existingFrags.has(ast.name.value)) { + referencedFragments.push(ast); + } + } + return referencedFragments; +}; +exports.getFragmentDependenciesForAST = getFragmentDependenciesForAST; + +/***/ }), + +/***/ "../../graphql-language-service/esm/utils/getASTNodeAtPosition.js": +/*!************************************************************************!*\ + !*** ../../graphql-language-service/esm/utils/getASTNodeAtPosition.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.getASTNodeAtPosition = getASTNodeAtPosition; +exports.pointToOffset = pointToOffset; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +function getASTNodeAtPosition(query, ast, point) { + const offset = pointToOffset(query, point); + let nodeContainingPosition; + (0, _graphql.visit)(ast, { + enter(node) { + if (node.kind !== 'Name' && node.loc && node.loc.start <= offset && offset <= node.loc.end) { + nodeContainingPosition = node; + } else { + return false; + } + }, + leave(node) { + if (node.loc && node.loc.start <= offset && offset <= node.loc.end) { + return false; + } + } + }); + return nodeContainingPosition; +} +function pointToOffset(text, point) { + const linesUntilPosition = text.split('\n').slice(0, point.line); + return point.character + linesUntilPosition.map(line => line.length + 1).reduce((a, b) => a + b, 0); +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/utils/getOperationFacts.js": +/*!*********************************************************************!*\ + !*** ../../graphql-language-service/esm/utils/getOperationFacts.js ***! + \*********************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = getOperationFacts; +exports.getOperationASTFacts = getOperationASTFacts; +exports.getQueryFacts = void 0; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +var _collectVariables = __webpack_require__(/*! ./collectVariables */ "../../graphql-language-service/esm/utils/collectVariables.js"); +function getOperationASTFacts(documentAST, schema) { + const variableToType = schema ? (0, _collectVariables.collectVariables)(schema, documentAST) : undefined; + const operations = []; + (0, _graphql.visit)(documentAST, { + OperationDefinition(node) { + operations.push(node); + } + }); + return { + variableToType, + operations + }; +} +function getOperationFacts(schema, documentString) { + if (!documentString) { + return; + } + try { + const documentAST = (0, _graphql.parse)(documentString); + return Object.assign(Object.assign({}, getOperationASTFacts(documentAST, schema)), { + documentAST + }); + } catch (_a) { + return; + } +} +const getQueryFacts = getOperationFacts; +exports.getQueryFacts = getQueryFacts; + +/***/ }), + +/***/ "../../graphql-language-service/esm/utils/getVariablesJSONSchema.js": +/*!**************************************************************************!*\ + !*** ../../graphql-language-service/esm/utils/getVariablesJSONSchema.js ***! + \**************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.defaultJSONSchemaOptions = void 0; +exports.getVariablesJSONSchema = getVariablesJSONSchema; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +const defaultJSONSchemaOptions = { + useMarkdownDescription: false +}; +exports.defaultJSONSchemaOptions = defaultJSONSchemaOptions; +function text(into, newText) { + into.push(newText); +} +function renderType(into, t) { + if ((0, _graphql.isNonNullType)(t)) { + renderType(into, t.ofType); + text(into, '!'); + } else if ((0, _graphql.isListType)(t)) { + text(into, '['); + renderType(into, t.ofType); + text(into, ']'); + } else { + text(into, t.name); + } +} +function renderDefinitionDescription(t, useMarkdown, description) { + const into = []; + const type = 'type' in t ? t.type : t; + if ('type' in t && t.description) { + text(into, t.description); + text(into, '\n\n'); + } + text(into, renderTypeToString(type, useMarkdown)); + if (description) { + text(into, '\n'); + text(into, description); + } else if (!(0, _graphql.isScalarType)(type) && 'description' in type && type.description) { + text(into, '\n'); + text(into, type.description); + } else if ('ofType' in type && !(0, _graphql.isScalarType)(type.ofType) && 'description' in type.ofType && type.ofType.description) { + text(into, '\n'); + text(into, type.ofType.description); + } + return into.join(''); +} +function renderTypeToString(t, useMarkdown) { + const into = []; + if (useMarkdown) { + text(into, '```graphql\n'); + } + renderType(into, t); + if (useMarkdown) { + text(into, '\n```'); + } + return into.join(''); +} +const defaultScalarTypesMap = { + Int: { + type: 'integer' + }, + String: { + type: 'string' + }, + Float: { + type: 'number' + }, + ID: { + type: 'string' + }, + Boolean: { + type: 'boolean' + }, + DateTime: { + type: 'string' + } +}; +class Marker { + constructor() { + this.set = new Set(); + } + mark(name) { + if (this.set.has(name)) { + return false; + } + this.set.add(name); + return true; + } +} +function getJSONSchemaFromGraphQLType(fieldOrType, options) { + var _a, _b; + let definition = Object.create(null); + const definitions = Object.create(null); + const isField = ('type' in fieldOrType); + const type = isField ? fieldOrType.type : fieldOrType; + const baseType = (0, _graphql.isNonNullType)(type) ? type.ofType : type; + const required = (0, _graphql.isNonNullType)(type); + if ((0, _graphql.isScalarType)(baseType)) { + if ((_a = options === null || options === void 0 ? void 0 : options.scalarSchemas) === null || _a === void 0 ? void 0 : _a[baseType.name]) { + definition = JSON.parse(JSON.stringify(options.scalarSchemas[baseType.name])); + } else { + definition.type = ['string', 'number', 'boolean', 'integer']; + } + if (!required) { + if (Array.isArray(definition.type)) { + definition.type.push('null'); + } else if (definition.type) { + definition.type = [definition.type, 'null']; + } else if (definition.enum) { + definition.enum.push(null); + } else if (definition.oneOf) { + definition.oneOf.push({ + type: 'null' + }); + } else { + definition = { + oneOf: [definition, { + type: 'null' + }] + }; + } + } + } else if ((0, _graphql.isEnumType)(baseType)) { + definition.enum = baseType.getValues().map(val => val.name); + if (!required) { + definition.enum.push(null); + } + } else if ((0, _graphql.isListType)(baseType)) { + if (required) { + definition.type = 'array'; + } else { + definition.type = ['array', 'null']; + } + const { + definition: def, + definitions: defs + } = getJSONSchemaFromGraphQLType(baseType.ofType, options); + definition.items = def; + if (defs) { + for (const defName of Object.keys(defs)) { + definitions[defName] = defs[defName]; + } + } + } else if ((0, _graphql.isInputObjectType)(baseType)) { + if (required) { + definition.$ref = `#/definitions/${baseType.name}`; + } else { + definition.oneOf = [{ + $ref: `#/definitions/${baseType.name}` + }, { + type: 'null' + }]; + } + if ((_b = options === null || options === void 0 ? void 0 : options.definitionMarker) === null || _b === void 0 ? void 0 : _b.mark(baseType.name)) { + const fields = baseType.getFields(); + const fieldDef = { + type: 'object', + properties: {}, + required: [] + }; + fieldDef.description = renderDefinitionDescription(baseType); + if (options === null || options === void 0 ? void 0 : options.useMarkdownDescription) { + fieldDef.markdownDescription = renderDefinitionDescription(baseType, true); + } + for (const fieldName of Object.keys(fields)) { + const field = fields[fieldName]; + const { + required: fieldRequired, + definition: fieldDefinition, + definitions: typeDefinitions + } = getJSONSchemaFromGraphQLType(field, options); + fieldDef.properties[fieldName] = fieldDefinition; + if (fieldRequired) { + fieldDef.required.push(fieldName); + } + if (typeDefinitions) { + for (const [defName, value] of Object.entries(typeDefinitions)) { + definitions[defName] = value; + } + } + } + definitions[baseType.name] = fieldDef; + } + } + if ('defaultValue' in fieldOrType && fieldOrType.defaultValue !== undefined) { + definition.default = fieldOrType.defaultValue; + } + const { + description + } = definition; + definition.description = renderDefinitionDescription(fieldOrType, false, description); + if (options === null || options === void 0 ? void 0 : options.useMarkdownDescription) { + definition.markdownDescription = renderDefinitionDescription(fieldOrType, true, description); + } + return { + required, + definition, + definitions + }; +} +function getVariablesJSONSchema(variableToType, options) { + var _a; + const jsonSchema = { + $schema: 'http://json-schema.org/draft-04/schema', + type: 'object', + properties: {}, + required: [] + }; + const runtimeOptions = Object.assign(Object.assign({}, options), { + definitionMarker: new Marker(), + scalarSchemas: Object.assign(Object.assign({}, defaultScalarTypesMap), options === null || options === void 0 ? void 0 : options.scalarSchemas) + }); + if (variableToType) { + for (const [variableName, type] of Object.entries(variableToType)) { + const { + definition, + required, + definitions + } = getJSONSchemaFromGraphQLType(type, runtimeOptions); + jsonSchema.properties[variableName] = definition; + if (required) { + (_a = jsonSchema.required) === null || _a === void 0 ? void 0 : _a.push(variableName); + } + if (definitions) { + jsonSchema.definitions = Object.assign(Object.assign({}, jsonSchema === null || jsonSchema === void 0 ? void 0 : jsonSchema.definitions), definitions); + } + } + } + return jsonSchema; +} + +/***/ }), + +/***/ "../../graphql-language-service/esm/utils/index.js": +/*!*********************************************************!*\ + !*** ../../graphql-language-service/esm/utils/index.js ***! + \*********************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "Position", ({ + enumerable: true, + get: function () { + return _Range.Position; + } +})); +Object.defineProperty(exports, "Range", ({ + enumerable: true, + get: function () { + return _Range.Range; + } +})); +Object.defineProperty(exports, "collectVariables", ({ + enumerable: true, + get: function () { + return _collectVariables.collectVariables; + } +})); +Object.defineProperty(exports, "getASTNodeAtPosition", ({ + enumerable: true, + get: function () { + return _getASTNodeAtPosition.getASTNodeAtPosition; + } +})); +Object.defineProperty(exports, "getFragmentDependencies", ({ + enumerable: true, + get: function () { + return _fragmentDependencies.getFragmentDependencies; + } +})); +Object.defineProperty(exports, "getFragmentDependenciesForAST", ({ + enumerable: true, + get: function () { + return _fragmentDependencies.getFragmentDependenciesForAST; + } +})); +Object.defineProperty(exports, "getOperationASTFacts", ({ + enumerable: true, + get: function () { + return _getOperationFacts.getOperationASTFacts; + } +})); +Object.defineProperty(exports, "getOperationFacts", ({ + enumerable: true, + get: function () { + return _getOperationFacts.default; + } +})); +Object.defineProperty(exports, "getQueryFacts", ({ + enumerable: true, + get: function () { + return _getOperationFacts.getQueryFacts; + } +})); +Object.defineProperty(exports, "getVariablesJSONSchema", ({ + enumerable: true, + get: function () { + return _getVariablesJSONSchema.getVariablesJSONSchema; + } +})); +Object.defineProperty(exports, "locToRange", ({ + enumerable: true, + get: function () { + return _Range.locToRange; + } +})); +Object.defineProperty(exports, "offsetToPosition", ({ + enumerable: true, + get: function () { + return _Range.offsetToPosition; + } +})); +Object.defineProperty(exports, "pointToOffset", ({ + enumerable: true, + get: function () { + return _getASTNodeAtPosition.pointToOffset; + } +})); +Object.defineProperty(exports, "validateWithCustomRules", ({ + enumerable: true, + get: function () { + return _validateWithCustomRules.validateWithCustomRules; + } +})); +var _fragmentDependencies = __webpack_require__(/*! ./fragmentDependencies */ "../../graphql-language-service/esm/utils/fragmentDependencies.js"); +var _getVariablesJSONSchema = __webpack_require__(/*! ./getVariablesJSONSchema */ "../../graphql-language-service/esm/utils/getVariablesJSONSchema.js"); +var _getASTNodeAtPosition = __webpack_require__(/*! ./getASTNodeAtPosition */ "../../graphql-language-service/esm/utils/getASTNodeAtPosition.js"); +var _Range = __webpack_require__(/*! ./Range */ "../../graphql-language-service/esm/utils/Range.js"); +var _validateWithCustomRules = __webpack_require__(/*! ./validateWithCustomRules */ "../../graphql-language-service/esm/utils/validateWithCustomRules.js"); +var _collectVariables = __webpack_require__(/*! ./collectVariables */ "../../graphql-language-service/esm/utils/collectVariables.js"); +var _getOperationFacts = _interopRequireWildcard(__webpack_require__(/*! ./getOperationFacts */ "../../graphql-language-service/esm/utils/getOperationFacts.js")); +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +/***/ }), + +/***/ "../../graphql-language-service/esm/utils/validateWithCustomRules.js": +/*!***************************************************************************!*\ + !*** ../../graphql-language-service/esm/utils/validateWithCustomRules.js ***! + \***************************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.validateWithCustomRules = validateWithCustomRules; +var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); +const specifiedSDLRules = [_graphql.LoneSchemaDefinitionRule, _graphql.UniqueOperationTypesRule, _graphql.UniqueTypeNamesRule, _graphql.UniqueEnumValueNamesRule, _graphql.UniqueFieldDefinitionNamesRule, _graphql.UniqueDirectiveNamesRule, _graphql.KnownTypeNamesRule, _graphql.KnownDirectivesRule, _graphql.UniqueDirectivesPerLocationRule, _graphql.PossibleTypeExtensionsRule, _graphql.UniqueArgumentNamesRule, _graphql.UniqueInputFieldNamesRule]; +function validateWithCustomRules(schema, ast, customRules, isRelayCompatMode, isSchemaDocument) { + const rules = _graphql.specifiedRules.filter(rule => { + if (rule === _graphql.NoUnusedFragmentsRule || rule === _graphql.ExecutableDefinitionsRule) { + return false; + } + if (isRelayCompatMode && rule === _graphql.KnownFragmentNamesRule) { + return false; + } + return true; + }); + if (customRules) { + Array.prototype.push.apply(rules, customRules); + } + if (isSchemaDocument) { + Array.prototype.push.apply(rules, specifiedSDLRules); + } + const errors = (0, _graphql.validate)(schema, ast, rules); + return errors.filter(error => { + if (error.message.includes('Unknown directive') && error.nodes) { + const node = error.nodes[0]; + if (node && node.kind === _graphql.Kind.DIRECTIVE) { + const name = node.name.value; + if (name === 'arguments' || name === 'argumentDefinitions') { + return false; + } + } + } + return true; + }); +} + +/***/ }), + +/***/ "./style.css": +/*!*******************!*\ + !*** ./style.css ***! + \*******************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "../../graphiql-react/dist/style.css": +/*!*******************************************!*\ + !*** ../../graphiql-react/dist/style.css ***! + \*******************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "../../graphiql-react/font/fira-code.css": +/*!***********************************************!*\ + !*** ../../graphiql-react/font/fira-code.css ***! + \***********************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "../../graphiql-react/font/roboto.css": +/*!********************************************!*\ + !*** ../../graphiql-react/font/roboto.css ***! + \********************************************/ +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "react": +/*!************************!*\ + !*** external "React" ***! + \************************/ +/***/ (function(module) { + +module.exports = window["React"]; + +/***/ }), + +/***/ "react-dom": +/*!***************************!*\ + !*** external "ReactDOM" ***! + \***************************/ +/***/ (function(module) { + +module.exports = window["ReactDOM"]; + +/***/ }), + +/***/ "../../../node_modules/@headlessui/react/dist/headlessui.dev.cjs": +/*!***********************************************************************!*\ + !*** ../../../node_modules/@headlessui/react/dist/headlessui.dev.cjs ***! + \***********************************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Combobox: () => Combobox, + Dialog: () => Dialog, + Disclosure: () => Disclosure, + FocusTrap: () => FocusTrap, + Listbox: () => Listbox, + Menu: () => Menu, + Popover: () => Popover, + Portal: () => Portal, + RadioGroup: () => RadioGroup, + Switch: () => Switch, + Tab: () => Tab, + Transition: () => Transition +}); +module.exports = __toCommonJS(src_exports); + +// src/components/combobox/combobox.tsx +var import_react19 = __toESM(__webpack_require__(/*! react */ "react"), 1); + +// src/hooks/use-computed.ts +var import_react3 = __webpack_require__(/*! react */ "react"); + +// src/hooks/use-iso-morphic-effect.ts +var import_react = __webpack_require__(/*! react */ "react"); + +// src/utils/env.ts +var Env = class { + constructor() { + __publicField(this, "current", this.detect()); + __publicField(this, "handoffState", "pending"); + __publicField(this, "currentId", 0); + } + set(env2) { + if (this.current === env2) + return; + this.handoffState = "pending"; + this.currentId = 0; + this.current = env2; + } + reset() { + this.set(this.detect()); + } + nextId() { + return ++this.currentId; + } + get isServer() { + return this.current === "server"; + } + get isClient() { + return this.current === "client"; + } + detect() { + if (typeof window === "undefined" || typeof document === "undefined") { + return "server"; + } + return "client"; + } + handoff() { + if (this.handoffState === "pending") { + this.handoffState = "complete"; + } + } + get isHandoffComplete() { + return this.handoffState === "complete"; + } +}; +var env = new Env(); + +// src/hooks/use-iso-morphic-effect.ts +var useIsoMorphicEffect = (effect, deps) => { + if (env.isServer) { + (0, import_react.useEffect)(effect, deps); + } else { + (0, import_react.useLayoutEffect)(effect, deps); + } +}; + +// src/hooks/use-latest-value.ts +var import_react2 = __webpack_require__(/*! react */ "react"); +function useLatestValue(value) { + let cache = (0, import_react2.useRef)(value); + useIsoMorphicEffect(() => { + cache.current = value; + }, [value]); + return cache; +} + +// src/hooks/use-computed.ts +function useComputed(cb, dependencies) { + let [value, setValue] = (0, import_react3.useState)(cb); + let cbRef = useLatestValue(cb); + useIsoMorphicEffect(() => setValue(cbRef.current), [cbRef, setValue, ...dependencies]); + return value; +} + +// src/hooks/use-disposables.ts +var import_react4 = __webpack_require__(/*! react */ "react"); + +// src/utils/micro-task.ts +function microTask(cb) { + if (typeof queueMicrotask === "function") { + queueMicrotask(cb); + } else { + Promise.resolve().then(cb).catch( + (e) => setTimeout(() => { + throw e; + }) + ); + } +} + +// src/utils/disposables.ts +function disposables() { + let _disposables = []; + let api = { + addEventListener(element, name, listener, options) { + element.addEventListener(name, listener, options); + return api.add(() => element.removeEventListener(name, listener, options)); + }, + requestAnimationFrame(...args) { + let raf = requestAnimationFrame(...args); + return api.add(() => cancelAnimationFrame(raf)); + }, + nextFrame(...args) { + return api.requestAnimationFrame(() => { + return api.requestAnimationFrame(...args); + }); + }, + setTimeout(...args) { + let timer = setTimeout(...args); + return api.add(() => clearTimeout(timer)); + }, + microTask(...args) { + let task = { current: true }; + microTask(() => { + if (task.current) { + args[0](); + } + }); + return api.add(() => { + task.current = false; + }); + }, + style(node, property, value) { + let previous = node.style.getPropertyValue(property); + Object.assign(node.style, { [property]: value }); + return this.add(() => { + Object.assign(node.style, { [property]: previous }); + }); + }, + group(cb) { + let d = disposables(); + cb(d); + return this.add(() => d.dispose()); + }, + add(cb) { + _disposables.push(cb); + return () => { + let idx = _disposables.indexOf(cb); + if (idx >= 0) { + for (let dispose of _disposables.splice(idx, 1)) { + dispose(); + } + } + }; + }, + dispose() { + for (let dispose of _disposables.splice(0)) { + dispose(); + } + } + }; + return api; +} + +// src/hooks/use-disposables.ts +function useDisposables() { + let [d] = (0, import_react4.useState)(disposables); + (0, import_react4.useEffect)(() => () => d.dispose(), [d]); + return d; +} + +// src/hooks/use-event.ts +var import_react5 = __toESM(__webpack_require__(/*! react */ "react"), 1); +var useEvent = ( + // TODO: Add React.useEvent ?? once the useEvent hook is available + function useEvent2(cb) { + let cache = useLatestValue(cb); + return import_react5.default.useCallback((...args) => cache.current(...args), [cache]); + } +); + +// src/hooks/use-id.ts +var import_react7 = __toESM(__webpack_require__(/*! react */ "react"), 1); + +// src/hooks/use-server-handoff-complete.ts +var import_react6 = __webpack_require__(/*! react */ "react"); +function useServerHandoffComplete() { + let [complete, setComplete] = (0, import_react6.useState)(env.isHandoffComplete); + if (complete && env.isHandoffComplete === false) { + setComplete(false); + } + (0, import_react6.useEffect)(() => { + if (complete === true) + return; + setComplete(true); + }, [complete]); + (0, import_react6.useEffect)(() => env.handoff(), []); + return complete; +} + +// src/hooks/use-id.ts +var _a; +var useId = ( + // Prefer React's `useId` if it's available. + // @ts-expect-error - `useId` doesn't exist in React < 18. + (_a = import_react7.default.useId) != null ? _a : function useId2() { + let ready = useServerHandoffComplete(); + let [id, setId] = import_react7.default.useState(ready ? () => env.nextId() : null); + useIsoMorphicEffect(() => { + if (id === null) + setId(env.nextId()); + }, [id]); + return id != null ? "" + id : void 0; + } +); + +// src/hooks/use-outside-click.ts +var import_react10 = __webpack_require__(/*! react */ "react"); + +// src/utils/match.ts +function match(value, lookup, ...args) { + if (value in lookup) { + let returnValue = lookup[value]; + return typeof returnValue === "function" ? returnValue(...args) : returnValue; + } + let error = new Error( + `Tried to handle "${value}" but there is no handler defined. Only defined handlers are: ${Object.keys( + lookup + ).map((key) => `"${key}"`).join(", ")}.` + ); + if (Error.captureStackTrace) + Error.captureStackTrace(error, match); + throw error; +} + +// src/utils/owner.ts +function getOwnerDocument(element) { + if (env.isServer) + return null; + if (element instanceof Node) + return element.ownerDocument; + if (element == null ? void 0 : element.hasOwnProperty("current")) { + if (element.current instanceof Node) + return element.current.ownerDocument; + } + return document; +} + +// src/utils/focus-management.ts +var focusableSelector = [ + "[contentEditable=true]", + "[tabindex]", + "a[href]", + "area[href]", + "button:not([disabled])", + "iframe", + "input:not([disabled])", + "select:not([disabled])", + "textarea:not([disabled])" +].map( + false ? ( + // TODO: Remove this once JSDOM fixes the issue where an element that is + // "hidden" can be the document.activeElement, because this is not possible + // in real browsers. + 0 + ) : (selector) => `${selector}:not([tabindex='-1'])` +).join(","); +function getFocusableElements(container = document.body) { + if (container == null) + return []; + return Array.from(container.querySelectorAll(focusableSelector)).sort( + // We want to move `tabIndex={0}` to the end of the list, this is what the browser does as well. + (a, z) => Math.sign((a.tabIndex || Number.MAX_SAFE_INTEGER) - (z.tabIndex || Number.MAX_SAFE_INTEGER)) + ); +} +function isFocusableElement(element, mode = 0 /* Strict */) { + var _a3; + if (element === ((_a3 = getOwnerDocument(element)) == null ? void 0 : _a3.body)) + return false; + return match(mode, { + [0 /* Strict */]() { + return element.matches(focusableSelector); + }, + [1 /* Loose */]() { + let next = element; + while (next !== null) { + if (next.matches(focusableSelector)) + return true; + next = next.parentElement; + } + return false; + } + }); +} +function restoreFocusIfNecessary(element) { + let ownerDocument = getOwnerDocument(element); + disposables().nextFrame(() => { + if (ownerDocument && !isFocusableElement(ownerDocument.activeElement, 0 /* Strict */)) { + focusElement(element); + } + }); +} +if (typeof window !== "undefined" && typeof document !== "undefined") { + document.addEventListener( + "keydown", + (event) => { + if (event.metaKey || event.altKey || event.ctrlKey) { + return; + } + document.documentElement.dataset.headlessuiFocusVisible = ""; + }, + true + ); + document.addEventListener( + "click", + (event) => { + if (event.detail === 1 /* Mouse */) { + delete document.documentElement.dataset.headlessuiFocusVisible; + } else if (event.detail === 0 /* Keyboard */) { + document.documentElement.dataset.headlessuiFocusVisible = ""; + } + }, + true + ); +} +function focusElement(element) { + element == null ? void 0 : element.focus({ preventScroll: true }); +} +var selectableSelector = ["textarea", "input"].join(","); +function isSelectableElement(element) { + var _a3, _b; + return (_b = (_a3 = element == null ? void 0 : element.matches) == null ? void 0 : _a3.call(element, selectableSelector)) != null ? _b : false; +} +function sortByDomNode(nodes, resolveKey = (i) => i) { + return nodes.slice().sort((aItem, zItem) => { + let a = resolveKey(aItem); + let z = resolveKey(zItem); + if (a === null || z === null) + return 0; + let position = a.compareDocumentPosition(z); + if (position & Node.DOCUMENT_POSITION_FOLLOWING) + return -1; + if (position & Node.DOCUMENT_POSITION_PRECEDING) + return 1; + return 0; + }); +} +function focusFrom(current, focus) { + return focusIn(getFocusableElements(), focus, { relativeTo: current }); +} +function focusIn(container, focus, { + sorted = true, + relativeTo = null, + skipElements = [] +} = {}) { + let ownerDocument = Array.isArray(container) ? container.length > 0 ? container[0].ownerDocument : document : container.ownerDocument; + let elements = Array.isArray(container) ? sorted ? sortByDomNode(container) : container : getFocusableElements(container); + if (skipElements.length > 0 && elements.length > 1) { + elements = elements.filter((x) => !skipElements.includes(x)); + } + relativeTo = relativeTo != null ? relativeTo : ownerDocument.activeElement; + let direction = (() => { + if (focus & (1 /* First */ | 4 /* Next */)) + return 1 /* Next */; + if (focus & (2 /* Previous */ | 8 /* Last */)) + return -1 /* Previous */; + throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last"); + })(); + let startIndex = (() => { + if (focus & 1 /* First */) + return 0; + if (focus & 2 /* Previous */) + return Math.max(0, elements.indexOf(relativeTo)) - 1; + if (focus & 4 /* Next */) + return Math.max(0, elements.indexOf(relativeTo)) + 1; + if (focus & 8 /* Last */) + return elements.length - 1; + throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last"); + })(); + let focusOptions = focus & 32 /* NoScroll */ ? { preventScroll: true } : {}; + let offset = 0; + let total = elements.length; + let next = void 0; + do { + if (offset >= total || offset + total <= 0) + return 0 /* Error */; + let nextIdx = startIndex + offset; + if (focus & 16 /* WrapAround */) { + nextIdx = (nextIdx + total) % total; + } else { + if (nextIdx < 0) + return 3 /* Underflow */; + if (nextIdx >= total) + return 1 /* Overflow */; + } + next = elements[nextIdx]; + next == null ? void 0 : next.focus(focusOptions); + offset += direction; + } while (next !== ownerDocument.activeElement); + if (focus & (4 /* Next */ | 2 /* Previous */) && isSelectableElement(next)) { + next.select(); + } + return 2 /* Success */; +} + +// src/hooks/use-document-event.ts +var import_react8 = __webpack_require__(/*! react */ "react"); +function useDocumentEvent(type, listener, options) { + let listenerRef = useLatestValue(listener); + (0, import_react8.useEffect)(() => { + function handler(event) { + listenerRef.current(event); + } + document.addEventListener(type, handler, options); + return () => document.removeEventListener(type, handler, options); + }, [type, options]); +} + +// src/hooks/use-window-event.ts +var import_react9 = __webpack_require__(/*! react */ "react"); +function useWindowEvent(type, listener, options) { + let listenerRef = useLatestValue(listener); + (0, import_react9.useEffect)(() => { + function handler(event) { + listenerRef.current(event); + } + window.addEventListener(type, handler, options); + return () => window.removeEventListener(type, handler, options); + }, [type, options]); +} + +// src/hooks/use-outside-click.ts +function useOutsideClick(containers, cb, enabled = true) { + let enabledRef = (0, import_react10.useRef)(false); + (0, import_react10.useEffect)( + false ? 0 : () => { + requestAnimationFrame(() => { + enabledRef.current = enabled; + }); + }, + [enabled] + ); + function handleOutsideClick(event, resolveTarget) { + if (!enabledRef.current) + return; + if (event.defaultPrevented) + return; + let target = resolveTarget(event); + if (target === null) { + return; + } + if (!target.getRootNode().contains(target)) + return; + let _containers = function resolve(containers2) { + if (typeof containers2 === "function") { + return resolve(containers2()); + } + if (Array.isArray(containers2)) { + return containers2; + } + if (containers2 instanceof Set) { + return containers2; + } + return [containers2]; + }(containers); + for (let container of _containers) { + if (container === null) + continue; + let domNode = container instanceof HTMLElement ? container : container.current; + if (domNode == null ? void 0 : domNode.contains(target)) { + return; + } + if (event.composed && event.composedPath().includes(domNode)) { + return; + } + } + if ( + // This check alllows us to know whether or not we clicked on a "focusable" element like a + // button or an input. This is a backwards compatibility check so that you can open a and click on another which should close Menu A and open Menu B. We might + // revisit that so that you will require 2 clicks instead. + !isFocusableElement(target, 1 /* Loose */) && // This could be improved, but the `Combobox.Button` adds tabIndex={-1} to make it + // unfocusable via the keyboard so that tabbing to the next item from the input doesn't + // first go to the button. + target.tabIndex !== -1 + ) { + event.preventDefault(); + } + return cb(event, target); + } + let initialClickTarget = (0, import_react10.useRef)(null); + useDocumentEvent( + "mousedown", + (event) => { + var _a3, _b; + if (enabledRef.current) { + initialClickTarget.current = ((_b = (_a3 = event.composedPath) == null ? void 0 : _a3.call(event)) == null ? void 0 : _b[0]) || event.target; + } + }, + true + ); + useDocumentEvent( + "click", + (event) => { + if (!initialClickTarget.current) { + return; + } + handleOutsideClick(event, () => { + return initialClickTarget.current; + }); + initialClickTarget.current = null; + }, + // We will use the `capture` phase so that layers in between with `event.stopPropagation()` + // don't "cancel" this outside click check. E.g.: A `Menu` inside a `DialogPanel` if the `Menu` + // is open, and you click outside of it in the `DialogPanel` the `Menu` should close. However, + // the `DialogPanel` has a `onClick(e) { e.stopPropagation() }` which would cancel this. + true + ); + useWindowEvent( + "blur", + (event) => handleOutsideClick( + event, + () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null + ), + true + ); +} + +// src/hooks/use-resolve-button-type.ts +var import_react11 = __webpack_require__(/*! react */ "react"); +function resolveType(props) { + var _a3; + if (props.type) + return props.type; + let tag = (_a3 = props.as) != null ? _a3 : "button"; + if (typeof tag === "string" && tag.toLowerCase() === "button") + return "button"; + return void 0; +} +function useResolveButtonType(props, ref) { + let [type, setType] = (0, import_react11.useState)(() => resolveType(props)); + useIsoMorphicEffect(() => { + setType(resolveType(props)); + }, [props.type, props.as]); + useIsoMorphicEffect(() => { + if (type) + return; + if (!ref.current) + return; + if (ref.current instanceof HTMLButtonElement && !ref.current.hasAttribute("type")) { + setType("button"); + } + }, [type, ref]); + return type; +} + +// src/hooks/use-sync-refs.ts +var import_react12 = __webpack_require__(/*! react */ "react"); +var Optional = Symbol(); +function optionalRef(cb, isOptional = true) { + return Object.assign(cb, { [Optional]: isOptional }); +} +function useSyncRefs(...refs) { + let cache = (0, import_react12.useRef)(refs); + (0, import_react12.useEffect)(() => { + cache.current = refs; + }, [refs]); + let syncRefs = useEvent((value) => { + for (let ref of cache.current) { + if (ref == null) + continue; + if (typeof ref === "function") + ref(value); + else + ref.current = value; + } + }); + return refs.every( + (ref) => ref == null || // @ts-expect-error + (ref == null ? void 0 : ref[Optional]) + ) ? void 0 : syncRefs; +} + +// src/hooks/use-tree-walker.ts +var import_react13 = __webpack_require__(/*! react */ "react"); +function useTreeWalker({ + container, + accept, + walk, + enabled = true +}) { + let acceptRef = (0, import_react13.useRef)(accept); + let walkRef = (0, import_react13.useRef)(walk); + (0, import_react13.useEffect)(() => { + acceptRef.current = accept; + walkRef.current = walk; + }, [accept, walk]); + useIsoMorphicEffect(() => { + if (!container) + return; + if (!enabled) + return; + let ownerDocument = getOwnerDocument(container); + if (!ownerDocument) + return; + let accept2 = acceptRef.current; + let walk2 = walkRef.current; + let acceptNode = Object.assign((node) => accept2(node), { acceptNode: accept2 }); + let walker = ownerDocument.createTreeWalker( + container, + NodeFilter.SHOW_ELEMENT, + acceptNode, + // @ts-expect-error This `false` is a simple small fix for older browsers + false + ); + while (walker.nextNode()) + walk2(walker.currentNode); + }, [container, enabled, acceptRef, walkRef]); +} + +// src/utils/calculate-active-index.ts +function assertNever(x) { + throw new Error("Unexpected object: " + x); +} +function calculateActiveIndex(action, resolvers) { + let items = resolvers.resolveItems(); + if (items.length <= 0) + return null; + let currentActiveIndex = resolvers.resolveActiveIndex(); + let activeIndex = currentActiveIndex != null ? currentActiveIndex : -1; + let nextActiveIndex = (() => { + switch (action.focus) { + case 0 /* First */: + return items.findIndex((item) => !resolvers.resolveDisabled(item)); + case 1 /* Previous */: { + let idx = items.slice().reverse().findIndex((item, idx2, all) => { + if (activeIndex !== -1 && all.length - idx2 - 1 >= activeIndex) + return false; + return !resolvers.resolveDisabled(item); + }); + if (idx === -1) + return idx; + return items.length - 1 - idx; + } + case 2 /* Next */: + return items.findIndex((item, idx) => { + if (idx <= activeIndex) + return false; + return !resolvers.resolveDisabled(item); + }); + case 3 /* Last */: { + let idx = items.slice().reverse().findIndex((item) => !resolvers.resolveDisabled(item)); + if (idx === -1) + return idx; + return items.length - 1 - idx; + } + case 4 /* Specific */: + return items.findIndex((item) => resolvers.resolveId(item) === action.id); + case 5 /* Nothing */: + return null; + default: + assertNever(action); + } + })(); + return nextActiveIndex === -1 ? currentActiveIndex : nextActiveIndex; +} + +// src/utils/render.ts +var import_react14 = __webpack_require__(/*! react */ "react"); + +// src/utils/class-names.ts +function classNames(...classes) { + return classes.filter(Boolean).join(" "); +} + +// src/utils/render.ts +function render({ + ourProps, + theirProps, + slot, + defaultTag, + features, + visible = true, + name +}) { + let props = mergeProps(theirProps, ourProps); + if (visible) + return _render(props, slot, defaultTag, name); + let featureFlags = features != null ? features : 0 /* None */; + if (featureFlags & 2 /* Static */) { + let { static: isStatic = false, ...rest } = props; + if (isStatic) + return _render(rest, slot, defaultTag, name); + } + if (featureFlags & 1 /* RenderStrategy */) { + let { unmount = true, ...rest } = props; + let strategy = unmount ? 0 /* Unmount */ : 1 /* Hidden */; + return match(strategy, { + [0 /* Unmount */]() { + return null; + }, + [1 /* Hidden */]() { + return _render( + { ...rest, ...{ hidden: true, style: { display: "none" } } }, + slot, + defaultTag, + name + ); + } + }); + } + return _render(props, slot, defaultTag, name); +} +function _render(props, slot = {}, tag, name) { + let { + as: Component = tag, + children, + refName = "ref", + ...rest + } = omit(props, ["unmount", "static"]); + let refRelatedProps = props.ref !== void 0 ? { [refName]: props.ref } : {}; + let resolvedChildren = typeof children === "function" ? children(slot) : children; + if ("className" in rest && rest.className && typeof rest.className === "function") { + rest.className = rest.className(slot); + } + let dataAttributes = {}; + if (slot) { + let exposeState = false; + let states = []; + for (let [k, v] of Object.entries(slot)) { + if (typeof v === "boolean") { + exposeState = true; + } + if (v === true) { + states.push(k); + } + } + if (exposeState) + dataAttributes[`data-headlessui-state`] = states.join(" "); + } + if (Component === import_react14.Fragment) { + if (Object.keys(compact(rest)).length > 0) { + if (!(0, import_react14.isValidElement)(resolvedChildren) || Array.isArray(resolvedChildren) && resolvedChildren.length > 1) { + throw new Error( + [ + 'Passing props on "Fragment"!', + "", + `The current component <${name} /> is rendering a "Fragment".`, + `However we need to passthrough the following props:`, + Object.keys(rest).map((line) => ` - ${line}`).join("\n"), + "", + "You can apply a few solutions:", + [ + 'Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', + "Render a single element as the child so that we can forward the props onto that element." + ].map((line) => ` - ${line}`).join("\n") + ].join("\n") + ); + } + let childProps = resolvedChildren.props; + let newClassName = typeof (childProps == null ? void 0 : childProps.className) === "function" ? (...args) => classNames(childProps == null ? void 0 : childProps.className(...args), rest.className) : classNames(childProps == null ? void 0 : childProps.className, rest.className); + let classNameProps = newClassName ? { className: newClassName } : {}; + return (0, import_react14.cloneElement)( + resolvedChildren, + Object.assign( + {}, + // Filter out undefined values so that they don't override the existing values + mergeProps(resolvedChildren.props, compact(omit(rest, ["ref"]))), + dataAttributes, + refRelatedProps, + mergeRefs(resolvedChildren.ref, refRelatedProps.ref), + classNameProps + ) + ); + } + } + return (0, import_react14.createElement)( + Component, + Object.assign( + {}, + omit(rest, ["ref"]), + Component !== import_react14.Fragment && refRelatedProps, + Component !== import_react14.Fragment && dataAttributes + ), + resolvedChildren + ); +} +function mergeRefs(...refs) { + return { + ref: refs.every((ref) => ref == null) ? void 0 : (value) => { + for (let ref of refs) { + if (ref == null) + continue; + if (typeof ref === "function") + ref(value); + else + ref.current = value; + } + } + }; +} +function mergeProps(...listOfProps) { + var _a3; + if (listOfProps.length === 0) + return {}; + if (listOfProps.length === 1) + return listOfProps[0]; + let target = {}; + let eventHandlers = {}; + for (let props of listOfProps) { + for (let prop in props) { + if (prop.startsWith("on") && typeof props[prop] === "function") { + (_a3 = eventHandlers[prop]) != null ? _a3 : eventHandlers[prop] = []; + eventHandlers[prop].push(props[prop]); + } else { + target[prop] = props[prop]; + } + } + } + if (target.disabled || target["aria-disabled"]) { + return Object.assign( + target, + // Set all event listeners that we collected to `undefined`. This is + // important because of the `cloneElement` from above, which merges the + // existing and new props, they don't just override therefore we have to + // explicitly nullify them. + Object.fromEntries(Object.keys(eventHandlers).map((eventName) => [eventName, void 0])) + ); + } + for (let eventName in eventHandlers) { + Object.assign(target, { + [eventName](event, ...args) { + let handlers = eventHandlers[eventName]; + for (let handler of handlers) { + if ((event instanceof Event || (event == null ? void 0 : event.nativeEvent) instanceof Event) && event.defaultPrevented) { + return; + } + handler(event, ...args); + } + } + }); + } + return target; +} +function forwardRefWithAs(component) { + var _a3; + return Object.assign((0, import_react14.forwardRef)(component), { + displayName: (_a3 = component.displayName) != null ? _a3 : component.name + }); +} +function compact(object) { + let clone = Object.assign({}, object); + for (let key in clone) { + if (clone[key] === void 0) + delete clone[key]; + } + return clone; +} +function omit(object, keysToOmit = []) { + let clone = Object.assign({}, object); + for (let key of keysToOmit) { + if (key in clone) + delete clone[key]; + } + return clone; +} + +// src/utils/bugs.ts +function isDisabledReactIssue7711(element) { + let parent = element.parentElement; + let legend = null; + while (parent && !(parent instanceof HTMLFieldSetElement)) { + if (parent instanceof HTMLLegendElement) + legend = parent; + parent = parent.parentElement; + } + let isParentDisabled = (parent == null ? void 0 : parent.getAttribute("disabled")) === ""; + if (isParentDisabled && isFirstLegend(legend)) + return false; + return isParentDisabled; +} +function isFirstLegend(element) { + if (!element) + return false; + let previous = element.previousElementSibling; + while (previous !== null) { + if (previous instanceof HTMLLegendElement) + return false; + previous = previous.previousElementSibling; + } + return true; +} + +// src/utils/form.ts +function objectToFormEntries(source = {}, parentKey = null, entries = []) { + for (let [key, value] of Object.entries(source)) { + append(entries, composeKey(parentKey, key), value); + } + return entries; +} +function composeKey(parent, key) { + return parent ? parent + "[" + key + "]" : key; +} +function append(entries, key, value) { + if (Array.isArray(value)) { + for (let [subkey, subvalue] of value.entries()) { + append(entries, composeKey(key, subkey.toString()), subvalue); + } + } else if (value instanceof Date) { + entries.push([key, value.toISOString()]); + } else if (typeof value === "boolean") { + entries.push([key, value ? "1" : "0"]); + } else if (typeof value === "string") { + entries.push([key, value]); + } else if (typeof value === "number") { + entries.push([key, `${value}`]); + } else if (value === null || value === void 0) { + entries.push([key, ""]); + } else { + objectToFormEntries(value, key, entries); + } +} +function attemptSubmit(element) { + var _a3; + let form = (_a3 = element == null ? void 0 : element.form) != null ? _a3 : element.closest("form"); + if (!form) + return; + for (let element2 of form.elements) { + if (element2.tagName === "INPUT" && element2.type === "submit" || element2.tagName === "BUTTON" && element2.type === "submit" || element2.nodeName === "INPUT" && element2.type === "image") { + element2.click(); + return; + } + } +} + +// src/internal/hidden.tsx +var DEFAULT_VISUALLY_HIDDEN_TAG = "div"; +function VisuallyHidden(props, ref) { + let { features = 1 /* None */, ...theirProps } = props; + let ourProps = { + ref, + "aria-hidden": (features & 2 /* Focusable */) === 2 /* Focusable */ ? true : void 0, + style: { + position: "fixed", + top: 1, + left: 1, + width: 1, + height: 0, + padding: 0, + margin: -1, + overflow: "hidden", + clip: "rect(0, 0, 0, 0)", + whiteSpace: "nowrap", + borderWidth: "0", + ...(features & 4 /* Hidden */) === 4 /* Hidden */ && !((features & 2 /* Focusable */) === 2 /* Focusable */) && { display: "none" } + } + }; + return render({ + ourProps, + theirProps, + slot: {}, + defaultTag: DEFAULT_VISUALLY_HIDDEN_TAG, + name: "Hidden" + }); +} +var Hidden = forwardRefWithAs(VisuallyHidden); + +// src/internal/open-closed.tsx +var import_react15 = __toESM(__webpack_require__(/*! react */ "react"), 1); +var Context = (0, import_react15.createContext)(null); +Context.displayName = "OpenClosedContext"; +function useOpenClosed() { + return (0, import_react15.useContext)(Context); +} +function OpenClosedProvider({ value, children }) { + return /* @__PURE__ */ import_react15.default.createElement(Context.Provider, { value }, children); +} + +// src/hooks/use-controllable.ts +var import_react16 = __webpack_require__(/*! react */ "react"); +function useControllable(controlledValue, onChange, defaultValue) { + let [internalValue, setInternalValue] = (0, import_react16.useState)(defaultValue); + let isControlled = controlledValue !== void 0; + let wasControlled = (0, import_react16.useRef)(isControlled); + let didWarnOnUncontrolledToControlled = (0, import_react16.useRef)(false); + let didWarnOnControlledToUncontrolled = (0, import_react16.useRef)(false); + if (isControlled && !wasControlled.current && !didWarnOnUncontrolledToControlled.current) { + didWarnOnUncontrolledToControlled.current = true; + wasControlled.current = isControlled; + console.error( + "A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen." + ); + } else if (!isControlled && wasControlled.current && !didWarnOnControlledToUncontrolled.current) { + didWarnOnControlledToUncontrolled.current = true; + wasControlled.current = isControlled; + console.error( + "A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen." + ); + } + return [ + isControlled ? controlledValue : internalValue, + useEvent((value) => { + if (isControlled) { + return onChange == null ? void 0 : onChange(value); + } else { + setInternalValue(value); + return onChange == null ? void 0 : onChange(value); + } + }) + ]; +} + +// src/hooks/use-watch.ts +var import_react17 = __webpack_require__(/*! react */ "react"); +function useWatch(cb, dependencies) { + let track = (0, import_react17.useRef)([]); + let action = useEvent(cb); + (0, import_react17.useEffect)(() => { + let oldValues = [...track.current]; + for (let [idx, value] of dependencies.entries()) { + if (track.current[idx] !== value) { + let returnValue = action(dependencies, oldValues); + track.current = dependencies; + return returnValue; + } + } + }, [action, ...dependencies]); +} + +// src/hooks/use-tracked-pointer.ts +var import_react18 = __webpack_require__(/*! react */ "react"); +function eventToPosition(evt) { + return [evt.screenX, evt.screenY]; +} +function useTrackedPointer() { + let lastPos = (0, import_react18.useRef)([-1, -1]); + return { + wasMoved(evt) { + if (false) {} + let newPos = eventToPosition(evt); + if (lastPos.current[0] === newPos[0] && lastPos.current[1] === newPos[1]) { + return false; + } + lastPos.current = newPos; + return true; + }, + update(evt) { + lastPos.current = eventToPosition(evt); + } + }; +} + +// src/utils/platform.ts +function isIOS() { + return ( + // Check if it is an iPhone + /iPhone/gi.test(window.navigator.platform) || // Check if it is an iPad. iPad reports itself as "MacIntel", but we can check if it is a touch + // screen. Let's hope that Apple doesn't release a touch screen Mac (or maybe this would then + // work as expected 🤔). + /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0 + ); +} +function isAndroid() { + return /Android/gi.test(window.navigator.userAgent); +} +function isMobile() { + return isIOS() || isAndroid(); +} + +// src/components/combobox/combobox.tsx +function adjustOrderedState(state, adjustment = (i) => i) { + let currentActiveOption = state.activeOptionIndex !== null ? state.options[state.activeOptionIndex] : null; + let sortedOptions = sortByDomNode( + adjustment(state.options.slice()), + (option) => option.dataRef.current.domRef.current + ); + let adjustedActiveOptionIndex = currentActiveOption ? sortedOptions.indexOf(currentActiveOption) : null; + if (adjustedActiveOptionIndex === -1) { + adjustedActiveOptionIndex = null; + } + return { + options: sortedOptions, + activeOptionIndex: adjustedActiveOptionIndex + }; +} +var reducers = { + [1 /* CloseCombobox */](state) { + var _a3; + if ((_a3 = state.dataRef.current) == null ? void 0 : _a3.disabled) + return state; + if (state.comboboxState === 1 /* Closed */) + return state; + return { ...state, activeOptionIndex: null, comboboxState: 1 /* Closed */ }; + }, + [0 /* OpenCombobox */](state) { + var _a3; + if ((_a3 = state.dataRef.current) == null ? void 0 : _a3.disabled) + return state; + if (state.comboboxState === 0 /* Open */) + return state; + let activeOptionIndex = state.activeOptionIndex; + if (state.dataRef.current) { + let { isSelected } = state.dataRef.current; + let optionIdx = state.options.findIndex((option) => isSelected(option.dataRef.current.value)); + if (optionIdx !== -1) { + activeOptionIndex = optionIdx; + } + } + return { ...state, comboboxState: 0 /* Open */, activeOptionIndex }; + }, + [2 /* GoToOption */](state, action) { + var _a3, _b, _c, _d; + if ((_a3 = state.dataRef.current) == null ? void 0 : _a3.disabled) + return state; + if (((_b = state.dataRef.current) == null ? void 0 : _b.optionsRef.current) && !((_c = state.dataRef.current) == null ? void 0 : _c.optionsPropsRef.current.static) && state.comboboxState === 1 /* Closed */) { + return state; + } + let adjustedState = adjustOrderedState(state); + if (adjustedState.activeOptionIndex === null) { + let localActiveOptionIndex = adjustedState.options.findIndex( + (option) => !option.dataRef.current.disabled + ); + if (localActiveOptionIndex !== -1) { + adjustedState.activeOptionIndex = localActiveOptionIndex; + } + } + let activeOptionIndex = calculateActiveIndex(action, { + resolveItems: () => adjustedState.options, + resolveActiveIndex: () => adjustedState.activeOptionIndex, + resolveId: (item) => item.id, + resolveDisabled: (item) => item.dataRef.current.disabled + }); + return { + ...state, + ...adjustedState, + activeOptionIndex, + activationTrigger: (_d = action.trigger) != null ? _d : 1 /* Other */ + }; + }, + [3 /* RegisterOption */]: (state, action) => { + var _a3, _b; + let option = { id: action.id, dataRef: action.dataRef }; + let adjustedState = adjustOrderedState(state, (options) => [...options, option]); + if (state.activeOptionIndex === null) { + if ((_a3 = state.dataRef.current) == null ? void 0 : _a3.isSelected(action.dataRef.current.value)) { + adjustedState.activeOptionIndex = adjustedState.options.indexOf(option); + } + } + let nextState = { + ...state, + ...adjustedState, + activationTrigger: 1 /* Other */ + }; + if (((_b = state.dataRef.current) == null ? void 0 : _b.__demoMode) && state.dataRef.current.value === void 0) { + nextState.activeOptionIndex = 0; + } + return nextState; + }, + [4 /* UnregisterOption */]: (state, action) => { + let adjustedState = adjustOrderedState(state, (options) => { + let idx = options.findIndex((a) => a.id === action.id); + if (idx !== -1) + options.splice(idx, 1); + return options; + }); + return { + ...state, + ...adjustedState, + activationTrigger: 1 /* Other */ + }; + }, + [5 /* RegisterLabel */]: (state, action) => { + return { + ...state, + labelId: action.id + }; + } +}; +var ComboboxActionsContext = (0, import_react19.createContext)(null); +ComboboxActionsContext.displayName = "ComboboxActionsContext"; +function useActions(component) { + let context = (0, import_react19.useContext)(ComboboxActionsContext); + if (context === null) { + let err = new Error(`<${component} /> is missing a parent component.`); + if (Error.captureStackTrace) + Error.captureStackTrace(err, useActions); + throw err; + } + return context; +} +var ComboboxDataContext = (0, import_react19.createContext)(null); +ComboboxDataContext.displayName = "ComboboxDataContext"; +function useData(component) { + let context = (0, import_react19.useContext)(ComboboxDataContext); + if (context === null) { + let err = new Error(`<${component} /> is missing a parent component.`); + if (Error.captureStackTrace) + Error.captureStackTrace(err, useData); + throw err; + } + return context; +} +function stateReducer(state, action) { + return match(action.type, reducers, state, action); +} +var DEFAULT_COMBOBOX_TAG = import_react19.Fragment; +function ComboboxFn(props, ref) { + let { + value: controlledValue, + defaultValue, + onChange: controlledOnChange, + form: formName, + name, + by = (a, z) => a === z, + disabled = false, + __demoMode = false, + nullable = false, + multiple = false, + ...theirProps + } = props; + let [value = multiple ? [] : void 0, theirOnChange] = useControllable( + controlledValue, + controlledOnChange, + defaultValue + ); + let [state, dispatch] = (0, import_react19.useReducer)(stateReducer, { + dataRef: (0, import_react19.createRef)(), + comboboxState: __demoMode ? 0 /* Open */ : 1 /* Closed */, + options: [], + activeOptionIndex: null, + activationTrigger: 1 /* Other */, + labelId: null + }); + let defaultToFirstOption = (0, import_react19.useRef)(false); + let optionsPropsRef = (0, import_react19.useRef)({ static: false, hold: false }); + let labelRef = (0, import_react19.useRef)(null); + let inputRef = (0, import_react19.useRef)(null); + let buttonRef = (0, import_react19.useRef)(null); + let optionsRef = (0, import_react19.useRef)(null); + let compare = useEvent( + // @ts-expect-error Eventually we'll want to tackle this, but for now this will do. + typeof by === "string" ? (a, z) => { + let property = by; + return (a == null ? void 0 : a[property]) === (z == null ? void 0 : z[property]); + } : by + ); + let isSelected = (0, import_react19.useCallback)( + (compareValue) => match(data.mode, { + [1 /* Multi */]: () => value.some((option) => compare(option, compareValue)), + [0 /* Single */]: () => compare(value, compareValue) + }), + [value] + ); + let data = (0, import_react19.useMemo)( + () => ({ + ...state, + optionsPropsRef, + labelRef, + inputRef, + buttonRef, + optionsRef, + value, + defaultValue, + disabled, + mode: multiple ? 1 /* Multi */ : 0 /* Single */, + get activeOptionIndex() { + if (defaultToFirstOption.current && state.activeOptionIndex === null && state.options.length > 0) { + let localActiveOptionIndex = state.options.findIndex( + (option) => !option.dataRef.current.disabled + ); + if (localActiveOptionIndex !== -1) { + return localActiveOptionIndex; + } + } + return state.activeOptionIndex; + }, + compare, + isSelected, + nullable, + __demoMode + }), + [value, defaultValue, disabled, multiple, nullable, __demoMode, state] + ); + let lastActiveOption = (0, import_react19.useRef)( + data.activeOptionIndex !== null ? data.options[data.activeOptionIndex] : null + ); + (0, import_react19.useEffect)(() => { + let currentActiveOption = data.activeOptionIndex !== null ? data.options[data.activeOptionIndex] : null; + if (lastActiveOption.current !== currentActiveOption) { + lastActiveOption.current = currentActiveOption; + } + }); + useIsoMorphicEffect(() => { + state.dataRef.current = data; + }, [data]); + useOutsideClick( + [data.buttonRef, data.inputRef, data.optionsRef], + () => actions.closeCombobox(), + data.comboboxState === 0 /* Open */ + ); + let slot = (0, import_react19.useMemo)( + () => ({ + open: data.comboboxState === 0 /* Open */, + disabled, + activeIndex: data.activeOptionIndex, + activeOption: data.activeOptionIndex === null ? null : data.options[data.activeOptionIndex].dataRef.current.value, + value + }), + [data, disabled, value] + ); + let selectOption = useEvent((id) => { + let option = data.options.find((item) => item.id === id); + if (!option) + return; + onChange(option.dataRef.current.value); + }); + let selectActiveOption = useEvent(() => { + if (data.activeOptionIndex !== null) { + let { dataRef, id } = data.options[data.activeOptionIndex]; + onChange(dataRef.current.value); + actions.goToOption(4 /* Specific */, id); + } + }); + let openCombobox = useEvent(() => { + dispatch({ type: 0 /* OpenCombobox */ }); + defaultToFirstOption.current = true; + }); + let closeCombobox = useEvent(() => { + dispatch({ type: 1 /* CloseCombobox */ }); + defaultToFirstOption.current = false; + }); + let goToOption = useEvent((focus, id, trigger) => { + defaultToFirstOption.current = false; + if (focus === 4 /* Specific */) { + return dispatch({ type: 2 /* GoToOption */, focus: 4 /* Specific */, id, trigger }); + } + return dispatch({ type: 2 /* GoToOption */, focus, trigger }); + }); + let registerOption = useEvent((id, dataRef) => { + dispatch({ type: 3 /* RegisterOption */, id, dataRef }); + return () => { + var _a3; + if (((_a3 = lastActiveOption.current) == null ? void 0 : _a3.id) === id) { + defaultToFirstOption.current = true; + } + dispatch({ type: 4 /* UnregisterOption */, id }); + }; + }); + let registerLabel = useEvent((id) => { + dispatch({ type: 5 /* RegisterLabel */, id }); + return () => dispatch({ type: 5 /* RegisterLabel */, id: null }); + }); + let onChange = useEvent((value2) => { + return match(data.mode, { + [0 /* Single */]() { + return theirOnChange == null ? void 0 : theirOnChange(value2); + }, + [1 /* Multi */]() { + let copy = data.value.slice(); + let idx = copy.findIndex((item) => compare(item, value2)); + if (idx === -1) { + copy.push(value2); + } else { + copy.splice(idx, 1); + } + return theirOnChange == null ? void 0 : theirOnChange(copy); + } + }); + }); + let actions = (0, import_react19.useMemo)( + () => ({ + onChange, + registerOption, + registerLabel, + goToOption, + closeCombobox, + openCombobox, + selectActiveOption, + selectOption + }), + [] + ); + let ourProps = ref === null ? {} : { ref }; + let form = (0, import_react19.useRef)(null); + let d = useDisposables(); + (0, import_react19.useEffect)(() => { + if (!form.current) + return; + if (defaultValue === void 0) + return; + d.addEventListener(form.current, "reset", () => { + onChange(defaultValue); + }); + }, [ + form, + onChange + /* Explicitly ignoring `defaultValue` */ + ]); + return /* @__PURE__ */ import_react19.default.createElement(ComboboxActionsContext.Provider, { value: actions }, /* @__PURE__ */ import_react19.default.createElement(ComboboxDataContext.Provider, { value: data }, /* @__PURE__ */ import_react19.default.createElement( + OpenClosedProvider, + { + value: match(data.comboboxState, { + [0 /* Open */]: 1 /* Open */, + [1 /* Closed */]: 2 /* Closed */ + }) + }, + name != null && value != null && objectToFormEntries({ [name]: value }).map(([name2, value2], idx) => /* @__PURE__ */ import_react19.default.createElement( + Hidden, + { + features: 4 /* Hidden */, + ref: idx === 0 ? (element) => { + var _a3; + form.current = (_a3 = element == null ? void 0 : element.closest("form")) != null ? _a3 : null; + } : void 0, + ...compact({ + key: name2, + as: "input", + type: "hidden", + hidden: true, + readOnly: true, + form: formName, + name: name2, + value: value2 + }) + } + )), + render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_COMBOBOX_TAG, + name: "Combobox" + }) + ))); +} +var DEFAULT_INPUT_TAG = "input"; +function InputFn(props, ref) { + var _a3, _b, _c, _d; + let internalId = useId(); + let { + id = `headlessui-combobox-input-${internalId}`, + onChange, + displayValue, + // @ts-ignore: We know this MAY NOT exist for a given tag but we only care when it _does_ exist. + type = "text", + ...theirProps + } = props; + let data = useData("Combobox.Input"); + let actions = useActions("Combobox.Input"); + let inputRef = useSyncRefs(data.inputRef, ref); + let isTyping = (0, import_react19.useRef)(false); + let d = useDisposables(); + let currentDisplayValue = function() { + var _a4; + if (typeof displayValue === "function" && data.value !== void 0) { + return (_a4 = displayValue(data.value)) != null ? _a4 : ""; + } else if (typeof data.value === "string") { + return data.value; + } else { + return ""; + } + }(); + useWatch( + ([currentDisplayValue2, state], [oldCurrentDisplayValue, oldState]) => { + if (isTyping.current) + return; + if (!data.inputRef.current) + return; + if (oldState === 0 /* Open */ && state === 1 /* Closed */) { + data.inputRef.current.value = currentDisplayValue2; + } else if (currentDisplayValue2 !== oldCurrentDisplayValue) { + data.inputRef.current.value = currentDisplayValue2; + } + }, + [currentDisplayValue, data.comboboxState] + ); + useWatch( + ([newState], [oldState]) => { + if (newState === 0 /* Open */ && oldState === 1 /* Closed */) { + let input = data.inputRef.current; + if (!input) + return; + let currentValue = input.value; + let { selectionStart, selectionEnd, selectionDirection } = input; + input.value = ""; + input.value = currentValue; + if (selectionDirection !== null) { + input.setSelectionRange(selectionStart, selectionEnd, selectionDirection); + } else { + input.setSelectionRange(selectionStart, selectionEnd); + } + } + }, + [data.comboboxState] + ); + let isComposing = (0, import_react19.useRef)(false); + let composedChangeEvent = (0, import_react19.useRef)(null); + let handleCompositionStart = useEvent(() => { + isComposing.current = true; + }); + let handleCompositionEnd = useEvent(() => { + d.nextFrame(() => { + isComposing.current = false; + if (composedChangeEvent.current) { + actions.openCombobox(); + onChange == null ? void 0 : onChange(composedChangeEvent.current); + composedChangeEvent.current = null; + } + }); + }); + let handleKeyDown = useEvent((event) => { + isTyping.current = true; + switch (event.key) { + case "Backspace" /* Backspace */: + case "Delete" /* Delete */: + if (data.mode !== 0 /* Single */) + return; + if (!data.nullable) + return; + let input = event.currentTarget; + d.requestAnimationFrame(() => { + if (input.value === "") { + actions.onChange(null); + if (data.optionsRef.current) { + data.optionsRef.current.scrollTop = 0; + } + actions.goToOption(5 /* Nothing */); + } + }); + break; + case "Enter" /* Enter */: + isTyping.current = false; + if (data.comboboxState !== 0 /* Open */) + return; + if (isComposing.current) + return; + event.preventDefault(); + event.stopPropagation(); + if (data.activeOptionIndex === null) { + actions.closeCombobox(); + return; + } + actions.selectActiveOption(); + if (data.mode === 0 /* Single */) { + actions.closeCombobox(); + } + break; + case "ArrowDown" /* ArrowDown */: + isTyping.current = false; + event.preventDefault(); + event.stopPropagation(); + return match(data.comboboxState, { + [0 /* Open */]: () => { + actions.goToOption(2 /* Next */); + }, + [1 /* Closed */]: () => { + actions.openCombobox(); + } + }); + case "ArrowUp" /* ArrowUp */: + isTyping.current = false; + event.preventDefault(); + event.stopPropagation(); + return match(data.comboboxState, { + [0 /* Open */]: () => { + actions.goToOption(1 /* Previous */); + }, + [1 /* Closed */]: () => { + actions.openCombobox(); + d.nextFrame(() => { + if (!data.value) { + actions.goToOption(3 /* Last */); + } + }); + } + }); + case "Home" /* Home */: + if (event.shiftKey) { + break; + } + isTyping.current = false; + event.preventDefault(); + event.stopPropagation(); + return actions.goToOption(0 /* First */); + case "PageUp" /* PageUp */: + isTyping.current = false; + event.preventDefault(); + event.stopPropagation(); + return actions.goToOption(0 /* First */); + case "End" /* End */: + if (event.shiftKey) { + break; + } + isTyping.current = false; + event.preventDefault(); + event.stopPropagation(); + return actions.goToOption(3 /* Last */); + case "PageDown" /* PageDown */: + isTyping.current = false; + event.preventDefault(); + event.stopPropagation(); + return actions.goToOption(3 /* Last */); + case "Escape" /* Escape */: + isTyping.current = false; + if (data.comboboxState !== 0 /* Open */) + return; + event.preventDefault(); + if (data.optionsRef.current && !data.optionsPropsRef.current.static) { + event.stopPropagation(); + } + return actions.closeCombobox(); + case "Tab" /* Tab */: + isTyping.current = false; + if (data.comboboxState !== 0 /* Open */) + return; + if (data.mode === 0 /* Single */) + actions.selectActiveOption(); + actions.closeCombobox(); + break; + } + }); + let handleChange = useEvent((event) => { + if (isComposing.current) { + composedChangeEvent.current = event; + return; + } + actions.openCombobox(); + onChange == null ? void 0 : onChange(event); + }); + let handleBlur = useEvent(() => { + isTyping.current = false; + }); + let labelledby = useComputed(() => { + if (!data.labelId) + return void 0; + return [data.labelId].join(" "); + }, [data.labelId]); + let slot = (0, import_react19.useMemo)( + () => ({ open: data.comboboxState === 0 /* Open */, disabled: data.disabled }), + [data] + ); + let ourProps = { + ref: inputRef, + id, + role: "combobox", + type, + "aria-controls": (_a3 = data.optionsRef.current) == null ? void 0 : _a3.id, + "aria-expanded": data.disabled ? void 0 : data.comboboxState === 0 /* Open */, + "aria-activedescendant": data.activeOptionIndex === null ? void 0 : (_b = data.options[data.activeOptionIndex]) == null ? void 0 : _b.id, + "aria-labelledby": labelledby, + "aria-autocomplete": "list", + defaultValue: (_d = (_c = props.defaultValue) != null ? _c : data.defaultValue !== void 0 ? displayValue == null ? void 0 : displayValue(data.defaultValue) : null) != null ? _d : data.defaultValue, + disabled: data.disabled, + onCompositionStart: handleCompositionStart, + onCompositionEnd: handleCompositionEnd, + onKeyDown: handleKeyDown, + onChange: handleChange, + onBlur: handleBlur + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_INPUT_TAG, + name: "Combobox.Input" + }); +} +var DEFAULT_BUTTON_TAG = "button"; +function ButtonFn(props, ref) { + var _a3; + let data = useData("Combobox.Button"); + let actions = useActions("Combobox.Button"); + let buttonRef = useSyncRefs(data.buttonRef, ref); + let internalId = useId(); + let { id = `headlessui-combobox-button-${internalId}`, ...theirProps } = props; + let d = useDisposables(); + let handleKeyDown = useEvent((event) => { + switch (event.key) { + case "ArrowDown" /* ArrowDown */: + event.preventDefault(); + event.stopPropagation(); + if (data.comboboxState === 1 /* Closed */) { + actions.openCombobox(); + } + return d.nextFrame(() => { + var _a4; + return (_a4 = data.inputRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); + }); + case "ArrowUp" /* ArrowUp */: + event.preventDefault(); + event.stopPropagation(); + if (data.comboboxState === 1 /* Closed */) { + actions.openCombobox(); + d.nextFrame(() => { + if (!data.value) { + actions.goToOption(3 /* Last */); + } + }); + } + return d.nextFrame(() => { + var _a4; + return (_a4 = data.inputRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); + }); + case "Escape" /* Escape */: + if (data.comboboxState !== 0 /* Open */) + return; + event.preventDefault(); + if (data.optionsRef.current && !data.optionsPropsRef.current.static) { + event.stopPropagation(); + } + actions.closeCombobox(); + return d.nextFrame(() => { + var _a4; + return (_a4 = data.inputRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); + }); + default: + return; + } + }); + let handleClick = useEvent((event) => { + if (isDisabledReactIssue7711(event.currentTarget)) + return event.preventDefault(); + if (data.comboboxState === 0 /* Open */) { + actions.closeCombobox(); + } else { + event.preventDefault(); + actions.openCombobox(); + } + d.nextFrame(() => { + var _a4; + return (_a4 = data.inputRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); + }); + }); + let labelledby = useComputed(() => { + if (!data.labelId) + return void 0; + return [data.labelId, id].join(" "); + }, [data.labelId, id]); + let slot = (0, import_react19.useMemo)( + () => ({ + open: data.comboboxState === 0 /* Open */, + disabled: data.disabled, + value: data.value + }), + [data] + ); + let ourProps = { + ref: buttonRef, + id, + type: useResolveButtonType(props, data.buttonRef), + tabIndex: -1, + "aria-haspopup": "listbox", + "aria-controls": (_a3 = data.optionsRef.current) == null ? void 0 : _a3.id, + "aria-expanded": data.disabled ? void 0 : data.comboboxState === 0 /* Open */, + "aria-labelledby": labelledby, + disabled: data.disabled, + onClick: handleClick, + onKeyDown: handleKeyDown + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_BUTTON_TAG, + name: "Combobox.Button" + }); +} +var DEFAULT_LABEL_TAG = "label"; +function LabelFn(props, ref) { + let internalId = useId(); + let { id = `headlessui-combobox-label-${internalId}`, ...theirProps } = props; + let data = useData("Combobox.Label"); + let actions = useActions("Combobox.Label"); + let labelRef = useSyncRefs(data.labelRef, ref); + useIsoMorphicEffect(() => actions.registerLabel(id), [id]); + let handleClick = useEvent(() => { + var _a3; + return (_a3 = data.inputRef.current) == null ? void 0 : _a3.focus({ preventScroll: true }); + }); + let slot = (0, import_react19.useMemo)( + () => ({ open: data.comboboxState === 0 /* Open */, disabled: data.disabled }), + [data] + ); + let ourProps = { ref: labelRef, id, onClick: handleClick }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_LABEL_TAG, + name: "Combobox.Label" + }); +} +var DEFAULT_OPTIONS_TAG = "ul"; +var OptionsRenderFeatures = 1 /* RenderStrategy */ | 2 /* Static */; +function OptionsFn(props, ref) { + let internalId = useId(); + let { id = `headlessui-combobox-options-${internalId}`, hold = false, ...theirProps } = props; + let data = useData("Combobox.Options"); + let optionsRef = useSyncRefs(data.optionsRef, ref); + let usesOpenClosedState = useOpenClosed(); + let visible = (() => { + if (usesOpenClosedState !== null) { + return (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; + } + return data.comboboxState === 0 /* Open */; + })(); + useIsoMorphicEffect(() => { + var _a3; + data.optionsPropsRef.current.static = (_a3 = props.static) != null ? _a3 : false; + }, [data.optionsPropsRef, props.static]); + useIsoMorphicEffect(() => { + data.optionsPropsRef.current.hold = hold; + }, [data.optionsPropsRef, hold]); + useTreeWalker({ + container: data.optionsRef.current, + enabled: data.comboboxState === 0 /* Open */, + accept(node) { + if (node.getAttribute("role") === "option") + return NodeFilter.FILTER_REJECT; + if (node.hasAttribute("role")) + return NodeFilter.FILTER_SKIP; + return NodeFilter.FILTER_ACCEPT; + }, + walk(node) { + node.setAttribute("role", "none"); + } + }); + let labelledby = useComputed( + () => { + var _a3, _b; + return (_b = data.labelId) != null ? _b : (_a3 = data.buttonRef.current) == null ? void 0 : _a3.id; + }, + [data.labelId, data.buttonRef.current] + ); + let slot = (0, import_react19.useMemo)( + () => ({ open: data.comboboxState === 0 /* Open */ }), + [data] + ); + let ourProps = { + "aria-labelledby": labelledby, + role: "listbox", + "aria-multiselectable": data.mode === 1 /* Multi */ ? true : void 0, + id, + ref: optionsRef + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_OPTIONS_TAG, + features: OptionsRenderFeatures, + visible, + name: "Combobox.Options" + }); +} +var DEFAULT_OPTION_TAG = "li"; +function OptionFn(props, ref) { + var _a3, _b; + let internalId = useId(); + let { + id = `headlessui-combobox-option-${internalId}`, + disabled = false, + value, + ...theirProps + } = props; + let data = useData("Combobox.Option"); + let actions = useActions("Combobox.Option"); + let active = data.activeOptionIndex !== null ? data.options[data.activeOptionIndex].id === id : false; + let selected = data.isSelected(value); + let internalOptionRef = (0, import_react19.useRef)(null); + let bag = useLatestValue({ + disabled, + value, + domRef: internalOptionRef, + textValue: (_b = (_a3 = internalOptionRef.current) == null ? void 0 : _a3.textContent) == null ? void 0 : _b.toLowerCase() + }); + let optionRef = useSyncRefs(ref, internalOptionRef); + let select = useEvent(() => actions.selectOption(id)); + useIsoMorphicEffect(() => actions.registerOption(id, bag), [bag, id]); + let enableScrollIntoView = (0, import_react19.useRef)(data.__demoMode ? false : true); + useIsoMorphicEffect(() => { + if (!data.__demoMode) + return; + let d = disposables(); + d.requestAnimationFrame(() => { + enableScrollIntoView.current = true; + }); + return d.dispose; + }, []); + useIsoMorphicEffect(() => { + if (data.comboboxState !== 0 /* Open */) + return; + if (!active) + return; + if (!enableScrollIntoView.current) + return; + if (data.activationTrigger === 0 /* Pointer */) + return; + let d = disposables(); + d.requestAnimationFrame(() => { + var _a4, _b2; + (_b2 = (_a4 = internalOptionRef.current) == null ? void 0 : _a4.scrollIntoView) == null ? void 0 : _b2.call(_a4, { block: "nearest" }); + }); + return d.dispose; + }, [ + internalOptionRef, + active, + data.comboboxState, + data.activationTrigger, + /* We also want to trigger this when the position of the active item changes so that we can re-trigger the scrollIntoView */ + data.activeOptionIndex + ]); + let handleClick = useEvent((event) => { + if (disabled) + return event.preventDefault(); + select(); + if (data.mode === 0 /* Single */) { + actions.closeCombobox(); + } + if (!isMobile()) { + requestAnimationFrame(() => { + var _a4; + return (_a4 = data.inputRef.current) == null ? void 0 : _a4.focus(); + }); + } + }); + let handleFocus = useEvent(() => { + if (disabled) + return actions.goToOption(5 /* Nothing */); + actions.goToOption(4 /* Specific */, id); + }); + let pointer = useTrackedPointer(); + let handleEnter = useEvent((evt) => pointer.update(evt)); + let handleMove = useEvent((evt) => { + if (!pointer.wasMoved(evt)) + return; + if (disabled) + return; + if (active) + return; + actions.goToOption(4 /* Specific */, id, 0 /* Pointer */); + }); + let handleLeave = useEvent((evt) => { + if (!pointer.wasMoved(evt)) + return; + if (disabled) + return; + if (!active) + return; + if (data.optionsPropsRef.current.hold) + return; + actions.goToOption(5 /* Nothing */); + }); + let slot = (0, import_react19.useMemo)( + () => ({ active, selected, disabled }), + [active, selected, disabled] + ); + let ourProps = { + id, + ref: optionRef, + role: "option", + tabIndex: disabled === true ? void 0 : -1, + "aria-disabled": disabled === true ? true : void 0, + // According to the WAI-ARIA best practices, we should use aria-checked for + // multi-select,but Voice-Over disagrees. So we use aria-checked instead for + // both single and multi-select. + "aria-selected": selected, + disabled: void 0, + // Never forward the `disabled` prop + onClick: handleClick, + onFocus: handleFocus, + onPointerEnter: handleEnter, + onMouseEnter: handleEnter, + onPointerMove: handleMove, + onMouseMove: handleMove, + onPointerLeave: handleLeave, + onMouseLeave: handleLeave + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_OPTION_TAG, + name: "Combobox.Option" + }); +} +var ComboboxRoot = forwardRefWithAs(ComboboxFn); +var Button = forwardRefWithAs(ButtonFn); +var Input = forwardRefWithAs(InputFn); +var Label = forwardRefWithAs(LabelFn); +var Options = forwardRefWithAs(OptionsFn); +var Option = forwardRefWithAs(OptionFn); +var Combobox = Object.assign(ComboboxRoot, { Input, Button, Label, Options, Option }); + +// src/components/dialog/dialog.tsx +var import_react31 = __toESM(__webpack_require__(/*! react */ "react"), 1); + +// src/components/focus-trap/focus-trap.tsx +var import_react25 = __toESM(__webpack_require__(/*! react */ "react"), 1); + +// src/hooks/use-tab-direction.ts +var import_react20 = __webpack_require__(/*! react */ "react"); +function useTabDirection() { + let direction = (0, import_react20.useRef)(0 /* Forwards */); + useWindowEvent( + "keydown", + (event) => { + if (event.key === "Tab") { + direction.current = event.shiftKey ? 1 /* Backwards */ : 0 /* Forwards */; + } + }, + true + ); + return direction; +} + +// src/hooks/use-is-mounted.ts +var import_react21 = __webpack_require__(/*! react */ "react"); +function useIsMounted() { + let mounted = (0, import_react21.useRef)(false); + useIsoMorphicEffect(() => { + mounted.current = true; + return () => { + mounted.current = false; + }; + }, []); + return mounted; +} + +// src/hooks/use-owner.ts +var import_react22 = __webpack_require__(/*! react */ "react"); +function useOwnerDocument(...args) { + return (0, import_react22.useMemo)(() => getOwnerDocument(...args), [...args]); +} + +// src/hooks/use-event-listener.ts +var import_react23 = __webpack_require__(/*! react */ "react"); +function useEventListener(element, type, listener, options) { + let listenerRef = useLatestValue(listener); + (0, import_react23.useEffect)(() => { + element = element != null ? element : window; + function handler(event) { + listenerRef.current(event); + } + element.addEventListener(type, handler, options); + return () => element.removeEventListener(type, handler, options); + }, [element, type, options]); +} + +// src/utils/document-ready.ts +function onDocumentReady(cb) { + function check() { + if (document.readyState === "loading") + return; + cb(); + document.removeEventListener("DOMContentLoaded", check); + } + if (typeof window !== "undefined" && typeof document !== "undefined") { + document.addEventListener("DOMContentLoaded", check); + check(); + } +} + +// src/hooks/use-on-unmount.ts +var import_react24 = __webpack_require__(/*! react */ "react"); +function useOnUnmount(cb) { + let stableCb = useEvent(cb); + let trulyUnmounted = (0, import_react24.useRef)(false); + (0, import_react24.useEffect)(() => { + trulyUnmounted.current = false; + return () => { + trulyUnmounted.current = true; + microTask(() => { + if (!trulyUnmounted.current) + return; + stableCb(); + }); + }; + }, [stableCb]); +} + +// src/components/focus-trap/focus-trap.tsx +function resolveContainers(containers) { + if (!containers) + return /* @__PURE__ */ new Set(); + if (typeof containers === "function") + return new Set(containers()); + let all = /* @__PURE__ */ new Set(); + for (let container of containers.current) { + if (container.current instanceof HTMLElement) { + all.add(container.current); + } + } + return all; +} +var DEFAULT_FOCUS_TRAP_TAG = "div"; +var Features3 = /* @__PURE__ */ ((Features4) => { + Features4[Features4["None"] = 1] = "None"; + Features4[Features4["InitialFocus"] = 2] = "InitialFocus"; + Features4[Features4["TabLock"] = 4] = "TabLock"; + Features4[Features4["FocusLock"] = 8] = "FocusLock"; + Features4[Features4["RestoreFocus"] = 16] = "RestoreFocus"; + Features4[Features4["All"] = 30] = "All"; + return Features4; +})(Features3 || {}); +function FocusTrapFn(props, ref) { + let container = (0, import_react25.useRef)(null); + let focusTrapRef = useSyncRefs(container, ref); + let { initialFocus, containers, features = 30 /* All */, ...theirProps } = props; + if (!useServerHandoffComplete()) { + features = 1 /* None */; + } + let ownerDocument = useOwnerDocument(container); + useRestoreFocus({ ownerDocument }, Boolean(features & 16 /* RestoreFocus */)); + let previousActiveElement = useInitialFocus( + { ownerDocument, container, initialFocus }, + Boolean(features & 2 /* InitialFocus */) + ); + useFocusLock( + { ownerDocument, container, containers, previousActiveElement }, + Boolean(features & 8 /* FocusLock */) + ); + let direction = useTabDirection(); + let handleFocus = useEvent((e) => { + let el = container.current; + if (!el) + return; + let wrapper = false ? 0 : (cb) => cb(); + wrapper(() => { + match(direction.current, { + [0 /* Forwards */]: () => { + focusIn(el, 1 /* First */, { skipElements: [e.relatedTarget] }); + }, + [1 /* Backwards */]: () => { + focusIn(el, 8 /* Last */, { skipElements: [e.relatedTarget] }); + } + }); + }); + }); + let d = useDisposables(); + let recentlyUsedTabKey = (0, import_react25.useRef)(false); + let ourProps = { + ref: focusTrapRef, + onKeyDown(e) { + if (e.key == "Tab") { + recentlyUsedTabKey.current = true; + d.requestAnimationFrame(() => { + recentlyUsedTabKey.current = false; + }); + } + }, + onBlur(e) { + let allContainers = resolveContainers(containers); + if (container.current instanceof HTMLElement) + allContainers.add(container.current); + let relatedTarget = e.relatedTarget; + if (!(relatedTarget instanceof HTMLElement)) + return; + if (relatedTarget.dataset.headlessuiFocusGuard === "true") { + return; + } + if (!contains(allContainers, relatedTarget)) { + if (recentlyUsedTabKey.current) { + focusIn( + container.current, + match(direction.current, { + [0 /* Forwards */]: () => 4 /* Next */, + [1 /* Backwards */]: () => 2 /* Previous */ + }) | 16 /* WrapAround */, + { relativeTo: e.target } + ); + } else if (e.target instanceof HTMLElement) { + focusElement(e.target); + } + } + } + }; + return /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, Boolean(features & 4 /* TabLock */) && /* @__PURE__ */ import_react25.default.createElement( + Hidden, + { + as: "button", + type: "button", + "data-headlessui-focus-guard": true, + onFocus: handleFocus, + features: 2 /* Focusable */ + } + ), render({ + ourProps, + theirProps, + defaultTag: DEFAULT_FOCUS_TRAP_TAG, + name: "FocusTrap" + }), Boolean(features & 4 /* TabLock */) && /* @__PURE__ */ import_react25.default.createElement( + Hidden, + { + as: "button", + type: "button", + "data-headlessui-focus-guard": true, + onFocus: handleFocus, + features: 2 /* Focusable */ + } + )); +} +var FocusTrapRoot = forwardRefWithAs(FocusTrapFn); +var FocusTrap = Object.assign(FocusTrapRoot, { + features: Features3 +}); +var history = []; +onDocumentReady(() => { + function handle(e) { + if (!(e.target instanceof HTMLElement)) + return; + if (e.target === document.body) + return; + if (history[0] === e.target) + return; + history.unshift(e.target); + history = history.filter((x) => x != null && x.isConnected); + history.splice(10); + } + window.addEventListener("click", handle, { capture: true }); + window.addEventListener("mousedown", handle, { capture: true }); + window.addEventListener("focus", handle, { capture: true }); + document.body.addEventListener("click", handle, { capture: true }); + document.body.addEventListener("mousedown", handle, { capture: true }); + document.body.addEventListener("focus", handle, { capture: true }); +}); +function useRestoreElement(enabled = true) { + let localHistory = (0, import_react25.useRef)(history.slice()); + useWatch( + ([newEnabled], [oldEnabled]) => { + if (oldEnabled === true && newEnabled === false) { + microTask(() => { + localHistory.current.splice(0); + }); + } + if (oldEnabled === false && newEnabled === true) { + localHistory.current = history.slice(); + } + }, + [enabled, history, localHistory] + ); + return useEvent(() => { + var _a3; + return (_a3 = localHistory.current.find((x) => x != null && x.isConnected)) != null ? _a3 : null; + }); +} +function useRestoreFocus({ ownerDocument }, enabled) { + let getRestoreElement = useRestoreElement(enabled); + useWatch(() => { + if (enabled) + return; + if ((ownerDocument == null ? void 0 : ownerDocument.activeElement) === (ownerDocument == null ? void 0 : ownerDocument.body)) { + focusElement(getRestoreElement()); + } + }, [enabled]); + useOnUnmount(() => { + if (!enabled) + return; + focusElement(getRestoreElement()); + }); +} +function useInitialFocus({ + ownerDocument, + container, + initialFocus +}, enabled) { + let previousActiveElement = (0, import_react25.useRef)(null); + let mounted = useIsMounted(); + useWatch(() => { + if (!enabled) + return; + let containerElement = container.current; + if (!containerElement) + return; + microTask(() => { + if (!mounted.current) { + return; + } + let activeElement = ownerDocument == null ? void 0 : ownerDocument.activeElement; + if (initialFocus == null ? void 0 : initialFocus.current) { + if ((initialFocus == null ? void 0 : initialFocus.current) === activeElement) { + previousActiveElement.current = activeElement; + return; + } + } else if (containerElement.contains(activeElement)) { + previousActiveElement.current = activeElement; + return; + } + if (initialFocus == null ? void 0 : initialFocus.current) { + focusElement(initialFocus.current); + } else { + if (focusIn(containerElement, 1 /* First */) === 0 /* Error */) { + console.warn("There are no focusable elements inside the "); + } + } + previousActiveElement.current = ownerDocument == null ? void 0 : ownerDocument.activeElement; + }); + }, [enabled]); + return previousActiveElement; +} +function useFocusLock({ + ownerDocument, + container, + containers, + previousActiveElement +}, enabled) { + let mounted = useIsMounted(); + useEventListener( + ownerDocument == null ? void 0 : ownerDocument.defaultView, + "focus", + (event) => { + if (!enabled) + return; + if (!mounted.current) + return; + let allContainers = resolveContainers(containers); + if (container.current instanceof HTMLElement) + allContainers.add(container.current); + let previous = previousActiveElement.current; + if (!previous) + return; + let toElement = event.target; + if (toElement && toElement instanceof HTMLElement) { + if (!contains(allContainers, toElement)) { + event.preventDefault(); + event.stopPropagation(); + focusElement(previous); + } else { + previousActiveElement.current = toElement; + focusElement(toElement); + } + } else { + focusElement(previousActiveElement.current); + } + }, + true + ); +} +function contains(containers, element) { + for (let container of containers) { + if (container.contains(element)) + return true; + } + return false; +} + +// src/components/portal/portal.tsx +var import_react27 = __toESM(__webpack_require__(/*! react */ "react"), 1); +var import_react_dom = __webpack_require__(/*! react-dom */ "react-dom"); + +// src/internal/portal-force-root.tsx +var import_react26 = __toESM(__webpack_require__(/*! react */ "react"), 1); +var ForcePortalRootContext = (0, import_react26.createContext)(false); +function usePortalRoot() { + return (0, import_react26.useContext)(ForcePortalRootContext); +} +function ForcePortalRoot(props) { + return /* @__PURE__ */ import_react26.default.createElement(ForcePortalRootContext.Provider, { value: props.force }, props.children); +} + +// src/components/portal/portal.tsx +function usePortalTarget(ref) { + let forceInRoot = usePortalRoot(); + let groupTarget = (0, import_react27.useContext)(PortalGroupContext); + let ownerDocument = useOwnerDocument(ref); + let [target, setTarget] = (0, import_react27.useState)(() => { + if (!forceInRoot && groupTarget !== null) + return null; + if (env.isServer) + return null; + let existingRoot = ownerDocument == null ? void 0 : ownerDocument.getElementById("headlessui-portal-root"); + if (existingRoot) + return existingRoot; + if (ownerDocument === null) + return null; + let root = ownerDocument.createElement("div"); + root.setAttribute("id", "headlessui-portal-root"); + return ownerDocument.body.appendChild(root); + }); + (0, import_react27.useEffect)(() => { + if (target === null) + return; + if (!(ownerDocument == null ? void 0 : ownerDocument.body.contains(target))) { + ownerDocument == null ? void 0 : ownerDocument.body.appendChild(target); + } + }, [target, ownerDocument]); + (0, import_react27.useEffect)(() => { + if (forceInRoot) + return; + if (groupTarget === null) + return; + setTarget(groupTarget.current); + }, [groupTarget, setTarget, forceInRoot]); + return target; +} +var DEFAULT_PORTAL_TAG = import_react27.Fragment; +function PortalFn(props, ref) { + let theirProps = props; + let internalPortalRootRef = (0, import_react27.useRef)(null); + let portalRef = useSyncRefs( + optionalRef((ref2) => { + internalPortalRootRef.current = ref2; + }), + ref + ); + let ownerDocument = useOwnerDocument(internalPortalRootRef); + let target = usePortalTarget(internalPortalRootRef); + let [element] = (0, import_react27.useState)( + () => { + var _a3; + return env.isServer ? null : (_a3 = ownerDocument == null ? void 0 : ownerDocument.createElement("div")) != null ? _a3 : null; + } + ); + let parent = (0, import_react27.useContext)(PortalParentContext); + let ready = useServerHandoffComplete(); + useIsoMorphicEffect(() => { + if (!target || !element) + return; + if (!target.contains(element)) { + element.setAttribute("data-headlessui-portal", ""); + target.appendChild(element); + } + }, [target, element]); + useIsoMorphicEffect(() => { + if (!element) + return; + if (!parent) + return; + return parent.register(element); + }, [parent, element]); + useOnUnmount(() => { + var _a3; + if (!target || !element) + return; + if (element instanceof Node && target.contains(element)) { + target.removeChild(element); + } + if (target.childNodes.length <= 0) { + (_a3 = target.parentElement) == null ? void 0 : _a3.removeChild(target); + } + }); + if (!ready) + return null; + let ourProps = { ref: portalRef }; + return !target || !element ? null : (0, import_react_dom.createPortal)( + render({ + ourProps, + theirProps, + defaultTag: DEFAULT_PORTAL_TAG, + name: "Portal" + }), + element + ); +} +var DEFAULT_GROUP_TAG = import_react27.Fragment; +var PortalGroupContext = (0, import_react27.createContext)(null); +function GroupFn(props, ref) { + let { target, ...theirProps } = props; + let groupRef = useSyncRefs(ref); + let ourProps = { ref: groupRef }; + return /* @__PURE__ */ import_react27.default.createElement(PortalGroupContext.Provider, { value: target }, render({ + ourProps, + theirProps, + defaultTag: DEFAULT_GROUP_TAG, + name: "Popover.Group" + })); +} +var PortalParentContext = (0, import_react27.createContext)(null); +function useNestedPortals() { + let parent = (0, import_react27.useContext)(PortalParentContext); + let portals = (0, import_react27.useRef)([]); + let register = useEvent((portal) => { + portals.current.push(portal); + if (parent) + parent.register(portal); + return () => unregister(portal); + }); + let unregister = useEvent((portal) => { + let idx = portals.current.indexOf(portal); + if (idx !== -1) + portals.current.splice(idx, 1); + if (parent) + parent.unregister(portal); + }); + let api = (0, import_react27.useMemo)( + () => ({ register, unregister, portals }), + [register, unregister, portals] + ); + return [ + portals, + (0, import_react27.useMemo)(() => { + return function PortalWrapper({ children }) { + return /* @__PURE__ */ import_react27.default.createElement(PortalParentContext.Provider, { value: api }, children); + }; + }, [api]) + ]; +} +var PortalRoot = forwardRefWithAs(PortalFn); +var Group = forwardRefWithAs(GroupFn); +var Portal = Object.assign(PortalRoot, { Group }); + +// src/components/description/description.tsx +var import_react28 = __toESM(__webpack_require__(/*! react */ "react"), 1); +var DescriptionContext = (0, import_react28.createContext)(null); +function useDescriptionContext() { + let context = (0, import_react28.useContext)(DescriptionContext); + if (context === null) { + let err = new Error( + "You used a component, but it is not inside a relevant parent." + ); + if (Error.captureStackTrace) + Error.captureStackTrace(err, useDescriptionContext); + throw err; + } + return context; +} +function useDescriptions() { + let [descriptionIds, setDescriptionIds] = (0, import_react28.useState)([]); + return [ + // The actual id's as string or undefined + descriptionIds.length > 0 ? descriptionIds.join(" ") : void 0, + // The provider component + (0, import_react28.useMemo)(() => { + return function DescriptionProvider(props) { + let register = useEvent((value) => { + setDescriptionIds((existing) => [...existing, value]); + return () => setDescriptionIds((existing) => { + let clone = existing.slice(); + let idx = clone.indexOf(value); + if (idx !== -1) + clone.splice(idx, 1); + return clone; + }); + }); + let contextBag = (0, import_react28.useMemo)( + () => ({ register, slot: props.slot, name: props.name, props: props.props }), + [register, props.slot, props.name, props.props] + ); + return /* @__PURE__ */ import_react28.default.createElement(DescriptionContext.Provider, { value: contextBag }, props.children); + }; + }, [setDescriptionIds]) + ]; +} +var DEFAULT_DESCRIPTION_TAG = "p"; +function DescriptionFn(props, ref) { + let internalId = useId(); + let { id = `headlessui-description-${internalId}`, ...theirProps } = props; + let context = useDescriptionContext(); + let descriptionRef = useSyncRefs(ref); + useIsoMorphicEffect(() => context.register(id), [id, context.register]); + let ourProps = { ref: descriptionRef, ...context.props, id }; + return render({ + ourProps, + theirProps, + slot: context.slot || {}, + defaultTag: DEFAULT_DESCRIPTION_TAG, + name: context.name || "Description" + }); +} +var DescriptionRoot = forwardRefWithAs(DescriptionFn); +var Description = Object.assign(DescriptionRoot, { + // +}); + +// src/internal/stack-context.tsx +var import_react29 = __toESM(__webpack_require__(/*! react */ "react"), 1); +var StackContext = (0, import_react29.createContext)(() => { +}); +StackContext.displayName = "StackContext"; +function useStackContext() { + return (0, import_react29.useContext)(StackContext); +} +function StackProvider({ + children, + onUpdate, + type, + element, + enabled +}) { + let parentUpdate = useStackContext(); + let notify = useEvent((...args) => { + onUpdate == null ? void 0 : onUpdate(...args); + parentUpdate(...args); + }); + useIsoMorphicEffect(() => { + let shouldNotify = enabled === void 0 || enabled === true; + shouldNotify && notify(0 /* Add */, type, element); + return () => { + shouldNotify && notify(1 /* Remove */, type, element); + }; + }, [notify, type, element, enabled]); + return /* @__PURE__ */ import_react29.default.createElement(StackContext.Provider, { value: notify }, children); +} + +// src/use-sync-external-store-shim/index.ts +var React11 = __toESM(__webpack_require__(/*! react */ "react"), 1); + +// src/use-sync-external-store-shim/useSyncExternalStoreShimClient.ts +var React10 = __toESM(__webpack_require__(/*! react */ "react"), 1); +function isPolyfill(x, y) { + return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y; +} +var is = typeof Object.is === "function" ? Object.is : isPolyfill; +var { useState: useState8, useEffect: useEffect14, useLayoutEffect: useLayoutEffect2, useDebugValue } = React10; +var didWarnOld18Alpha = false; +var didWarnUncachedGetSnapshot = false; +function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + if (true) { + if (!didWarnOld18Alpha) { + if ("startTransition" in React10) { + didWarnOld18Alpha = true; + console.error( + "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." + ); + } + } + } + const value = getSnapshot(); + if (true) { + if (!didWarnUncachedGetSnapshot) { + const cachedValue = getSnapshot(); + if (!is(value, cachedValue)) { + console.error("The result of getSnapshot should be cached to avoid an infinite loop"); + didWarnUncachedGetSnapshot = true; + } + } + } + const [{ inst }, forceUpdate] = useState8({ inst: { value, getSnapshot } }); + useLayoutEffect2(() => { + inst.value = value; + inst.getSnapshot = getSnapshot; + if (checkIfSnapshotChanged(inst)) { + forceUpdate({ inst }); + } + }, [subscribe, value, getSnapshot]); + useEffect14(() => { + if (checkIfSnapshotChanged(inst)) { + forceUpdate({ inst }); + } + const handleStoreChange = () => { + if (checkIfSnapshotChanged(inst)) { + forceUpdate({ inst }); + } + }; + return subscribe(handleStoreChange); + }, [subscribe]); + useDebugValue(value); + return value; +} +function checkIfSnapshotChanged(inst) { + const latestGetSnapshot = inst.getSnapshot; + const prevValue = inst.value; + try { + const nextValue = latestGetSnapshot(); + return !is(prevValue, nextValue); + } catch (error) { + return true; + } +} + +// src/use-sync-external-store-shim/useSyncExternalStoreShimServer.ts +function useSyncExternalStore2(subscribe, getSnapshot, getServerSnapshot) { + return getSnapshot(); +} + +// src/use-sync-external-store-shim/index.ts +var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); +var isServerEnvironment = !canUseDOM; +var shim = isServerEnvironment ? useSyncExternalStore2 : useSyncExternalStore; +var useSyncExternalStore3 = "useSyncExternalStore" in React11 ? ((r) => r.useSyncExternalStore)(React11) : shim; + +// src/hooks/use-store.ts +function useStore(store) { + return useSyncExternalStore3(store.subscribe, store.getSnapshot, store.getSnapshot); +} + +// src/utils/store.ts +function createStore(initial, actions) { + let state = initial(); + let listeners = /* @__PURE__ */ new Set(); + return { + getSnapshot() { + return state; + }, + subscribe(onChange) { + listeners.add(onChange); + return () => listeners.delete(onChange); + }, + dispatch(key, ...args) { + let newState = actions[key].call(state, ...args); + if (newState) { + state = newState; + listeners.forEach((listener) => listener()); + } + } + }; +} + +// src/hooks/document-overflow/adjust-scrollbar-padding.ts +function adjustScrollbarPadding() { + let scrollbarWidthBefore; + return { + before({ doc }) { + var _a3; + let documentElement = doc.documentElement; + let ownerWindow = (_a3 = doc.defaultView) != null ? _a3 : window; + scrollbarWidthBefore = ownerWindow.innerWidth - documentElement.clientWidth; + }, + after({ doc, d }) { + let documentElement = doc.documentElement; + let scrollbarWidthAfter = documentElement.clientWidth - documentElement.offsetWidth; + let scrollbarWidth = scrollbarWidthBefore - scrollbarWidthAfter; + d.style(documentElement, "paddingRight", `${scrollbarWidth}px`); + } + }; +} + +// src/hooks/document-overflow/handle-ios-locking.ts +function handleIOSLocking() { + if (!isIOS()) { + return {}; + } + let scrollPosition; + return { + before() { + scrollPosition = window.pageYOffset; + }, + after({ doc, d, meta }) { + function inAllowedContainer(el) { + return meta.containers.flatMap((resolve) => resolve()).some((container) => container.contains(el)); + } + d.style(doc.body, "marginTop", `-${scrollPosition}px`); + window.scrollTo(0, 0); + let scrollToElement = null; + d.addEventListener( + doc, + "click", + (e) => { + if (!(e.target instanceof HTMLElement)) { + return; + } + try { + let anchor = e.target.closest("a"); + if (!anchor) + return; + let { hash } = new URL(anchor.href); + let el = doc.querySelector(hash); + if (el && !inAllowedContainer(el)) { + scrollToElement = el; + } + } catch (err) { + } + }, + true + ); + d.addEventListener( + doc, + "touchmove", + (e) => { + if (e.target instanceof HTMLElement && !inAllowedContainer(e.target)) { + e.preventDefault(); + } + }, + { passive: false } + ); + d.add(() => { + window.scrollTo(0, window.pageYOffset + scrollPosition); + if (scrollToElement && scrollToElement.isConnected) { + scrollToElement.scrollIntoView({ block: "nearest" }); + scrollToElement = null; + } + }); + } + }; +} + +// src/hooks/document-overflow/prevent-scroll.ts +function preventScroll() { + return { + before({ doc, d }) { + d.style(doc.documentElement, "overflow", "hidden"); + } + }; +} + +// src/hooks/document-overflow/overflow-store.ts +function buildMeta(fns) { + let tmp = {}; + for (let fn of fns) { + Object.assign(tmp, fn(tmp)); + } + return tmp; +} +var overflows = createStore(() => /* @__PURE__ */ new Map(), { + PUSH(doc, meta) { + var _a3; + let entry = (_a3 = this.get(doc)) != null ? _a3 : { + doc, + count: 0, + d: disposables(), + meta: /* @__PURE__ */ new Set() + }; + entry.count++; + entry.meta.add(meta); + this.set(doc, entry); + return this; + }, + POP(doc, meta) { + let entry = this.get(doc); + if (entry) { + entry.count--; + entry.meta.delete(meta); + } + return this; + }, + SCROLL_PREVENT({ doc, d, meta }) { + let ctx = { + doc, + d, + meta: buildMeta(meta) + }; + let steps = [ + handleIOSLocking(), + adjustScrollbarPadding(), + preventScroll() + ]; + steps.forEach(({ before }) => before == null ? void 0 : before(ctx)); + steps.forEach(({ after }) => after == null ? void 0 : after(ctx)); + }, + SCROLL_ALLOW({ d }) { + d.dispose(); + }, + TEARDOWN({ doc }) { + this.delete(doc); + } +}); +overflows.subscribe(() => { + let docs = overflows.getSnapshot(); + let styles = /* @__PURE__ */ new Map(); + for (let [doc] of docs) { + styles.set(doc, doc.documentElement.style.overflow); + } + for (let entry of docs.values()) { + let isHidden = styles.get(entry.doc) === "hidden"; + let isLocked = entry.count !== 0; + let willChange = isLocked && !isHidden || !isLocked && isHidden; + if (willChange) { + overflows.dispatch(entry.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", entry); + } + if (entry.count === 0) { + overflows.dispatch("TEARDOWN", entry); + } + } +}); + +// src/hooks/document-overflow/use-document-overflow.ts +function useDocumentOverflowLockedEffect(doc, shouldBeLocked, meta) { + let store = useStore(overflows); + let entry = doc ? store.get(doc) : void 0; + let locked = entry ? entry.count > 0 : false; + useIsoMorphicEffect(() => { + if (!doc || !shouldBeLocked) { + return; + } + overflows.dispatch("PUSH", doc, meta); + return () => overflows.dispatch("POP", doc, meta); + }, [shouldBeLocked, doc]); + return locked; +} + +// src/hooks/use-inert.tsx +var originals = /* @__PURE__ */ new Map(); +var counts = /* @__PURE__ */ new Map(); +function useInert(node, enabled = true) { + useIsoMorphicEffect(() => { + var _a3; + if (!enabled) + return; + let element = typeof node === "function" ? node() : node.current; + if (!element) + return; + function cleanup() { + var _a4; + if (!element) + return; + let count2 = (_a4 = counts.get(element)) != null ? _a4 : 1; + if (count2 === 1) + counts.delete(element); + else + counts.set(element, count2 - 1); + if (count2 !== 1) + return; + let original = originals.get(element); + if (!original) + return; + if (original["aria-hidden"] === null) + element.removeAttribute("aria-hidden"); + else + element.setAttribute("aria-hidden", original["aria-hidden"]); + element.inert = original.inert; + originals.delete(element); + } + let count = (_a3 = counts.get(element)) != null ? _a3 : 0; + counts.set(element, count + 1); + if (count !== 0) + return cleanup; + originals.set(element, { + "aria-hidden": element.getAttribute("aria-hidden"), + inert: element.inert + }); + element.setAttribute("aria-hidden", "true"); + element.inert = true; + return cleanup; + }, [node, enabled]); +} + +// src/hooks/use-root-containers.tsx +var import_react30 = __toESM(__webpack_require__(/*! react */ "react"), 1); +function useRootContainers({ + defaultContainers = [], + portals +} = {}) { + let mainTreeNodeRef = (0, import_react30.useRef)(null); + let ownerDocument = useOwnerDocument(mainTreeNodeRef); + let resolveContainers2 = useEvent(() => { + var _a3; + let containers = []; + for (let container of defaultContainers) { + if (container === null) + continue; + if (container instanceof HTMLElement) { + containers.push(container); + } else if ("current" in container && container.current instanceof HTMLElement) { + containers.push(container.current); + } + } + if (portals == null ? void 0 : portals.current) { + for (let portal of portals.current) { + containers.push(portal); + } + } + for (let container of (_a3 = ownerDocument == null ? void 0 : ownerDocument.querySelectorAll("html > *, body > *")) != null ? _a3 : []) { + if (container === document.body) + continue; + if (container === document.head) + continue; + if (!(container instanceof HTMLElement)) + continue; + if (container.id === "headlessui-portal-root") + continue; + if (container.contains(mainTreeNodeRef.current)) + continue; + if (containers.some((defaultContainer) => container.contains(defaultContainer))) + continue; + containers.push(container); + } + return containers; + }); + return { + resolveContainers: resolveContainers2, + contains: useEvent( + (element) => resolveContainers2().some((container) => container.contains(element)) + ), + mainTreeNodeRef, + MainTreeNode: (0, import_react30.useMemo)(() => { + return function MainTreeNode() { + return /* @__PURE__ */ import_react30.default.createElement(Hidden, { features: 4 /* Hidden */, ref: mainTreeNodeRef }); + }; + }, [mainTreeNodeRef]) + }; +} + +// src/components/dialog/dialog.tsx +var reducers2 = { + [0 /* SetTitleId */](state, action) { + if (state.titleId === action.id) + return state; + return { ...state, titleId: action.id }; + } +}; +var DialogContext = (0, import_react31.createContext)(null); +DialogContext.displayName = "DialogContext"; +function useDialogContext(component) { + let context = (0, import_react31.useContext)(DialogContext); + if (context === null) { + let err = new Error(`<${component} /> is missing a parent component.`); + if (Error.captureStackTrace) + Error.captureStackTrace(err, useDialogContext); + throw err; + } + return context; +} +function useScrollLock(ownerDocument, enabled, resolveAllowedContainers = () => [document.body]) { + useDocumentOverflowLockedEffect(ownerDocument, enabled, (meta) => { + var _a3; + return { + containers: [...(_a3 = meta.containers) != null ? _a3 : [], resolveAllowedContainers] + }; + }); +} +function stateReducer2(state, action) { + return match(action.type, reducers2, state, action); +} +var DEFAULT_DIALOG_TAG = "div"; +var DialogRenderFeatures = 1 /* RenderStrategy */ | 2 /* Static */; +function DialogFn(props, ref) { + var _a3; + let internalId = useId(); + let { + id = `headlessui-dialog-${internalId}`, + open, + onClose, + initialFocus, + __demoMode = false, + ...theirProps + } = props; + let [nestedDialogCount, setNestedDialogCount] = (0, import_react31.useState)(0); + let usesOpenClosedState = useOpenClosed(); + if (open === void 0 && usesOpenClosedState !== null) { + open = (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; + } + let internalDialogRef = (0, import_react31.useRef)(null); + let dialogRef = useSyncRefs(internalDialogRef, ref); + let ownerDocument = useOwnerDocument(internalDialogRef); + let hasOpen = props.hasOwnProperty("open") || usesOpenClosedState !== null; + let hasOnClose = props.hasOwnProperty("onClose"); + if (!hasOpen && !hasOnClose) { + throw new Error( + `You have to provide an \`open\` and an \`onClose\` prop to the \`Dialog\` component.` + ); + } + if (!hasOpen) { + throw new Error( + `You provided an \`onClose\` prop to the \`Dialog\`, but forgot an \`open\` prop.` + ); + } + if (!hasOnClose) { + throw new Error( + `You provided an \`open\` prop to the \`Dialog\`, but forgot an \`onClose\` prop.` + ); + } + if (typeof open !== "boolean") { + throw new Error( + `You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${open}` + ); + } + if (typeof onClose !== "function") { + throw new Error( + `You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${onClose}` + ); + } + let dialogState = open ? 0 /* Open */ : 1 /* Closed */; + let [state, dispatch] = (0, import_react31.useReducer)(stateReducer2, { + titleId: null, + descriptionId: null, + panelRef: (0, import_react31.createRef)() + }); + let close = useEvent(() => onClose(false)); + let setTitleId = useEvent((id2) => dispatch({ type: 0 /* SetTitleId */, id: id2 })); + let ready = useServerHandoffComplete(); + let enabled = ready ? __demoMode ? false : dialogState === 0 /* Open */ : false; + let hasNestedDialogs = nestedDialogCount > 1; + let hasParentDialog = (0, import_react31.useContext)(DialogContext) !== null; + let [portals, PortalWrapper] = useNestedPortals(); + let { + resolveContainers: resolveRootContainers, + mainTreeNodeRef, + MainTreeNode + } = useRootContainers({ + portals, + defaultContainers: [(_a3 = state.panelRef.current) != null ? _a3 : internalDialogRef.current] + }); + let position = !hasNestedDialogs ? "leaf" : "parent"; + let isClosing = usesOpenClosedState !== null ? (usesOpenClosedState & 4 /* Closing */) === 4 /* Closing */ : false; + let inertOthersEnabled = (() => { + if (hasParentDialog) + return false; + if (isClosing) + return false; + return enabled; + })(); + let resolveRootOfMainTreeNode = (0, import_react31.useCallback)(() => { + var _a4, _b; + return (_b = Array.from((_a4 = ownerDocument == null ? void 0 : ownerDocument.querySelectorAll("body > *")) != null ? _a4 : []).find((root) => { + if (root.id === "headlessui-portal-root") + return false; + return root.contains(mainTreeNodeRef.current) && root instanceof HTMLElement; + })) != null ? _b : null; + }, [mainTreeNodeRef]); + useInert(resolveRootOfMainTreeNode, inertOthersEnabled); + let inertParentDialogs = (() => { + if (hasNestedDialogs) + return true; + return enabled; + })(); + let resolveRootOfParentDialog = (0, import_react31.useCallback)(() => { + var _a4, _b; + return (_b = Array.from((_a4 = ownerDocument == null ? void 0 : ownerDocument.querySelectorAll("[data-headlessui-portal]")) != null ? _a4 : []).find( + (root) => root.contains(mainTreeNodeRef.current) && root instanceof HTMLElement + )) != null ? _b : null; + }, [mainTreeNodeRef]); + useInert(resolveRootOfParentDialog, inertParentDialogs); + let outsideClickEnabled = (() => { + if (!enabled) + return false; + if (hasNestedDialogs) + return false; + return true; + })(); + useOutsideClick(resolveRootContainers, close, outsideClickEnabled); + let escapeToCloseEnabled = (() => { + if (hasNestedDialogs) + return false; + if (dialogState !== 0 /* Open */) + return false; + return true; + })(); + useEventListener(ownerDocument == null ? void 0 : ownerDocument.defaultView, "keydown", (event) => { + if (!escapeToCloseEnabled) + return; + if (event.defaultPrevented) + return; + if (event.key !== "Escape" /* Escape */) + return; + event.preventDefault(); + event.stopPropagation(); + close(); + }); + let scrollLockEnabled = (() => { + if (isClosing) + return false; + if (dialogState !== 0 /* Open */) + return false; + if (hasParentDialog) + return false; + return true; + })(); + useScrollLock(ownerDocument, scrollLockEnabled, resolveRootContainers); + (0, import_react31.useEffect)(() => { + if (dialogState !== 0 /* Open */) + return; + if (!internalDialogRef.current) + return; + let observer = new ResizeObserver((entries) => { + for (let entry of entries) { + let rect = entry.target.getBoundingClientRect(); + if (rect.x === 0 && rect.y === 0 && rect.width === 0 && rect.height === 0) { + close(); + } + } + }); + observer.observe(internalDialogRef.current); + return () => observer.disconnect(); + }, [dialogState, internalDialogRef, close]); + let [describedby, DescriptionProvider] = useDescriptions(); + let contextBag = (0, import_react31.useMemo)( + () => [{ dialogState, close, setTitleId }, state], + [dialogState, state, close, setTitleId] + ); + let slot = (0, import_react31.useMemo)( + () => ({ open: dialogState === 0 /* Open */ }), + [dialogState] + ); + let ourProps = { + ref: dialogRef, + id, + role: "dialog", + "aria-modal": dialogState === 0 /* Open */ ? true : void 0, + "aria-labelledby": state.titleId, + "aria-describedby": describedby + }; + return /* @__PURE__ */ import_react31.default.createElement( + StackProvider, + { + type: "Dialog", + enabled: dialogState === 0 /* Open */, + element: internalDialogRef, + onUpdate: useEvent((message, type) => { + if (type !== "Dialog") + return; + match(message, { + [0 /* Add */]: () => setNestedDialogCount((count) => count + 1), + [1 /* Remove */]: () => setNestedDialogCount((count) => count - 1) + }); + }) + }, + /* @__PURE__ */ import_react31.default.createElement(ForcePortalRoot, { force: true }, /* @__PURE__ */ import_react31.default.createElement(Portal, null, /* @__PURE__ */ import_react31.default.createElement(DialogContext.Provider, { value: contextBag }, /* @__PURE__ */ import_react31.default.createElement(Portal.Group, { target: internalDialogRef }, /* @__PURE__ */ import_react31.default.createElement(ForcePortalRoot, { force: false }, /* @__PURE__ */ import_react31.default.createElement(DescriptionProvider, { slot, name: "Dialog.Description" }, /* @__PURE__ */ import_react31.default.createElement( + FocusTrap, + { + initialFocus, + containers: resolveRootContainers, + features: enabled ? match(position, { + parent: FocusTrap.features.RestoreFocus, + leaf: FocusTrap.features.All & ~FocusTrap.features.FocusLock + }) : FocusTrap.features.None + }, + /* @__PURE__ */ import_react31.default.createElement(PortalWrapper, null, render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_DIALOG_TAG, + features: DialogRenderFeatures, + visible: dialogState === 0 /* Open */, + name: "Dialog" + })) + ))))))), + /* @__PURE__ */ import_react31.default.createElement(MainTreeNode, null) + ); +} +var DEFAULT_OVERLAY_TAG = "div"; +function OverlayFn(props, ref) { + let internalId = useId(); + let { id = `headlessui-dialog-overlay-${internalId}`, ...theirProps } = props; + let [{ dialogState, close }] = useDialogContext("Dialog.Overlay"); + let overlayRef = useSyncRefs(ref); + let handleClick = useEvent((event) => { + if (event.target !== event.currentTarget) + return; + if (isDisabledReactIssue7711(event.currentTarget)) + return event.preventDefault(); + event.preventDefault(); + event.stopPropagation(); + close(); + }); + let slot = (0, import_react31.useMemo)( + () => ({ open: dialogState === 0 /* Open */ }), + [dialogState] + ); + let ourProps = { + ref: overlayRef, + id, + "aria-hidden": true, + onClick: handleClick + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_OVERLAY_TAG, + name: "Dialog.Overlay" + }); +} +var DEFAULT_BACKDROP_TAG = "div"; +function BackdropFn(props, ref) { + let internalId = useId(); + let { id = `headlessui-dialog-backdrop-${internalId}`, ...theirProps } = props; + let [{ dialogState }, state] = useDialogContext("Dialog.Backdrop"); + let backdropRef = useSyncRefs(ref); + (0, import_react31.useEffect)(() => { + if (state.panelRef.current === null) { + throw new Error( + `A component is being used, but a component is missing.` + ); + } + }, [state.panelRef]); + let slot = (0, import_react31.useMemo)( + () => ({ open: dialogState === 0 /* Open */ }), + [dialogState] + ); + let ourProps = { + ref: backdropRef, + id, + "aria-hidden": true + }; + return /* @__PURE__ */ import_react31.default.createElement(ForcePortalRoot, { force: true }, /* @__PURE__ */ import_react31.default.createElement(Portal, null, render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_BACKDROP_TAG, + name: "Dialog.Backdrop" + }))); +} +var DEFAULT_PANEL_TAG = "div"; +function PanelFn(props, ref) { + let internalId = useId(); + let { id = `headlessui-dialog-panel-${internalId}`, ...theirProps } = props; + let [{ dialogState }, state] = useDialogContext("Dialog.Panel"); + let panelRef = useSyncRefs(ref, state.panelRef); + let slot = (0, import_react31.useMemo)( + () => ({ open: dialogState === 0 /* Open */ }), + [dialogState] + ); + let handleClick = useEvent((event) => { + event.stopPropagation(); + }); + let ourProps = { + ref: panelRef, + id, + onClick: handleClick + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_PANEL_TAG, + name: "Dialog.Panel" + }); +} +var DEFAULT_TITLE_TAG = "h2"; +function TitleFn(props, ref) { + let internalId = useId(); + let { id = `headlessui-dialog-title-${internalId}`, ...theirProps } = props; + let [{ dialogState, setTitleId }] = useDialogContext("Dialog.Title"); + let titleRef = useSyncRefs(ref); + (0, import_react31.useEffect)(() => { + setTitleId(id); + return () => setTitleId(null); + }, [id, setTitleId]); + let slot = (0, import_react31.useMemo)( + () => ({ open: dialogState === 0 /* Open */ }), + [dialogState] + ); + let ourProps = { ref: titleRef, id }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_TITLE_TAG, + name: "Dialog.Title" + }); +} +var DialogRoot = forwardRefWithAs(DialogFn); +var Backdrop = forwardRefWithAs(BackdropFn); +var Panel = forwardRefWithAs(PanelFn); +var Overlay = forwardRefWithAs(OverlayFn); +var Title = forwardRefWithAs(TitleFn); +var Dialog = Object.assign(DialogRoot, { + Backdrop, + Panel, + Overlay, + Title, + Description +}); + +// src/components/disclosure/disclosure.tsx +var import_react33 = __toESM(__webpack_require__(/*! react */ "react"), 1); + +// src/utils/start-transition.ts +var import_react32 = __toESM(__webpack_require__(/*! react */ "react"), 1); +var _a2; +var startTransition = ( + // Prefer React's `startTransition` if it's available. + // @ts-expect-error - `startTransition` doesn't exist in React < 18. + (_a2 = import_react32.default.startTransition) != null ? _a2 : function startTransition2(cb) { + cb(); + } +); + +// src/components/disclosure/disclosure.tsx +var reducers3 = { + [0 /* ToggleDisclosure */]: (state) => ({ + ...state, + disclosureState: match(state.disclosureState, { + [0 /* Open */]: 1 /* Closed */, + [1 /* Closed */]: 0 /* Open */ + }) + }), + [1 /* CloseDisclosure */]: (state) => { + if (state.disclosureState === 1 /* Closed */) + return state; + return { ...state, disclosureState: 1 /* Closed */ }; + }, + [4 /* LinkPanel */](state) { + if (state.linkedPanel === true) + return state; + return { ...state, linkedPanel: true }; + }, + [5 /* UnlinkPanel */](state) { + if (state.linkedPanel === false) + return state; + return { ...state, linkedPanel: false }; + }, + [2 /* SetButtonId */](state, action) { + if (state.buttonId === action.buttonId) + return state; + return { ...state, buttonId: action.buttonId }; + }, + [3 /* SetPanelId */](state, action) { + if (state.panelId === action.panelId) + return state; + return { ...state, panelId: action.panelId }; + } +}; +var DisclosureContext = (0, import_react33.createContext)(null); +DisclosureContext.displayName = "DisclosureContext"; +function useDisclosureContext(component) { + let context = (0, import_react33.useContext)(DisclosureContext); + if (context === null) { + let err = new Error(`<${component} /> is missing a parent component.`); + if (Error.captureStackTrace) + Error.captureStackTrace(err, useDisclosureContext); + throw err; + } + return context; +} +var DisclosureAPIContext = (0, import_react33.createContext)(null); +DisclosureAPIContext.displayName = "DisclosureAPIContext"; +function useDisclosureAPIContext(component) { + let context = (0, import_react33.useContext)(DisclosureAPIContext); + if (context === null) { + let err = new Error(`<${component} /> is missing a parent component.`); + if (Error.captureStackTrace) + Error.captureStackTrace(err, useDisclosureAPIContext); + throw err; + } + return context; +} +var DisclosurePanelContext = (0, import_react33.createContext)(null); +DisclosurePanelContext.displayName = "DisclosurePanelContext"; +function useDisclosurePanelContext() { + return (0, import_react33.useContext)(DisclosurePanelContext); +} +function stateReducer3(state, action) { + return match(action.type, reducers3, state, action); +} +var DEFAULT_DISCLOSURE_TAG = import_react33.Fragment; +function DisclosureFn(props, ref) { + let { defaultOpen = false, ...theirProps } = props; + let internalDisclosureRef = (0, import_react33.useRef)(null); + let disclosureRef = useSyncRefs( + ref, + optionalRef( + (ref2) => { + internalDisclosureRef.current = ref2; + }, + props.as === void 0 || // @ts-expect-error The `as` prop _can_ be a Fragment + props.as === import_react33.Fragment + ) + ); + let panelRef = (0, import_react33.useRef)(null); + let buttonRef = (0, import_react33.useRef)(null); + let reducerBag = (0, import_react33.useReducer)(stateReducer3, { + disclosureState: defaultOpen ? 0 /* Open */ : 1 /* Closed */, + linkedPanel: false, + buttonRef, + panelRef, + buttonId: null, + panelId: null + }); + let [{ disclosureState, buttonId }, dispatch] = reducerBag; + let close = useEvent((focusableElement) => { + dispatch({ type: 1 /* CloseDisclosure */ }); + let ownerDocument = getOwnerDocument(internalDisclosureRef); + if (!ownerDocument) + return; + if (!buttonId) + return; + let restoreElement = (() => { + if (!focusableElement) + return ownerDocument.getElementById(buttonId); + if (focusableElement instanceof HTMLElement) + return focusableElement; + if (focusableElement.current instanceof HTMLElement) + return focusableElement.current; + return ownerDocument.getElementById(buttonId); + })(); + restoreElement == null ? void 0 : restoreElement.focus(); + }); + let api = (0, import_react33.useMemo)(() => ({ close }), [close]); + let slot = (0, import_react33.useMemo)( + () => ({ open: disclosureState === 0 /* Open */, close }), + [disclosureState, close] + ); + let ourProps = { + ref: disclosureRef + }; + return /* @__PURE__ */ import_react33.default.createElement(DisclosureContext.Provider, { value: reducerBag }, /* @__PURE__ */ import_react33.default.createElement(DisclosureAPIContext.Provider, { value: api }, /* @__PURE__ */ import_react33.default.createElement( + OpenClosedProvider, + { + value: match(disclosureState, { + [0 /* Open */]: 1 /* Open */, + [1 /* Closed */]: 2 /* Closed */ + }) + }, + render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_DISCLOSURE_TAG, + name: "Disclosure" + }) + ))); +} +var DEFAULT_BUTTON_TAG2 = "button"; +function ButtonFn2(props, ref) { + let internalId = useId(); + let { id = `headlessui-disclosure-button-${internalId}`, ...theirProps } = props; + let [state, dispatch] = useDisclosureContext("Disclosure.Button"); + let panelContext = useDisclosurePanelContext(); + let isWithinPanel = panelContext === null ? false : panelContext === state.panelId; + let internalButtonRef = (0, import_react33.useRef)(null); + let buttonRef = useSyncRefs(internalButtonRef, ref, !isWithinPanel ? state.buttonRef : null); + (0, import_react33.useEffect)(() => { + if (isWithinPanel) + return; + dispatch({ type: 2 /* SetButtonId */, buttonId: id }); + return () => { + dispatch({ type: 2 /* SetButtonId */, buttonId: null }); + }; + }, [id, dispatch, isWithinPanel]); + let handleKeyDown = useEvent((event) => { + var _a3; + if (isWithinPanel) { + if (state.disclosureState === 1 /* Closed */) + return; + switch (event.key) { + case " " /* Space */: + case "Enter" /* Enter */: + event.preventDefault(); + event.stopPropagation(); + dispatch({ type: 0 /* ToggleDisclosure */ }); + (_a3 = state.buttonRef.current) == null ? void 0 : _a3.focus(); + break; + } + } else { + switch (event.key) { + case " " /* Space */: + case "Enter" /* Enter */: + event.preventDefault(); + event.stopPropagation(); + dispatch({ type: 0 /* ToggleDisclosure */ }); + break; + } + } + }); + let handleKeyUp = useEvent((event) => { + switch (event.key) { + case " " /* Space */: + event.preventDefault(); + break; + } + }); + let handleClick = useEvent((event) => { + var _a3; + if (isDisabledReactIssue7711(event.currentTarget)) + return; + if (props.disabled) + return; + if (isWithinPanel) { + dispatch({ type: 0 /* ToggleDisclosure */ }); + (_a3 = state.buttonRef.current) == null ? void 0 : _a3.focus(); + } else { + dispatch({ type: 0 /* ToggleDisclosure */ }); + } + }); + let slot = (0, import_react33.useMemo)( + () => ({ open: state.disclosureState === 0 /* Open */ }), + [state] + ); + let type = useResolveButtonType(props, internalButtonRef); + let ourProps = isWithinPanel ? { ref: buttonRef, type, onKeyDown: handleKeyDown, onClick: handleClick } : { + ref: buttonRef, + id, + type, + "aria-expanded": props.disabled ? void 0 : state.disclosureState === 0 /* Open */, + "aria-controls": state.linkedPanel ? state.panelId : void 0, + onKeyDown: handleKeyDown, + onKeyUp: handleKeyUp, + onClick: handleClick + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_BUTTON_TAG2, + name: "Disclosure.Button" + }); +} +var DEFAULT_PANEL_TAG2 = "div"; +var PanelRenderFeatures = 1 /* RenderStrategy */ | 2 /* Static */; +function PanelFn2(props, ref) { + let internalId = useId(); + let { id = `headlessui-disclosure-panel-${internalId}`, ...theirProps } = props; + let [state, dispatch] = useDisclosureContext("Disclosure.Panel"); + let { close } = useDisclosureAPIContext("Disclosure.Panel"); + let panelRef = useSyncRefs(ref, state.panelRef, (el) => { + startTransition(() => dispatch({ type: el ? 4 /* LinkPanel */ : 5 /* UnlinkPanel */ })); + }); + (0, import_react33.useEffect)(() => { + dispatch({ type: 3 /* SetPanelId */, panelId: id }); + return () => { + dispatch({ type: 3 /* SetPanelId */, panelId: null }); + }; + }, [id, dispatch]); + let usesOpenClosedState = useOpenClosed(); + let visible = (() => { + if (usesOpenClosedState !== null) { + return (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; + } + return state.disclosureState === 0 /* Open */; + })(); + let slot = (0, import_react33.useMemo)( + () => ({ open: state.disclosureState === 0 /* Open */, close }), + [state, close] + ); + let ourProps = { + ref: panelRef, + id + }; + return /* @__PURE__ */ import_react33.default.createElement(DisclosurePanelContext.Provider, { value: state.panelId }, render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_PANEL_TAG2, + features: PanelRenderFeatures, + visible, + name: "Disclosure.Panel" + })); +} +var DisclosureRoot = forwardRefWithAs(DisclosureFn); +var Button2 = forwardRefWithAs(ButtonFn2); +var Panel2 = forwardRefWithAs(PanelFn2); +var Disclosure = Object.assign(DisclosureRoot, { Button: Button2, Panel: Panel2 }); + +// src/components/listbox/listbox.tsx +var import_react35 = __toESM(__webpack_require__(/*! react */ "react"), 1); + +// src/hooks/use-text-value.ts +var import_react34 = __webpack_require__(/*! react */ "react"); + +// src/utils/get-text-value.ts +var emojiRegex = /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g; +function getTextContents(element) { + var _a3, _b; + let currentInnerText = (_a3 = element.innerText) != null ? _a3 : ""; + let copy = element.cloneNode(true); + if (!(copy instanceof HTMLElement)) { + return currentInnerText; + } + let dropped = false; + for (let child of copy.querySelectorAll('[hidden],[aria-hidden],[role="img"]')) { + child.remove(); + dropped = true; + } + let value = dropped ? (_b = copy.innerText) != null ? _b : "" : currentInnerText; + if (emojiRegex.test(value)) { + value = value.replace(emojiRegex, ""); + } + return value; +} +function getTextValue(element) { + let label = element.getAttribute("aria-label"); + if (typeof label === "string") + return label.trim(); + let labelledby = element.getAttribute("aria-labelledby"); + if (labelledby) { + let labels = labelledby.split(" ").map((labelledby2) => { + let labelEl = document.getElementById(labelledby2); + if (labelEl) { + let label2 = labelEl.getAttribute("aria-label"); + if (typeof label2 === "string") + return label2.trim(); + return getTextContents(labelEl).trim(); + } + return null; + }).filter(Boolean); + if (labels.length > 0) + return labels.join(", "); + } + return getTextContents(element).trim(); +} + +// src/hooks/use-text-value.ts +function useTextValue(element) { + let cacheKey = (0, import_react34.useRef)(""); + let cacheValue = (0, import_react34.useRef)(""); + return useEvent(() => { + let el = element.current; + if (!el) + return ""; + let currentKey = el.innerText; + if (cacheKey.current === currentKey) { + return cacheValue.current; + } + let value = getTextValue(el).trim().toLowerCase(); + cacheKey.current = currentKey; + cacheValue.current = value; + return value; + }); +} + +// src/components/listbox/listbox.tsx +function adjustOrderedState2(state, adjustment = (i) => i) { + let currentActiveOption = state.activeOptionIndex !== null ? state.options[state.activeOptionIndex] : null; + let sortedOptions = sortByDomNode( + adjustment(state.options.slice()), + (option) => option.dataRef.current.domRef.current + ); + let adjustedActiveOptionIndex = currentActiveOption ? sortedOptions.indexOf(currentActiveOption) : null; + if (adjustedActiveOptionIndex === -1) { + adjustedActiveOptionIndex = null; + } + return { + options: sortedOptions, + activeOptionIndex: adjustedActiveOptionIndex + }; +} +var reducers4 = { + [1 /* CloseListbox */](state) { + if (state.dataRef.current.disabled) + return state; + if (state.listboxState === 1 /* Closed */) + return state; + return { ...state, activeOptionIndex: null, listboxState: 1 /* Closed */ }; + }, + [0 /* OpenListbox */](state) { + if (state.dataRef.current.disabled) + return state; + if (state.listboxState === 0 /* Open */) + return state; + let activeOptionIndex = state.activeOptionIndex; + let { isSelected } = state.dataRef.current; + let optionIdx = state.options.findIndex((option) => isSelected(option.dataRef.current.value)); + if (optionIdx !== -1) { + activeOptionIndex = optionIdx; + } + return { ...state, listboxState: 0 /* Open */, activeOptionIndex }; + }, + [2 /* GoToOption */](state, action) { + var _a3; + if (state.dataRef.current.disabled) + return state; + if (state.listboxState === 1 /* Closed */) + return state; + let adjustedState = adjustOrderedState2(state); + let activeOptionIndex = calculateActiveIndex(action, { + resolveItems: () => adjustedState.options, + resolveActiveIndex: () => adjustedState.activeOptionIndex, + resolveId: (option) => option.id, + resolveDisabled: (option) => option.dataRef.current.disabled + }); + return { + ...state, + ...adjustedState, + searchQuery: "", + activeOptionIndex, + activationTrigger: (_a3 = action.trigger) != null ? _a3 : 1 /* Other */ + }; + }, + [3 /* Search */]: (state, action) => { + if (state.dataRef.current.disabled) + return state; + if (state.listboxState === 1 /* Closed */) + return state; + let wasAlreadySearching = state.searchQuery !== ""; + let offset = wasAlreadySearching ? 0 : 1; + let searchQuery = state.searchQuery + action.value.toLowerCase(); + let reOrderedOptions = state.activeOptionIndex !== null ? state.options.slice(state.activeOptionIndex + offset).concat(state.options.slice(0, state.activeOptionIndex + offset)) : state.options; + let matchingOption = reOrderedOptions.find( + (option) => { + var _a3; + return !option.dataRef.current.disabled && ((_a3 = option.dataRef.current.textValue) == null ? void 0 : _a3.startsWith(searchQuery)); + } + ); + let matchIdx = matchingOption ? state.options.indexOf(matchingOption) : -1; + if (matchIdx === -1 || matchIdx === state.activeOptionIndex) + return { ...state, searchQuery }; + return { + ...state, + searchQuery, + activeOptionIndex: matchIdx, + activationTrigger: 1 /* Other */ + }; + }, + [4 /* ClearSearch */](state) { + if (state.dataRef.current.disabled) + return state; + if (state.listboxState === 1 /* Closed */) + return state; + if (state.searchQuery === "") + return state; + return { ...state, searchQuery: "" }; + }, + [5 /* RegisterOption */]: (state, action) => { + let option = { id: action.id, dataRef: action.dataRef }; + let adjustedState = adjustOrderedState2(state, (options) => [...options, option]); + if (state.activeOptionIndex === null) { + if (state.dataRef.current.isSelected(action.dataRef.current.value)) { + adjustedState.activeOptionIndex = adjustedState.options.indexOf(option); + } + } + return { ...state, ...adjustedState }; + }, + [6 /* UnregisterOption */]: (state, action) => { + let adjustedState = adjustOrderedState2(state, (options) => { + let idx = options.findIndex((a) => a.id === action.id); + if (idx !== -1) + options.splice(idx, 1); + return options; + }); + return { + ...state, + ...adjustedState, + activationTrigger: 1 /* Other */ + }; + }, + [7 /* RegisterLabel */]: (state, action) => { + return { + ...state, + labelId: action.id + }; + } +}; +var ListboxActionsContext = (0, import_react35.createContext)(null); +ListboxActionsContext.displayName = "ListboxActionsContext"; +function useActions2(component) { + let context = (0, import_react35.useContext)(ListboxActionsContext); + if (context === null) { + let err = new Error(`<${component} /> is missing a parent component.`); + if (Error.captureStackTrace) + Error.captureStackTrace(err, useActions2); + throw err; + } + return context; +} +var ListboxDataContext = (0, import_react35.createContext)(null); +ListboxDataContext.displayName = "ListboxDataContext"; +function useData2(component) { + let context = (0, import_react35.useContext)(ListboxDataContext); + if (context === null) { + let err = new Error(`<${component} /> is missing a parent component.`); + if (Error.captureStackTrace) + Error.captureStackTrace(err, useData2); + throw err; + } + return context; +} +function stateReducer4(state, action) { + return match(action.type, reducers4, state, action); +} +var DEFAULT_LISTBOX_TAG = import_react35.Fragment; +function ListboxFn(props, ref) { + let { + value: controlledValue, + defaultValue, + form: formName, + name, + onChange: controlledOnChange, + by = (a, z) => a === z, + disabled = false, + horizontal = false, + multiple = false, + ...theirProps + } = props; + const orientation = horizontal ? "horizontal" : "vertical"; + let listboxRef = useSyncRefs(ref); + let [value = multiple ? [] : void 0, theirOnChange] = useControllable( + controlledValue, + controlledOnChange, + defaultValue + ); + let [state, dispatch] = (0, import_react35.useReducer)(stateReducer4, { + dataRef: (0, import_react35.createRef)(), + listboxState: 1 /* Closed */, + options: [], + searchQuery: "", + labelId: null, + activeOptionIndex: null, + activationTrigger: 1 /* Other */ + }); + let optionsPropsRef = (0, import_react35.useRef)({ static: false, hold: false }); + let labelRef = (0, import_react35.useRef)(null); + let buttonRef = (0, import_react35.useRef)(null); + let optionsRef = (0, import_react35.useRef)(null); + let compare = useEvent( + typeof by === "string" ? (a, z) => { + let property = by; + return (a == null ? void 0 : a[property]) === (z == null ? void 0 : z[property]); + } : by + ); + let isSelected = (0, import_react35.useCallback)( + (compareValue) => match(data.mode, { + [1 /* Multi */]: () => value.some((option) => compare(option, compareValue)), + [0 /* Single */]: () => compare(value, compareValue) + }), + [value] + ); + let data = (0, import_react35.useMemo)( + () => ({ + ...state, + value, + disabled, + mode: multiple ? 1 /* Multi */ : 0 /* Single */, + orientation, + compare, + isSelected, + optionsPropsRef, + labelRef, + buttonRef, + optionsRef + }), + [value, disabled, multiple, state] + ); + useIsoMorphicEffect(() => { + state.dataRef.current = data; + }, [data]); + useOutsideClick( + [data.buttonRef, data.optionsRef], + (event, target) => { + var _a3; + dispatch({ type: 1 /* CloseListbox */ }); + if (!isFocusableElement(target, 1 /* Loose */)) { + event.preventDefault(); + (_a3 = data.buttonRef.current) == null ? void 0 : _a3.focus(); + } + }, + data.listboxState === 0 /* Open */ + ); + let slot = (0, import_react35.useMemo)( + () => ({ open: data.listboxState === 0 /* Open */, disabled, value }), + [data, disabled, value] + ); + let selectOption = useEvent((id) => { + let option = data.options.find((item) => item.id === id); + if (!option) + return; + onChange(option.dataRef.current.value); + }); + let selectActiveOption = useEvent(() => { + if (data.activeOptionIndex !== null) { + let { dataRef, id } = data.options[data.activeOptionIndex]; + onChange(dataRef.current.value); + dispatch({ type: 2 /* GoToOption */, focus: 4 /* Specific */, id }); + } + }); + let openListbox = useEvent(() => dispatch({ type: 0 /* OpenListbox */ })); + let closeListbox = useEvent(() => dispatch({ type: 1 /* CloseListbox */ })); + let goToOption = useEvent((focus, id, trigger) => { + if (focus === 4 /* Specific */) { + return dispatch({ type: 2 /* GoToOption */, focus: 4 /* Specific */, id, trigger }); + } + return dispatch({ type: 2 /* GoToOption */, focus, trigger }); + }); + let registerOption = useEvent((id, dataRef) => { + dispatch({ type: 5 /* RegisterOption */, id, dataRef }); + return () => dispatch({ type: 6 /* UnregisterOption */, id }); + }); + let registerLabel = useEvent((id) => { + dispatch({ type: 7 /* RegisterLabel */, id }); + return () => dispatch({ type: 7 /* RegisterLabel */, id: null }); + }); + let onChange = useEvent((value2) => { + return match(data.mode, { + [0 /* Single */]() { + return theirOnChange == null ? void 0 : theirOnChange(value2); + }, + [1 /* Multi */]() { + let copy = data.value.slice(); + let idx = copy.findIndex((item) => compare(item, value2)); + if (idx === -1) { + copy.push(value2); + } else { + copy.splice(idx, 1); + } + return theirOnChange == null ? void 0 : theirOnChange(copy); + } + }); + }); + let search = useEvent((value2) => dispatch({ type: 3 /* Search */, value: value2 })); + let clearSearch = useEvent(() => dispatch({ type: 4 /* ClearSearch */ })); + let actions = (0, import_react35.useMemo)( + () => ({ + onChange, + registerOption, + registerLabel, + goToOption, + closeListbox, + openListbox, + selectActiveOption, + selectOption, + search, + clearSearch + }), + [] + ); + let ourProps = { ref: listboxRef }; + let form = (0, import_react35.useRef)(null); + let d = useDisposables(); + (0, import_react35.useEffect)(() => { + if (!form.current) + return; + if (defaultValue === void 0) + return; + d.addEventListener(form.current, "reset", () => { + onChange(defaultValue); + }); + }, [ + form, + onChange + /* Explicitly ignoring `defaultValue` */ + ]); + return /* @__PURE__ */ import_react35.default.createElement(ListboxActionsContext.Provider, { value: actions }, /* @__PURE__ */ import_react35.default.createElement(ListboxDataContext.Provider, { value: data }, /* @__PURE__ */ import_react35.default.createElement( + OpenClosedProvider, + { + value: match(data.listboxState, { + [0 /* Open */]: 1 /* Open */, + [1 /* Closed */]: 2 /* Closed */ + }) + }, + name != null && value != null && objectToFormEntries({ [name]: value }).map(([name2, value2], idx) => /* @__PURE__ */ import_react35.default.createElement( + Hidden, + { + features: 4 /* Hidden */, + ref: idx === 0 ? (element) => { + var _a3; + form.current = (_a3 = element == null ? void 0 : element.closest("form")) != null ? _a3 : null; + } : void 0, + ...compact({ + key: name2, + as: "input", + type: "hidden", + hidden: true, + readOnly: true, + form: formName, + name: name2, + value: value2 + }) + } + )), + render({ ourProps, theirProps, slot, defaultTag: DEFAULT_LISTBOX_TAG, name: "Listbox" }) + ))); +} +var DEFAULT_BUTTON_TAG3 = "button"; +function ButtonFn3(props, ref) { + var _a3; + let internalId = useId(); + let { id = `headlessui-listbox-button-${internalId}`, ...theirProps } = props; + let data = useData2("Listbox.Button"); + let actions = useActions2("Listbox.Button"); + let buttonRef = useSyncRefs(data.buttonRef, ref); + let d = useDisposables(); + let handleKeyDown = useEvent((event) => { + switch (event.key) { + case " " /* Space */: + case "Enter" /* Enter */: + case "ArrowDown" /* ArrowDown */: + event.preventDefault(); + actions.openListbox(); + d.nextFrame(() => { + if (!data.value) + actions.goToOption(0 /* First */); + }); + break; + case "ArrowUp" /* ArrowUp */: + event.preventDefault(); + actions.openListbox(); + d.nextFrame(() => { + if (!data.value) + actions.goToOption(3 /* Last */); + }); + break; + } + }); + let handleKeyUp = useEvent((event) => { + switch (event.key) { + case " " /* Space */: + event.preventDefault(); + break; + } + }); + let handleClick = useEvent((event) => { + if (isDisabledReactIssue7711(event.currentTarget)) + return event.preventDefault(); + if (data.listboxState === 0 /* Open */) { + actions.closeListbox(); + d.nextFrame(() => { + var _a4; + return (_a4 = data.buttonRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); + }); + } else { + event.preventDefault(); + actions.openListbox(); + } + }); + let labelledby = useComputed(() => { + if (!data.labelId) + return void 0; + return [data.labelId, id].join(" "); + }, [data.labelId, id]); + let slot = (0, import_react35.useMemo)( + () => ({ + open: data.listboxState === 0 /* Open */, + disabled: data.disabled, + value: data.value + }), + [data] + ); + let ourProps = { + ref: buttonRef, + id, + type: useResolveButtonType(props, data.buttonRef), + "aria-haspopup": "listbox", + "aria-controls": (_a3 = data.optionsRef.current) == null ? void 0 : _a3.id, + "aria-expanded": data.disabled ? void 0 : data.listboxState === 0 /* Open */, + "aria-labelledby": labelledby, + disabled: data.disabled, + onKeyDown: handleKeyDown, + onKeyUp: handleKeyUp, + onClick: handleClick + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_BUTTON_TAG3, + name: "Listbox.Button" + }); +} +var DEFAULT_LABEL_TAG2 = "label"; +function LabelFn2(props, ref) { + let internalId = useId(); + let { id = `headlessui-listbox-label-${internalId}`, ...theirProps } = props; + let data = useData2("Listbox.Label"); + let actions = useActions2("Listbox.Label"); + let labelRef = useSyncRefs(data.labelRef, ref); + useIsoMorphicEffect(() => actions.registerLabel(id), [id]); + let handleClick = useEvent(() => { + var _a3; + return (_a3 = data.buttonRef.current) == null ? void 0 : _a3.focus({ preventScroll: true }); + }); + let slot = (0, import_react35.useMemo)( + () => ({ open: data.listboxState === 0 /* Open */, disabled: data.disabled }), + [data] + ); + let ourProps = { ref: labelRef, id, onClick: handleClick }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_LABEL_TAG2, + name: "Listbox.Label" + }); +} +var DEFAULT_OPTIONS_TAG2 = "ul"; +var OptionsRenderFeatures2 = 1 /* RenderStrategy */ | 2 /* Static */; +function OptionsFn2(props, ref) { + var _a3; + let internalId = useId(); + let { id = `headlessui-listbox-options-${internalId}`, ...theirProps } = props; + let data = useData2("Listbox.Options"); + let actions = useActions2("Listbox.Options"); + let optionsRef = useSyncRefs(data.optionsRef, ref); + let d = useDisposables(); + let searchDisposables = useDisposables(); + let usesOpenClosedState = useOpenClosed(); + let visible = (() => { + if (usesOpenClosedState !== null) { + return (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; + } + return data.listboxState === 0 /* Open */; + })(); + (0, import_react35.useEffect)(() => { + var _a4; + let container = data.optionsRef.current; + if (!container) + return; + if (data.listboxState !== 0 /* Open */) + return; + if (container === ((_a4 = getOwnerDocument(container)) == null ? void 0 : _a4.activeElement)) + return; + container.focus({ preventScroll: true }); + }, [data.listboxState, data.optionsRef]); + let handleKeyDown = useEvent((event) => { + searchDisposables.dispose(); + switch (event.key) { + case " " /* Space */: + if (data.searchQuery !== "") { + event.preventDefault(); + event.stopPropagation(); + return actions.search(event.key); + } + case "Enter" /* Enter */: + event.preventDefault(); + event.stopPropagation(); + if (data.activeOptionIndex !== null) { + let { dataRef } = data.options[data.activeOptionIndex]; + actions.onChange(dataRef.current.value); + } + if (data.mode === 0 /* Single */) { + actions.closeListbox(); + disposables().nextFrame(() => { + var _a4; + return (_a4 = data.buttonRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); + }); + } + break; + case match(data.orientation, { vertical: "ArrowDown" /* ArrowDown */, horizontal: "ArrowRight" /* ArrowRight */ }): + event.preventDefault(); + event.stopPropagation(); + return actions.goToOption(2 /* Next */); + case match(data.orientation, { vertical: "ArrowUp" /* ArrowUp */, horizontal: "ArrowLeft" /* ArrowLeft */ }): + event.preventDefault(); + event.stopPropagation(); + return actions.goToOption(1 /* Previous */); + case "Home" /* Home */: + case "PageUp" /* PageUp */: + event.preventDefault(); + event.stopPropagation(); + return actions.goToOption(0 /* First */); + case "End" /* End */: + case "PageDown" /* PageDown */: + event.preventDefault(); + event.stopPropagation(); + return actions.goToOption(3 /* Last */); + case "Escape" /* Escape */: + event.preventDefault(); + event.stopPropagation(); + actions.closeListbox(); + return d.nextFrame(() => { + var _a4; + return (_a4 = data.buttonRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); + }); + case "Tab" /* Tab */: + event.preventDefault(); + event.stopPropagation(); + break; + default: + if (event.key.length === 1) { + actions.search(event.key); + searchDisposables.setTimeout(() => actions.clearSearch(), 350); + } + break; + } + }); + let labelledby = useComputed( + () => { + var _a4, _b, _c; + return (_c = (_a4 = data.labelRef.current) == null ? void 0 : _a4.id) != null ? _c : (_b = data.buttonRef.current) == null ? void 0 : _b.id; + }, + [data.labelRef.current, data.buttonRef.current] + ); + let slot = (0, import_react35.useMemo)( + () => ({ open: data.listboxState === 0 /* Open */ }), + [data] + ); + let ourProps = { + "aria-activedescendant": data.activeOptionIndex === null ? void 0 : (_a3 = data.options[data.activeOptionIndex]) == null ? void 0 : _a3.id, + "aria-multiselectable": data.mode === 1 /* Multi */ ? true : void 0, + "aria-labelledby": labelledby, + "aria-orientation": data.orientation, + id, + onKeyDown: handleKeyDown, + role: "listbox", + tabIndex: 0, + ref: optionsRef + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_OPTIONS_TAG2, + features: OptionsRenderFeatures2, + visible, + name: "Listbox.Options" + }); +} +var DEFAULT_OPTION_TAG2 = "li"; +function OptionFn2(props, ref) { + let internalId = useId(); + let { + id = `headlessui-listbox-option-${internalId}`, + disabled = false, + value, + ...theirProps + } = props; + let data = useData2("Listbox.Option"); + let actions = useActions2("Listbox.Option"); + let active = data.activeOptionIndex !== null ? data.options[data.activeOptionIndex].id === id : false; + let selected = data.isSelected(value); + let internalOptionRef = (0, import_react35.useRef)(null); + let getTextValue2 = useTextValue(internalOptionRef); + let bag = useLatestValue({ + disabled, + value, + domRef: internalOptionRef, + get textValue() { + return getTextValue2(); + } + }); + let optionRef = useSyncRefs(ref, internalOptionRef); + useIsoMorphicEffect(() => { + if (data.listboxState !== 0 /* Open */) + return; + if (!active) + return; + if (data.activationTrigger === 0 /* Pointer */) + return; + let d = disposables(); + d.requestAnimationFrame(() => { + var _a3, _b; + (_b = (_a3 = internalOptionRef.current) == null ? void 0 : _a3.scrollIntoView) == null ? void 0 : _b.call(_a3, { block: "nearest" }); + }); + return d.dispose; + }, [ + internalOptionRef, + active, + data.listboxState, + data.activationTrigger, + /* We also want to trigger this when the position of the active item changes so that we can re-trigger the scrollIntoView */ + data.activeOptionIndex + ]); + useIsoMorphicEffect(() => actions.registerOption(id, bag), [bag, id]); + let handleClick = useEvent((event) => { + if (disabled) + return event.preventDefault(); + actions.onChange(value); + if (data.mode === 0 /* Single */) { + actions.closeListbox(); + disposables().nextFrame(() => { + var _a3; + return (_a3 = data.buttonRef.current) == null ? void 0 : _a3.focus({ preventScroll: true }); + }); + } + }); + let handleFocus = useEvent(() => { + if (disabled) + return actions.goToOption(5 /* Nothing */); + actions.goToOption(4 /* Specific */, id); + }); + let pointer = useTrackedPointer(); + let handleEnter = useEvent((evt) => pointer.update(evt)); + let handleMove = useEvent((evt) => { + if (!pointer.wasMoved(evt)) + return; + if (disabled) + return; + if (active) + return; + actions.goToOption(4 /* Specific */, id, 0 /* Pointer */); + }); + let handleLeave = useEvent((evt) => { + if (!pointer.wasMoved(evt)) + return; + if (disabled) + return; + if (!active) + return; + actions.goToOption(5 /* Nothing */); + }); + let slot = (0, import_react35.useMemo)( + () => ({ active, selected, disabled }), + [active, selected, disabled] + ); + let ourProps = { + id, + ref: optionRef, + role: "option", + tabIndex: disabled === true ? void 0 : -1, + "aria-disabled": disabled === true ? true : void 0, + // According to the WAI-ARIA best practices, we should use aria-checked for + // multi-select,but Voice-Over disagrees. So we use aria-checked instead for + // both single and multi-select. + "aria-selected": selected, + disabled: void 0, + // Never forward the `disabled` prop + onClick: handleClick, + onFocus: handleFocus, + onPointerEnter: handleEnter, + onMouseEnter: handleEnter, + onPointerMove: handleMove, + onMouseMove: handleMove, + onPointerLeave: handleLeave, + onMouseLeave: handleLeave + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_OPTION_TAG2, + name: "Listbox.Option" + }); +} +var ListboxRoot = forwardRefWithAs(ListboxFn); +var Button3 = forwardRefWithAs(ButtonFn3); +var Label2 = forwardRefWithAs(LabelFn2); +var Options2 = forwardRefWithAs(OptionsFn2); +var Option2 = forwardRefWithAs(OptionFn2); +var Listbox = Object.assign(ListboxRoot, { Button: Button3, Label: Label2, Options: Options2, Option: Option2 }); + +// src/components/menu/menu.tsx +var import_react36 = __toESM(__webpack_require__(/*! react */ "react"), 1); +function adjustOrderedState3(state, adjustment = (i) => i) { + let currentActiveItem = state.activeItemIndex !== null ? state.items[state.activeItemIndex] : null; + let sortedItems = sortByDomNode( + adjustment(state.items.slice()), + (item) => item.dataRef.current.domRef.current + ); + let adjustedActiveItemIndex = currentActiveItem ? sortedItems.indexOf(currentActiveItem) : null; + if (adjustedActiveItemIndex === -1) { + adjustedActiveItemIndex = null; + } + return { + items: sortedItems, + activeItemIndex: adjustedActiveItemIndex + }; +} +var reducers5 = { + [1 /* CloseMenu */](state) { + if (state.menuState === 1 /* Closed */) + return state; + return { ...state, activeItemIndex: null, menuState: 1 /* Closed */ }; + }, + [0 /* OpenMenu */](state) { + if (state.menuState === 0 /* Open */) + return state; + return { + ...state, + /* We can turn off demo mode once we re-open the `Menu` */ + __demoMode: false, + menuState: 0 /* Open */ + }; + }, + [2 /* GoToItem */]: (state, action) => { + var _a3; + let adjustedState = adjustOrderedState3(state); + let activeItemIndex = calculateActiveIndex(action, { + resolveItems: () => adjustedState.items, + resolveActiveIndex: () => adjustedState.activeItemIndex, + resolveId: (item) => item.id, + resolveDisabled: (item) => item.dataRef.current.disabled + }); + return { + ...state, + ...adjustedState, + searchQuery: "", + activeItemIndex, + activationTrigger: (_a3 = action.trigger) != null ? _a3 : 1 /* Other */ + }; + }, + [3 /* Search */]: (state, action) => { + let wasAlreadySearching = state.searchQuery !== ""; + let offset = wasAlreadySearching ? 0 : 1; + let searchQuery = state.searchQuery + action.value.toLowerCase(); + let reOrderedItems = state.activeItemIndex !== null ? state.items.slice(state.activeItemIndex + offset).concat(state.items.slice(0, state.activeItemIndex + offset)) : state.items; + let matchingItem = reOrderedItems.find( + (item) => { + var _a3; + return ((_a3 = item.dataRef.current.textValue) == null ? void 0 : _a3.startsWith(searchQuery)) && !item.dataRef.current.disabled; + } + ); + let matchIdx = matchingItem ? state.items.indexOf(matchingItem) : -1; + if (matchIdx === -1 || matchIdx === state.activeItemIndex) + return { ...state, searchQuery }; + return { + ...state, + searchQuery, + activeItemIndex: matchIdx, + activationTrigger: 1 /* Other */ + }; + }, + [4 /* ClearSearch */](state) { + if (state.searchQuery === "") + return state; + return { ...state, searchQuery: "", searchActiveItemIndex: null }; + }, + [5 /* RegisterItem */]: (state, action) => { + let adjustedState = adjustOrderedState3(state, (items) => [ + ...items, + { id: action.id, dataRef: action.dataRef } + ]); + return { ...state, ...adjustedState }; + }, + [6 /* UnregisterItem */]: (state, action) => { + let adjustedState = adjustOrderedState3(state, (items) => { + let idx = items.findIndex((a) => a.id === action.id); + if (idx !== -1) + items.splice(idx, 1); + return items; + }); + return { + ...state, + ...adjustedState, + activationTrigger: 1 /* Other */ + }; + } +}; +var MenuContext = (0, import_react36.createContext)(null); +MenuContext.displayName = "MenuContext"; +function useMenuContext(component) { + let context = (0, import_react36.useContext)(MenuContext); + if (context === null) { + let err = new Error(`<${component} /> is missing a parent component.`); + if (Error.captureStackTrace) + Error.captureStackTrace(err, useMenuContext); + throw err; + } + return context; +} +function stateReducer5(state, action) { + return match(action.type, reducers5, state, action); +} +var DEFAULT_MENU_TAG = import_react36.Fragment; +function MenuFn(props, ref) { + let { __demoMode = false, ...theirProps } = props; + let reducerBag = (0, import_react36.useReducer)(stateReducer5, { + __demoMode, + menuState: __demoMode ? 0 /* Open */ : 1 /* Closed */, + buttonRef: (0, import_react36.createRef)(), + itemsRef: (0, import_react36.createRef)(), + items: [], + searchQuery: "", + activeItemIndex: null, + activationTrigger: 1 /* Other */ + }); + let [{ menuState, itemsRef, buttonRef }, dispatch] = reducerBag; + let menuRef = useSyncRefs(ref); + useOutsideClick( + [buttonRef, itemsRef], + (event, target) => { + var _a3; + dispatch({ type: 1 /* CloseMenu */ }); + if (!isFocusableElement(target, 1 /* Loose */)) { + event.preventDefault(); + (_a3 = buttonRef.current) == null ? void 0 : _a3.focus(); + } + }, + menuState === 0 /* Open */ + ); + let close = useEvent(() => { + dispatch({ type: 1 /* CloseMenu */ }); + }); + let slot = (0, import_react36.useMemo)( + () => ({ open: menuState === 0 /* Open */, close }), + [menuState, close] + ); + let ourProps = { ref: menuRef }; + return /* @__PURE__ */ import_react36.default.createElement(MenuContext.Provider, { value: reducerBag }, /* @__PURE__ */ import_react36.default.createElement( + OpenClosedProvider, + { + value: match(menuState, { + [0 /* Open */]: 1 /* Open */, + [1 /* Closed */]: 2 /* Closed */ + }) + }, + render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_MENU_TAG, + name: "Menu" + }) + )); +} +var DEFAULT_BUTTON_TAG4 = "button"; +function ButtonFn4(props, ref) { + var _a3; + let internalId = useId(); + let { id = `headlessui-menu-button-${internalId}`, ...theirProps } = props; + let [state, dispatch] = useMenuContext("Menu.Button"); + let buttonRef = useSyncRefs(state.buttonRef, ref); + let d = useDisposables(); + let handleKeyDown = useEvent((event) => { + switch (event.key) { + case " " /* Space */: + case "Enter" /* Enter */: + case "ArrowDown" /* ArrowDown */: + event.preventDefault(); + event.stopPropagation(); + dispatch({ type: 0 /* OpenMenu */ }); + d.nextFrame(() => dispatch({ type: 2 /* GoToItem */, focus: 0 /* First */ })); + break; + case "ArrowUp" /* ArrowUp */: + event.preventDefault(); + event.stopPropagation(); + dispatch({ type: 0 /* OpenMenu */ }); + d.nextFrame(() => dispatch({ type: 2 /* GoToItem */, focus: 3 /* Last */ })); + break; + } + }); + let handleKeyUp = useEvent((event) => { + switch (event.key) { + case " " /* Space */: + event.preventDefault(); + break; + } + }); + let handleClick = useEvent((event) => { + if (isDisabledReactIssue7711(event.currentTarget)) + return event.preventDefault(); + if (props.disabled) + return; + if (state.menuState === 0 /* Open */) { + dispatch({ type: 1 /* CloseMenu */ }); + d.nextFrame(() => { + var _a4; + return (_a4 = state.buttonRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); + }); + } else { + event.preventDefault(); + dispatch({ type: 0 /* OpenMenu */ }); + } + }); + let slot = (0, import_react36.useMemo)( + () => ({ open: state.menuState === 0 /* Open */ }), + [state] + ); + let ourProps = { + ref: buttonRef, + id, + type: useResolveButtonType(props, state.buttonRef), + "aria-haspopup": "menu", + "aria-controls": (_a3 = state.itemsRef.current) == null ? void 0 : _a3.id, + "aria-expanded": props.disabled ? void 0 : state.menuState === 0 /* Open */, + onKeyDown: handleKeyDown, + onKeyUp: handleKeyUp, + onClick: handleClick + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_BUTTON_TAG4, + name: "Menu.Button" + }); +} +var DEFAULT_ITEMS_TAG = "div"; +var ItemsRenderFeatures = 1 /* RenderStrategy */ | 2 /* Static */; +function ItemsFn(props, ref) { + var _a3, _b; + let internalId = useId(); + let { id = `headlessui-menu-items-${internalId}`, ...theirProps } = props; + let [state, dispatch] = useMenuContext("Menu.Items"); + let itemsRef = useSyncRefs(state.itemsRef, ref); + let ownerDocument = useOwnerDocument(state.itemsRef); + let searchDisposables = useDisposables(); + let usesOpenClosedState = useOpenClosed(); + let visible = (() => { + if (usesOpenClosedState !== null) { + return (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; + } + return state.menuState === 0 /* Open */; + })(); + (0, import_react36.useEffect)(() => { + let container = state.itemsRef.current; + if (!container) + return; + if (state.menuState !== 0 /* Open */) + return; + if (container === (ownerDocument == null ? void 0 : ownerDocument.activeElement)) + return; + container.focus({ preventScroll: true }); + }, [state.menuState, state.itemsRef, ownerDocument]); + useTreeWalker({ + container: state.itemsRef.current, + enabled: state.menuState === 0 /* Open */, + accept(node) { + if (node.getAttribute("role") === "menuitem") + return NodeFilter.FILTER_REJECT; + if (node.hasAttribute("role")) + return NodeFilter.FILTER_SKIP; + return NodeFilter.FILTER_ACCEPT; + }, + walk(node) { + node.setAttribute("role", "none"); + } + }); + let handleKeyDown = useEvent((event) => { + var _a4, _b2; + searchDisposables.dispose(); + switch (event.key) { + case " " /* Space */: + if (state.searchQuery !== "") { + event.preventDefault(); + event.stopPropagation(); + return dispatch({ type: 3 /* Search */, value: event.key }); + } + case "Enter" /* Enter */: + event.preventDefault(); + event.stopPropagation(); + dispatch({ type: 1 /* CloseMenu */ }); + if (state.activeItemIndex !== null) { + let { dataRef } = state.items[state.activeItemIndex]; + (_b2 = (_a4 = dataRef.current) == null ? void 0 : _a4.domRef.current) == null ? void 0 : _b2.click(); + } + restoreFocusIfNecessary(state.buttonRef.current); + break; + case "ArrowDown" /* ArrowDown */: + event.preventDefault(); + event.stopPropagation(); + return dispatch({ type: 2 /* GoToItem */, focus: 2 /* Next */ }); + case "ArrowUp" /* ArrowUp */: + event.preventDefault(); + event.stopPropagation(); + return dispatch({ type: 2 /* GoToItem */, focus: 1 /* Previous */ }); + case "Home" /* Home */: + case "PageUp" /* PageUp */: + event.preventDefault(); + event.stopPropagation(); + return dispatch({ type: 2 /* GoToItem */, focus: 0 /* First */ }); + case "End" /* End */: + case "PageDown" /* PageDown */: + event.preventDefault(); + event.stopPropagation(); + return dispatch({ type: 2 /* GoToItem */, focus: 3 /* Last */ }); + case "Escape" /* Escape */: + event.preventDefault(); + event.stopPropagation(); + dispatch({ type: 1 /* CloseMenu */ }); + disposables().nextFrame(() => { + var _a5; + return (_a5 = state.buttonRef.current) == null ? void 0 : _a5.focus({ preventScroll: true }); + }); + break; + case "Tab" /* Tab */: + event.preventDefault(); + event.stopPropagation(); + dispatch({ type: 1 /* CloseMenu */ }); + disposables().nextFrame(() => { + focusFrom( + state.buttonRef.current, + event.shiftKey ? 2 /* Previous */ : 4 /* Next */ + ); + }); + break; + default: + if (event.key.length === 1) { + dispatch({ type: 3 /* Search */, value: event.key }); + searchDisposables.setTimeout(() => dispatch({ type: 4 /* ClearSearch */ }), 350); + } + break; + } + }); + let handleKeyUp = useEvent((event) => { + switch (event.key) { + case " " /* Space */: + event.preventDefault(); + break; + } + }); + let slot = (0, import_react36.useMemo)( + () => ({ open: state.menuState === 0 /* Open */ }), + [state] + ); + let ourProps = { + "aria-activedescendant": state.activeItemIndex === null ? void 0 : (_a3 = state.items[state.activeItemIndex]) == null ? void 0 : _a3.id, + "aria-labelledby": (_b = state.buttonRef.current) == null ? void 0 : _b.id, + id, + onKeyDown: handleKeyDown, + onKeyUp: handleKeyUp, + role: "menu", + tabIndex: 0, + ref: itemsRef + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_ITEMS_TAG, + features: ItemsRenderFeatures, + visible, + name: "Menu.Items" + }); +} +var DEFAULT_ITEM_TAG = import_react36.Fragment; +function ItemFn(props, ref) { + let internalId = useId(); + let { id = `headlessui-menu-item-${internalId}`, disabled = false, ...theirProps } = props; + let [state, dispatch] = useMenuContext("Menu.Item"); + let active = state.activeItemIndex !== null ? state.items[state.activeItemIndex].id === id : false; + let internalItemRef = (0, import_react36.useRef)(null); + let itemRef = useSyncRefs(ref, internalItemRef); + useIsoMorphicEffect(() => { + if (state.__demoMode) + return; + if (state.menuState !== 0 /* Open */) + return; + if (!active) + return; + if (state.activationTrigger === 0 /* Pointer */) + return; + let d = disposables(); + d.requestAnimationFrame(() => { + var _a3, _b; + (_b = (_a3 = internalItemRef.current) == null ? void 0 : _a3.scrollIntoView) == null ? void 0 : _b.call(_a3, { block: "nearest" }); + }); + return d.dispose; + }, [ + state.__demoMode, + internalItemRef, + active, + state.menuState, + state.activationTrigger, + /* We also want to trigger this when the position of the active item changes so that we can re-trigger the scrollIntoView */ + state.activeItemIndex + ]); + let getTextValue2 = useTextValue(internalItemRef); + let bag = (0, import_react36.useRef)({ + disabled, + domRef: internalItemRef, + get textValue() { + return getTextValue2(); + } + }); + useIsoMorphicEffect(() => { + bag.current.disabled = disabled; + }, [bag, disabled]); + useIsoMorphicEffect(() => { + dispatch({ type: 5 /* RegisterItem */, id, dataRef: bag }); + return () => dispatch({ type: 6 /* UnregisterItem */, id }); + }, [bag, id]); + let close = useEvent(() => { + dispatch({ type: 1 /* CloseMenu */ }); + }); + let handleClick = useEvent((event) => { + if (disabled) + return event.preventDefault(); + dispatch({ type: 1 /* CloseMenu */ }); + restoreFocusIfNecessary(state.buttonRef.current); + }); + let handleFocus = useEvent(() => { + if (disabled) + return dispatch({ type: 2 /* GoToItem */, focus: 5 /* Nothing */ }); + dispatch({ type: 2 /* GoToItem */, focus: 4 /* Specific */, id }); + }); + let pointer = useTrackedPointer(); + let handleEnter = useEvent((evt) => pointer.update(evt)); + let handleMove = useEvent((evt) => { + if (!pointer.wasMoved(evt)) + return; + if (disabled) + return; + if (active) + return; + dispatch({ + type: 2 /* GoToItem */, + focus: 4 /* Specific */, + id, + trigger: 0 /* Pointer */ + }); + }); + let handleLeave = useEvent((evt) => { + if (!pointer.wasMoved(evt)) + return; + if (disabled) + return; + if (!active) + return; + dispatch({ type: 2 /* GoToItem */, focus: 5 /* Nothing */ }); + }); + let slot = (0, import_react36.useMemo)( + () => ({ active, disabled, close }), + [active, disabled, close] + ); + let ourProps = { + id, + ref: itemRef, + role: "menuitem", + tabIndex: disabled === true ? void 0 : -1, + "aria-disabled": disabled === true ? true : void 0, + disabled: void 0, + // Never forward the `disabled` prop + onClick: handleClick, + onFocus: handleFocus, + onPointerEnter: handleEnter, + onMouseEnter: handleEnter, + onPointerMove: handleMove, + onMouseMove: handleMove, + onPointerLeave: handleLeave, + onMouseLeave: handleLeave + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_ITEM_TAG, + name: "Menu.Item" + }); +} +var MenuRoot = forwardRefWithAs(MenuFn); +var Button4 = forwardRefWithAs(ButtonFn4); +var Items = forwardRefWithAs(ItemsFn); +var Item = forwardRefWithAs(ItemFn); +var Menu = Object.assign(MenuRoot, { Button: Button4, Items, Item }); + +// src/components/popover/popover.tsx +var import_react37 = __toESM(__webpack_require__(/*! react */ "react"), 1); +var reducers6 = { + [0 /* TogglePopover */]: (state) => { + let nextState = { + ...state, + popoverState: match(state.popoverState, { + [0 /* Open */]: 1 /* Closed */, + [1 /* Closed */]: 0 /* Open */ + }) + }; + if (nextState.popoverState === 0 /* Open */) { + nextState.__demoMode = false; + } + return nextState; + }, + [1 /* ClosePopover */](state) { + if (state.popoverState === 1 /* Closed */) + return state; + return { ...state, popoverState: 1 /* Closed */ }; + }, + [2 /* SetButton */](state, action) { + if (state.button === action.button) + return state; + return { ...state, button: action.button }; + }, + [3 /* SetButtonId */](state, action) { + if (state.buttonId === action.buttonId) + return state; + return { ...state, buttonId: action.buttonId }; + }, + [4 /* SetPanel */](state, action) { + if (state.panel === action.panel) + return state; + return { ...state, panel: action.panel }; + }, + [5 /* SetPanelId */](state, action) { + if (state.panelId === action.panelId) + return state; + return { ...state, panelId: action.panelId }; + } +}; +var PopoverContext = (0, import_react37.createContext)(null); +PopoverContext.displayName = "PopoverContext"; +function usePopoverContext(component) { + let context = (0, import_react37.useContext)(PopoverContext); + if (context === null) { + let err = new Error(`<${component} /> is missing a parent component.`); + if (Error.captureStackTrace) + Error.captureStackTrace(err, usePopoverContext); + throw err; + } + return context; +} +var PopoverAPIContext = (0, import_react37.createContext)(null); +PopoverAPIContext.displayName = "PopoverAPIContext"; +function usePopoverAPIContext(component) { + let context = (0, import_react37.useContext)(PopoverAPIContext); + if (context === null) { + let err = new Error(`<${component} /> is missing a parent component.`); + if (Error.captureStackTrace) + Error.captureStackTrace(err, usePopoverAPIContext); + throw err; + } + return context; +} +var PopoverGroupContext = (0, import_react37.createContext)(null); +PopoverGroupContext.displayName = "PopoverGroupContext"; +function usePopoverGroupContext() { + return (0, import_react37.useContext)(PopoverGroupContext); +} +var PopoverPanelContext = (0, import_react37.createContext)(null); +PopoverPanelContext.displayName = "PopoverPanelContext"; +function usePopoverPanelContext() { + return (0, import_react37.useContext)(PopoverPanelContext); +} +function stateReducer6(state, action) { + return match(action.type, reducers6, state, action); +} +var DEFAULT_POPOVER_TAG = "div"; +function PopoverFn(props, ref) { + var _a3; + let { __demoMode = false, ...theirProps } = props; + let internalPopoverRef = (0, import_react37.useRef)(null); + let popoverRef = useSyncRefs( + ref, + optionalRef((ref2) => { + internalPopoverRef.current = ref2; + }) + ); + let buttons = (0, import_react37.useRef)([]); + let reducerBag = (0, import_react37.useReducer)(stateReducer6, { + __demoMode, + popoverState: __demoMode ? 0 /* Open */ : 1 /* Closed */, + buttons, + button: null, + buttonId: null, + panel: null, + panelId: null, + beforePanelSentinel: (0, import_react37.createRef)(), + afterPanelSentinel: (0, import_react37.createRef)() + }); + let [ + { popoverState, button, buttonId, panel, panelId, beforePanelSentinel, afterPanelSentinel }, + dispatch + ] = reducerBag; + let ownerDocument = useOwnerDocument((_a3 = internalPopoverRef.current) != null ? _a3 : button); + let isPortalled = (0, import_react37.useMemo)(() => { + if (!button) + return false; + if (!panel) + return false; + for (let root2 of document.querySelectorAll("body > *")) { + if (Number(root2 == null ? void 0 : root2.contains(button)) ^ Number(root2 == null ? void 0 : root2.contains(panel))) { + return true; + } + } + let elements = getFocusableElements(); + let buttonIdx = elements.indexOf(button); + let beforeIdx = (buttonIdx + elements.length - 1) % elements.length; + let afterIdx = (buttonIdx + 1) % elements.length; + let beforeElement = elements[beforeIdx]; + let afterElement = elements[afterIdx]; + if (!panel.contains(beforeElement) && !panel.contains(afterElement)) { + return true; + } + return false; + }, [button, panel]); + let buttonIdRef = useLatestValue(buttonId); + let panelIdRef = useLatestValue(panelId); + let registerBag = (0, import_react37.useMemo)( + () => ({ + buttonId: buttonIdRef, + panelId: panelIdRef, + close: () => dispatch({ type: 1 /* ClosePopover */ }) + }), + [buttonIdRef, panelIdRef, dispatch] + ); + let groupContext = usePopoverGroupContext(); + let registerPopover = groupContext == null ? void 0 : groupContext.registerPopover; + let isFocusWithinPopoverGroup = useEvent(() => { + var _a4; + return (_a4 = groupContext == null ? void 0 : groupContext.isFocusWithinPopoverGroup()) != null ? _a4 : (ownerDocument == null ? void 0 : ownerDocument.activeElement) && ((button == null ? void 0 : button.contains(ownerDocument.activeElement)) || (panel == null ? void 0 : panel.contains(ownerDocument.activeElement))); + }); + (0, import_react37.useEffect)(() => registerPopover == null ? void 0 : registerPopover(registerBag), [registerPopover, registerBag]); + let [portals, PortalWrapper] = useNestedPortals(); + let root = useRootContainers({ + portals, + defaultContainers: [button, panel] + }); + useEventListener( + ownerDocument == null ? void 0 : ownerDocument.defaultView, + "focus", + (event) => { + var _a4, _b, _c, _d; + if (event.target === window) + return; + if (!(event.target instanceof HTMLElement)) + return; + if (popoverState !== 0 /* Open */) + return; + if (isFocusWithinPopoverGroup()) + return; + if (!button) + return; + if (!panel) + return; + if (root.contains(event.target)) + return; + if ((_b = (_a4 = beforePanelSentinel.current) == null ? void 0 : _a4.contains) == null ? void 0 : _b.call(_a4, event.target)) + return; + if ((_d = (_c = afterPanelSentinel.current) == null ? void 0 : _c.contains) == null ? void 0 : _d.call(_c, event.target)) + return; + dispatch({ type: 1 /* ClosePopover */ }); + }, + true + ); + useOutsideClick( + root.resolveContainers, + (event, target) => { + dispatch({ type: 1 /* ClosePopover */ }); + if (!isFocusableElement(target, 1 /* Loose */)) { + event.preventDefault(); + button == null ? void 0 : button.focus(); + } + }, + popoverState === 0 /* Open */ + ); + let close = useEvent( + (focusableElement) => { + dispatch({ type: 1 /* ClosePopover */ }); + let restoreElement = (() => { + if (!focusableElement) + return button; + if (focusableElement instanceof HTMLElement) + return focusableElement; + if ("current" in focusableElement && focusableElement.current instanceof HTMLElement) + return focusableElement.current; + return button; + })(); + restoreElement == null ? void 0 : restoreElement.focus(); + } + ); + let api = (0, import_react37.useMemo)( + () => ({ close, isPortalled }), + [close, isPortalled] + ); + let slot = (0, import_react37.useMemo)( + () => ({ open: popoverState === 0 /* Open */, close }), + [popoverState, close] + ); + let ourProps = { ref: popoverRef }; + return /* @__PURE__ */ import_react37.default.createElement(PopoverPanelContext.Provider, { value: null }, /* @__PURE__ */ import_react37.default.createElement(PopoverContext.Provider, { value: reducerBag }, /* @__PURE__ */ import_react37.default.createElement(PopoverAPIContext.Provider, { value: api }, /* @__PURE__ */ import_react37.default.createElement( + OpenClosedProvider, + { + value: match(popoverState, { + [0 /* Open */]: 1 /* Open */, + [1 /* Closed */]: 2 /* Closed */ + }) + }, + /* @__PURE__ */ import_react37.default.createElement(PortalWrapper, null, render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_POPOVER_TAG, + name: "Popover" + }), /* @__PURE__ */ import_react37.default.createElement(root.MainTreeNode, null)) + )))); +} +var DEFAULT_BUTTON_TAG5 = "button"; +function ButtonFn5(props, ref) { + let internalId = useId(); + let { id = `headlessui-popover-button-${internalId}`, ...theirProps } = props; + let [state, dispatch] = usePopoverContext("Popover.Button"); + let { isPortalled } = usePopoverAPIContext("Popover.Button"); + let internalButtonRef = (0, import_react37.useRef)(null); + let sentinelId = `headlessui-focus-sentinel-${useId()}`; + let groupContext = usePopoverGroupContext(); + let closeOthers = groupContext == null ? void 0 : groupContext.closeOthers; + let panelContext = usePopoverPanelContext(); + let isWithinPanel = panelContext !== null; + (0, import_react37.useEffect)(() => { + if (isWithinPanel) + return; + dispatch({ type: 3 /* SetButtonId */, buttonId: id }); + return () => { + dispatch({ type: 3 /* SetButtonId */, buttonId: null }); + }; + }, [isWithinPanel, id, dispatch]); + let [uniqueIdentifier] = (0, import_react37.useState)(() => Symbol()); + let buttonRef = useSyncRefs( + internalButtonRef, + ref, + isWithinPanel ? null : (button) => { + if (button) { + state.buttons.current.push(uniqueIdentifier); + } else { + let idx = state.buttons.current.indexOf(uniqueIdentifier); + if (idx !== -1) + state.buttons.current.splice(idx, 1); + } + if (state.buttons.current.length > 1) { + console.warn( + "You are already using a but only 1 is supported." + ); + } + button && dispatch({ type: 2 /* SetButton */, button }); + } + ); + let withinPanelButtonRef = useSyncRefs(internalButtonRef, ref); + let ownerDocument = useOwnerDocument(internalButtonRef); + let handleKeyDown = useEvent((event) => { + var _a3, _b, _c; + if (isWithinPanel) { + if (state.popoverState === 1 /* Closed */) + return; + switch (event.key) { + case " " /* Space */: + case "Enter" /* Enter */: + event.preventDefault(); + (_b = (_a3 = event.target).click) == null ? void 0 : _b.call(_a3); + dispatch({ type: 1 /* ClosePopover */ }); + (_c = state.button) == null ? void 0 : _c.focus(); + break; + } + } else { + switch (event.key) { + case " " /* Space */: + case "Enter" /* Enter */: + event.preventDefault(); + event.stopPropagation(); + if (state.popoverState === 1 /* Closed */) + closeOthers == null ? void 0 : closeOthers(state.buttonId); + dispatch({ type: 0 /* TogglePopover */ }); + break; + case "Escape" /* Escape */: + if (state.popoverState !== 0 /* Open */) + return closeOthers == null ? void 0 : closeOthers(state.buttonId); + if (!internalButtonRef.current) + return; + if ((ownerDocument == null ? void 0 : ownerDocument.activeElement) && !internalButtonRef.current.contains(ownerDocument.activeElement)) { + return; + } + event.preventDefault(); + event.stopPropagation(); + dispatch({ type: 1 /* ClosePopover */ }); + break; + } + } + }); + let handleKeyUp = useEvent((event) => { + if (isWithinPanel) + return; + if (event.key === " " /* Space */) { + event.preventDefault(); + } + }); + let handleClick = useEvent((event) => { + var _a3, _b; + if (isDisabledReactIssue7711(event.currentTarget)) + return; + if (props.disabled) + return; + if (isWithinPanel) { + dispatch({ type: 1 /* ClosePopover */ }); + (_a3 = state.button) == null ? void 0 : _a3.focus(); + } else { + event.preventDefault(); + event.stopPropagation(); + if (state.popoverState === 1 /* Closed */) + closeOthers == null ? void 0 : closeOthers(state.buttonId); + dispatch({ type: 0 /* TogglePopover */ }); + (_b = state.button) == null ? void 0 : _b.focus(); + } + }); + let handleMouseDown = useEvent((event) => { + event.preventDefault(); + event.stopPropagation(); + }); + let visible = state.popoverState === 0 /* Open */; + let slot = (0, import_react37.useMemo)(() => ({ open: visible }), [visible]); + let type = useResolveButtonType(props, internalButtonRef); + let ourProps = isWithinPanel ? { + ref: withinPanelButtonRef, + type, + onKeyDown: handleKeyDown, + onClick: handleClick + } : { + ref: buttonRef, + id: state.buttonId, + type, + "aria-expanded": props.disabled ? void 0 : state.popoverState === 0 /* Open */, + "aria-controls": state.panel ? state.panelId : void 0, + onKeyDown: handleKeyDown, + onKeyUp: handleKeyUp, + onClick: handleClick, + onMouseDown: handleMouseDown + }; + let direction = useTabDirection(); + let handleFocus = useEvent(() => { + let el = state.panel; + if (!el) + return; + function run() { + let result = match(direction.current, { + [0 /* Forwards */]: () => focusIn(el, 1 /* First */), + [1 /* Backwards */]: () => focusIn(el, 8 /* Last */) + }); + if (result === 0 /* Error */) { + focusIn( + getFocusableElements().filter((el2) => el2.dataset.headlessuiFocusGuard !== "true"), + match(direction.current, { + [0 /* Forwards */]: 4 /* Next */, + [1 /* Backwards */]: 2 /* Previous */ + }), + { relativeTo: state.button } + ); + } + } + if (false) {} else { + run(); + } + }); + return /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_BUTTON_TAG5, + name: "Popover.Button" + }), visible && !isWithinPanel && isPortalled && /* @__PURE__ */ import_react37.default.createElement( + Hidden, + { + id: sentinelId, + features: 2 /* Focusable */, + "data-headlessui-focus-guard": true, + as: "button", + type: "button", + onFocus: handleFocus + } + )); +} +var DEFAULT_OVERLAY_TAG2 = "div"; +var OverlayRenderFeatures = 1 /* RenderStrategy */ | 2 /* Static */; +function OverlayFn2(props, ref) { + let internalId = useId(); + let { id = `headlessui-popover-overlay-${internalId}`, ...theirProps } = props; + let [{ popoverState }, dispatch] = usePopoverContext("Popover.Overlay"); + let overlayRef = useSyncRefs(ref); + let usesOpenClosedState = useOpenClosed(); + let visible = (() => { + if (usesOpenClosedState !== null) { + return (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; + } + return popoverState === 0 /* Open */; + })(); + let handleClick = useEvent((event) => { + if (isDisabledReactIssue7711(event.currentTarget)) + return event.preventDefault(); + dispatch({ type: 1 /* ClosePopover */ }); + }); + let slot = (0, import_react37.useMemo)( + () => ({ open: popoverState === 0 /* Open */ }), + [popoverState] + ); + let ourProps = { + ref: overlayRef, + id, + "aria-hidden": true, + onClick: handleClick + }; + return render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_OVERLAY_TAG2, + features: OverlayRenderFeatures, + visible, + name: "Popover.Overlay" + }); +} +var DEFAULT_PANEL_TAG3 = "div"; +var PanelRenderFeatures2 = 1 /* RenderStrategy */ | 2 /* Static */; +function PanelFn3(props, ref) { + let internalId = useId(); + let { id = `headlessui-popover-panel-${internalId}`, focus = false, ...theirProps } = props; + let [state, dispatch] = usePopoverContext("Popover.Panel"); + let { close, isPortalled } = usePopoverAPIContext("Popover.Panel"); + let beforePanelSentinelId = `headlessui-focus-sentinel-before-${useId()}`; + let afterPanelSentinelId = `headlessui-focus-sentinel-after-${useId()}`; + let internalPanelRef = (0, import_react37.useRef)(null); + let panelRef = useSyncRefs(internalPanelRef, ref, (panel) => { + dispatch({ type: 4 /* SetPanel */, panel }); + }); + let ownerDocument = useOwnerDocument(internalPanelRef); + useIsoMorphicEffect(() => { + dispatch({ type: 5 /* SetPanelId */, panelId: id }); + return () => { + dispatch({ type: 5 /* SetPanelId */, panelId: null }); + }; + }, [id, dispatch]); + let usesOpenClosedState = useOpenClosed(); + let visible = (() => { + if (usesOpenClosedState !== null) { + return (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; + } + return state.popoverState === 0 /* Open */; + })(); + let handleKeyDown = useEvent((event) => { + var _a3; + switch (event.key) { + case "Escape" /* Escape */: + if (state.popoverState !== 0 /* Open */) + return; + if (!internalPanelRef.current) + return; + if ((ownerDocument == null ? void 0 : ownerDocument.activeElement) && !internalPanelRef.current.contains(ownerDocument.activeElement)) { + return; + } + event.preventDefault(); + event.stopPropagation(); + dispatch({ type: 1 /* ClosePopover */ }); + (_a3 = state.button) == null ? void 0 : _a3.focus(); + break; + } + }); + (0, import_react37.useEffect)(() => { + var _a3; + if (props.static) + return; + if (state.popoverState === 1 /* Closed */ && ((_a3 = props.unmount) != null ? _a3 : true)) { + dispatch({ type: 4 /* SetPanel */, panel: null }); + } + }, [state.popoverState, props.unmount, props.static, dispatch]); + (0, import_react37.useEffect)(() => { + if (state.__demoMode) + return; + if (!focus) + return; + if (state.popoverState !== 0 /* Open */) + return; + if (!internalPanelRef.current) + return; + let activeElement = ownerDocument == null ? void 0 : ownerDocument.activeElement; + if (internalPanelRef.current.contains(activeElement)) + return; + focusIn(internalPanelRef.current, 1 /* First */); + }, [state.__demoMode, focus, internalPanelRef, state.popoverState]); + let slot = (0, import_react37.useMemo)( + () => ({ open: state.popoverState === 0 /* Open */, close }), + [state, close] + ); + let ourProps = { + ref: panelRef, + id, + onKeyDown: handleKeyDown, + onBlur: focus && state.popoverState === 0 /* Open */ ? (event) => { + var _a3, _b, _c, _d, _e; + let el = event.relatedTarget; + if (!el) + return; + if (!internalPanelRef.current) + return; + if ((_a3 = internalPanelRef.current) == null ? void 0 : _a3.contains(el)) + return; + dispatch({ type: 1 /* ClosePopover */ }); + if (((_c = (_b = state.beforePanelSentinel.current) == null ? void 0 : _b.contains) == null ? void 0 : _c.call(_b, el)) || ((_e = (_d = state.afterPanelSentinel.current) == null ? void 0 : _d.contains) == null ? void 0 : _e.call(_d, el))) { + el.focus({ preventScroll: true }); + } + } : void 0, + tabIndex: -1 + }; + let direction = useTabDirection(); + let handleBeforeFocus = useEvent(() => { + let el = internalPanelRef.current; + if (!el) + return; + function run() { + match(direction.current, { + [0 /* Forwards */]: () => { + var _a3; + let result = focusIn(el, 1 /* First */); + if (result === 0 /* Error */) { + (_a3 = state.afterPanelSentinel.current) == null ? void 0 : _a3.focus(); + } + }, + [1 /* Backwards */]: () => { + var _a3; + (_a3 = state.button) == null ? void 0 : _a3.focus({ preventScroll: true }); + } + }); + } + if (false) {} else { + run(); + } + }); + let handleAfterFocus = useEvent(() => { + let el = internalPanelRef.current; + if (!el) + return; + function run() { + match(direction.current, { + [0 /* Forwards */]: () => { + var _a3; + if (!state.button) + return; + let elements = getFocusableElements(); + let idx = elements.indexOf(state.button); + let before = elements.slice(0, idx + 1); + let after = elements.slice(idx + 1); + let combined = [...after, ...before]; + for (let element of combined.slice()) { + if (element.dataset.headlessuiFocusGuard === "true" || ((_a3 = state.panel) == null ? void 0 : _a3.contains(element))) { + let idx2 = combined.indexOf(element); + if (idx2 !== -1) + combined.splice(idx2, 1); + } + } + focusIn(combined, 1 /* First */, { sorted: false }); + }, + [1 /* Backwards */]: () => { + var _a3; + let result = focusIn(el, 2 /* Previous */); + if (result === 0 /* Error */) { + (_a3 = state.button) == null ? void 0 : _a3.focus(); + } + } + }); + } + if (false) {} else { + run(); + } + }); + return /* @__PURE__ */ import_react37.default.createElement(PopoverPanelContext.Provider, { value: id }, visible && isPortalled && /* @__PURE__ */ import_react37.default.createElement( + Hidden, + { + id: beforePanelSentinelId, + ref: state.beforePanelSentinel, + features: 2 /* Focusable */, + "data-headlessui-focus-guard": true, + as: "button", + type: "button", + onFocus: handleBeforeFocus + } + ), render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_PANEL_TAG3, + features: PanelRenderFeatures2, + visible, + name: "Popover.Panel" + }), visible && isPortalled && /* @__PURE__ */ import_react37.default.createElement( + Hidden, + { + id: afterPanelSentinelId, + ref: state.afterPanelSentinel, + features: 2 /* Focusable */, + "data-headlessui-focus-guard": true, + as: "button", + type: "button", + onFocus: handleAfterFocus + } + )); +} +var DEFAULT_GROUP_TAG2 = "div"; +function GroupFn2(props, ref) { + let internalGroupRef = (0, import_react37.useRef)(null); + let groupRef = useSyncRefs(internalGroupRef, ref); + let [popovers, setPopovers] = (0, import_react37.useState)([]); + let unregisterPopover = useEvent((registerbag) => { + setPopovers((existing) => { + let idx = existing.indexOf(registerbag); + if (idx !== -1) { + let clone = existing.slice(); + clone.splice(idx, 1); + return clone; + } + return existing; + }); + }); + let registerPopover = useEvent((registerbag) => { + setPopovers((existing) => [...existing, registerbag]); + return () => unregisterPopover(registerbag); + }); + let isFocusWithinPopoverGroup = useEvent(() => { + var _a3; + let ownerDocument = getOwnerDocument(internalGroupRef); + if (!ownerDocument) + return false; + let element = ownerDocument.activeElement; + if ((_a3 = internalGroupRef.current) == null ? void 0 : _a3.contains(element)) + return true; + return popovers.some((bag) => { + var _a4, _b; + return ((_a4 = ownerDocument.getElementById(bag.buttonId.current)) == null ? void 0 : _a4.contains(element)) || ((_b = ownerDocument.getElementById(bag.panelId.current)) == null ? void 0 : _b.contains(element)); + }); + }); + let closeOthers = useEvent((buttonId) => { + for (let popover of popovers) { + if (popover.buttonId.current !== buttonId) + popover.close(); + } + }); + let contextBag = (0, import_react37.useMemo)( + () => ({ + registerPopover, + unregisterPopover, + isFocusWithinPopoverGroup, + closeOthers + }), + [registerPopover, unregisterPopover, isFocusWithinPopoverGroup, closeOthers] + ); + let slot = (0, import_react37.useMemo)(() => ({}), []); + let theirProps = props; + let ourProps = { ref: groupRef }; + return /* @__PURE__ */ import_react37.default.createElement(PopoverGroupContext.Provider, { value: contextBag }, render({ + ourProps, + theirProps, + slot, + defaultTag: DEFAULT_GROUP_TAG2, + name: "Popover.Group" + })); +} +var PopoverRoot = forwardRefWithAs(PopoverFn); +var Button5 = forwardRefWithAs(ButtonFn5); +var Overlay2 = forwardRefWithAs(OverlayFn2); +var Panel3 = forwardRefWithAs(PanelFn3); +var Group2 = forwardRefWithAs(GroupFn2); +var Popover = Object.assign(PopoverRoot, { Button: Button5, Overlay: Overlay2, Panel: Panel3, Group: Group2 }); + +// src/components/radio-group/radio-group.tsx +var import_react40 = __toESM(__webpack_require__(/*! react */ "react"), 1); + +// src/hooks/use-flags.ts +var import_react38 = __webpack_require__(/*! react */ "react"); +function useFlags(initialFlags = 0) { + let [flags, setFlags] = (0, import_react38.useState)(initialFlags); + let mounted = useIsMounted(); + let addFlag = (0, import_react38.useCallback)( + (flag) => { + if (!mounted.current) + return; + setFlags((flags2) => flags2 | flag); + }, + [flags, mounted] + ); + let hasFlag = (0, import_react38.useCallback)((flag) => Boolean(flags & flag), [flags]); + let removeFlag = (0, import_react38.useCallback)( + (flag) => { + if (!mounted.current) + return; + setFlags((flags2) => flags2 & ~flag); + }, + [setFlags, mounted] + ); + let toggleFlag = (0, import_react38.useCallback)( + (flag) => { + if (!mounted.current) + return; + setFlags((flags2) => flags2 ^ flag); + }, + [setFlags] + ); + return { flags, addFlag, hasFlag, removeFlag, toggleFlag }; +} + +// src/components/label/label.tsx +var import_react39 = __toESM(__webpack_require__(/*! react */ "react"), 1); +var LabelContext = (0, import_react39.createContext)( + null +); +function useLabelContext() { + let context = (0, import_react39.useContext)(LabelContext); + if (context === null) { + let err = new Error("You used a