UNPKG

@storybook/addon-onboarding

Version:

Storybook Onboarding: Help new users learn how to write stories

974 lines (949 loc) • 298 kB
import { IntentSurvey } from "./chunk-IQU35HZW.js"; import { ADDON_CONTROLS_ID, ADDON_ONBOARDING_CHANNEL } from "./chunk-VFOIHBP2.js"; import { __commonJS, __toESM } from "./chunk-UBBB7RW7.js"; // ../../../node_modules/scroll/index.js var require_scroll = __commonJS({ "../../../node_modules/scroll/index.js"(exports, module) { var E_NOSCROLL = new Error("Element already at target scroll position"), E_CANCELLED = new Error("Scroll cancelled"), min = Math.min, ms = Date.now; module.exports = { left: make("scrollLeft"), top: make("scrollTop") }; function make(prop) { return function(el, to, opts, cb) { opts = opts || {}, typeof opts == "function" && (cb = opts, opts = {}), typeof cb != "function" && (cb = noop2); var start = ms(), from = el[prop], ease = opts.ease || inOutSine, duration = isNaN(opts.duration) ? 350 : +opts.duration, cancelled = !1; return from === to ? cb(E_NOSCROLL, el[prop]) : requestAnimationFrame(animate), cancel; function cancel() { cancelled = !0; } function animate(timestamp) { if (cancelled) return cb(E_CANCELLED, el[prop]); var now = ms(), time = min(1, (now - start) / duration), eased = ease(time); el[prop] = eased * (to - from) + from, time < 1 ? requestAnimationFrame(animate) : requestAnimationFrame(function() { cb(null, el[prop]); }); } }; } function inOutSine(n2) { return 0.5 * (1 - Math.cos(Math.PI * n2)); } function noop2() { } } }); // ../../../node_modules/scrollparent/scrollparent.js var require_scrollparent = __commonJS({ "../../../node_modules/scrollparent/scrollparent.js"(exports, module) { (function(root2, factory) { typeof define == "function" && define.amd ? define([], factory) : typeof module == "object" && module.exports ? module.exports = factory() : root2.Scrollparent = factory(); })(exports, function() { function isScrolling(node) { var overflow = getComputedStyle(node, null).getPropertyValue("overflow"); return overflow.indexOf("scroll") > -1 || overflow.indexOf("auto") > -1; } function scrollParent2(node) { if (node instanceof HTMLElement || node instanceof SVGElement) { for (var current = node.parentNode; current.parentNode; ) { if (isScrolling(current)) return current; current = current.parentNode; } return document.scrollingElement || document.documentElement; } } return scrollParent2; }); } }); // ../../../node_modules/react-innertext/index.js var require_react_innertext = __commonJS({ "../../../node_modules/react-innertext/index.js"(exports, module) { "use strict"; var hasProps = function(jsx) { return Object.prototype.hasOwnProperty.call(jsx, "props"); }, reduceJsxToString = function(previous, current) { return previous + innerText2(current); }, innerText2 = function(jsx) { return jsx === null || typeof jsx == "boolean" || typeof jsx > "u" ? "" : typeof jsx == "number" ? jsx.toString() : typeof jsx == "string" ? jsx : Array.isArray(jsx) ? jsx.reduce(reduceJsxToString, "") : hasProps(jsx) && Object.prototype.hasOwnProperty.call(jsx.props, "children") ? innerText2(jsx.props.children) : ""; }; innerText2.default = innerText2; module.exports = innerText2; } }); // ../../../node_modules/deepmerge/dist/cjs.js var require_cjs = __commonJS({ "../../../node_modules/deepmerge/dist/cjs.js"(exports, module) { "use strict"; var isMergeableObject = function(value) { return isNonNullObject(value) && !isSpecial(value); }; function isNonNullObject(value) { return !!value && typeof value == "object"; } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); } var canUseSymbol = typeof Symbol == "function" && Symbol.for, REACT_ELEMENT_TYPE = canUseSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE; } function emptyTarget(val) { return Array.isArray(val) ? [] : {}; } function cloneUnlessOtherwiseSpecified(value, options) { return options.clone !== !1 && options.isMergeableObject(value) ? deepmerge4(emptyTarget(value), value, options) : value; } function defaultArrayMerge(target, source, options) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options); }); } function getMergeFunction(key, options) { if (!options.customMerge) return deepmerge4; var customMerge = options.customMerge(key); return typeof customMerge == "function" ? customMerge : deepmerge4; } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { return Object.propertyIsEnumerable.call(target, symbol); }) : []; } function getKeys(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); } function propertyIsOnObject(object, property) { try { return property in object; } catch { return !1; } } function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); } function mergeObject(target, source, options) { var destination = {}; return options.isMergeableObject(target) && getKeys(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); }), getKeys(source).forEach(function(key) { propertyIsUnsafe(target, key) || (propertyIsOnObject(target, key) && options.isMergeableObject(source[key]) ? destination[key] = getMergeFunction(key, options)(target[key], source[key], options) : destination[key] = cloneUnlessOtherwiseSpecified(source[key], options)); }), destination; } function deepmerge4(target, source, options) { options = options || {}, options.arrayMerge = options.arrayMerge || defaultArrayMerge, options.isMergeableObject = options.isMergeableObject || isMergeableObject, options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source), targetIsArray = Array.isArray(target), sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; return sourceAndTargetTypesMatch ? sourceIsArray ? options.arrayMerge(target, source, options) : mergeObject(target, source, options) : cloneUnlessOtherwiseSpecified(source, options); } deepmerge4.all = function(array, options) { if (!Array.isArray(array)) throw new Error("first argument should be an array"); return array.reduce(function(prev, next) { return deepmerge4(prev, next, options); }, {}); }; var deepmerge_1 = deepmerge4; module.exports = deepmerge_1; } }); // ../../../node_modules/react-is/cjs/react-is.production.min.js var require_react_is_production_min = __commonJS({ "../../../node_modules/react-is/cjs/react-is.production.min.js"(exports) { "use strict"; var b2 = typeof Symbol == "function" && Symbol.for, c2 = b2 ? /* @__PURE__ */ Symbol.for("react.element") : 60103, d2 = b2 ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, e2 = b2 ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, f2 = b2 ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, g2 = b2 ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, h2 = b2 ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, k2 = b2 ? /* @__PURE__ */ Symbol.for("react.context") : 60110, l2 = b2 ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, m2 = b2 ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, n2 = b2 ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, p2 = b2 ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, q = b2 ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, r2 = b2 ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, t2 = b2 ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, v2 = b2 ? /* @__PURE__ */ Symbol.for("react.block") : 60121, w2 = b2 ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, x2 = b2 ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, y2 = b2 ? /* @__PURE__ */ Symbol.for("react.scope") : 60119; function z2(a2) { if (typeof a2 == "object" && a2 !== null) { var u2 = a2.$$typeof; switch (u2) { case c2: switch (a2 = a2.type, a2) { case l2: case m2: case e2: case g2: case f2: case p2: return a2; default: switch (a2 = a2 && a2.$$typeof, a2) { case k2: case n2: case t2: case r2: case h2: return a2; default: return u2; } } case d2: return u2; } } } function A2(a2) { return z2(a2) === m2; } exports.AsyncMode = l2; exports.ConcurrentMode = m2; exports.ContextConsumer = k2; exports.ContextProvider = h2; exports.Element = c2; exports.ForwardRef = n2; exports.Fragment = e2; exports.Lazy = t2; exports.Memo = r2; exports.Portal = d2; exports.Profiler = g2; exports.StrictMode = f2; exports.Suspense = p2; exports.isAsyncMode = function(a2) { return A2(a2) || z2(a2) === l2; }; exports.isConcurrentMode = A2; exports.isContextConsumer = function(a2) { return z2(a2) === k2; }; exports.isContextProvider = function(a2) { return z2(a2) === h2; }; exports.isElement = function(a2) { return typeof a2 == "object" && a2 !== null && a2.$$typeof === c2; }; exports.isForwardRef = function(a2) { return z2(a2) === n2; }; exports.isFragment = function(a2) { return z2(a2) === e2; }; exports.isLazy = function(a2) { return z2(a2) === t2; }; exports.isMemo = function(a2) { return z2(a2) === r2; }; exports.isPortal = function(a2) { return z2(a2) === d2; }; exports.isProfiler = function(a2) { return z2(a2) === g2; }; exports.isStrictMode = function(a2) { return z2(a2) === f2; }; exports.isSuspense = function(a2) { return z2(a2) === p2; }; exports.isValidElementType = function(a2) { return typeof a2 == "string" || typeof a2 == "function" || a2 === e2 || a2 === m2 || a2 === g2 || a2 === f2 || a2 === p2 || a2 === q || typeof a2 == "object" && a2 !== null && (a2.$$typeof === t2 || a2.$$typeof === r2 || a2.$$typeof === h2 || a2.$$typeof === k2 || a2.$$typeof === n2 || a2.$$typeof === w2 || a2.$$typeof === x2 || a2.$$typeof === y2 || a2.$$typeof === v2); }; exports.typeOf = z2; } }); // ../../../node_modules/react-is/cjs/react-is.development.js var require_react_is_development = __commonJS({ "../../../node_modules/react-is/cjs/react-is.development.js"(exports) { "use strict"; process.env.NODE_ENV !== "production" && (function() { "use strict"; var hasSymbol = typeof Symbol == "function" && Symbol.for, REACT_ELEMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103, REACT_PORTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, REACT_FRAGMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, REACT_STRICT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, REACT_PROFILER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, REACT_PROVIDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, REACT_CONTEXT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.context") : 60110, REACT_ASYNC_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, REACT_CONCURRENT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, REACT_FORWARD_REF_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, REACT_SUSPENSE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, REACT_SUSPENSE_LIST_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, REACT_MEMO_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, REACT_LAZY_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, REACT_BLOCK_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.block") : 60121, REACT_FUNDAMENTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, REACT_RESPONDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, REACT_SCOPE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.scope") : 60119; function isValidElementType(type) { return typeof type == "string" || typeof type == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); } function typeOf(object) { if (typeof object == "object" && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_ASYNC_MODE_TYPE: case REACT_CONCURRENT_MODE_TYPE: case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_PORTAL_TYPE: return $$typeof; } } } var AsyncMode = REACT_ASYNC_MODE_TYPE, ConcurrentMode = REACT_CONCURRENT_MODE_TYPE, ContextConsumer = REACT_CONTEXT_TYPE, ContextProvider = REACT_PROVIDER_TYPE, Element = REACT_ELEMENT_TYPE, ForwardRef = REACT_FORWARD_REF_TYPE, Fragment = REACT_FRAGMENT_TYPE, Lazy = REACT_LAZY_TYPE, Memo = REACT_MEMO_TYPE, Portal = REACT_PORTAL_TYPE, Profiler = REACT_PROFILER_TYPE, StrictMode = REACT_STRICT_MODE_TYPE, Suspense = REACT_SUSPENSE_TYPE, hasWarnedAboutDeprecatedIsAsyncMode = !1; function isAsyncMode(object) { return hasWarnedAboutDeprecatedIsAsyncMode || (hasWarnedAboutDeprecatedIsAsyncMode = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; } function isConcurrentMode(object) { return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement(object) { return typeof object == "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } exports.AsyncMode = AsyncMode, exports.ConcurrentMode = ConcurrentMode, exports.ContextConsumer = ContextConsumer, exports.ContextProvider = ContextProvider, exports.Element = Element, exports.ForwardRef = ForwardRef, exports.Fragment = Fragment, exports.Lazy = Lazy, exports.Memo = Memo, exports.Portal = Portal, exports.Profiler = Profiler, exports.StrictMode = StrictMode, exports.Suspense = Suspense, exports.isAsyncMode = isAsyncMode, exports.isConcurrentMode = isConcurrentMode, exports.isContextConsumer = isContextConsumer, exports.isContextProvider = isContextProvider, exports.isElement = isElement, exports.isForwardRef = isForwardRef, exports.isFragment = isFragment, exports.isLazy = isLazy, exports.isMemo = isMemo, exports.isPortal = isPortal, exports.isProfiler = isProfiler, exports.isStrictMode = isStrictMode, exports.isSuspense = isSuspense, exports.isValidElementType = isValidElementType, exports.typeOf = typeOf; })(); } }); // ../../../node_modules/react-is/index.js var require_react_is = __commonJS({ "../../../node_modules/react-is/index.js"(exports, module) { "use strict"; process.env.NODE_ENV === "production" ? module.exports = require_react_is_production_min() : module.exports = require_react_is_development(); } }); // ../../../node_modules/object-assign/index.js var require_object_assign = __commonJS({ "../../../node_modules/object-assign/index.js"(exports, module) { "use strict"; var getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val == null) throw new TypeError("Object.assign cannot be called with null or undefined"); return Object(val); } function shouldUseNative() { try { if (!Object.assign) return !1; var test1 = new String("abc"); if (test1[5] = "de", Object.getOwnPropertyNames(test1)[0] === "5") return !1; for (var test2 = {}, i2 = 0; i2 < 10; i2++) test2["_" + String.fromCharCode(i2)] = i2; var order2 = Object.getOwnPropertyNames(test2).map(function(n2) { return test2[n2]; }); if (order2.join("") !== "0123456789") return !1; var test3 = {}; return "abcdefghijklmnopqrst".split("").forEach(function(letter) { test3[letter] = letter; }), Object.keys(Object.assign({}, test3)).join("") === "abcdefghijklmnopqrst"; } catch { return !1; } } module.exports = shouldUseNative() ? Object.assign : function(target, source) { for (var from, to = toObject(target), symbols, s2 = 1; s2 < arguments.length; s2++) { from = Object(arguments[s2]); for (var key in from) hasOwnProperty.call(from, key) && (to[key] = from[key]); if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i2 = 0; i2 < symbols.length; i2++) propIsEnumerable.call(from, symbols[i2]) && (to[symbols[i2]] = from[symbols[i2]]); } } return to; }; } }); // ../../../node_modules/prop-types/lib/ReactPropTypesSecret.js var require_ReactPropTypesSecret = __commonJS({ "../../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) { "use strict"; var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; module.exports = ReactPropTypesSecret; } }); // ../../../node_modules/prop-types/lib/has.js var require_has = __commonJS({ "../../../node_modules/prop-types/lib/has.js"(exports, module) { module.exports = Function.call.bind(Object.prototype.hasOwnProperty); } }); // ../../../node_modules/prop-types/checkPropTypes.js var require_checkPropTypes = __commonJS({ "../../../node_modules/prop-types/checkPropTypes.js"(exports, module) { "use strict"; var printWarning = function() { }; process.env.NODE_ENV !== "production" && (ReactPropTypesSecret = require_ReactPropTypesSecret(), loggedTypeFailures = {}, has = require_has(), printWarning = function(text) { var message = "Warning: " + text; typeof console < "u" && console.error(message); try { throw new Error(message); } catch { } }); var ReactPropTypesSecret, loggedTypeFailures, has; function checkPropTypes(typeSpecs, values, location, componentName, getStack) { if (process.env.NODE_ENV !== "production") { for (var typeSpecName in typeSpecs) if (has(typeSpecs, typeSpecName)) { var error; try { if (typeof typeSpecs[typeSpecName] != "function") { var err = Error( (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." ); throw err.name = "Invariant Violation", err; } error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); } catch (ex) { error = ex; } if (error && !(error instanceof Error) && printWarning( (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." ), error instanceof Error && !(error.message in loggedTypeFailures)) { loggedTypeFailures[error.message] = !0; var stack = getStack ? getStack() : ""; printWarning( "Failed " + location + " type: " + error.message + (stack ?? "") ); } } } } checkPropTypes.resetWarningCache = function() { process.env.NODE_ENV !== "production" && (loggedTypeFailures = {}); }; module.exports = checkPropTypes; } }); // ../../../node_modules/prop-types/factoryWithTypeCheckers.js var require_factoryWithTypeCheckers = __commonJS({ "../../../node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) { "use strict"; var ReactIs = require_react_is(), assign = require_object_assign(), ReactPropTypesSecret = require_ReactPropTypesSecret(), has = require_has(), checkPropTypes = require_checkPropTypes(), printWarning = function() { }; process.env.NODE_ENV !== "production" && (printWarning = function(text) { var message = "Warning: " + text; typeof console < "u" && console.error(message); try { throw new Error(message); } catch { } }); function emptyFunctionThatReturnsNull() { return null; } module.exports = function(isValidElement2, throwOnDirectAccess) { var ITERATOR_SYMBOL = typeof Symbol == "function" && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator"; function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn == "function") return iteratorFn; } var ANONYMOUS = "<<anonymous>>", ReactPropTypes = { array: createPrimitiveTypeChecker("array"), bigint: createPrimitiveTypeChecker("bigint"), bool: createPrimitiveTypeChecker("boolean"), func: createPrimitiveTypeChecker("function"), number: createPrimitiveTypeChecker("number"), object: createPrimitiveTypeChecker("object"), string: createPrimitiveTypeChecker("string"), symbol: createPrimitiveTypeChecker("symbol"), any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, element: createElementTypeChecker(), elementType: createElementTypeTypeChecker(), instanceOf: createInstanceTypeChecker, node: createNodeChecker(), objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, shape: createShapeTypeChecker, exact: createStrictShapeTypeChecker }; function is4(x2, y2) { return x2 === y2 ? x2 !== 0 || 1 / x2 === 1 / y2 : x2 !== x2 && y2 !== y2; } function PropTypeError(message, data) { this.message = message, this.data = data && typeof data == "object" ? data : {}, this.stack = ""; } PropTypeError.prototype = Error.prototype; function createChainableTypeChecker(validate) { if (process.env.NODE_ENV !== "production") var manualPropTypeCallCache = {}, manualPropTypeWarningCount = 0; function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { if (componentName = componentName || ANONYMOUS, propFullName = propFullName || propName, secret !== ReactPropTypesSecret) { if (throwOnDirectAccess) { var err = new Error( "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" ); throw err.name = "Invariant Violation", err; } else if (process.env.NODE_ENV !== "production" && typeof console < "u") { var cacheKey = componentName + ":" + propName; !manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors manualPropTypeWarningCount < 3 && (printWarning( "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." ), manualPropTypeCallCache[cacheKey] = !0, manualPropTypeWarningCount++); } } return props[propName] == null ? isRequired ? props[propName] === null ? new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")) : new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")) : null : validate(props, propName, componentName, location, propFullName); } var chainedCheckType = checkType.bind(null, !1); return chainedCheckType.isRequired = checkType.bind(null, !0), chainedCheckType; } function createPrimitiveTypeChecker(expectedType) { function validate(props, propName, componentName, location, propFullName, secret) { var propValue = props[propName], propType = getPropType(propValue); if (propType !== expectedType) { var preciseType = getPreciseType(propValue); return new PropTypeError( "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), { expectedType } ); } return null; } return createChainableTypeChecker(validate); } function createAnyTypeChecker() { return createChainableTypeChecker(emptyFunctionThatReturnsNull); } function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker != "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf."); var propValue = props[propName]; if (!Array.isArray(propValue)) { var propType = getPropType(propValue); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")); } for (var i2 = 0; i2 < propValue.length; i2++) { var error = typeChecker(propValue, i2, componentName, location, propFullName + "[" + i2 + "]", ReactPropTypesSecret); if (error instanceof Error) return error; } return null; } return createChainableTypeChecker(validate); } function createElementTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!isValidElement2(propValue)) { var propType = getPropType(propValue); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement.")); } return null; } return createChainableTypeChecker(validate); } function createElementTypeTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!ReactIs.isValidElementType(propValue)) { var propType = getPropType(propValue); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type.")); } return null; } return createChainableTypeChecker(validate); } function createInstanceTypeChecker(expectedClass) { function validate(props, propName, componentName, location, propFullName) { if (!(props[propName] instanceof expectedClass)) { var expectedClassName = expectedClass.name || ANONYMOUS, actualClassName = getClassName(props[propName]); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`.")); } return null; } return createChainableTypeChecker(validate); } function createEnumTypeChecker(expectedValues) { if (!Array.isArray(expectedValues)) return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? printWarning( "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." ) : printWarning("Invalid argument supplied to oneOf, expected an array.")), emptyFunctionThatReturnsNull; function validate(props, propName, componentName, location, propFullName) { for (var propValue = props[propName], i2 = 0; i2 < expectedValues.length; i2++) if (is4(propValue, expectedValues[i2])) return null; var valuesString = JSON.stringify(expectedValues, function(key, value) { var type = getPreciseType(value); return type === "symbol" ? String(value) : value; }); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")); } return createChainableTypeChecker(validate); } function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker != "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf."); var propValue = props[propName], propType = getPropType(propValue); if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")); for (var key in propValue) if (has(propValue, key)) { var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); if (error instanceof Error) return error; } return null; } return createChainableTypeChecker(validate); } function createUnionTypeChecker(arrayOfTypeCheckers) { if (!Array.isArray(arrayOfTypeCheckers)) return process.env.NODE_ENV !== "production" && printWarning("Invalid argument supplied to oneOfType, expected an instance of array."), emptyFunctionThatReturnsNull; for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) { var checker = arrayOfTypeCheckers[i2]; if (typeof checker != "function") return printWarning( "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i2 + "." ), emptyFunctionThatReturnsNull; } function validate(props, propName, componentName, location, propFullName) { for (var expectedTypes = [], i3 = 0; i3 < arrayOfTypeCheckers.length; i3++) { var checker2 = arrayOfTypeCheckers[i3], checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret); if (checkerResult == null) return null; checkerResult.data && has(checkerResult.data, "expectedType") && expectedTypes.push(checkerResult.data.expectedType); } var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + ".")); } return createChainableTypeChecker(validate); } function createNodeChecker() { function validate(props, propName, componentName, location, propFullName) { return isNode(props[propName]) ? null : new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode.")); } return createChainableTypeChecker(validate); } function invalidValidatorError(componentName, location, propFullName, key, type) { return new PropTypeError( (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`." ); } function createShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName], propType = getPropType(propValue); if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); for (var key in shapeTypes) { var checker = shapeTypes[key]; if (typeof checker != "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); if (error) return error; } return null; } return createChainableTypeChecker(validate); } function createStrictShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName], propType = getPropType(propValue); if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); var allKeys = assign({}, props[propName], shapeTypes); for (var key in allKeys) { var checker = shapeTypes[key]; if (has(shapeTypes, key) && typeof checker != "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); if (!checker) return new PropTypeError( "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + ` Valid keys: ` + JSON.stringify(Object.keys(shapeTypes), null, " ") ); var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); if (error) return error; } return null; } return createChainableTypeChecker(validate); } function isNode(propValue) { switch (typeof propValue) { case "number": case "string": case "undefined": return !0; case "boolean": return !propValue; case "object": if (Array.isArray(propValue)) return propValue.every(isNode); if (propValue === null || isValidElement2(propValue)) return !0; var iteratorFn = getIteratorFn(propValue); if (iteratorFn) { var iterator = iteratorFn.call(propValue), step; if (iteratorFn !== propValue.entries) { for (; !(step = iterator.next()).done; ) if (!isNode(step.value)) return !1; } else for (; !(step = iterator.next()).done; ) { var entry = step.value; if (entry && !isNode(entry[1])) return !1; } } else return !1; return !0; default: return !1; } } function isSymbol(propType, propValue) { return propType === "symbol" ? !0 : propValue ? propValue["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && propValue instanceof Symbol : !1; } function getPropType(propValue) { var propType = typeof propValue; return Array.isArray(propValue) ? "array" : propValue instanceof RegExp ? "object" : isSymbol(propType, propValue) ? "symbol" : propType; } function getPreciseType(propValue) { if (typeof propValue > "u" || propValue === null) return "" + propValue; var propType = getPropType(propValue); if (propType === "object") { if (propValue instanceof Date) return "date"; if (propValue instanceof RegExp) return "regexp"; } return propType; } function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case "array": case "object": return "an " + type; case "boolean": case "date": case "regexp": return "a " + type; default: return type; } } function getClassName(propValue) { return !propValue.constructor || !propValue.constructor.name ? ANONYMOUS : propValue.constructor.name; } return ReactPropTypes.checkPropTypes = checkPropTypes, ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache, ReactPropTypes.PropTypes = ReactPropTypes, ReactPropTypes; }; } }); // ../../../node_modules/prop-types/factoryWithThrowingShims.js var require_factoryWithThrowingShims = __commonJS({ "../../../node_modules/prop-types/factoryWithThrowingShims.js"(exports, module) { "use strict"; var ReactPropTypesSecret = require_ReactPropTypesSecret(); function emptyFunction() { } function emptyFunctionWithReset() { } emptyFunctionWithReset.resetWarningCache = emptyFunction; module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret !== ReactPropTypesSecret) { var err = new Error( "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types" ); throw err.name = "Invariant Violation", err; } } shim.isRequired = shim; function getShim() { return shim; } var ReactPropTypes = { array: shim, bigint: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, elementType: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim, checkPropTypes: emptyFunctionWithReset, resetWarningCache: emptyFunction }; return ReactPropTypes.PropTypes = ReactPropTypes, ReactPropTypes; }; } }); // ../../../node_modules/prop-types/index.js var require_prop_types = __commonJS({ "../../../node_modules/prop-types/index.js"(exports, module) { process.env.NODE_ENV !== "production" ? (ReactIs = require_react_is(), throwOnDirectAccess = !0, module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess)) : module.exports = require_factoryWithThrowingShims()(); var ReactIs, throwOnDirectAccess; } }); // src/Onboarding.tsx import React14, { useCallback as useCallback3, useEffect as useEffect5, useState as useState3 } from "react"; import { SyntaxHighlighter } from "storybook/internal/components"; import { SAVE_STORY_RESPONSE } from "storybook/internal/core-events"; import { ThemeProvider as ThemeProvider2, convert as convert2, styled as styled4, themes as themes2 } from "storybook/theming"; // ../../core/src/manager/components/TourGuide/HighlightElement.tsx import { useEffect } from "react"; var HIGHLIGHT_KEYFRAMES_ID = "storybook-highlight-element-keyframes", keyframes = ` @keyframes sb-highlight-pulsate { 0% { box-shadow: rgba(2,156,253,1) 0 0 2px 1px, 0 0 0 0 rgba(2, 156, 253, 0.7), 0 0 0 0 rgba(2, 156, 253, 0.4); } 50% { box-shadow: rgba(2,156,253,1) 0 0 2px 1px, 0 0 0 20px rgba(2, 156, 253, 0), 0 0 0 40px rgba(2, 156, 253, 0); } 100% { box-shadow: rgba(2,156,253,1) 0 0 2px 1px, 0 0 0 0 rgba(2, 156, 253, 0), 0 0 0 0 rgba(2, 156, 253, 0); } } `, createOverlay = (element) => { let overlay = document.createElement("div"); return overlay.id = "storybook-highlight-element", overlay.style.position = "fixed", overlay.style.pointerEvents = "none", overlay.style.zIndex = "2147483647", overlay.style.transition = "opacity 0.2s ease-in-out", requestAnimationFrame(() => { updateOverlayStyles(element, overlay), element.scrollIntoView({ behavior: "smooth", block: "center" }); }), overlay; }, updateOverlayStyles = (element, overlay) => { let rect = element.getBoundingClientRect(), computedStyle = window.getComputedStyle(element); overlay.style.top = `${rect.top}px`, overlay.style.left = `${rect.left}px`, overlay.style.width = `${rect.width}px`, overlay.style.height = `${rect.height}px`, overlay.style.borderRadius = computedStyle.borderRadius; }, findScrollableAncestors = (element) => { let scrollableAncestors = [window], parent = element.parentElement; for (; parent; ) { let style = window.getComputedStyle(parent); (style.overflow === "auto" || style.overflow === "scroll" || style.overflowX === "auto" || style.overflowX === "scroll" || style.overflowY === "auto" || style.overflowY === "scroll") && scrollableAncestors.push(parent), parent = parent.parentElement; } return scrollableAncestors; }; function HighlightElement({ targetSelector, pulsating = !1 }) { return useEffect(() => { let element = document.querySelector(targetSelector); if (!element || !element.parentElement) return; let overlay = document.body.appendChild(createOverlay(element)); if (pulsating) { if (!document.getElementById(HIGHLIGHT_KEYFRAMES_ID)) { let style = document.createElement("style"); style.id = HIGHLIGHT_KEYFRAMES_ID, style.innerHTML = keyframes, document.head.appendChild(style); } overlay.style.animation = "sb-highlight-pulsate 3s infinite", overlay.style.transformOrigin = "center", overlay.style.animationTimingFunction = "ease-in-out"; } else overlay.style.boxShadow = "rgba(2,156,253,1) 0 0 2px 1px"; let scrollTimeout = null, handleScroll = () => { overlay.parentElement && overlay.remove(), scrollTimeout !== null && clearTimeout(scrollTimeout), scrollTimeout = window.setTimeout(() => { element && (updateOverlayStyles(element, overlay), overlay.style.opacity = "0", document.body.appendChild(overlay), requestAnimationFrame(() => overlay.style.opacity = "1")); }, 150); }, resizeObserver = new ResizeObserver( () => overlay.parentElement && updateOverlayStyles(element, overlay) ); resizeObserver.observe(window.document.body), resizeObserver.observe(element); let scrollContainers = findScrollableAncestors(element); return scrollContainers.forEach( (el) => el.addEventListener("scroll", handleScroll, { passive: !0 }) ), scrollContainers.filter((el) => el !== window).forEach((el) => resizeObserver.observe(el)), () => { scrollTimeout !== null && clearTimeout(scrollTimeout), overlay.parentElement && overlay.remove(), scrollContainers.forEach((el) => el.removeEventListener("scroll", handleScroll)), resizeObserver.disconnect(); }; }, [targetSelector, pulsating]), null; } // ../../core/src/manager/components/TourGuide/TourGuide.tsx import React11, { useCallback, useEffect as useEffect3, useMemo, useRef, useState } from "react"; import { createRoot } from "react-dom/client"; // ../../../node_modules/@babel/runtime/helpers/esm/extends.js function _extends() { return _extends = Object.assign ? Object.assign.bind() : function(n2) { for (var e2 = 1; e2 < arguments.length; e2++) { var t2 = arguments[e2]; for (var r2 in t2) ({}).hasOwnProperty.call(t2, r2) && (n2[r2] = t2[r2]); } return n2; }, _extends.apply(null, arguments); } // ../../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js function _assertThisInitialized(e2) { if (e2 === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e2; } // ../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js function _setPrototypeOf(t2, e2) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) { return t3.__proto__ = e3, t3; }, _setPrototypeOf(t2, e2); } // ../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js function _inheritsLoose(t2, o2) { t2.prototype = Object.create(o2.prototype), t2.prototype.constructor = t2, _setPrototypeOf(t2, o2); } // ../../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js function _getPrototypeOf(t2) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) { return t3.__proto__ || Object.getPrototypeOf(t3); }, _getPrototypeOf(t2); } // ../../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js function _isNativeFunction(t2) { try { return Function.toString.call(t2).indexOf("[native code]") !== -1; } catch { return typeof t2 == "function"; } } // ../../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js function _isNativeReflectConstruct() { try {