This commit is contained in:
cmedina committed 2024-09-09 07:44:04 -04:00
1 parent 51da011d12
commit 7f6116450f
187 files changed
+81911 -388

No files matched your search

@@ -0,0 +1,333 @@
try{
(()=>{var dc=Object.create;var za=Object.defineProperty;var uc=Object.getOwnPropertyDescriptor;var mc=Object.getOwnPropertyNames;var pc=Object.getPrototypeOf,hc=Object.prototype.hasOwnProperty;var Jt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ua=(e,t)=>()=>(e&&(t=e(e=0)),t);var fc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gc=(e,t)=>{for(var n in t)za(e,n,{get:t[n],enumerable:!0})},el=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of mc(t))!hc.call(e,i)&&i!==n&&za(e,i,{get:()=>t[i],enumerable:!(r=uc(t,i))||r.enumerable});return e};var vc=(e,t,n)=>(n=e!=null?dc(pc(e)):{},el(t||!e||!e.__esModule?za(n,"default",{value:e,enumerable:!0}):n,e)),tl=e=>el(za({},"__esModule",{value:!0}),e);var Ee=Ua(()=>{});var Ke,ke=Ua(()=>{Ke={NODE_ENV:"production",NODE_PATH:[],STORYBOOK:"true",PUBLIC_URL:".",REACT_APP_FIREBASE_API_KEY:"AIzaSyBF08201QSA6WE1kgkSxOA9uGw_WeHepsM",REACT_APP_FIREBASE_AUTH_DOMAIN:"fibonacci-fold.firebaseapp.com",REACT_APP_FIREBASE_DATABASE_URL:"https://fibonacci-fold-default-rtdb.firebaseio.com",REACT_APP_FIREBASE_PROJECT_ID:"fibonacci-fold",REACT_APP_FIREBASE_STORAGE_BUCKET:"fibonacci-fold.appspot.com",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"1045946969690",REACT_APP_FIREBASE_APP_ID:"1:1045946969690:web:25bd68760c48adfe40f263",REACT_APP_FIREBASE_MEASUREMENT_ID:"G-KLD89FXCRC"}});var we=Ua(()=>{});var $a={};gc($a,{Children:()=>bc,Component:()=>Vt,Fragment:()=>Ec,Profiler:()=>kc,PureComponent:()=>wc,StrictMode:()=>Cc,Suspense:()=>Sc,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>xc,cloneElement:()=>Mc,createContext:()=>Je,createElement:()=>x,createFactory:()=>Nc,createRef:()=>Fc,default:()=>a,forwardRef:()=>Q,isValidElement:()=>si,lazy:()=>Ac,memo:()=>Oc,startTransition:()=>Lc,unstable_act:()=>Tc,useCallback:()=>W,useContext:()=>Xt,useDebugValue:()=>_c,useDeferredValue:()=>Zc,useEffect:()=>oe,useId:()=>Ic,useImperativeHandle:()=>Rc,useInsertionEffect:()=>Bc,useLayoutEffect:()=>Pc,useMemo:()=>jt,useReducer:()=>ci,useRef:()=>Pe,useState:()=>Re,useSyncExternalStore:()=>Vc,useTransition:()=>jc,version:()=>Hc});var a,bc,Vt,Ec,kc,wc,Cc,Sc,xc,Mc,Je,x,Nc,Fc,Q,si,Ac,Oc,Lc,Tc,W,Xt,_c,Zc,oe,Ic,Rc,Bc,Pc,jt,ci,Pe,Re,Vc,jc,Hc,qn=Ua(()=>{Ee();ke();we();a=__REACT__,{Children:bc,Component:Vt,Fragment:Ec,Profiler:kc,PureComponent:wc,StrictMode:Cc,Suspense:Sc,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:xc,cloneElement:Mc,createContext:Je,createElement:x,createFactory:Nc,createRef:Fc,forwardRef:Q,isValidElement:si,lazy:Ac,memo:Oc,startTransition:Lc,unstable_act:Tc,useCallback:W,useContext:Xt,useDebugValue:_c,useDeferredValue:Zc,useEffect:oe,useId:Ic,useImperativeHandle:Rc,useInsertionEffect:Bc,useLayoutEffect:Pc,useMemo:jt,useReducer:ci,useRef:Pe,useState:Re,useSyncExternalStore:Vc,useTransition:jc,version:Hc}=__REACT__});var vl=fc((Jn,vi)=>{Ee();ke();we();(function(e,t){typeof Jn=="object"&&typeof vi=="object"?vi.exports=t((qn(),tl($a))):typeof define=="function"&&define.amd?define(["react"],t):typeof Jn=="object"?Jn.ReactConfetti=t((qn(),tl($a))):e.ReactConfetti=t(e.React)})(typeof self<"u"?self:Jn,function(e){return function(t){var n={};function r(i){if(n[i])return n[i].exports;var o=n[i]={i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=n,r.d=function(i,o,l){r.o(i,o)||Object.defineProperty(i,o,{enumerable:!0,get:l})},r.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,o){if(1&o&&(i=r(i)),8&o||4&o&&typeof i=="object"&&i&&i.__esModule)return i;var l=Object.create(null);if(r.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:i}),2&o&&typeof i!="string")for(var s in i)r.d(l,s,(function(c){return i[c]}).bind(null,s));return l},r.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(o,"a",o),o},r.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},r.p="",r(r.s=2)}([function(t,n){t.exports=e},function(t,n,r){"use strict";var i={linear:function(o,l,s,c){return(s-l)*o/c+l},easeInQuad:function(o,l,s,c){return(s-l)*(o/=c)*o+l},easeOutQuad:function(o,l,s,c){return-(s-l)*(o/=c)*(o-2)+l},easeInOutQuad:function(o,l,s,c){var d=s-l;return(o/=c/2)<1?d/2*o*o+l:-d/2*(--o*(o-2)-1)+l},easeInCubic:function(o,l,s,c){return(s-l)*(o/=c)*o*o+l},easeOutCubic:function(o,l,s,c){return(s-l)*((o=o/c-1)*o*o+1)+l},easeInOutCubic:function(o,l,s,c){var d=s-l;return(o/=c/2)<1?d/2*o*o*o+l:d/2*((o-=2)*o*o+2)+l},easeInQuart:function(o,l,s,c){return(s-l)*(o/=c)*o*o*o+l},easeOutQuart:function(o,l,s,c){return-(s-l)*((o=o/c-1)*o*o*o-1)+l},easeInOutQuart:function(o,l,s,c){var d=s-l;return(o/=c/2)<1?d/2*o*o*o*o+l:-d/2*((o-=2)*o*o*o-2)+l},easeInQuint:function(o,l,s,c){return(s-l)*(Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function j(C){return(j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M})(C)}function Y(){return(Y=Object.assign||function(C){for(var M=1;M<arguments.length;M++){var F=arguments[M];for(var N in F)Object.prototype.hasOwnProperty.call(F,N)&&(C[N]=F[N])}return C}).apply(this,arguments)}function J(C,M){var F=Object.keys(C);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(C);M&&(N=N.filter(function(ie){return Object.getOwnPropertyDescriptor(C,ie).enumerable})),F.push.apply(F,N)}return F}function ce(C){for(var M=1;M<arguments.length;M++){var F=arguments[M]!=null?arguments[M]:{};M%2?J(Object(F),!0).forEach(function(N){Kt(C,N,F[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(F)):J(Object(F)).forEach(function(N){Object.defineProperty(C,N,Object.getOwnPropertyDescriptor(F,N))})}return C}function Se(C,M){return function(F){if(Array.isArray(F))return F}(C)||function(F,N){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(F)))){var ie=[],re=!0,P=!1,ve=void 0;try{for(var be,fe=F[Symbol.iterator]();!(re=(be=fe.next()).done)&&(ie.push(be.value),!N||ie.length!==N);re=!0);}catch(Ze){P=!0,ve=Ze}finally{try{re||fe.return==null||fe.return()}finally{if(P)throw ve}}return ie}}(C,M)||Oe(C,M)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Oe(C,M){if(C){if(typeof C=="string")return xe(C,M);var F=Object.prototype.toString.call(C).slice(8,-1);return F==="Object"&&C.constructor&&(F=C.constructor.name),F==="Map"||F==="Set"?Array.from(C):F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F)?xe(C,M):void 0}}function xe(C,M){(M==null||M>C.length)&&(M=C.length);for(var F=0,N=new Array(M);F<M;F++)N[F]=C[F];return N}function Qe(C,M){if(!(C instanceof M))throw new TypeError("Cannot call a class as a function")}function ge(C,M){for(var F=0;F<M.length;F++){var N=M[F];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(C,N.key,N)}}function Fe(C,M){return(Fe=Object.setPrototypeOf||function(F,N){return F.__proto__=N,F})(C,M)}function Bt(C){var M=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var F,N=Dn(C);if(M){var ie=Dn(this).constructor;F=Reflect.construct(N,arguments,ie)}else F=N.apply(this,arguments);return _e(this,F)}}function _e(C,M){return!M||j(M)!=="object"&&typeof M!="function"?bt(C):M}function bt(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function Dn(C){return(Dn=Object.setPrototypeOf?Object.getPrototypeOf:function(M){return M.__proto__||Object.getPrototypeOf(M)})(C)}function Kt(C,M,F){return M in C?Object.defineProperty(C,M,{value:F,enumerable:!0,configurable:!0,writable:!0}):C[M]=F,C}var ri=s.a.createRef(),zn=function(C){(function(P,ve){if(typeof ve!="function"&&ve!==null)throw new TypeError("Super expression must either be null or a function");P.prototype=Object.create(ve&&ve.prototype,{constructor:{value:P,writable:!0,configurable:!0}}),ve&&Fe(P,ve)})(re,C);var M,F,N,ie=Bt(re);function re(P){var ve;Qe(this,re);for(var be=arguments.length,fe=new Array(be>1?be-1:0),Ze=1;Ze<be;Ze++)fe[Ze-1]=arguments[Ze];return Kt(bt(ve=ie.call.apply(ie,[this,P].concat(fe))),"canvas",s.a.createRef()),Kt(bt(ve),"confetti",void 0),ve.canvas=P.canvasRef||ri,ve}return M=re,(F=[{key:"componentDidMount",value:function(){if(this.canvas.current){var P=Un(this.props)[0];this.confetti=new S(this.canvas.current,P)}}},{key:"componentDidUpdate",value:function(){var P=Un(this.props)[0];this.confetti&&(this.confetti.options=P)}},{key:"componentWillUnmount",value:function(){this.confetti&&this.confetti.stop(),this.confetti=void 0}},{key:"render",value:function(){var P=Se(Un(this.props),2),ve=P[0],be=P[1],fe=ce({zIndex:2,position:"absolute",pointerEvents:"none",top:0,left:0,bottom:0,right:0},be.style);return s.a.createElement("canvas",Y({width:ve.width,height:ve.height,ref:this.canvas},be,{style:fe}))}}])&&ge(M.prototype,F),N&&ge(M,N),re}(l.Component);function Un(C){var M={},F={},N=[].concat(B(Object.keys(E)),["confettiSource","drawShape","onConfettiComplete"]),ie=["canvasRef"];for(var re in C){var P=C[re];N.includes(re)?M[re]=P:ie.includes(re)?ie[re]=P:F[re]=P}return[M,F,{}]}Kt(zn,"defaultProps",ce({},E)),Kt(zn,"displayName","ReactConfetti");var Da=s.a.forwardRef(function(C,M){return s.a.createElement(zn,Y({canvasRef:M},C))});n.default=Da}]).default})});Ee();ke();we();Ee();ke();we();qn();qn();Ee();ke();we();var uf=__STORYBOOK_API__,{ActiveTabs:mf,Consumer:pf,ManagerContext:hf,Provider:ff,RequestResponseError:gf,addons:Yn,combineParameters:vf,controlOrMetaKey:yf,controlOrMetaSymbol:bf,eventMatchesShortcut:Ef,eventToShortcut:kf,experimental_requestResponse:wf,isMacLike:Cf,isShortcutTaken:Sf,keyToSymbol:xf,merge:Mf,mockChannel:Nf,optionOrAltSymbol:Ff,shortcutMatchesShortcut:Af,shortcutToHumanString:Of,types:Lf,useAddonState:nl,useArgTypes:Tf,useArgs:_f,useChannel:di,useGlobalTypes:al,useGlobals:rl,useParameter:il,useSharedState:Zf,useStoryPrepared:If,useStorybookApi:vn,useStorybookState:yn}=__STORYBOOK_API__;Ee();ke();we();var jf=__STORYBOOK_THEMING__,{CacheProvider:Hf,ClassNames:Df,Global:zf,ThemeProvider:Uf,background:$f,color:Lt,convert:Wf,create:Gf,createCache:qf,createGlobal:Yf,createReset:Qf,css:pe,darken:Kf,ensure:Jf,ignoreSsrWarning:Xf,isPropValid:e8,jsx:t8,keyframes:Ht,lighten:n8,styled:w,themes:a8,typography:r8,useTheme:en,withTheme:i8}=__STORYBOOK_THEMING__;Ee();ke();we();var d8=__STORYBOOK_TYPES__,{Addon_TypesEnum:Wa}=__STORYBOOK_TYPES__;Ee();ke();we();var f8=__STORYBOOK_COMPONENTS__,{A:g8,ActionBar:v8,AddonPanel:y8,Badge:ui,Bar:b8,Blockquote:E8,Button:mi,ClipboardCode:k8,Code:ol,DL:w8,Div:C8,DocumentWrapper:S8,EmptyTabContent:x8,ErrorFormatter:M8,FlexBar:N8,Form:F8,H1:A8,H2:O8,H3:L8,H4:T8,H5:_8,H6:Z8,HR:I8,IconButton:ll,IconButtonSkeleton:R8,Icons:B8,Img:P8,LI:V8,Link:bn,ListItem:j8,Loader:pi,Modal:H8,OL:D8,P:z8,Placeholder:U8,Pre:$8,ResetWrapper:W8,ScrollArea:G8,Separator:q8,Spaced:Y8,Span:Q8,StorybookIcon:K8,StorybookLogo:J8,Symbols:X8,SyntaxHighlight Line truncated
`),n="",r=0,i=0,o=t.length-1,l=0;l<t.length;l++)Ga.lastIndex=0,Ga.test(t[l])&&(l&&(!r||Ga.lastIndex<r)&&(r=Ga.lastIndex),i=i||l,o=l);for(var s=i;s<=o;s++)s!==i&&(n+=`
`),n+=t[s].slice(r).replace(/\\"""/g,'"""');return n}function ae(){for(var e=0|Ce.charCodeAt(ee++);e===9||e===10||e===13||e===32||e===35||e===44||e===65279;e=0|Ce.charCodeAt(ee++))if(e===35)for(;(e=Ce.charCodeAt(ee++))!==10&&e!==13;);ee--}var bs=/[_A-Za-z]\w*/y;function Nt(){var e;if(e=Xe(bs))return{kind:"Name",value:e}}var b5=/(?:null|true|false)/y,Es=/\$[_A-Za-z]\w*/y,E5=/-?\d+/y,k5=/(?:\.\d+)?[eE][+-]?\d+|\.\d+/y,w5=/\\/g,C5=/"""(?:"""|(?:[\s\S]*?[^\\])""")/y,S5=/"(?:"|[^\r\n]*?[^\\]")/y;function ur(e){var t,n;if(n=Xe(b5))t=n==="null"?{kind:"NullValue"}:{kind:"BooleanValue",value:n==="true"};else if(!e&&(n=Xe(Es)))t={kind:"Variable",name:{kind:"Name",value:n.slice(1)}};else if(n=Xe(E5)){var r=n;(n=Xe(k5))?t={kind:"FloatValue",value:r+n}:t={kind:"IntValue",value:r}}else if(n=Xe(bs))t={kind:"EnumValue",value:n};else if(n=Xe(C5))t={kind:"StringValue",value:y5(n.slice(3,-3)),block:!0};else if(n=Xe(S5))t={kind:"StringValue",value:w5.test(n)?JSON.parse(n):n.slice(1,-1),block:!1};else if(t=function(i){var o;if(Ce.charCodeAt(ee)===91){ee++,ae();for(var l=[];o=ur(i);)l.push(o);if(Ce.charCodeAt(ee++)!==93)throw Te("ListValue");return ae(),{kind:"ListValue",values:l}}}(e)||function(i){if(Ce.charCodeAt(ee)===123){ee++,ae();for(var o=[],l;l=Nt();){if(ae(),Ce.charCodeAt(ee++)!==58)throw Te("ObjectField");ae();var s=ur(i);if(!s)throw Te("ObjectField");o.push({kind:"ObjectField",name:l,value:s})}if(Ce.charCodeAt(ee++)!==125)throw Te("ObjectValue");return ae(),{kind:"ObjectValue",fields:o}}}(e))return t;return ae(),t}function ks(e){var t=[];if(ae(),Ce.charCodeAt(ee)===40){ee++,ae();for(var n;n=Nt();){if(ae(),Ce.charCodeAt(ee++)!==58)throw Te("Argument");ae();var r=ur(e);if(!r)throw Te("Argument");t.push({kind:"Argument",name:n,value:r})}if(!t.length||Ce.charCodeAt(ee++)!==41)throw Te("Argument");ae()}return t}function An(e){var t=[];for(ae();Ce.charCodeAt(ee)===64;){ee++;var n=Nt();if(!n)throw Te("Directive");ae(),t.push({kind:"Directive",name:n,arguments:ks(e)})}return t}function x5(){var e=Nt();if(e){ae();var t;if(Ce.charCodeAt(ee)===58){if(ee++,ae(),t=e,!(e=Nt()))throw Te("Field");ae()}return{kind:"Field",alias:t,name:e,arguments:ks(!1),directives:An(!1),selectionSet:Dr()}}}function ws(){var e;if(ae(),Ce.charCodeAt(ee)===91){ee++,ae();var t=ws();if(!t||Ce.charCodeAt(ee++)!==93)throw Te("ListType");e={kind:"ListType",type:t}}else if(e=Nt())e={kind:"NamedType",name:e};else throw Te("NamedType");return ae(),Ce.charCodeAt(ee)===33?(ee++,ae(),{kind:"NonNullType",type:e}):e}var M5=/on/y;function Cs(){if(Xe(M5)){ae();var e=Nt();if(!e)throw Te("NamedType");return ae(),{kind:"NamedType",name:e}}}var N5=/\.\.\./y;function F5(){if(Xe(N5)){ae();var e=ee,t;if((t=Nt())&&t.value!=="on")return{kind:"FragmentSpread",name:t,directives:An(!1)};ee=e;var n=Cs(),r=An(!1),i=Dr();if(!i)throw Te("InlineFragment");return{kind:"InlineFragment",typeCondition:n,directives:r,selectionSet:i}}}function Dr(){var e;if(ae(),Ce.charCodeAt(ee)===123){ee++,ae();for(var t=[];e=F5()||x5();)t.push(e);if(!t.length||Ce.charCodeAt(ee++)!==125)throw Te("SelectionSet");return ae(),{kind:"SelectionSet",selections:t}}}var A5=/fragment/y;function O5(){if(Xe(A5)){ae();var e=Nt();if(!e)throw Te("FragmentDefinition");ae();var t=Cs();if(!t)throw Te("FragmentDefinition");var n=An(!1),r=Dr();if(!r)throw Te("FragmentDefinition");return{kind:"FragmentDefinition",name:e,typeCondition:t,directives:n,selectionSet:r}}}var L5=/(?:query|mutation|subscription)/y;function T5(){var e,t,n=[],r=[];(e=Xe(L5))&&(ae(),t=Nt(),n=function(){var o,l=[];if(ae(),Ce.charCodeAt(ee)===40){for(ee++,ae();o=Xe(Es);){if(ae(),Ce.charCodeAt(ee++)!==58)throw Te("VariableDefinition");var s=ws(),c=void 0;if(Ce.charCodeAt(ee)===61&&(ee++,ae(),!(c=ur(!0))))throw Te("VariableDefinition");ae(),l.push({kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:o.slice(1)}},type:s,defaultValue:c,directives:An(!0)})}if(Ce.charCodeAt(ee++)!==41)throw Te("VariableDefinition");ae()}return l}(),r=An(!1));var i=Dr();if(i)return{kind:"OperationDefinition",operation:e||"query",name:t,variableDefinitions:n,directives:r,selectionSet:i}}function _5(e,t){return Ce=typeof e.body=="string"?e.body:e,ee=0,function(){var n;ae();for(var r=[];n=O5()||T5();)r.push(n);return{kind:"Document",definitions:r}}()}function Z5(e){return JSON.stringify(e)}function I5(e){return`"""
`+e.replace(/"""/g,'\\"""')+`
"""`}var nt=e=>!(!e||!e.length),Ve={OperationDefinition(e){if(e.operation==="query"&&!e.name&&!nt(e.variableDefinitions)&&!nt(e.directives))return Ve.SelectionSet(e.selectionSet);var t=e.operation;return e.name&&(t+=" "+e.name.value),nt(e.variableDefinitions)&&(e.name||(t+=" "),t+="("+e.variableDefinitions.map(Ve.VariableDefinition).join(", ")+")"),nt(e.directives)&&(t+=" "+e.directives.map(Ve.Directive).join(" ")),t+" "+Ve.SelectionSet(e.selectionSet)},VariableDefinition(e){var t=Ve.Variable(e.variable)+": "+at(e.type);return e.defaultValue&&(t+=" = "+at(e.defaultValue)),nt(e.directives)&&(t+=" "+e.directives.map(Ve.Directive).join(" ")),t},Field(e){var t=(e.alias?e.alias.value+": ":"")+e.name.value;if(nt(e.arguments)){var n=e.arguments.map(Ve.Argument),r=t+"("+n.join(", ")+")";t=r.length>80?t+`(
`+n.join(`
`).replace(/\n/g,`
`)+`
)`:r}return nt(e.directives)&&(t+=" "+e.directives.map(Ve.Directive).join(" ")),e.selectionSet?t+" "+Ve.SelectionSet(e.selectionSet):t},StringValue:e=>e.block?I5(e.value):Z5(e.value),BooleanValue:e=>""+e.value,NullValue:e=>"null",IntValue:e=>e.value,FloatValue:e=>e.value,EnumValue:e=>e.value,Name:e=>e.value,Variable:e=>"$"+e.name.value,ListValue:e=>"["+e.values.map(at).join(", ")+"]",ObjectValue:e=>"{"+e.fields.map(Ve.ObjectField).join(", ")+"}",ObjectField:e=>e.name.value+": "+at(e.value),Document:e=>nt(e.definitions)?e.definitions.map(at).join(`
`):"",SelectionSet:e=>`{
`+e.selections.map(at).join(`
`).replace(/\n/g,`
`)+`
}`,Argument:e=>e.name.value+": "+at(e.value),FragmentSpread(e){var t="..."+e.name.value;return nt(e.directives)&&(t+=" "+e.directives.map(Ve.Directive).join(" ")),t},InlineFragment(e){var t="...";return e.typeCondition&&(t+=" on "+e.typeCondition.name.value),nt(e.directives)&&(t+=" "+e.directives.map(Ve.Directive).join(" ")),t+" "+at(e.selectionSet)},FragmentDefinition(e){var t="fragment "+e.name.value;return t+=" on "+e.typeCondition.name.value,nt(e.directives)&&(t+=" "+e.directives.map(Ve.Directive).join(" ")),t+" "+at(e.selectionSet)},Directive(e){var t="@"+e.name.value;return nt(e.arguments)&&(t+="("+e.arguments.map(Ve.Argument).join(", ")+")"),t},NamedType:e=>e.name.value,ListType:e=>"["+at(e.type)+"]",NonNullType:e=>at(e.type)+"!"};function at(e){return Ve[e.kind]?Ve[e.kind](e):""}var R5=e=>e&&e.message&&(e.extensions||e.name==="GraphQLError")?e:typeof e=="object"&&e.message?new Gi(e.message,e.nodes,e.source,e.positions,e.path,e,e.extensions||{}):new Gi(e),No=class extends Error{constructor(e){var t=(e.graphQLErrors||[]).map(R5),n=((r,i)=>{var o="";if(r)return`[Network] ${r.message}`;if(i)for(var l of i)o&&(o+=`
`),o+=`[GraphQL] ${l.message}`;return o})(e.networkError,t);super(n),this.name="CombinedError",this.message=n,this.graphQLErrors=t,this.networkError=e.networkError,this.response=e.response}toString(){return this.message}},qi=(e,t)=>{for(var n=0|(t||5381),r=0,i=0|e.length;r<i;r++)n=(n<<5)+n+e.charCodeAt(r);return n},on=new Set,Sl=new WeakMap,wn=e=>{if(e===null||on.has(e))return"null";if(typeof e!="object")return JSON.stringify(e)||"";if(e.toJSON)return wn(e.toJSON());if(Array.isArray(e)){var t="[";for(var n of e)t.length>1&&(t+=","),t+=wn(n)||"null";return t+="]"}else if(pr!==On&&e instanceof pr||hr!==On&&e instanceof hr)return"null";var r=Object.keys(e).sort();if(!r.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var i=Sl.get(e)||Math.random().toString(36).slice(2);return Sl.set(e,i),wn({__key:i})}on.add(e);var o="{";for(var l of r){var s=wn(e[l]);s&&(o.length>1&&(o+=","),o+=wn(l)+":"+s)}return on.delete(e),o+="}"},Yi=(e,t,n)=>{if(!(n==null||typeof n!="object"||n.toJSON||on.has(n)))if(Array.isArray(n))for(var r=0,i=n.length;r<i;r++)Yi(e,`${t}.${r}`,n[r]);else if(n instanceof pr||n instanceof hr)e.set(t,n);else{on.add(n);for(var o of Object.keys(n))Yi(e,`${t}.${o}`,n[o])}},mr=e=>(on.clear(),wn(e)),On=class{},pr=typeof File<"u"?File:On,hr=typeof Blob<"u"?Blob:On,B5=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,P5=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,V5=(e,t)=>t%2==0?e.replace(P5,`
`):e,xl=e=>e.split(B5).map(V5).join("").trim(),Ml=new Map,or=new Map,Fo=e=>{var t;return typeof e=="string"?t=xl(e):e.loc&&or.get(e.__key)===e?t=e.loc.source.body:(t=Ml.get(e)||xl(at(e)),Ml.set(e,t)),typeof e!="string"&&!e.loc&&(e.loc={start:0,end:t.length,source:{body:t,name:"gql",locationOffset:{line:1,column:1}}}),t},Nl=e=>{var t=qi(Fo(e));if(e.definitions){var n=Ss(e);n&&(t=qi(`
# ${n}`,t))}return t},j5=e=>{var t,n;return typeof e=="string"?(t=Nl(e),n=or.get(t)||_5(e)):(t=e.__key||Nl(e),n=or.get(t)||e),n.loc||Fo(n),n.__key=t,or.set(t,n),n},Mn=(e,t,n)=>{var r=t||{},i=j5(e),o=mr(r),l=i.__key;return o!=="{}"&&(l=qi(o,l)),{key:l,query:i,variables:r,extensions:n}},Ss=e=>{for(var t of e.definitions)if(t.kind===v5.OPERATION_DEFINITION)return t.name?t.name.value:void 0},Fl=(e,t,n)=>{if(!("data"in t||"errors"in t&&Array.isArray(t.errors)))throw new Error("No Content");var r=e.kind==="subscription";return{operation:e,data:t.data,error:Array.isArray(t.errors)?new No({graphQLErrors:t.errors,response:n}):void 0,extensions:t.extensions?{...t.extensions}:void 0,hasNext:t.hasNext==null?r:t.hasNext,stale:!1}},Qi=(e,t)=>{if(typeof e=="object"&&e!=null&&(!e.constructor||e.constructor===Object||Array.isArray(e))){e=Array.isArray(e)?[...e]:{...e};for(var n of Object.keys(t))e[n]=Qi(e[n],t[n]);return e}return t},H5=(e,t,n,r)=>{var i=e.error?e.error.graphQLErrors:[],o=!!e.extensions||!!t.extensions,l={...e.extensions,...t.extensions},s=t.incremental;"path"in t&&(s=[t]);var c={data:e.data};if(s){var d=function(m){Array.isArray(m.errors)&&i.push(...m.errors),m.extensions&&(Object.assign(l,m.extensions),o=!0);var p="data",g=c,f=[];if(m.path)f=m.path;else if(r){var y=r.find(S=>S.id===m.id);m.subPath?f=[...y.path,...m.subPath]:f=y.path}for(var k=0,b=f.length;k<b;p=f[k++])g=g[p]=Array.isArray(g[p])?[...g[p]]:{...g[p]};if(m.items)for(var h=+p>=0?p:0,v=0,E=m.items.length;v<E;v++)g[h+v]=Qi(g[h+v],m.items[v]);else m.data!==void 0&&(g[p]=Qi(g[p],m.data))};for(var u of s)d(u)}else c.data=t.data||e.data,i=t.errors||i;return{operation:e.operation,data:c.data,error:i.length?new No({graphQLErrors:i,response:n}):void 0,extensions:o?l:void 0,hasNext:t.hasNext!=null?t.hasNext:e.hasNext,stale:!1}},xs=(e,t,n)=>({operation:e,data:void 0,error:new No({networkError:t,response:n}),extensions:void 0,hasNext:!1,stale:!1});function D5(e){return{query:e.extensions&&e.extensions.persistedQuery&&!e.extensions.persistedQuery.miss?void 0:Fo(e.query),operationName:Ss(e.query),variables:e.variables||void 0,extensions:e.extensions}}var z5=(e,t)=>{var n=e.kind==="query"&&e.context.preferGetMethod;if(!n||!t)return e.context.url;var r=new URL(e.context.url);for(var i in t){var o=t[i];o&&r.searchParams.set(i,typeof o=="object"?mr(o):o)}var l=r.toString();return l.length>2047&&n!=="force"?(e.context.preferGetMethod=!1,e.context.url):l},U5=(e,t)=>{if(t&&!(e.kind==="query"&&e.context.preferGetMethod)){var n=mr(t),r=(s=>{var c=new Map;return(pr!==On||hr!==On)&&(on.clear(),Yi(c,"variables",s)),c})(t.variables);if(r.size){var i=new FormData;i.append("operations",n),i.append("map",mr({...[...r.keys()].map(s=>[s])}));var o=0;for(var l of r.values())i.append(""+o++,l);return i}return n}},$5=(e,t)=>{var n={accept:e.kind==="subscription"?"text/event-stream, multipart/mixed":"application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed"},r=(typeof e.context.fetchOptions=="function"?e.context.fetchOptions():e.context.fetchOptions)||{};if(r.headers)for(var i in r.headers)n[i.toLowerCase()]=r.headers[i];var o=U5(e,t);return typeof o=="string"&&!n["content-type"]&&(n["content-type"]="application/json"),{...r,method:o?"POST":"GET",body:o,headers:n}},W5=typeof TextDecoder<"u"?new TextDecoder:null,G5=/boundary="?([^=";]+)"?/i,q5=/data: ?([^\n]+)/,Al=e=>e.constructor.name==="Buffer"?e.toString():W5.decode(e);async function*Ol(e){if(e.body[Symbol.asyncIterator])for await(var t of e.body)yield Al(t);else{var n=e.body.getReader(),r;try{for(;!(r=await n.read()).done;)yield Al(r.value)}finally{n.cancel()}}}async function*Ll(e,t){var n="",r;for await(var i of e)for(n+=i;(r=n.indexOf(t))>-1;)yield n.slice(0,r),n=n.slice(r+t.length)}async function*Y5(e,t,n){var r=!0,i=null,o;try{yield await Promise.resolve();var l=(o=await(e.context.fetch||fetch)(t,n)).headers.get("Content-Type")||"",s;/multipart\/mixed/i.test(l)?s=async function*(u,m){var p=u.match(G5),g="--"+(p?p[1]:"-"),f=!0,y;for await(var k of Ll(Ol(m),`\r
`+g)){if(f){f=!1;var b=k.indexOf(g);if(b>-1)k=k.slice(b+g.length);else continue}try{yield y=JSON.parse(k.slice(k.indexOf(`\r
\r
`)+4))}catch(h){if(!y)throw h}if(y&&y.hasNext===!1)break}y&&y.hasNext!==!1&&(yield{hasNext:!1})}(l,o):/text\/event-stream/i.test(l)?s=async function*(u){var m;for await(var p of Ll(Ol(u),`
`)){var g=p.match(q5);if(g){var f=g[1];try{yield m=JSON.parse(f)}catch(y){if(!m)throw y}if(m&&m.hasNext===!1)break}}m&&m.hasNext!==!1&&(yield{hasNext:!1})}(o):/text\//i.test(l)?s=async function*(u){var m=await u.text();try{var p=JSON.parse(m);yield p}catch{throw new Error(m)}}(o):s=async function*(u){yield JSON.parse(await u.text())}(o);var c;for await(var d of s)d.pending&&!i?c=d.pending:d.pending&&(c=[...c,...d.pending]),i=i?H5(i,d,o,c):Fl(e,d,o),r=!1,yield i,r=!0;i||(yield i=Fl(e,{},o))}catch(u){if(!r)throw u;yield xs(e,o&&(o.status<200||o.status>=300)&&o.statusText?new Error(o.statusText):u,o)}}function Q5(e,t,n){var r;return typeof AbortController<"u"&&(n.signal=(r=new AbortController).signal),xo(()=>{r&&r.abort()})(qe(i=>!!i)(vs(Y5(e,t,n))))}var Ki=(e,t)=>{if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(i=>Ki(i));if(e&&typeof e=="object"&&(t||"__typename"in e)){var n={};for(var r in e)r==="__typename"?Object.defineProperty(n,"__typename",{enumerable:!1,value:e.__typename}):n[r]=Ki(e[r]);return n}else return e};function Tl(e){var t=n=>e(n);return t.toPromise=()=>Mo(Hr(1)(qe(n=>!n.stale&&!n.hasNext)(t))),t.then=(n,r)=>t.toPromise().then(n,r),t.subscribe=n=>Fn(n)(t),t}function fr(e,t,n){return{...t,kind:e,context:t.context?{...t.context,...n}:n||t.context}}var K5=()=>{},J5=({forward:e,dispatchDebug:t})=>n=>{var r=cr(o=>{var l=D5(o),s=z5(o,l),c=$5(o,l),d=fs(qe(u=>u.kind==="teardown"&&u.key===o.key)(n))(Q5(o,s,c));return d})(qe(o=>o.kind!=="teardown"&&(o.kind!=="subscription"||!!o.context.fetchSubscriptions))(n)),i=e(qe(o=>o.kind==="teardown"||o.kind==="subscription"&&!o.context.fetchSubscriptions)(n));return ga([r,i])},X5=e=>({client:t,forward:n,dispatchDebug:r})=>e.reduceRight((i,o)=>o({client:t,forward(l){return va(i(va(l)))},dispatchDebug(l){}}),n),eu=({onOperation:e,onResult:t,onError:n})=>({forward:r})=>i=>cr(o=>{n&&o.error&&n(o.error,o.operation);var l=t&&t(o)||o;return"then"in l?Cl(l):ma(l)})(r(cr(o=>{var l=e&&e(o)||o;return"then"in l?Cl(l):ma(l)})(i))),tu=({dispatchDebug:e})=>t=>qe(n=>!1)(t),nu=function e(t){var n=0,r=new Map,i=new Map,o=new Set,l=[],s={url:t.url,fetchSubscriptions:t.fetchSubscriptions,fetchOptions:t.fetchOptions,fetch:t.fetch,preferGetMethod:t.preferGetMethod,requestPolicy:t.requestPolicy||"cache-first"},c=Wi();function d(h){(h.kind==="mutation"||h.kind==="teardown"||!o.has(h.key))&&(h.kind==="teardown"?o.delete(h.key):h.kind!=="mutation"&&o.add(h.key),c.next(h))}var u=!1;function m(h){if(h&&d(h),!u){for(u=!0;u&&(h=l.shift());)d(h);u=!1}}var p=h=>{var v=fs(qe(E=>E.kind==="teardown"&&E.key===h.key)(c.source))(qe(E=>E.operation.kind===h.kind&&E.operation.key===h.key&&(!E.operation.context._instance||E.operation.context._instance===h.context._instance))(b));return t.maskTypename&&(v=Ui(E=>({...E,data:Ki(E.data,!0)}))(v)),h.kind!=="query"?v=gs(E=>!!E.hasNext,!0)(v):v=wl(E=>{var S=ma(E);return E.stale||E.hasNext?S:ga([S,Ui(()=>(E.stale=!0,E))(Hr(1)(qe(B=>B.key===h.key)(c.source)))])})(v),h.kind!=="mutation"?v=xo(()=>{o.delete(h.key),r.delete(h.key),i.delete(h.key),u=!1;for(var E=l.length-1;E>=0;E--)l[E].key===h.key&&l.splice(E,1);d(fr("teardown",h,h.context))})(dr(E=>{if(E.stale){for(var S of l)if(S.key===E.operation.key){o.delete(S.key);break}}else E.hasNext||o.delete(h.key);r.set(h.key,E)})(v)):v=$i(()=>{d(h)})(v),va(v)},g=this instanceof e?this:Object.create(e.prototype),f=Object.assign(g,{suspense:!!t.suspense,operations$:c.source,reexecuteOperation(h){if(h.kind==="teardown")m(h);else if(h.kind==="mutation"||i.has(h.key)){for(var v=!1,E=0;E<l.length;E++)v=v||l[E].key===h.key;v||o.delete(h.key),l.push(h),Promise.resolve().then(m)}},createRequestOperation(h,v,E){return E||(E={}),fr(h,v,{_instance:h==="mutation"?n=n+1|0:void 0,...s,...E,requestPolicy:E.requestPolicy||s.requestPolicy,suspense:E.suspense||E.suspense!==!1&&f.suspense})},executeRequestOperation(h){return h.kind==="mutation"?Tl(p(h)):Tl(p5(()=>{var v=i.get(h.key);v||i.set(h.key,v=p(h)),v=$i(()=>{m(h)})(v);var E=r.get(h.key);return h.kind==="query"&&E&&(E.stale||E.hasNext)?wl(ma)(ga([v,qe(S=>S===r.get(h.key))(ma(E))])):v}))},executeQuery(h,v){var E=f.createRequestOperation("query",h,v);return f.executeRequestOperation(E)},executeSubscription(h,v){var E=f.createRequestOperation("subscription",h,v);return f.executeRequestOperation(E)},executeMutation(h,v){var E=f.createRequestOperation("mutation",h,v);return f.executeRequestOperation(E)},readQuery(h,v,E){var S=null;return Fn(B=>{S=B})(f.query(h,v,E)).unsubscribe(),S},query:(h,v,E)=>f.executeQuery(Mn(h,v),E),subscription:(h,v,E)=>f.executeSubscription(Mn(h,v),E),mutation:(h,v,E)=>f.executeMutation(Mn(h,v),E)}),y=K5,k=X5(t.exchanges),b=va(k({client:f,dispatchDebug:y,forward:tu({dispatchDebug:y})})(c.source));return g5(b),f},ki=(e,t)=>fr(e.kind,e,{...e.context,authAttempt:t});function au(e){return({client:t,forward:n})=>{var r=new Set,i=Wi(),o=Wi(),l=new Map;function s(){d=void 0;var m=l;l=new Map,m.forEach(i.next)}function c(m){d=void 0;var p=l;l=new Map,p Line truncated
query VisualTestsProjectCountQuery {
viewer {
projectCount
accounts {
newProjectUrl
}
}
}
`),I4=({onBack:e,hasProjectId:t,setAccessToken:n,setCreatedProjectId:r,exchangeParameters:i})=>{let o=Ao(),l=Js(),{user_code:s,verificationUrl:c}=i,d=Pe(),u=Pe(),m=Pe(),p=W(async y=>{if(y.message==="login"&&u.current?.(c),y.message==="grant")try{let k=await q2(i);if(!k)throw new Error("Failed to fetch an access token");d.current=k;let b=Fs(k),{data:h}=await o.query(Z4,{},{fetchOptions:b});if(!h?.viewer)throw new Error("Failed to fetch initial project list");if(h.viewer.projectCount>0||t)n(d.current),m.current?.();else{if(!h.viewer.accounts[0])throw new Error("User has no accounts!");if(!h.viewer.accounts[0].newProjectUrl)throw new Error("Unexpected missing project URL");u.current?.(h.viewer.accounts[0].newProjectUrl)}}catch(k){l("Login Error",k)}y.message==="createdProject"&&(d.current?(n(d.current),r(`Project:${y.projectId}`),m.current?.()):l("Unexpected missing access token",new Error))},[c,i,o,t,n,l,r]),[g,f]=h0(p);return u.current=g,m.current=f,a.createElement(Ne,{footer:null,ignoreConfig:!0},a.createElement(Yr,{onBack:e}),a.createElement(ye,null,a.createElement(de,null,a.createElement("div",null,a.createElement(he,null,"Verify your account"),a.createElement("div",null,a.createElement(G,{center:!0,muted:!0},"Check this verification code on Chromatic to grant access to your published Storybooks.")),a.createElement(_4,null,s?.split("").map((y,k)=>a.createElement("li",{key:`${k}-${y}`},y.replace(/[^A-Z0-9]/,""))))),a.createElement(ue,{variant:"solid",size:"medium",onClick:()=>g(c)},"Go to Chromatic"))))},R4=({onNext:e,onUninstall:t})=>a.createElement(Ne,{footer:null,ignoreConfig:!0},a.createElement(Yr,null),a.createElement(ye,null,a.createElement(de,null,a.createElement("div",null,a.createElement(pn,null),a.createElement(he,null,"Visual tests"),a.createElement(G,{center:!0,muted:!0},"Catch bugs in UI appearance automatically. Compare image snapshots to detect visual changes.")),a.createElement(Ft,null,a.createElement(ue,{variant:"solid",size:"medium",onClick:e},"Enable"),a.createElement(ue,{link:!0,onClick:()=>t()},"Uninstall"))))),B4=({setAccessToken:e,setCreatedProjectId:t,hasProjectId:n})=>{let[r,i]=rt("authenticationScreen",n?"signin":"welcome"),[o,l]=rt("exchangeParameters"),s=Js(),{uninstallAddon:c}=Ro();tt("Authentication",r.charAt(0).toUpperCase()+r.slice(1));let d=W(async u=>{try{l(await G2(u)),i("verify")}catch(m){s("Sign in Error",m)}},[s,l,i]);if(r==="welcome"&&!n)return a.createElement(R4,{onNext:()=>i("signin"),onUninstall:c});if(r==="signin"||r==="welcome"&&n)return a.createElement(Tm,{...n?{}:{onBack:()=>i("welcome")},onSignIn:d,onSignInWithSSO:()=>i("subdomain")});if(r==="subdomain")return a.createElement(Lm,{onBack:()=>i("signin"),onSignIn:d});if(r==="verify"){if(!o)throw new Error("Expected to have a `exchangeParameters` if at `verify` step");return a.createElement(I4,{onBack:()=>i("signin"),hasProjectId:n,setAccessToken:e,setCreatedProjectId:t,exchangeParameters:o})}return null},f0=w.div(({theme:e})=>({display:"flex",flexDirection:"row",alignItems:"center",borderRadius:e.appBorderRadius,background:e.base==="light"?e.color.lightest:e.color.darkest,border:`1px solid ${e.appBorderColor}`,padding:15,flex:1,gap:14,maxWidth:"500px",width:"100%"}),({theme:e,warning:t})=>t&&{background:e.base==="dark"?"#342e1a":e.background.warning}),P4=w.b(()=>({display:"block",marginBottom:2})),V4=()=>{tt("Errors","GitNotFound");let{uninstallAddon:e}=Ro();return a.createElement(Ne,{footer:null},a.createElement(ye,null,a.createElement(de,null,a.createElement("div",null,a.createElement(pn,null),a.createElement(he,null,"Visual tests"),a.createElement(G,{center:!0,muted:!0},"Catch bugs in UI appearance automatically. Compare image snapshots to detect visual changes.")),a.createElement(f0,null,a.createElement(rs,{style:{flexShrink:0}}),a.createElement(G,null,a.createElement(P4,null,"Git not detected"),"This addon requires Git to associate test results with commits and branches. Run"," ",a.createElement(De,null,"git init")," and make your first commit",a.createElement(De,null,"git commit -m")," to get started!")),a.createElement($e,{target:"_blank",href:"https://www.chromatic.com/docs/visual-tests-addon#git-addon",withArrow:!0,secondary:!0},"Visual tests requirements"),a.createElement($e,{withArrow:!0,onClick:()=>e()},"Uninstall"))))},j4=w(ko)(({theme:e})=>({width:40,height:40,padding:10,background:e.color.positive,borderRadius:"100%",color:"white"})),H4=w($e)(()=>({marginTop:5})),D4=gt(`
query ProjectQuery($projectId: ID!) {
project(id: $projectId) {
id
name
webUrl
lastBuild {
branch
number
}
}
}
`),z4=({projectId:e,configFile:t,goToNext:n})=>{tt("LinkProject","LinkedProject");let[{data:r,fetching:i,error:o}]=Oo({query:D4,variables:{projectId:e}});return a.createElement(Ne,{footer:a.createElement(qr,null,a.createElement(lt,null,r?.project?.lastBuild&&a.createElement(G,{style:{marginLeft:5}},"Last build: ",r.project.lastBuild.number," on branch"," ",r.project.lastBuild.branch)),a.createElement(lt,{push:!0},a.createElement(Gr,null)))},a.createElement(ye,null,a.createElement(de,null,i&&a.createElement("p",null,"Loading..."),o&&a.createElement("p",null,o.message),r?.project&&a.createElement(a.Fragment,null,a.createElement(j4,null),a.createElement("div",null,a.createElement(he,null,"Project linked!"),a.createElement(G,{center:!0,muted:!0,style:{maxWidth:500}},"The ",a.createElement(De,null,"projectId")," for ",a.createElement("strong",null,r.project.name)," was added in"," ",a.createElement(De,null,t)," to sync tests with Chromatic. Please commit this change to continue using this addon.")),a.createElement(Ft,null,a.createElement(ue,{variant:"solid",size:"medium",onClick:()=>n()},"Catch a UI change"),a.createElement(H4,{href:"https://www.chromatic.com/docs/cli",target:"_blank",withArrow:!0,secondary:!0},"What's a project ID?"))))))};function U4(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.from(typeof e=="string"?[e]:e);r[r.length-1]=r[r.length-1].replace(/\r?\n([\t ]*)$/,"");var i=r.reduce(function(s,c){var d=c.match(/\n([\t ]+|(?!\s).)/g);return d?s.concat(d.map(function(u){var m,p;return(p=(m=u.match(/[\t ]/g))===null||m===void 0?void 0:m.length)!==null&&p!==void 0?p:0})):s},[]);if(i.length){var o=new RegExp(`
[ ]{`+Math.min.apply(Math,i)+"}","g");r=r.map(function(s){return s.replace(o,`
`)})}r[0]=r[0].replace(/^\r?\n/,"");var l=r[0];return t.forEach(function(s,c){var d=l.match(/(?:^|\n)( *)$/),u=d?d[1]:"",m=s;typeof s=="string"&&s.includes(`
`)&&(m=String(s).split(`
`).map(function(p,g){return g===0?p:""+u+p}).join(`
`)),l+=m+r[c+1]}),l}var $4=w.div(({theme:e})=>({"&& > *":{margin:0},"&& pre":{color:e.base==="light"?e.color.darker:e.color.lighter,background:e.base==="light"?e.color.lightest:e.color.darkest,fontSize:"12px",lineHeight:"16px",textAlign:"left",padding:"15px !important"}})),W4="https://www.chromatic.com/docs/visual-tests-addon/#configure";function G4({projectId:e,configFile:t}){return tt("LinkProject","LinkingProjectFailed"),a.createElement(Ne,null,a.createElement(ye,null,a.createElement(de,null,a.createElement("div",null,a.createElement(he,null,"Add the project ID to your Chromatic config"),a.createElement(G,{center:!0,muted:!0},"The ",a.createElement(De,null,"projectId")," will be used to sync tests with Chromatic. Please commit this change to continue using the addon. The file should be saved at"," ",a.createElement(De,null,t),".")),a.createElement($4,null,a.createElement(De,null,U4`
{
"projectId": "${e}",
}
`)),a.createElement($e,{secondary:!0,withArrow:!0,target:"_blank",href:W4},"What's this for?"))))}var q4=gt(`
query SelectProjectsQuery {
viewer {
accounts {
id
name
avatarUrl
newProjectUrl
projects {
id
name
webUrl
lastBuild {
branch
number
}
}
}
}
}
`),Y4=({createdProjectId:e,setCreatedProjectId:t,onUpdateProject:n})=>{let r=a.useCallback(async i=>{await n(i)},[n]);return a.createElement(J4,{createdProjectId:e,setCreatedProjectId:t,onSelectProjectId:r})},Ja=w.div(({theme:e})=>({fontSize:`${e.typography.size.s1-1}px`,fontWeight:e.typography.weight.bold,color:e.base==="light"?e.color.dark:e.color.light,backgroundColor:"inherit",padding:"7px 15px",borderBottom:`1px solid ${e.appBorderColor}`,lineHeight:"18px",letterSpacing:"0.38em",textTransform:"uppercase"})),Jl=w.div(({theme:e})=>({})),Xl=w.div(({theme:e})=>({background:e.base==="light"?e.color.lighter:e.color.darker})),e1=w.div(({theme:e})=>({background:e.base==="light"?e.color.lightest:e.color.darkest,borderRadius:5,border:`1px solid ${e.appBorderColor}`,height:260,maxWidth:420,minWidth:260,width:"100%",overflow:"hidden",textAlign:"left",position:"relative",display:"flex","> *":{flex:1,display:"flex",flexDirection:"column",width:"50%"}})),Xa=w.div({height:"100%",overflowY:"auto"}),Q4=w(de)({width:"100%"}),K4=w(v2)({marginRight:10});function J4({createdProjectId:e,setCreatedProjectId:t,onSelectProjectId:n}){let[{data:r,fetching:i,error:o},l]=Oo({query:q4});oe(()=>{let h=setInterval(l,5e3);return()=>clearInterval(h)},[l]);let[s,c]=rt("selectedAccountId"),d=r?.viewer?.accounts.find(h=>h.id===s),u=W(h=>c(h.id),[c]);oe(()=>{!s&&r?.viewer?.accounts&&u(r.viewer.accounts[0])},[r,s,u]);let[m,p]=rt("isSelectingProject",!1),g=W(h=>{p(!0),n(h.id);let v=setTimeout(()=>{p(!1)},1e3);return()=>clearTimeout(v)},[n,p]),f=W(async h=>{h.message==="createdProject"&&(l(),t(h.projectId))},[l,t]),[y,k]=h0(f),b=e&&d?.projects?.find(h=>h?.id.endsWith(e));return oe(()=>{b&&(k(),g(b))},[b,g,k]),tt("LinkProject","LinkProject"),a.createElement(Ne,null,a.createElement(ye,null,a.createElement(Q4,null,a.createElement("div",null,a.createElement(he,null,"Select a project"),a.createElement(G,{muted:!0},"Your tests will sync with this project.")),o&&a.createElement("p",null,o.message),!r&&i&&a.createElement(e1,null,a.createElement(Jl,null,a.createElement(Ja,null,"Accounts"),a.createElement(Xa,null,a.createElement(dt,{appearance:"secondary",isLoading:!0}),a.createElement(dt,{appearance:"secondary",isLoading:!0}),a.createElement(dt,{appearance:"secondary",isLoading:!0}),a.createElement(dt,{appearance:"secondary",isLoading:!0}),a.createElement(dt,{appearance:"secondary",isLoading:!0}))),a.createElement(Xl,null,a.createElement(Ja,null,"Projects"),a.createElement(Xa,{"data-testid":"right-list"},a.createElement(dt,{appearance:"secondary",isLoading:!0}),a.createElement(dt,{appearance:"secondary",isLoading:!0}),a.createElement(dt,{appearance:"secondary",isLoading:!0})))),r?.viewer?.accounts&&a.createElement(e1,null,a.createElement(Jl,null,a.createElement(Ja,null,"Accounts"),a.createElement(Xa,{"data-testid":"left-list"},r.viewer.accounts?.map(h=>a.createElement(dt,{key:h.id,title:h.name,appearance:"secondary",left:a.createElement(K4,{src:h.avatarUrl??void 0,size:"tiny"}),onClick:()=>u(h),active:s===h.id})))),a.createElement(Xl,null,a.createElement(Ja,null,"Projects"),a.createElement(Xa,{"data-testid":"right-list"},d&&a.createElement(dt,{isLink:!1,onClick:()=>{if(!d?.newProjectUrl)throw new Error("Unexpected missing `newProjectUrl` on account");y(d.newProjectUrl)},title:a.createElement($e,{isButton:!0,withArrow:!0},"Create new project")}),d?.projects?.map(h=>h&&a.createElement(dt,{appearance:"secondary",key:h.id,title:h.name,right:a.createElement(Md,{"aria-label":h.name}),onClick:()=>g(h),disabled:m}))))))))}var X4=()=>a.createElement(Ne,{footer:null},a.createElement(ye,null,a.createElement(de,null,a.createElement("div",null,a.createElement(pn,null),a.createElement(he,null,"Visual tests"),a.createElement(G,{center:!0,muted:!0},"Visual tests only runs locally. To test this Storybook, clone it to your machine and run ",a.createElement(De,null,"npx storybook dev"),"."))))),ep=({offline:e=!1})=>a.createElement(Ne,{footer:null},a.createElement(ye,null,a.createElement(de,null,a.createElement("div",null,a.createElement(he,null,"Can't connect to Chromatic"),a.createElement(G,{center:!0,muted:!0},e?"You're offline. Double check your internet connection.":"We're having trouble connecting to the Chromatic API.")),!e&&a.createElement($e,{href:"https://status.chromatic.com",target:"_blank",rel:"noreferrer",withArrow:!0},"Chromatic API status")))),tp=()=>(tt("Uninstalled","uninstalled"),a.createElement(Ne,{footer:!1},a.createElement(ye,null,a.createElement(de,null,a.createElement("div",null,a.createElement(pn,null),a.createElement(he,null,"Uninstall complete"),a.createElement(G,{center:!0,muted:!0},"Visual Tests will vanish the next time you restart your Storybook.")))))),g0={isRunning:!1,startBuild:()=>{},stopBuild:()=>{}},v0=Je(g0),Za=()=>Ot(v0,"RunBuild"),np=({children:e,watchState:t=g0})=>a.createElement(v0.Provider,{value:t},e),y0={PENDING:"warn",FAILED:"error",DENIED:"error",BROKEN:"error"},Ai=[null,"unknown","pending","success","warn","error"];function Line truncated
@keyframes joyride-beacon-inner {
20% {
opacity: 0.9;
}
90% {
opacity: 0.7;
}
}
@keyframes joyride-beacon-outer {
0% {
transform: scale(1);
}
45% {
opacity: 0.7;
transform: scale(0.75);
}
100% {
opacity: 0.9;
transform: scale(1);
}
}
`)),t.appendChild(n)}componentDidMount(){let{shouldFocus:e}=this.props;setTimeout(()=>{I.domElement(this.beacon)&&e&&this.beacon.focus()},0)}componentWillUnmount(){let e=document.getElementById("joyride-beacon-animation");e?.parentNode&&e.parentNode.removeChild(e)}render(){let{beaconComponent:e,continuous:t,index:n,isLastStep:r,locale:i,onClickOrHover:o,size:l,step:s,styles:c}=this.props,d=I.string(i.open)?i.open:(0,z3.default)(i.open),u={"aria-label":d,onClick:o,onMouseEnter:o,ref:this.setBeaconRef,title:d},m;return e?m=x(e,{continuous:t,index:n,isLastStep:r,size:l,step:s,...u}):m=x("button",{key:"JoyrideBeacon",className:"react-joyride__beacon","data-test-id":"button-beacon",style:c.beacon,type:"button",...u},x("span",{style:c.beaconInner}),x("span",{style:c.beaconOuter})),m}};function ph({styles:e}){return x("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight","data-test-id":"spotlight",style:e})}var hh=ph,fh=class extends Vt{constructor(){super(...arguments),R(this,"isActive",!1),R(this,"resizeTimeout"),R(this,"scrollTimeout"),R(this,"scrollParent"),R(this,"state",{isScrolling:!1,mouseOverSpotlight:!1,showSpotlight:!0}),R(this,"handleMouseMove",e=>{let{mouseOverSpotlight:t}=this.state,{height:n,left:r,position:i,top:o,width:l}=this.spotlightStyles,s=i==="fixed"?e.clientY:e.pageY,c=i==="fixed"?e.clientX:e.pageX,d=s>=o&&s<=o+n,u=c>=r&&c<=r+l&&d;u!==t&&this.updateState({mouseOverSpotlight:u})}),R(this,"handleScroll",()=>{let{target:e}=this.props,t=Gt(e);if(this.scrollParent!==document){let{isScrolling:n}=this.state;n||this.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(()=>{this.updateState({isScrolling:!1,showSpotlight:!0})},50)}else Ta(t,"sticky")&&this.updateState({})}),R(this,"handleResize",()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.isActive&&this.forceUpdate()},100)})}componentDidMount(){let{debug:e,disableScrolling:t,disableScrollParentFix:n=!1,target:r}=this.props,i=Gt(r);this.scrollParent=ei(i??document.body,n,!0),this.isActive=!0,window.addEventListener("resize",this.handleResize)}componentDidUpdate(e){var t;let{lifecycle:n,spotlightClicks:r}=this.props,{changed:i}=Tr(e,this.props);i("lifecycle",X.TOOLTIP)&&((t=this.scrollParent)==null||t.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(()=>{let{isScrolling:o}=this.state;o||this.updateState({showSpotlight:!0})},100)),(i("spotlightClicks")||i("disableOverlay")||i("lifecycle"))&&(r&&n===X.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):n!==X.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}componentWillUnmount(){var e;this.isActive=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),(e=this.scrollParent)==null||e.removeEventListener("scroll",this.handleScroll)}get spotlightStyles(){var e,t,n;let{showSpotlight:r}=this.state,{disableScrollParentFix:i=!1,spotlightClicks:o,spotlightPadding:l=0,styles:s,target:c}=this.props,d=Gt(c),u=q0(d),m=Ta(d),p=Q3(d,l,i);return{...N1()?s.spotlightLegacy:s.spotlight,height:Math.round(((e=u?.height)!=null?e:0)+l*2),left:Math.round(((t=u?.left)!=null?t:0)-l),opacity:r?1:0,pointerEvents:o?"none":"auto",position:m?"fixed":"absolute",top:p,transition:"opacity 0.2s",width:Math.round(((n=u?.width)!=null?n:0)+l*2)}}updateState(e){this.isActive&&this.setState(t=>({...t,...e}))}render(){let{mouseOverSpotlight:e,showSpotlight:t}=this.state,{disableOverlay:n,disableOverlayClose:r,lifecycle:i,onClickOverlay:o,placement:l,styles:s}=this.props;if(n||i!==X.TOOLTIP)return null;let c=s.overlay;N1()&&(c=l==="center"?s.overlayLegacyCenter:s.overlayLegacy);let d={cursor:r?"default":"pointer",height:W3(),pointerEvents:e?"none":"auto",...c},u=l!=="center"&&t&&x(hh,{styles:this.spotlightStyles});if(Y0()==="safari"){let{mixBlendMode:m,zIndex:p,...g}=d;u=x("div",{style:{...g}},u),delete d.backgroundColor}return x("div",{className:"react-joyride__overlay","data-test-id":"overlay",onClick:o,role:"presentation",style:d},u)}},gh=class extends Vt{constructor(){super(...arguments),R(this,"node",null)}componentDidMount(){let{id:e}=this.props;zt()&&(this.node=document.createElement("div"),this.node.id=e,document.body.appendChild(this.node),ra||this.renderReact15())}componentDidUpdate(){zt()&&(ra||this.renderReact15())}componentWillUnmount(){!zt()||!this.node||(ra||fl(this.node),this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=null))}renderReact15(){if(!zt())return;let{children:e}=this.props;this.node&&gl(this,e,this.node)}renderReact16(){if(!zt()||!ra)return null;let{children:e}=this.props;return this.node?Kn(e,this.node):null}render(){return ra?this.renderReact16():null}};function vh({styles:e,...t}){let{color:n,height:r,width:i,...o}=e;return a.createElement("button",{style:o,type:"button" Line truncated
query AddonVisualTestsBuild(
$projectId: ID!
$branch: String!
$gitUserEmailHash: String!
$repositoryOwnerName: String
$storyId: String!
$testStatuses: [TestStatus!]!
$selectedBuildId: ID!
$hasSelectedBuildId: Boolean!
) {
project(id: $projectId) {
name
manageUrl
account {
billingUrl
suspensionReason
}
features {
uiTests
}
lastBuildOnBranch: lastBuild(
branches: [$branch]
repositoryOwnerName: $repositoryOwnerName
localBuilds: { localBuildEmailHash: $gitUserEmailHash }
) {
...LastBuildOnBranchBuildFields
...SelectedBuildFields @skip(if: $hasSelectedBuildId)
}
lastBuild {
id
slug
branch
}
}
selectedBuild: build(id: $selectedBuildId) @include(if: $hasSelectedBuildId) {
...SelectedBuildFields
}
viewer {
preferences {
vtaOnboarding
}
projectMembership(projectId: $projectId) {
userCanReview: meetsAccessLevel(minimumAccessLevel: REVIEWER)
}
}
}
`),Oh=gt(`
fragment LastBuildOnBranchBuildFields on Build {
__typename
id
status
committedAt
... on StartedBuild {
testsForStatus: tests(first: 1000, statuses: $testStatuses) {
nodes {
...StatusTestFields
}
}
testsForStory: tests(storyId: $storyId) {
nodes {
...LastBuildOnBranchTestFields
}
}
}
... on CompletedBuild {
result
testsForStatus: tests(first: 1000, statuses: $testStatuses) {
nodes {
...StatusTestFields
}
}
testsForStory: tests(storyId: $storyId) {
nodes {
...LastBuildOnBranchTestFields
}
}
}
}
`),Lh=gt(`
fragment SelectedBuildFields on Build {
__typename
id
number
branch
commit
committedAt
uncommittedHash
status
... on StartedBuild {
startedAt
testsForStory: tests(storyId: $storyId) {
nodes {
...StoryTestFields
}
}
}
... on CompletedBuild {
startedAt
testsForStory: tests(storyId: $storyId) {
nodes {
...StoryTestFields
}
}
}
}
`),ec=gt(`
fragment StatusTestFields on Test {
id
status
result
story {
storyId
}
}
`),Th=gt(`
fragment LastBuildOnBranchTestFields on Test {
status
result
}
`),_h=gt(`
fragment StoryTestFields on Test {
id
status
result
webUrl
comparisons {
id
result
browser {
id
key
name
version
}
captureDiff {
diffImage(signed: true) {
imageUrl
imageWidth
}
focusImage(signed: true) {
imageUrl
imageWidth
}
}
headCapture {
captureImage(signed: true) {
backgroundColor
imageUrl
imageWidth
imageHeight
thumbnailUrl
}
captureError {
kind
... on CaptureErrorInteractionFailure {
error
}
... on CaptureErrorJSError {
error
}
... on CaptureErrorFailedJS {
error
}
}
}
baseCapture {
captureImage(signed: true) {
imageUrl
imageWidth
imageHeight
}
}
}
mode {
name
globals
}
story {
storyId
name
component {
name
}
}
}
`),Zh=gt(`
mutation ReviewTest($input: ReviewTestInput!) {
reviewTest(input: $input) {
updatedTests {
id
status
}
userErrors {
... on UserError {
__typename
message
}
... on BuildSupersededError {
build {
id
}
}
... on TestUnreviewableError {
test {
id
}
}
}
}
}
`),Ih=({projectId:e,storyId:t,gitInfo:n,selectedBuildInfo:r})=>{let[{data:i,error:o,operation:l},s]=Oo({query:Ah,variables:{projectId:e,storyId:t,testStatuses:Object.keys(y0),branch:n.branch||"",...n.slug?{repositoryOwnerName:n.slug.split("/",1)[0]}:{},gitUserEmailHash:n.userEmailHash,selectedBuildId:r?.buildId||"",hasSelectedBuildId:!!r}});oe(()=>{let y=setInterval(s,5e3);return()=>clearInterval(y)},[s]);let c=l&&t&&l.variables.storyId!==t,d=Nn(Oh,i?.project?.lastBuildOnBranch),u=[...Nn(Th,d&&"testsForStory"in d&&d.testsForStory?d.testsForStory.nodes:[])],m=d?.committedAt>n.committedAt,p=!!d&&!m,g=!!d&&u.every(y=>y.status!=="IN_PROGRESS"),f=Nn(Lh,i?.selectedBuild??(g?i?.project?.lastBuildOnBranch:void 0));return{account:i?.project?.account,features:i?.project?.features,manageUrl:i?.project?.manageUrl,hasData:!!i&&!c,hasProject:!!i?.project,hasSelectedBuild:f?.branch.split(":").at(-1)===n.branch,lastBuildOnBranch:d,lastBuildOnBranchIsNewer:m,lastBuildOnBranchIsReady:g,lastBuildOnBranchIsSelectable:p,selectedBuild:f,selectedBuildMatchesGit:f?.branch.split(":").at(-1)===n.branch&&f?.commit===n.commit&&f?.uncommittedHash===n.uncommittedHash,rerunQuery:s,queryError:o,userCanReview:!!i?.viewer?.projectMembership?.userCanReview,vtaOnboarding:i?.viewer?.preferences?.vtaOnboarding}},Yo=Je(null),tc=Je(null),Rh=()=>Ot(Yo,"Build"),nc=()=>{let{selectedBuild:e}=Ot(Yo,"Build");if(!e)throw new Error("No selectedBuild on Build context");return e},fn=()=>Ot(tc,"Story"),Zi=({children:e,watchState:t})=>{let n=!!t?.selectedBuild&&"testsForStory"in t.selectedBuild,r=t?.selectedBuild&&"testsForStory"in t.selectedBuild&&t.selectedBuild.testsForStory?.nodes,i=[...Nn(_h,r||[])],o=qo(i),{toggleDiff:l}=Pn();return oe(()=>l(o.changeCount>0),[l,o.changeCount]),a.createElement(Yo.Provider,{value:jt(()=>t,[JSON.stringify(t?.selectedBuild)])},a.createElement(tc.Provider,{value:{hasTests:n,tests:i,summary:o,...Fh(i)}},e))},Bh=w.div(({width:e,height:t,left:n,top:r})=>({width:`${e}px`,height:`${t}px`,left:`${n}px`,top:`${r}px`,position:"relative",overflow:"hidden"}));function Ph({top:e=0,left:t=0,width:n=window.innerWidth,height:r=window.innerHeight,colors:i=["#CA90FF","#FC521F","#66BF3C","#FF4785","#FFAE00","#1EA7FD"],...o}){let[l]=Re(()=>{let s=document.createElement("div");return s.setAttribute("id","confetti-container"),s.setAttribute("style","position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999;"),s});return oe(()=>(document.body.appendChild(l),()=>{document.body.removeChild(l)}),[l]),Kn(a.createElement(Bh,{top:e,left:t,width:n,height:r},a.createElement(es.default,{colors:i,drawShape:jh,...o})),l)}function Vh(e,t){return Math.floor(Math.random()*(t-e))+e}function jh(e){let t=this;switch(t.shape=t.shape||Vh(1,6),t.shape){case 2:{let n=t.w/2,r=t.h/2;e.moveTo(-n+2,-r),e.lineTo(n-2,-r),e.arcTo(n,-r,n,-r+2,2),e.lineTo(n,r-2),e.arcTo(n,r,n-2,r,2),e.lineTo(-n+2,r),e.arcTo(-n,r,-n,r-2,2),e.lineTo(-n,-r+2),e.arcTo(-n,-r,-n+2,-r,2);break}case 3:{e.rect(-4,-4,8,16),e.rect(-12,-4,24,8);break}case 4:{e.rect(-4,-4,8,16),e.rect(-4,-4,24,8);break}case 1:{e.arc(0,0,t.radius,0,2*Math.PI);break}case 5:{e.moveTo(16,4),e.lineTo(4,24),e.lineTo(24,24);break}case 6:{e.arc(4,-4,4,-Math.PI/2,0),e.lineTo(4,0);break}}e.closePath(),e.fill()}var Hh=w.div(({theme:e})=>({background:e.base==="light"?e.color.lightest:"#292A2C",width:260,padding:15,borderRadius:5,boxShadow:"0px 0px 32px 0px #00000029"})),Dh=w.div({display:"flex",flexDirection:"column",alignItems:"flex-start"}),zh=w.div(({theme:e})=>({fontSize:13,lineHeight:"18px",fontWeight:700,color:e.color.defaultText})),Uh=w.div(({theme:e})=>({fontSize:13,lineHeight:"18px",textAlign:"start",color:e.color.defaultText,margin:0,marginTop:5})),$h=w.div({display:"flex",justifyContent:"flex-end",marginTop:15}),Wh=({isLastStep:e,step:t,primaryProps:n,tooltipProps:r})=>a.createElement(Hh,{...r},a.createElement(Dh,null,t.title&&a.createElement(zh,null,t.title),a.createElement(Uh,null,t.content)),(t.hideNextButton||t.hideBackButton)&&a.createElement($h,{id:"buttonSkip"},!t.hideSkipButton&&!e&&a.createElement(ue,{size:"medium",onClick:t.onSkipWalkthroughButtonClick,link:!0,style:{paddingRight:12,paddingLeft:12,marginRight:8}},"Skip"),!t.hideNextButton&&a.createElement(ue,{...n,onClick:n.onClick,variant:"solid",...t.onNextButtonClick?{onClick:t.onNextButtonClick}:{}},t.nextButtonText||"Next"))),T1="setFilter",Gh=({managerApi:e,skipWalkthrough:t,startWalkthrough:n,completeWalkthrough:r})=>{let i=en(),o=fn(),l=o?.selectedTest?.result==="CHANGED",s=o?.selectedTest?.status!=="ACCEPTED",c=JSON.stringify(yn().layout),d=Pe(c);d.current!==c&&(window.dispatchEvent(new Event("resize")),d.current=c),oe(()=>{n()}),oe(()=>{e.getCurrentStoryData()?.type!=="story"&&e.jumpToStory(1),e.togglePanel(!0),e.togglePanelPosition("right"),e.setSelectedPanel(qt)},[e]);let[u,m]=rt("showConfetti",!1),[p,g]=rt("stepIndex",0),f=()=>g((y=0)=>y+1);return oe(()=>{let y=document.getElementById("storybook-explorer-tree Line truncated
"info info"
"actions actions"
"label controls"
`,gridTemplateColumns:"1fr fit-content(50%)",gridTemplateRows:"auto auto auto",borderBottom:`1px solid ${e.appBorderColor}`,"@container (min-width: 300px)":{gridTemplateAreas:`
"info actions"
"label controls"
`,gridTemplateColumns:"1fr auto",gridTemplateRows:"auto auto"},"@container (min-width: 800px)":{gridTemplateAreas:'"info label controls actions"',gridTemplateColumns:"auto 1fr auto auto",gridTemplateRows:40}})),Q1=w.div(({theme:e})=>({display:"grid",gridTemplateAreas:`
"header"
"main"
"footer"
`,gridTemplateColumns:"1fr",gridTemplateRows:"auto 1fr auto",height:"100%","&[hidden]":{display:"none"}})),K1=w.div(({theme:e})=>({gridArea:"header",position:"sticky",zIndex:1,top:0,background:e.background.content,"@container (min-width: 800px)":{background:e.background.app}})),j6=w.div(({theme:e})=>({gridArea:"main",overflowY:"auto",maxHeight:"100%",background:e.background.content})),J1=w.div(({theme:e})=>({gridArea:"footer",position:"sticky",zIndex:1,bottom:0})),H6=w.div(({children:e,theme:t})=>({display:"flex",alignItems:"center",border:`0px solid ${t.appBorderColor}`,borderTopWidth:1,borderBottomWidth:e?1:0,height:e?40:0,padding:e?"0 15px":0})),D6=w.div(({theme:e})=>({fontFamily:e.typography.fonts.mono,fontSize:e.typography.size.s1,color:e.color.defaultText,lineHeight:"18px",padding:15,whiteSpace:"pre-wrap",wordBreak:"break-word"})),Pi=w.div(({theme:e})=>({background:e.background.hoverable,padding:"10px 15px",lineHeight:"18px",position:"relative",borderBottom:`1px solid ${e.appBorderColor}`})),z6=({isOutdated:e,isStarting:t,isBuildFailed:n,shouldSwitchToLastBuildOnBranch:r,switchToLastBuildOnBranch:i,hidden:o,storyId:l})=>{let{baselineImageVisible:s,diffVisible:c,focusVisible:d}=Wr(),{toggleBaselineImage:u,toggleSettings:m,toggleWarnings:p}=Pn(),g=nc(),f="startedAt"in g&&g.startedAt,y=fn(),{tests:k}=y,b=a.useRef(l),h=a.useRef(y.selectedComparison?.id),v=a.useRef(g.id),{selectedTest:E,selectedComparison:S}=y,B=k.every(({result:xe,status:Qe})=>xe==="ADDED"&&Qe!=="ACCEPTED"),j=!B&&E?.result==="ADDED"&&E?.status!=="ACCEPTED",Y=!B&&S?.result==="ADDED"&&E?.result!=="ADDED"&&E?.status!=="ACCEPTED";oe(()=>{(b.current!==l||h.current!==y.selectedComparison?.id||v.current!==g.id||B||j||Y)&&(u(!1),m(!1),p(!1)),h.current=y.selectedComparison?.id,b.current=l,v.current=g.id},[g.id,l,y,u,m,p,B,j,Y]);let J=a.createElement(V6,{tests:k,startedAt:f,isStarting:t,isBuildFailed:n,isOutdated:e,shouldSwitchToLastBuildOnBranch:r,switchToLastBuildOnBranch:i});if(t||!k.length)return a.createElement(Q1,{hidden:o},a.createElement(K1,null,a.createElement(Y1,null,J)),a.createElement(J1,null,a.createElement(D1,null)));let ce=qo(k),{isInProgress:Se}=ce,Oe=S?.headCapture?.captureError&&"error"in S?.headCapture?.captureError&&S?.headCapture?.captureError?.error;return a.createElement(Q1,{hidden:o},a.createElement(K1,null,a.createElement(Y1,null,J,a.createElement(H7,{isOutdated:e}))),a.createElement(j6,null,Se&&a.createElement(pi,null),!Se&&B&&a.createElement(Pi,null,a.createElement(G,null,"New story found. Accept this snapshot as a test baseline."," ",a.createElement($e,{withArrow:!0,href:"https://www.chromatic.com/docs/branching-and-baselines",target:"_blank"},"Learn more"))),!Se&&j&&a.createElement(Pi,null,a.createElement(G,null,"New mode found. Accept this snapshot as a test baseline."," ",a.createElement($e,{withArrow:!0,href:"https://www.chromatic.com/docs/branching-and-baselines",target:"_blank"},"Learn more"))),!Se&&Y&&a.createElement(Pi,null,a.createElement(G,null,"New browser found. Accept this snapshot as a test baseline."," ",a.createElement($e,{withArrow:!0,href:"https://www.chromatic.com/docs/branching-and-baselines",target:"_blank"},"Learn more"))),!Se&&S&&a.createElement(N7,{key:S.id,componentName:E?.story?.component?.name,storyName:E?.story?.name,testUrl:E?.webUrl,comparisonResult:S.result??void 0,latestImage:S.headCapture?.captureImage??void 0,baselineImage:S.baseCapture?.captureImage??void 0,baselineImageVisible:s,diffImage:S.captureDiff?.diffImage??void 0,focusImage:S.captureDiff?.focusImage??void 0,diffVisible:c,focusVisible:d}),!Se&&Oe&&a.createElement(a.Fragment,null,a.createElement(H6,null,a.createElement("b",null,"Error stack trace")),a.createElement(D6,null,Oe.stack||Oe.message))),a.createElement(J1,null,a.createElement(D1,null)))},U6=w(ui)({padding:"4px 8px",margin:"0 6px"}),$6=({onClose:e})=>a.createElement(t0,null,a.createElement(oo,null,a.createElement(kr,null,"Warnings",a.createElement(U6,{status:"warning"},"2"),a.createElement(Po,{onClick:e},a.createElement(Bo,{"aria-label":"Close"}))),a.createElement("p",null,"It's essential that your components and stories render in a consistent fashion to prevent false positives. Two issues detected in this story may cause false positives."),a.createElement("p",null,a.createElement(ue,{variant:"outline"},a.createElement(as,null),"Docs"),a.createElement(ue,{variant:"outline"},a.createElement(Ad,null),"Get support"))));w.div(({theme:e})=>({color:e.color.warning,background:e.background.warning,padding:10,lineHeight:"18px",position:"relative"}));var W6=({branch:e,dismissBuildError:t,isOutdated:n,localBuildProgress:r,switchToLastBuildOnBranch:i,storyId:o})=>{let{settingsVisible:l,warningsVisible:s}=Wr(),{toggleSettings:c,toggleWarnings:d}=Pn(),{isRunning:u,startBuild:m,stopBuild:p}=Za(),{lastBuildOnBranch:g,lastBuildOnBranchIsReady:f,lastBuildOnBranchIsSelectable:y}=Rh(),k=nc(),b=fn(),{buildIsReviewable:h,userCanReview:v}=oc(),E=!!(!h&&f&&y&&i),S=g?.status==="IN_PROGRESS",B Line truncated
mutation UpdateUserPreferences($input: UserPreferencesInput!) {
updateUserPreferences(input: $input) {
updatedPreferences {
vtaOnboarding
}
}
}
`),K6=({lastBuildOnBranch:e,vtaOnboarding:t})=>{let n=vn(),{notifications:r,storyId:i}=yn(),[o,l]=a.useState(!1),s=a.useCallback(()=>{l(!0),r.forEach(({id:h})=>n.clearNotification(h))},[n,r]),[c,d]=a.useState(!1),u=a.useCallback(()=>d(!0),[]),[m,p]=a.useState(!0);a.useEffect(()=>{if(n?.getUrlState?.().queryParams.vtaOnboarding==="true"){p(!1);return}t&&p(t==="COMPLETED"||t==="DISMISSED")},[n,t]);let[{fetching:g},f]=Ms(Q6),y=a.useCallback(async h=>{await f({input:{vtaOnboarding:h?"COMPLETED":"DISMISSED"}}),p(!0),d(!1);let E=new URL(window.location.href);E.searchParams.has("vtaOnboarding")&&(E.searchParams.delete("vtaOnboarding"),window.history.replaceState({},"",E.href))},[f]),k=a.useMemo(()=>(e&&"testsForStatus"in e&&e.testsForStatus?.nodes&&Nn(ec,e.testsForStatus.nodes)||[]).some(h=>h?.status==="PENDING"&&h?.result==="CHANGED"&&h?.story?.storyId===i),[e,i]),b=!o&&!m&&!c;return{showOnboarding:b,showGuidedTour:!b&&!m,completeOnboarding:s,skipOnboarding:a.useCallback(()=>y(!1),[y]),completeWalkthrough:a.useCallback(()=>y(!0),[y]),skipWalkthrough:a.useCallback(()=>y(!1),[y]),startWalkthrough:u,lastBuildHasChangesForStory:k,isUpdating:g}},J6=({isOutdated:e,selectedBuildInfo:t,setSelectedBuildInfo:n,dismissBuildError:r,localBuildProgress:i,setOutdated:o,updateBuildStatus:l,projectId:s,gitInfo:c,storyId:d})=>{let u=vn(),{addNotification:m,setOptions:p,togglePanel:g}=u,f=Ih({projectId:s,storyId:d,gitInfo:c,selectedBuildInfo:t}),{account:y,features:k,manageUrl:b,hasData:h,hasProject:v,hasSelectedBuild:E,lastBuildOnBranch:S,lastBuildOnBranchIsReady:B,lastBuildOnBranchIsSelectable:j,selectedBuild:Y,selectedBuildMatchesGit:J,queryError:ce,rerunQuery:Se,userCanReview:Oe}=f,xe=W(({onDismiss:C})=>{C(),p({selectedPanel:qt}),g(!0)},[p,g]),Qe=Y6({buildIsReviewable:!!Y&&Y.id===S?.id,userCanReview:Oe,onReviewSuccess:Se,onReviewError:(C,M)=>{C instanceof Error&&m({id:`${U}/errorAccepting/${Date.now()}`,content:{headline:`Failed to ${M.status==="ACCEPTED"?"accept":"unaccept"} changes`,subHeadline:C.message},icon:a.createElement(Wt,{color:Lt.negative}),duration:8e3,onClick:xe})}});oe(()=>o(!J),[J,o]);let ge=S&&"testsForStatus"in S&&S.testsForStatus?.nodes&&Nn(ec,S.testsForStatus.nodes),Fe=j&&rp(u,ge||[]);oe(()=>{l(C=>({...q6(C),...Fe}))},[JSON.stringify(Fe),l]),oe(()=>{n(C=>ip(C,{shouldSwitchToLastBuildOnBranch:j&&B,lastBuildOnBranchId:S?.id,storyId:d}))},[j,B,S?.id,n,d]);let Bt=W(()=>S?.id&&j&&n({buildId:S.id,storyId:d}),[n,j,S?.id,d]),{showOnboarding:_e,showGuidedTour:bt,completeOnboarding:Dn,completeWalkthrough:Kt,skipOnboarding:ri,skipWalkthrough:zn,startWalkthrough:Un,lastBuildHasChangesForStory:Da}=K6(f);return k&&!k.uiTests?a.createElement(op,{manageUrl:b}):y?.suspensionReason?a.createElement(b0,{billingUrl:y.billingUrl,suspensionReason:y.suspensionReason}):_e&&v?a.createElement(a.Fragment,null,!h||ce?a.createElement(a.Fragment,null):a.createElement(Zi,{watchState:f},a.createElement(p7,{gitInfo:c,projectId:s,updateBuildStatus:l,dismissBuildError:r,localBuildProgress:i,showInitialBuildScreen:!Y,onComplete:Dn,onSkip:ri,lastBuildHasChangesForStory:Da}))):a.createElement(a.Fragment,null,!Y||!E||!h||ce?a.createElement(G6,{queryError:ce,hasData:h,hasProject:v,hasSelectedBuild:E,branch:c.branch,dismissBuildError:r,isOutdated:e,localBuildProgress:i,...j&&{switchToLastBuildOnBranch:Bt}}):a.createElement(C7,{watchState:Qe},a.createElement(Zi,{watchState:f},a.createElement(W6,{branch:c.branch,dismissBuildError:r,isOutdated:e,localBuildProgress:i,...S&&{lastBuildOnBranch:S},...j&&{switchToLastBuildOnBranch:Bt},userCanReview:Oe,storyId:d}))),bt&&a.createElement(Zi,{watchState:{selectedBuild:Y}},a.createElement(Gh,{managerApi:u,skipWalkthrough:zn,startWalkthrough:Un,completeWalkthrough:Kt})))},X6=e=>{let[t,n]=rt("selectedBuildInfo");return a.createElement(J6,{selectedBuildInfo:t,setSelectedBuildInfo:n,...e})},ef=({active:e,api:t})=>{let[n,r]=Ns(),i=W(_e=>{r(_e),_e||Q2("authenticationScreen","exchangeParameters")},[r]),{storyId:o}=yn(),[l,s]=Re(window.navigator.onLine);oe(()=>{let _e=()=>s(!0),bt=()=>s(!1);return window.addEventListener("online",_e),window.addEventListener("offline",bt),()=>{window.removeEventListener("online",_e),window.removeEventListener("offline",bt)}},[]);let[c]=Ie($d),[d]=Ie(cs),[u]=Ie(us),[m]=Ie(Di),[p,g]=Ie(ms),[,f]=Ie(Di),y=di({}),k=W(_e=>t.experimental_updateStatus(U,_e),[t]),{loading:b,projectId:h,configFile:v,updateProject:E,projectUpdatingFailed:S,projectIdUpdated:B,clearProjectIdUpdated:j}=Ls(),[Y,J]=rt("createdProjectId"),[ce,Se]=Ie(ps),Oe=W(_e=>y(Qd,_e),[y]),{isRunning:xe,startBuild:Qe,stopBuild:ge}=As({localBuildProgress:p,accessToken:n}),Fe=_e=>a.createElement(iu,{key:qt,value:yu},a.createElement(bu,{value:Oe},a.createElement(u2,{value:{accessToken:n,setAccessToken:i}},a.createElement(K2,{addonUninstalled:ce,setAddonUninstalled:Se},a.createElement(vm,null,a.createElement(np,{watchState:{isRunning:xe,startBuild:Qe,stopBuild:ge}},a.createElement("div",{hidden:!e,style:{containerType:"size",height:"100%" Line truncated
}catch(e){ console.error("[Storybook] One of your manager-entries failed: " + import.meta.url, e); }
@@ -0,0 +1,40 @@
Bundled license information:
filesize/dist/filesize.esm.js:
/**
* filesize
*
* @copyright 2024 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 10.1.4
*/
@chromatic-com/storybook/dist/manager.mjs:
/*! Bundled license information:
popper.js/dist/esm/popper.js:
(**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.16.1
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*)
*/