@graphiql/plugin-explorer
Advanced tools
Comparing version 0.1.0 to 0.1.1-canary-d5a222ad.0
@@ -1,6 +0,6 @@ | ||
"use strict";var Be=Object.defineProperty;var be=Object.getOwnPropertySymbols;var Ue=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable;var Se=(r,t,a)=>t in r?Be(r,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[t]=a,ce=(r,t)=>{for(var a in t||(t={}))Ue.call(t,a)&&Se(r,a,t[a]);if(be)for(var a of be(t))He.call(t,a)&&Se(r,a,t[a]);return r};Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";var fe=require("@graphiql/react"),me=require("react"),ze=require("graphql");function we(r){if(r&&r.__esModule)return r;var t={__proto__:null,[Symbol.toStringTag]:"Module"};return r&&Object.keys(r).forEach(function(a){if(a!=="default"){var n=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return r[a]}})}}),t.default=r,Object.freeze(t)}var We=we(me),Ge=we(ze);function xe(r){return r&&Object.prototype.hasOwnProperty.call(r,"default")&&Object.keys(r).length===1?r.default:r}var re={},ie={},Fe=xe(We),$e=xe(Ge);Object.defineProperty(ie,"__esModule",{value:!0});var Qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ke=function(){function r(t,a){var n=[],e=!0,o=!1,c=void 0;try{for(var f=t[Symbol.iterator](),u;!(e=(u=f.next()).done)&&(n.push(u.value),!(a&&n.length===a));e=!0);}catch(i){o=!0,c=i}finally{try{!e&&f.return&&f.return()}finally{if(o)throw c}}return n}return function(t,a){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return r(t,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=Object.assign||function(r){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(r[n]=a[n])}return r},I=function(){function r(t,a){for(var n=0;n<a.length;n++){var e=a[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}return function(t,a,n){return a&&r(t.prototype,a),n&&r(t,n),t}}();ie.defaultValue=ve;var Ze=Fe,l=Ke(Ze),v=$e;function Ke(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a]);return t.default=r,t}function _e(r,t,a){return t in r?Object.defineProperty(r,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[t]=a,r}function L(r){if(Array.isArray(r)){for(var t=0,a=Array(r.length);t<r.length;t++)a[t]=r[t];return a}else return Array.from(r)}function q(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function F(r,t){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:r}function B(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(r,t):r.__proto__=t)}function de(r){return r.charAt(0).toUpperCase()+r.slice(1)}var Je={keyword:"#B11A04",def:"#D2054E",property:"#1F61A0",qualifier:"#1C92A9",attribute:"#8B2BB9",number:"#2882F9",string:"#D64292",builtin:"#D47509",string2:"#0B7FC7",variable:"#397D13",atom:"#CA9800"},Ye=l.createElement("svg",{width:"12",height:"9"},l.createElement("path",{fill:"#666",d:"M 0 2 L 9 2 L 4.5 7.5 z"})),Xe=l.createElement("svg",{width:"12",height:"9"},l.createElement("path",{fill:"#666",d:"M 0 0 L 0 9 L 5.5 4.5 z"})),et=l.createElement("svg",{style:{marginRight:"3px",marginLeft:"-3px"},width:"12",height:"12",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M16 0H2C0.9 0 0 0.9 0 2V16C0 17.1 0.9 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0ZM16 16H2V2H16V16ZM14.99 6L13.58 4.58L6.99 11.17L4.41 8.6L2.99 10.01L6.99 14L14.99 6Z",fill:"#666"})),tt=l.createElement("svg",{style:{marginRight:"3px",marginLeft:"-3px"},width:"12",height:"12",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M16 2V16H2V2H16ZM16 0H2C0.9 0 0 0.9 0 2V16C0 17.1 0.9 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0Z",fill:"#CCC"}));function ae(r){return r.checked?r.styleConfig.checkboxChecked:r.styleConfig.checkboxUnchecked}function De(r){var t=r.getFields();if(t.id){var a=["id"];return t.email?a.push("email"):t.name&&a.push("name"),a}if(t.edges)return["edges"];if(t.node)return["node"];if(t.nodes)return["nodes"];var n=[];return Object.keys(t).forEach(function(e){(0,v.isLeafType)(t[e].type)&&n.push(e)}),n.length?n.slice(0,2):["__typename"]}function Ve(r){return(0,v.isNonNullType)(r.type)&&r.defaultValue===void 0}function nt(r){for(var t=r;(0,v.isWrappingType)(t);)t=t.ofType;return t}function G(r){for(var t=r;(0,v.isWrappingType)(t);)t=t.ofType;return t}function Te(r,t){if(typeof t!="string"&&t.kind==="VariableDefinition")return t.variable;if((0,v.isScalarType)(r))try{switch(r.name){case"String":return{kind:"StringValue",value:String(r.parseValue(t))};case"Float":return{kind:"FloatValue",value:String(r.parseValue(parseFloat(t)))};case"Int":return{kind:"IntValue",value:String(r.parseValue(parseInt(t,10)))};case"Boolean":try{var a=JSON.parse(t);return typeof a=="boolean"?{kind:"BooleanValue",value:a}:{kind:"BooleanValue",value:!1}}catch{return{kind:"BooleanValue",value:!1}}default:return{kind:"StringValue",value:String(r.parseValue(t))}}}catch(e){return console.error("error coercing arg value",e,t),{kind:"StringValue",value:t}}else try{var n=r.parseValue(t);return n?{kind:"EnumValue",value:String(n)}:{kind:"EnumValue",value:r.getValues()[0].name}}catch{return{kind:"EnumValue",value:r.getValues()[0].name}}}var rt=function(r){B(t,r);function t(){var a,n,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._getArgSelection=function(){return e.props.selection.fields.find(function(i){return i.name.value===e.props.arg.name})},e._removeArg=function(){var i=e.props.selection,s=e._getArgSelection();e._previousArgSelection=s,e.props.modifyFields(i.fields.filter(function(p){return p!==s}),!0)},e._addArg=function(){var i=e.props,s=i.selection,p=i.arg,m=i.getDefaultScalarArgValue,h=i.parentField,w=i.makeDefaultArg,d=G(p.type),b=null;if(e._previousArgSelection)b=e._previousArgSelection;else if((0,v.isInputObjectType)(d)){var g=d.getFields();b={kind:"ObjectField",name:{kind:"Name",value:p.name},value:{kind:"ObjectValue",fields:oe(m,w,h,Object.keys(g).map(function(k){return g[k]}))}}}else(0,v.isLeafType)(d)&&(b={kind:"ObjectField",name:{kind:"Name",value:p.name},value:m(h,p,d)});if(!b)console.error("Unable to add arg for argType",d);else return e.props.modifyFields([].concat(L(s.fields||[]),[b]),!0)},e._setArgValue=function(i,s){var p=!1,m=!1,h=!1;try{i.kind==="VariableDefinition"?m=!0:i===null||typeof i=="undefined"?p=!0:typeof i.kind=="string"&&(h=!0)}catch{}var w=e.props.selection,d=e._getArgSelection();if(!d){console.error("missing arg selection when setting arg value");return}var b=G(e.props.arg.type),g=(0,v.isLeafType)(b)||m||p||h;if(!g){console.warn("Unable to handle non leaf types in InputArgView.setArgValue",i);return}var k=void 0,A=void 0;i===null||typeof i=="undefined"?A=null:!i.target&&!!i.kind&&i.kind==="VariableDefinition"?(k=i,A=k.variable):typeof i.kind=="string"?A=i:i.target&&typeof i.target.value=="string"&&(k=i.target.value,A=Te(b,k));var E=e.props.modifyFields((w.fields||[]).map(function(V){var P=V===d,R=P?_({},V,{value:A}):V;return R}),s);return E},e._modifyChildFields=function(i){return e.props.modifyFields(e.props.selection.fields.map(function(s){return s.name.value===e.props.arg.name?_({},s,{value:{kind:"ObjectValue",fields:i}}):s}),!0)},n),F(e,o)}return I(t,[{key:"render",value:function(){var n=this.props,e=n.arg,o=n.parentField,c=this._getArgSelection();return l.createElement(je,{argValue:c?c.value:null,arg:e,parentField:o,addArg:this._addArg,removeArg:this._removeArg,setArgFields:this._modifyChildFields,setArgValue:this._setArgValue,getDefaultScalarArgValue:this.props.getDefaultScalarArgValue,makeDefaultArg:this.props.makeDefaultArg,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig,onCommit:this.props.onCommit,definition:this.props.definition})}}]),t}(l.PureComponent);function ve(r){if((0,v.isEnumType)(r))return{kind:"EnumValue",value:r.getValues()[0].name};switch(r.name){case"String":return{kind:"StringValue",value:""};case"Float":return{kind:"FloatValue",value:"1.5"};case"Int":return{kind:"IntValue",value:"10"};case"Boolean":return{kind:"BooleanValue",value:!1};default:return{kind:"StringValue",value:""}}}function Ne(r,t,a){return ve(a)}var it=function(r){B(t,r);function t(){var a,n,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._getArgSelection=function(){var i=e.props.selection;return(i.arguments||[]).find(function(s){return s.name.value===e.props.arg.name})},e._removeArg=function(i){var s=e.props.selection,p=e._getArgSelection();return e._previousArgSelection=p,e.props.modifyArguments((s.arguments||[]).filter(function(m){return m!==p}),i)},e._addArg=function(i){var s=e.props,p=s.selection,m=s.getDefaultScalarArgValue,h=s.makeDefaultArg,w=s.parentField,d=s.arg,b=G(d.type),g=null;if(e._previousArgSelection)g=e._previousArgSelection;else if((0,v.isInputObjectType)(b)){var k=b.getFields();g={kind:"Argument",name:{kind:"Name",value:d.name},value:{kind:"ObjectValue",fields:oe(m,h,w,Object.keys(k).map(function(A){return k[A]}))}}}else(0,v.isLeafType)(b)&&(g={kind:"Argument",name:{kind:"Name",value:d.name},value:m(w,d,b)});return g?e.props.modifyArguments([].concat(L(p.arguments||[]),[g]),i):(console.error("Unable to add arg for argType",b),null)},e._setArgValue=function(i,s){var p=!1,m=!1,h=!1;try{i.kind==="VariableDefinition"?m=!0:i===null||typeof i=="undefined"?p=!0:typeof i.kind=="string"&&(h=!0)}catch{}var w=e.props.selection,d=e._getArgSelection();if(!d&&!m){console.error("missing arg selection when setting arg value");return}var b=G(e.props.arg.type),g=(0,v.isLeafType)(b)||m||p||h;if(!g){console.warn("Unable to handle non leaf types in ArgView._setArgValue");return}var k=void 0,A=void 0;return i===null||typeof i=="undefined"?A=null:i.target&&typeof i.target.value=="string"?(k=i.target.value,A=Te(b,k)):!i.target&&i.kind==="VariableDefinition"?(k=i,A=k.variable):typeof i.kind=="string"&&(A=i),e.props.modifyArguments((w.arguments||[]).map(function(E){return E===d?_({},E,{value:A}):E}),s)},e._setArgFields=function(i,s){var p=e.props.selection,m=e._getArgSelection();if(!m){console.error("missing arg selection when setting arg value");return}return e.props.modifyArguments((p.arguments||[]).map(function(h){return h===m?_({},h,{value:{kind:"ObjectValue",fields:i}}):h}),s)},n),F(e,o)}return I(t,[{key:"render",value:function(){var n=this.props,e=n.arg,o=n.parentField,c=this._getArgSelection();return l.createElement(je,{argValue:c?c.value:null,arg:e,parentField:o,addArg:this._addArg,removeArg:this._removeArg,setArgFields:this._setArgFields,setArgValue:this._setArgValue,getDefaultScalarArgValue:this.props.getDefaultScalarArgValue,makeDefaultArg:this.props.makeDefaultArg,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig,onCommit:this.props.onCommit,definition:this.props.definition})}}]),t}(l.PureComponent);function at(r){return r.ctrlKey&&r.key==="Enter"}function ot(r){return r!=="FragmentDefinition"}var lt=function(r){B(t,r);function t(){var a,n,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._handleChange=function(i){e.props.setArgValue(i,!0)},n),F(e,o)}return I(t,[{key:"componentDidMount",value:function(){var n=this._ref,e=document.activeElement;n&&e&&!(e instanceof HTMLTextAreaElement)&&(n.focus(),n.setSelectionRange(0,n.value.length))}},{key:"render",value:function(){var n=this,e=this.props,o=e.arg,c=e.argValue,f=e.styleConfig,u=G(o.type),i=typeof c.value=="string"?c.value:"",s=this.props.argValue.kind==="StringValue"?f.colors.string:f.colors.number;return l.createElement("span",{style:{color:s}},u.name==="String"?'"':"",l.createElement("input",{style:{border:"none",borderBottom:"1px solid #888",outline:"none",width:Math.max(1,Math.min(15,i.length))+"ch",color:s},ref:function(m){n._ref=m},type:"text",onChange:this._handleChange,value:i}),u.name==="String"?'"':"")}}]),t}(l.PureComponent),je=function(r){B(t,r);function t(){var a,n,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={displayArgActions:!1},n),F(e,o)}return I(t,[{key:"render",value:function(){var n=this,e=this.props,o=e.argValue,c=e.arg,f=e.styleConfig,u=G(c.type),i=null;if(o){if(o.kind==="Variable")i=l.createElement("span",{style:{color:f.colors.variable}},"$",o.name.value);else if((0,v.isScalarType)(u))u.name==="Boolean"?i=l.createElement("select",{style:{color:f.colors.builtin},onChange:this.props.setArgValue,value:o.kind==="BooleanValue"?o.value:void 0},l.createElement("option",{key:"true",value:"true"},"true"),l.createElement("option",{key:"false",value:"false"},"false")):i=l.createElement(lt,{setArgValue:this.props.setArgValue,arg:c,argValue:o,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig});else if((0,v.isEnumType)(u))o.kind==="EnumValue"?i=l.createElement("select",{style:{backgroundColor:"white",color:f.colors.string2},onChange:this.props.setArgValue,value:o.value},u.getValues().map(function(d){return l.createElement("option",{key:d.name,value:d.name},d.name)})):console.error("arg mismatch between arg and selection",u,o);else if((0,v.isInputObjectType)(u))if(o.kind==="ObjectValue"){var s=u.getFields();i=l.createElement("div",{style:{marginLeft:16}},Object.keys(s).sort().map(function(d){return l.createElement(rt,{key:d,arg:s[d],parentField:n.props.parentField,selection:o,modifyFields:n.props.setArgFields,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition})}))}else console.error("arg mismatch between arg and selection",u,o)}var p=function(){var b=c.name,g=(n.props.definition.variableDefinitions||[]).filter(function(C){return C.variable.name.value.startsWith(b)}).length,k=void 0;g>0?k=""+b+g:k=b;var A=c.type.toString(),E=(0,v.parseType)(A),V={kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:k}},type:E,directives:[]},P=function(x){return(n.props.definition.variableDefinitions||[]).find(function(T){return T.variable.name.value===x})},R=void 0,z={};if(typeof o!="undefined"&&o!==null){var U=(0,v.visit)(o,{Variable:function(x){var T=x.name.value,Q=P(T);if(z[T]=z[T]+1||1,!!Q)return Q.defaultValue}}),$=V.type.kind==="NonNullType",j=$?_({},V,{type:V.type.type}):V;R=_({},j,{defaultValue:U})}else R=V;var J=Object.entries(z).filter(function(C){var x=ke(C,2);x[0];var T=x[1];return T<2}).map(function(C){var x=ke(C,2),T=x[0];return x[1],T});if(R){var Z=n.props.setArgValue(R,!1);if(Z){var Y=Z.definitions.find(function(C){return!!C.operation&&!!C.name&&!!C.name.value&&!!n.props.definition.name&&!!n.props.definition.name.value?C.name.value===n.props.definition.name.value:!1}),y=[].concat(L(Y.variableDefinitions||[]),[R]).filter(function(C){return J.indexOf(C.variable.name.value)===-1}),S=_({},Y,{variableDefinitions:y}),O=Z.definitions,D=O.map(function(C){return Y===C?S:C}),N=_({},Z,{definitions:D});n.props.onCommit(N)}}},m=function(){if(!(!o||!o.name||!o.name.value)){var b=o.name.value,g=(n.props.definition.variableDefinitions||[]).find(function(j){return j.variable.name.value===b});if(!!g){var k=g.defaultValue,A=n.props.setArgValue(k,{commit:!1});if(A){var E=A.definitions.find(function(j){return j.name.value===n.props.definition.name.value});if(!E)return;var V=0;(0,v.visit)(E,{Variable:function(J){J.name.value===b&&(V=V+1)}});var P=E.variableDefinitions||[];V<2&&(P=P.filter(function(j){return j.variable.name.value!==b}));var R=_({},E,{variableDefinitions:P}),z=A.definitions,U=z.map(function(j){return E===j?R:j}),$=_({},A,{definitions:U});n.props.onCommit($)}}}},h=o&&o.kind==="Variable",w=this.state.displayArgActions?l.createElement("button",{type:"submit",className:"toolbar-button",title:h?"Remove the variable":"Extract the current value into a GraphQL variable",onClick:function(b){b.preventDefault(),b.stopPropagation(),h?m():p()},style:f.styles.actionButtonStyle},l.createElement("span",{style:{color:f.colors.variable}},"$")):null;return l.createElement("div",{style:{cursor:"pointer",minHeight:"16px",WebkitUserSelect:"none",userSelect:"none"},"data-arg-name":c.name,"data-arg-type":u.name,className:"graphiql-explorer-"+c.name},l.createElement("span",{style:{cursor:"pointer"},onClick:function(b){var g=!o;g?n.props.addArg(!0):n.props.removeArg(!0),n.setState({displayArgActions:g})}},(0,v.isInputObjectType)(u)?l.createElement("span",null,o?this.props.styleConfig.arrowOpen:this.props.styleConfig.arrowClosed):l.createElement(ae,{checked:!!o,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:f.colors.attribute},title:c.description,onMouseEnter:function(){o!==null&&typeof o!="undefined"&&n.setState({displayArgActions:!0})},onMouseLeave:function(){return n.setState({displayArgActions:!1})}},c.name,Ve(c)?"*":"",": ",w," ")," "),i||l.createElement("span",null)," ")}}]),t}(l.PureComponent),st=function(r){B(t,r);function t(){var a,n,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._addFragment=function(){e.props.modifySelections([].concat(L(e.props.selections),[e._previousSelection||{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.props.implementingType.name}},selectionSet:{kind:"SelectionSet",selections:e.props.getDefaultFieldNames(e.props.implementingType).map(function(i){return{kind:"Field",name:{kind:"Name",value:i}}})}}]))},e._removeFragment=function(){var i=e._getSelection();e._previousSelection=i,e.props.modifySelections(e.props.selections.filter(function(s){return s!==i}))},e._getSelection=function(){var i=e.props.selections.find(function(s){return s.kind==="InlineFragment"&&s.typeCondition&&e.props.implementingType.name===s.typeCondition.name.value});if(!i)return null;if(i.kind==="InlineFragment")return i},e._modifyChildSelections=function(i,s){var p=e._getSelection();return e.props.modifySelections(e.props.selections.map(function(m){return m===p?{directives:m.directives,kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.props.implementingType.name}},selectionSet:{kind:"SelectionSet",selections:i}}:m}),s)},n),F(e,o)}return I(t,[{key:"render",value:function(){var n=this,e=this.props,o=e.implementingType,c=e.schema,f=e.getDefaultFieldNames,u=e.styleConfig,i=this._getSelection(),s=o.getFields(),p=i?i.selectionSet?i.selectionSet.selections:[]:[];return l.createElement("div",{className:"graphiql-explorer-"+o.name},l.createElement("span",{style:{cursor:"pointer"},onClick:i?this._removeFragment:this._addFragment},l.createElement(ae,{checked:!!i,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:u.colors.atom}},this.props.implementingType.name)),i?l.createElement("div",{style:{marginLeft:16}},Object.keys(s).sort().map(function(m){return l.createElement(Re,{key:m,field:s[m],selections:p,modifySelections:n._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,onCommit:n.props.onCommit,styleConfig:n.props.styleConfig,definition:n.props.definition,availableFragments:n.props.availableFragments})})):null)}}]),t}(l.PureComponent),ut=function(r){B(t,r);function t(){var a,n,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._addFragment=function(){e.props.modifySelections([].concat(L(e.props.selections),[e._previousSelection||{kind:"FragmentSpread",name:e.props.fragment.name}]))},e._removeFragment=function(){var i=e._getSelection();e._previousSelection=i,e.props.modifySelections(e.props.selections.filter(function(s){var p=s.kind==="FragmentSpread"&&s.name.value===e.props.fragment.name.value;return!p}))},e._getSelection=function(){var i=e.props.selections.find(function(s){return s.kind==="FragmentSpread"&&s.name.value===e.props.fragment.name.value});return i},n),F(e,o)}return I(t,[{key:"render",value:function(){var n=this.props.styleConfig,e=this._getSelection();return l.createElement("div",{className:"graphiql-explorer-"+this.props.fragment.name.value},l.createElement("span",{style:{cursor:"pointer"},onClick:e?this._removeFragment:this._addFragment},l.createElement(ae,{checked:!!e,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:n.colors.def},className:"graphiql-explorer-"+this.props.fragment.name.value},this.props.fragment.name.value)))}}]),t}(l.PureComponent);function oe(r,t,a,n){var e=[],o=!0,c=!1,f=void 0;try{for(var u=n[Symbol.iterator](),i;!(o=(i=u.next()).done);o=!0){var s=i.value;if((0,v.isRequiredInputField)(s)||t&&t(a,s)){var p=G(s.type);(0,v.isInputObjectType)(p)?function(){var m=p.getFields();e.push({kind:"ObjectField",name:{kind:"Name",value:s.name},value:{kind:"ObjectValue",fields:oe(r,t,a,Object.keys(m).map(function(h){return m[h]}))}})}():(0,v.isLeafType)(p)&&e.push({kind:"ObjectField",name:{kind:"Name",value:s.name},value:r(a,s,p)})}}}catch(m){c=!0,f=m}finally{try{!o&&u.return&&u.return()}finally{if(c)throw f}}return e}function Ce(r,t,a){var n=[],e=!0,o=!1,c=void 0;try{for(var f=a.args[Symbol.iterator](),u;!(e=(u=f.next()).done);e=!0){var i=u.value;if(Ve(i)||t&&t(a,i)){var s=G(i.type);(0,v.isInputObjectType)(s)?function(){var p=s.getFields();n.push({kind:"Argument",name:{kind:"Name",value:i.name},value:{kind:"ObjectValue",fields:oe(r,t,a,Object.keys(p).map(function(m){return p[m]}))}})}():(0,v.isLeafType)(s)&&n.push({kind:"Argument",name:{kind:"Name",value:i.name},value:r(a,i,s)})}}}catch(p){o=!0,c=p}finally{try{!e&&f.return&&f.return()}finally{if(o)throw c}}return n}var Re=function(r){B(t,r);function t(){var a,n,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={displayFieldActions:!1},e._addAllFieldsToSelections=function(i){var s=i?Object.keys(i).map(function(h){return{kind:"Field",name:{kind:"Name",value:h},arguments:[]}}):[],p={kind:"SelectionSet",selections:s},m=[].concat(L(e.props.selections.filter(function(h){return h.kind==="InlineFragment"?!0:h.name.value!==e.props.field.name})),[{kind:"Field",name:{kind:"Name",value:e.props.field.name},arguments:Ce(e.props.getDefaultScalarArgValue,e.props.makeDefaultArg,e.props.field),selectionSet:p}]);e.props.modifySelections(m)},e._addFieldToSelections=function(i){var s=[].concat(L(e.props.selections),[e._previousSelection||{kind:"Field",name:{kind:"Name",value:e.props.field.name},arguments:Ce(e.props.getDefaultScalarArgValue,e.props.makeDefaultArg,e.props.field)}]);e.props.modifySelections(s)},e._handleUpdateSelections=function(i){var s=e._getSelection();if(s&&!i.altKey)e._removeFieldFromSelections();else{var p=(0,v.getNamedType)(e.props.field.type),m=(0,v.isObjectType)(p)&&p.getFields(),h=!!m&&i.altKey;h?e._addAllFieldsToSelections(m):e._addFieldToSelections(m)}},e._removeFieldFromSelections=function(){var i=e._getSelection();e._previousSelection=i,e.props.modifySelections(e.props.selections.filter(function(s){return s!==i}))},e._getSelection=function(){var i=e.props.selections.find(function(s){return s.kind==="Field"&&e.props.field.name===s.name.value});if(!i)return null;if(i.kind==="Field")return i},e._setArguments=function(i,s){var p=e._getSelection();if(!p){console.error("Missing selection when setting arguments",i);return}return e.props.modifySelections(e.props.selections.map(function(m){return m===p?{alias:p.alias,arguments:i,directives:p.directives,kind:"Field",name:p.name,selectionSet:p.selectionSet}:m}),s)},e._modifyChildSelections=function(i,s){return e.props.modifySelections(e.props.selections.map(function(p){if(p.kind==="Field"&&e.props.field.name===p.name.value){if(p.kind!=="Field")throw new Error("invalid selection");return{alias:p.alias,arguments:p.arguments,directives:p.directives,kind:"Field",name:p.name,selectionSet:{kind:"SelectionSet",selections:i}}}return p}),s)},n),F(e,o)}return I(t,[{key:"render",value:function(){var n=this,e=this.props,o=e.field,c=e.schema,f=e.getDefaultFieldNames,u=e.styleConfig,i=this._getSelection(),s=nt(o.type),p=o.args.sort(function(g,k){return g.name.localeCompare(k.name)}),m="graphiql-explorer-node graphiql-explorer-"+o.name;o.isDeprecated&&(m+=" graphiql-explorer-deprecated");var h=(0,v.isObjectType)(s)||(0,v.isInterfaceType)(s)||(0,v.isUnionType)(s)?this.props.availableFragments&&this.props.availableFragments[s.name]:null,w=l.createElement("div",{className:m},l.createElement("span",{title:o.description,style:{cursor:"pointer",display:"inline-flex",alignItems:"center",minHeight:"16px",WebkitUserSelect:"none",userSelect:"none"},"data-field-name":o.name,"data-field-type":s.name,onClick:this._handleUpdateSelections,onMouseEnter:function(){var k=(0,v.isObjectType)(s)&&i&&i.selectionSet&&i.selectionSet.selections.filter(function(A){return A.kind!=="FragmentSpread"}).length>0;k&&n.setState({displayFieldActions:!0})},onMouseLeave:function(){return n.setState({displayFieldActions:!1})}},(0,v.isObjectType)(s)?l.createElement("span",null,i?this.props.styleConfig.arrowOpen:this.props.styleConfig.arrowClosed):null,(0,v.isObjectType)(s)?null:l.createElement(ae,{checked:!!i,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:u.colors.property},className:"graphiql-explorer-field-view"},o.name),this.state.displayFieldActions?l.createElement("button",{type:"submit",className:"toolbar-button",title:"Extract selections into a new reusable fragment",onClick:function(k){k.preventDefault(),k.stopPropagation();var A=s.name,E=A+"Fragment",V=(h||[]).filter(function(j){return j.name.value.startsWith(E)}).length;V>0&&(E=""+E+V);var P=i?i.selectionSet?i.selectionSet.selections:[]:[],R=[{kind:"FragmentSpread",name:{kind:"Name",value:E},directives:[]}],z={kind:"FragmentDefinition",name:{kind:"Name",value:E},typeCondition:{kind:"NamedType",name:{kind:"Name",value:s.name}},directives:[],selectionSet:{kind:"SelectionSet",selections:P}},U=n._modifyChildSelections(R,!1);if(U){var $=_({},U,{definitions:[].concat(L(U.definitions),[z])});n.props.onCommit($)}else console.warn("Unable to complete extractFragment operation")},style:_({},u.styles.actionButtonStyle)},l.createElement("span",null,"\u2026")):null),i&&p.length?l.createElement("div",{style:{marginLeft:16},className:"graphiql-explorer-graphql-arguments"},p.map(function(g){return l.createElement(it,{key:g.name,parentField:o,arg:g,selection:i,modifyArguments:n._setArguments,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition})})):null);if(i&&((0,v.isObjectType)(s)||(0,v.isInterfaceType)(s)||(0,v.isUnionType)(s))){var d=(0,v.isUnionType)(s)?{}:s.getFields(),b=i?i.selectionSet?i.selectionSet.selections:[]:[];return l.createElement("div",{className:"graphiql-explorer-"+o.name},w,l.createElement("div",{style:{marginLeft:16}},h?h.map(function(g){var k=c.getType(g.typeCondition.name.value),A=g.name.value;return k?l.createElement(ut,{key:A,fragment:g,selections:b,modifySelections:n._modifyChildSelections,schema:c,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit}):null}):null,Object.keys(d).sort().map(function(g){return l.createElement(t,{key:g,field:d[g],selections:b,modifySelections:n._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition,availableFragments:n.props.availableFragments})}),(0,v.isInterfaceType)(s)||(0,v.isUnionType)(s)?c.getPossibleTypes(s).map(function(g){return l.createElement(st,{key:g.name,implementingType:g,selections:b,modifySelections:n._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition})}):null))}return w}}]),t}(l.PureComponent);function pt(r){try{return r.trim()?(0,v.parse)(r,{noLocation:!0}):null}catch(t){return new Error(t)}}var ct={kind:"OperationDefinition",operation:"query",variableDefinitions:[],name:{kind:"Name",value:"MyQuery"},directives:[],selectionSet:{kind:"SelectionSet",selections:[]}},ne={kind:"Document",definitions:[ct]},K=null;function ft(r){if(K&&K[0]===r)return K[1];var t=pt(r);return t?t instanceof Error?K?K[1]:ne:(K=[r,t],t):ne}var Ae={buttonStyle:{fontSize:"1.2em",padding:"0px",backgroundColor:"white",border:"none",margin:"5px 0px",height:"40px",width:"100%",display:"block",maxWidth:"none"},actionButtonStyle:{padding:"0px",backgroundColor:"white",border:"none",margin:"0px",maxWidth:"none",height:"15px",width:"15px",display:"inline-block",fontSize:"smaller"},explorerActionsStyle:{margin:"4px -8px -8px",paddingLeft:"8px",bottom:"0px",width:"100%",textAlign:"center",background:"none",borderTop:"none",borderBottom:"none"}},mt=function(r){B(t,r);function t(){var a,n,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={newOperationType:"query",displayTitleActions:!1},e._modifySelections=function(i,s){var p=e.props.definition;p.selectionSet.selections.length===0&&e._previousOperationDef&&(p=e._previousOperationDef);var m=void 0;if(p.kind==="FragmentDefinition")m=_({},p,{selectionSet:_({},p.selectionSet,{selections:i})});else if(p.kind==="OperationDefinition"){var h=i.filter(function(w){return!(w.kind==="Field"&&w.name.value==="__typename")});h.length===0&&(h=[{kind:"Field",name:{kind:"Name",value:"__typename ## Placeholder value"}}]),m=_({},p,{selectionSet:_({},p.selectionSet,{selections:h})})}return e.props.onEdit(m,s)},e._onOperationRename=function(i){return e.props.onOperationRename(i.target.value)},e._handlePotentialRun=function(i){at(i)&&ot(e.props.definition.kind)&&e.props.onRunOperation(e.props.name)},e._rootViewElId=function(){var i=e.props,s=i.operationType,p=i.name,m=s+"-"+(p||"unknown");return m},n),F(e,o)}return I(t,[{key:"componentDidMount",value:function(){var n=this._rootViewElId();this.props.onMount(n)}},{key:"render",value:function(){var n=this,e=this.props,o=e.operationType,c=e.definition,f=e.schema,u=e.getDefaultFieldNames,i=e.styleConfig,s=this._rootViewElId(),p=this.props.fields||{},m=c,h=m.selectionSet.selections,w=this.props.name||de(o)+" Name";return l.createElement("div",{id:s,tabIndex:"0",onKeyDown:this._handlePotentialRun,style:{borderBottom:this.props.isLast?"none":"1px solid #d6d6d6",marginBottom:"0em",paddingBottom:"1em"}},l.createElement("div",{style:{color:i.colors.keyword,paddingBottom:4},className:"graphiql-operation-title-bar",onMouseEnter:function(){return n.setState({displayTitleActions:!0})},onMouseLeave:function(){return n.setState({displayTitleActions:!1})}},o," ",l.createElement("span",{style:{color:i.colors.def}},l.createElement("input",{style:{color:i.colors.def,border:"none",borderBottom:"1px solid #888",outline:"none",width:Math.max(4,w.length)+"ch"},autoComplete:"false",placeholder:de(o)+" Name",value:this.props.name,onKeyDown:this._handlePotentialRun,onChange:this._onOperationRename})),this.props.onTypeName?l.createElement("span",null,l.createElement("br",null),"on "+this.props.onTypeName):"",this.state.displayTitleActions?l.createElement(l.Fragment,null,l.createElement("button",{type:"submit",className:"toolbar-button",onClick:function(){return n.props.onOperationDestroy()},style:_({},i.styles.actionButtonStyle)},l.createElement("span",null,"\u2715")),l.createElement("button",{type:"submit",className:"toolbar-button",onClick:function(){return n.props.onOperationClone()},style:_({},i.styles.actionButtonStyle)},l.createElement("span",null,"\u2398"))):""),Object.keys(p).sort().map(function(d){return l.createElement(Re,{key:d,field:p[d],selections:h,modifySelections:n._modifySelections,schema:f,getDefaultFieldNames:u,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition,availableFragments:n.props.availableFragments})}))}}]),t}(l.PureComponent);function dt(){return l.createElement("div",{style:{fontFamily:"sans-serif",display:"flex",flexDirection:"column",alignItems:"center",margin:"1em",marginTop:0,flexGrow:1,justifyContent:"flex-end"}},l.createElement("div",{style:{borderTop:"1px solid #d6d6d6",paddingTop:"1em",width:"100%",textAlign:"center"}},"GraphiQL Explorer by ",l.createElement("a",{href:"https://www.onegraph.com"},"OneGraph")),l.createElement("div",null,"Contribute on"," ",l.createElement("a",{href:"https://github.com/OneGraph/graphiql-explorer"},"GitHub")))}var Me=function(r){B(t,r);function t(){var a,n,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={newOperationType:"query",operation:null,operationToScrollTo:null},e._resetScroll=function(){var i=e._ref;i&&(i.scrollLeft=0)},e._onEdit=function(i){return e.props.onEdit(i)},e._setAddOperationType=function(i){e.setState({newOperationType:i})},e._handleRootViewMount=function(i){if(!!e.state.operationToScrollTo&&e.state.operationToScrollTo===i){var s=".graphiql-explorer-root #"+i,p=document.querySelector(s);p&&p.scrollIntoView()}},n),F(e,o)}return I(t,[{key:"componentDidMount",value:function(){this._resetScroll()}},{key:"render",value:function(){var n=this,e=this.props,o=e.schema,c=e.query,f=e.makeDefaultArg;if(!o)return l.createElement("div",{style:{fontFamily:"sans-serif"},className:"error-container"},"No Schema Available");var u={colors:this.props.colors||Je,checkboxChecked:this.props.checkboxChecked||et,checkboxUnchecked:this.props.checkboxUnchecked||tt,arrowClosed:this.props.arrowClosed||Xe,arrowOpen:this.props.arrowOpen||Ye,styles:this.props.styles?_({},Ae,this.props.styles):Ae},i=o.getQueryType(),s=o.getMutationType(),p=o.getSubscriptionType();if(!i&&!s&&!p)return l.createElement("div",null,"Missing query type");var m=i&&i.getFields(),h=s&&s.getFields(),w=p&&p.getFields(),d=ft(c),b=this.props.getDefaultFieldNames||De,g=this.props.getDefaultScalarArgValue||Ne,k=d.definitions,A=k.map(function(y){return y.kind==="FragmentDefinition"||y.kind==="OperationDefinition"?y:null}).filter(Boolean),E=A.length===0?ne.definitions:A,V=function(S,O){var D=O==null||O===""?null:{kind:"Name",value:O,loc:void 0},N=_({},S,{name:D}),C=d.definitions,x=C.map(function(T){return S===T?N:T});return _({},d,{definitions:x})},P=function(S){var O=void 0;S.kind==="FragmentDefinition"?O="fragment":O=S.operation;var D=(S.name&&S.name.value||"")+"Copy",N={kind:"Name",value:D,loc:void 0},C=_({},S,{name:N}),x=d.definitions,T=[].concat(L(x),[C]);return n.setState({operationToScrollTo:O+"-"+D}),_({},d,{definitions:T})},R=function(S){var O=d.definitions,D=O.filter(function(N){return S!==N});return _({},d,{definitions:D})},z=function(S){var O=d.definitions,D=d.definitions.length===1&&d.definitions[0]===ne.definitions[0],N=D?[]:O.filter(function(X){return X.kind==="OperationDefinition"?X.operation===S:!1}),C="My"+de(S)+(N.length===0?"":N.length+1),x="__typename # Placeholder value",T={kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:x,loc:null},arguments:[],directives:[],selectionSet:null,loc:null}],loc:null},Q={kind:"OperationDefinition",operation:S,name:{kind:"Name",value:C},variableDefinitions:[],directives:[],selectionSet:T,loc:null},le=D?[Q]:[].concat(L(d.definitions),[Q]),se=_({},d,{definitions:le});n.setState({operationToScrollTo:S+"-"+C}),n.props.onEdit((0,v.print)(se))},U=[m?l.createElement("option",{key:"query",className:"toolbar-button",style:u.styles.buttonStyle,type:"link",value:"query"},"Query"):null,h?l.createElement("option",{key:"mutation",className:"toolbar-button",style:u.styles.buttonStyle,type:"link",value:"mutation"},"Mutation"):null,w?l.createElement("option",{key:"subscription",className:"toolbar-button",style:u.styles.buttonStyle,type:"link",value:"subscription"},"Subscription"):null].filter(Boolean),$=U.length===0||this.props.hideActions?null:l.createElement("div",{style:{minHeight:"50px",maxHeight:"50px",overflow:"none"}},l.createElement("form",{className:"variable-editor-title graphiql-explorer-actions",style:_({},u.styles.explorerActionsStyle,{display:"flex",flexDirection:"row",alignItems:"center",borderTop:"1px solid rgb(214, 214, 214)"}),onSubmit:function(S){return S.preventDefault()}},l.createElement("span",{style:{display:"inline-block",flexGrow:"0",textAlign:"right"}},"Add new"," "),l.createElement("select",{onChange:function(S){return n._setAddOperationType(S.target.value)},value:this.state.newOperationType,style:{flexGrow:"2"}},U),l.createElement("button",{type:"submit",className:"toolbar-button",onClick:function(){return n.state.newOperationType?z(n.state.newOperationType):null},style:_({},u.styles.buttonStyle,{height:"22px",width:"22px"})},l.createElement("span",null,"+")))),j=this.props.externalFragments&&this.props.externalFragments.reduce(function(y,S){if(S.kind==="FragmentDefinition"){var O=S.typeCondition.name.value,D=y[O]||[],N=[].concat(L(D),[S]).sort(function(C,x){return C.name.value.localeCompare(x.name.value)});return _({},y,_e({},O,N))}return y},{}),J=E.reduce(function(y,S){if(S.kind==="FragmentDefinition"){var O=S.typeCondition.name.value,D=y[O]||[],N=[].concat(L(D),[S]).sort(function(C,x){return C.name.value.localeCompare(x.name.value)});return _({},y,_e({},O,N))}return y},{}),Z=_({},J,j),Y=this.props.showAttribution?l.createElement(dt,null):null;return l.createElement("div",{ref:function(S){n._ref=S},style:{fontSize:12,textOverflow:"ellipsis",whiteSpace:"nowrap",margin:0,padding:8,fontFamily:'Consolas, Inconsolata, "Droid Sans Mono", Monaco, monospace',display:"flex",flexDirection:"column",height:"100%"},className:"graphiql-explorer-root"},l.createElement("div",{style:{flexGrow:"1",overflow:"scroll"}},E.map(function(y,S){var O=y&&y.name&&y.name.value,D=y.kind==="FragmentDefinition"?"fragment":y&&y.operation||"query",N=function(H){var W=V(y,H);n.props.onEdit((0,v.print)(W))},C=function(){var H=P(y);n.props.onEdit((0,v.print)(H))},x=function(){var H=R(y);n.props.onEdit((0,v.print)(H))},T=y.kind==="FragmentDefinition"&&y.typeCondition.kind==="NamedType"&&o.getType(y.typeCondition.name.value),Q=T instanceof v.GraphQLObjectType?T.getFields():null,le=D==="query"?m:D==="mutation"?h:D==="subscription"?w:y.kind==="FragmentDefinition"?Q:null,se=y.kind==="FragmentDefinition"?y.typeCondition.name.value:null,X=function(H){var W=(0,v.print)(H);n.props.onEdit(W)};return l.createElement(mt,{key:S,isLast:S===E.length-1,fields:le,operationType:D,name:O,definition:y,onOperationRename:N,onOperationDestroy:x,onOperationClone:C,onTypeName:se,onMount:n._handleRootViewMount,onCommit:X,onEdit:function(H,W){var ue=void 0;if((typeof W=="undefined"?"undefined":Qe(W))==="object"&&typeof W.commit!="undefined"?ue=W.commit:ue=!0,H){var pe=_({},d,{definitions:d.definitions.map(function(he){return he===y?H:he})});return ue&&X(pe),pe}else return d},schema:o,getDefaultFieldNames:b,getDefaultScalarArgValue:g,makeDefaultArg:f,onRunOperation:function(){n.props.onRunOperation&&n.props.onRunOperation(O)},styleConfig:u,availableFragments:Z})}),Y),$)}}]),t}(l.PureComponent);Me.defaultProps={getDefaultFieldNames:De,getDefaultScalarArgValue:Ne};var vt=function(r){B(t,r);function t(){var a,n,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={hasError:!1,error:null,errorInfo:null},n),F(e,o)}return I(t,[{key:"componentDidCatch",value:function(n,e){this.setState({hasError:!0,error:n,errorInfo:e}),console.error("Error in component",n,e)}},{key:"render",value:function(){return this.state.hasError?l.createElement("div",{style:{padding:18,fontFamily:"sans-serif"}},l.createElement("div",null,"Something went wrong"),l.createElement("details",{style:{whiteSpace:"pre-wrap"}},this.state.error?this.state.error.toString():null,l.createElement("br",null),this.state.errorInfo?this.state.errorInfo.componentStack:null)):this.props.children}}]),t}(l.Component),ge=function(r){B(t,r);function t(){return q(this,t),F(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return I(t,[{key:"render",value:function(){return l.createElement("div",{className:"docExplorerWrap",style:{height:"100%",width:this.props.width,minWidth:this.props.width,zIndex:7,display:this.props.explorerIsOpen?"flex":"none",flexDirection:"column",overflow:"hidden"}},l.createElement("div",{className:"doc-explorer-title-bar"},l.createElement("div",{className:"doc-explorer-title"},this.props.title),l.createElement("div",{className:"doc-explorer-rhs"},l.createElement("div",{className:"docExplorerHide",onClick:this.props.onToggleExplorer},"\u2715"))),l.createElement("div",{className:"doc-explorer-contents",style:{padding:"0px",overflowY:"unset"}},l.createElement(vt,null,l.createElement(Me,this.props))))}}]),t}(l.PureComponent);ge.defaultValue=ve;ge.defaultProps={width:320,title:"Explorer"};ie.default=ge;Object.defineProperty(re,"__esModule",{value:!0});re.Explorer=void 0;var gt=ie,Le=yt(gt);function yt(r){return r&&r.__esModule?r:{default:r}}re.Explorer=Le.default;var ht=re.default=Le.default;var ye={exports:{}},te={};/* | ||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var ce=require("@graphiql/react"),fe=require("react"),Pe=require("graphql");function Ee(i){if(i&&i.__esModule)return i;var t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});return i&&Object.keys(i).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(i,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return i[a]}})}}),t.default=i,Object.freeze(t)}var Ie=Ee(fe),qe=Ee(Pe);function Ae(i){return i&&Object.prototype.hasOwnProperty.call(i,"default")&&Object.keys(i).length===1?i.default:i}var ne={},ie={},Oe=Ae(Ie),Be=Ae(qe);Object.defineProperty(ie,"__esModule",{value:!0});var Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},he=function(){function i(t,a){var r=[],e=!0,o=!1,c=void 0;try{for(var f=t[Symbol.iterator](),u;!(e=(u=f.next()).done)&&(r.push(u.value),!(a&&r.length===a));e=!0);}catch(n){o=!0,c=n}finally{try{!e&&f.return&&f.return()}finally{if(o)throw c}}return r}return function(t,a){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return i(t,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i[r]=a[r])}return i},I=function(){function i(t,a){for(var r=0;r<a.length;r++){var e=a[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}return function(t,a,r){return a&&i(t.prototype,a),r&&i(t,r),t}}();ie.defaultValue=de;var ze=Oe,l=He(ze),v=Be;function He(i){if(i&&i.__esModule)return i;var t={};if(i!=null)for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a]);return t.default=i,t}function be(i,t,a){return t in i?Object.defineProperty(i,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[t]=a,i}function L(i){if(Array.isArray(i)){for(var t=0,a=Array(i.length);t<i.length;t++)a[t]=i[t];return a}else return Array.from(i)}function q(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function F(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function B(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}function me(i){return i.charAt(0).toUpperCase()+i.slice(1)}var We={keyword:"#B11A04",def:"#D2054E",property:"#1F61A0",qualifier:"#1C92A9",attribute:"#8B2BB9",number:"#2882F9",string:"#D64292",builtin:"#D47509",string2:"#0B7FC7",variable:"#397D13",atom:"#CA9800"},Ge=l.createElement("svg",{width:"12",height:"9"},l.createElement("path",{fill:"#666",d:"M 0 2 L 9 2 L 4.5 7.5 z"})),$e=l.createElement("svg",{width:"12",height:"9"},l.createElement("path",{fill:"#666",d:"M 0 0 L 0 9 L 5.5 4.5 z"})),Qe=l.createElement("svg",{style:{marginRight:"3px",marginLeft:"-3px"},width:"12",height:"12",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M16 0H2C0.9 0 0 0.9 0 2V16C0 17.1 0.9 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0ZM16 16H2V2H16V16ZM14.99 6L13.58 4.58L6.99 11.17L4.41 8.6L2.99 10.01L6.99 14L14.99 6Z",fill:"#666"})),Ze=l.createElement("svg",{style:{marginRight:"3px",marginLeft:"-3px"},width:"12",height:"12",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M16 2V16H2V2H16ZM16 0H2C0.9 0 0 0.9 0 2V16C0 17.1 0.9 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0Z",fill:"#CCC"}));function ae(i){return i.checked?i.styleConfig.checkboxChecked:i.styleConfig.checkboxUnchecked}function we(i){var t=i.getFields();if(t.id){var a=["id"];return t.email?a.push("email"):t.name&&a.push("name"),a}if(t.edges)return["edges"];if(t.node)return["node"];if(t.nodes)return["nodes"];var r=[];return Object.keys(t).forEach(function(e){(0,v.isLeafType)(t[e].type)&&r.push(e)}),r.length?r.slice(0,2):["__typename"]}function xe(i){return(0,v.isNonNullType)(i.type)&&i.defaultValue===void 0}function Ke(i){for(var t=i;(0,v.isWrappingType)(t);)t=t.ofType;return t}function G(i){for(var t=i;(0,v.isWrappingType)(t);)t=t.ofType;return t}function Fe(i,t){if(typeof t!="string"&&t.kind==="VariableDefinition")return t.variable;if((0,v.isScalarType)(i))try{switch(i.name){case"String":return{kind:"StringValue",value:String(i.parseValue(t))};case"Float":return{kind:"FloatValue",value:String(i.parseValue(parseFloat(t)))};case"Int":return{kind:"IntValue",value:String(i.parseValue(parseInt(t,10)))};case"Boolean":try{var a=JSON.parse(t);return typeof a=="boolean"?{kind:"BooleanValue",value:a}:{kind:"BooleanValue",value:!1}}catch{return{kind:"BooleanValue",value:!1}}default:return{kind:"StringValue",value:String(i.parseValue(t))}}}catch(e){return console.error("error coercing arg value",e,t),{kind:"StringValue",value:t}}else try{var r=i.parseValue(t);return r?{kind:"EnumValue",value:String(r)}:{kind:"EnumValue",value:i.getValues()[0].name}}catch{return{kind:"EnumValue",value:i.getValues()[0].name}}}var Je=function(i){B(t,i);function t(){var a,r,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._getArgSelection=function(){return e.props.selection.fields.find(function(n){return n.name.value===e.props.arg.name})},e._removeArg=function(){var n=e.props.selection,s=e._getArgSelection();e._previousArgSelection=s,e.props.modifyFields(n.fields.filter(function(p){return p!==s}),!0)},e._addArg=function(){var n=e.props,s=n.selection,p=n.arg,m=n.getDefaultScalarArgValue,h=n.parentField,w=n.makeDefaultArg,d=G(p.type),b=null;if(e._previousArgSelection)b=e._previousArgSelection;else if((0,v.isInputObjectType)(d)){var g=d.getFields();b={kind:"ObjectField",name:{kind:"Name",value:p.name},value:{kind:"ObjectValue",fields:oe(m,w,h,Object.keys(g).map(function(k){return g[k]}))}}}else(0,v.isLeafType)(d)&&(b={kind:"ObjectField",name:{kind:"Name",value:p.name},value:m(h,p,d)});if(!b)console.error("Unable to add arg for argType",d);else return e.props.modifyFields([].concat(L(s.fields||[]),[b]),!0)},e._setArgValue=function(n,s){var p=!1,m=!1,h=!1;try{n.kind==="VariableDefinition"?m=!0:n===null||typeof n=="undefined"?p=!0:typeof n.kind=="string"&&(h=!0)}catch{}var w=e.props.selection,d=e._getArgSelection();if(!d){console.error("missing arg selection when setting arg value");return}var b=G(e.props.arg.type),g=(0,v.isLeafType)(b)||m||p||h;if(!g){console.warn("Unable to handle non leaf types in InputArgView.setArgValue",n);return}var k=void 0,E=void 0;n===null||typeof n=="undefined"?E=null:!n.target&&!!n.kind&&n.kind==="VariableDefinition"?(k=n,E=k.variable):typeof n.kind=="string"?E=n:n.target&&typeof n.target.value=="string"&&(k=n.target.value,E=Fe(b,k));var A=e.props.modifyFields((w.fields||[]).map(function(V){var P=V===d,R=P?_({},V,{value:E}):V;return R}),s);return A},e._modifyChildFields=function(n){return e.props.modifyFields(e.props.selection.fields.map(function(s){return s.name.value===e.props.arg.name?_({},s,{value:{kind:"ObjectValue",fields:n}}):s}),!0)},r),F(e,o)}return I(t,[{key:"render",value:function(){var r=this.props,e=r.arg,o=r.parentField,c=this._getArgSelection();return l.createElement(Ve,{argValue:c?c.value:null,arg:e,parentField:o,addArg:this._addArg,removeArg:this._removeArg,setArgFields:this._modifyChildFields,setArgValue:this._setArgValue,getDefaultScalarArgValue:this.props.getDefaultScalarArgValue,makeDefaultArg:this.props.makeDefaultArg,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig,onCommit:this.props.onCommit,definition:this.props.definition})}}]),t}(l.PureComponent);function de(i){if((0,v.isEnumType)(i))return{kind:"EnumValue",value:i.getValues()[0].name};switch(i.name){case"String":return{kind:"StringValue",value:""};case"Float":return{kind:"FloatValue",value:"1.5"};case"Int":return{kind:"IntValue",value:"10"};case"Boolean":return{kind:"BooleanValue",value:!1};default:return{kind:"StringValue",value:""}}}function De(i,t,a){return de(a)}var Ye=function(i){B(t,i);function t(){var a,r,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._getArgSelection=function(){var n=e.props.selection;return(n.arguments||[]).find(function(s){return s.name.value===e.props.arg.name})},e._removeArg=function(n){var s=e.props.selection,p=e._getArgSelection();return e._previousArgSelection=p,e.props.modifyArguments((s.arguments||[]).filter(function(m){return m!==p}),n)},e._addArg=function(n){var s=e.props,p=s.selection,m=s.getDefaultScalarArgValue,h=s.makeDefaultArg,w=s.parentField,d=s.arg,b=G(d.type),g=null;if(e._previousArgSelection)g=e._previousArgSelection;else if((0,v.isInputObjectType)(b)){var k=b.getFields();g={kind:"Argument",name:{kind:"Name",value:d.name},value:{kind:"ObjectValue",fields:oe(m,h,w,Object.keys(k).map(function(E){return k[E]}))}}}else(0,v.isLeafType)(b)&&(g={kind:"Argument",name:{kind:"Name",value:d.name},value:m(w,d,b)});return g?e.props.modifyArguments([].concat(L(p.arguments||[]),[g]),n):(console.error("Unable to add arg for argType",b),null)},e._setArgValue=function(n,s){var p=!1,m=!1,h=!1;try{n.kind==="VariableDefinition"?m=!0:n===null||typeof n=="undefined"?p=!0:typeof n.kind=="string"&&(h=!0)}catch{}var w=e.props.selection,d=e._getArgSelection();if(!d&&!m){console.error("missing arg selection when setting arg value");return}var b=G(e.props.arg.type),g=(0,v.isLeafType)(b)||m||p||h;if(!g){console.warn("Unable to handle non leaf types in ArgView._setArgValue");return}var k=void 0,E=void 0;return n===null||typeof n=="undefined"?E=null:n.target&&typeof n.target.value=="string"?(k=n.target.value,E=Fe(b,k)):!n.target&&n.kind==="VariableDefinition"?(k=n,E=k.variable):typeof n.kind=="string"&&(E=n),e.props.modifyArguments((w.arguments||[]).map(function(A){return A===d?_({},A,{value:E}):A}),s)},e._setArgFields=function(n,s){var p=e.props.selection,m=e._getArgSelection();if(!m){console.error("missing arg selection when setting arg value");return}return e.props.modifyArguments((p.arguments||[]).map(function(h){return h===m?_({},h,{value:{kind:"ObjectValue",fields:n}}):h}),s)},r),F(e,o)}return I(t,[{key:"render",value:function(){var r=this.props,e=r.arg,o=r.parentField,c=this._getArgSelection();return l.createElement(Ve,{argValue:c?c.value:null,arg:e,parentField:o,addArg:this._addArg,removeArg:this._removeArg,setArgFields:this._setArgFields,setArgValue:this._setArgValue,getDefaultScalarArgValue:this.props.getDefaultScalarArgValue,makeDefaultArg:this.props.makeDefaultArg,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig,onCommit:this.props.onCommit,definition:this.props.definition})}}]),t}(l.PureComponent);function Xe(i){return i.ctrlKey&&i.key==="Enter"}function et(i){return i!=="FragmentDefinition"}var tt=function(i){B(t,i);function t(){var a,r,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._handleChange=function(n){e.props.setArgValue(n,!0)},r),F(e,o)}return I(t,[{key:"componentDidMount",value:function(){var r=this._ref,e=document.activeElement;r&&e&&!(e instanceof HTMLTextAreaElement)&&(r.focus(),r.setSelectionRange(0,r.value.length))}},{key:"render",value:function(){var r=this,e=this.props,o=e.arg,c=e.argValue,f=e.styleConfig,u=G(o.type),n=typeof c.value=="string"?c.value:"",s=this.props.argValue.kind==="StringValue"?f.colors.string:f.colors.number;return l.createElement("span",{style:{color:s}},u.name==="String"?'"':"",l.createElement("input",{style:{border:"none",borderBottom:"1px solid #888",outline:"none",width:Math.max(1,Math.min(15,n.length))+"ch",color:s},ref:function(m){r._ref=m},type:"text",onChange:this._handleChange,value:n}),u.name==="String"?'"':"")}}]),t}(l.PureComponent),Ve=function(i){B(t,i);function t(){var a,r,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={displayArgActions:!1},r),F(e,o)}return I(t,[{key:"render",value:function(){var r=this,e=this.props,o=e.argValue,c=e.arg,f=e.styleConfig,u=G(c.type),n=null;if(o){if(o.kind==="Variable")n=l.createElement("span",{style:{color:f.colors.variable}},"$",o.name.value);else if((0,v.isScalarType)(u))u.name==="Boolean"?n=l.createElement("select",{style:{color:f.colors.builtin},onChange:this.props.setArgValue,value:o.kind==="BooleanValue"?o.value:void 0},l.createElement("option",{key:"true",value:"true"},"true"),l.createElement("option",{key:"false",value:"false"},"false")):n=l.createElement(tt,{setArgValue:this.props.setArgValue,arg:c,argValue:o,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig});else if((0,v.isEnumType)(u))o.kind==="EnumValue"?n=l.createElement("select",{style:{backgroundColor:"white",color:f.colors.string2},onChange:this.props.setArgValue,value:o.value},u.getValues().map(function(d){return l.createElement("option",{key:d.name,value:d.name},d.name)})):console.error("arg mismatch between arg and selection",u,o);else if((0,v.isInputObjectType)(u))if(o.kind==="ObjectValue"){var s=u.getFields();n=l.createElement("div",{style:{marginLeft:16}},Object.keys(s).sort().map(function(d){return l.createElement(Je,{key:d,arg:s[d],parentField:r.props.parentField,selection:o,modifyFields:r.props.setArgFields,getDefaultScalarArgValue:r.props.getDefaultScalarArgValue,makeDefaultArg:r.props.makeDefaultArg,onRunOperation:r.props.onRunOperation,styleConfig:r.props.styleConfig,onCommit:r.props.onCommit,definition:r.props.definition})}))}else console.error("arg mismatch between arg and selection",u,o)}var p=function(){var b=c.name,g=(r.props.definition.variableDefinitions||[]).filter(function(C){return C.variable.name.value.startsWith(b)}).length,k=void 0;g>0?k=""+b+g:k=b;var E=c.type.toString(),A=(0,v.parseType)(E),V={kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:k}},type:A,directives:[]},P=function(x){return(r.props.definition.variableDefinitions||[]).find(function(T){return T.variable.name.value===x})},R=void 0,H={};if(typeof o!="undefined"&&o!==null){var U=(0,v.visit)(o,{Variable:function(x){var T=x.name.value,Q=P(T);if(H[T]=H[T]+1||1,!!Q)return Q.defaultValue}}),$=V.type.kind==="NonNullType",j=$?_({},V,{type:V.type.type}):V;R=_({},j,{defaultValue:U})}else R=V;var J=Object.entries(H).filter(function(C){var x=he(C,2);x[0];var T=x[1];return T<2}).map(function(C){var x=he(C,2),T=x[0];return x[1],T});if(R){var Z=r.props.setArgValue(R,!1);if(Z){var Y=Z.definitions.find(function(C){return!!C.operation&&!!C.name&&!!C.name.value&&!!r.props.definition.name&&!!r.props.definition.name.value?C.name.value===r.props.definition.name.value:!1}),y=[].concat(L(Y.variableDefinitions||[]),[R]).filter(function(C){return J.indexOf(C.variable.name.value)===-1}),S=_({},Y,{variableDefinitions:y}),O=Z.definitions,D=O.map(function(C){return Y===C?S:C}),N=_({},Z,{definitions:D});r.props.onCommit(N)}}},m=function(){if(!(!o||!o.name||!o.name.value)){var b=o.name.value,g=(r.props.definition.variableDefinitions||[]).find(function(j){return j.variable.name.value===b});if(!!g){var k=g.defaultValue,E=r.props.setArgValue(k,{commit:!1});if(E){var A=E.definitions.find(function(j){return j.name.value===r.props.definition.name.value});if(!A)return;var V=0;(0,v.visit)(A,{Variable:function(J){J.name.value===b&&(V=V+1)}});var P=A.variableDefinitions||[];V<2&&(P=P.filter(function(j){return j.variable.name.value!==b}));var R=_({},A,{variableDefinitions:P}),H=E.definitions,U=H.map(function(j){return A===j?R:j}),$=_({},E,{definitions:U});r.props.onCommit($)}}}},h=o&&o.kind==="Variable",w=this.state.displayArgActions?l.createElement("button",{type:"submit",className:"toolbar-button",title:h?"Remove the variable":"Extract the current value into a GraphQL variable",onClick:function(b){b.preventDefault(),b.stopPropagation(),h?m():p()},style:f.styles.actionButtonStyle},l.createElement("span",{style:{color:f.colors.variable}},"$")):null;return l.createElement("div",{style:{cursor:"pointer",minHeight:"16px",WebkitUserSelect:"none",userSelect:"none"},"data-arg-name":c.name,"data-arg-type":u.name,className:"graphiql-explorer-"+c.name},l.createElement("span",{style:{cursor:"pointer"},onClick:function(b){var g=!o;g?r.props.addArg(!0):r.props.removeArg(!0),r.setState({displayArgActions:g})}},(0,v.isInputObjectType)(u)?l.createElement("span",null,o?this.props.styleConfig.arrowOpen:this.props.styleConfig.arrowClosed):l.createElement(ae,{checked:!!o,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:f.colors.attribute},title:c.description,onMouseEnter:function(){o!==null&&typeof o!="undefined"&&r.setState({displayArgActions:!0})},onMouseLeave:function(){return r.setState({displayArgActions:!1})}},c.name,xe(c)?"*":"",": ",w," ")," "),n||l.createElement("span",null)," ")}}]),t}(l.PureComponent),rt=function(i){B(t,i);function t(){var a,r,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._addFragment=function(){e.props.modifySelections([].concat(L(e.props.selections),[e._previousSelection||{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.props.implementingType.name}},selectionSet:{kind:"SelectionSet",selections:e.props.getDefaultFieldNames(e.props.implementingType).map(function(n){return{kind:"Field",name:{kind:"Name",value:n}}})}}]))},e._removeFragment=function(){var n=e._getSelection();e._previousSelection=n,e.props.modifySelections(e.props.selections.filter(function(s){return s!==n}))},e._getSelection=function(){var n=e.props.selections.find(function(s){return s.kind==="InlineFragment"&&s.typeCondition&&e.props.implementingType.name===s.typeCondition.name.value});if(!n)return null;if(n.kind==="InlineFragment")return n},e._modifyChildSelections=function(n,s){var p=e._getSelection();return e.props.modifySelections(e.props.selections.map(function(m){return m===p?{directives:m.directives,kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.props.implementingType.name}},selectionSet:{kind:"SelectionSet",selections:n}}:m}),s)},r),F(e,o)}return I(t,[{key:"render",value:function(){var r=this,e=this.props,o=e.implementingType,c=e.schema,f=e.getDefaultFieldNames,u=e.styleConfig,n=this._getSelection(),s=o.getFields(),p=n?n.selectionSet?n.selectionSet.selections:[]:[];return l.createElement("div",{className:"graphiql-explorer-"+o.name},l.createElement("span",{style:{cursor:"pointer"},onClick:n?this._removeFragment:this._addFragment},l.createElement(ae,{checked:!!n,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:u.colors.atom}},this.props.implementingType.name)),n?l.createElement("div",{style:{marginLeft:16}},Object.keys(s).sort().map(function(m){return l.createElement(Te,{key:m,field:s[m],selections:p,modifySelections:r._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:r.props.getDefaultScalarArgValue,makeDefaultArg:r.props.makeDefaultArg,onRunOperation:r.props.onRunOperation,onCommit:r.props.onCommit,styleConfig:r.props.styleConfig,definition:r.props.definition,availableFragments:r.props.availableFragments})})):null)}}]),t}(l.PureComponent),nt=function(i){B(t,i);function t(){var a,r,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._addFragment=function(){e.props.modifySelections([].concat(L(e.props.selections),[e._previousSelection||{kind:"FragmentSpread",name:e.props.fragment.name}]))},e._removeFragment=function(){var n=e._getSelection();e._previousSelection=n,e.props.modifySelections(e.props.selections.filter(function(s){var p=s.kind==="FragmentSpread"&&s.name.value===e.props.fragment.name.value;return!p}))},e._getSelection=function(){var n=e.props.selections.find(function(s){return s.kind==="FragmentSpread"&&s.name.value===e.props.fragment.name.value});return n},r),F(e,o)}return I(t,[{key:"render",value:function(){var r=this.props.styleConfig,e=this._getSelection();return l.createElement("div",{className:"graphiql-explorer-"+this.props.fragment.name.value},l.createElement("span",{style:{cursor:"pointer"},onClick:e?this._removeFragment:this._addFragment},l.createElement(ae,{checked:!!e,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:r.colors.def},className:"graphiql-explorer-"+this.props.fragment.name.value},this.props.fragment.name.value)))}}]),t}(l.PureComponent);function oe(i,t,a,r){var e=[],o=!0,c=!1,f=void 0;try{for(var u=r[Symbol.iterator](),n;!(o=(n=u.next()).done);o=!0){var s=n.value;if((0,v.isRequiredInputField)(s)||t&&t(a,s)){var p=G(s.type);(0,v.isInputObjectType)(p)?function(){var m=p.getFields();e.push({kind:"ObjectField",name:{kind:"Name",value:s.name},value:{kind:"ObjectValue",fields:oe(i,t,a,Object.keys(m).map(function(h){return m[h]}))}})}():(0,v.isLeafType)(p)&&e.push({kind:"ObjectField",name:{kind:"Name",value:s.name},value:i(a,s,p)})}}}catch(m){c=!0,f=m}finally{try{!o&&u.return&&u.return()}finally{if(c)throw f}}return e}function Se(i,t,a){var r=[],e=!0,o=!1,c=void 0;try{for(var f=a.args[Symbol.iterator](),u;!(e=(u=f.next()).done);e=!0){var n=u.value;if(xe(n)||t&&t(a,n)){var s=G(n.type);(0,v.isInputObjectType)(s)?function(){var p=s.getFields();r.push({kind:"Argument",name:{kind:"Name",value:n.name},value:{kind:"ObjectValue",fields:oe(i,t,a,Object.keys(p).map(function(m){return p[m]}))}})}():(0,v.isLeafType)(s)&&r.push({kind:"Argument",name:{kind:"Name",value:n.name},value:i(a,n,s)})}}}catch(p){o=!0,c=p}finally{try{!e&&f.return&&f.return()}finally{if(o)throw c}}return r}var Te=function(i){B(t,i);function t(){var a,r,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={displayFieldActions:!1},e._addAllFieldsToSelections=function(n){var s=n?Object.keys(n).map(function(h){return{kind:"Field",name:{kind:"Name",value:h},arguments:[]}}):[],p={kind:"SelectionSet",selections:s},m=[].concat(L(e.props.selections.filter(function(h){return h.kind==="InlineFragment"?!0:h.name.value!==e.props.field.name})),[{kind:"Field",name:{kind:"Name",value:e.props.field.name},arguments:Se(e.props.getDefaultScalarArgValue,e.props.makeDefaultArg,e.props.field),selectionSet:p}]);e.props.modifySelections(m)},e._addFieldToSelections=function(n){var s=[].concat(L(e.props.selections),[e._previousSelection||{kind:"Field",name:{kind:"Name",value:e.props.field.name},arguments:Se(e.props.getDefaultScalarArgValue,e.props.makeDefaultArg,e.props.field)}]);e.props.modifySelections(s)},e._handleUpdateSelections=function(n){var s=e._getSelection();if(s&&!n.altKey)e._removeFieldFromSelections();else{var p=(0,v.getNamedType)(e.props.field.type),m=(0,v.isObjectType)(p)&&p.getFields(),h=!!m&&n.altKey;h?e._addAllFieldsToSelections(m):e._addFieldToSelections(m)}},e._removeFieldFromSelections=function(){var n=e._getSelection();e._previousSelection=n,e.props.modifySelections(e.props.selections.filter(function(s){return s!==n}))},e._getSelection=function(){var n=e.props.selections.find(function(s){return s.kind==="Field"&&e.props.field.name===s.name.value});if(!n)return null;if(n.kind==="Field")return n},e._setArguments=function(n,s){var p=e._getSelection();if(!p){console.error("Missing selection when setting arguments",n);return}return e.props.modifySelections(e.props.selections.map(function(m){return m===p?{alias:p.alias,arguments:n,directives:p.directives,kind:"Field",name:p.name,selectionSet:p.selectionSet}:m}),s)},e._modifyChildSelections=function(n,s){return e.props.modifySelections(e.props.selections.map(function(p){if(p.kind==="Field"&&e.props.field.name===p.name.value){if(p.kind!=="Field")throw new Error("invalid selection");return{alias:p.alias,arguments:p.arguments,directives:p.directives,kind:"Field",name:p.name,selectionSet:{kind:"SelectionSet",selections:n}}}return p}),s)},r),F(e,o)}return I(t,[{key:"render",value:function(){var r=this,e=this.props,o=e.field,c=e.schema,f=e.getDefaultFieldNames,u=e.styleConfig,n=this._getSelection(),s=Ke(o.type),p=o.args.sort(function(g,k){return g.name.localeCompare(k.name)}),m="graphiql-explorer-node graphiql-explorer-"+o.name;o.isDeprecated&&(m+=" graphiql-explorer-deprecated");var h=(0,v.isObjectType)(s)||(0,v.isInterfaceType)(s)||(0,v.isUnionType)(s)?this.props.availableFragments&&this.props.availableFragments[s.name]:null,w=l.createElement("div",{className:m},l.createElement("span",{title:o.description,style:{cursor:"pointer",display:"inline-flex",alignItems:"center",minHeight:"16px",WebkitUserSelect:"none",userSelect:"none"},"data-field-name":o.name,"data-field-type":s.name,onClick:this._handleUpdateSelections,onMouseEnter:function(){var k=(0,v.isObjectType)(s)&&n&&n.selectionSet&&n.selectionSet.selections.filter(function(E){return E.kind!=="FragmentSpread"}).length>0;k&&r.setState({displayFieldActions:!0})},onMouseLeave:function(){return r.setState({displayFieldActions:!1})}},(0,v.isObjectType)(s)?l.createElement("span",null,n?this.props.styleConfig.arrowOpen:this.props.styleConfig.arrowClosed):null,(0,v.isObjectType)(s)?null:l.createElement(ae,{checked:!!n,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:u.colors.property},className:"graphiql-explorer-field-view"},o.name),this.state.displayFieldActions?l.createElement("button",{type:"submit",className:"toolbar-button",title:"Extract selections into a new reusable fragment",onClick:function(k){k.preventDefault(),k.stopPropagation();var E=s.name,A=E+"Fragment",V=(h||[]).filter(function(j){return j.name.value.startsWith(A)}).length;V>0&&(A=""+A+V);var P=n?n.selectionSet?n.selectionSet.selections:[]:[],R=[{kind:"FragmentSpread",name:{kind:"Name",value:A},directives:[]}],H={kind:"FragmentDefinition",name:{kind:"Name",value:A},typeCondition:{kind:"NamedType",name:{kind:"Name",value:s.name}},directives:[],selectionSet:{kind:"SelectionSet",selections:P}},U=r._modifyChildSelections(R,!1);if(U){var $=_({},U,{definitions:[].concat(L(U.definitions),[H])});r.props.onCommit($)}else console.warn("Unable to complete extractFragment operation")},style:_({},u.styles.actionButtonStyle)},l.createElement("span",null,"\u2026")):null),n&&p.length?l.createElement("div",{style:{marginLeft:16},className:"graphiql-explorer-graphql-arguments"},p.map(function(g){return l.createElement(Ye,{key:g.name,parentField:o,arg:g,selection:n,modifyArguments:r._setArguments,getDefaultScalarArgValue:r.props.getDefaultScalarArgValue,makeDefaultArg:r.props.makeDefaultArg,onRunOperation:r.props.onRunOperation,styleConfig:r.props.styleConfig,onCommit:r.props.onCommit,definition:r.props.definition})})):null);if(n&&((0,v.isObjectType)(s)||(0,v.isInterfaceType)(s)||(0,v.isUnionType)(s))){var d=(0,v.isUnionType)(s)?{}:s.getFields(),b=n?n.selectionSet?n.selectionSet.selections:[]:[];return l.createElement("div",{className:"graphiql-explorer-"+o.name},w,l.createElement("div",{style:{marginLeft:16}},h?h.map(function(g){var k=c.getType(g.typeCondition.name.value),E=g.name.value;return k?l.createElement(nt,{key:E,fragment:g,selections:b,modifySelections:r._modifyChildSelections,schema:c,styleConfig:r.props.styleConfig,onCommit:r.props.onCommit}):null}):null,Object.keys(d).sort().map(function(g){return l.createElement(t,{key:g,field:d[g],selections:b,modifySelections:r._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:r.props.getDefaultScalarArgValue,makeDefaultArg:r.props.makeDefaultArg,onRunOperation:r.props.onRunOperation,styleConfig:r.props.styleConfig,onCommit:r.props.onCommit,definition:r.props.definition,availableFragments:r.props.availableFragments})}),(0,v.isInterfaceType)(s)||(0,v.isUnionType)(s)?c.getPossibleTypes(s).map(function(g){return l.createElement(rt,{key:g.name,implementingType:g,selections:b,modifySelections:r._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:r.props.getDefaultScalarArgValue,makeDefaultArg:r.props.makeDefaultArg,onRunOperation:r.props.onRunOperation,styleConfig:r.props.styleConfig,onCommit:r.props.onCommit,definition:r.props.definition})}):null))}return w}}]),t}(l.PureComponent);function it(i){try{return i.trim()?(0,v.parse)(i,{noLocation:!0}):null}catch(t){return new Error(t)}}var at={kind:"OperationDefinition",operation:"query",variableDefinitions:[],name:{kind:"Name",value:"MyQuery"},directives:[],selectionSet:{kind:"SelectionSet",selections:[]}},re={kind:"Document",definitions:[at]},K=null;function ot(i){if(K&&K[0]===i)return K[1];var t=it(i);return t?t instanceof Error?K?K[1]:re:(K=[i,t],t):re}var ke={buttonStyle:{fontSize:"1.2em",padding:"0px",backgroundColor:"white",border:"none",margin:"5px 0px",height:"40px",width:"100%",display:"block",maxWidth:"none"},actionButtonStyle:{padding:"0px",backgroundColor:"white",border:"none",margin:"0px",maxWidth:"none",height:"15px",width:"15px",display:"inline-block",fontSize:"smaller"},explorerActionsStyle:{margin:"4px -8px -8px",paddingLeft:"8px",bottom:"0px",width:"100%",textAlign:"center",background:"none",borderTop:"none",borderBottom:"none"}},lt=function(i){B(t,i);function t(){var a,r,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={newOperationType:"query",displayTitleActions:!1},e._modifySelections=function(n,s){var p=e.props.definition;p.selectionSet.selections.length===0&&e._previousOperationDef&&(p=e._previousOperationDef);var m=void 0;if(p.kind==="FragmentDefinition")m=_({},p,{selectionSet:_({},p.selectionSet,{selections:n})});else if(p.kind==="OperationDefinition"){var h=n.filter(function(w){return!(w.kind==="Field"&&w.name.value==="__typename")});h.length===0&&(h=[{kind:"Field",name:{kind:"Name",value:"__typename ## Placeholder value"}}]),m=_({},p,{selectionSet:_({},p.selectionSet,{selections:h})})}return e.props.onEdit(m,s)},e._onOperationRename=function(n){return e.props.onOperationRename(n.target.value)},e._handlePotentialRun=function(n){Xe(n)&&et(e.props.definition.kind)&&e.props.onRunOperation(e.props.name)},e._rootViewElId=function(){var n=e.props,s=n.operationType,p=n.name,m=s+"-"+(p||"unknown");return m},r),F(e,o)}return I(t,[{key:"componentDidMount",value:function(){var r=this._rootViewElId();this.props.onMount(r)}},{key:"render",value:function(){var r=this,e=this.props,o=e.operationType,c=e.definition,f=e.schema,u=e.getDefaultFieldNames,n=e.styleConfig,s=this._rootViewElId(),p=this.props.fields||{},m=c,h=m.selectionSet.selections,w=this.props.name||me(o)+" Name";return l.createElement("div",{id:s,tabIndex:"0",onKeyDown:this._handlePotentialRun,style:{borderBottom:this.props.isLast?"none":"1px solid #d6d6d6",marginBottom:"0em",paddingBottom:"1em"}},l.createElement("div",{style:{color:n.colors.keyword,paddingBottom:4},className:"graphiql-operation-title-bar",onMouseEnter:function(){return r.setState({displayTitleActions:!0})},onMouseLeave:function(){return r.setState({displayTitleActions:!1})}},o," ",l.createElement("span",{style:{color:n.colors.def}},l.createElement("input",{style:{color:n.colors.def,border:"none",borderBottom:"1px solid #888",outline:"none",width:Math.max(4,w.length)+"ch"},autoComplete:"false",placeholder:me(o)+" Name",value:this.props.name,onKeyDown:this._handlePotentialRun,onChange:this._onOperationRename})),this.props.onTypeName?l.createElement("span",null,l.createElement("br",null),"on "+this.props.onTypeName):"",this.state.displayTitleActions?l.createElement(l.Fragment,null,l.createElement("button",{type:"submit",className:"toolbar-button",onClick:function(){return r.props.onOperationDestroy()},style:_({},n.styles.actionButtonStyle)},l.createElement("span",null,"\u2715")),l.createElement("button",{type:"submit",className:"toolbar-button",onClick:function(){return r.props.onOperationClone()},style:_({},n.styles.actionButtonStyle)},l.createElement("span",null,"\u2398"))):""),Object.keys(p).sort().map(function(d){return l.createElement(Te,{key:d,field:p[d],selections:h,modifySelections:r._modifySelections,schema:f,getDefaultFieldNames:u,getDefaultScalarArgValue:r.props.getDefaultScalarArgValue,makeDefaultArg:r.props.makeDefaultArg,onRunOperation:r.props.onRunOperation,styleConfig:r.props.styleConfig,onCommit:r.props.onCommit,definition:r.props.definition,availableFragments:r.props.availableFragments})}))}}]),t}(l.PureComponent);function st(){return l.createElement("div",{style:{fontFamily:"sans-serif",display:"flex",flexDirection:"column",alignItems:"center",margin:"1em",marginTop:0,flexGrow:1,justifyContent:"flex-end"}},l.createElement("div",{style:{borderTop:"1px solid #d6d6d6",paddingTop:"1em",width:"100%",textAlign:"center"}},"GraphiQL Explorer by ",l.createElement("a",{href:"https://www.onegraph.com"},"OneGraph")),l.createElement("div",null,"Contribute on"," ",l.createElement("a",{href:"https://github.com/OneGraph/graphiql-explorer"},"GitHub")))}var Ne=function(i){B(t,i);function t(){var a,r,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={newOperationType:"query",operation:null,operationToScrollTo:null},e._resetScroll=function(){var n=e._ref;n&&(n.scrollLeft=0)},e._onEdit=function(n){return e.props.onEdit(n)},e._setAddOperationType=function(n){e.setState({newOperationType:n})},e._handleRootViewMount=function(n){if(!!e.state.operationToScrollTo&&e.state.operationToScrollTo===n){var s=".graphiql-explorer-root #"+n,p=document.querySelector(s);p&&p.scrollIntoView()}},r),F(e,o)}return I(t,[{key:"componentDidMount",value:function(){this._resetScroll()}},{key:"render",value:function(){var r=this,e=this.props,o=e.schema,c=e.query,f=e.makeDefaultArg;if(!o)return l.createElement("div",{style:{fontFamily:"sans-serif"},className:"error-container"},"No Schema Available");var u={colors:this.props.colors||We,checkboxChecked:this.props.checkboxChecked||Qe,checkboxUnchecked:this.props.checkboxUnchecked||Ze,arrowClosed:this.props.arrowClosed||$e,arrowOpen:this.props.arrowOpen||Ge,styles:this.props.styles?_({},ke,this.props.styles):ke},n=o.getQueryType(),s=o.getMutationType(),p=o.getSubscriptionType();if(!n&&!s&&!p)return l.createElement("div",null,"Missing query type");var m=n&&n.getFields(),h=s&&s.getFields(),w=p&&p.getFields(),d=ot(c),b=this.props.getDefaultFieldNames||we,g=this.props.getDefaultScalarArgValue||De,k=d.definitions,E=k.map(function(y){return y.kind==="FragmentDefinition"||y.kind==="OperationDefinition"?y:null}).filter(Boolean),A=E.length===0?re.definitions:E,V=function(S,O){var D=O==null||O===""?null:{kind:"Name",value:O,loc:void 0},N=_({},S,{name:D}),C=d.definitions,x=C.map(function(T){return S===T?N:T});return _({},d,{definitions:x})},P=function(S){var O=void 0;S.kind==="FragmentDefinition"?O="fragment":O=S.operation;var D=(S.name&&S.name.value||"")+"Copy",N={kind:"Name",value:D,loc:void 0},C=_({},S,{name:N}),x=d.definitions,T=[].concat(L(x),[C]);return r.setState({operationToScrollTo:O+"-"+D}),_({},d,{definitions:T})},R=function(S){var O=d.definitions,D=O.filter(function(N){return S!==N});return _({},d,{definitions:D})},H=function(S){var O=d.definitions,D=d.definitions.length===1&&d.definitions[0]===re.definitions[0],N=D?[]:O.filter(function(X){return X.kind==="OperationDefinition"?X.operation===S:!1}),C="My"+me(S)+(N.length===0?"":N.length+1),x="__typename # Placeholder value",T={kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:x,loc:null},arguments:[],directives:[],selectionSet:null,loc:null}],loc:null},Q={kind:"OperationDefinition",operation:S,name:{kind:"Name",value:C},variableDefinitions:[],directives:[],selectionSet:T,loc:null},le=D?[Q]:[].concat(L(d.definitions),[Q]),se=_({},d,{definitions:le});r.setState({operationToScrollTo:S+"-"+C}),r.props.onEdit((0,v.print)(se))},U=[m?l.createElement("option",{key:"query",className:"toolbar-button",style:u.styles.buttonStyle,type:"link",value:"query"},"Query"):null,h?l.createElement("option",{key:"mutation",className:"toolbar-button",style:u.styles.buttonStyle,type:"link",value:"mutation"},"Mutation"):null,w?l.createElement("option",{key:"subscription",className:"toolbar-button",style:u.styles.buttonStyle,type:"link",value:"subscription"},"Subscription"):null].filter(Boolean),$=U.length===0||this.props.hideActions?null:l.createElement("div",{style:{minHeight:"50px",maxHeight:"50px",overflow:"none"}},l.createElement("form",{className:"variable-editor-title graphiql-explorer-actions",style:_({},u.styles.explorerActionsStyle,{display:"flex",flexDirection:"row",alignItems:"center",borderTop:"1px solid rgb(214, 214, 214)"}),onSubmit:function(S){return S.preventDefault()}},l.createElement("span",{style:{display:"inline-block",flexGrow:"0",textAlign:"right"}},"Add new"," "),l.createElement("select",{onChange:function(S){return r._setAddOperationType(S.target.value)},value:this.state.newOperationType,style:{flexGrow:"2"}},U),l.createElement("button",{type:"submit",className:"toolbar-button",onClick:function(){return r.state.newOperationType?H(r.state.newOperationType):null},style:_({},u.styles.buttonStyle,{height:"22px",width:"22px"})},l.createElement("span",null,"+")))),j=this.props.externalFragments&&this.props.externalFragments.reduce(function(y,S){if(S.kind==="FragmentDefinition"){var O=S.typeCondition.name.value,D=y[O]||[],N=[].concat(L(D),[S]).sort(function(C,x){return C.name.value.localeCompare(x.name.value)});return _({},y,be({},O,N))}return y},{}),J=A.reduce(function(y,S){if(S.kind==="FragmentDefinition"){var O=S.typeCondition.name.value,D=y[O]||[],N=[].concat(L(D),[S]).sort(function(C,x){return C.name.value.localeCompare(x.name.value)});return _({},y,be({},O,N))}return y},{}),Z=_({},J,j),Y=this.props.showAttribution?l.createElement(st,null):null;return l.createElement("div",{ref:function(S){r._ref=S},style:{fontSize:12,textOverflow:"ellipsis",whiteSpace:"nowrap",margin:0,padding:8,fontFamily:'Consolas, Inconsolata, "Droid Sans Mono", Monaco, monospace',display:"flex",flexDirection:"column",height:"100%"},className:"graphiql-explorer-root"},l.createElement("div",{style:{flexGrow:"1",overflow:"scroll"}},A.map(function(y,S){var O=y&&y.name&&y.name.value,D=y.kind==="FragmentDefinition"?"fragment":y&&y.operation||"query",N=function(z){var W=V(y,z);r.props.onEdit((0,v.print)(W))},C=function(){var z=P(y);r.props.onEdit((0,v.print)(z))},x=function(){var z=R(y);r.props.onEdit((0,v.print)(z))},T=y.kind==="FragmentDefinition"&&y.typeCondition.kind==="NamedType"&&o.getType(y.typeCondition.name.value),Q=T instanceof v.GraphQLObjectType?T.getFields():null,le=D==="query"?m:D==="mutation"?h:D==="subscription"?w:y.kind==="FragmentDefinition"?Q:null,se=y.kind==="FragmentDefinition"?y.typeCondition.name.value:null,X=function(z){var W=(0,v.print)(z);r.props.onEdit(W)};return l.createElement(lt,{key:S,isLast:S===A.length-1,fields:le,operationType:D,name:O,definition:y,onOperationRename:N,onOperationDestroy:x,onOperationClone:C,onTypeName:se,onMount:r._handleRootViewMount,onCommit:X,onEdit:function(z,W){var ue=void 0;if((typeof W=="undefined"?"undefined":Ue(W))==="object"&&typeof W.commit!="undefined"?ue=W.commit:ue=!0,z){var pe=_({},d,{definitions:d.definitions.map(function(ye){return ye===y?z:ye})});return ue&&X(pe),pe}else return d},schema:o,getDefaultFieldNames:b,getDefaultScalarArgValue:g,makeDefaultArg:f,onRunOperation:function(){r.props.onRunOperation&&r.props.onRunOperation(O)},styleConfig:u,availableFragments:Z})}),Y),$)}}]),t}(l.PureComponent);Ne.defaultProps={getDefaultFieldNames:we,getDefaultScalarArgValue:De};var ut=function(i){B(t,i);function t(){var a,r,e,o;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=F(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={hasError:!1,error:null,errorInfo:null},r),F(e,o)}return I(t,[{key:"componentDidCatch",value:function(r,e){this.setState({hasError:!0,error:r,errorInfo:e}),console.error("Error in component",r,e)}},{key:"render",value:function(){return this.state.hasError?l.createElement("div",{style:{padding:18,fontFamily:"sans-serif"}},l.createElement("div",null,"Something went wrong"),l.createElement("details",{style:{whiteSpace:"pre-wrap"}},this.state.error?this.state.error.toString():null,l.createElement("br",null),this.state.errorInfo?this.state.errorInfo.componentStack:null)):this.props.children}}]),t}(l.Component),ve=function(i){B(t,i);function t(){return q(this,t),F(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return I(t,[{key:"render",value:function(){return l.createElement("div",{className:"docExplorerWrap",style:{height:"100%",width:this.props.width,minWidth:this.props.width,zIndex:7,display:this.props.explorerIsOpen?"flex":"none",flexDirection:"column",overflow:"hidden"}},l.createElement("div",{className:"doc-explorer-title-bar"},l.createElement("div",{className:"doc-explorer-title"},this.props.title),l.createElement("div",{className:"doc-explorer-rhs"},l.createElement("div",{className:"docExplorerHide",onClick:this.props.onToggleExplorer},"\u2715"))),l.createElement("div",{className:"doc-explorer-contents",style:{padding:"0px",overflowY:"unset"}},l.createElement(ut,null,l.createElement(Ne,this.props))))}}]),t}(l.PureComponent);ve.defaultValue=de;ve.defaultProps={width:320,title:"Explorer"};ie.default=ve;Object.defineProperty(ne,"__esModule",{value:!0});ne.Explorer=void 0;var pt=ie,je=ct(pt);function ct(i){return i&&i.__esModule?i:{default:i}}ne.Explorer=je.default;var ft=ne.default=je.default;var ge={exports:{}},te={};/* | ||
object-assign | ||
(c) Sindre Sorhus | ||
@license MIT | ||
*/var Ee=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable;function kt(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function _t(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;var n=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(n.join("")!=="0123456789")return!1;var e={};return"abcdefghijklmnopqrst".split("").forEach(function(o){e[o]=o}),Object.keys(Object.assign({},e)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}_t();/** @license React v17.0.2 | ||
*/var _e=Object.getOwnPropertySymbols,mt=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;function vt(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function gt(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;var r=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(r.join("")!=="0123456789")return!1;var e={};return"abcdefghijklmnopqrst".split("").forEach(function(o){e[o]=o}),Object.keys(Object.assign({},e)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}gt();/** @license React v17.0.2 | ||
* react-jsx-runtime.production.min.js | ||
@@ -12,2 +12,2 @@ * | ||
* LICENSE file in the root directory of this source tree. | ||
*/var Ct=Fe,Pe=60103;te.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var Oe=Symbol.for;Pe=Oe("react.element"),te.Fragment=Oe("react.fragment")}var At=Ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Et=Object.prototype.hasOwnProperty,Ot={key:!0,ref:!0,__self:!0,__source:!0};function Ie(r,t,a){var n,e={},o=null,c=null;a!==void 0&&(o=""+a),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(c=t.ref);for(n in t)Et.call(t,n)&&!Ot.hasOwnProperty(n)&&(e[n]=t[n]);if(r&&r.defaultProps)for(n in t=r.defaultProps,t)e[n]===void 0&&(e[n]=t[n]);return{$$typeof:Pe,type:r,key:o,ref:c,props:e,_owner:At.current}}te.jsx=Ie;te.jsxs=Ie;ye.exports=te;const M=ye.exports.jsx,qe=ye.exports.jsxs;function wt(r){const{setOperationName:t}=fe.useEditorContext({nonNull:!0}),{schema:a}=fe.useSchemaContext({nonNull:!0}),{run:n}=fe.useExecutionContext({nonNull:!0});return M(ht,ce({schema:a,onRunOperation:e=>{e&&t(e),n()},explorerIsOpen:!0,colors:{keyword:"hsl(var(--color-primary))",def:"hsl(var(--color-tertiary))",property:"hsl(var(--color-info))",qualifier:"hsl(var(--color-secondary))",attribute:"hsl(var(--color-info))",number:"hsl(var(--color-success))",string:"hsl(var(--color-warning))",builtin:"hsl(var(--color-success))",string2:"hsl(var(--color-secondary))",variable:"hsl(var(--color-secondary))",atom:"hsl(var(--color-tertiary))"},arrowOpen:M("svg",{viewBox:"0 -4 13 15",style:{color:"hsla(var(--color-neutral), 0.4)",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:M("path",{d:"M3.35355 6.85355L6.14645 9.64645C6.34171 9.84171 6.65829 9.84171 6.85355 9.64645L9.64645 6.85355C9.96143 6.53857 9.73835 6 9.29289 6L3.70711 6C3.26165 6 3.03857 6.53857 3.35355 6.85355Z",fill:"currentColor"})}),arrowClosed:M("svg",{viewBox:"0 -2 13 15",style:{color:"hsla(var(--color-neutral), 0.4)",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:M("path",{d:"M6.35355 11.1464L9.14645 8.35355C9.34171 8.15829 9.34171 7.84171 9.14645 7.64645L6.35355 4.85355C6.03857 4.53857 5.5 4.76165 5.5 5.20711V10.7929C5.5 11.2383 6.03857 11.4614 6.35355 11.1464Z",fill:"currentColor"})}),checkboxUnchecked:M("svg",{viewBox:"0 0 15 15",style:{color:"hsla(var(--color-neutral), 0.4)",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:M("circle",{cx:"7.5",cy:"7.5",r:"6",stroke:"currentColor",fill:"none"})}),checkboxChecked:qe("svg",{viewBox:"0 0 15 15",style:{color:"hsl(var(--color-info))",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:[M("circle",{cx:"7.5",cy:"7.5",r:"7.5",fill:"currentColor"}),M("path",{d:"M4.64641 7.00106L6.8801 9.23256L10.5017 5.61325",fill:"none",stroke:"white",strokeWidth:"1.5"})]}),styles:{buttonStyle:{backgroundColor:"transparent",border:"none",color:"hsla(var(--color-neutral), 0.6)",cursor:"pointer",fontSize:"1em"},explorerActionsStyle:{padding:"var(--px-8) var(--px-4)"},actionButtonStyle:{backgroundColor:"transparent",border:"none",color:"hsla(var(--color-neutral), 0.6)",cursor:"pointer",fontSize:"1em"}}},r))}function xt(r){const t=me.useRef(r);return t.current=r,me.useMemo(()=>({title:"GraphiQL Explorer",icon:()=>qe("svg",{height:"1em",strokeWidth:"1.5",viewBox:"0 0 24 24",fill:"none",children:[M("path",{d:"M18 6H20M22 6H20M20 6V4M20 6V8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),M("path",{d:"M21.4 20H2.6C2.26863 20 2 19.7314 2 19.4V11H21.4C21.7314 11 22 11.2686 22 11.6V19.4C22 19.7314 21.7314 20 21.4 20Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),M("path",{d:"M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]}),content:()=>M(wt,ce({},t.current))}),[])}exports.useExplorerPlugin=xt; | ||
*/var yt=Oe,Re=60103;te.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var Ce=Symbol.for;Re=Ce("react.element"),te.Fragment=Ce("react.fragment")}var ht=yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,bt=Object.prototype.hasOwnProperty,St={key:!0,ref:!0,__self:!0,__source:!0};function Me(i,t,a){var r,e={},o=null,c=null;a!==void 0&&(o=""+a),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(c=t.ref);for(r in t)bt.call(t,r)&&!St.hasOwnProperty(r)&&(e[r]=t[r]);if(i&&i.defaultProps)for(r in t=i.defaultProps,t)e[r]===void 0&&(e[r]=t[r]);return{$$typeof:Re,type:i,key:o,ref:c,props:e,_owner:ht.current}}te.jsx=Me;te.jsxs=Me;ge.exports=te;const M=ge.exports.jsx,Le=ge.exports.jsxs;function kt(i){const{setOperationName:t}=ce.useEditorContext({nonNull:!0}),{schema:a}=ce.useSchemaContext({nonNull:!0}),{run:r}=ce.useExecutionContext({nonNull:!0});return M(ft,{schema:a,onRunOperation:e=>{e&&t(e),r()},explorerIsOpen:!0,colors:{keyword:"hsl(var(--color-primary))",def:"hsl(var(--color-tertiary))",property:"hsl(var(--color-info))",qualifier:"hsl(var(--color-secondary))",attribute:"hsl(var(--color-info))",number:"hsl(var(--color-success))",string:"hsl(var(--color-warning))",builtin:"hsl(var(--color-success))",string2:"hsl(var(--color-secondary))",variable:"hsl(var(--color-secondary))",atom:"hsl(var(--color-tertiary))"},arrowOpen:M("svg",{viewBox:"0 -4 13 15",style:{color:"hsla(var(--color-neutral), 0.4)",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:M("path",{d:"M3.35355 6.85355L6.14645 9.64645C6.34171 9.84171 6.65829 9.84171 6.85355 9.64645L9.64645 6.85355C9.96143 6.53857 9.73835 6 9.29289 6L3.70711 6C3.26165 6 3.03857 6.53857 3.35355 6.85355Z",fill:"currentColor"})}),arrowClosed:M("svg",{viewBox:"0 -2 13 15",style:{color:"hsla(var(--color-neutral), 0.4)",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:M("path",{d:"M6.35355 11.1464L9.14645 8.35355C9.34171 8.15829 9.34171 7.84171 9.14645 7.64645L6.35355 4.85355C6.03857 4.53857 5.5 4.76165 5.5 5.20711V10.7929C5.5 11.2383 6.03857 11.4614 6.35355 11.1464Z",fill:"currentColor"})}),checkboxUnchecked:M("svg",{viewBox:"0 0 15 15",style:{color:"hsla(var(--color-neutral), 0.4)",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:M("circle",{cx:"7.5",cy:"7.5",r:"6",stroke:"currentColor",fill:"none"})}),checkboxChecked:Le("svg",{viewBox:"0 0 15 15",style:{color:"hsl(var(--color-info))",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:[M("circle",{cx:"7.5",cy:"7.5",r:"7.5",fill:"currentColor"}),M("path",{d:"M4.64641 7.00106L6.8801 9.23256L10.5017 5.61325",fill:"none",stroke:"white",strokeWidth:"1.5"})]}),styles:{buttonStyle:{backgroundColor:"transparent",border:"none",color:"hsla(var(--color-neutral), 0.6)",cursor:"pointer",fontSize:"1em"},explorerActionsStyle:{padding:"var(--px-8) var(--px-4)"},actionButtonStyle:{backgroundColor:"transparent",border:"none",color:"hsla(var(--color-neutral), 0.6)",cursor:"pointer",fontSize:"1em"}},...i})}function _t(i){const t=fe.useRef(i);return t.current=i,fe.useMemo(()=>({title:"GraphiQL Explorer",icon:()=>Le("svg",{height:"1em",strokeWidth:"1.5",viewBox:"0 0 24 24",fill:"none",children:[M("path",{d:"M18 6H20M22 6H20M20 6V4M20 6V8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),M("path",{d:"M21.4 20H2.6C2.26863 20 2 19.7314 2 19.4V11H21.4C21.7314 11 22 11.2686 22 11.6V19.4C22 19.7314 21.7314 20 21.4 20Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),M("path",{d:"M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]}),content:()=>M(kt,{...t.current})}),[])}exports.useExplorerPlugin=_t; |
@@ -1,6 +0,7 @@ | ||
(function(N,j){typeof exports=="object"&&typeof module!="undefined"?j(exports,require("@graphiql/react"),require("react"),require("graphql")):typeof define=="function"&&define.amd?define(["exports","@graphiql/react","react","graphql"],j):(N=typeof globalThis!="undefined"?globalThis:N||self,j(N.GraphiQLPluginExplorer={},N.GraphiQL.React,N.React,N.GraphiQL.GraphQL))})(this,function(N,j,M,Ue){"use strict";var wt=Object.defineProperty;var qe=Object.getOwnPropertySymbols;var xt=Object.prototype.hasOwnProperty,Ft=Object.prototype.propertyIsEnumerable;var Be=(N,j,M)=>j in N?wt(N,j,{enumerable:!0,configurable:!0,writable:!0,value:M}):N[j]=M,he=(N,j)=>{for(var M in j||(j={}))xt.call(j,M)&&Be(N,M,j[M]);if(qe)for(var M of qe(j))Ft.call(j,M)&&Be(N,M,j[M]);return N};function be(i){if(i&&i.__esModule)return i;var t={__proto__:null,[Symbol.toStringTag]:"Module"};return i&&Object.keys(i).forEach(function(a){if(a!=="default"){var n=Object.getOwnPropertyDescriptor(i,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return i[a]}})}}),t.default=i,Object.freeze(t)}var He=be(M),ze=be(Ue);function Se(i){return i&&Object.prototype.hasOwnProperty.call(i,"default")&&Object.keys(i).length===1?i.default:i}var ae={},oe={},ke=Se(He),Ge=Se(ze);Object.defineProperty(oe,"__esModule",{value:!0});var We=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},_e=function(){function i(t,a){var n=[],e=!0,o=!1,c=void 0;try{for(var f=t[Symbol.iterator](),u;!(e=(u=f.next()).done)&&(n.push(u.value),!(a&&n.length===a));e=!0);}catch(r){o=!0,c=r}finally{try{!e&&f.return&&f.return()}finally{if(o)throw c}}return n}return function(t,a){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return i(t,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),k=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(i[n]=a[n])}return i},B=function(){function i(t,a){for(var n=0;n<a.length;n++){var e=a[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}return function(t,a,n){return a&&i(t.prototype,a),n&&i(t,n),t}}();oe.defaultValue=ce;var Qe=ke,l=$e(Qe),v=Ge;function $e(i){if(i&&i.__esModule)return i;var t={};if(i!=null)for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a]);return t.default=i,t}function Ce(i,t,a){return t in i?Object.defineProperty(i,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[t]=a,i}function q(i){if(Array.isArray(i)){for(var t=0,a=Array(i.length);t<i.length;t++)a[t]=i[t];return a}else return Array.from(i)}function U(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function w(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function H(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}function pe(i){return i.charAt(0).toUpperCase()+i.slice(1)}var Ze={keyword:"#B11A04",def:"#D2054E",property:"#1F61A0",qualifier:"#1C92A9",attribute:"#8B2BB9",number:"#2882F9",string:"#D64292",builtin:"#D47509",string2:"#0B7FC7",variable:"#397D13",atom:"#CA9800"},Ke=l.createElement("svg",{width:"12",height:"9"},l.createElement("path",{fill:"#666",d:"M 0 2 L 9 2 L 4.5 7.5 z"})),Je=l.createElement("svg",{width:"12",height:"9"},l.createElement("path",{fill:"#666",d:"M 0 0 L 0 9 L 5.5 4.5 z"})),Ye=l.createElement("svg",{style:{marginRight:"3px",marginLeft:"-3px"},width:"12",height:"12",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M16 0H2C0.9 0 0 0.9 0 2V16C0 17.1 0.9 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0ZM16 16H2V2H16V16ZM14.99 6L13.58 4.58L6.99 11.17L4.41 8.6L2.99 10.01L6.99 14L14.99 6Z",fill:"#666"})),Xe=l.createElement("svg",{style:{marginRight:"3px",marginLeft:"-3px"},width:"12",height:"12",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M16 2V16H2V2H16ZM16 0H2C0.9 0 0 0.9 0 2V16C0 17.1 0.9 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0Z",fill:"#CCC"}));function le(i){return i.checked?i.styleConfig.checkboxChecked:i.styleConfig.checkboxUnchecked}function Ee(i){var t=i.getFields();if(t.id){var a=["id"];return t.email?a.push("email"):t.name&&a.push("name"),a}if(t.edges)return["edges"];if(t.node)return["node"];if(t.nodes)return["nodes"];var n=[];return Object.keys(t).forEach(function(e){(0,v.isLeafType)(t[e].type)&&n.push(e)}),n.length?n.slice(0,2):["__typename"]}function Ae(i){return(0,v.isNonNullType)(i.type)&&i.defaultValue===void 0}function et(i){for(var t=i;(0,v.isWrappingType)(t);)t=t.ofType;return t}function $(i){for(var t=i;(0,v.isWrappingType)(t);)t=t.ofType;return t}function Oe(i,t){if(typeof t!="string"&&t.kind==="VariableDefinition")return t.variable;if((0,v.isScalarType)(i))try{switch(i.name){case"String":return{kind:"StringValue",value:String(i.parseValue(t))};case"Float":return{kind:"FloatValue",value:String(i.parseValue(parseFloat(t)))};case"Int":return{kind:"IntValue",value:String(i.parseValue(parseInt(t,10)))};case"Boolean":try{var a=JSON.parse(t);return typeof a=="boolean"?{kind:"BooleanValue",value:a}:{kind:"BooleanValue",value:!1}}catch{return{kind:"BooleanValue",value:!1}}default:return{kind:"StringValue",value:String(i.parseValue(t))}}}catch(e){return console.error("error coercing arg value",e,t),{kind:"StringValue",value:t}}else try{var n=i.parseValue(t);return n?{kind:"EnumValue",value:String(n)}:{kind:"EnumValue",value:i.getValues()[0].name}}catch{return{kind:"EnumValue",value:i.getValues()[0].name}}}var tt=function(i){H(t,i);function t(){var a,n,e,o;U(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=w(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._getArgSelection=function(){return e.props.selection.fields.find(function(r){return r.name.value===e.props.arg.name})},e._removeArg=function(){var r=e.props.selection,s=e._getArgSelection();e._previousArgSelection=s,e.props.modifyFields(r.fields.filter(function(p){return p!==s}),!0)},e._addArg=function(){var r=e.props,s=r.selection,p=r.arg,m=r.getDefaultScalarArgValue,h=r.parentField,x=r.makeDefaultArg,d=$(p.type),b=null;if(e._previousArgSelection)b=e._previousArgSelection;else if((0,v.isInputObjectType)(d)){var g=d.getFields();b={kind:"ObjectField",name:{kind:"Name",value:p.name},value:{kind:"ObjectValue",fields:se(m,x,h,Object.keys(g).map(function(_){return g[_]}))}}}else(0,v.isLeafType)(d)&&(b={kind:"ObjectField",name:{kind:"Name",value:p.name},value:m(h,p,d)});if(!b)console.error("Unable to add arg for argType",d);else return e.props.modifyFields([].concat(q(s.fields||[]),[b]),!0)},e._setArgValue=function(r,s){var p=!1,m=!1,h=!1;try{r.kind==="VariableDefinition"?m=!0:r===null||typeof r=="undefined"?p=!0:typeof r.kind=="string"&&(h=!0)}catch{}var x=e.props.selection,d=e._getArgSelection();if(!d){console.error("missing arg selection when setting arg value");return}var b=$(e.props.arg.type),g=(0,v.isLeafType)(b)||m||p||h;if(!g){console.warn("Unable to handle non leaf types in InputArgView.setArgValue",r);return}var _=void 0,E=void 0;r===null||typeof r=="undefined"?E=null:!r.target&&!!r.kind&&r.kind==="VariableDefinition"?(_=r,E=_.variable):typeof r.kind=="string"?E=r:r.target&&typeof r.target.value=="string"&&(_=r.target.value,E=Oe(b,_));var A=e.props.modifyFields((x.fields||[]).map(function(V){var z=V===d,I=z?k({},V,{value:E}):V;return I}),s);return A},e._modifyChildFields=function(r){return e.props.modifyFields(e.props.selection.fields.map(function(s){return s.name.value===e.props.arg.name?k({},s,{value:{kind:"ObjectValue",fields:r}}):s}),!0)},n),w(e,o)}return B(t,[{key:"render",value:function(){var n=this.props,e=n.arg,o=n.parentField,c=this._getArgSelection();return l.createElement(xe,{argValue:c?c.value:null,arg:e,parentField:o,addArg:this._addArg,removeArg:this._removeArg,setArgFields:this._modifyChildFields,setArgValue:this._setArgValue,getDefaultScalarArgValue:this.props.getDefaultScalarArgValue,makeDefaultArg:this.props.makeDefaultArg,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig,onCommit:this.props.onCommit,definition:this.props.definition})}}]),t}(l.PureComponent);function ce(i){if((0,v.isEnumType)(i))return{kind:"EnumValue",value:i.getValues()[0].name};switch(i.name){case"String":return{kind:"StringValue",value:""};case"Float":return{kind:"FloatValue",value:"1.5"};case"Int":return{kind:"IntValue",value:"10"};case"Boolean":return{kind:"BooleanValue",value:!1};default:return{kind:"StringValue",value:""}}}function we(i,t,a){return ce(a)}var nt=function(i){H(t,i);function t(){var a,n,e,o;U(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=w(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._getArgSelection=function(){var r=e.props.selection;return(r.arguments||[]).find(function(s){return s.name.value===e.props.arg.name})},e._removeArg=function(r){var s=e.props.selection,p=e._getArgSelection();return e._previousArgSelection=p,e.props.modifyArguments((s.arguments||[]).filter(function(m){return m!==p}),r)},e._addArg=function(r){var s=e.props,p=s.selection,m=s.getDefaultScalarArgValue,h=s.makeDefaultArg,x=s.parentField,d=s.arg,b=$(d.type),g=null;if(e._previousArgSelection)g=e._previousArgSelection;else if((0,v.isInputObjectType)(b)){var _=b.getFields();g={kind:"Argument",name:{kind:"Name",value:d.name},value:{kind:"ObjectValue",fields:se(m,h,x,Object.keys(_).map(function(E){return _[E]}))}}}else(0,v.isLeafType)(b)&&(g={kind:"Argument",name:{kind:"Name",value:d.name},value:m(x,d,b)});return g?e.props.modifyArguments([].concat(q(p.arguments||[]),[g]),r):(console.error("Unable to add arg for argType",b),null)},e._setArgValue=function(r,s){var p=!1,m=!1,h=!1;try{r.kind==="VariableDefinition"?m=!0:r===null||typeof r=="undefined"?p=!0:typeof r.kind=="string"&&(h=!0)}catch{}var x=e.props.selection,d=e._getArgSelection();if(!d&&!m){console.error("missing arg selection when setting arg value");return}var b=$(e.props.arg.type),g=(0,v.isLeafType)(b)||m||p||h;if(!g){console.warn("Unable to handle non leaf types in ArgView._setArgValue");return}var _=void 0,E=void 0;return r===null||typeof r=="undefined"?E=null:r.target&&typeof r.target.value=="string"?(_=r.target.value,E=Oe(b,_)):!r.target&&r.kind==="VariableDefinition"?(_=r,E=_.variable):typeof r.kind=="string"&&(E=r),e.props.modifyArguments((x.arguments||[]).map(function(A){return A===d?k({},A,{value:E}):A}),s)},e._setArgFields=function(r,s){var p=e.props.selection,m=e._getArgSelection();if(!m){console.error("missing arg selection when setting arg value");return}return e.props.modifyArguments((p.arguments||[]).map(function(h){return h===m?k({},h,{value:{kind:"ObjectValue",fields:r}}):h}),s)},n),w(e,o)}return B(t,[{key:"render",value:function(){var n=this.props,e=n.arg,o=n.parentField,c=this._getArgSelection();return l.createElement(xe,{argValue:c?c.value:null,arg:e,parentField:o,addArg:this._addArg,removeArg:this._removeArg,setArgFields:this._setArgFields,setArgValue:this._setArgValue,getDefaultScalarArgValue:this.props.getDefaultScalarArgValue,makeDefaultArg:this.props.makeDefaultArg,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig,onCommit:this.props.onCommit,definition:this.props.definition})}}]),t}(l.PureComponent);function rt(i){return i.ctrlKey&&i.key==="Enter"}function it(i){return i!=="FragmentDefinition"}var at=function(i){H(t,i);function t(){var a,n,e,o;U(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=w(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._handleChange=function(r){e.props.setArgValue(r,!0)},n),w(e,o)}return B(t,[{key:"componentDidMount",value:function(){var n=this._ref,e=document.activeElement;n&&e&&!(e instanceof HTMLTextAreaElement)&&(n.focus(),n.setSelectionRange(0,n.value.length))}},{key:"render",value:function(){var n=this,e=this.props,o=e.arg,c=e.argValue,f=e.styleConfig,u=$(o.type),r=typeof c.value=="string"?c.value:"",s=this.props.argValue.kind==="StringValue"?f.colors.string:f.colors.number;return l.createElement("span",{style:{color:s}},u.name==="String"?'"':"",l.createElement("input",{style:{border:"none",borderBottom:"1px solid #888",outline:"none",width:Math.max(1,Math.min(15,r.length))+"ch",color:s},ref:function(m){n._ref=m},type:"text",onChange:this._handleChange,value:r}),u.name==="String"?'"':"")}}]),t}(l.PureComponent),xe=function(i){H(t,i);function t(){var a,n,e,o;U(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=w(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={displayArgActions:!1},n),w(e,o)}return B(t,[{key:"render",value:function(){var n=this,e=this.props,o=e.argValue,c=e.arg,f=e.styleConfig,u=$(c.type),r=null;if(o){if(o.kind==="Variable")r=l.createElement("span",{style:{color:f.colors.variable}},"$",o.name.value);else if((0,v.isScalarType)(u))u.name==="Boolean"?r=l.createElement("select",{style:{color:f.colors.builtin},onChange:this.props.setArgValue,value:o.kind==="BooleanValue"?o.value:void 0},l.createElement("option",{key:"true",value:"true"},"true"),l.createElement("option",{key:"false",value:"false"},"false")):r=l.createElement(at,{setArgValue:this.props.setArgValue,arg:c,argValue:o,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig});else if((0,v.isEnumType)(u))o.kind==="EnumValue"?r=l.createElement("select",{style:{backgroundColor:"white",color:f.colors.string2},onChange:this.props.setArgValue,value:o.value},u.getValues().map(function(d){return l.createElement("option",{key:d.name,value:d.name},d.name)})):console.error("arg mismatch between arg and selection",u,o);else if((0,v.isInputObjectType)(u))if(o.kind==="ObjectValue"){var s=u.getFields();r=l.createElement("div",{style:{marginLeft:16}},Object.keys(s).sort().map(function(d){return l.createElement(tt,{key:d,arg:s[d],parentField:n.props.parentField,selection:o,modifyFields:n.props.setArgFields,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition})}))}else console.error("arg mismatch between arg and selection",u,o)}var p=function(){var b=c.name,g=(n.props.definition.variableDefinitions||[]).filter(function(C){return C.variable.name.value.startsWith(b)}).length,_=void 0;g>0?_=""+b+g:_=b;var E=c.type.toString(),A=(0,v.parseType)(E),V={kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:_}},type:A,directives:[]},z=function(F){return(n.props.definition.variableDefinitions||[]).find(function(T){return T.variable.name.value===F})},I=void 0,Q={};if(typeof o!="undefined"&&o!==null){var G=(0,v.visit)(o,{Variable:function(F){var T=F.name.value,J=z(T);if(Q[T]=Q[T]+1||1,!!J)return J.defaultValue}}),K=V.type.kind==="NonNullType",L=K?k({},V,{type:V.type.type}):V;I=k({},L,{defaultValue:G})}else I=V;var te=Object.entries(Q).filter(function(C){var F=_e(C,2);F[0];var T=F[1];return T<2}).map(function(C){var F=_e(C,2),T=F[0];return F[1],T});if(I){var X=n.props.setArgValue(I,!1);if(X){var ne=X.definitions.find(function(C){return!!C.operation&&!!C.name&&!!C.name.value&&!!n.props.definition.name&&!!n.props.definition.name.value?C.name.value===n.props.definition.name.value:!1}),y=[].concat(q(ne.variableDefinitions||[]),[I]).filter(function(C){return te.indexOf(C.variable.name.value)===-1}),S=k({},ne,{variableDefinitions:y}),O=X.definitions,D=O.map(function(C){return ne===C?S:C}),R=k({},X,{definitions:D});n.props.onCommit(R)}}},m=function(){if(!(!o||!o.name||!o.name.value)){var b=o.name.value,g=(n.props.definition.variableDefinitions||[]).find(function(L){return L.variable.name.value===b});if(!!g){var _=g.defaultValue,E=n.props.setArgValue(_,{commit:!1});if(E){var A=E.definitions.find(function(L){return L.name.value===n.props.definition.name.value});if(!A)return;var V=0;(0,v.visit)(A,{Variable:function(te){te.name.value===b&&(V=V+1)}});var z=A.variableDefinitions||[];V<2&&(z=z.filter(function(L){return L.variable.name.value!==b}));var I=k({},A,{variableDefinitions:z}),Q=E.definitions,G=Q.map(function(L){return A===L?I:L}),K=k({},E,{definitions:G});n.props.onCommit(K)}}}},h=o&&o.kind==="Variable",x=this.state.displayArgActions?l.createElement("button",{type:"submit",className:"toolbar-button",title:h?"Remove the variable":"Extract the current value into a GraphQL variable",onClick:function(b){b.preventDefault(),b.stopPropagation(),h?m():p()},style:f.styles.actionButtonStyle},l.createElement("span",{style:{color:f.colors.variable}},"$")):null;return l.createElement("div",{style:{cursor:"pointer",minHeight:"16px",WebkitUserSelect:"none",userSelect:"none"},"data-arg-name":c.name,"data-arg-type":u.name,className:"graphiql-explorer-"+c.name},l.createElement("span",{style:{cursor:"pointer"},onClick:function(b){var g=!o;g?n.props.addArg(!0):n.props.removeArg(!0),n.setState({displayArgActions:g})}},(0,v.isInputObjectType)(u)?l.createElement("span",null,o?this.props.styleConfig.arrowOpen:this.props.styleConfig.arrowClosed):l.createElement(le,{checked:!!o,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:f.colors.attribute},title:c.description,onMouseEnter:function(){o!==null&&typeof o!="undefined"&&n.setState({displayArgActions:!0})},onMouseLeave:function(){return n.setState({displayArgActions:!1})}},c.name,Ae(c)?"*":"",": ",x," ")," "),r||l.createElement("span",null)," ")}}]),t}(l.PureComponent),ot=function(i){H(t,i);function t(){var a,n,e,o;U(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=w(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._addFragment=function(){e.props.modifySelections([].concat(q(e.props.selections),[e._previousSelection||{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.props.implementingType.name}},selectionSet:{kind:"SelectionSet",selections:e.props.getDefaultFieldNames(e.props.implementingType).map(function(r){return{kind:"Field",name:{kind:"Name",value:r}}})}}]))},e._removeFragment=function(){var r=e._getSelection();e._previousSelection=r,e.props.modifySelections(e.props.selections.filter(function(s){return s!==r}))},e._getSelection=function(){var r=e.props.selections.find(function(s){return s.kind==="InlineFragment"&&s.typeCondition&&e.props.implementingType.name===s.typeCondition.name.value});if(!r)return null;if(r.kind==="InlineFragment")return r},e._modifyChildSelections=function(r,s){var p=e._getSelection();return e.props.modifySelections(e.props.selections.map(function(m){return m===p?{directives:m.directives,kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.props.implementingType.name}},selectionSet:{kind:"SelectionSet",selections:r}}:m}),s)},n),w(e,o)}return B(t,[{key:"render",value:function(){var n=this,e=this.props,o=e.implementingType,c=e.schema,f=e.getDefaultFieldNames,u=e.styleConfig,r=this._getSelection(),s=o.getFields(),p=r?r.selectionSet?r.selectionSet.selections:[]:[];return l.createElement("div",{className:"graphiql-explorer-"+o.name},l.createElement("span",{style:{cursor:"pointer"},onClick:r?this._removeFragment:this._addFragment},l.createElement(le,{checked:!!r,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:u.colors.atom}},this.props.implementingType.name)),r?l.createElement("div",{style:{marginLeft:16}},Object.keys(s).sort().map(function(m){return l.createElement(De,{key:m,field:s[m],selections:p,modifySelections:n._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,onCommit:n.props.onCommit,styleConfig:n.props.styleConfig,definition:n.props.definition,availableFragments:n.props.availableFragments})})):null)}}]),t}(l.PureComponent),lt=function(i){H(t,i);function t(){var a,n,e,o;U(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=w(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._addFragment=function(){e.props.modifySelections([].concat(q(e.props.selections),[e._previousSelection||{kind:"FragmentSpread",name:e.props.fragment.name}]))},e._removeFragment=function(){var r=e._getSelection();e._previousSelection=r,e.props.modifySelections(e.props.selections.filter(function(s){var p=s.kind==="FragmentSpread"&&s.name.value===e.props.fragment.name.value;return!p}))},e._getSelection=function(){var r=e.props.selections.find(function(s){return s.kind==="FragmentSpread"&&s.name.value===e.props.fragment.name.value});return r},n),w(e,o)}return B(t,[{key:"render",value:function(){var n=this.props.styleConfig,e=this._getSelection();return l.createElement("div",{className:"graphiql-explorer-"+this.props.fragment.name.value},l.createElement("span",{style:{cursor:"pointer"},onClick:e?this._removeFragment:this._addFragment},l.createElement(le,{checked:!!e,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:n.colors.def},className:"graphiql-explorer-"+this.props.fragment.name.value},this.props.fragment.name.value)))}}]),t}(l.PureComponent);function se(i,t,a,n){var e=[],o=!0,c=!1,f=void 0;try{for(var u=n[Symbol.iterator](),r;!(o=(r=u.next()).done);o=!0){var s=r.value;if((0,v.isRequiredInputField)(s)||t&&t(a,s)){var p=$(s.type);(0,v.isInputObjectType)(p)?function(){var m=p.getFields();e.push({kind:"ObjectField",name:{kind:"Name",value:s.name},value:{kind:"ObjectValue",fields:se(i,t,a,Object.keys(m).map(function(h){return m[h]}))}})}():(0,v.isLeafType)(p)&&e.push({kind:"ObjectField",name:{kind:"Name",value:s.name},value:i(a,s,p)})}}}catch(m){c=!0,f=m}finally{try{!o&&u.return&&u.return()}finally{if(c)throw f}}return e}function Fe(i,t,a){var n=[],e=!0,o=!1,c=void 0;try{for(var f=a.args[Symbol.iterator](),u;!(e=(u=f.next()).done);e=!0){var r=u.value;if(Ae(r)||t&&t(a,r)){var s=$(r.type);(0,v.isInputObjectType)(s)?function(){var p=s.getFields();n.push({kind:"Argument",name:{kind:"Name",value:r.name},value:{kind:"ObjectValue",fields:se(i,t,a,Object.keys(p).map(function(m){return p[m]}))}})}():(0,v.isLeafType)(s)&&n.push({kind:"Argument",name:{kind:"Name",value:r.name},value:i(a,r,s)})}}}catch(p){o=!0,c=p}finally{try{!e&&f.return&&f.return()}finally{if(o)throw c}}return n}var De=function(i){H(t,i);function t(){var a,n,e,o;U(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=w(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={displayFieldActions:!1},e._addAllFieldsToSelections=function(r){var s=r?Object.keys(r).map(function(h){return{kind:"Field",name:{kind:"Name",value:h},arguments:[]}}):[],p={kind:"SelectionSet",selections:s},m=[].concat(q(e.props.selections.filter(function(h){return h.kind==="InlineFragment"?!0:h.name.value!==e.props.field.name})),[{kind:"Field",name:{kind:"Name",value:e.props.field.name},arguments:Fe(e.props.getDefaultScalarArgValue,e.props.makeDefaultArg,e.props.field),selectionSet:p}]);e.props.modifySelections(m)},e._addFieldToSelections=function(r){var s=[].concat(q(e.props.selections),[e._previousSelection||{kind:"Field",name:{kind:"Name",value:e.props.field.name},arguments:Fe(e.props.getDefaultScalarArgValue,e.props.makeDefaultArg,e.props.field)}]);e.props.modifySelections(s)},e._handleUpdateSelections=function(r){var s=e._getSelection();if(s&&!r.altKey)e._removeFieldFromSelections();else{var p=(0,v.getNamedType)(e.props.field.type),m=(0,v.isObjectType)(p)&&p.getFields(),h=!!m&&r.altKey;h?e._addAllFieldsToSelections(m):e._addFieldToSelections(m)}},e._removeFieldFromSelections=function(){var r=e._getSelection();e._previousSelection=r,e.props.modifySelections(e.props.selections.filter(function(s){return s!==r}))},e._getSelection=function(){var r=e.props.selections.find(function(s){return s.kind==="Field"&&e.props.field.name===s.name.value});if(!r)return null;if(r.kind==="Field")return r},e._setArguments=function(r,s){var p=e._getSelection();if(!p){console.error("Missing selection when setting arguments",r);return}return e.props.modifySelections(e.props.selections.map(function(m){return m===p?{alias:p.alias,arguments:r,directives:p.directives,kind:"Field",name:p.name,selectionSet:p.selectionSet}:m}),s)},e._modifyChildSelections=function(r,s){return e.props.modifySelections(e.props.selections.map(function(p){if(p.kind==="Field"&&e.props.field.name===p.name.value){if(p.kind!=="Field")throw new Error("invalid selection");return{alias:p.alias,arguments:p.arguments,directives:p.directives,kind:"Field",name:p.name,selectionSet:{kind:"SelectionSet",selections:r}}}return p}),s)},n),w(e,o)}return B(t,[{key:"render",value:function(){var n=this,e=this.props,o=e.field,c=e.schema,f=e.getDefaultFieldNames,u=e.styleConfig,r=this._getSelection(),s=et(o.type),p=o.args.sort(function(g,_){return g.name.localeCompare(_.name)}),m="graphiql-explorer-node graphiql-explorer-"+o.name;o.isDeprecated&&(m+=" graphiql-explorer-deprecated");var h=(0,v.isObjectType)(s)||(0,v.isInterfaceType)(s)||(0,v.isUnionType)(s)?this.props.availableFragments&&this.props.availableFragments[s.name]:null,x=l.createElement("div",{className:m},l.createElement("span",{title:o.description,style:{cursor:"pointer",display:"inline-flex",alignItems:"center",minHeight:"16px",WebkitUserSelect:"none",userSelect:"none"},"data-field-name":o.name,"data-field-type":s.name,onClick:this._handleUpdateSelections,onMouseEnter:function(){var _=(0,v.isObjectType)(s)&&r&&r.selectionSet&&r.selectionSet.selections.filter(function(E){return E.kind!=="FragmentSpread"}).length>0;_&&n.setState({displayFieldActions:!0})},onMouseLeave:function(){return n.setState({displayFieldActions:!1})}},(0,v.isObjectType)(s)?l.createElement("span",null,r?this.props.styleConfig.arrowOpen:this.props.styleConfig.arrowClosed):null,(0,v.isObjectType)(s)?null:l.createElement(le,{checked:!!r,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:u.colors.property},className:"graphiql-explorer-field-view"},o.name),this.state.displayFieldActions?l.createElement("button",{type:"submit",className:"toolbar-button",title:"Extract selections into a new reusable fragment",onClick:function(_){_.preventDefault(),_.stopPropagation();var E=s.name,A=E+"Fragment",V=(h||[]).filter(function(L){return L.name.value.startsWith(A)}).length;V>0&&(A=""+A+V);var z=r?r.selectionSet?r.selectionSet.selections:[]:[],I=[{kind:"FragmentSpread",name:{kind:"Name",value:A},directives:[]}],Q={kind:"FragmentDefinition",name:{kind:"Name",value:A},typeCondition:{kind:"NamedType",name:{kind:"Name",value:s.name}},directives:[],selectionSet:{kind:"SelectionSet",selections:z}},G=n._modifyChildSelections(I,!1);if(G){var K=k({},G,{definitions:[].concat(q(G.definitions),[Q])});n.props.onCommit(K)}else console.warn("Unable to complete extractFragment operation")},style:k({},u.styles.actionButtonStyle)},l.createElement("span",null,"\u2026")):null),r&&p.length?l.createElement("div",{style:{marginLeft:16},className:"graphiql-explorer-graphql-arguments"},p.map(function(g){return l.createElement(nt,{key:g.name,parentField:o,arg:g,selection:r,modifyArguments:n._setArguments,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition})})):null);if(r&&((0,v.isObjectType)(s)||(0,v.isInterfaceType)(s)||(0,v.isUnionType)(s))){var d=(0,v.isUnionType)(s)?{}:s.getFields(),b=r?r.selectionSet?r.selectionSet.selections:[]:[];return l.createElement("div",{className:"graphiql-explorer-"+o.name},x,l.createElement("div",{style:{marginLeft:16}},h?h.map(function(g){var _=c.getType(g.typeCondition.name.value),E=g.name.value;return _?l.createElement(lt,{key:E,fragment:g,selections:b,modifySelections:n._modifyChildSelections,schema:c,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit}):null}):null,Object.keys(d).sort().map(function(g){return l.createElement(t,{key:g,field:d[g],selections:b,modifySelections:n._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition,availableFragments:n.props.availableFragments})}),(0,v.isInterfaceType)(s)||(0,v.isUnionType)(s)?c.getPossibleTypes(s).map(function(g){return l.createElement(ot,{key:g.name,implementingType:g,selections:b,modifySelections:n._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition})}):null))}return x}}]),t}(l.PureComponent);function st(i){try{return i.trim()?(0,v.parse)(i,{noLocation:!0}):null}catch(t){return new Error(t)}}var ut={kind:"OperationDefinition",operation:"query",variableDefinitions:[],name:{kind:"Name",value:"MyQuery"},directives:[],selectionSet:{kind:"SelectionSet",selections:[]}},ue={kind:"Document",definitions:[ut]},Y=null;function pt(i){if(Y&&Y[0]===i)return Y[1];var t=st(i);return t?t instanceof Error?Y?Y[1]:ue:(Y=[i,t],t):ue}var Ve={buttonStyle:{fontSize:"1.2em",padding:"0px",backgroundColor:"white",border:"none",margin:"5px 0px",height:"40px",width:"100%",display:"block",maxWidth:"none"},actionButtonStyle:{padding:"0px",backgroundColor:"white",border:"none",margin:"0px",maxWidth:"none",height:"15px",width:"15px",display:"inline-block",fontSize:"smaller"},explorerActionsStyle:{margin:"4px -8px -8px",paddingLeft:"8px",bottom:"0px",width:"100%",textAlign:"center",background:"none",borderTop:"none",borderBottom:"none"}},ct=function(i){H(t,i);function t(){var a,n,e,o;U(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=w(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={newOperationType:"query",displayTitleActions:!1},e._modifySelections=function(r,s){var p=e.props.definition;p.selectionSet.selections.length===0&&e._previousOperationDef&&(p=e._previousOperationDef);var m=void 0;if(p.kind==="FragmentDefinition")m=k({},p,{selectionSet:k({},p.selectionSet,{selections:r})});else if(p.kind==="OperationDefinition"){var h=r.filter(function(x){return!(x.kind==="Field"&&x.name.value==="__typename")});h.length===0&&(h=[{kind:"Field",name:{kind:"Name",value:"__typename ## Placeholder value"}}]),m=k({},p,{selectionSet:k({},p.selectionSet,{selections:h})})}return e.props.onEdit(m,s)},e._onOperationRename=function(r){return e.props.onOperationRename(r.target.value)},e._handlePotentialRun=function(r){rt(r)&&it(e.props.definition.kind)&&e.props.onRunOperation(e.props.name)},e._rootViewElId=function(){var r=e.props,s=r.operationType,p=r.name,m=s+"-"+(p||"unknown");return m},n),w(e,o)}return B(t,[{key:"componentDidMount",value:function(){var n=this._rootViewElId();this.props.onMount(n)}},{key:"render",value:function(){var n=this,e=this.props,o=e.operationType,c=e.definition,f=e.schema,u=e.getDefaultFieldNames,r=e.styleConfig,s=this._rootViewElId(),p=this.props.fields||{},m=c,h=m.selectionSet.selections,x=this.props.name||pe(o)+" Name";return l.createElement("div",{id:s,tabIndex:"0",onKeyDown:this._handlePotentialRun,style:{borderBottom:this.props.isLast?"none":"1px solid #d6d6d6",marginBottom:"0em",paddingBottom:"1em"}},l.createElement("div",{style:{color:r.colors.keyword,paddingBottom:4},className:"graphiql-operation-title-bar",onMouseEnter:function(){return n.setState({displayTitleActions:!0})},onMouseLeave:function(){return n.setState({displayTitleActions:!1})}},o," ",l.createElement("span",{style:{color:r.colors.def}},l.createElement("input",{style:{color:r.colors.def,border:"none",borderBottom:"1px solid #888",outline:"none",width:Math.max(4,x.length)+"ch"},autoComplete:"false",placeholder:pe(o)+" Name",value:this.props.name,onKeyDown:this._handlePotentialRun,onChange:this._onOperationRename})),this.props.onTypeName?l.createElement("span",null,l.createElement("br",null),"on "+this.props.onTypeName):"",this.state.displayTitleActions?l.createElement(l.Fragment,null,l.createElement("button",{type:"submit",className:"toolbar-button",onClick:function(){return n.props.onOperationDestroy()},style:k({},r.styles.actionButtonStyle)},l.createElement("span",null,"\u2715")),l.createElement("button",{type:"submit",className:"toolbar-button",onClick:function(){return n.props.onOperationClone()},style:k({},r.styles.actionButtonStyle)},l.createElement("span",null,"\u2398"))):""),Object.keys(p).sort().map(function(d){return l.createElement(De,{key:d,field:p[d],selections:h,modifySelections:n._modifySelections,schema:f,getDefaultFieldNames:u,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition,availableFragments:n.props.availableFragments})}))}}]),t}(l.PureComponent);function ft(){return l.createElement("div",{style:{fontFamily:"sans-serif",display:"flex",flexDirection:"column",alignItems:"center",margin:"1em",marginTop:0,flexGrow:1,justifyContent:"flex-end"}},l.createElement("div",{style:{borderTop:"1px solid #d6d6d6",paddingTop:"1em",width:"100%",textAlign:"center"}},"GraphiQL Explorer by ",l.createElement("a",{href:"https://www.onegraph.com"},"OneGraph")),l.createElement("div",null,"Contribute on"," ",l.createElement("a",{href:"https://github.com/OneGraph/graphiql-explorer"},"GitHub")))}var Te=function(i){H(t,i);function t(){var a,n,e,o;U(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=w(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={newOperationType:"query",operation:null,operationToScrollTo:null},e._resetScroll=function(){var r=e._ref;r&&(r.scrollLeft=0)},e._onEdit=function(r){return e.props.onEdit(r)},e._setAddOperationType=function(r){e.setState({newOperationType:r})},e._handleRootViewMount=function(r){if(!!e.state.operationToScrollTo&&e.state.operationToScrollTo===r){var s=".graphiql-explorer-root #"+r,p=document.querySelector(s);p&&p.scrollIntoView()}},n),w(e,o)}return B(t,[{key:"componentDidMount",value:function(){this._resetScroll()}},{key:"render",value:function(){var n=this,e=this.props,o=e.schema,c=e.query,f=e.makeDefaultArg;if(!o)return l.createElement("div",{style:{fontFamily:"sans-serif"},className:"error-container"},"No Schema Available");var u={colors:this.props.colors||Ze,checkboxChecked:this.props.checkboxChecked||Ye,checkboxUnchecked:this.props.checkboxUnchecked||Xe,arrowClosed:this.props.arrowClosed||Je,arrowOpen:this.props.arrowOpen||Ke,styles:this.props.styles?k({},Ve,this.props.styles):Ve},r=o.getQueryType(),s=o.getMutationType(),p=o.getSubscriptionType();if(!r&&!s&&!p)return l.createElement("div",null,"Missing query type");var m=r&&r.getFields(),h=s&&s.getFields(),x=p&&p.getFields(),d=pt(c),b=this.props.getDefaultFieldNames||Ee,g=this.props.getDefaultScalarArgValue||we,_=d.definitions,E=_.map(function(y){return y.kind==="FragmentDefinition"||y.kind==="OperationDefinition"?y:null}).filter(Boolean),A=E.length===0?ue.definitions:E,V=function(S,O){var D=O==null||O===""?null:{kind:"Name",value:O,loc:void 0},R=k({},S,{name:D}),C=d.definitions,F=C.map(function(T){return S===T?R:T});return k({},d,{definitions:F})},z=function(S){var O=void 0;S.kind==="FragmentDefinition"?O="fragment":O=S.operation;var D=(S.name&&S.name.value||"")+"Copy",R={kind:"Name",value:D,loc:void 0},C=k({},S,{name:R}),F=d.definitions,T=[].concat(q(F),[C]);return n.setState({operationToScrollTo:O+"-"+D}),k({},d,{definitions:T})},I=function(S){var O=d.definitions,D=O.filter(function(R){return S!==R});return k({},d,{definitions:D})},Q=function(S){var O=d.definitions,D=d.definitions.length===1&&d.definitions[0]===ue.definitions[0],R=D?[]:O.filter(function(re){return re.kind==="OperationDefinition"?re.operation===S:!1}),C="My"+pe(S)+(R.length===0?"":R.length+1),F="__typename # Placeholder value",T={kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:F,loc:null},arguments:[],directives:[],selectionSet:null,loc:null}],loc:null},J={kind:"OperationDefinition",operation:S,name:{kind:"Name",value:C},variableDefinitions:[],directives:[],selectionSet:T,loc:null},de=D?[J]:[].concat(q(d.definitions),[J]),ve=k({},d,{definitions:de});n.setState({operationToScrollTo:S+"-"+C}),n.props.onEdit((0,v.print)(ve))},G=[m?l.createElement("option",{key:"query",className:"toolbar-button",style:u.styles.buttonStyle,type:"link",value:"query"},"Query"):null,h?l.createElement("option",{key:"mutation",className:"toolbar-button",style:u.styles.buttonStyle,type:"link",value:"mutation"},"Mutation"):null,x?l.createElement("option",{key:"subscription",className:"toolbar-button",style:u.styles.buttonStyle,type:"link",value:"subscription"},"Subscription"):null].filter(Boolean),K=G.length===0||this.props.hideActions?null:l.createElement("div",{style:{minHeight:"50px",maxHeight:"50px",overflow:"none"}},l.createElement("form",{className:"variable-editor-title graphiql-explorer-actions",style:k({},u.styles.explorerActionsStyle,{display:"flex",flexDirection:"row",alignItems:"center",borderTop:"1px solid rgb(214, 214, 214)"}),onSubmit:function(S){return S.preventDefault()}},l.createElement("span",{style:{display:"inline-block",flexGrow:"0",textAlign:"right"}},"Add new"," "),l.createElement("select",{onChange:function(S){return n._setAddOperationType(S.target.value)},value:this.state.newOperationType,style:{flexGrow:"2"}},G),l.createElement("button",{type:"submit",className:"toolbar-button",onClick:function(){return n.state.newOperationType?Q(n.state.newOperationType):null},style:k({},u.styles.buttonStyle,{height:"22px",width:"22px"})},l.createElement("span",null,"+")))),L=this.props.externalFragments&&this.props.externalFragments.reduce(function(y,S){if(S.kind==="FragmentDefinition"){var O=S.typeCondition.name.value,D=y[O]||[],R=[].concat(q(D),[S]).sort(function(C,F){return C.name.value.localeCompare(F.name.value)});return k({},y,Ce({},O,R))}return y},{}),te=A.reduce(function(y,S){if(S.kind==="FragmentDefinition"){var O=S.typeCondition.name.value,D=y[O]||[],R=[].concat(q(D),[S]).sort(function(C,F){return C.name.value.localeCompare(F.name.value)});return k({},y,Ce({},O,R))}return y},{}),X=k({},te,L),ne=this.props.showAttribution?l.createElement(ft,null):null;return l.createElement("div",{ref:function(S){n._ref=S},style:{fontSize:12,textOverflow:"ellipsis",whiteSpace:"nowrap",margin:0,padding:8,fontFamily:'Consolas, Inconsolata, "Droid Sans Mono", Monaco, monospace',display:"flex",flexDirection:"column",height:"100%"},className:"graphiql-explorer-root"},l.createElement("div",{style:{flexGrow:"1",overflow:"scroll"}},A.map(function(y,S){var O=y&&y.name&&y.name.value,D=y.kind==="FragmentDefinition"?"fragment":y&&y.operation||"query",R=function(W){var Z=V(y,W);n.props.onEdit((0,v.print)(Z))},C=function(){var W=z(y);n.props.onEdit((0,v.print)(W))},F=function(){var W=I(y);n.props.onEdit((0,v.print)(W))},T=y.kind==="FragmentDefinition"&&y.typeCondition.kind==="NamedType"&&o.getType(y.typeCondition.name.value),J=T instanceof v.GraphQLObjectType?T.getFields():null,de=D==="query"?m:D==="mutation"?h:D==="subscription"?x:y.kind==="FragmentDefinition"?J:null,ve=y.kind==="FragmentDefinition"?y.typeCondition.name.value:null,re=function(W){var Z=(0,v.print)(W);n.props.onEdit(Z)};return l.createElement(ct,{key:S,isLast:S===A.length-1,fields:de,operationType:D,name:O,definition:y,onOperationRename:R,onOperationDestroy:F,onOperationClone:C,onTypeName:ve,onMount:n._handleRootViewMount,onCommit:re,onEdit:function(W,Z){var ge=void 0;if((typeof Z=="undefined"?"undefined":We(Z))==="object"&&typeof Z.commit!="undefined"?ge=Z.commit:ge=!0,W){var ye=k({},d,{definitions:d.definitions.map(function(Ie){return Ie===y?W:Ie})});return ge&&re(ye),ye}else return d},schema:o,getDefaultFieldNames:b,getDefaultScalarArgValue:g,makeDefaultArg:f,onRunOperation:function(){n.props.onRunOperation&&n.props.onRunOperation(O)},styleConfig:u,availableFragments:X})}),ne),K)}}]),t}(l.PureComponent);Te.defaultProps={getDefaultFieldNames:Ee,getDefaultScalarArgValue:we};var mt=function(i){H(t,i);function t(){var a,n,e,o;U(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(n=(e=w(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={hasError:!1,error:null,errorInfo:null},n),w(e,o)}return B(t,[{key:"componentDidCatch",value:function(n,e){this.setState({hasError:!0,error:n,errorInfo:e}),console.error("Error in component",n,e)}},{key:"render",value:function(){return this.state.hasError?l.createElement("div",{style:{padding:18,fontFamily:"sans-serif"}},l.createElement("div",null,"Something went wrong"),l.createElement("details",{style:{whiteSpace:"pre-wrap"}},this.state.error?this.state.error.toString():null,l.createElement("br",null),this.state.errorInfo?this.state.errorInfo.componentStack:null)):this.props.children}}]),t}(l.Component),fe=function(i){H(t,i);function t(){return U(this,t),w(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return B(t,[{key:"render",value:function(){return l.createElement("div",{className:"docExplorerWrap",style:{height:"100%",width:this.props.width,minWidth:this.props.width,zIndex:7,display:this.props.explorerIsOpen?"flex":"none",flexDirection:"column",overflow:"hidden"}},l.createElement("div",{className:"doc-explorer-title-bar"},l.createElement("div",{className:"doc-explorer-title"},this.props.title),l.createElement("div",{className:"doc-explorer-rhs"},l.createElement("div",{className:"docExplorerHide",onClick:this.props.onToggleExplorer},"\u2715"))),l.createElement("div",{className:"doc-explorer-contents",style:{padding:"0px",overflowY:"unset"}},l.createElement(mt,null,l.createElement(Te,this.props))))}}]),t}(l.PureComponent);fe.defaultValue=ce,fe.defaultProps={width:320,title:"Explorer"},oe.default=fe,Object.defineProperty(ae,"__esModule",{value:!0}),ae.Explorer=void 0;var dt=oe,Ne=vt(dt);function vt(i){return i&&i.__esModule?i:{default:i}}ae.Explorer=Ne.default;var gt=ae.default=Ne.default,Dt="",me={exports:{}},ee={};/* | ||
(function(H,$){typeof exports=="object"&&typeof module!="undefined"?$(exports,require("@graphiql/react"),require("react"),require("graphql")):typeof define=="function"&&define.amd?define(["exports","@graphiql/react","react","graphql"],$):(H=typeof globalThis!="undefined"?globalThis:H||self,$(H.GraphiQLPluginExplorer={},H.GraphiQL.React,H.React,H.GraphiQL.GraphQL))})(this,function(H,$,ue,Ie){"use strict";function he(i){if(i&&i.__esModule)return i;var t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});return i&&Object.keys(i).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(i,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return i[a]}})}}),t.default=i,Object.freeze(t)}var qe=he(ue),Be=he(Ie);function be(i){return i&&Object.prototype.hasOwnProperty.call(i,"default")&&Object.keys(i).length===1?i.default:i}var ie={},ae={},Se=be(qe),Ue=be(Be);Object.defineProperty(ae,"__esModule",{value:!0});var ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},ke=function(){function i(t,a){var r=[],e=!0,o=!1,c=void 0;try{for(var f=t[Symbol.iterator](),u;!(e=(u=f.next()).done)&&(r.push(u.value),!(a&&r.length===a));e=!0);}catch(n){o=!0,c=n}finally{try{!e&&f.return&&f.return()}finally{if(o)throw c}}return r}return function(t,a){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return i(t,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),k=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i[r]=a[r])}return i},P=function(){function i(t,a){for(var r=0;r<a.length;r++){var e=a[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}return function(t,a,r){return a&&i(t.prototype,a),r&&i(t,r),t}}();ae.defaultValue=ce;var He=Se,l=Ge(He),v=Ue;function Ge(i){if(i&&i.__esModule)return i;var t={};if(i!=null)for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a]);return t.default=i,t}function _e(i,t,a){return t in i?Object.defineProperty(i,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[t]=a,i}function M(i){if(Array.isArray(i)){for(var t=0,a=Array(i.length);t<i.length;t++)a[t]=i[t];return a}else return Array.from(i)}function I(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function x(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function q(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}function pe(i){return i.charAt(0).toUpperCase()+i.slice(1)}var We={keyword:"#B11A04",def:"#D2054E",property:"#1F61A0",qualifier:"#1C92A9",attribute:"#8B2BB9",number:"#2882F9",string:"#D64292",builtin:"#D47509",string2:"#0B7FC7",variable:"#397D13",atom:"#CA9800"},Qe=l.createElement("svg",{width:"12",height:"9"},l.createElement("path",{fill:"#666",d:"M 0 2 L 9 2 L 4.5 7.5 z"})),$e=l.createElement("svg",{width:"12",height:"9"},l.createElement("path",{fill:"#666",d:"M 0 0 L 0 9 L 5.5 4.5 z"})),Ze=l.createElement("svg",{style:{marginRight:"3px",marginLeft:"-3px"},width:"12",height:"12",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M16 0H2C0.9 0 0 0.9 0 2V16C0 17.1 0.9 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0ZM16 16H2V2H16V16ZM14.99 6L13.58 4.58L6.99 11.17L4.41 8.6L2.99 10.01L6.99 14L14.99 6Z",fill:"#666"})),Ke=l.createElement("svg",{style:{marginRight:"3px",marginLeft:"-3px"},width:"12",height:"12",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M16 2V16H2V2H16ZM16 0H2C0.9 0 0 0.9 0 2V16C0 17.1 0.9 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0Z",fill:"#CCC"}));function oe(i){return i.checked?i.styleConfig.checkboxChecked:i.styleConfig.checkboxUnchecked}function Ce(i){var t=i.getFields();if(t.id){var a=["id"];return t.email?a.push("email"):t.name&&a.push("name"),a}if(t.edges)return["edges"];if(t.node)return["node"];if(t.nodes)return["nodes"];var r=[];return Object.keys(t).forEach(function(e){(0,v.isLeafType)(t[e].type)&&r.push(e)}),r.length?r.slice(0,2):["__typename"]}function Ee(i){return(0,v.isNonNullType)(i.type)&&i.defaultValue===void 0}function Je(i){for(var t=i;(0,v.isWrappingType)(t);)t=t.ofType;return t}function W(i){for(var t=i;(0,v.isWrappingType)(t);)t=t.ofType;return t}function Ae(i,t){if(typeof t!="string"&&t.kind==="VariableDefinition")return t.variable;if((0,v.isScalarType)(i))try{switch(i.name){case"String":return{kind:"StringValue",value:String(i.parseValue(t))};case"Float":return{kind:"FloatValue",value:String(i.parseValue(parseFloat(t)))};case"Int":return{kind:"IntValue",value:String(i.parseValue(parseInt(t,10)))};case"Boolean":try{var a=JSON.parse(t);return typeof a=="boolean"?{kind:"BooleanValue",value:a}:{kind:"BooleanValue",value:!1}}catch{return{kind:"BooleanValue",value:!1}}default:return{kind:"StringValue",value:String(i.parseValue(t))}}}catch(e){return console.error("error coercing arg value",e,t),{kind:"StringValue",value:t}}else try{var r=i.parseValue(t);return r?{kind:"EnumValue",value:String(r)}:{kind:"EnumValue",value:i.getValues()[0].name}}catch{return{kind:"EnumValue",value:i.getValues()[0].name}}}var Ye=function(i){q(t,i);function t(){var a,r,e,o;I(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=x(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._getArgSelection=function(){return e.props.selection.fields.find(function(n){return n.name.value===e.props.arg.name})},e._removeArg=function(){var n=e.props.selection,s=e._getArgSelection();e._previousArgSelection=s,e.props.modifyFields(n.fields.filter(function(p){return p!==s}),!0)},e._addArg=function(){var n=e.props,s=n.selection,p=n.arg,m=n.getDefaultScalarArgValue,h=n.parentField,w=n.makeDefaultArg,d=W(p.type),b=null;if(e._previousArgSelection)b=e._previousArgSelection;else if((0,v.isInputObjectType)(d)){var g=d.getFields();b={kind:"ObjectField",name:{kind:"Name",value:p.name},value:{kind:"ObjectValue",fields:le(m,w,h,Object.keys(g).map(function(_){return g[_]}))}}}else(0,v.isLeafType)(d)&&(b={kind:"ObjectField",name:{kind:"Name",value:p.name},value:m(h,p,d)});if(!b)console.error("Unable to add arg for argType",d);else return e.props.modifyFields([].concat(M(s.fields||[]),[b]),!0)},e._setArgValue=function(n,s){var p=!1,m=!1,h=!1;try{n.kind==="VariableDefinition"?m=!0:n===null||typeof n=="undefined"?p=!0:typeof n.kind=="string"&&(h=!0)}catch{}var w=e.props.selection,d=e._getArgSelection();if(!d){console.error("missing arg selection when setting arg value");return}var b=W(e.props.arg.type),g=(0,v.isLeafType)(b)||m||p||h;if(!g){console.warn("Unable to handle non leaf types in InputArgView.setArgValue",n);return}var _=void 0,E=void 0;n===null||typeof n=="undefined"?E=null:!n.target&&!!n.kind&&n.kind==="VariableDefinition"?(_=n,E=_.variable):typeof n.kind=="string"?E=n:n.target&&typeof n.target.value=="string"&&(_=n.target.value,E=Ae(b,_));var A=e.props.modifyFields((w.fields||[]).map(function(V){var B=V===d,L=B?k({},V,{value:E}):V;return L}),s);return A},e._modifyChildFields=function(n){return e.props.modifyFields(e.props.selection.fields.map(function(s){return s.name.value===e.props.arg.name?k({},s,{value:{kind:"ObjectValue",fields:n}}):s}),!0)},r),x(e,o)}return P(t,[{key:"render",value:function(){var r=this.props,e=r.arg,o=r.parentField,c=this._getArgSelection();return l.createElement(xe,{argValue:c?c.value:null,arg:e,parentField:o,addArg:this._addArg,removeArg:this._removeArg,setArgFields:this._modifyChildFields,setArgValue:this._setArgValue,getDefaultScalarArgValue:this.props.getDefaultScalarArgValue,makeDefaultArg:this.props.makeDefaultArg,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig,onCommit:this.props.onCommit,definition:this.props.definition})}}]),t}(l.PureComponent);function ce(i){if((0,v.isEnumType)(i))return{kind:"EnumValue",value:i.getValues()[0].name};switch(i.name){case"String":return{kind:"StringValue",value:""};case"Float":return{kind:"FloatValue",value:"1.5"};case"Int":return{kind:"IntValue",value:"10"};case"Boolean":return{kind:"BooleanValue",value:!1};default:return{kind:"StringValue",value:""}}}function Oe(i,t,a){return ce(a)}var Xe=function(i){q(t,i);function t(){var a,r,e,o;I(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=x(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._getArgSelection=function(){var n=e.props.selection;return(n.arguments||[]).find(function(s){return s.name.value===e.props.arg.name})},e._removeArg=function(n){var s=e.props.selection,p=e._getArgSelection();return e._previousArgSelection=p,e.props.modifyArguments((s.arguments||[]).filter(function(m){return m!==p}),n)},e._addArg=function(n){var s=e.props,p=s.selection,m=s.getDefaultScalarArgValue,h=s.makeDefaultArg,w=s.parentField,d=s.arg,b=W(d.type),g=null;if(e._previousArgSelection)g=e._previousArgSelection;else if((0,v.isInputObjectType)(b)){var _=b.getFields();g={kind:"Argument",name:{kind:"Name",value:d.name},value:{kind:"ObjectValue",fields:le(m,h,w,Object.keys(_).map(function(E){return _[E]}))}}}else(0,v.isLeafType)(b)&&(g={kind:"Argument",name:{kind:"Name",value:d.name},value:m(w,d,b)});return g?e.props.modifyArguments([].concat(M(p.arguments||[]),[g]),n):(console.error("Unable to add arg for argType",b),null)},e._setArgValue=function(n,s){var p=!1,m=!1,h=!1;try{n.kind==="VariableDefinition"?m=!0:n===null||typeof n=="undefined"?p=!0:typeof n.kind=="string"&&(h=!0)}catch{}var w=e.props.selection,d=e._getArgSelection();if(!d&&!m){console.error("missing arg selection when setting arg value");return}var b=W(e.props.arg.type),g=(0,v.isLeafType)(b)||m||p||h;if(!g){console.warn("Unable to handle non leaf types in ArgView._setArgValue");return}var _=void 0,E=void 0;return n===null||typeof n=="undefined"?E=null:n.target&&typeof n.target.value=="string"?(_=n.target.value,E=Ae(b,_)):!n.target&&n.kind==="VariableDefinition"?(_=n,E=_.variable):typeof n.kind=="string"&&(E=n),e.props.modifyArguments((w.arguments||[]).map(function(A){return A===d?k({},A,{value:E}):A}),s)},e._setArgFields=function(n,s){var p=e.props.selection,m=e._getArgSelection();if(!m){console.error("missing arg selection when setting arg value");return}return e.props.modifyArguments((p.arguments||[]).map(function(h){return h===m?k({},h,{value:{kind:"ObjectValue",fields:n}}):h}),s)},r),x(e,o)}return P(t,[{key:"render",value:function(){var r=this.props,e=r.arg,o=r.parentField,c=this._getArgSelection();return l.createElement(xe,{argValue:c?c.value:null,arg:e,parentField:o,addArg:this._addArg,removeArg:this._removeArg,setArgFields:this._setArgFields,setArgValue:this._setArgValue,getDefaultScalarArgValue:this.props.getDefaultScalarArgValue,makeDefaultArg:this.props.makeDefaultArg,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig,onCommit:this.props.onCommit,definition:this.props.definition})}}]),t}(l.PureComponent);function et(i){return i.ctrlKey&&i.key==="Enter"}function tt(i){return i!=="FragmentDefinition"}var rt=function(i){q(t,i);function t(){var a,r,e,o;I(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=x(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._handleChange=function(n){e.props.setArgValue(n,!0)},r),x(e,o)}return P(t,[{key:"componentDidMount",value:function(){var r=this._ref,e=document.activeElement;r&&e&&!(e instanceof HTMLTextAreaElement)&&(r.focus(),r.setSelectionRange(0,r.value.length))}},{key:"render",value:function(){var r=this,e=this.props,o=e.arg,c=e.argValue,f=e.styleConfig,u=W(o.type),n=typeof c.value=="string"?c.value:"",s=this.props.argValue.kind==="StringValue"?f.colors.string:f.colors.number;return l.createElement("span",{style:{color:s}},u.name==="String"?'"':"",l.createElement("input",{style:{border:"none",borderBottom:"1px solid #888",outline:"none",width:Math.max(1,Math.min(15,n.length))+"ch",color:s},ref:function(m){r._ref=m},type:"text",onChange:this._handleChange,value:n}),u.name==="String"?'"':"")}}]),t}(l.PureComponent),xe=function(i){q(t,i);function t(){var a,r,e,o;I(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=x(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={displayArgActions:!1},r),x(e,o)}return P(t,[{key:"render",value:function(){var r=this,e=this.props,o=e.argValue,c=e.arg,f=e.styleConfig,u=W(c.type),n=null;if(o){if(o.kind==="Variable")n=l.createElement("span",{style:{color:f.colors.variable}},"$",o.name.value);else if((0,v.isScalarType)(u))u.name==="Boolean"?n=l.createElement("select",{style:{color:f.colors.builtin},onChange:this.props.setArgValue,value:o.kind==="BooleanValue"?o.value:void 0},l.createElement("option",{key:"true",value:"true"},"true"),l.createElement("option",{key:"false",value:"false"},"false")):n=l.createElement(rt,{setArgValue:this.props.setArgValue,arg:c,argValue:o,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig});else if((0,v.isEnumType)(u))o.kind==="EnumValue"?n=l.createElement("select",{style:{backgroundColor:"white",color:f.colors.string2},onChange:this.props.setArgValue,value:o.value},u.getValues().map(function(d){return l.createElement("option",{key:d.name,value:d.name},d.name)})):console.error("arg mismatch between arg and selection",u,o);else if((0,v.isInputObjectType)(u))if(o.kind==="ObjectValue"){var s=u.getFields();n=l.createElement("div",{style:{marginLeft:16}},Object.keys(s).sort().map(function(d){return l.createElement(Ye,{key:d,arg:s[d],parentField:r.props.parentField,selection:o,modifyFields:r.props.setArgFields,getDefaultScalarArgValue:r.props.getDefaultScalarArgValue,makeDefaultArg:r.props.makeDefaultArg,onRunOperation:r.props.onRunOperation,styleConfig:r.props.styleConfig,onCommit:r.props.onCommit,definition:r.props.definition})}))}else console.error("arg mismatch between arg and selection",u,o)}var p=function(){var b=c.name,g=(r.props.definition.variableDefinitions||[]).filter(function(C){return C.variable.name.value.startsWith(b)}).length,_=void 0;g>0?_=""+b+g:_=b;var E=c.type.toString(),A=(0,v.parseType)(E),V={kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:_}},type:A,directives:[]},B=function(F){return(r.props.definition.variableDefinitions||[]).find(function(T){return T.variable.name.value===F})},L=void 0,G={};if(typeof o!="undefined"&&o!==null){var U=(0,v.visit)(o,{Variable:function(F){var T=F.name.value,K=B(T);if(G[T]=G[T]+1||1,!!K)return K.defaultValue}}),Z=V.type.kind==="NonNullType",j=Z?k({},V,{type:V.type.type}):V;L=k({},j,{defaultValue:U})}else L=V;var ee=Object.entries(G).filter(function(C){var F=ke(C,2);F[0];var T=F[1];return T<2}).map(function(C){var F=ke(C,2),T=F[0];return F[1],T});if(L){var Y=r.props.setArgValue(L,!1);if(Y){var te=Y.definitions.find(function(C){return!!C.operation&&!!C.name&&!!C.name.value&&!!r.props.definition.name&&!!r.props.definition.name.value?C.name.value===r.props.definition.name.value:!1}),y=[].concat(M(te.variableDefinitions||[]),[L]).filter(function(C){return ee.indexOf(C.variable.name.value)===-1}),S=k({},te,{variableDefinitions:y}),O=Y.definitions,D=O.map(function(C){return te===C?S:C}),N=k({},Y,{definitions:D});r.props.onCommit(N)}}},m=function(){if(!(!o||!o.name||!o.name.value)){var b=o.name.value,g=(r.props.definition.variableDefinitions||[]).find(function(j){return j.variable.name.value===b});if(!!g){var _=g.defaultValue,E=r.props.setArgValue(_,{commit:!1});if(E){var A=E.definitions.find(function(j){return j.name.value===r.props.definition.name.value});if(!A)return;var V=0;(0,v.visit)(A,{Variable:function(ee){ee.name.value===b&&(V=V+1)}});var B=A.variableDefinitions||[];V<2&&(B=B.filter(function(j){return j.variable.name.value!==b}));var L=k({},A,{variableDefinitions:B}),G=E.definitions,U=G.map(function(j){return A===j?L:j}),Z=k({},E,{definitions:U});r.props.onCommit(Z)}}}},h=o&&o.kind==="Variable",w=this.state.displayArgActions?l.createElement("button",{type:"submit",className:"toolbar-button",title:h?"Remove the variable":"Extract the current value into a GraphQL variable",onClick:function(b){b.preventDefault(),b.stopPropagation(),h?m():p()},style:f.styles.actionButtonStyle},l.createElement("span",{style:{color:f.colors.variable}},"$")):null;return l.createElement("div",{style:{cursor:"pointer",minHeight:"16px",WebkitUserSelect:"none",userSelect:"none"},"data-arg-name":c.name,"data-arg-type":u.name,className:"graphiql-explorer-"+c.name},l.createElement("span",{style:{cursor:"pointer"},onClick:function(b){var g=!o;g?r.props.addArg(!0):r.props.removeArg(!0),r.setState({displayArgActions:g})}},(0,v.isInputObjectType)(u)?l.createElement("span",null,o?this.props.styleConfig.arrowOpen:this.props.styleConfig.arrowClosed):l.createElement(oe,{checked:!!o,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:f.colors.attribute},title:c.description,onMouseEnter:function(){o!==null&&typeof o!="undefined"&&r.setState({displayArgActions:!0})},onMouseLeave:function(){return r.setState({displayArgActions:!1})}},c.name,Ee(c)?"*":"",": ",w," ")," "),n||l.createElement("span",null)," ")}}]),t}(l.PureComponent),nt=function(i){q(t,i);function t(){var a,r,e,o;I(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=x(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._addFragment=function(){e.props.modifySelections([].concat(M(e.props.selections),[e._previousSelection||{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.props.implementingType.name}},selectionSet:{kind:"SelectionSet",selections:e.props.getDefaultFieldNames(e.props.implementingType).map(function(n){return{kind:"Field",name:{kind:"Name",value:n}}})}}]))},e._removeFragment=function(){var n=e._getSelection();e._previousSelection=n,e.props.modifySelections(e.props.selections.filter(function(s){return s!==n}))},e._getSelection=function(){var n=e.props.selections.find(function(s){return s.kind==="InlineFragment"&&s.typeCondition&&e.props.implementingType.name===s.typeCondition.name.value});if(!n)return null;if(n.kind==="InlineFragment")return n},e._modifyChildSelections=function(n,s){var p=e._getSelection();return e.props.modifySelections(e.props.selections.map(function(m){return m===p?{directives:m.directives,kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.props.implementingType.name}},selectionSet:{kind:"SelectionSet",selections:n}}:m}),s)},r),x(e,o)}return P(t,[{key:"render",value:function(){var r=this,e=this.props,o=e.implementingType,c=e.schema,f=e.getDefaultFieldNames,u=e.styleConfig,n=this._getSelection(),s=o.getFields(),p=n?n.selectionSet?n.selectionSet.selections:[]:[];return l.createElement("div",{className:"graphiql-explorer-"+o.name},l.createElement("span",{style:{cursor:"pointer"},onClick:n?this._removeFragment:this._addFragment},l.createElement(oe,{checked:!!n,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:u.colors.atom}},this.props.implementingType.name)),n?l.createElement("div",{style:{marginLeft:16}},Object.keys(s).sort().map(function(m){return l.createElement(Fe,{key:m,field:s[m],selections:p,modifySelections:r._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:r.props.getDefaultScalarArgValue,makeDefaultArg:r.props.makeDefaultArg,onRunOperation:r.props.onRunOperation,onCommit:r.props.onCommit,styleConfig:r.props.styleConfig,definition:r.props.definition,availableFragments:r.props.availableFragments})})):null)}}]),t}(l.PureComponent),it=function(i){q(t,i);function t(){var a,r,e,o;I(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=x(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e._addFragment=function(){e.props.modifySelections([].concat(M(e.props.selections),[e._previousSelection||{kind:"FragmentSpread",name:e.props.fragment.name}]))},e._removeFragment=function(){var n=e._getSelection();e._previousSelection=n,e.props.modifySelections(e.props.selections.filter(function(s){var p=s.kind==="FragmentSpread"&&s.name.value===e.props.fragment.name.value;return!p}))},e._getSelection=function(){var n=e.props.selections.find(function(s){return s.kind==="FragmentSpread"&&s.name.value===e.props.fragment.name.value});return n},r),x(e,o)}return P(t,[{key:"render",value:function(){var r=this.props.styleConfig,e=this._getSelection();return l.createElement("div",{className:"graphiql-explorer-"+this.props.fragment.name.value},l.createElement("span",{style:{cursor:"pointer"},onClick:e?this._removeFragment:this._addFragment},l.createElement(oe,{checked:!!e,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:r.colors.def},className:"graphiql-explorer-"+this.props.fragment.name.value},this.props.fragment.name.value)))}}]),t}(l.PureComponent);function le(i,t,a,r){var e=[],o=!0,c=!1,f=void 0;try{for(var u=r[Symbol.iterator](),n;!(o=(n=u.next()).done);o=!0){var s=n.value;if((0,v.isRequiredInputField)(s)||t&&t(a,s)){var p=W(s.type);(0,v.isInputObjectType)(p)?function(){var m=p.getFields();e.push({kind:"ObjectField",name:{kind:"Name",value:s.name},value:{kind:"ObjectValue",fields:le(i,t,a,Object.keys(m).map(function(h){return m[h]}))}})}():(0,v.isLeafType)(p)&&e.push({kind:"ObjectField",name:{kind:"Name",value:s.name},value:i(a,s,p)})}}}catch(m){c=!0,f=m}finally{try{!o&&u.return&&u.return()}finally{if(c)throw f}}return e}function we(i,t,a){var r=[],e=!0,o=!1,c=void 0;try{for(var f=a.args[Symbol.iterator](),u;!(e=(u=f.next()).done);e=!0){var n=u.value;if(Ee(n)||t&&t(a,n)){var s=W(n.type);(0,v.isInputObjectType)(s)?function(){var p=s.getFields();r.push({kind:"Argument",name:{kind:"Name",value:n.name},value:{kind:"ObjectValue",fields:le(i,t,a,Object.keys(p).map(function(m){return p[m]}))}})}():(0,v.isLeafType)(s)&&r.push({kind:"Argument",name:{kind:"Name",value:n.name},value:i(a,n,s)})}}}catch(p){o=!0,c=p}finally{try{!e&&f.return&&f.return()}finally{if(o)throw c}}return r}var Fe=function(i){q(t,i);function t(){var a,r,e,o;I(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=x(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={displayFieldActions:!1},e._addAllFieldsToSelections=function(n){var s=n?Object.keys(n).map(function(h){return{kind:"Field",name:{kind:"Name",value:h},arguments:[]}}):[],p={kind:"SelectionSet",selections:s},m=[].concat(M(e.props.selections.filter(function(h){return h.kind==="InlineFragment"?!0:h.name.value!==e.props.field.name})),[{kind:"Field",name:{kind:"Name",value:e.props.field.name},arguments:we(e.props.getDefaultScalarArgValue,e.props.makeDefaultArg,e.props.field),selectionSet:p}]);e.props.modifySelections(m)},e._addFieldToSelections=function(n){var s=[].concat(M(e.props.selections),[e._previousSelection||{kind:"Field",name:{kind:"Name",value:e.props.field.name},arguments:we(e.props.getDefaultScalarArgValue,e.props.makeDefaultArg,e.props.field)}]);e.props.modifySelections(s)},e._handleUpdateSelections=function(n){var s=e._getSelection();if(s&&!n.altKey)e._removeFieldFromSelections();else{var p=(0,v.getNamedType)(e.props.field.type),m=(0,v.isObjectType)(p)&&p.getFields(),h=!!m&&n.altKey;h?e._addAllFieldsToSelections(m):e._addFieldToSelections(m)}},e._removeFieldFromSelections=function(){var n=e._getSelection();e._previousSelection=n,e.props.modifySelections(e.props.selections.filter(function(s){return s!==n}))},e._getSelection=function(){var n=e.props.selections.find(function(s){return s.kind==="Field"&&e.props.field.name===s.name.value});if(!n)return null;if(n.kind==="Field")return n},e._setArguments=function(n,s){var p=e._getSelection();if(!p){console.error("Missing selection when setting arguments",n);return}return e.props.modifySelections(e.props.selections.map(function(m){return m===p?{alias:p.alias,arguments:n,directives:p.directives,kind:"Field",name:p.name,selectionSet:p.selectionSet}:m}),s)},e._modifyChildSelections=function(n,s){return e.props.modifySelections(e.props.selections.map(function(p){if(p.kind==="Field"&&e.props.field.name===p.name.value){if(p.kind!=="Field")throw new Error("invalid selection");return{alias:p.alias,arguments:p.arguments,directives:p.directives,kind:"Field",name:p.name,selectionSet:{kind:"SelectionSet",selections:n}}}return p}),s)},r),x(e,o)}return P(t,[{key:"render",value:function(){var r=this,e=this.props,o=e.field,c=e.schema,f=e.getDefaultFieldNames,u=e.styleConfig,n=this._getSelection(),s=Je(o.type),p=o.args.sort(function(g,_){return g.name.localeCompare(_.name)}),m="graphiql-explorer-node graphiql-explorer-"+o.name;o.isDeprecated&&(m+=" graphiql-explorer-deprecated");var h=(0,v.isObjectType)(s)||(0,v.isInterfaceType)(s)||(0,v.isUnionType)(s)?this.props.availableFragments&&this.props.availableFragments[s.name]:null,w=l.createElement("div",{className:m},l.createElement("span",{title:o.description,style:{cursor:"pointer",display:"inline-flex",alignItems:"center",minHeight:"16px",WebkitUserSelect:"none",userSelect:"none"},"data-field-name":o.name,"data-field-type":s.name,onClick:this._handleUpdateSelections,onMouseEnter:function(){var _=(0,v.isObjectType)(s)&&n&&n.selectionSet&&n.selectionSet.selections.filter(function(E){return E.kind!=="FragmentSpread"}).length>0;_&&r.setState({displayFieldActions:!0})},onMouseLeave:function(){return r.setState({displayFieldActions:!1})}},(0,v.isObjectType)(s)?l.createElement("span",null,n?this.props.styleConfig.arrowOpen:this.props.styleConfig.arrowClosed):null,(0,v.isObjectType)(s)?null:l.createElement(oe,{checked:!!n,styleConfig:this.props.styleConfig}),l.createElement("span",{style:{color:u.colors.property},className:"graphiql-explorer-field-view"},o.name),this.state.displayFieldActions?l.createElement("button",{type:"submit",className:"toolbar-button",title:"Extract selections into a new reusable fragment",onClick:function(_){_.preventDefault(),_.stopPropagation();var E=s.name,A=E+"Fragment",V=(h||[]).filter(function(j){return j.name.value.startsWith(A)}).length;V>0&&(A=""+A+V);var B=n?n.selectionSet?n.selectionSet.selections:[]:[],L=[{kind:"FragmentSpread",name:{kind:"Name",value:A},directives:[]}],G={kind:"FragmentDefinition",name:{kind:"Name",value:A},typeCondition:{kind:"NamedType",name:{kind:"Name",value:s.name}},directives:[],selectionSet:{kind:"SelectionSet",selections:B}},U=r._modifyChildSelections(L,!1);if(U){var Z=k({},U,{definitions:[].concat(M(U.definitions),[G])});r.props.onCommit(Z)}else console.warn("Unable to complete extractFragment operation")},style:k({},u.styles.actionButtonStyle)},l.createElement("span",null,"\u2026")):null),n&&p.length?l.createElement("div",{style:{marginLeft:16},className:"graphiql-explorer-graphql-arguments"},p.map(function(g){return l.createElement(Xe,{key:g.name,parentField:o,arg:g,selection:n,modifyArguments:r._setArguments,getDefaultScalarArgValue:r.props.getDefaultScalarArgValue,makeDefaultArg:r.props.makeDefaultArg,onRunOperation:r.props.onRunOperation,styleConfig:r.props.styleConfig,onCommit:r.props.onCommit,definition:r.props.definition})})):null);if(n&&((0,v.isObjectType)(s)||(0,v.isInterfaceType)(s)||(0,v.isUnionType)(s))){var d=(0,v.isUnionType)(s)?{}:s.getFields(),b=n?n.selectionSet?n.selectionSet.selections:[]:[];return l.createElement("div",{className:"graphiql-explorer-"+o.name},w,l.createElement("div",{style:{marginLeft:16}},h?h.map(function(g){var _=c.getType(g.typeCondition.name.value),E=g.name.value;return _?l.createElement(it,{key:E,fragment:g,selections:b,modifySelections:r._modifyChildSelections,schema:c,styleConfig:r.props.styleConfig,onCommit:r.props.onCommit}):null}):null,Object.keys(d).sort().map(function(g){return l.createElement(t,{key:g,field:d[g],selections:b,modifySelections:r._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:r.props.getDefaultScalarArgValue,makeDefaultArg:r.props.makeDefaultArg,onRunOperation:r.props.onRunOperation,styleConfig:r.props.styleConfig,onCommit:r.props.onCommit,definition:r.props.definition,availableFragments:r.props.availableFragments})}),(0,v.isInterfaceType)(s)||(0,v.isUnionType)(s)?c.getPossibleTypes(s).map(function(g){return l.createElement(nt,{key:g.name,implementingType:g,selections:b,modifySelections:r._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:r.props.getDefaultScalarArgValue,makeDefaultArg:r.props.makeDefaultArg,onRunOperation:r.props.onRunOperation,styleConfig:r.props.styleConfig,onCommit:r.props.onCommit,definition:r.props.definition})}):null))}return w}}]),t}(l.PureComponent);function at(i){try{return i.trim()?(0,v.parse)(i,{noLocation:!0}):null}catch(t){return new Error(t)}}var ot={kind:"OperationDefinition",operation:"query",variableDefinitions:[],name:{kind:"Name",value:"MyQuery"},directives:[],selectionSet:{kind:"SelectionSet",selections:[]}},se={kind:"Document",definitions:[ot]},J=null;function lt(i){if(J&&J[0]===i)return J[1];var t=at(i);return t?t instanceof Error?J?J[1]:se:(J=[i,t],t):se}var De={buttonStyle:{fontSize:"1.2em",padding:"0px",backgroundColor:"white",border:"none",margin:"5px 0px",height:"40px",width:"100%",display:"block",maxWidth:"none"},actionButtonStyle:{padding:"0px",backgroundColor:"white",border:"none",margin:"0px",maxWidth:"none",height:"15px",width:"15px",display:"inline-block",fontSize:"smaller"},explorerActionsStyle:{margin:"4px -8px -8px",paddingLeft:"8px",bottom:"0px",width:"100%",textAlign:"center",background:"none",borderTop:"none",borderBottom:"none"}},st=function(i){q(t,i);function t(){var a,r,e,o;I(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=x(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={newOperationType:"query",displayTitleActions:!1},e._modifySelections=function(n,s){var p=e.props.definition;p.selectionSet.selections.length===0&&e._previousOperationDef&&(p=e._previousOperationDef);var m=void 0;if(p.kind==="FragmentDefinition")m=k({},p,{selectionSet:k({},p.selectionSet,{selections:n})});else if(p.kind==="OperationDefinition"){var h=n.filter(function(w){return!(w.kind==="Field"&&w.name.value==="__typename")});h.length===0&&(h=[{kind:"Field",name:{kind:"Name",value:"__typename ## Placeholder value"}}]),m=k({},p,{selectionSet:k({},p.selectionSet,{selections:h})})}return e.props.onEdit(m,s)},e._onOperationRename=function(n){return e.props.onOperationRename(n.target.value)},e._handlePotentialRun=function(n){et(n)&&tt(e.props.definition.kind)&&e.props.onRunOperation(e.props.name)},e._rootViewElId=function(){var n=e.props,s=n.operationType,p=n.name,m=s+"-"+(p||"unknown");return m},r),x(e,o)}return P(t,[{key:"componentDidMount",value:function(){var r=this._rootViewElId();this.props.onMount(r)}},{key:"render",value:function(){var r=this,e=this.props,o=e.operationType,c=e.definition,f=e.schema,u=e.getDefaultFieldNames,n=e.styleConfig,s=this._rootViewElId(),p=this.props.fields||{},m=c,h=m.selectionSet.selections,w=this.props.name||pe(o)+" Name";return l.createElement("div",{id:s,tabIndex:"0",onKeyDown:this._handlePotentialRun,style:{borderBottom:this.props.isLast?"none":"1px solid #d6d6d6",marginBottom:"0em",paddingBottom:"1em"}},l.createElement("div",{style:{color:n.colors.keyword,paddingBottom:4},className:"graphiql-operation-title-bar",onMouseEnter:function(){return r.setState({displayTitleActions:!0})},onMouseLeave:function(){return r.setState({displayTitleActions:!1})}},o," ",l.createElement("span",{style:{color:n.colors.def}},l.createElement("input",{style:{color:n.colors.def,border:"none",borderBottom:"1px solid #888",outline:"none",width:Math.max(4,w.length)+"ch"},autoComplete:"false",placeholder:pe(o)+" Name",value:this.props.name,onKeyDown:this._handlePotentialRun,onChange:this._onOperationRename})),this.props.onTypeName?l.createElement("span",null,l.createElement("br",null),"on "+this.props.onTypeName):"",this.state.displayTitleActions?l.createElement(l.Fragment,null,l.createElement("button",{type:"submit",className:"toolbar-button",onClick:function(){return r.props.onOperationDestroy()},style:k({},n.styles.actionButtonStyle)},l.createElement("span",null,"\u2715")),l.createElement("button",{type:"submit",className:"toolbar-button",onClick:function(){return r.props.onOperationClone()},style:k({},n.styles.actionButtonStyle)},l.createElement("span",null,"\u2398"))):""),Object.keys(p).sort().map(function(d){return l.createElement(Fe,{key:d,field:p[d],selections:h,modifySelections:r._modifySelections,schema:f,getDefaultFieldNames:u,getDefaultScalarArgValue:r.props.getDefaultScalarArgValue,makeDefaultArg:r.props.makeDefaultArg,onRunOperation:r.props.onRunOperation,styleConfig:r.props.styleConfig,onCommit:r.props.onCommit,definition:r.props.definition,availableFragments:r.props.availableFragments})}))}}]),t}(l.PureComponent);function ut(){return l.createElement("div",{style:{fontFamily:"sans-serif",display:"flex",flexDirection:"column",alignItems:"center",margin:"1em",marginTop:0,flexGrow:1,justifyContent:"flex-end"}},l.createElement("div",{style:{borderTop:"1px solid #d6d6d6",paddingTop:"1em",width:"100%",textAlign:"center"}},"GraphiQL Explorer by ",l.createElement("a",{href:"https://www.onegraph.com"},"OneGraph")),l.createElement("div",null,"Contribute on"," ",l.createElement("a",{href:"https://github.com/OneGraph/graphiql-explorer"},"GitHub")))}var Ve=function(i){q(t,i);function t(){var a,r,e,o;I(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=x(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={newOperationType:"query",operation:null,operationToScrollTo:null},e._resetScroll=function(){var n=e._ref;n&&(n.scrollLeft=0)},e._onEdit=function(n){return e.props.onEdit(n)},e._setAddOperationType=function(n){e.setState({newOperationType:n})},e._handleRootViewMount=function(n){if(!!e.state.operationToScrollTo&&e.state.operationToScrollTo===n){var s=".graphiql-explorer-root #"+n,p=document.querySelector(s);p&&p.scrollIntoView()}},r),x(e,o)}return P(t,[{key:"componentDidMount",value:function(){this._resetScroll()}},{key:"render",value:function(){var r=this,e=this.props,o=e.schema,c=e.query,f=e.makeDefaultArg;if(!o)return l.createElement("div",{style:{fontFamily:"sans-serif"},className:"error-container"},"No Schema Available");var u={colors:this.props.colors||We,checkboxChecked:this.props.checkboxChecked||Ze,checkboxUnchecked:this.props.checkboxUnchecked||Ke,arrowClosed:this.props.arrowClosed||$e,arrowOpen:this.props.arrowOpen||Qe,styles:this.props.styles?k({},De,this.props.styles):De},n=o.getQueryType(),s=o.getMutationType(),p=o.getSubscriptionType();if(!n&&!s&&!p)return l.createElement("div",null,"Missing query type");var m=n&&n.getFields(),h=s&&s.getFields(),w=p&&p.getFields(),d=lt(c),b=this.props.getDefaultFieldNames||Ce,g=this.props.getDefaultScalarArgValue||Oe,_=d.definitions,E=_.map(function(y){return y.kind==="FragmentDefinition"||y.kind==="OperationDefinition"?y:null}).filter(Boolean),A=E.length===0?se.definitions:E,V=function(S,O){var D=O==null||O===""?null:{kind:"Name",value:O,loc:void 0},N=k({},S,{name:D}),C=d.definitions,F=C.map(function(T){return S===T?N:T});return k({},d,{definitions:F})},B=function(S){var O=void 0;S.kind==="FragmentDefinition"?O="fragment":O=S.operation;var D=(S.name&&S.name.value||"")+"Copy",N={kind:"Name",value:D,loc:void 0},C=k({},S,{name:N}),F=d.definitions,T=[].concat(M(F),[C]);return r.setState({operationToScrollTo:O+"-"+D}),k({},d,{definitions:T})},L=function(S){var O=d.definitions,D=O.filter(function(N){return S!==N});return k({},d,{definitions:D})},G=function(S){var O=d.definitions,D=d.definitions.length===1&&d.definitions[0]===se.definitions[0],N=D?[]:O.filter(function(re){return re.kind==="OperationDefinition"?re.operation===S:!1}),C="My"+pe(S)+(N.length===0?"":N.length+1),F="__typename # Placeholder value",T={kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:F,loc:null},arguments:[],directives:[],selectionSet:null,loc:null}],loc:null},K={kind:"OperationDefinition",operation:S,name:{kind:"Name",value:C},variableDefinitions:[],directives:[],selectionSet:T,loc:null},de=D?[K]:[].concat(M(d.definitions),[K]),ve=k({},d,{definitions:de});r.setState({operationToScrollTo:S+"-"+C}),r.props.onEdit((0,v.print)(ve))},U=[m?l.createElement("option",{key:"query",className:"toolbar-button",style:u.styles.buttonStyle,type:"link",value:"query"},"Query"):null,h?l.createElement("option",{key:"mutation",className:"toolbar-button",style:u.styles.buttonStyle,type:"link",value:"mutation"},"Mutation"):null,w?l.createElement("option",{key:"subscription",className:"toolbar-button",style:u.styles.buttonStyle,type:"link",value:"subscription"},"Subscription"):null].filter(Boolean),Z=U.length===0||this.props.hideActions?null:l.createElement("div",{style:{minHeight:"50px",maxHeight:"50px",overflow:"none"}},l.createElement("form",{className:"variable-editor-title graphiql-explorer-actions",style:k({},u.styles.explorerActionsStyle,{display:"flex",flexDirection:"row",alignItems:"center",borderTop:"1px solid rgb(214, 214, 214)"}),onSubmit:function(S){return S.preventDefault()}},l.createElement("span",{style:{display:"inline-block",flexGrow:"0",textAlign:"right"}},"Add new"," "),l.createElement("select",{onChange:function(S){return r._setAddOperationType(S.target.value)},value:this.state.newOperationType,style:{flexGrow:"2"}},U),l.createElement("button",{type:"submit",className:"toolbar-button",onClick:function(){return r.state.newOperationType?G(r.state.newOperationType):null},style:k({},u.styles.buttonStyle,{height:"22px",width:"22px"})},l.createElement("span",null,"+")))),j=this.props.externalFragments&&this.props.externalFragments.reduce(function(y,S){if(S.kind==="FragmentDefinition"){var O=S.typeCondition.name.value,D=y[O]||[],N=[].concat(M(D),[S]).sort(function(C,F){return C.name.value.localeCompare(F.name.value)});return k({},y,_e({},O,N))}return y},{}),ee=A.reduce(function(y,S){if(S.kind==="FragmentDefinition"){var O=S.typeCondition.name.value,D=y[O]||[],N=[].concat(M(D),[S]).sort(function(C,F){return C.name.value.localeCompare(F.name.value)});return k({},y,_e({},O,N))}return y},{}),Y=k({},ee,j),te=this.props.showAttribution?l.createElement(ut,null):null;return l.createElement("div",{ref:function(S){r._ref=S},style:{fontSize:12,textOverflow:"ellipsis",whiteSpace:"nowrap",margin:0,padding:8,fontFamily:'Consolas, Inconsolata, "Droid Sans Mono", Monaco, monospace',display:"flex",flexDirection:"column",height:"100%"},className:"graphiql-explorer-root"},l.createElement("div",{style:{flexGrow:"1",overflow:"scroll"}},A.map(function(y,S){var O=y&&y.name&&y.name.value,D=y.kind==="FragmentDefinition"?"fragment":y&&y.operation||"query",N=function(z){var Q=V(y,z);r.props.onEdit((0,v.print)(Q))},C=function(){var z=B(y);r.props.onEdit((0,v.print)(z))},F=function(){var z=L(y);r.props.onEdit((0,v.print)(z))},T=y.kind==="FragmentDefinition"&&y.typeCondition.kind==="NamedType"&&o.getType(y.typeCondition.name.value),K=T instanceof v.GraphQLObjectType?T.getFields():null,de=D==="query"?m:D==="mutation"?h:D==="subscription"?w:y.kind==="FragmentDefinition"?K:null,ve=y.kind==="FragmentDefinition"?y.typeCondition.name.value:null,re=function(z){var Q=(0,v.print)(z);r.props.onEdit(Q)};return l.createElement(st,{key:S,isLast:S===A.length-1,fields:de,operationType:D,name:O,definition:y,onOperationRename:N,onOperationDestroy:F,onOperationClone:C,onTypeName:ve,onMount:r._handleRootViewMount,onCommit:re,onEdit:function(z,Q){var ge=void 0;if((typeof Q=="undefined"?"undefined":ze(Q))==="object"&&typeof Q.commit!="undefined"?ge=Q.commit:ge=!0,z){var ye=k({},d,{definitions:d.definitions.map(function(Pe){return Pe===y?z:Pe})});return ge&&re(ye),ye}else return d},schema:o,getDefaultFieldNames:b,getDefaultScalarArgValue:g,makeDefaultArg:f,onRunOperation:function(){r.props.onRunOperation&&r.props.onRunOperation(O)},styleConfig:u,availableFragments:Y})}),te),Z)}}]),t}(l.PureComponent);Ve.defaultProps={getDefaultFieldNames:Ce,getDefaultScalarArgValue:Oe};var pt=function(i){q(t,i);function t(){var a,r,e,o;I(this,t);for(var c=arguments.length,f=Array(c),u=0;u<c;u++)f[u]=arguments[u];return o=(r=(e=x(this,(a=t.__proto__||Object.getPrototypeOf(t)).call.apply(a,[this].concat(f))),e),e.state={hasError:!1,error:null,errorInfo:null},r),x(e,o)}return P(t,[{key:"componentDidCatch",value:function(r,e){this.setState({hasError:!0,error:r,errorInfo:e}),console.error("Error in component",r,e)}},{key:"render",value:function(){return this.state.hasError?l.createElement("div",{style:{padding:18,fontFamily:"sans-serif"}},l.createElement("div",null,"Something went wrong"),l.createElement("details",{style:{whiteSpace:"pre-wrap"}},this.state.error?this.state.error.toString():null,l.createElement("br",null),this.state.errorInfo?this.state.errorInfo.componentStack:null)):this.props.children}}]),t}(l.Component),fe=function(i){q(t,i);function t(){return I(this,t),x(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return P(t,[{key:"render",value:function(){return l.createElement("div",{className:"docExplorerWrap",style:{height:"100%",width:this.props.width,minWidth:this.props.width,zIndex:7,display:this.props.explorerIsOpen?"flex":"none",flexDirection:"column",overflow:"hidden"}},l.createElement("div",{className:"doc-explorer-title-bar"},l.createElement("div",{className:"doc-explorer-title"},this.props.title),l.createElement("div",{className:"doc-explorer-rhs"},l.createElement("div",{className:"docExplorerHide",onClick:this.props.onToggleExplorer},"\u2715"))),l.createElement("div",{className:"doc-explorer-contents",style:{padding:"0px",overflowY:"unset"}},l.createElement(pt,null,l.createElement(Ve,this.props))))}}]),t}(l.PureComponent);fe.defaultValue=ce,fe.defaultProps={width:320,title:"Explorer"},ae.default=fe,Object.defineProperty(ie,"__esModule",{value:!0}),ie.Explorer=void 0;var ct=ae,Te=ft(ct);function ft(i){return i&&i.__esModule?i:{default:i}}ie.Explorer=Te.default;var mt=ie.default=Te.default,Et=(()=>`.docExplorerWrap{height:unset!important;min-width:unset!important;width:unset!important}.doc-explorer-title{font-size:var(--font-size-h2);font-weight:var(--font-weight-medium)}.doc-explorer-rhs{display:none}.graphiql-explorer-root{font-family:var(--font-family-mono)!important;font-size:var(--font-size-body)!important;padding:0!important}.graphiql-explorer-root>div:first-child{padding-left:var(--px-8)}.graphiql-explorer-root input{background:hsl(var(--color-base))}.graphiql-explorer-root select{background-color:hsl(var(--color-base));border:1px solid hsla(var(--color-neutral),.6);border-radius:var(--border-radius-4);color:hsl(var(--color-neutral));margin:0 var(--px-4);padding:var(--px-4) var(--px-6)} | ||
`)(),me={exports:{}},X={};/* | ||
object-assign | ||
(c) Sindre Sorhus | ||
@license MIT | ||
*/var je=Object.getOwnPropertySymbols,yt=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable;function bt(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function St(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;var n=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(n.join("")!=="0123456789")return!1;var e={};return"abcdefghijklmnopqrst".split("").forEach(function(o){e[o]=o}),Object.keys(Object.assign({},e)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}St();/** @license React v17.0.2 | ||
*/var Ne=Object.getOwnPropertySymbols,dt=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable;function gt(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function yt(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;var r=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(r.join("")!=="0123456789")return!1;var e={};return"abcdefghijklmnopqrst".split("").forEach(function(o){e[o]=o}),Object.keys(Object.assign({},e)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}yt();/** @license React v17.0.2 | ||
* react-jsx-runtime.production.min.js | ||
@@ -12,2 +13,2 @@ * | ||
* LICENSE file in the root directory of this source tree. | ||
*/var kt=ke,Re=60103;if(ee.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var Le=Symbol.for;Re=Le("react.element"),ee.Fragment=Le("react.fragment")}var _t=kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ct=Object.prototype.hasOwnProperty,Et={key:!0,ref:!0,__self:!0,__source:!0};function Me(i,t,a){var n,e={},o=null,c=null;a!==void 0&&(o=""+a),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(c=t.ref);for(n in t)Ct.call(t,n)&&!Et.hasOwnProperty(n)&&(e[n]=t[n]);if(i&&i.defaultProps)for(n in t=i.defaultProps,t)e[n]===void 0&&(e[n]=t[n]);return{$$typeof:Re,type:i,key:o,ref:c,props:e,_owner:_t.current}}ee.jsx=Me,ee.jsxs=Me,me.exports=ee;const P=me.exports.jsx,Pe=me.exports.jsxs;function At(i){const{setOperationName:t}=j.useEditorContext({nonNull:!0}),{schema:a}=j.useSchemaContext({nonNull:!0}),{run:n}=j.useExecutionContext({nonNull:!0});return P(gt,he({schema:a,onRunOperation:e=>{e&&t(e),n()},explorerIsOpen:!0,colors:{keyword:"hsl(var(--color-primary))",def:"hsl(var(--color-tertiary))",property:"hsl(var(--color-info))",qualifier:"hsl(var(--color-secondary))",attribute:"hsl(var(--color-info))",number:"hsl(var(--color-success))",string:"hsl(var(--color-warning))",builtin:"hsl(var(--color-success))",string2:"hsl(var(--color-secondary))",variable:"hsl(var(--color-secondary))",atom:"hsl(var(--color-tertiary))"},arrowOpen:P("svg",{viewBox:"0 -4 13 15",style:{color:"hsla(var(--color-neutral), 0.4)",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:P("path",{d:"M3.35355 6.85355L6.14645 9.64645C6.34171 9.84171 6.65829 9.84171 6.85355 9.64645L9.64645 6.85355C9.96143 6.53857 9.73835 6 9.29289 6L3.70711 6C3.26165 6 3.03857 6.53857 3.35355 6.85355Z",fill:"currentColor"})}),arrowClosed:P("svg",{viewBox:"0 -2 13 15",style:{color:"hsla(var(--color-neutral), 0.4)",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:P("path",{d:"M6.35355 11.1464L9.14645 8.35355C9.34171 8.15829 9.34171 7.84171 9.14645 7.64645L6.35355 4.85355C6.03857 4.53857 5.5 4.76165 5.5 5.20711V10.7929C5.5 11.2383 6.03857 11.4614 6.35355 11.1464Z",fill:"currentColor"})}),checkboxUnchecked:P("svg",{viewBox:"0 0 15 15",style:{color:"hsla(var(--color-neutral), 0.4)",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:P("circle",{cx:"7.5",cy:"7.5",r:"6",stroke:"currentColor",fill:"none"})}),checkboxChecked:Pe("svg",{viewBox:"0 0 15 15",style:{color:"hsl(var(--color-info))",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:[P("circle",{cx:"7.5",cy:"7.5",r:"7.5",fill:"currentColor"}),P("path",{d:"M4.64641 7.00106L6.8801 9.23256L10.5017 5.61325",fill:"none",stroke:"white",strokeWidth:"1.5"})]}),styles:{buttonStyle:{backgroundColor:"transparent",border:"none",color:"hsla(var(--color-neutral), 0.6)",cursor:"pointer",fontSize:"1em"},explorerActionsStyle:{padding:"var(--px-8) var(--px-4)"},actionButtonStyle:{backgroundColor:"transparent",border:"none",color:"hsla(var(--color-neutral), 0.6)",cursor:"pointer",fontSize:"1em"}}},i))}function Ot(i){const t=M.useRef(i);return t.current=i,M.useMemo(()=>({title:"GraphiQL Explorer",icon:()=>Pe("svg",{height:"1em",strokeWidth:"1.5",viewBox:"0 0 24 24",fill:"none",children:[P("path",{d:"M18 6H20M22 6H20M20 6V4M20 6V8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),P("path",{d:"M21.4 20H2.6C2.26863 20 2 19.7314 2 19.4V11H21.4C21.7314 11 22 11.2686 22 11.6V19.4C22 19.7314 21.7314 20 21.4 20Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),P("path",{d:"M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]}),content:()=>P(At,he({},t.current))}),[])}N.useExplorerPlugin=Ot,Object.defineProperty(N,"__esModule",{value:!0}),N[Symbol.toStringTag]="Module"}); | ||
*/var ht=Se,je=60103;if(X.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var Re=Symbol.for;je=Re("react.element"),X.Fragment=Re("react.fragment")}var bt=ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,St=Object.prototype.hasOwnProperty,kt={key:!0,ref:!0,__self:!0,__source:!0};function Le(i,t,a){var r,e={},o=null,c=null;a!==void 0&&(o=""+a),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(c=t.ref);for(r in t)St.call(t,r)&&!kt.hasOwnProperty(r)&&(e[r]=t[r]);if(i&&i.defaultProps)for(r in t=i.defaultProps,t)e[r]===void 0&&(e[r]=t[r]);return{$$typeof:je,type:i,key:o,ref:c,props:e,_owner:bt.current}}X.jsx=Le,X.jsxs=Le,me.exports=X;const R=me.exports.jsx,Me=me.exports.jsxs;function _t(i){const{setOperationName:t}=$.useEditorContext({nonNull:!0}),{schema:a}=$.useSchemaContext({nonNull:!0}),{run:r}=$.useExecutionContext({nonNull:!0});return R(mt,{schema:a,onRunOperation:e=>{e&&t(e),r()},explorerIsOpen:!0,colors:{keyword:"hsl(var(--color-primary))",def:"hsl(var(--color-tertiary))",property:"hsl(var(--color-info))",qualifier:"hsl(var(--color-secondary))",attribute:"hsl(var(--color-info))",number:"hsl(var(--color-success))",string:"hsl(var(--color-warning))",builtin:"hsl(var(--color-success))",string2:"hsl(var(--color-secondary))",variable:"hsl(var(--color-secondary))",atom:"hsl(var(--color-tertiary))"},arrowOpen:R("svg",{viewBox:"0 -4 13 15",style:{color:"hsla(var(--color-neutral), 0.4)",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:R("path",{d:"M3.35355 6.85355L6.14645 9.64645C6.34171 9.84171 6.65829 9.84171 6.85355 9.64645L9.64645 6.85355C9.96143 6.53857 9.73835 6 9.29289 6L3.70711 6C3.26165 6 3.03857 6.53857 3.35355 6.85355Z",fill:"currentColor"})}),arrowClosed:R("svg",{viewBox:"0 -2 13 15",style:{color:"hsla(var(--color-neutral), 0.4)",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:R("path",{d:"M6.35355 11.1464L9.14645 8.35355C9.34171 8.15829 9.34171 7.84171 9.14645 7.64645L6.35355 4.85355C6.03857 4.53857 5.5 4.76165 5.5 5.20711V10.7929C5.5 11.2383 6.03857 11.4614 6.35355 11.1464Z",fill:"currentColor"})}),checkboxUnchecked:R("svg",{viewBox:"0 0 15 15",style:{color:"hsla(var(--color-neutral), 0.4)",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:R("circle",{cx:"7.5",cy:"7.5",r:"6",stroke:"currentColor",fill:"none"})}),checkboxChecked:Me("svg",{viewBox:"0 0 15 15",style:{color:"hsl(var(--color-info))",marginRight:"var(--px-4)",height:"var(--px-16)",width:"var(--px-16)"},children:[R("circle",{cx:"7.5",cy:"7.5",r:"7.5",fill:"currentColor"}),R("path",{d:"M4.64641 7.00106L6.8801 9.23256L10.5017 5.61325",fill:"none",stroke:"white",strokeWidth:"1.5"})]}),styles:{buttonStyle:{backgroundColor:"transparent",border:"none",color:"hsla(var(--color-neutral), 0.6)",cursor:"pointer",fontSize:"1em"},explorerActionsStyle:{padding:"var(--px-8) var(--px-4)"},actionButtonStyle:{backgroundColor:"transparent",border:"none",color:"hsla(var(--color-neutral), 0.6)",cursor:"pointer",fontSize:"1em"}},...i})}function Ct(i){const t=ue.useRef(i);return t.current=i,ue.useMemo(()=>({title:"GraphiQL Explorer",icon:()=>Me("svg",{height:"1em",strokeWidth:"1.5",viewBox:"0 0 24 24",fill:"none",children:[R("path",{d:"M18 6H20M22 6H20M20 6V4M20 6V8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),R("path",{d:"M21.4 20H2.6C2.26863 20 2 19.7314 2 19.4V11H21.4C21.7314 11 22 11.2686 22 11.6V19.4C22 19.7314 21.7314 20 21.4 20Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),R("path",{d:"M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]}),content:()=>R(_t,{...t.current})}),[])}H.useExplorerPlugin=Ct,Object.defineProperties(H,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); |
{ | ||
"name": "@graphiql/plugin-explorer", | ||
"version": "0.1.0", | ||
"version": "0.1.1-canary-d5a222ad.0", | ||
"main": "dist/graphiql-plugin-explorer.cjs.js", | ||
@@ -29,3 +29,3 @@ "module": "dist/graphiql-plugin-explorer.es.js", | ||
"peerDependencies": { | ||
"@graphiql/react": "^0.11.1", | ||
"@graphiql/react": "^0.11.2-canary-d5a222ad.0", | ||
"graphql": "^16.4.0", | ||
@@ -38,4 +38,4 @@ "react": "^18.2.0", | ||
"typescript": "^4.6.3", | ||
"vite": "^2.9.5" | ||
"vite": "^2.9.13" | ||
} | ||
} |
@@ -12,3 +12,3 @@ declare module 'graphiql-explorer' { | ||
} from 'graphql'; | ||
import { ComponentType, ReactNode } from 'react'; | ||
import { ComponentType, ReactNode, CSSProperties } from 'react'; | ||
@@ -51,7 +51,7 @@ export type GraphiQLExplorerProps = { | ||
checkboxUnchecked?: ReactNode | null; | ||
styles?: ?{ | ||
explorerActionsStyle?: { [key: string]: any }; | ||
buttonStyle?: { [key: string]: any }; | ||
actionButtonStyle?: { [key: string]: any }; | ||
}; | ||
styles?: { | ||
explorerActionsStyle?: CSSProperties; | ||
buttonStyle?: CSSProperties; | ||
actionButtonStyle?: CSSProperties; | ||
} | null; | ||
showAttribution: boolean; | ||
@@ -58,0 +58,0 @@ hideActions?: boolean; |
@@ -12,3 +12,3 @@ declare module 'graphiql-explorer' { | ||
} from 'graphql'; | ||
import { ComponentType, ReactNode } from 'react'; | ||
import { ComponentType, ReactNode, CSSProperties } from 'react'; | ||
@@ -51,7 +51,7 @@ export type GraphiQLExplorerProps = { | ||
checkboxUnchecked?: ReactNode | null; | ||
styles?: ?{ | ||
explorerActionsStyle?: { [key: string]: any }; | ||
buttonStyle?: { [key: string]: any }; | ||
actionButtonStyle?: { [key: string]: any }; | ||
}; | ||
styles?: { | ||
explorerActionsStyle?: CSSProperties; | ||
buttonStyle?: CSSProperties; | ||
actionButtonStyle?: CSSProperties; | ||
} | null; | ||
showAttribution: boolean; | ||
@@ -58,0 +58,0 @@ hideActions?: boolean; |
import { GraphiQLPlugin } from '@graphiql/react'; | ||
import { GraphiQLExplorerProps } from 'graphiql-explorer'; | ||
import './graphiql-explorer.d.ts'; | ||
import './index.css'; | ||
export declare function useExplorerPlugin(props: GraphiQLExplorerProps): GraphiQLPlugin; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
208634
3401