interface IPeopleApiPersonMetaData {
  ownerId: string;
  objectType: string;
  contactId: string[];
  inViewerDomain: boolean;
  ownerUserType: string[];
  affinity: IPeopleApiAffinity[];
  identityInfo: IPeopleApiIdentityInfo;
}


interface IPeopleApiResponseHeaders extends IHttpResponseHeaders {
  date: string;
  server: string;
  vary: string;
}


interface IPeopleApiResponseOuterResult {
  results: IPeopleApiResponseInnerResult[];
  nextPageToken: string;
  status: object;
}


interface IPeopleApiSourceId {
  id: string;
  containerType: string;
}


/**
 * 参数预处理
 * 配置 @Optimized() 标识注解使用
 * @returns Function
 */
export function Preprocess() {
    return function (target: any, propertyName: string, descriptor: TypedPropertyDescriptor<Function>) {
        let method = descriptor.value!
        descriptor.value = function () {
            let optimizedParameters: number[] = Reflect.getOwnMetadata(optimizedMetadataKey, target, propertyName)
            if (optimizedParameters) {
                for (let parameterIndex of optimizedParameters) {
                    let value = arguments[parameterIndex]
                    if (typeof value === 'object') {
                        arguments[parameterIndex] = removeInvalidField(value)
                    }
                }
            }
            return method.apply(this, arguments)
        }
    }
}


/**
 * 清除未初始化的字段
 * @returns Function
 */
export function Optimized() {
    return function (target: Object, propertyKey: string | symbol, parameterIndex: number) {
        let existingRequiredParameters: number[] = Reflect.getOwnMetadata(optimizedMetadataKey, target, propertyKey) || []
        existingRequiredParameters.push(parameterIndex)
        Reflect.defineMetadata(optimizedMetadataKey, existingRequiredParameters, target, propertyKey)
    }
}


export interface Repository<TModel> {
  list(top?: number): Promise<TModel[]>;
  get(id: number): Promise<TModel>;
  add(model: TModel): Promise<TModel>;
  update(model: TModel): Promise<TModel>;
  remove(id: number): Promise<void>;
}


@Module({
  imports: [
    ConfigModule,
    LoggerModule,
  ],
  exports: [
    CacheInterceptor,
    MutexInterceptor,
    RedisUtilsProvider,
    HashCacheInterceptor,
    ClusterCacheInterceptor,
    HashClusterCacheInterceptor,
    RedisClientFactoryProvider.getProvider(),
    ClusterClientFactoryProvider.getProvider(),
  ],
  providers: [
    CacheInterceptor,
    MutexInterceptor,
    RedisUtilsProvider,
    HashCacheInterceptor,
    ClusterCacheInterceptor,
    HashClusterCacheInterceptor,
    RedisClientFactoryProvider.getProvider(),
    ClusterClientFactoryProvider.getProvider(),
  ],
})
export class RedisClientModule {}


() => {
    const appActionAsyncKeys = Object.keys(appActionAsync) as (keyof ipc.AppActionAsync)[];
    appActionAsyncKeys.forEach(k => {
        ipcMain.on(k, (_event, args: any) => {
            appActionAsync[k](args);
        });
    });

    const appActionSyncKeys = Object.keys(appActionSync) as (keyof ipc.AppActionSync)[];
    appActionSyncKeys.forEach(k => {
        ipcMain.handle(k, appActionSync[k]);
    });

    const mainWin = windowManager.getWindow(constants.WindowsName.Main)!;
    injectionWindowIPCAction(mainWin);
}


k => {
        ipcMain.on(k, (_event, args: any) => {
            appActionAsync[k](args);
        });
    }


(_event, args: any) => {
            appActionAsync[k](args);
        }


k => {
        ipcMain.handle(k, appActionSync[k]);
    }


({ Component, pageProps }) => {
  return (
      <Component {...pageProps} />
  )
}


export interface Match {
  params: Record<string, string>;
}


export interface RouteComponentProps<TPreloadedData = any> {
  /**
   * The preloaded data returned by `preloadData`. If `preloadData` is not
   * specified for a route, then `preloadedData` is `undefined`.
   */
  preloadedData: TPreloadedData;

  /**
   * The values of the dynamic parameters in the `path`, if any.
   */
  params: Record<string, string>;

  /**
   * Any matching child routes that should be rendered inside the parent route.
   */
  children: ReactNode;
}


export interface MatchedRoute<TPreloadedData = any> {
  route: Route<TPreloadedData>;
  match: Match;
}


export interface RouterEntry {
  location: Location;
  preloadedRoutes: PreloadedRoute[];
}


export interface RouterOptions {
  /**
   * The default fallback component to use for any route that didn't specify a
   * custom `fallback`. The default fallback will be shown while the component
   * or data for the route are loading.
   */
  defaultFallback?: ComponentType;

  /**
   * The error fallback component to show when an error occurs for some route,
   * e.g., when the component or data for a route fails to load.
   */
  errorFallback?: ComponentType<{ error: Error; retry: () => void }>;

  /**
   * The type of history object to use for route navigation. The history object
   * is created with the [`history`
   * package](https://github.com/ReactTraining/history).
   */
  history?: RouterHistoryOption;

  /**
   * Callback that is called when an error occurs for some route, e.g., when
   * the component or data for a route fails to load. This callback can be used
   * to log the error information to an error reporting service.
   */
  onError?: (error: Error, errorInfo: ErrorInfo) => void;

  /**
   * Content to preload for a link's path whenever the link is hovered.
   */
  preloadOnLinkHover?: PreloadContentOption;

  /**
   * Content to preload for a link's path whenever the link is pressed in
   * (mouse down on desktop).
   */
  preloadOnLinkPressIn?: PreloadContentOption;

  /**
   * The `useTransition` hook exported by React. When you pass the
   * `useTransition` hook, you opt into having a delay during route updates in
   * order to avoid showing undesirable loading states.
   */
  useTransition?: UseTransition;
}


export interface Router {
  /**
   * Disables the transition for the next route update. This is only applicable
   * when you opt into route transitions by passing the `useTransition` option.
   */
  disableNextRouteTransition: () => void;

  /**
   * Enables the transition for the next route update. This is only applicable
   * when you opt into route transitions by passing the `useTransition` option.
   */
  enableNextRouteTransition: () => void;

  /**
   * Returns the current router entry, which consists of the location object
   * and the preloaded routes for that location.
   */
  getCurrentRouterEntry: () => RouterEntry;

  /**
   * The history object created with the `history` package, which provides the
   * primitives for route navigation.
   */
  history: BrowserHistory | MemoryHistory | HashHistory;

  /**
   * Returns whether the transition for the next route is enabled. This is only
   * applicable when you opt into route transitions by passing the
   * `useTransition` option.
   */
  isNextRouteTransitionEnabled: () => boolean;

  /**
   * The options provided to `createRouter` populated with default values for
   * all options that were omitted.
   */
  options: Required<RouterOptions>;

  /**
   * Preloads the specified `content` for the given path before the navigation
   * to that path actually occurs. Note that if the specified `content` is
   * already loaded or is loading for the given `path`, then this function has
   * no effect.
   */
  preloadBeforeNavigation: (path: string, content: PreloadContentOption) => void;

  /**
   * Refreshes the current router entry by preloading again the components and
   * data for the current entry. Note that if the components already loaded or
   * are still loading, then preloading them again will have no effect.
   */
  refreshCurrentRouterEntry: () => void;

  /**
   * Removes the history listener that the router attached to the history
   * object when it was created.
   */
  removeHistoryListener: () => void;

  /**
   * Subscribes the given callback function to router entry changes. A cleanup
   * function is returned that will unsubscribe the callback when called.
   */
  subscribe: (subscriber: (routerEntry: RouterEntry) => void) => () => void;
}


export type RouteComponent<TPreloadedData = any> = ComponentType<
  RouteComponentProps<TPreloadedData>
>;


export type Route<TPreloadedData = any> = {
  /**
   * The path for which this route will match. Path parameters, even with
   * custom regular expressions, are supported.
   */
  path?: string;

  /**
   * The component to render for the route.
   */
  component: RouteComponent<TPreloadedData>;

  /**
   * Function used to preload data for the route whenever it matches. This
   * function is called with the route parameters and it should return the
   * preloaded data in the form of a resource that the route component can
   * attempt to read and if it's not ready yet, the component suspends.
   */
  preloadData?: (params: Record<string, string>) => TPreloadedData;

  /**
   * The fallback component that will be shown while the component or data for
   * the route are still loading.
   */
  fallback?: ComponentType;

  /**
   * Children routes of the current route.
   */
  routes?: Route[];
};


export type PreloadedRoute<TPreloadedData = any> = {
  component: RouteComponent<TPreloadedData>;
  preloadedData: TPreloadedData;
  fallback?: ComponentType;
  match: Match;
};


export type UseTransition = () => [(callback: () => void) => void, boolean];


/**
 * Specifies what type of content to preload for a path even before the
 * navigation to that path occurs.
 */
export type PreloadContentOption = 'code' | 'code-and-data' | 'none';


export type RouterHistoryOption = 'browser' | 'hash' | 'memory' | ['memory', MemoryHistoryOptions];


({
  dataset,
  organization,
  referenceData,
  isLoadingDataset,
  datasetActions: {
    getDatasetRequested: getDataset,
    deleteDatasetRequested: deleteDataset
  },
  organizationActions: { getOrganizationRequested: getOrganization },
  referenceDataActions: {
    getReferenceDataRequested: getReferenceData,
    getNewReferenceDataRequested: getNewReferenceData
  },
  authService
}) => {
  const { catalogId, datasetId } = useParams<RouteParams>();
  const { replace } = useHistory();

  const referenceDataCodes = [
    ReferenceDataCode.FREQUENCY,
    ReferenceDataCode.OPEN_LICENCES,
    ReferenceDataCode.PROVENANCE,
    ReferenceDataCode.REFERENCE_TYPES
  ];

  const newReferenceDataCodes = [
    ReferenceDataCode.LOS,
    ReferenceDataCode.THEMES,
    ReferenceDataCode.MEDIA_TYPES
  ];

  useEffect(() => {
    getDataset(catalogId, datasetId);

    if (organization?.id !== catalogId) {
      getOrganization(catalogId);
    }

    if (
      !referenceDataCodes.every(code =>
        Object.keys(referenceData).includes(code)
      )
    ) {
      getReferenceData(
        referenceDataCodes.filter(
          code => !Object.keys(referenceData).includes(code)
        )
      );
    }

    if (
      !newReferenceDataCodes.every(code =>
        Object.keys(referenceData).includes(code)
      )
    ) {
      getNewReferenceData(
        newReferenceDataCodes.filter(
          code => !Object.keys(referenceData).includes(code)
        )
      );
    }
  }, []);

  const handleDeleteDataset = () =>
    deleteDataset(catalogId, datasetId, () =>
      replace(`/catalogs/${catalogId}/datasets`, { confirmDelete: true })
    );

  const isReadOnly =
    !authService.hasSystemAdminPermission() &&
    !authService.hasOrganizationWritePermission(catalogId);

  const allowDelegatedRegistration =
    organization?.allowDelegatedRegistration ?? false;

  return (
    <>
      <Breadcrumbs as={SC.Breadcrumbs}>
        <Breadcrumb>
          <Link to='/catalogs' as={RouteLink}>
            <Translation id='Alle kataloger' />
          </Link>
        </Breadcrumb>
        <Breadcrumb>
          <Link to={`/catalogs/${catalogId}/datasets`} as={RouteLink}>
            <Translation id='Datasettkatalog' />
          </Link>
        </Breadcrumb>
        <Breadcrumb active>
          {isLoadingDataset && <Skeleton width={200} />}
          {!isLoadingDataset &&
            (Object.values(dataset?.title ?? {}).some(Boolean) ? (
              <Translation object={dataset?.title} />
            ) : (
              <Translation id='breadcrumbs.datasetRegistration' />


() => {
    getDataset(catalogId, datasetId);

    if (organization?.id !== catalogId) {
      getOrganization(catalogId);
    }

    if (
      !referenceDataCodes.every(code =>
        Object.keys(referenceData).includes(code)
      )
    ) {
      getReferenceData(
        referenceDataCodes.filter(
          code => !Object.keys(referenceData).includes(code)
        )
      );
    }

    if (
      !newReferenceDataCodes.every(code =>
        Object.keys(referenceData).includes(code)
      )
    ) {
      getNewReferenceData(
        newReferenceDataCodes.filter(
          code => !Object.keys(referenceData).includes(code)
        )
      );
    }
  }


code =>
        Object.keys(referenceData).includes(code)


code => !Object.keys(referenceData).includes(code)


() =>
    deleteDataset(catalogId, datasetId, () =>
      replace(`/catalogs/${catalogId}/datasets`, { confirmDelete: true })
    )


() =>
      replace(`/catalogs/${catalogId}/datasets`, { confirmDelete: true })


interface RouteParams {
  catalogId: string;
  datasetId: string;
}


interface Props
  extends AuthProps,
    DatasetProps,
    OrganizationProps,
    ReferenceDataProps {}


export function getScrollableAncestors(element: Node | null): Element[] {
  // console.log('element', element);
  const scrollParents: Element[] = [];

  function findScrollableAncestors(node: Node | null): Element[] {
    // console.log('finding scrollable ancestors');
    if (!node) {
      // console.log('not node', node);
      return scrollParents;
    }

    if (node instanceof Document && node.scrollingElement != null) {
      // console.log('found node, adding', node);
      scrollParents.push(node.scrollingElement);

      return scrollParents;
    }

    if (!(node instanceof HTMLElement) || node instanceof SVGElement) {
      // console.log('not node #2', node);
      return scrollParents;
    }

    if (isScrollable(node)) {
      // console.log('found isScrollable, adding', node);
      scrollParents.push(node);
      // console.log(scrollParents);
    }

    // console.log('calling parent recursevly');
    return findScrollableAncestors(node.parentNode);
  }

  // console.log('returning');
  // console.log(scrollParents);
  return element ? findScrollableAncestors(element.parentNode) : scrollParents;
}


function findScrollableAncestors(node: Node | null): Element[] {
    // console.log('finding scrollable ancestors');
    if (!node) {
      // console.log('not node', node);
      return scrollParents;
    }

    if (node instanceof Document && node.scrollingElement != null) {
      // console.log('found node, adding', node);
      scrollParents.push(node.scrollingElement);

      return scrollParents;
    }

    if (!(node instanceof HTMLElement) || node instanceof SVGElement) {
      // console.log('not node #2', node);
      return scrollParents;
    }

    if (isScrollable(node)) {
      // console.log('found isScrollable, adding', node);
      scrollParents.push(node);
      // console.log(scrollParents);
    }

    // console.log('calling parent recursevly');
    return findScrollableAncestors(node.parentNode);
  }


(err: any): any /** TODO #9100 */ => null


(): any /** TODO #9100 */ => null


(value: any /** TODO #9100 */) => {
        setTimeout(() => generatorOrNext.next(value));
      }


() => generatorOrNext.next(value)


(value: any /** TODO #9100 */) => { generatorOrNext.next(value); }


(err) => { setTimeout(() => generatorOrNext.error(err)); }


() => generatorOrNext.error(err)


(err) => { generatorOrNext.error(err); }


() => { setTimeout(() => generatorOrNext.complete()); }


() => generatorOrNext.complete()


() => { generatorOrNext.complete(); }


(value: any /** TODO #9100 */) => {
        setTimeout(() => generatorOrNext(value));
      }


() => generatorOrNext(value)


(value: any /** TODO #9100 */) => { generatorOrNext(value); }


(err) => { setTimeout(() => error(err)); }


() => error(err)


(err) => { error(err); }


() => { setTimeout(() => complete()); }


() => complete()


() => { complete(); }


export class TimerWrapper {
  static setTimeout(fn: (...args: any[]) => void, millis: number): number {
    return global.setTimeout(fn, millis);
  }
  static clearTimeout(id: number): void { global.clearTimeout(id); }

  static setInterval(fn: (...args: any[]) => void, millis: number): number {
    return global.setInterval(fn, millis);
  }
  static clearInterval(id: number): void { global.clearInterval(id); }
}


export class ObservableWrapper {
  // TODO(vsavkin): when we use rxnext, try inferring the generic type from the first arg
  static subscribe<T>(
      emitter: any, onNext: (value: T) => void, onError?: (exception: any) => void,
      onComplete: () => void = () => {}): Object {
    onError = (typeof onError === 'function') && onError || noop;
    onComplete = (typeof onComplete === 'function') && onComplete || noop;
    return emitter.subscribe({next: onNext, error: onError, complete: onComplete});
  }

  static isObservable(obs: any): boolean { return !!obs.subscribe; }

  /**
   * Returns whether `obs` has any subscribers listening to events.
   */
  static hasSubscribers(obs: EventEmitter<any>): boolean { return obs.observers.length > 0; }

  static dispose(subscription: any) { subscription.unsubscribe(); }

  /**
   * @deprecated - use callEmit() instead
   */
  static callNext(emitter: EventEmitter<any>, value: any) { emitter.emit(value); }

  static callEmit(emitter: EventEmitter<any>, value: any) { emitter.emit(value); }

  static callError(emitter: EventEmitter<any>, error: any) { emitter.error(error); }

  static callComplete(emitter: EventEmitter<any>) { emitter.complete(); }

  static fromPromise(promise: Promise<any>): Observable<any> {
    return PromiseObservable.create(promise);
  }

  static toPromise(obj: Observable<any>): Promise<any> { return toPromise.call(obj); }
}


/**
 * Use by directives and components to emit custom Events.
 *
 * ### Examples
 *
 * In the following example, `Zippy` alternatively emits `open` and `close` events when its
 * title gets clicked:
 *
 * ```
 * @Component({
 *   selector: 'zippy',
 *   template: `
 *   <div class="zippy">
 *     <div (click)="toggle()">Toggle</div>
 *     <div [hidden]="!visible">
 *       <ng-content></ng-content>
 *     </div>
 *  </div>`})
 * export class Zippy {
 *   visible: boolean = true;
 *   @Output() open: EventEmitter<any> = new EventEmitter();
 *   @Output() close: EventEmitter<any> = new EventEmitter();
 *
 *   toggle() {
 *     this.visible = !this.visible;
 *     if (this.visible) {
 *       this.open.emit(null);
 *     } else {
 *       this.close.emit(null);
 *     }
 *   }
 * }
 * ```
 *
 * The events payload can be accessed by the parameter `$event` on the components output event
 * handler:
 *
 * ```
 * <zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
 * ```
 *
 * Uses Rx.Observable but provides an adapter to make it work as specified here:
 * https://github.com/jhusain/observable-spec
 *
 * Once a reference implementation of the spec is available, switch to it.
 * @stable
 */
export class EventEmitter<T> extends Subject<T> {
  // TODO: mark this as internal once all the facades are gone
  // we can't mark it as internal now because EventEmitter exported via @angular/core would not
  // contain this property making it incompatible with all the code that uses EventEmitter via
  // facades, which are local to the code and do not have this property stripped.
  // tslint:disable-next-line
  __isAsync: boolean;

  /**
   * Creates an instance of [EventEmitter], which depending on [isAsync],
   * delivers events synchronously or asynchronously.
   */
  constructor(isAsync: boolean = false) {
    super();
    this.__isAsync = isAsync;
  }

  emit(value?: T) { super.next(value); }

  /**
   * @deprecated - use .emit(value) instead
   */
  next(value: any) { super.next(value); }

  subscribe(generatorOrNext?: any, error?: any, complete?: any): any {
    let schedulerFn: any /** TODO #9100 */;
    let errorFn = (err: any): any /** TODO #9100 */ => null;
    let completeFn = (): any /** TODO #9100 */ => null;

    if (generatorOrNext && typeof generatorOrNext === 'object') {
      schedulerFn = this.__isAsync ? (value: any /** TODO #9100 */) => {
        setTimeout(() => generatorOrNext.next(value));
      } : (value: any /** TODO #9100 */) => { generatorOrNext.next(value); };

      if (generatorOrNext.error) {
        errorFn = this.__isAsync ? (err) => { setTimeout(() => generatorOrNext.error(err)); } :
                                   (err) => { generatorOrNext.error(err); };
      }

      if (generatorOrNext.complete) {
        completeFn = this.__isAsync ? () => { setTimeout(() => generatorOrNext.complete()); } :
                                      () => { generatorOrNext.complete(); };
      }
    } else {
      schedulerFn = this.__isAsync ? (value: any /** TODO #9100 */) => {
        setTimeout(() => generatorOrNext(value));
      } : (value: any /** TODO #9100 */) => { generatorOrNext(value); };

      if (error) {
        errorFn =
            this.__isAsync ? (err) => { setTimeout(() => error(err)); } : (err) => { error(err); };
      }

      if (complete) {
        completeFn =
            this.__isAsync ? () => { setTimeout(() => complete()); } : () => { complete(); };
      }
    }

    return super.subscribe(schedulerFn, errorFn, completeFn);
  }
}


static setTimeout(fn: (...args: any[]) => void, millis: number): number {
    return global.setTimeout(fn, millis);
  }


static clearTimeout(id: number): void { global.clearTimeout(id); }


static setInterval(fn: (...args: any[]) => void, millis: number): number {
    return global.setInterval(fn, millis);
  }


static clearInterval(id: number): void { global.clearInterval(id); }


// TODO(vsavkin): when we use rxnext, try inferring the generic type from the first arg
static subscribe<T>(
      emitter: any, onNext: (value: T) => void, onError?: (exception: any) => void,
      onComplete: () => void = () => {}): Object {
    onError = (typeof onError === 'function') && onError || noop;
    onComplete = (typeof onComplete === 'function') && onComplete || noop;
    return emitter.subscribe({next: onNext, error: onError, complete: onComplete});
  }


static isObservable(obs: any): boolean { return !!obs.subscribe; }


/**
   * Returns whether `obs` has any subscribers listening to events.
   */
static hasSubscribers(obs: EventEmitter<any>): boolean { return obs.observers.length > 0; }


static dispose(subscription: any) { subscription.unsubscribe(); }


/**
   * @deprecated - use callEmit() instead
   */
static callNext(emitter: EventEmitter<any>, value: any) { emitter.emit(value); }


static callEmit(emitter: EventEmitter<any>, value: any) { emitter.emit(value); }


static callError(emitter: EventEmitter<any>, error: any) { emitter.error(error); }


static callComplete(emitter: EventEmitter<any>) { emitter.complete(); }


static fromPromise(promise: Promise<any>): Observable<any> {
    return PromiseObservable.create(promise);
  }


static toPromise(obj: Observable<any>): Promise<any> { return toPromise.call(obj); }


emit(value?: T) { super.next(value); }


/**
   * @deprecated - use .emit(value) instead
   */
next(value: any) { super.next(value); }


subscribe(generatorOrNext?: any, error?: any, complete?: any): any {
    let schedulerFn: any /** TODO #9100 */;
    let errorFn = (err: any): any /** TODO #9100 */ => null;
    let completeFn = (): any /** TODO #9100 */ => null;

    if (generatorOrNext && typeof generatorOrNext === 'object') {
      schedulerFn = this.__isAsync ? (value: any /** TODO #9100 */) => {
        setTimeout(() => generatorOrNext.next(value));
      } : (value: any /** TODO #9100 */) => { generatorOrNext.next(value); };

      if (generatorOrNext.error) {
        errorFn = this.__isAsync ? (err) => { setTimeout(() => generatorOrNext.error(err)); } :
                                   (err) => { generatorOrNext.error(err); };
      }

      if (generatorOrNext.complete) {
        completeFn = this.__isAsync ? () => { setTimeout(() => generatorOrNext.complete()); } :
                                      () => { generatorOrNext.complete(); };
      }
    } else {
      schedulerFn = this.__isAsync ? (value: any /** TODO #9100 */) => {
        setTimeout(() => generatorOrNext(value));
      } : (value: any /** TODO #9100 */) => { generatorOrNext(value); };

      if (error) {
        errorFn =
            this.__isAsync ? (err) => { setTimeout(() => error(err)); } : (err) => { error(err); };
      }

      if (complete) {
        completeFn =
            this.__isAsync ? () => { setTimeout(() => complete()); } : () => { complete(); };
      }
    }

    return super.subscribe(schedulerFn, errorFn, completeFn);
  }


() => {
    it('finds all the words given in a 2D array', () => {
        expect(findWords(
            [["a","b"],["a","a"]],
            ["aba","baa","bab","aaab","aaa","aaaa","aaba"]
        ).length).to.equal(5);
    })
}


() => {
        expect(findWords(
            [["a","b"],["a","a"]],
            ["aba","baa","bab","aaab","aaa","aaaa","aaba"]
        ).length).to.equal(5);
    }


export function fetch(id: string, version: number): FetchAction {
    return {
        category: "linkedData",
        type: ActionType.FETCH,
        id,
        version,
    };
}


export function fetchError(error: AppError): FetchErrorAction {
    return {
        category: "linkedData",
        type: ActionType.FETCH_ERROR,
        error
    };
}


export interface ActionBase<T> extends CategoryAction<"linkedData", T> {
}


export interface FetchAction extends ActionBase<ActionType.FETCH> {
    id: string;
    version: number;
}


export interface FetchingAction extends ActionBase<ActionType.FETCHING> {
}


export interface FetchedAction extends ActionBase<ActionType.FETCHED> {
    linkedData: LinkedData;
}


export interface FetchErrorAction extends ActionBase<ActionType.FETCH_ERROR> {
    error: AppError;
}


export enum ActionType {
    FETCH = "@linkedData/fetch",
    FETCHING = "@linkedData/fetching",
    FETCHED = "@linkedData/fetched",
    FETCH_ERROR = "@linkedData/fetch-error",
}


export type LinkedDataAction =
    | FetchingAction
    | FetchedAction
    | FetchErrorAction;


() => {

  test('renders component', () => {
    const wrapper = mount(Components, {
      localVue,
      i18n,
    }) as any;

    wrapper.vm.sliderChange();
    wrapper.vm.calendarChange();
    wrapper.vm.addNotificationClick();
    wrapper.vm.selectChange();
    wrapper.vm.onRequest('foo');
    wrapper.vm.onRequest('foo', false);
    wrapper.vm.formSubmit({ name: 'foo', email: 'bar' }, () => {
      return true;
    });
    wrapper.vm.formReset();

    wrapper.vm.registerSchema.elements.forEach((element: IFormElement) => {
      if (element.isValid) {
        element.isValid('');
      }
    });

    wrapper.vm.loginSchema.elements.forEach((element: IFormElement) => {
      if (element.isValid) {
        element.isValid('');
      }
    });

    expect(wrapper.find('h1').text()).toBe('Components');
  });

}


() => {
    const wrapper = mount(Components, {
      localVue,
      i18n,
    }) as any;

    wrapper.vm.sliderChange();
    wrapper.vm.calendarChange();
    wrapper.vm.addNotificationClick();
    wrapper.vm.selectChange();
    wrapper.vm.onRequest('foo');
    wrapper.vm.onRequest('foo', false);
    wrapper.vm.formSubmit({ name: 'foo', email: 'bar' }, () => {
      return true;
    });
    wrapper.vm.formReset();

    wrapper.vm.registerSchema.elements.forEach((element: IFormElement) => {
      if (element.isValid) {
        element.isValid('');
      }
    });

    wrapper.vm.loginSchema.elements.forEach((element: IFormElement) => {
      if (element.isValid) {
        element.isValid('');
      }
    });

    expect(wrapper.find('h1').text()).toBe('Components');
  }


() => {
      return true;
    }


(element: IFormElement) => {
      if (element.isValid) {
        element.isValid('');
      }
    }


@Component({
  selector: 'dt-example-form-field-hint',
  templateUrl: 'form-field-hint-example.html',
})
export class DtExampleFormFieldHint {}


(column): SortOrderDropdownOption => ({
                    label: column.displayName,
                    display: {
                        name: column.name,
                        displayName: column.displayName,
                    },
                    value: {
                        sortBy: SortBy.column,
                        sortColumnSlug: column.slug,
                    } as SortConfig,
                })


(opt) =>
                            isEqual(
                                opt.value,
                                trimObject(omit(this.sortConfig, "sortOrder"))
                            )


(s) => {
                return { label: s.toString(), value: s }
            }


(comparisonLine, i) => (
                    <div key={i}>
                        {`Line ${i + 1}`


() => this.onRemoveComparisonLine(i)


@observer
class ColorSchemeSelector extends React.Component<{ grapher: Grapher }> {
    @action.bound onChange(selected: ColorSchemeOption) {
        // The onChange method can return an array of values (when multiple
        // items can be selected) or a single value. Since we are certain that
        // we are not using the multi-option select we can force the type to be
        // a single value.

        this.props.grapher.baseColorScheme = (selected.value === "default"
            ? undefined
            : selected.value) as ColorSchemeName

        // clear out saved, pre-computed colors so the color scheme change is immediately visible
        this.props.grapher.seriesColorMap?.clear()
    }

    @action.bound onInvertColorScheme(value: boolean) {
        this.props.grapher.invertColorScheme = value || undefined

        this.props.grapher.seriesColorMap?.clear()
    }

    render() {
        const { grapher } = this.props

        return (
            <React.Fragment>
                <FieldsRow>

                        Color scheme
                        <ColorSchemeDropdown
                            value={grapher.baseColorScheme || "default"}
                            onChange={this.onChange}
                            invertedColorScheme={!!grapher.invertColorScheme}
                            additionalOptions={[
                                {
                                    colorScheme: undefined,
                                    gradient: undefined,
                                    label: "Default",
                                    value: "default",
                                },
                            ]}
                        />

                </FieldsRow>
                <FieldsRow>
                    <Toggle
                        label="Invert colors"
                        value={!!grapher.invertColorScheme}


@observer
class SortOrderSection extends React.Component<{ editor: ChartEditor }> {
    @computed get sortConfig(): SortConfig {
        return this.grapher._sortConfig
    }

    @computed get grapher() {
        return this.props.editor.grapher
    }

    @computed get sortOptions(): SortOrderDropdownOption[] {
        const { features } = this.props.editor

        let dimensionSortOptions: SortOrderDropdownOption[] = []
        if (features.canSortByColumn) {
            dimensionSortOptions = this.grapher.yColumns.map(
                (column): SortOrderDropdownOption => ({
                    label: column.displayName,
                    display: {
                        name: column.name,
                        displayName: column.displayName,
                    },
                    value: {
                        sortBy: SortBy.column,
                        sortColumnSlug: column.slug,
                    } as SortConfig,
                })
            )
        }

        return [
            { label: "Entity name", value: { sortBy: SortBy.entityName } },
            { label: "Total value", value: { sortBy: SortBy.total } },
            ...dimensionSortOptions,
        ]
    }

    @action.bound onSortByChange(selected: ValueType<SortOrderDropdownOption>) {
        const value = asArray(selected)[0].value
        this.grapher.sortBy = value.sortBy
        this.grapher.sortColumnSlug = value.sortColumnSlug
    }

    @action.bound onSortOrderChange(sortOrder: string) {
        this.grapher.sortOrder = sortOrder as SortOrder
    }

    render() {
        return (

                    For line charts the sort order is only applied when it's
                    collapsed to a bar chart.

                    Sort by
                    <Select
                        options={this.sortOptions}
                        onChange={this.onSortByChange}
                        value={this.sortOptions.find((opt) =>
                            isEqual(
                                opt.value,
                                trimObject(omit(this.sortConfig, "sortOrder"))
                            )
                        )}
                        formatOptionLabel={(opt, { context }) =>
                            opt.display && context === "menu" ? (

                                    {opt.display.displayName}

                                    <small style={{ opacity: 0.8 }}


@observer
class FacetSection extends React.Component<{ editor: ChartEditor }> {
    base: React.RefObject<HTMLDivElement> = React.createRef()

    @computed get grapher() {
        return this.props.editor.grapher
    }

    @computed get facetOptions(): Array<{
        label: string
        value?: FacetStrategy
    }> {
        return [{ label: "auto" }].concat(
            this.grapher.availableFacetStrategies.map((s) => {
                return { label: s.toString(), value: s }
            })
        )
    }

    @computed get facetSelection(): { label: string; value?: FacetStrategy } {
        const strategy = this.grapher.selectedFacetStrategy
        if (strategy) {
            return { label: strategy.toString(), value: strategy }
        }

        return { label: "auto" }
    }

    @action.bound onFacetSelectionChange(
        selected: ValueType<{ label: string; value?: FacetStrategy }>
    ) {
        const value = asArray(selected)[0].value
        this.grapher.selectedFacetStrategy = value
    }

    render() {
        const yAxisConfig = this.props.editor.grapher.yAxis

        return (

                    Faceting strategy
                    <Select
                        options={this.facetOptions}
                        value={this.facetSelection}
                        onChange={this.onFacetSelectionChange}
                    />

                <FieldsRow>
                    <Toggle
                        label={`Facets have uniform y-axis`}
                        value={
                            yAxisConfig.facetDomain === FacetAxisDomain.shared
                        }
                        onValue={(value) => {
                            yAxisConfig.facetDomain = value
                                ? FacetAxisDomain.shared
                                : FacetAxisDomain.independent
                        }}


@observer
class TimelineSection extends React.Component<{ editor: ChartEditor }> {
    base: React.RefObject<HTMLDivElement> = React.createRef()

    @computed get grapher() {
        return this.props.editor.grapher
    }

    @computed get minTime() {
        return this.grapher.minTime
    }
    @computed get maxTime() {
        return this.grapher.maxTime
    }

    @computed get timelineMinTime() {
        return this.grapher.timelineMinTime
    }
    @computed get timelineMaxTime() {
        return this.grapher.timelineMaxTime
    }

    @action.bound onMinTime(value: number | undefined) {
        this.grapher.minTime = value ?? TimeBoundValue.negativeInfinity
    }

    @action.bound onMaxTime(value: number | undefined) {
        this.grapher.maxTime = value ?? TimeBoundValue.positiveInfinity
    }

    @action.bound onTimelineMinTime(value: number | undefined) {
        this.grapher.timelineMinTime = value
    }

    @action.bound onTimelineMaxTime(value: number | undefined) {
        this.grapher.timelineMaxTime = value
    }

    @action.bound onToggleHideTimeline(value: boolean) {
        this.grapher.hideTimeline = value || undefined
    }

    @action.bound onToggleShowYearLabels(value: boolean) {
        this.grapher.showYearLabels = value || undefined
    }

    render() {
        const { features } = this.props.editor
        const { grapher } = this

        return (
            <Section name="Timeline selection">
                <FieldsRow>
                    {features.timeDomain && (
                        <NumberField
                            label="Selection start"
                            value={this.minTime}
                            onValue={debounce(this.onMinTime)}
                            allowNegative
                        />
                    )}


@observer
class ComparisonLineSection extends React.Component<{ editor: ChartEditor }> {
    @observable comparisonLines: ComparisonLineConfig[] = []

    @action.bound onAddComparisonLine() {
        const { grapher } = this.props.editor
        grapher.comparisonLines.push({})
    }

    @action.bound onRemoveComparisonLine(index: number) {
        const { grapher } = this.props.editor
        grapher.comparisonLines!.splice(index, 1)
    }

    render() {
        const { comparisonLines } = this.props.editor.grapher

        return (

                    Overlay a line onto the chart for comparison. Supports basic{" "}

                        mathematical expressions

                    .

                <Button onClick={this.onAddComparisonLine}>
                    <FontAwesomeIcon icon={faPlus} /> Add comparison line
                </Button>
                {comparisonLines.map((comparisonLine, i) => (

                        {`Line ${i + 1}`}{" "}
                        <Button onClick={() => this.onRemoveComparisonLine(i)}>
                            <FontAwesomeIcon icon={faMinus} />
                        </Button>
                        <TextField
                            label={`y=`}
                            placeholder="x"
                            value={comparisonLine.yEquals}
                            onValue={action((value: string) =>


@observer
export class EditorCustomizeTab extends React.Component<{
    editor: ChartEditor
}> {
    render() {
        const xAxisConfig = this.props.editor.grapher.xAxis
        const yAxisConfig = this.props.editor.grapher.yAxis

        const { features } = this.props.editor
        const { grapher } = this.props.editor

        return (

                {features.canCustomizeYAxis && (

                        {features.canCustomizeYAxisScale && (
                            <React.Fragment>
                                <FieldsRow>
                                    <NumberField
                                        label={`Min`}
                                        value={yAxisConfig.min}
                                        onValue={(value) =>
                                            (yAxisConfig.min = value)
                                        }
                                        allowDecimal
                                        allowNegative


interface SortOrderDropdownOption {
    label: string
    value: Omit<SortConfig, "sortOrder">
    display?: { name: string; displayName: string }
}


@action.bound onChange(selected: ColorSchemeOption) {
        // The onChange method can return an array of values (when multiple
        // items can be selected) or a single value. Since we are certain that
        // we are not using the multi-option select we can force the type to be
        // a single value.

        this.props.grapher.baseColorScheme = (selected.value === "default"
            ? undefined
            : selected.value) as ColorSchemeName

        // clear out saved, pre-computed colors so the color scheme change is immediately visible
        this.props.grapher.seriesColorMap?.clear()
    }


@action.bound onInvertColorScheme(value: boolean) {
        this.props.grapher.invertColorScheme = value || undefined

        this.props.grapher.seriesColorMap?.clear()
    }


render() {
        const { grapher } = this.props

        return (
            <React.Fragment>
                <FieldsRow>

                        Color scheme
                        <ColorSchemeDropdown
                            value={grapher.baseColorScheme || "default"}
                            onChange={this.onChange}
                            invertedColorScheme={!!grapher.invertColorScheme}


@action.bound onSortByChange(selected: ValueType<SortOrderDropdownOption>) {
        const value = asArray(selected)[0].value
        this.grapher.sortBy = value.sortBy
        this.grapher.sortColumnSlug = value.sortColumnSlug
    }


@action.bound onSortOrderChange(sortOrder: string) {
        this.grapher.sortOrder = sortOrder as SortOrder
    }


render() {
        return (

                    For line charts the sort order is only applied when it's
                    collapsed to a bar chart.

                    Sort by
                    <Select
                        options={this.sortOptions}
                        onChange={this.onSortByChange}
                        value={this.sortOptions.find((opt) =>
                            isEqual(
                                opt.value,
                                trimObject(omit(this.sortConfig, "sortOrder"))
                            )
                        )}
                        formatOptionLabel={(opt, { context }) =>
                            opt.display && context === "menu" ? (

                                    {opt.display.displayName}

                                    <small style={{ opacity: 0.8 }}


@action.bound onFacetSelectionChange(
        selected: ValueType<{ label: string; value?: FacetStrategy }>
    ) {
        const value = asArray(selected)[0].value
        this.grapher.selectedFacetStrategy = value
    }


render() {
        const yAxisConfig = this.props.editor.grapher.yAxis

        return (

                    Faceting strategy
                    <Select
                        options={this.facetOptions}
                        value={this.facetSelection}
                        onChange={this.onFacetSelectionChange}
                    />

                <FieldsRow>
                    <Toggle
                        label={`Facets have uniform y-axis`}
                        value={
                            yAxisConfig.facetDomain === FacetAxisDomain.shared
                        }
                        onValue={(value) => {
                            yAxisConfig.facetDomain = value
                                ? FacetAxisDomain.shared
                                : FacetAxisDomain.independent
                        }}


@action.bound onMinTime(value: number | undefined) {
        this.grapher.minTime = value ?? TimeBoundValue.negativeInfinity
    }


@action.bound onMaxTime(value: number | undefined) {
        this.grapher.maxTime = value ?? TimeBoundValue.positiveInfinity
    }


@action.bound onTimelineMinTime(value: number | undefined) {
        this.grapher.timelineMinTime = value
    }


@action.bound onTimelineMaxTime(value: number | undefined) {
        this.grapher.timelineMaxTime = value
    }


@action.bound onToggleHideTimeline(value: boolean) {
        this.grapher.hideTimeline = value || undefined
    }


@action.bound onToggleShowYearLabels(value: boolean) {
        this.grapher.showYearLabels = value || undefined
    }


render() {
        const { features } = this.props.editor
        const { grapher } = this

        return (
            <Section name="Timeline selection">
                <FieldsRow>
                    {features.timeDomain && (
                        <NumberField
                            label="Selection start"
                            value={this.minTime}
                            onValue={debounce(this.onMinTime)}
                            allowNegative
                        />
                    )}


debounce(this


@action.bound onAddComparisonLine() {
        const { grapher } = this.props.editor
        grapher.comparisonLines.push({})
    }


@action.bound onRemoveComparisonLine(index: number) {
        const { grapher } = this.props.editor
        grapher.comparisonLines!.splice(index, 1)
    }


render() {
        const { comparisonLines } = this.props.editor.grapher

        return (

                    Overlay a line onto the chart for comparison. Supports basic{" "}

                        mathematical expressions

                    .

                <Button onClick={this.onAddComparisonLine}>
                    <FontAwesomeIcon icon={faPlus} /> Add comparison line
                </Button>
                {comparisonLines.map((comparisonLine, i) => (

                        {`Line ${i + 1}`}{" "}
                        <Button onClick={() => this.onRemoveComparisonLine(i)}>
                            <FontAwesomeIcon icon={faMinus} />
                        </Button>
                        <TextField
                            label={`y=`}


action(


render() {
        const xAxisConfig = this.props.editor.grapher.xAxis
        const yAxisConfig = this.props.editor.grapher.yAxis

        const { features } = this.props.editor
        const { grapher } = this.props.editor

        return (

                {features.canCustomizeYAxis && (

                        {features.canCustomizeYAxisScale && (
                            <React.Fragment>
                                <FieldsRow>
                                    <NumberField
                                        label={`Min`}
                                        value={yAxisConfig.min}
                                        onValue={(value) =>
                                            (yAxisConfig.min = value)
                                        }


() => {
  describe('LogsComponent', () => {
    let comp: LogsComponent;
    let fixture: ComponentFixture<LogsComponent>;
    let service: LogsService;

    beforeEach(async(() => {
      TestBed.configureTestingModule({
        imports: [BabylioTestModule],
        declarations: [LogsComponent],
        providers: [LogsService]
      })
        .overrideTemplate(LogsComponent, '')
        .compileComponents();
    }));

    beforeEach(() => {
      fixture = TestBed.createComponent(LogsComponent);
      comp = fixture.componentInstance;
      service = fixture.debugElement.injector.get(LogsService);
    });

    describe('OnInit', () => {
      it('should set all default values correctly', () => {
        expect(comp.filter).toBe('');
        expect(comp.orderProp).toBe('name');
        expect(comp.reverse).toBe(false);
      });
      it('Should call load all on init', () => {
        // GIVEN
        const log = new Log('main', 'WARN');
        spyOn(service, 'findAll').and.returnValue(
          of({
            loggers: {
              main: {
                effectiveLevel: 'WARN'
              }
            }
          })
        );

        // WHEN
        comp.ngOnInit();

        // THEN
        expect(service.findAll).toHaveBeenCalled();
        expect(comp.loggers && comp.loggers[0]).toEqual(jasmine.objectContaining(log));
      });
    });
    describe('change log level', () => {
      it('should change log level correctly', () => {
        // GIVEN
        const log = new Log('main', 'ERROR');
        spyOn(service, 'changeLevel').and.returnValue(of({}));
        spyOn(service, 'findAll').and.returnValue(
          of({
            loggers: {
              main: {
                effectiveLevel: 'ERROR'
              }
            }
          })
        );

        // WHEN
        comp.changeLevel('main', 'ERROR');

        // THEN
        expect(service.changeLevel).toHaveBeenCalled();
        expect(service.findAll).toHaveBeenCalled();
        expect(comp.loggers && comp.loggers[0]).toEqual(jasmine.objectContaining(log));
      });
    });
  });
}


() => {
    let comp: LogsComponent;
    let fixture: ComponentFixture<LogsComponent>;
    let service: LogsService;

    beforeEach(async(() => {
      TestBed.configureTestingModule({
        imports: [BabylioTestModule],
        declarations: [LogsComponent],
        providers: [LogsService]
      })
        .overrideTemplate(LogsComponent, '')
        .compileComponents();
    }));

    beforeEach(() => {
      fixture = TestBed.createComponent(LogsComponent);
      comp = fixture.componentInstance;
      service = fixture.debugElement.injector.get(LogsService);
    });

    describe('OnInit', () => {
      it('should set all default values correctly', () => {
        expect(comp.filter).toBe('');
        expect(comp.orderProp).toBe('name');
        expect(comp.reverse).toBe(false);
      });
      it('Should call load all on init', () => {
        // GIVEN
        const log = new Log('main', 'WARN');
        spyOn(service, 'findAll').and.returnValue(
          of({
            loggers: {
              main: {
                effectiveLevel: 'WARN'
              }
            }
          })
        );

        // WHEN
        comp.ngOnInit();

        // THEN
        expect(service.findAll).toHaveBeenCalled();
        expect(comp.loggers && comp.loggers[0]).toEqual(jasmine.objectContaining(log));
      });
    });
    describe('change log level', () => {
      it('should change log level correctly', () => {
        // GIVEN
        const log = new Log('main', 'ERROR');
        spyOn(service, 'changeLevel').and.returnValue(of({}));
        spyOn(service, 'findAll').and.returnValue(
          of({
            loggers: {
              main: {
                effectiveLevel: 'ERROR'
              }
            }
          })
        );

        // WHEN
        comp.changeLevel('main', 'ERROR');

        // THEN
        expect(service.changeLevel).toHaveBeenCalled();
        expect(service.findAll).toHaveBeenCalled();
        expect(comp.loggers && comp.loggers[0]).toEqual(jasmine.objectContaining(log));
      });
    });
  }


() => {
      TestBed.configureTestingModule({
        imports: [BabylioTestModule],
        declarations: [LogsComponent],
        providers: [LogsService]
      })
        .overrideTemplate(LogsComponent, '')
        .compileComponents();
    }


() => {
      fixture = TestBed.createComponent(LogsComponent);
      comp = fixture.componentInstance;
      service = fixture.debugElement.injector.get(LogsService);
    }


() => {
      it('should set all default values correctly', () => {
        expect(comp.filter).toBe('');
        expect(comp.orderProp).toBe('name');
        expect(comp.reverse).toBe(false);
      });
      it('Should call load all on init', () => {
        // GIVEN
        const log = new Log('main', 'WARN');
        spyOn(service, 'findAll').and.returnValue(
          of({
            loggers: {
              main: {
                effectiveLevel: 'WARN'
              }
            }
          })
        );

        // WHEN
        comp.ngOnInit();

        // THEN
        expect(service.findAll).toHaveBeenCalled();
        expect(comp.loggers && comp.loggers[0]).toEqual(jasmine.objectContaining(log));
      });
    }


() => {
        expect(comp.filter).toBe('');
        expect(comp.orderProp).toBe('name');
        expect(comp.reverse).toBe(false);
      }


() => {
        // GIVEN
        const log = new Log('main', 'WARN');
        spyOn(service, 'findAll').and.returnValue(
          of({
            loggers: {
              main: {
                effectiveLevel: 'WARN'
              }
            }
          })
        );

        // WHEN
        comp.ngOnInit();

        // THEN
        expect(service.findAll).toHaveBeenCalled();
        expect(comp.loggers && comp.loggers[0]).toEqual(jasmine.objectContaining(log));
      }


() => {
      it('should change log level correctly', () => {
        // GIVEN
        const log = new Log('main', 'ERROR');
        spyOn(service, 'changeLevel').and.returnValue(of({}));
        spyOn(service, 'findAll').and.returnValue(
          of({
            loggers: {
              main: {
                effectiveLevel: 'ERROR'
              }
            }
          })
        );

        // WHEN
        comp.changeLevel('main', 'ERROR');

        // THEN
        expect(service.changeLevel).toHaveBeenCalled();
        expect(service.findAll).toHaveBeenCalled();
        expect(comp.loggers && comp.loggers[0]).toEqual(jasmine.objectContaining(log));
      });
    }


() => {
        // GIVEN
        const log = new Log('main', 'ERROR');
        spyOn(service, 'changeLevel').and.returnValue(of({}));
        spyOn(service, 'findAll').and.returnValue(
          of({
            loggers: {
              main: {
                effectiveLevel: 'ERROR'
              }
            }
          })
        );

        // WHEN
        comp.changeLevel('main', 'ERROR');

        // THEN
        expect(service.changeLevel).toHaveBeenCalled();
        expect(service.findAll).toHaveBeenCalled();
        expect(comp.loggers && comp.loggers[0]).toEqual(jasmine.objectContaining(log));
      }


/**
 * Connector between the steps
 *
 * @since 1.13.42
 * @status REVIEWING
 * @category basic
 * @see http://uikit.myntra.com/components/stepper/step-separator
 */
export default class StepSeparator extends PureComponent<Props> {
  render() {
    const {
      orientation,
      children,
      hasSmallSteps,
      completed,
      className,
    } = this.props
    return (
      <div
        className={classnames(
          className,
          'step-separator',
          `step-separator--${orientation}`,
          {
            'step-separator--has-small-steps': hasSmallSteps,
            'step-separator--completed': completed,
          }
        )}
      >
        {children}
      </div>
    )
  }
}


export interface Props extends BaseProps {
  /** @private */
  className?: string
}


render() {
    const {
      orientation,
      children,
      hasSmallSteps,
      completed,
      className,
    } = this.props
    return (
      <div
        className={classnames(
          className,
          'step-separator',
          `step-separator--${orientation}`,
          {
            'step-separator--has-small-steps': hasSmallSteps,
            'step-separator--completed': completed,
          }
        )}
      >
        {children}
      </div>
    )
  }
}


classnames(
          className,
          'step-separator',
          `step-separator--${orientation


/**
     * The Account object.
     */
interface Account {
      /**
       * Unique identifier for the object.
       */
      id: string;

      /**
       * String representing the object's type. Objects of the same type share the same value.
       */
      object: 'account';

      /**
       * Business information about the account.
       */
      business_profile: Account.BusinessProfile | null;

      /**
       * The business type.
       */
      business_type: Account.BusinessType | null;

      capabilities?: Account.Capabilities;

      /**
       * Whether the account can create live charges.
       */
      charges_enabled: boolean;

      company?: Account.Company;

      /**
       * The account's country.
       */
      country: string;

      /**
       * Time at which the object was created. Measured in seconds since the Unix epoch.
       */
      created?: number;

      /**
       * Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts).
       */
      default_currency: string;

      deleted?: void;

      /**
       * Whether account details have been submitted. Standard accounts cannot receive payouts before this is true.
       */
      details_submitted: boolean;

      /**
       * The primary user's email address.
       */
      email: string | null;

      /**
       * External accounts (bank accounts and debit cards) currently attached to this account
       */
      external_accounts?: ApiList<Stripe.BankAccount | Stripe.Card>;

      /**
       * This is an object representing a person associated with a Stripe account.
       *
       * Related guide: [Handling Identity Verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information).
       */
      individual?: Stripe.Person;

      /**
       * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
       */
      metadata?: Metadata;

      /**
       * Whether Stripe can send payouts to this account.
       */
      payouts_enabled: boolean;

      requirements?: Account.Requirements;

      /**
       * Options for customizing how the account functions within Stripe.
       */
      settings: Account.Settings | null;

      tos_acceptance?: Account.TosAcceptance;

      /**
       * The Stripe account type. Can be `standard`, `express`, or `custom`.
       */
      type: Account.Type;
    }


interface BusinessProfile {
        /**
         * [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.
         */
        mcc: string | null;

        /**
         * The customer-facing business name.
         */
        name: string | null;

        /**
         * Internal-only description of the product sold or service provided by the business. It's used by Stripe for risk and underwriting purposes.
         */
        product_description?: string | null;

        /**
         * A publicly available mailing address for sending support issues to.
         */
        support_address: Address | null;

        /**
         * A publicly available email address for sending support issues to.
         */
        support_email: string | null;

        /**
         * A publicly available phone number to call with support issues.
         */
        support_phone: string | null;

        /**
         * A publicly available website for handling support issues.
         */
        support_url: string | null;

        /**
         * The business's publicly available website.
         */
        url: string | null;
      }


interface Capabilities {
        /**
         * The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges.
         */
        au_becs_debit_payments?: Capabilities.AuBecsDebitPayments;

        /**
         * The status of the card issuing capability of the account, or whether you can use Issuing to distribute funds on cards
         */
        card_issuing?: Capabilities.CardIssuing;

        /**
         * The status of the card payments capability of the account, or whether the account can directly process credit and debit card charges.
         */
        card_payments?: Capabilities.CardPayments;

        /**
         * The status of the legacy payments capability of the account.
         */
        legacy_payments?: Capabilities.LegacyPayments;

        /**
         * The status of the tax reporting 1099-K (US) capability of the account.
         */
        tax_reporting_us_1099_k?: Capabilities.TaxReportingUs1099K;

        /**
         * The status of the tax reporting 1099-MISC (US) capability of the account.
         */
        tax_reporting_us_1099_misc?: Capabilities.TaxReportingUs1099Misc;

        /**
         * The status of the transfers capability of the account, or whether your platform can transfer funds to the account.
         */
        transfers?: Capabilities.Transfers;
      }


interface Company {
        address?: Address;

        /**
         * The Kana variation of the company's primary address (Japan only).
         */
        address_kana?: Company.AddressKana | null;

        /**
         * The Kanji variation of the company's primary address (Japan only).
         */
        address_kanji?: Company.AddressKanji | null;

        /**
         * Whether the company's directors have been provided. This Boolean will be `true` if you've manually indicated that all directors are provided via [the `directors_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-directors_provided).
         */
        directors_provided?: boolean;

        /**
         * Whether the company's executives have been provided. This Boolean will be `true` if you've manually indicated that all executives are provided via [the `executives_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided.
         */
        executives_provided?: boolean;

        /**
         * The company's legal name.
         */
        name: string | null;

        /**
         * The Kana variation of the company's legal name (Japan only).
         */
        name_kana?: string | null;

        /**
         * The Kanji variation of the company's legal name (Japan only).
         */
        name_kanji?: string | null;

        /**
         * Whether the company's owners have been provided. This Boolean will be `true` if you've manually indicated that all owners are provided via [the `owners_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-owners_provided), or if Stripe determined that sufficient owners were provided. Stripe determines ownership requirements using both the number of owners provided and their total percent ownership (calculated by adding the `percent_ownership` of each owner together).
         */
        owners_provided?: boolean;

        /**
         * The company's phone number (used for verification).
         */
        phone?: string | null;

        /**
         * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.
         */
        structure?: Company.Structure;

        /**
         * Whether the company's business ID number was provided.
         */
        tax_id_provided?: boolean;

        /**
         * The jurisdiction in which the `tax_id` is registered (Germany-based companies only).
         */
        tax_id_registrar?: string;

        /**
         * Whether the company's business VAT number was provided.
         */
        vat_id_provided?: boolean;

        /**
         * Information on the verification state of the company.
         */
        verification?: Company.Verification | null;
      }


interface AddressKana {
          /**
           * City/Ward.
           */
          city: string | null;

          /**
           * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
           */
          country: string | null;

          /**
           * Block/Building number.
           */
          line1: string | null;

          /**
           * Building details.
           */
          line2: string | null;

          /**
           * ZIP or postal code.
           */
          postal_code: string | null;

          /**
           * Prefecture.
           */
          state: string | null;

          /**
           * Town/cho-me.
           */
          town: string | null;
        }


interface AddressKanji {
          /**
           * City/Ward.
           */
          city: string | null;

          /**
           * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
           */
          country: string | null;

          /**
           * Block/Building number.
           */
          line1: string | null;

          /**
           * Building details.
           */
          line2: string | null;

          /**
           * ZIP or postal code.
           */
          postal_code: string | null;

          /**
           * Prefecture.
           */
          state: string | null;

          /**
           * Town/cho-me.
           */
          town: string | null;
        }


interface Verification {
          document: Verification.Document;
        }


interface Document {
            /**
             * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`.
             */
            back: string | Stripe.File | null;

            /**
             * A user-displayable string describing the verification state of this document.
             */
            details: string | null;

            /**
             * One of `document_corrupt`, `document_expired`, `document_failed_copy`, `document_failed_greyscale`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_not_readable`, `document_not_uploaded`, `document_type_not_supported`, or `document_too_large`. A machine-readable code specifying the verification state for this document.
             */
            details_code: string | null;

            /**
             * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`.
             */
            front: string | Stripe.File | null;
          }


interface Requirements {
        /**
         * The date the fields in `currently_due` must be collected by to keep payouts enabled for the account. These fields might block payouts sooner if the next threshold is reached before these fields are collected.
         */
        current_deadline: number | null;

        /**
         * The fields that need to be collected to keep the account enabled. If not collected by the `current_deadline`, these fields appear in `past_due` as well, and the account is disabled.
         */
        currently_due: Array<string> | null;

        /**
         * If the account is disabled, this string describes why the account can't create charges or receive payouts. Can be `requirements.past_due`, `requirements.pending_verification`, `rejected.fraud`, `rejected.terms_of_service`, `rejected.listed`, `rejected.other`, `listed`, `under_review`, or `other`.
         */
        disabled_reason: string | null;

        /**
         * The fields that need to be collected again because validation or verification failed for some reason.
         */
        errors: Array<Requirements.Error> | null;

        /**
         * The fields that need to be collected assuming all volume thresholds are reached. As they become required, these fields appear in `currently_due` as well, and the `current_deadline` is set.
         */
        eventually_due: Array<string> | null;

        /**
         * The fields that weren't collected by the `current_deadline`. These fields need to be collected to re-enable the account.
         */
        past_due: Array<string> | null;

        /**
         * Fields that may become required depending on the results of verification or review. An empty array unless an asynchronous verification is pending. If verification fails, the fields in this array become required and move to `currently_due` or `past_due`.
         */
        pending_verification: Array<string> | null;
      }


interface Error {
          /**
           * The code for the type of error.
           */
          code: Error.Code;

          /**
           * An informative message that indicates the error type and provides additional details about the error.
           */
          reason: string;

          /**
           * The specific user onboarding requirement field (in the requirements hash) that needs to be resolved.
           */
          requirement: string;
        }


interface Settings {
        branding: Settings.Branding;

        card_payments: Settings.CardPayments;

        dashboard: Settings.Dashboard;

        payments: Settings.Payments;

        payouts?: Settings.Payouts;
      }


interface Branding {
          /**
           * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px.
           */
          icon: string | Stripe.File | null;

          /**
           * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px.
           */
          logo: string | Stripe.File | null;

          /**
           * A CSS hex color value representing the primary branding color for this account
           */
          primary_color: string | null;

          /**
           * A CSS hex color value representing the secondary branding color for this account
           */
          secondary_color: string | null;
        }


interface CardPayments {
          decline_on?: CardPayments.DeclineOn;

          /**
           * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion.
           */
          statement_descriptor_prefix: string | null;
        }


interface DeclineOn {
            /**
             * Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification.
             */
            avs_failure: boolean;

            /**
             * Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification.
             */
            cvc_failure: boolean;
          }


interface Dashboard {
          /**
           * The display name for this account. This is used on the Stripe Dashboard to differentiate between accounts.
           */
          display_name: string | null;

          /**
           * The timezone used in the Stripe Dashboard for this account. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones).
           */
          timezone: string | null;
        }


interface Payments {
          /**
           * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge.
           */
          statement_descriptor: string | null;

          /**
           * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only)
           */
          statement_descriptor_kana: string | null;

          /**
           * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only)
           */
          statement_descriptor_kanji: string | null;
        }


interface Payouts {
          /**
           * A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. See our [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances) documentation for details. Default value is `true` for Express accounts and `false` for Custom accounts.
           */
          debit_negative_balances: boolean;

          schedule: Payouts.Schedule;

          /**
           * The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard.
           */
          statement_descriptor: string | null;
        }


interface Schedule {
            /**
             * The number of days charges for the account will be held before being paid out.
             */
            delay_days: number;

            /**
             * How frequently funds will be paid out. One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`.
             */
            interval: string;

            /**
             * The day of the month funds will be paid out. Only shown if `interval` is monthly. Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months.
             */
            monthly_anchor?: number;

            /**
             * The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. Only shown if `interval` is weekly.
             */
            weekly_anchor?: string;
          }


interface TosAcceptance {
        /**
         * The Unix timestamp marking when the Stripe Services Agreement was accepted by the account representative
         */
        date: number | null;

        /**
         * The IP address from which the Stripe Services Agreement was accepted by the account representative
         */
        ip: string | null;

        /**
         * The user agent of the browser from which the Stripe Services Agreement was accepted by the account representative
         */
        user_agent: string | null;
      }


/**
     * The DeletedAccount object.
     */
interface DeletedAccount {
      /**
       * Unique identifier for the object.
       */
      id: string;

      /**
       * String representing the object's type. Objects of the same type share the same value.
       */
      object: 'account';

      /**
       * Always true for a deleted object
       */
      deleted: true;
    }


interface AccountCreateParams {
      /**
       * An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account.
       */
      account_token?: string;

      /**
       * Business information about the account.
       */
      business_profile?: AccountCreateParams.BusinessProfile;

      /**
       * The business type.
       */
      business_type?: AccountCreateParams.BusinessType;

      /**
       * Information about the company or business. This field is null unless `business_type` is set to `company`, `government_entity`, or `non_profit`.
       */
      company?: AccountCreateParams.Company;

      /**
       * The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created.
       */
      country?: string;

      /**
       * Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts).
       */
      default_currency?: string;

      /**
       * The email address of the account holder. For Custom accounts, this is only to make the account easier to identify to you: Stripe will never directly email your users.
       */
      email?: string;

      /**
       * Specifies which fields in the response should be expanded.
       */
      expand?: Array<string>;

      /**
       * A card or bank account to attach to the account. You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/stripe.js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation.
       *
       * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the bank account or card creation API.
       */
      external_account?: string;

      /**
       * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`.
       */
      individual?: AccountCreateParams.Individual;

      /**
       * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
       */
      metadata?: MetadataParam | null;

      /**
       * The set of capabilities you want to unlock for this account. Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive.
       */
      requested_capabilities?: Array<AccountCreateParams.RequestedCapability>;

      /**
       * Options for customizing how the account functions within Stripe.
       */
      settings?: AccountCreateParams.Settings;

      /**
       * Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance).
       */
      tos_acceptance?: AccountCreateParams.TosAcceptance;

      /**
       * The type of Stripe account to create. Currently must be `custom`, as only [Custom accounts](https://stripe.com/docs/connect/custom-accounts) may be created via the API.
       */
      type?: AccountCreateParams.Type;
    }


interface BusinessProfile {
        /**
         * [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.
         */
        mcc?: string;

        /**
         * The customer-facing business name.
         */
        name?: string;

        /**
         * Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes.
         */
        product_description?: string;

        /**
         * A publicly available email address for sending support issues to.
         */
        support_email?: string;

        /**
         * A publicly available phone number to call with support issues.
         */
        support_phone?: string;

        /**
         * A publicly available website for handling support issues.
         */
        support_url?: string;

        /**
         * The business's publicly available website.
         */
        url?: string;
      }


interface Company {
        /**
         * The company's primary address.
         */
        address?: Company.Address;

        /**
         * The Kana variation of the company's primary address (Japan only).
         */
        address_kana?: JapanAddressParam;

        /**
         * The Kanji variation of the company's primary address (Japan only).
         */
        address_kanji?: JapanAddressParam;

        /**
         * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided.
         */
        directors_provided?: boolean;

        /**
         * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement.
         */
        executives_provided?: boolean;

        /**
         * The company's legal name.
         */
        name?: string;

        /**
         * The Kana variation of the company's legal name (Japan only).
         */
        name_kana?: string;

        /**
         * The Kanji variation of the company's legal name (Japan only).
         */
        name_kanji?: string;

        /**
         * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement.
         */
        owners_provided?: boolean;

        /**
         * The company's phone number (used for verification).
         */
        phone?: string;

        /**
         * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.
         */
        structure?: Company.Structure | null;

        /**
         * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.)
         */
        tax_id?: string;

        /**
         * The jurisdiction in which the `tax_id` is registered (Germany-based companies only).
         */
        tax_id_registrar?: string;

        /**
         * The VAT number of the company.
         */
        vat_id?: string;

        /**
         * Information on the verification state of the company.
         */
        verification?: Company.Verification;
      }


interface Address {
          /**
           * City, district, suburb, town, or village.
           */
          city?: string;

          /**
           * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
           */
          country?: string;

          /**
           * Address line 1 (e.g., street, PO Box, or company name).
           */
          line1?: string;

          /**
           * Address line 2 (e.g., apartment, suite, unit, or building).
           */
          line2?: string;

          /**
           * ZIP or postal code.
           */
          postal_code?: string;

          /**
           * State, county, province, or region.
           */
          state?: string;
        }


interface Verification {
          /**
           * A document verifying the business.
           */
          document?: Verification.Document;
        }


interface Document {
            /**
             * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
             */
            back?: string;

            /**
             * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
             */
            front?: string;
          }


interface Individual {
        /**
         * The individual's primary address.
         */
        address?: Individual.Address;

        /**
         * The Kana variation of the the individual's primary address (Japan only).
         */
        address_kana?: JapanAddressParam;

        /**
         * The Kanji variation of the the individual's primary address (Japan only).
         */
        address_kanji?: JapanAddressParam;

        /**
         * The individual's date of birth.
         */
        dob?: Individual.Dob | null;

        /**
         * The individual's email address.
         */
        email?: string;

        /**
         * The individual's first name.
         */
        first_name?: string;

        /**
         * The Kana variation of the the individual's first name (Japan only).
         */
        first_name_kana?: string;

        /**
         * The Kanji variation of the individual's first name (Japan only).
         */
        first_name_kanji?: string;

        /**
         * The individual's gender (International regulations require either "male" or "female").
         */
        gender?: string;

        /**
         * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/stripe.js#collecting-pii-data).
         */
        id_number?: string;

        /**
         * The individual's last name.
         */
        last_name?: string;

        /**
         * The Kana varation of the individual's last name (Japan only).
         */
        last_name_kana?: string;

        /**
         * The Kanji varation of the individual's last name (Japan only).
         */
        last_name_kanji?: string;

        /**
         * The individual's maiden name.
         */
        maiden_name?: string;

        /**
         * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
         */
        metadata?: MetadataParam | null;

        /**
         * The individual's phone number.
         */
        phone?: string;

        /**
         * The last four digits of the individual's Social Security Number (U.S. only).
         */
        ssn_last_4?: string;

        /**
         * The individual's verification document information.
         */
        verification?: Individual.Verification;
      }


interface Dob {
          /**
           * The day of birth, between 1 and 31.
           */
          day: number;

          /**
           * The month of birth, between 1 and 12.
           */
          month: number;

          /**
           * The four-digit year of birth.
           */
          year: number;
        }


interface Verification {
          /**
           * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
           */
          additional_document?: Verification.AdditionalDocument;

          /**
           * An identifying document, either a passport or local ID card.
           */
          document?: Verification.Document;
        }


interface AdditionalDocument {
            /**
             * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
             */
            back?: string;

            /**
             * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
             */
            front?: string;
          }


interface Document {
            /**
             * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
             */
            back?: string;

            /**
             * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
             */
            front?: string;
          }


interface Settings {
        /**
         * Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products.
         */
        branding?: Settings.Branding;

        /**
         * Settings specific to card charging on the account.
         */
        card_payments?: Settings.CardPayments;

        /**
         * Settings that apply across payment methods for charging on the account.
         */
        payments?: Settings.Payments;

        /**
         * Settings specific to the account's payouts.
         */
        payouts?: Settings.Payouts;
      }


interface Branding {
          /**
           * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px.
           */
          icon?: string;

          /**
           * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px.
           */
          logo?: string;

          /**
           * A CSS hex color value representing the primary branding color for this account.
           */
          primary_color?: string;

          /**
           * A CSS hex color value representing the secondary branding color for this account.
           */
          secondary_color?: string;
        }


interface CardPayments {
          /**
           * Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge.
           */
          decline_on?: CardPayments.DeclineOn;

          /**
           * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion.
           */
          statement_descriptor_prefix?: string;
        }


interface DeclineOn {
            /**
             * Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification.
             */
            avs_failure?: boolean;

            /**
             * Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification.
             */
            cvc_failure?: boolean;
          }


interface Payments {
          /**
           * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge.
           */
          statement_descriptor?: string;

          /**
           * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only).
           */
          statement_descriptor_kana?: string;

          /**
           * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only).
           */
          statement_descriptor_kanji?: string;
        }


interface Payouts {
          /**
           * A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances).
           */
          debit_negative_balances?: boolean;

          /**
           * Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation.
           */
          schedule?: Payouts.Schedule;

          /**
           * The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard.
           */
          statement_descriptor?: string;
        }


interface Schedule {
            /**
             * The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter does not apply when the `interval` is `manual`.
             */
            delay_days?: 'minimum' | number;

            /**
             * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`.
             */
            interval?: Schedule.Interval;

            /**
             * The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`.
             */
            monthly_anchor?: number;

            /**
             * The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.)
             */
            weekly_anchor?: Schedule.WeeklyAnchor;
          }


interface TosAcceptance {
        /**
         * The Unix timestamp marking when the account representative accepted the Stripe Services Agreement.
         */
        date?: number;

        /**
         * The IP address from which the account representative accepted the Stripe Services Agreement.
         */
        ip?: string;

        /**
         * The user agent of the browser from which the account representative accepted the Stripe Services Agreement.
         */
        user_agent?: string;
      }


interface AccountRetrieveParams {
      /**
       * Specifies which fields in the response should be expanded.
       */
      expand?: Array<string>;
    }


interface AccountUpdateParams {
      /**
       * An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account.
       */
      account_token?: string;

      /**
       * Business information about the account.
       */
      business_profile?: AccountUpdateParams.BusinessProfile;

      /**
       * The business type.
       */
      business_type?: AccountUpdateParams.BusinessType;

      /**
       * Information about the company or business. This field is null unless `business_type` is set to `company`, `government_entity`, or `non_profit`.
       */
      company?: AccountUpdateParams.Company;

      /**
       * Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts).
       */
      default_currency?: string;

      /**
       * Email address of the account representative. For Standard accounts, this is used to ask them to claim their Stripe account. For Custom accounts, this only makes the account easier to identify to platforms; Stripe does not email the account representative.
       */
      email?: string;

      /**
       * Specifies which fields in the response should be expanded.
       */
      expand?: Array<string>;

      /**
       * A card or bank account to attach to the account. You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/stripe.js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation.
       *
       * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the bank account or card creation API.
       */
      external_account?: string;

      /**
       * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`.
       */
      individual?: AccountUpdateParams.Individual;

      /**
       * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
       */
      metadata?: MetadataParam | null;

      /**
       * The set of capabilities you want to unlock for this account. Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive.
       */
      requested_capabilities?: Array<AccountUpdateParams.RequestedCapability>;

      /**
       * Options for customizing how the account functions within Stripe.
       */
      settings?: AccountUpdateParams.Settings;

      /**
       * Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance).
       */
      tos_acceptance?: AccountUpdateParams.TosAcceptance;
    }


interface AccountListParams extends PaginationParams {
      created?: RangeQueryParam | number;

      /**
       * Specifies which fields in the response should be expanded.
       */
      expand?: Array<string>;
    }


interface AccountDeleteParams {}


interface AccountRejectParams {
      /**
       * The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`.
       */
      reason: string;

      /**
       * Specifies which fields in the response should be expanded.
       */
      expand?: Array<string>;
    }


type BusinessType =
        | 'company'
        | 'government_entity'
        | 'individual'
        | 'non_profit';


type AuBecsDebitPayments = 'active' | 'inactive' | 'pending';


type CardIssuing = 'active' | 'inactive' | 'pending';


type CardPayments = 'active' | 'inactive' | 'pending';


type LegacyPayments = 'active' | 'inactive' | 'pending';


type TaxReportingUs1099K = 'active' | 'inactive' | 'pending';


type TaxReportingUs1099Misc = 'active' | 'inactive' | 'pending';


type Transfers = 'active' | 'inactive' | 'pending';


type Structure =
          | 'government_instrumentality'
          | 'governmental_unit'
          | 'incorporated_non_profit'
          | 'multi_member_llc'
          | 'private_corporation'
          | 'private_partnership'
          | 'public_corporation'
          | 'public_partnership'
          | 'tax_exempt_government_instrumentality'
          | 'unincorporated_association'
          | 'unincorporated_non_profit';