diff --git a/README.md b/README.md index c8a1e5e..28906cb 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ RxFlow is a navigation framework for iOS applications based on a **Reactive Flow This README is a short story of the whole conception process that led me to this framework. You will find a very detail explanation of the whole project on my blog: -- [RxFlow Part 1: In Theory](https://twittemb.github.io/swift/coordinator/rxswift/rxflow/reactive%20programming/2017/11/08/rxflow-part-1-in-theory/) -- [RxFlow Part 2: In Practice](https://twittemb.github.io/swift/coordinator/reactive/rxflow/reactive%20programming/2017/12/09/rxflow-part-2-in-practice/) -- [RxFlow Part 3: Tips and Tricks](https://twittemb.github.io/swift/coordinator/reactive/rxswift/reactive%20programming/rxflow/2017/12/22/rxflow-part-3-tips-and-tricks/) +- [RxFlow Part 1: In Theory](https://twittemb.github.io/posts/2017-11-08-RxFlow-Part1/) +- [RxFlow Part 2: In Practice](https://twittemb.github.io/posts/2017-12-09-RxFlow-Part2/) +- [RxFlow Part 3: Tips and Tricks](https://twittemb.github.io/posts/2017-12-22-RxFlow-Part3/) The Jazzy documentation can be seen here as well: [Documentation](http://community.rxswift.org/RxFlow/) diff --git a/RxFlow.xcodeproj/project.pbxproj b/RxFlow.xcodeproj/project.pbxproj index b992de8..62e45e2 100644 --- a/RxFlow.xcodeproj/project.pbxproj +++ b/RxFlow.xcodeproj/project.pbxproj @@ -587,7 +587,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.9.0; + MARKETING_VERSION = 2.9.1; PRODUCT_BUNDLE_IDENTIFIER = io.warpfactor.RxFlow; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -618,7 +618,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 2.9.0; + MARKETING_VERSION = 2.9.1; PRODUCT_BUNDLE_IDENTIFIER = io.warpfactor.RxFlow; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/RxFlow/Stepper.swift b/RxFlow/Stepper.swift index cfd9dcb..94a55cd 100644 --- a/RxFlow/Stepper.swift +++ b/RxFlow/Stepper.swift @@ -80,6 +80,10 @@ public class CompositeStepper: Stepper { .concat(nextSteps) .bind(to: self.steps) .disposed(by: self.disposeBag) + + self.innerSteppers.forEach { stepper in + stepper.readyToEmitSteps() + } } } diff --git a/RxFlowTests/StepperTests.swift b/RxFlowTests/StepperTests.swift index 2e2107e..237241e 100644 --- a/RxFlowTests/StepperTests.swift +++ b/RxFlowTests/StepperTests.swift @@ -28,12 +28,17 @@ final class StepperClass: Stepper { let steps = PublishRelay() let initialStep: Step let nextStep: Step + private(set) var madeReady = false init(with initialStep: Step, andNextStep nextStep: Step) { self.initialStep = initialStep self.nextStep = nextStep } + func readyToEmitSteps() { + madeReady = true + } + func emitNextStep () { self.steps.accept(self.nextStep) } @@ -121,6 +126,21 @@ final class StepperTests: XCTestCase { XCTAssertEqual(observer.events[2].value.element as? StepperTestsStep, StepperTestsStep.stepThree) } + func testCompositeStepperReadyToEmitSteps() { + + // Given: a compositeStepper + let stepper1 = StepperClass(with: StepperTestsStep.stepOne, andNextStep: StepperTestsStep.stepTwo) + let stepper2 = StepperClass(with: StepperTestsStep.stepOne, andNextStep: StepperTestsStep.stepTwo) + let compositeStepper = CompositeStepper(steppers: [stepper1, stepper2]) + + // When: ready to emit steps + compositeStepper.readyToEmitSteps() + + // Then: the composite steppers are made ready + XCTAssertTrue(stepper1.madeReady) + XCTAssertTrue(stepper2.madeReady) + } + func testCompositeStepper() { let initialStepsToEmit = [StepperTestsStep.stepOne, StepperTestsStep.stepTwo, StepperTestsStep.stepThree] diff --git a/docs/Classes.html b/docs/Classes.html index 2b7a4a7..17ebe9b 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -8,13 +8,21 @@ + + +
-

RxFlow Docs (98% documented)

+

RxFlow 2.9.0 Docs (0% documented)

+

+

+ +
+

@@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -124,37 +124,9 @@

Classes

  • - - - Flows - -
    -
    -
    -
    -
    -
    -

    Utility functions to synchronize Flows readyness

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public class Flows
    - -
    -
    -
    -
    -
  • -
  • -
    - - + - FlowCoordinator + FlowCoordinator
    @@ -166,14 +138,6 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public final class FlowCoordinator : NSObject
    - -
    -
  • @@ -193,9 +157,9 @@

    default implementation

  • - + - OneStepper + OneStepper
    @@ -207,23 +171,15 @@

    default implementation

    See more

    -
    -

    Declaration

    -
    -

    Swift

    -
    public class OneStepper : Stepper
    - -
    -
  • - + - DefaultStepper + DefaultStepper
    @@ -235,23 +191,15 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public class DefaultStepper : OneStepper
    - -
    -
  • - + - CompositeStepper + CompositeStepper
    @@ -264,14 +212,6 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public class CompositeStepper : Stepper
    - -
    -
  • @@ -280,8 +220,8 @@

    Declaration

    diff --git a/docs/Classes/CompositeStepper.html b/docs/Classes/CompositeStepper.html index af0a59b..b133a95 100644 --- a/docs/Classes/CompositeStepper.html +++ b/docs/Classes/CompositeStepper.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    CompositeStepper

    -
    -
    -
    public class CompositeStepper : Stepper
    - -
    -

    A Stepper that combines multiple steppers. All those Steppers will be associated to the Presentable that is given within the NextFlowItem

    @@ -131,9 +125,9 @@

    CompositeStepper

  • - + - steps + steps
    @@ -143,23 +137,15 @@

    CompositeStepper

    -
    -

    Declaration

    -
    -

    Swift

    -
    public let steps: PublishRelay<Step>
    - -
    -
  • - + - init(steppers:) + init(steppers:)
    @@ -170,42 +156,15 @@

    Declaration

    Initialize

    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(steppers: [Stepper])
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - steppers - - -
    -

    all these Steppers will be observed by the Coordinator

    -
    -
    -
  • - + - readyToEmitSteps() + readyToEmitSteps()
    @@ -215,14 +174,6 @@

    Parameters

    -
    -

    Declaration

    -
    -

    Swift

    -
    public func readyToEmitSteps()
    - -
    -
  • @@ -231,8 +182,8 @@

    Declaration

    diff --git a/docs/Classes/DefaultStepper.html b/docs/Classes/DefaultStepper.html index 6985e2e..5ab5115 100644 --- a/docs/Classes/DefaultStepper.html +++ b/docs/Classes/DefaultStepper.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    DefaultStepper

    -
    -
    -
    public class DefaultStepper : OneStepper
    - -
    -

    A Simple Stepper that has one goal: emit a first default step equal to RxFlowStep.home

    @@ -130,9 +124,9 @@

    DefaultStepper

  • - + - init() + init()
    @@ -143,14 +137,6 @@

    DefaultStepper

    Initialize the DefaultStepper

    -
    -

    Declaration

    -
    -

    Swift

    -
    public init()
    - -
    -
  • @@ -159,8 +145,8 @@

    Declaration

    diff --git a/docs/Classes/FlowCoordinator.html b/docs/Classes/FlowCoordinator.html index 82ff10d..c7c3e9d 100644 --- a/docs/Classes/FlowCoordinator.html +++ b/docs/Classes/FlowCoordinator.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    FlowCoordinator

    -
    -
    -
    public final class FlowCoordinator : NSObject
    - -
    -

    A FlowCoordinator handles the navigation of a Flow, based on its Stepper and the FlowContributors it emits

    @@ -130,9 +124,9 @@

    FlowCoordinator

  • - + - coordinate(flow:with:) + coordinate(flow:with:)
    @@ -140,16 +134,27 @@

    FlowCoordinator

    -

    Undocumented

    +

    Execute the navigation of the Flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    public func coordinate(flow: Flow, with stepper: Stepper = DefaultStepper())
    +
    +
    +
  • +
  • +
    + + + + navigate(to:) + +
    +
    +
    +
    +
    +
    +

    allow to drive the navigation from the outside of a flow

    -
  • @@ -159,8 +164,8 @@

    Declaration

    diff --git a/docs/Classes/OneStepper.html b/docs/Classes/OneStepper.html index 9dc5b75..0c1c20e 100644 --- a/docs/Classes/OneStepper.html +++ b/docs/Classes/OneStepper.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    OneStepper

    -
    -
    -
    public class OneStepper : Stepper
    - -
    -

    A Simple Stepper that has one goal: emit a single Step once initialized

    @@ -130,9 +124,9 @@

    OneStepper

  • - + - steps + steps
    @@ -142,23 +136,15 @@

    OneStepper

    -
    -

    Declaration

    -
    -

    Swift

    -
    public let steps: PublishRelay<Step>
    - -
    -
  • - + - init(withSingleStep:) + init(withSingleStep:)
    @@ -169,42 +155,15 @@

    Declaration

    Initialize the OneStepper

    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(withSingleStep singleStep: Step)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - singleStep - - -
    -

    the step to be emitted once initialized

    -
    -
    -
  • - + - initialStep + initialStep
    @@ -214,14 +173,6 @@

    Parameters

    -
    -

    Declaration

    -
    -

    Swift

    -
    public var initialStep: Step { get }
    - -
    -
  • @@ -230,8 +181,8 @@

    Declaration

    diff --git a/docs/Enums.html b/docs/Enums.html index 2fe384c..8cd493b 100644 --- a/docs/Enums.html +++ b/docs/Enums.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -124,9 +124,29 @@

    Enumerations

  • - + + + Flows + +
    +
    +
    +
    +
    +
    +

    Utility functions to synchronize Flows readyness

    + + See more +
    +
    +
    +
  • +
  • +
    + + - FlowContributor + FlowContributor
    @@ -146,23 +166,15 @@

    Enumerations

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum FlowContributor
    - -
    -
  • - + - FlowContributors + FlowContributors
    @@ -183,23 +195,15 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum FlowContributors
    - -
    -
  • - + - RxFlowStep + RxFlowStep
    @@ -215,14 +219,6 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum RxFlowStep : Step
    - -
    -
  • @@ -231,8 +227,8 @@

    Declaration

    diff --git a/docs/Enums/FlowContributor.html b/docs/Enums/FlowContributor.html index ed0d891..58f4e2c 100644 --- a/docs/Enums/FlowContributor.html +++ b/docs/Enums/FlowContributor.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    FlowContributor

    -
    -
    -
    public enum FlowContributor
    - -
    -

    A FlowContributor describes the next thing that will contribute to a Flow.

  • - + - forwardToCurrentFlow(withStep:) + forwardToCurrentFlow(withStep:)
    @@ -180,23 +166,15 @@

    Declaration

    the “withStep” step will be forwarded to the current flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    case forwardToCurrentFlow(withStep: Step)
    - -
    -
  • - + - forwardToParentFlow(withStep:) + forwardToParentFlow(withStep:)
    @@ -207,23 +185,15 @@

    Declaration

    the “withStep” step will be forwarded to the parent flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    case forwardToParentFlow(withStep: Step)
    - -
    -
  • - + - contribute(withNext:) + contribute(withNext:)
    @@ -235,18 +205,6 @@

    Declaration

    in case we have a single actor that is a Presentable and also a Stepper

    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func contribute(withNext nextPresentableAndStepper: Presentable & Stepper) -> FlowContributor
    - -
    -
    -
    -

    Return Value

    -

    .contribute(withNextPresentable: withNext, withNextStepper: withNext)

    -
  • @@ -255,8 +213,8 @@

    Return Value

    diff --git a/docs/Enums/FlowContributors.html b/docs/Enums/FlowContributors.html index 94a56b9..99a0f78 100644 --- a/docs/Enums/FlowContributors.html +++ b/docs/Enums/FlowContributors.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    FlowContributors

    -
    -
    -
    public enum FlowContributors
    - -
    -

    FlowContributors represent the next things that will trigger navigation actions inside a Flow

    @@ -139,9 +133,9 @@

    FlowContributors

  • @@ -152,23 +146,15 @@

    FlowContributors

    a Flow will trigger several FlowContributor at the same time for the same Step

    -
    -

    Declaration

    -
    -

    Swift

    -
    case multiple(flowContributors: [FlowContributor])
    - -
    -
  • - + - one(flowContributor:) + one(flowContributor:)
    @@ -179,23 +165,15 @@

    Declaration

    a Flow will trigger only one FlowContributor for a Step

    -
    -

    Declaration

    -
    -

    Swift

    -
    case one(flowContributor: FlowContributor)
    - -
    -
  • - + - end(forwardToParentFlowWithStep:) + end(forwardToParentFlowWithStep:)
    @@ -206,23 +184,15 @@

    Declaration

    a Flow will trigger a special FlowContributor that represents the dismissal of this Flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    case end(forwardToParentFlowWithStep: Step)
    - -
    -
  • - + - none + none
    @@ -233,41 +203,6 @@

    Declaration

    no further navigation will be triggered for a Step

    -
    -

    Declaration

    -
    -

    Swift

    -
    case none
    - -
    -
    - - -
  • -
  • -
    - - - - triggerParentFlow(withStep:) - -
    -
    -
    -
    -
    -
    -

    same as .one(flowContributor: .forwardToParentFlow(withStep: Step)). Should not be used anymore

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case triggerParentFlow(withStep: Step)
    - -
    -
  • @@ -276,8 +211,8 @@

    Declaration

    diff --git a/docs/Enums/Flows.html b/docs/Enums/Flows.html new file mode 100644 index 0000000..927b7a3 --- /dev/null +++ b/docs/Enums/Flows.html @@ -0,0 +1,253 @@ + + + + Flows Enumeration Reference + + + + + + + + + + + + + +
    +
    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Flows

    +

    Utility functions to synchronize Flows readyness

    + +
    +
    +
    +
      +
    • +
      + + + + ExecuteStrategy + +
      +
      +
      +
      +
      +
      + + See more +
      +
      +
      +
    • +
    • +
      + + + + use(_:when:block:) + +
      +
      +
      +
      +
      +
      + +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation +Once it is the case, the block is executed

      + +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation +Once it is the case, the block is executed

      + +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation +Once it is the case, the block is executed

      + +
      +
      +
      +
    • +
    • +
      + + + + use(_:_:when:block:) + +
      +
      +
      +
      +
      +
      +

      Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation +Once it is the case, the block is executed

      + +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/Enums/Flows/ExecuteStrategy.html b/docs/Enums/Flows/ExecuteStrategy.html new file mode 100644 index 0000000..9225eb6 --- /dev/null +++ b/docs/Enums/Flows/ExecuteStrategy.html @@ -0,0 +1,171 @@ + + + + ExecuteStrategy Enumeration Reference + + + + + + + + + + + + + +
    +
    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    +
    +
    +
    + +
    +
    + + +
    + + + diff --git a/docs/Enums/RxFlowStep.html b/docs/Enums/RxFlowStep.html index 94a478f..48fcd4f 100644 --- a/docs/Enums/RxFlowStep.html +++ b/docs/Enums/RxFlowStep.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    RxFlowStep

    -
    -
    -
    public enum RxFlowStep : Step
    - -
    -

    Standard RxFlow Steps

      @@ -134,9 +128,9 @@

      RxFlowStep

    • - + - home + home
      @@ -147,14 +141,6 @@

      RxFlowStep

      can be used to express a Flow first step

      -
      -

      Declaration

      -
      -

      Swift

      -
      case home
      - -
      -
    @@ -163,8 +149,8 @@

    Declaration

    diff --git a/docs/Extensions.html b/docs/Extensions.html index 49ed6a6..9f95143 100644 --- a/docs/Extensions.html +++ b/docs/Extensions.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -124,9 +124,9 @@

    Extensions

  • - + - ObservableType + ObservableType
    @@ -137,23 +137,15 @@

    Extensions

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public extension ObservableType
    - -
    -
  • - + - Reactive + Reactive
    @@ -164,25 +156,15 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public extension Reactive where Base: UIViewController
    -
    public extension Reactive where Base: UIWindow
    -
    public extension Reactive where Base: FlowCoordinator
    - -
    -
  • - + - UIViewController + UIViewController
    @@ -192,23 +174,15 @@

    Declaration

    -
    -

    Declaration

    -
    -

    Swift

    -
    extension UIViewController: Presentable
    - -
    -
  • - + - UIWindow + UIWindow
    @@ -218,14 +192,6 @@

    Declaration

    -
    -

    Declaration

    -
    -

    Swift

    -
    extension UIWindow: Presentable
    - -
    -
  • @@ -234,8 +200,8 @@

    Declaration

    diff --git a/docs/Extensions/ObservableType.html b/docs/Extensions/ObservableType.html index 89f0762..d777436 100644 --- a/docs/Extensions/ObservableType.html +++ b/docs/Extensions/ObservableType.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    ObservableType

    -
    -
    -
    public extension ObservableType
    - -
    -
    @@ -129,9 +123,9 @@

    ObservableType

  • @@ -144,46 +138,15 @@

    ObservableType

    seealso: pausable operator on reactivex.io

    -
    -

    Declaration

    -
    -

    Swift

    -
    func pausable<P>(withPauser pauser: P) -> Observable<Element> where P : ObservableType, P.Element == Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - pauser - - -
    -

    The observable sequence used to pause the source observable sequence.

    -
    -
    -
    -
    -

    Return Value

    -

    The observable sequence which is paused based upon the pauser observable sequence.

    -
  • - + - pausable(afterCount:withPauser:) + pausable(afterCount:withPauser:)
    @@ -198,52 +161,6 @@

    Return Value

    seealso: pausable operator on reactivex.io

    -
    -

    Declaration

    -
    -

    Swift

    -
    func pausable<P> (afterCount count: Int, withPauser pauser: P) -> Observable<Element>
    -    where
    -    P: ObservableType,
    -    P.Element == Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - count - - -
    -

    the number of events before considering the pauser parameter

    -
    -
    - - pauser - - -
    -

    The observable sequence used to pause the source observable sequence.

    -
    -
    -
    -
    -

    Return Value

    -

    The observable sequence which is paused based upon the pauser observable sequence.

    -
  • @@ -252,8 +169,8 @@

    Return Value

    diff --git a/docs/Extensions/Reactive.html b/docs/Extensions/Reactive.html index db42ec4..e6675e1 100644 --- a/docs/Extensions/Reactive.html +++ b/docs/Extensions/Reactive.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,34 +115,17 @@

    Reactive

    -
    -
    -
    public extension Reactive where Base: UIViewController
    -
    public extension Reactive where Base: UIWindow
    -
    public extension Reactive where Base: FlowCoordinator
    - -
    -
    -
    - - -
    - -

    Available where Base: UIViewController

    -

    -
    -
    • @@ -153,23 +136,15 @@

      Available where Base: UIViewContr

      Rx observable, triggered when the view is being dismissed

      -
      -

      Declaration

      -
      -

      Swift

      -
      var dismissed: ControlEvent<Bool> { get }
      - -
      -
  • - + - displayed + displayed
    @@ -180,36 +155,15 @@

    Declaration

    Rx observable, triggered when the view appearance state changes

    -
    -

    Declaration

    -
    -

    Swift

    -
    var displayed: Observable<Bool> { get }
    - -
    -
  • - - -
    -
    - - -
    - -

    Available where Base: UIWindow

    -

    -
    -
    -
    • @@ -220,14 +174,6 @@

      Available where Base: UIWindowRx Observable that is triggered once the UIWindow is displayed

      -
      -

      Declaration

      -
      -

      Swift

      -
      var windowDidAppear: Observable<Void> { get }
      - -
      -
    @@ -235,11 +181,11 @@

    Declaration

    - - + +
    - -

    Available where Base: FlowCoordinator

    + +

    FlowCoordinator Reactive extensions

    @@ -247,9 +193,9 @@

    Available where Base:

    @@ -260,23 +206,15 @@

    Available where Base: -

    Declaration

    - -

  • @@ -287,14 +225,6 @@

    Declaration

    Rx Observable emitted after the navigation to a Step within a Flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    var didNavigate: Observable<(Flow, Step)> { get }
    - -
    -
  • @@ -303,8 +233,8 @@

    Declaration

    diff --git a/docs/Protocols.html b/docs/Protocols.html index 36ff28a..bac381d 100644 --- a/docs/Protocols.html +++ b/docs/Protocols.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -124,9 +124,9 @@

    Protocols

  • - + - Flow + Flow
    @@ -138,23 +138,15 @@

    Protocols

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Flow : AnyObject, Presentable, Synchronizable
    - -
    -
  • @@ -166,23 +158,15 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Presentable
    - -
    -
  • - + - Step + Step
    @@ -193,23 +177,15 @@

    Declaration

    A Step describes a possible state of navigation inside a Flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Step
    - -
    -
  • - + - Stepper + Stepper
    @@ -222,23 +198,15 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Stepper
    - -
    -
  • @@ -249,14 +217,6 @@

    Declaration

    Provides a function to prevent concurrent block execution

    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Synchronizable
    - -
    -
  • @@ -265,8 +225,8 @@

    Declaration

    diff --git a/docs/Protocols/Flow.html b/docs/Protocols/Flow.html index 2fbdacf..7be6a05 100644 --- a/docs/Protocols/Flow.html +++ b/docs/Protocols/Flow.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    Flow

    -
    -
    -
    public protocol Flow : AnyObject, Presentable, Synchronizable
    - -
    -

    A Flow defines a clear navigation area. Combined to a Step it leads to a navigation action

    @@ -130,9 +124,9 @@

    Flow

  • - + - root + root
    @@ -143,23 +137,15 @@

    Flow

    the Presentable on which rely the navigation inside this Flow. This method must always give the same instance

    -
    -

    Declaration

    -
    -

    Swift

    -
    var root: Presentable { get }
    - -
    -
  • - + - adapt(step:) + adapt(step:) Default implementation @@ -177,46 +163,15 @@

    Default Implementation

    -
    -

    Declaration

    -
    -

    Swift

    -
    func adapt(step: Step) -> Single<Step>
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - step - - -
    -

    the step emitted by a Stepper within the Flow

    -
    -
    -
    -
    -

    Return Value

    -

    the step (possibly in the future) that should really by interpreted by the navigate(to:) function

    -
  • @@ -227,38 +182,6 @@

    Return Value

    Resolves FlowContributors according to the Step, in the context of this very Flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    func navigate(to step: Step) -> FlowContributors
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - step - - -
    -

    the Step emitted by one of the Steppers declared in the Flow

    -
    -
    -
    -
    -

    Return Value

    -

    the FlowContributors matching the Step. These FlowContributors determines the next navigation steps (Presentables to -display / Steppers to listen)

    -
  • @@ -267,8 +190,8 @@

    Return Value

    diff --git a/docs/Protocols/Presentable.html b/docs/Protocols/Presentable.html index fe79400..2138661 100644 --- a/docs/Protocols/Presentable.html +++ b/docs/Protocols/Presentable.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    Presentable

    -
    -
    -
    public protocol Presentable
    - -
    -

    An abstraction of what can be presented to the screen. For now, UIViewControllers and Flows are Presentable

    @@ -130,111 +124,9 @@

    Presentable

  • - + - rxVisible - -
    -
    -
    -
    -
    -
    -

    Rx Observable that triggers a bool indicating if the current Presentable is being displayed -(applies to UIViewController, Flow or UIWindow for instance)

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var rxVisible: Observable<Bool> { get }
    - -
    -
    -
    -
    -
  • -
  • -
    - - - - rxDismissed - -
    -
    -
    -
    -
    -
    -

    Rx Observable (Single trait) triggered when this presentable is dismissed

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var rxDismissed: Single<Void> { get }
    - -
    -
    -
    -
    -
  • - -
    -
    -
    - - -
    - -

    Available where Self: UIViewController

    -

    -
    -
    -
      -
    • -
      - - - - rxVisible - - - Default implementation - -
      -
      -
      -
      -
      -
      - -
      -

      Default Implementation

      -
      -

      Rx Observable that triggers a bool indicating if the current UIViewController is being displayed

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      var rxVisible: Observable<Bool> { get }
      - -
      -
      -
      -
      -
    • -
    • -
      - - - - rxDismissed + rxVisible Default implementation @@ -245,158 +137,24 @@

      Declaration

      - -
      -

      Default Implementation

      -
      -

      Rx Observable (Single trait) triggered when this UIViewController is dismissed

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      var rxDismissed: Single<Void> { get }
      - -
      -
      -
      -
      -
    • -
    -
    -
    -
    - - -
    - -

    Available where Self: Flow

    -

    -
    -
    -
      -
    • -
      - - - - rxVisible - - - Default implementation - -
      -
      -
      -
      -
      -
      - -
      -

      Default Implementation

      -
      -

      Rx Observable that triggers a bool indicating if the current Flow is being displayed

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      var rxVisible: Observable<Bool> { get }
      - -
      -
      -
      -
      -
    • -
    • -
      - - - - rxDismissed - - - Default implementation - -
      -
      -
      -
      -
      -
      - -
      -

      Default Implementation

      -
      -

      Rx Observable (Single trait) triggered when this Flow is dismissed

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      var rxDismissed: Single<Void> { get }
      +

      Rx Observable that triggers a bool indicating if the current Presentable is being displayed +(applies to UIViewController, Flow or UIWindow for instance)

      -
      -
      -
      -
      -
    • -
    -
    -
    -
    - - -
    - -

    Available where Self: UIWindow

    -

    -
    -
    -
      -
    • -
      - - - - rxVisible - - - Default implementation - -
      -
      -
      -
      -
      -
      -

      Default Implementation

      Rx Observable that triggers a bool indicating if the current UIWindow is being displayed

      -
      -

      Declaration

      -
      -

      Swift

      -
      var rxVisible: Observable<Bool> { get }
      - -
      -
    • - + - rxDismissed + rxDismissed Default implementation @@ -407,21 +165,14 @@

      Declaration

      - +

      Rx Observable (Single trait) triggered when this presentable is dismissed

      +

      Default Implementation

      Rx Observable (Single trait) triggered when this UIWindow is dismissed

      -
      -

      Declaration

      -
      -

      Swift

      -
      var rxDismissed: Single<Void> { get }
      - -
      -
    • @@ -430,8 +181,8 @@

      Declaration

    diff --git a/docs/Protocols/Stepper.html b/docs/Protocols/Stepper.html index d988c0b..7ad1730 100644 --- a/docs/Protocols/Stepper.html +++ b/docs/Protocols/Stepper.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    Stepper

    -
    -
    -
    public protocol Stepper
    - -
    -

    a Stepper has only one purpose is: emits Steps that correspond to specific navigation states. The Step changes lead to navigation actions in the context of a specific Flow

    @@ -131,9 +125,9 @@

    Stepper

  • - + - steps + steps
    @@ -144,23 +138,15 @@

    Stepper

    the relay used to emit steps inside this Stepper

    -
    -

    Declaration

    -
    -

    Swift

    -
    var steps: PublishRelay<Step> { get }
    - -
    -
  • - + - initialStep + initialStep Default implementation @@ -178,23 +164,15 @@

    Default Implementation

    -
    -

    Declaration

    -
    -

    Swift

    -
    var initialStep: Step { get }
    - -
    -
  • - + - readyToEmitSteps() + readyToEmitSteps() Default implementation @@ -212,14 +190,6 @@

    Default Implementation

    -
    -

    Declaration

    -
    -

    Swift

    -
    func readyToEmitSteps()
    - -
    -
  • @@ -228,8 +198,8 @@

    Declaration

    diff --git a/docs/badge.svg b/docs/badge.svg index f47d948..a5d7e55 100644 --- a/docs/badge.svg +++ b/docs/badge.svg @@ -1,15 +1,15 @@ - + - + - - + + @@ -18,11 +18,11 @@ documentation - - 98% + + 0% - - 98% + + 0% diff --git a/docs/css/jazzy.css b/docs/css/jazzy.css index 2d5656d..5cdffe9 100644 --- a/docs/css/jazzy.css +++ b/docs/css/jazzy.css @@ -56,9 +56,14 @@ p code, li code { padding: 2px 4px; border-radius: 4px; } +pre > code { + padding: 0; } + a { color: #0088cc; text-decoration: none; } + a code { + color: inherit; } ul { padding-left: 15px; } @@ -80,11 +85,11 @@ blockquote { header { font-size: 0.85em; - line-height: 26px; + line-height: 32px; background-color: #414141; position: fixed; width: 100%; - z-index: 2; } + z-index: 3; } header img { padding-right: 6px; vertical-align: -4px; @@ -100,12 +105,12 @@ header { #breadcrumbs { background-color: #f2f2f2; - height: 27px; + height: 21px; padding-top: 17px; position: fixed; width: 100%; z-index: 2; - margin-top: 26px; } + margin-top: 32px; } #breadcrumbs #carat { height: 10px; margin: 0 5px; } @@ -199,6 +204,7 @@ header { margin-left: 18px; } .task-group-section { + margin-top: 10px; padding-left: 6px; border-top: 1px solid #e2e2e2; } @@ -241,12 +247,14 @@ header { background-color: transparent; padding: 0; } .item .token, .item .direct-link { + display: inline-block; + text-indent: -20px; padding-left: 3px; - margin-left: 15px; + margin-left: 35px; font-size: 11.9px; transition: all 300ms; } .item .token-open { - margin-left: 0px; } + margin-left: 20px; } .item .discouraged { text-decoration: line-through; } .item .declaration-note { @@ -370,3 +378,46 @@ html.dash .content-wrapper { html.dash #footer { position: static; } + +form[role=search] { + float: right; } + form[role=search] input { + font: Helvetica, freesans, Arial, sans-serif; + margin-top: 6px; + font-size: 13px; + line-height: 20px; + padding: 0px 10px; + border: none; + border-radius: 1em; } + .loading form[role=search] input { + background: white url(../img/spinner.gif) center right 4px no-repeat; } + form[role=search] .tt-menu { + margin: 0; + min-width: 300px; + background: #fff; + color: #333; + border: 1px solid #e2e2e2; + z-index: 4; } + form[role=search] .tt-highlight { + font-weight: bold; } + form[role=search] .tt-suggestion { + font: Helvetica, freesans, Arial, sans-serif; + font-size: 14px; + padding: 0 8px; } + form[role=search] .tt-suggestion span { + display: table-cell; + white-space: nowrap; } + form[role=search] .tt-suggestion .doc-parent-name { + width: 100%; + text-align: right; + font-weight: normal; + font-size: 0.9em; + padding-left: 16px; } + form[role=search] .tt-suggestion:hover, + form[role=search] .tt-suggestion.tt-cursor { + cursor: pointer; + background-color: #4183c4; + color: #fff; } + form[role=search] .tt-suggestion:hover .doc-parent-name, + form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { + color: #fff; } diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes.html index 2b7a4a7..17ebe9b 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -124,37 +124,9 @@

    Classes

  • - - - Flows - -
    -
    -
    -
    -
    -
    -

    Utility functions to synchronize Flows readyness

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public class Flows
    - -
    -
    -
    -
    -
  • -
  • -
    @@ -166,14 +138,6 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public final class FlowCoordinator : NSObject
    - -
    -
  • @@ -193,9 +157,9 @@

    default implementation

  • @@ -207,23 +171,15 @@

    default implementation

    See more

    -
    -

    Declaration

    -
    -

    Swift

    -
    public class OneStepper : Stepper
    - -
    -
  • @@ -235,23 +191,15 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public class DefaultStepper : OneStepper
    - -
    -
  • @@ -264,14 +212,6 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public class CompositeStepper : Stepper
    - -
    -
  • @@ -280,8 +220,8 @@

    Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/CompositeStepper.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/CompositeStepper.html index af0a59b..b133a95 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/CompositeStepper.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/CompositeStepper.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    CompositeStepper

    -
    -
    -
    public class CompositeStepper : Stepper
    - -
    -

    A Stepper that combines multiple steppers. All those Steppers will be associated to the Presentable that is given within the NextFlowItem

    @@ -131,9 +125,9 @@

    CompositeStepper

  • - + - steps + steps
    @@ -143,23 +137,15 @@

    CompositeStepper

    -
    -

    Declaration

    -
    -

    Swift

    -
    public let steps: PublishRelay<Step>
    - -
    -
  • @@ -170,42 +156,15 @@

    Declaration

    Initialize

    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(steppers: [Stepper])
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - steppers - - -
    -

    all these Steppers will be observed by the Coordinator

    -
    -
    -
  • @@ -215,14 +174,6 @@

    Parameters

    -
    -

    Declaration

    -
    -

    Swift

    -
    public func readyToEmitSteps()
    - -
    -
  • @@ -231,8 +182,8 @@

    Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/DefaultStepper.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/DefaultStepper.html index 6985e2e..5ab5115 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/DefaultStepper.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/DefaultStepper.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    DefaultStepper

    -
    -
    -
    public class DefaultStepper : OneStepper
    - -
    -

    A Simple Stepper that has one goal: emit a first default step equal to RxFlowStep.home

    @@ -130,9 +124,9 @@

    DefaultStepper

  • - + - init() + init()
    @@ -143,14 +137,6 @@

    DefaultStepper

    Initialize the DefaultStepper

    -
    -

    Declaration

    -
    -

    Swift

    -
    public init()
    - -
    -
  • @@ -159,8 +145,8 @@

    Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/FlowCoordinator.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/FlowCoordinator.html index 82ff10d..c7c3e9d 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/FlowCoordinator.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/FlowCoordinator.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    FlowCoordinator

    -
    -
    -
    public final class FlowCoordinator : NSObject
    - -
    -

    A FlowCoordinator handles the navigation of a Flow, based on its Stepper and the FlowContributors it emits

    @@ -130,9 +124,9 @@

    FlowCoordinator

  • @@ -140,16 +134,27 @@

    FlowCoordinator

    -

    Undocumented

    +

    Execute the navigation of the Flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    public func coordinate(flow: Flow, with stepper: Stepper = DefaultStepper())
    +
    +
    +
  • +
  • +
    + + + + navigate(to:) + +
    +
    +
    +
    +
    +
    +

    allow to drive the navigation from the outside of a flow

    -
  • @@ -159,8 +164,8 @@

    Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/OneStepper.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/OneStepper.html index 9dc5b75..0c1c20e 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/OneStepper.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Classes/OneStepper.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    OneStepper

    -
    -
    -
    public class OneStepper : Stepper
    - -
    -

    A Simple Stepper that has one goal: emit a single Step once initialized

    @@ -130,9 +124,9 @@

    OneStepper

  • - + - steps + steps
    @@ -142,23 +136,15 @@

    OneStepper

    -
    -

    Declaration

    -
    -

    Swift

    -
    public let steps: PublishRelay<Step>
    - -
    -
  • @@ -169,42 +155,15 @@

    Declaration

    Initialize the OneStepper

    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(withSingleStep singleStep: Step)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - singleStep - - -
    -

    the step to be emitted once initialized

    -
    -
    -
  • @@ -214,14 +173,6 @@

    Parameters

    -
    -

    Declaration

    -
    -

    Swift

    -
    public var initialStep: Step { get }
    - -
    -
  • @@ -230,8 +181,8 @@

    Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums.html index 2fe384c..8cd493b 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -124,9 +124,29 @@

    Enumerations

  • - + + + Flows + +
    +
    +
    +
    +
    +
    +

    Utility functions to synchronize Flows readyness

    + + See more +
    +
    +
    +
  • +
  • +
    @@ -146,23 +166,15 @@

    Enumerations

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum FlowContributor
    - -
    -
  • @@ -183,23 +195,15 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum FlowContributors
    - -
    -
  • @@ -215,14 +219,6 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum RxFlowStep : Step
    - -
    -
  • @@ -231,8 +227,8 @@

    Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/FlowContributor.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/FlowContributor.html index ed0d891..58f4e2c 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/FlowContributor.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/FlowContributor.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    FlowContributor

    -
    -
    -
    public enum FlowContributor
    - -
    -

    A FlowContributor describes the next thing that will contribute to a Flow.

  • @@ -180,23 +166,15 @@

    Declaration

    the “withStep” step will be forwarded to the current flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    case forwardToCurrentFlow(withStep: Step)
    - -
    -
  • @@ -207,23 +185,15 @@

    Declaration

    the “withStep” step will be forwarded to the parent flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    case forwardToParentFlow(withStep: Step)
    - -
    -
  • @@ -235,18 +205,6 @@

    Declaration

    in case we have a single actor that is a Presentable and also a Stepper

    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func contribute(withNext nextPresentableAndStepper: Presentable & Stepper) -> FlowContributor
    - -
    -
    -
    -

    Return Value

    -

    .contribute(withNextPresentable: withNext, withNextStepper: withNext)

    -
  • @@ -255,8 +213,8 @@

    Return Value

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/FlowContributors.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/FlowContributors.html index 94a56b9..99a0f78 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/FlowContributors.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/FlowContributors.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    FlowContributors

    -
    -
    -
    public enum FlowContributors
    - -
    -

    FlowContributors represent the next things that will trigger navigation actions inside a Flow

    @@ -139,9 +133,9 @@

    FlowContributors

  • @@ -152,23 +146,15 @@

    FlowContributors

    a Flow will trigger several FlowContributor at the same time for the same Step

    -
    -

    Declaration

    -
    -

    Swift

    -
    case multiple(flowContributors: [FlowContributor])
    - -
    -
  • @@ -179,23 +165,15 @@

    Declaration

    a Flow will trigger only one FlowContributor for a Step

    -
    -

    Declaration

    -
    -

    Swift

    -
    case one(flowContributor: FlowContributor)
    - -
    -
  • @@ -206,23 +184,15 @@

    Declaration

    a Flow will trigger a special FlowContributor that represents the dismissal of this Flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    case end(forwardToParentFlowWithStep: Step)
    - -
    -
  • - + - none + none
    @@ -233,41 +203,6 @@

    Declaration

    no further navigation will be triggered for a Step

    -
    -

    Declaration

    -
    -

    Swift

    -
    case none
    - -
    -
    - - -
  • -
  • - -
    -
    -
    -
    -
    -

    same as .one(flowContributor: .forwardToParentFlow(withStep: Step)). Should not be used anymore

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case triggerParentFlow(withStep: Step)
    - -
    -
  • @@ -276,8 +211,8 @@

    Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/Flows.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/Flows.html new file mode 100644 index 0000000..927b7a3 --- /dev/null +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/Flows.html @@ -0,0 +1,253 @@ + + + + Flows Enumeration Reference + + + + + + + + + + + + + +
    +
    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    +
    +
    +
    + +
    +
    + +
    +
    +
    +

    Flows

    +

    Utility functions to synchronize Flows readyness

    + +
    +
    +
    +
      +
    • +
      + + + + ExecuteStrategy + +
      +
      +
      +
      +
      +
      + + See more +
      +
      +
      +
    • +
    • +
      + + + + use(_:when:block:) + +
      +
      +
      +
      +
      +
      + +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation +Once it is the case, the block is executed

      + +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation +Once it is the case, the block is executed

      + +
      +
      +
      +
    • +
    • + +
      +
      +
      +
      +
      +

      Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation +Once it is the case, the block is executed

      + +
      +
      +
      +
    • +
    • +
      + + + + use(_:_:when:block:) + +
      +
      +
      +
      +
      +
      +

      Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation +Once it is the case, the block is executed

      + +
      +
      +
      +
    • +
    +
    +
    +
    + +
    +
    + + + diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/Flows/ExecuteStrategy.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/Flows/ExecuteStrategy.html new file mode 100644 index 0000000..9225eb6 --- /dev/null +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/Flows/ExecuteStrategy.html @@ -0,0 +1,171 @@ + + + + ExecuteStrategy Enumeration Reference + + + + + + + + + + + + + +
    +
    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    +
    +
    +
    + +
    +
    + + +
    + + + diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/RxFlowStep.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/RxFlowStep.html index 94a478f..48fcd4f 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/RxFlowStep.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Enums/RxFlowStep.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    RxFlowStep

    -
    -
    -
    public enum RxFlowStep : Step
    - -
    -

    Standard RxFlow Steps

      @@ -134,9 +128,9 @@

      RxFlowStep

    • - + - home + home
      @@ -147,14 +141,6 @@

      RxFlowStep

      can be used to express a Flow first step

      -
      -

      Declaration

      -
      -

      Swift

      -
      case home
      - -
      -
    @@ -163,8 +149,8 @@

    Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Extensions.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Extensions.html index 49ed6a6..9f95143 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Extensions.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Extensions.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -124,9 +124,9 @@

    Extensions

  • @@ -137,23 +137,15 @@

    Extensions

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public extension ObservableType
    - -
    -
  • - + - Reactive + Reactive
    @@ -164,25 +156,15 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public extension Reactive where Base: UIViewController
    -
    public extension Reactive where Base: UIWindow
    -
    public extension Reactive where Base: FlowCoordinator
    - -
    -
  • @@ -192,23 +174,15 @@

    Declaration

    -
    -

    Declaration

    -
    -

    Swift

    -
    extension UIViewController: Presentable
    - -
    -
  • - + - UIWindow + UIWindow
    @@ -218,14 +192,6 @@

    Declaration

    -
    -

    Declaration

    -
    -

    Swift

    -
    extension UIWindow: Presentable
    - -
    -
  • @@ -234,8 +200,8 @@

    Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Extensions/ObservableType.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Extensions/ObservableType.html index 89f0762..d777436 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Extensions/ObservableType.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Extensions/ObservableType.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    ObservableType

    -
    -
    -
    public extension ObservableType
    - -
    -
    @@ -129,9 +123,9 @@

    ObservableType

  • @@ -144,46 +138,15 @@

    ObservableType

    seealso: pausable operator on reactivex.io

    -
    -

    Declaration

    -
    -

    Swift

    -
    func pausable<P>(withPauser pauser: P) -> Observable<Element> where P : ObservableType, P.Element == Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - pauser - - -
    -

    The observable sequence used to pause the source observable sequence.

    -
    -
    -
    -
    -

    Return Value

    -

    The observable sequence which is paused based upon the pauser observable sequence.

    -
  • @@ -198,52 +161,6 @@

    Return Value

    seealso: pausable operator on reactivex.io

    -
    -

    Declaration

    -
    -

    Swift

    -
    func pausable<P> (afterCount count: Int, withPauser pauser: P) -> Observable<Element>
    -    where
    -    P: ObservableType,
    -    P.Element == Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - count - - -
    -

    the number of events before considering the pauser parameter

    -
    -
    - - pauser - - -
    -

    The observable sequence used to pause the source observable sequence.

    -
    -
    -
    -
    -

    Return Value

    -

    The observable sequence which is paused based upon the pauser observable sequence.

    -
  • @@ -252,8 +169,8 @@

    Return Value

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Extensions/Reactive.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Extensions/Reactive.html index db42ec4..e6675e1 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Extensions/Reactive.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Extensions/Reactive.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,34 +115,17 @@

    Reactive

    -
    -
    -
    public extension Reactive where Base: UIViewController
    -
    public extension Reactive where Base: UIWindow
    -
    public extension Reactive where Base: FlowCoordinator
    - -
    -
    -
    - - -
    - -

    Available where Base: UIViewController

    -

    -
    -
    • @@ -153,23 +136,15 @@

      Available where Base: UIViewContr

      Rx observable, triggered when the view is being dismissed

      -
      -

      Declaration

      -
      -

      Swift

      -
      var dismissed: ControlEvent<Bool> { get }
      - -
      -
  • @@ -180,36 +155,15 @@

    Declaration

    Rx observable, triggered when the view appearance state changes

    -
    -

    Declaration

    -
    -

    Swift

    -
    var displayed: Observable<Bool> { get }
    - -
    -
  • - - -
    -
    - - -
    - -

    Available where Base: UIWindow

    -

    -
    -
    -
    • @@ -220,14 +174,6 @@

      Available where Base: UIWindowRx Observable that is triggered once the UIWindow is displayed

      -
      -

      Declaration

      -
      -

      Swift

      -
      var windowDidAppear: Observable<Void> { get }
      - -
      -
    @@ -235,11 +181,11 @@

    Declaration

    - - + +
    - -

    Available where Base: FlowCoordinator

    + +

    FlowCoordinator Reactive extensions

    @@ -247,9 +193,9 @@

    Available where Base:

    @@ -260,23 +206,15 @@

    Available where Base: -

    Declaration

    - -

  • @@ -287,14 +225,6 @@

    Declaration

    Rx Observable emitted after the navigation to a Step within a Flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    var didNavigate: Observable<(Flow, Step)> { get }
    - -
    -
  • @@ -303,8 +233,8 @@

    Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols.html index 36ff28a..bac381d 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -124,9 +124,9 @@

    Protocols

  • - + - Flow + Flow
    @@ -138,23 +138,15 @@

    Protocols

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Flow : AnyObject, Presentable, Synchronizable
    - -
    -
  • @@ -166,23 +158,15 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Presentable
    - -
    -
  • - + - Step + Step
    @@ -193,23 +177,15 @@

    Declaration

    A Step describes a possible state of navigation inside a Flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Step
    - -
    -
  • - + - Stepper + Stepper
    @@ -222,23 +198,15 @@

    Declaration

    See more
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Stepper
    - -
    -
  • @@ -249,14 +217,6 @@

    Declaration

    Provides a function to prevent concurrent block execution

    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Synchronizable
    - -
    -
  • @@ -265,8 +225,8 @@

    Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols/Flow.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols/Flow.html index 2fbdacf..7be6a05 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols/Flow.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols/Flow.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    Flow

    -
    -
    -
    public protocol Flow : AnyObject, Presentable, Synchronizable
    - -
    -

    A Flow defines a clear navigation area. Combined to a Step it leads to a navigation action

    @@ -130,9 +124,9 @@

    Flow

  • - + - root + root
    @@ -143,23 +137,15 @@

    Flow

    the Presentable on which rely the navigation inside this Flow. This method must always give the same instance

    -
    -

    Declaration

    -
    -

    Swift

    -
    var root: Presentable { get }
    - -
    -
  • - + - adapt(step:) + adapt(step:) Default implementation @@ -177,46 +163,15 @@

    Default Implementation

    -
    -

    Declaration

    -
    -

    Swift

    -
    func adapt(step: Step) -> Single<Step>
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - step - - -
    -

    the step emitted by a Stepper within the Flow

    -
    -
    -
    -
    -

    Return Value

    -

    the step (possibly in the future) that should really by interpreted by the navigate(to:) function

    -
  • @@ -227,38 +182,6 @@

    Return Value

    Resolves FlowContributors according to the Step, in the context of this very Flow

    -
    -

    Declaration

    -
    -

    Swift

    -
    func navigate(to step: Step) -> FlowContributors
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - step - - -
    -

    the Step emitted by one of the Steppers declared in the Flow

    -
    -
    -
    -
    -

    Return Value

    -

    the FlowContributors matching the Step. These FlowContributors determines the next navigation steps (Presentables to -display / Steppers to listen)

    -
  • @@ -267,8 +190,8 @@

    Return Value

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols/Presentable.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols/Presentable.html index fe79400..2138661 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols/Presentable.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols/Presentable.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    Presentable

    -
    -
    -
    public protocol Presentable
    - -
    -

    An abstraction of what can be presented to the screen. For now, UIViewControllers and Flows are Presentable

    @@ -130,111 +124,9 @@

    Presentable

  • - + - rxVisible - -
    -
    -
    -
    -
    -
    -

    Rx Observable that triggers a bool indicating if the current Presentable is being displayed -(applies to UIViewController, Flow or UIWindow for instance)

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var rxVisible: Observable<Bool> { get }
    - -
    -
    -
    -
    -
  • -
  • -
    - - - - rxDismissed - -
    -
    -
    -
    -
    -
    -

    Rx Observable (Single trait) triggered when this presentable is dismissed

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var rxDismissed: Single<Void> { get }
    - -
    -
    -
    -
    -
  • - -
    -
    -
    - - -
    - -

    Available where Self: UIViewController

    -

    -
    -
    -
      -
    • -
      - - - - rxVisible - - - Default implementation - -
      -
      -
      -
      -
      -
      - -
      -

      Default Implementation

      -
      -

      Rx Observable that triggers a bool indicating if the current UIViewController is being displayed

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      var rxVisible: Observable<Bool> { get }
      - -
      -
      -
      -
      -
    • -
    • -
      - - - - rxDismissed + rxVisible Default implementation @@ -245,158 +137,24 @@

      Declaration

      - -
      -

      Default Implementation

      -
      -

      Rx Observable (Single trait) triggered when this UIViewController is dismissed

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      var rxDismissed: Single<Void> { get }
      - -
      -
      -
      -
      -
    • -
    -
    -
    -
    - - -
    - -

    Available where Self: Flow

    -

    -
    -
    -
      -
    • -
      - - - - rxVisible - - - Default implementation - -
      -
      -
      -
      -
      -
      - -
      -

      Default Implementation

      -
      -

      Rx Observable that triggers a bool indicating if the current Flow is being displayed

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      var rxVisible: Observable<Bool> { get }
      - -
      -
      -
      -
      -
    • -
    • -
      - - - - rxDismissed - - - Default implementation - -
      -
      -
      -
      -
      -
      - -
      -

      Default Implementation

      -
      -

      Rx Observable (Single trait) triggered when this Flow is dismissed

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      var rxDismissed: Single<Void> { get }
      +

      Rx Observable that triggers a bool indicating if the current Presentable is being displayed +(applies to UIViewController, Flow or UIWindow for instance)

      -
      -
      -
      -
      -
    • -
    -
    -
    -
    - - -
    - -

    Available where Self: UIWindow

    -

    -
    -
    -
      -
    • -
      - - - - rxVisible - - - Default implementation - -
      -
      -
      -
      -
      -
      -

      Default Implementation

      Rx Observable that triggers a bool indicating if the current UIWindow is being displayed

      -
      -

      Declaration

      -
      -

      Swift

      -
      var rxVisible: Observable<Bool> { get }
      - -
      -
    • - + - rxDismissed + rxDismissed Default implementation @@ -407,21 +165,14 @@

      Declaration

      - +

      Rx Observable (Single trait) triggered when this presentable is dismissed

      +

      Default Implementation

      Rx Observable (Single trait) triggered when this UIWindow is dismissed

      -
      -

      Declaration

      -
      -

      Swift

      -
      var rxDismissed: Single<Void> { get }
      - -
      -
    • @@ -430,8 +181,8 @@

      Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols/Stepper.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols/Stepper.html index d988c0b..7ad1730 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols/Stepper.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/Protocols/Stepper.html @@ -8,13 +8,21 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -39,9 +47,6 @@ - @@ -56,6 +61,12 @@ + + @@ -71,10 +82,10 @@ Reactive @@ -88,24 +99,13 @@ Presentable - - - @@ -115,12 +115,6 @@

    Stepper

    -
    -
    -
    public protocol Stepper
    - -
    -

    a Stepper has only one purpose is: emits Steps that correspond to specific navigation states. The Step changes lead to navigation actions in the context of a specific Flow

    @@ -131,9 +125,9 @@

    Stepper

  • - + - steps + steps
    @@ -144,23 +138,15 @@

    Stepper

    the relay used to emit steps inside this Stepper

    -
    -

    Declaration

    -
    -

    Swift

    -
    var steps: PublishRelay<Step> { get }
    - -
    -
  • - + - initialStep + initialStep Default implementation @@ -178,23 +164,15 @@

    Default Implementation

    -
    -

    Declaration

    -
    -

    Swift

    -
    var initialStep: Step { get }
    - -
    -
  • - + - readyToEmitSteps() + readyToEmitSteps() Default implementation @@ -212,14 +190,6 @@

    Default Implementation

    -
    -

    Declaration

    -
    -

    Swift

    -
    func readyToEmitSteps()
    - -
    -
  • @@ -228,8 +198,8 @@

    Declaration

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/badge.svg b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/badge.svg index a096fec..a5d7e55 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/badge.svg +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/badge.svg @@ -1,15 +1,15 @@ - + - + - - + + @@ -18,11 +18,11 @@ documentation - - 100% + + 0% - - 100% + + 0% diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/css/jazzy.css b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/css/jazzy.css index 2d5656d..5cdffe9 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/css/jazzy.css +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/css/jazzy.css @@ -56,9 +56,14 @@ p code, li code { padding: 2px 4px; border-radius: 4px; } +pre > code { + padding: 0; } + a { color: #0088cc; text-decoration: none; } + a code { + color: inherit; } ul { padding-left: 15px; } @@ -80,11 +85,11 @@ blockquote { header { font-size: 0.85em; - line-height: 26px; + line-height: 32px; background-color: #414141; position: fixed; width: 100%; - z-index: 2; } + z-index: 3; } header img { padding-right: 6px; vertical-align: -4px; @@ -100,12 +105,12 @@ header { #breadcrumbs { background-color: #f2f2f2; - height: 27px; + height: 21px; padding-top: 17px; position: fixed; width: 100%; z-index: 2; - margin-top: 26px; } + margin-top: 32px; } #breadcrumbs #carat { height: 10px; margin: 0 5px; } @@ -199,6 +204,7 @@ header { margin-left: 18px; } .task-group-section { + margin-top: 10px; padding-left: 6px; border-top: 1px solid #e2e2e2; } @@ -241,12 +247,14 @@ header { background-color: transparent; padding: 0; } .item .token, .item .direct-link { + display: inline-block; + text-indent: -20px; padding-left: 3px; - margin-left: 15px; + margin-left: 35px; font-size: 11.9px; transition: all 300ms; } .item .token-open { - margin-left: 0px; } + margin-left: 20px; } .item .discouraged { text-decoration: line-through; } .item .declaration-note { @@ -370,3 +378,46 @@ html.dash .content-wrapper { html.dash #footer { position: static; } + +form[role=search] { + float: right; } + form[role=search] input { + font: Helvetica, freesans, Arial, sans-serif; + margin-top: 6px; + font-size: 13px; + line-height: 20px; + padding: 0px 10px; + border: none; + border-radius: 1em; } + .loading form[role=search] input { + background: white url(../img/spinner.gif) center right 4px no-repeat; } + form[role=search] .tt-menu { + margin: 0; + min-width: 300px; + background: #fff; + color: #333; + border: 1px solid #e2e2e2; + z-index: 4; } + form[role=search] .tt-highlight { + font-weight: bold; } + form[role=search] .tt-suggestion { + font: Helvetica, freesans, Arial, sans-serif; + font-size: 14px; + padding: 0 8px; } + form[role=search] .tt-suggestion span { + display: table-cell; + white-space: nowrap; } + form[role=search] .tt-suggestion .doc-parent-name { + width: 100%; + text-align: right; + font-weight: normal; + font-size: 0.9em; + padding-left: 16px; } + form[role=search] .tt-suggestion:hover, + form[role=search] .tt-suggestion.tt-cursor { + cursor: pointer; + background-color: #4183c4; + color: #fff; } + form[role=search] .tt-suggestion:hover .doc-parent-name, + form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { + color: #fff; } diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/img/spinner.gif b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/img/spinner.gif new file mode 100644 index 0000000..e3038d0 Binary files /dev/null and b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/img/spinner.gif differ diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/index.html b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/index.html index a91b263..27f82ce 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/index.html +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/index.html @@ -8,12 +8,20 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -38,9 +46,6 @@ - @@ -55,6 +60,12 @@ + + @@ -70,10 +81,10 @@ Reactive @@ -87,24 +98,13 @@ Presentable - - - @@ -148,9 +148,9 @@

    About

    You will find a very detail explanation of the whole project on my blog:

    The Jazzy documentation can be seen here as well: Documentation

    @@ -272,7 +272,7 @@

    How to declare } -

    The idea is to keep the Steps navigation independent as much as possible. For instance, calling a Step showMovieDetail(withId: Int) might be a bad idea since it tighlty couples the fact of selecting a movie with the consequence of showing the movie detail screen. It is not up to the emitter of the Step to decide where to navigate, this decision belongs to the Flow.

    +

    The idea is to keep the Steps navigation independent as much as possible. For instance, calling a Step showMovieDetail(withId: Int) might be a bad idea since it tightly couples the fact of selecting a movie with the consequence of showing the movie detail screen. It is not up to the emitter of the Step to decide where to navigate, this decision belongs to the Flow.

    How to declare a Flow

    The following Flow is used as a Navigation stack. All you have to do is:

    @@ -347,6 +347,18 @@

    How to declare a } } + + +

    From the AppDelegate you can reach the FlowCoordinator and call the navigate(to:) function when receiving a notification for instance.

    + +

    The step passed to the function will then be passed to all the existing Flows so you can adapt the navigation.

    +
    func userNotificationCenter(_ center: UNUserNotificationCenter,
    +                            didReceive response: UNNotificationResponse,
    +                            withCompletionHandler completionHandler: @escaping () -> Void) {
    +    // example of how DeepLink can be handled
    +    self.coordinator.navigate(to: DemoStep.movieIsPicked(withId: 23452))
    +}
    +

    How to adapt a Step before it triggers a navigation ?

    A Flow has a adapt(step:) -> Single<Step> function that by default returns the step it has been given @@ -405,17 +417,25 @@

    Is it possi

    Of course, it is the aim of a Coordinator. Inside a Flow we can present UIViewControllers and also new Flows. The function Flows.whenReady() allows to be triggered when the new Flow is ready to be displayed and gives us back its root Presentable.

    For instance, from the WishlistFlow, we launch the SettingsFlow in a popup.

    -
        private func navigateToSettings() -> FlowContributors {
    -        let settingsStepper = SettingsStepper()
    -        let settingsFlow = SettingsFlow(withServices: self.services, andStepper: settingsStepper)
    +
    private func navigateToSettings() -> FlowContributors {
    +    let settingsStepper = SettingsStepper()
    +    let settingsFlow = SettingsFlow(withServices: self.services, andStepper: settingsStepper)
     
    -        Flows.whenReady(flow1: settingsFlow) { [unowned self] (root: UISplitViewController) in
    -            self.rootViewController.present(root, animated: true)
    -        }
    -        return .one(flowContributor: .contribute(withNextPresentable: settingsFlow, withNextStepper: settingsStepper))
    +    Flows.use(settingsFlow, when: .ready) { [unowned self] root in
    +        self.rootViewController.present(root, animated: true)
    +    }
    +
    +    return .one(flowContributor: .contribute(withNextPresentable: settingsFlow, withNextStepper: settingsStepper))
         }
     
    +

    The Flows.use(when:) takes an ExecuteStrategy as a second parameter. It has two possible values:

    + +
      +
    • .created: The completion block will be executed instantly
    • +
    • .ready: The completion block will be executed once the sub flows (SettingsFlow in the example) have emitted a first step
    • +
    +

    For more complex cases, see the DashboardFlow.swift and the SettingsFlow.swift files in which we handle a UITabBarController and a UISplitViewController.

    How to bootstrap the RxFlow process

    @@ -476,8 +496,8 @@

    Tools and dependencies

    diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/jazzy.js b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/jazzy.js index c31dc05..1e55d6e 100755 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/jazzy.js +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/jazzy.js @@ -23,7 +23,7 @@ function openCurrentItemIfClosed() { if (window.jazzy.docset) { return; } - var $link = $(`.token[href="${location.hash}"]`); + var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); $content = itemLinkToContent($link); if ($content.is(':hidden')) { toggleItem($link, $content); @@ -57,3 +57,14 @@ $("a:not('.token')").on('click', function() { openCurrentItemIfClosed(); } }); + +// KaTeX rendering +if ("katex" in window) { + $($('.math').each( (_, element) => { + katex.render(element.textContent, element, { + displayMode: $(element).hasClass('m-block'), + throwOnError: false, + trust: true + }); + })) +} diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/jazzy.search.js b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/jazzy.search.js new file mode 100644 index 0000000..e3d1ab9 --- /dev/null +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/jazzy.search.js @@ -0,0 +1,70 @@ +$(function(){ + var $typeahead = $('[data-typeahead]'); + var $form = $typeahead.parents('form'); + var searchURL = $form.attr('action'); + + function displayTemplate(result) { + return result.name; + } + + function suggestionTemplate(result) { + var t = '
    '; + t += '' + result.name + ''; + if (result.parent_name) { + t += '' + result.parent_name + ''; + } + t += '
    '; + return t; + } + + $typeahead.one('focus', function() { + $form.addClass('loading'); + + $.getJSON(searchURL).then(function(searchData) { + const searchIndex = lunr(function() { + this.ref('url'); + this.field('name'); + this.field('abstract'); + for (const [url, doc] of Object.entries(searchData)) { + this.add({url: url, name: doc.name, abstract: doc.abstract}); + } + }); + + $typeahead.typeahead( + { + highlight: true, + minLength: 3, + autoselect: true + }, + { + limit: 10, + display: displayTemplate, + templates: { suggestion: suggestionTemplate }, + source: function(query, sync) { + const lcSearch = query.toLowerCase(); + const results = searchIndex.query(function(q) { + q.term(lcSearch, { boost: 100 }); + q.term(lcSearch, { + boost: 10, + wildcard: lunr.Query.wildcard.TRAILING + }); + }).map(function(result) { + var doc = searchData[result.ref]; + doc.url = result.ref; + return doc; + }); + sync(results); + } + } + ); + $form.removeClass('loading'); + $typeahead.trigger('focus'); + }); + }); + + var baseURL = searchURL.slice(0, -"search.json".length); + + $typeahead.on('typeahead:select', function(e, result) { + window.location = baseURL + result.url; + }); +}); diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/jquery.min.js b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/jquery.min.js index a1c07fd..b061403 100755 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/jquery.min.js +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/jquery.min.js @@ -1,2 +1,2 @@ -/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
    ",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
    ",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 00){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}(); diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/typeahead.jquery.js b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/typeahead.jquery.js new file mode 100644 index 0000000..3a2d2ab --- /dev/null +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/js/typeahead.jquery.js @@ -0,0 +1,1694 @@ +/*! + * typeahead.js 1.3.1 + * https://github.com/corejavascript/typeahead.js + * Copyright 2013-2020 Twitter, Inc. and other contributors; Licensed MIT + */ + + +(function(root, factory) { + if (typeof define === "function" && define.amd) { + define([ "jquery" ], function(a0) { + return factory(a0); + }); + } else if (typeof module === "object" && module.exports) { + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +})(this, function($) { + var _ = function() { + "use strict"; + return { + isMsie: function() { + return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false; + }, + isBlankString: function(str) { + return !str || /^\s*$/.test(str); + }, + escapeRegExChars: function(str) { + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + }, + isString: function(obj) { + return typeof obj === "string"; + }, + isNumber: function(obj) { + return typeof obj === "number"; + }, + isArray: $.isArray, + isFunction: $.isFunction, + isObject: $.isPlainObject, + isUndefined: function(obj) { + return typeof obj === "undefined"; + }, + isElement: function(obj) { + return !!(obj && obj.nodeType === 1); + }, + isJQuery: function(obj) { + return obj instanceof $; + }, + toStr: function toStr(s) { + return _.isUndefined(s) || s === null ? "" : s + ""; + }, + bind: $.proxy, + each: function(collection, cb) { + $.each(collection, reverseArgs); + function reverseArgs(index, value) { + return cb(value, index); + } + }, + map: $.map, + filter: $.grep, + every: function(obj, test) { + var result = true; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (!(result = test.call(null, val, key, obj))) { + return false; + } + }); + return !!result; + }, + some: function(obj, test) { + var result = false; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (result = test.call(null, val, key, obj)) { + return false; + } + }); + return !!result; + }, + mixin: $.extend, + identity: function(x) { + return x; + }, + clone: function(obj) { + return $.extend(true, {}, obj); + }, + getIdGenerator: function() { + var counter = 0; + return function() { + return counter++; + }; + }, + templatify: function templatify(obj) { + return $.isFunction(obj) ? obj : template; + function template() { + return String(obj); + } + }, + defer: function(fn) { + setTimeout(fn, 0); + }, + debounce: function(func, wait, immediate) { + var timeout, result; + return function() { + var context = this, args = arguments, later, callNow; + later = function() { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + } + }; + callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + } + return result; + }; + }, + throttle: function(func, wait) { + var context, args, timeout, result, previous, later; + previous = 0; + later = function() { + previous = new Date(); + timeout = null; + result = func.apply(context, args); + }; + return function() { + var now = new Date(), remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + } else if (!timeout) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }, + stringify: function(val) { + return _.isString(val) ? val : JSON.stringify(val); + }, + guid: function() { + function _p8(s) { + var p = (Math.random().toString(16) + "000000000").substr(2, 8); + return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p; + } + return "tt-" + _p8() + _p8(true) + _p8(true) + _p8(); + }, + noop: function() {} + }; + }(); + var WWW = function() { + "use strict"; + var defaultClassNames = { + wrapper: "twitter-typeahead", + input: "tt-input", + hint: "tt-hint", + menu: "tt-menu", + dataset: "tt-dataset", + suggestion: "tt-suggestion", + selectable: "tt-selectable", + empty: "tt-empty", + open: "tt-open", + cursor: "tt-cursor", + highlight: "tt-highlight" + }; + return build; + function build(o) { + var www, classes; + classes = _.mixin({}, defaultClassNames, o); + www = { + css: buildCss(), + classes: classes, + html: buildHtml(classes), + selectors: buildSelectors(classes) + }; + return { + css: www.css, + html: www.html, + classes: www.classes, + selectors: www.selectors, + mixin: function(o) { + _.mixin(o, www); + } + }; + } + function buildHtml(c) { + return { + wrapper: '', + menu: '
    ' + }; + } + function buildSelectors(classes) { + var selectors = {}; + _.each(classes, function(v, k) { + selectors[k] = "." + v; + }); + return selectors; + } + function buildCss() { + var css = { + wrapper: { + position: "relative", + display: "inline-block" + }, + hint: { + position: "absolute", + top: "0", + left: "0", + borderColor: "transparent", + boxShadow: "none", + opacity: "1" + }, + input: { + position: "relative", + verticalAlign: "top", + backgroundColor: "transparent" + }, + inputWithNoHint: { + position: "relative", + verticalAlign: "top" + }, + menu: { + position: "absolute", + top: "100%", + left: "0", + zIndex: "100", + display: "none" + }, + ltr: { + left: "0", + right: "auto" + }, + rtl: { + left: "auto", + right: " 0" + } + }; + if (_.isMsie()) { + _.mixin(css.input, { + backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)" + }); + } + return css; + } + }(); + var EventBus = function() { + "use strict"; + var namespace, deprecationMap; + namespace = "typeahead:"; + deprecationMap = { + render: "rendered", + cursorchange: "cursorchanged", + select: "selected", + autocomplete: "autocompleted" + }; + function EventBus(o) { + if (!o || !o.el) { + $.error("EventBus initialized without el"); + } + this.$el = $(o.el); + } + _.mixin(EventBus.prototype, { + _trigger: function(type, args) { + var $e = $.Event(namespace + type); + this.$el.trigger.call(this.$el, $e, args || []); + return $e; + }, + before: function(type) { + var args, $e; + args = [].slice.call(arguments, 1); + $e = this._trigger("before" + type, args); + return $e.isDefaultPrevented(); + }, + trigger: function(type) { + var deprecatedType; + this._trigger(type, [].slice.call(arguments, 1)); + if (deprecatedType = deprecationMap[type]) { + this._trigger(deprecatedType, [].slice.call(arguments, 1)); + } + } + }); + return EventBus; + }(); + var EventEmitter = function() { + "use strict"; + var splitter = /\s+/, nextTick = getNextTick(); + return { + onSync: onSync, + onAsync: onAsync, + off: off, + trigger: trigger + }; + function on(method, types, cb, context) { + var type; + if (!cb) { + return this; + } + types = types.split(splitter); + cb = context ? bindContext(cb, context) : cb; + this._callbacks = this._callbacks || {}; + while (type = types.shift()) { + this._callbacks[type] = this._callbacks[type] || { + sync: [], + async: [] + }; + this._callbacks[type][method].push(cb); + } + return this; + } + function onAsync(types, cb, context) { + return on.call(this, "async", types, cb, context); + } + function onSync(types, cb, context) { + return on.call(this, "sync", types, cb, context); + } + function off(types) { + var type; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + while (type = types.shift()) { + delete this._callbacks[type]; + } + return this; + } + function trigger(types) { + var type, callbacks, args, syncFlush, asyncFlush; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + args = [].slice.call(arguments, 1); + while ((type = types.shift()) && (callbacks = this._callbacks[type])) { + syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args)); + asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args)); + syncFlush() && nextTick(asyncFlush); + } + return this; + } + function getFlush(callbacks, context, args) { + return flush; + function flush() { + var cancelled; + for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) { + cancelled = callbacks[i].apply(context, args) === false; + } + return !cancelled; + } + } + function getNextTick() { + var nextTickFn; + if (window.setImmediate) { + nextTickFn = function nextTickSetImmediate(fn) { + setImmediate(function() { + fn(); + }); + }; + } else { + nextTickFn = function nextTickSetTimeout(fn) { + setTimeout(function() { + fn(); + }, 0); + }; + } + return nextTickFn; + } + function bindContext(fn, context) { + return fn.bind ? fn.bind(context) : function() { + fn.apply(context, [].slice.call(arguments, 0)); + }; + } + }(); + var highlight = function(doc) { + "use strict"; + var defaults = { + node: null, + pattern: null, + tagName: "strong", + className: null, + wordsOnly: false, + caseSensitive: false, + diacriticInsensitive: false + }; + var accented = { + A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]", + B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]", + C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]", + D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]", + E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]", + F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]", + G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]", + H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]", + I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]", + J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]", + K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]", + L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]", + M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]", + N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]", + O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]", + P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]", + Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]", + R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]", + S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]", + T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]", + U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]", + V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]", + W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]", + X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]", + Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]", + Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]" + }; + return function hightlight(o) { + var regex; + o = _.mixin({}, defaults, o); + if (!o.node || !o.pattern) { + return; + } + o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ]; + regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive); + traverse(o.node, hightlightTextNode); + function hightlightTextNode(textNode) { + var match, patternNode, wrapperNode; + if (match = regex.exec(textNode.data)) { + wrapperNode = doc.createElement(o.tagName); + o.className && (wrapperNode.className = o.className); + patternNode = textNode.splitText(match.index); + patternNode.splitText(match[0].length); + wrapperNode.appendChild(patternNode.cloneNode(true)); + textNode.parentNode.replaceChild(wrapperNode, patternNode); + } + return !!match; + } + function traverse(el, hightlightTextNode) { + var childNode, TEXT_NODE_TYPE = 3; + for (var i = 0; i < el.childNodes.length; i++) { + childNode = el.childNodes[i]; + if (childNode.nodeType === TEXT_NODE_TYPE) { + i += hightlightTextNode(childNode) ? 1 : 0; + } else { + traverse(childNode, hightlightTextNode); + } + } + } + }; + function accent_replacer(chr) { + return accented[chr.toUpperCase()] || chr; + } + function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) { + var escapedPatterns = [], regexStr; + for (var i = 0, len = patterns.length; i < len; i++) { + var escapedWord = _.escapeRegExChars(patterns[i]); + if (diacriticInsensitive) { + escapedWord = escapedWord.replace(/\S/g, accent_replacer); + } + escapedPatterns.push(escapedWord); + } + regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")"; + return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i"); + } + }(window.document); + var Input = function() { + "use strict"; + var specialKeyCodeMap; + specialKeyCodeMap = { + 9: "tab", + 27: "esc", + 37: "left", + 39: "right", + 13: "enter", + 38: "up", + 40: "down" + }; + function Input(o, www) { + var id; + o = o || {}; + if (!o.input) { + $.error("input is missing"); + } + www.mixin(this); + this.$hint = $(o.hint); + this.$input = $(o.input); + this.$menu = $(o.menu); + id = this.$input.attr("id") || _.guid(); + this.$menu.attr("id", id + "_listbox"); + this.$hint.attr({ + "aria-hidden": true + }); + this.$input.attr({ + "aria-owns": id + "_listbox", + role: "combobox", + "aria-autocomplete": "list", + "aria-expanded": false + }); + this.query = this.$input.val(); + this.queryWhenFocused = this.hasFocus() ? this.query : null; + this.$overflowHelper = buildOverflowHelper(this.$input); + this._checkLanguageDirection(); + if (this.$hint.length === 0) { + this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop; + } + this.onSync("cursorchange", this._updateDescendent); + } + Input.normalizeQuery = function(str) { + return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " "); + }; + _.mixin(Input.prototype, EventEmitter, { + _onBlur: function onBlur() { + this.resetInputValue(); + this.trigger("blurred"); + }, + _onFocus: function onFocus() { + this.queryWhenFocused = this.query; + this.trigger("focused"); + }, + _onKeydown: function onKeydown($e) { + var keyName = specialKeyCodeMap[$e.which || $e.keyCode]; + this._managePreventDefault(keyName, $e); + if (keyName && this._shouldTrigger(keyName, $e)) { + this.trigger(keyName + "Keyed", $e); + } + }, + _onInput: function onInput() { + this._setQuery(this.getInputValue()); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + _managePreventDefault: function managePreventDefault(keyName, $e) { + var preventDefault; + switch (keyName) { + case "up": + case "down": + preventDefault = !withModifier($e); + break; + + default: + preventDefault = false; + } + preventDefault && $e.preventDefault(); + }, + _shouldTrigger: function shouldTrigger(keyName, $e) { + var trigger; + switch (keyName) { + case "tab": + trigger = !withModifier($e); + break; + + default: + trigger = true; + } + return trigger; + }, + _checkLanguageDirection: function checkLanguageDirection() { + var dir = (this.$input.css("direction") || "ltr").toLowerCase(); + if (this.dir !== dir) { + this.dir = dir; + this.$hint.attr("dir", dir); + this.trigger("langDirChanged", dir); + } + }, + _setQuery: function setQuery(val, silent) { + var areEquivalent, hasDifferentWhitespace; + areEquivalent = areQueriesEquivalent(val, this.query); + hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false; + this.query = val; + if (!silent && !areEquivalent) { + this.trigger("queryChanged", this.query); + } else if (!silent && hasDifferentWhitespace) { + this.trigger("whitespaceChanged", this.query); + } + }, + _updateDescendent: function updateDescendent(event, id) { + this.$input.attr("aria-activedescendant", id); + }, + bind: function() { + var that = this, onBlur, onFocus, onKeydown, onInput; + onBlur = _.bind(this._onBlur, this); + onFocus = _.bind(this._onFocus, this); + onKeydown = _.bind(this._onKeydown, this); + onInput = _.bind(this._onInput, this); + this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown); + if (!_.isMsie() || _.isMsie() > 9) { + this.$input.on("input.tt", onInput); + } else { + this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) { + if (specialKeyCodeMap[$e.which || $e.keyCode]) { + return; + } + _.defer(_.bind(that._onInput, that, $e)); + }); + } + return this; + }, + focus: function focus() { + this.$input.focus(); + }, + blur: function blur() { + this.$input.blur(); + }, + getLangDir: function getLangDir() { + return this.dir; + }, + getQuery: function getQuery() { + return this.query || ""; + }, + setQuery: function setQuery(val, silent) { + this.setInputValue(val); + this._setQuery(val, silent); + }, + hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() { + return this.query !== this.queryWhenFocused; + }, + getInputValue: function getInputValue() { + return this.$input.val(); + }, + setInputValue: function setInputValue(value) { + this.$input.val(value); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + resetInputValue: function resetInputValue() { + this.setInputValue(this.query); + }, + getHint: function getHint() { + return this.$hint.val(); + }, + setHint: function setHint(value) { + this.$hint.val(value); + }, + clearHint: function clearHint() { + this.setHint(""); + }, + clearHintIfInvalid: function clearHintIfInvalid() { + var val, hint, valIsPrefixOfHint, isValid; + val = this.getInputValue(); + hint = this.getHint(); + valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0; + isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow(); + !isValid && this.clearHint(); + }, + hasFocus: function hasFocus() { + return this.$input.is(":focus"); + }, + hasOverflow: function hasOverflow() { + var constraint = this.$input.width() - 2; + this.$overflowHelper.text(this.getInputValue()); + return this.$overflowHelper.width() >= constraint; + }, + isCursorAtEnd: function() { + var valueLength, selectionStart, range; + valueLength = this.$input.val().length; + selectionStart = this.$input[0].selectionStart; + if (_.isNumber(selectionStart)) { + return selectionStart === valueLength; + } else if (document.selection) { + range = document.selection.createRange(); + range.moveStart("character", -valueLength); + return valueLength === range.text.length; + } + return true; + }, + destroy: function destroy() { + this.$hint.off(".tt"); + this.$input.off(".tt"); + this.$overflowHelper.remove(); + this.$hint = this.$input = this.$overflowHelper = $("
    "); + }, + setAriaExpanded: function setAriaExpanded(value) { + this.$input.attr("aria-expanded", value); + } + }); + return Input; + function buildOverflowHelper($input) { + return $('').css({ + position: "absolute", + visibility: "hidden", + whiteSpace: "pre", + fontFamily: $input.css("font-family"), + fontSize: $input.css("font-size"), + fontStyle: $input.css("font-style"), + fontVariant: $input.css("font-variant"), + fontWeight: $input.css("font-weight"), + wordSpacing: $input.css("word-spacing"), + letterSpacing: $input.css("letter-spacing"), + textIndent: $input.css("text-indent"), + textRendering: $input.css("text-rendering"), + textTransform: $input.css("text-transform") + }).insertAfter($input); + } + function areQueriesEquivalent(a, b) { + return Input.normalizeQuery(a) === Input.normalizeQuery(b); + } + function withModifier($e) { + return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey; + } + }(); + var Dataset = function() { + "use strict"; + var keys, nameGenerator; + keys = { + dataset: "tt-selectable-dataset", + val: "tt-selectable-display", + obj: "tt-selectable-object" + }; + nameGenerator = _.getIdGenerator(); + function Dataset(o, www) { + o = o || {}; + o.templates = o.templates || {}; + o.templates.notFound = o.templates.notFound || o.templates.empty; + if (!o.source) { + $.error("missing source"); + } + if (!o.node) { + $.error("missing node"); + } + if (o.name && !isValidName(o.name)) { + $.error("invalid dataset name: " + o.name); + } + www.mixin(this); + this.highlight = !!o.highlight; + this.name = _.toStr(o.name || nameGenerator()); + this.limit = o.limit || 5; + this.displayFn = getDisplayFn(o.display || o.displayKey); + this.templates = getTemplates(o.templates, this.displayFn); + this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source; + this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async; + this._resetLastSuggestion(); + this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name); + } + Dataset.extractData = function extractData(el) { + var $el = $(el); + if ($el.data(keys.obj)) { + return { + dataset: $el.data(keys.dataset) || "", + val: $el.data(keys.val) || "", + obj: $el.data(keys.obj) || null + }; + } + return null; + }; + _.mixin(Dataset.prototype, EventEmitter, { + _overwrite: function overwrite(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (this.async && this.templates.pending) { + this._renderPending(query); + } else if (!this.async && this.templates.notFound) { + this._renderNotFound(query); + } else { + this._empty(); + } + this.trigger("rendered", suggestions, false, this.name); + }, + _append: function append(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length && this.$lastSuggestion.length) { + this._appendSuggestions(query, suggestions); + } else if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (!this.$lastSuggestion.length && this.templates.notFound) { + this._renderNotFound(query); + } + this.trigger("rendered", suggestions, true, this.name); + }, + _renderSuggestions: function renderSuggestions(query, suggestions) { + var $fragment; + $fragment = this._getSuggestionsFragment(query, suggestions); + this.$lastSuggestion = $fragment.children().last(); + this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions)); + }, + _appendSuggestions: function appendSuggestions(query, suggestions) { + var $fragment, $lastSuggestion; + $fragment = this._getSuggestionsFragment(query, suggestions); + $lastSuggestion = $fragment.children().last(); + this.$lastSuggestion.after($fragment); + this.$lastSuggestion = $lastSuggestion; + }, + _renderPending: function renderPending(query) { + var template = this.templates.pending; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _renderNotFound: function renderNotFound(query) { + var template = this.templates.notFound; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _empty: function empty() { + this.$el.empty(); + this._resetLastSuggestion(); + }, + _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) { + var that = this, fragment; + fragment = document.createDocumentFragment(); + _.each(suggestions, function getSuggestionNode(suggestion) { + var $el, context; + context = that._injectQuery(query, suggestion); + $el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable); + fragment.appendChild($el[0]); + }); + this.highlight && highlight({ + className: this.classes.highlight, + node: fragment, + pattern: query + }); + return $(fragment); + }, + _getFooter: function getFooter(query, suggestions) { + return this.templates.footer ? this.templates.footer({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _getHeader: function getHeader(query, suggestions) { + return this.templates.header ? this.templates.header({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _resetLastSuggestion: function resetLastSuggestion() { + this.$lastSuggestion = $(); + }, + _injectQuery: function injectQuery(query, obj) { + return _.isObject(obj) ? _.mixin({ + _query: query + }, obj) : obj; + }, + update: function update(query) { + var that = this, canceled = false, syncCalled = false, rendered = 0; + this.cancel(); + this.cancel = function cancel() { + canceled = true; + that.cancel = $.noop; + that.async && that.trigger("asyncCanceled", query, that.name); + }; + this.source(query, sync, async); + !syncCalled && sync([]); + function sync(suggestions) { + if (syncCalled) { + return; + } + syncCalled = true; + suggestions = (suggestions || []).slice(0, that.limit); + rendered = suggestions.length; + that._overwrite(query, suggestions); + if (rendered < that.limit && that.async) { + that.trigger("asyncRequested", query, that.name); + } + } + function async(suggestions) { + suggestions = suggestions || []; + if (!canceled && rendered < that.limit) { + that.cancel = $.noop; + var idx = Math.abs(rendered - that.limit); + rendered += idx; + that._append(query, suggestions.slice(0, idx)); + that.async && that.trigger("asyncReceived", query, that.name); + } + } + }, + cancel: $.noop, + clear: function clear() { + this._empty(); + this.cancel(); + this.trigger("cleared"); + }, + isEmpty: function isEmpty() { + return this.$el.is(":empty"); + }, + destroy: function destroy() { + this.$el = $("
    "); + } + }); + return Dataset; + function getDisplayFn(display) { + display = display || _.stringify; + return _.isFunction(display) ? display : displayFn; + function displayFn(obj) { + return obj[display]; + } + } + function getTemplates(templates, displayFn) { + return { + notFound: templates.notFound && _.templatify(templates.notFound), + pending: templates.pending && _.templatify(templates.pending), + header: templates.header && _.templatify(templates.header), + footer: templates.footer && _.templatify(templates.footer), + suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate + }; + function userSuggestionTemplate(context) { + var template = templates.suggestion; + return $(template(context)).attr("id", _.guid()); + } + function suggestionTemplate(context) { + return $('
    ').attr("id", _.guid()).text(displayFn(context)); + } + } + function isValidName(str) { + return /^[_a-zA-Z0-9-]+$/.test(str); + } + }(); + var Menu = function() { + "use strict"; + function Menu(o, www) { + var that = this; + o = o || {}; + if (!o.node) { + $.error("node is required"); + } + www.mixin(this); + this.$node = $(o.node); + this.query = null; + this.datasets = _.map(o.datasets, initializeDataset); + function initializeDataset(oDataset) { + var node = that.$node.find(oDataset.node).first(); + oDataset.node = node.length ? node : $("
    ").appendTo(that.$node); + return new Dataset(oDataset, www); + } + } + _.mixin(Menu.prototype, EventEmitter, { + _onSelectableClick: function onSelectableClick($e) { + this.trigger("selectableClicked", $($e.currentTarget)); + }, + _onRendered: function onRendered(type, dataset, suggestions, async) { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetRendered", dataset, suggestions, async); + }, + _onCleared: function onCleared() { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetCleared"); + }, + _propagate: function propagate() { + this.trigger.apply(this, arguments); + }, + _allDatasetsEmpty: function allDatasetsEmpty() { + return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) { + var isEmpty = dataset.isEmpty(); + this.$node.attr("aria-expanded", !isEmpty); + return isEmpty; + }, this)); + }, + _getSelectables: function getSelectables() { + return this.$node.find(this.selectors.selectable); + }, + _removeCursor: function _removeCursor() { + var $selectable = this.getActiveSelectable(); + $selectable && $selectable.removeClass(this.classes.cursor); + }, + _ensureVisible: function ensureVisible($el) { + var elTop, elBottom, nodeScrollTop, nodeHeight; + elTop = $el.position().top; + elBottom = elTop + $el.outerHeight(true); + nodeScrollTop = this.$node.scrollTop(); + nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10); + if (elTop < 0) { + this.$node.scrollTop(nodeScrollTop + elTop); + } else if (nodeHeight < elBottom) { + this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight)); + } + }, + bind: function() { + var that = this, onSelectableClick; + onSelectableClick = _.bind(this._onSelectableClick, this); + this.$node.on("click.tt", this.selectors.selectable, onSelectableClick); + this.$node.on("mouseover", this.selectors.selectable, function() { + that.setCursor($(this)); + }); + this.$node.on("mouseleave", function() { + that._removeCursor(); + }); + _.each(this.datasets, function(dataset) { + dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that); + }); + return this; + }, + isOpen: function isOpen() { + return this.$node.hasClass(this.classes.open); + }, + open: function open() { + this.$node.scrollTop(0); + this.$node.addClass(this.classes.open); + }, + close: function close() { + this.$node.attr("aria-expanded", false); + this.$node.removeClass(this.classes.open); + this._removeCursor(); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.attr("dir", dir); + }, + selectableRelativeToCursor: function selectableRelativeToCursor(delta) { + var $selectables, $oldCursor, oldIndex, newIndex; + $oldCursor = this.getActiveSelectable(); + $selectables = this._getSelectables(); + oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1; + newIndex = oldIndex + delta; + newIndex = (newIndex + 1) % ($selectables.length + 1) - 1; + newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex; + return newIndex === -1 ? null : $selectables.eq(newIndex); + }, + setCursor: function setCursor($selectable) { + this._removeCursor(); + if ($selectable = $selectable && $selectable.first()) { + $selectable.addClass(this.classes.cursor); + this._ensureVisible($selectable); + } + }, + getSelectableData: function getSelectableData($el) { + return $el && $el.length ? Dataset.extractData($el) : null; + }, + getActiveSelectable: function getActiveSelectable() { + var $selectable = this._getSelectables().filter(this.selectors.cursor).first(); + return $selectable.length ? $selectable : null; + }, + getTopSelectable: function getTopSelectable() { + var $selectable = this._getSelectables().first(); + return $selectable.length ? $selectable : null; + }, + update: function update(query) { + var isValidUpdate = query !== this.query; + if (isValidUpdate) { + this.query = query; + _.each(this.datasets, updateDataset); + } + return isValidUpdate; + function updateDataset(dataset) { + dataset.update(query); + } + }, + empty: function empty() { + _.each(this.datasets, clearDataset); + this.query = null; + this.$node.addClass(this.classes.empty); + function clearDataset(dataset) { + dataset.clear(); + } + }, + destroy: function destroy() { + this.$node.off(".tt"); + this.$node = $("
    "); + _.each(this.datasets, destroyDataset); + function destroyDataset(dataset) { + dataset.destroy(); + } + } + }); + return Menu; + }(); + var Status = function() { + "use strict"; + function Status(options) { + this.$el = $("", { + role: "status", + "aria-live": "polite" + }).css({ + position: "absolute", + padding: "0", + border: "0", + height: "1px", + width: "1px", + "margin-bottom": "-1px", + "margin-right": "-1px", + overflow: "hidden", + clip: "rect(0 0 0 0)", + "white-space": "nowrap" + }); + options.$input.after(this.$el); + _.each(options.menu.datasets, _.bind(function(dataset) { + if (dataset.onSync) { + dataset.onSync("rendered", _.bind(this.update, this)); + dataset.onSync("cleared", _.bind(this.cleared, this)); + } + }, this)); + } + _.mixin(Status.prototype, { + update: function update(event, suggestions) { + var length = suggestions.length; + var words; + if (length === 1) { + words = { + result: "result", + is: "is" + }; + } else { + words = { + result: "results", + is: "are" + }; + } + this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate."); + }, + cleared: function() { + this.$el.text(""); + } + }); + return Status; + }(); + var DefaultMenu = function() { + "use strict"; + var s = Menu.prototype; + function DefaultMenu() { + Menu.apply(this, [].slice.call(arguments, 0)); + } + _.mixin(DefaultMenu.prototype, Menu.prototype, { + open: function open() { + !this._allDatasetsEmpty() && this._show(); + return s.open.apply(this, [].slice.call(arguments, 0)); + }, + close: function close() { + this._hide(); + return s.close.apply(this, [].slice.call(arguments, 0)); + }, + _onRendered: function onRendered() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onRendered.apply(this, [].slice.call(arguments, 0)); + }, + _onCleared: function onCleared() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onCleared.apply(this, [].slice.call(arguments, 0)); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl); + return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0)); + }, + _hide: function hide() { + this.$node.hide(); + }, + _show: function show() { + this.$node.css("display", "block"); + } + }); + return DefaultMenu; + }(); + var Typeahead = function() { + "use strict"; + function Typeahead(o, www) { + var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged; + o = o || {}; + if (!o.input) { + $.error("missing input"); + } + if (!o.menu) { + $.error("missing menu"); + } + if (!o.eventBus) { + $.error("missing event bus"); + } + www.mixin(this); + this.eventBus = o.eventBus; + this.minLength = _.isNumber(o.minLength) ? o.minLength : 1; + this.input = o.input; + this.menu = o.menu; + this.enabled = true; + this.autoselect = !!o.autoselect; + this.active = false; + this.input.hasFocus() && this.activate(); + this.dir = this.input.getLangDir(); + this._hacks(); + this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this); + onFocused = c(this, "activate", "open", "_onFocused"); + onBlurred = c(this, "deactivate", "_onBlurred"); + onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed"); + onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed"); + onEscKeyed = c(this, "isActive", "_onEscKeyed"); + onUpKeyed = c(this, "isActive", "open", "_onUpKeyed"); + onDownKeyed = c(this, "isActive", "open", "_onDownKeyed"); + onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed"); + onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed"); + onQueryChanged = c(this, "_openIfActive", "_onQueryChanged"); + onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged"); + this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this); + } + _.mixin(Typeahead.prototype, { + _hacks: function hacks() { + var $input, $menu; + $input = this.input.$input || $("
    "); + $menu = this.menu.$node || $("
    "); + $input.on("blur.tt", function($e) { + var active, isActive, hasActive; + active = document.activeElement; + isActive = $menu.is(active); + hasActive = $menu.has(active).length > 0; + if (_.isMsie() && (isActive || hasActive)) { + $e.preventDefault(); + $e.stopImmediatePropagation(); + _.defer(function() { + $input.focus(); + }); + } + }); + $menu.on("mousedown.tt", function($e) { + $e.preventDefault(); + }); + }, + _onSelectableClicked: function onSelectableClicked(type, $el) { + this.select($el); + }, + _onDatasetCleared: function onDatasetCleared() { + this._updateHint(); + }, + _onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) { + this._updateHint(); + if (this.autoselect) { + var cursorClass = this.selectors.cursor.substr(1); + this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass); + } + this.eventBus.trigger("render", suggestions, async, dataset); + }, + _onAsyncRequested: function onAsyncRequested(type, dataset, query) { + this.eventBus.trigger("asyncrequest", query, dataset); + }, + _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) { + this.eventBus.trigger("asynccancel", query, dataset); + }, + _onAsyncReceived: function onAsyncReceived(type, dataset, query) { + this.eventBus.trigger("asyncreceive", query, dataset); + }, + _onFocused: function onFocused() { + this._minLengthMet() && this.menu.update(this.input.getQuery()); + }, + _onBlurred: function onBlurred() { + if (this.input.hasQueryChangedSinceLastFocus()) { + this.eventBus.trigger("change", this.input.getQuery()); + } + }, + _onEnterKeyed: function onEnterKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + if (this.select($selectable)) { + $e.preventDefault(); + $e.stopPropagation(); + } + } else if (this.autoselect) { + if (this.select(this.menu.getTopSelectable())) { + $e.preventDefault(); + $e.stopPropagation(); + } + } + }, + _onTabKeyed: function onTabKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + this.select($selectable) && $e.preventDefault(); + } else if (this.autoselect) { + if ($selectable = this.menu.getTopSelectable()) { + this.autocomplete($selectable) && $e.preventDefault(); + } + } + }, + _onEscKeyed: function onEscKeyed() { + this.close(); + }, + _onUpKeyed: function onUpKeyed() { + this.moveCursor(-1); + }, + _onDownKeyed: function onDownKeyed() { + this.moveCursor(+1); + }, + _onLeftKeyed: function onLeftKeyed() { + if (this.dir === "rtl" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onRightKeyed: function onRightKeyed() { + if (this.dir === "ltr" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onQueryChanged: function onQueryChanged(e, query) { + this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty(); + }, + _onWhitespaceChanged: function onWhitespaceChanged() { + this._updateHint(); + }, + _onLangDirChanged: function onLangDirChanged(e, dir) { + if (this.dir !== dir) { + this.dir = dir; + this.menu.setLanguageDirection(dir); + } + }, + _openIfActive: function openIfActive() { + this.isActive() && this.open(); + }, + _minLengthMet: function minLengthMet(query) { + query = _.isString(query) ? query : this.input.getQuery() || ""; + return query.length >= this.minLength; + }, + _updateHint: function updateHint() { + var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match; + $selectable = this.menu.getTopSelectable(); + data = this.menu.getSelectableData($selectable); + val = this.input.getInputValue(); + if (data && !_.isBlankString(val) && !this.input.hasOverflow()) { + query = Input.normalizeQuery(val); + escapedQuery = _.escapeRegExChars(query); + frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i"); + match = frontMatchRegEx.exec(data.val); + match && this.input.setHint(val + match[1]); + } else { + this.input.clearHint(); + } + }, + isEnabled: function isEnabled() { + return this.enabled; + }, + enable: function enable() { + this.enabled = true; + }, + disable: function disable() { + this.enabled = false; + }, + isActive: function isActive() { + return this.active; + }, + activate: function activate() { + if (this.isActive()) { + return true; + } else if (!this.isEnabled() || this.eventBus.before("active")) { + return false; + } else { + this.active = true; + this.eventBus.trigger("active"); + return true; + } + }, + deactivate: function deactivate() { + if (!this.isActive()) { + return true; + } else if (this.eventBus.before("idle")) { + return false; + } else { + this.active = false; + this.close(); + this.eventBus.trigger("idle"); + return true; + } + }, + isOpen: function isOpen() { + return this.menu.isOpen(); + }, + open: function open() { + if (!this.isOpen() && !this.eventBus.before("open")) { + this.input.setAriaExpanded(true); + this.menu.open(); + this._updateHint(); + this.eventBus.trigger("open"); + } + return this.isOpen(); + }, + close: function close() { + if (this.isOpen() && !this.eventBus.before("close")) { + this.input.setAriaExpanded(false); + this.menu.close(); + this.input.clearHint(); + this.input.resetInputValue(); + this.eventBus.trigger("close"); + } + return !this.isOpen(); + }, + setVal: function setVal(val) { + this.input.setQuery(_.toStr(val)); + }, + getVal: function getVal() { + return this.input.getQuery(); + }, + select: function select($selectable) { + var data = this.menu.getSelectableData($selectable); + if (data && !this.eventBus.before("select", data.obj, data.dataset)) { + this.input.setQuery(data.val, true); + this.eventBus.trigger("select", data.obj, data.dataset); + this.close(); + return true; + } + return false; + }, + autocomplete: function autocomplete($selectable) { + var query, data, isValid; + query = this.input.getQuery(); + data = this.menu.getSelectableData($selectable); + isValid = data && query !== data.val; + if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) { + this.input.setQuery(data.val); + this.eventBus.trigger("autocomplete", data.obj, data.dataset); + return true; + } + return false; + }, + moveCursor: function moveCursor(delta) { + var query, $candidate, data, suggestion, datasetName, cancelMove, id; + query = this.input.getQuery(); + $candidate = this.menu.selectableRelativeToCursor(delta); + data = this.menu.getSelectableData($candidate); + suggestion = data ? data.obj : null; + datasetName = data ? data.dataset : null; + id = $candidate ? $candidate.attr("id") : null; + this.input.trigger("cursorchange", id); + cancelMove = this._minLengthMet() && this.menu.update(query); + if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) { + this.menu.setCursor($candidate); + if (data) { + if (typeof data.val === "string") { + this.input.setInputValue(data.val); + } + } else { + this.input.resetInputValue(); + this._updateHint(); + } + this.eventBus.trigger("cursorchange", suggestion, datasetName); + return true; + } + return false; + }, + destroy: function destroy() { + this.input.destroy(); + this.menu.destroy(); + } + }); + return Typeahead; + function c(ctx) { + var methods = [].slice.call(arguments, 1); + return function() { + var args = [].slice.call(arguments); + _.each(methods, function(method) { + return ctx[method].apply(ctx, args); + }); + }; + } + }(); + (function() { + "use strict"; + var old, keys, methods; + old = $.fn.typeahead; + keys = { + www: "tt-www", + attrs: "tt-attrs", + typeahead: "tt-typeahead" + }; + methods = { + initialize: function initialize(o, datasets) { + var www; + datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1); + o = o || {}; + www = WWW(o.classNames); + return this.each(attach); + function attach() { + var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor; + _.each(datasets, function(d) { + d.highlight = !!o.highlight; + }); + $input = $(this); + $wrapper = $(www.html.wrapper); + $hint = $elOrNull(o.hint); + $menu = $elOrNull(o.menu); + defaultHint = o.hint !== false && !$hint; + defaultMenu = o.menu !== false && !$menu; + defaultHint && ($hint = buildHintFromInput($input, www)); + defaultMenu && ($menu = $(www.html.menu).css(www.css.menu)); + $hint && $hint.val(""); + $input = prepInput($input, www); + if (defaultHint || defaultMenu) { + $wrapper.css(www.css.wrapper); + $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint); + $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null); + } + MenuConstructor = defaultMenu ? DefaultMenu : Menu; + eventBus = new EventBus({ + el: $input + }); + input = new Input({ + hint: $hint, + input: $input, + menu: $menu + }, www); + menu = new MenuConstructor({ + node: $menu, + datasets: datasets + }, www); + status = new Status({ + $input: $input, + menu: menu + }); + typeahead = new Typeahead({ + input: input, + menu: menu, + eventBus: eventBus, + minLength: o.minLength, + autoselect: o.autoselect + }, www); + $input.data(keys.www, www); + $input.data(keys.typeahead, typeahead); + } + }, + isEnabled: function isEnabled() { + var enabled; + ttEach(this.first(), function(t) { + enabled = t.isEnabled(); + }); + return enabled; + }, + enable: function enable() { + ttEach(this, function(t) { + t.enable(); + }); + return this; + }, + disable: function disable() { + ttEach(this, function(t) { + t.disable(); + }); + return this; + }, + isActive: function isActive() { + var active; + ttEach(this.first(), function(t) { + active = t.isActive(); + }); + return active; + }, + activate: function activate() { + ttEach(this, function(t) { + t.activate(); + }); + return this; + }, + deactivate: function deactivate() { + ttEach(this, function(t) { + t.deactivate(); + }); + return this; + }, + isOpen: function isOpen() { + var open; + ttEach(this.first(), function(t) { + open = t.isOpen(); + }); + return open; + }, + open: function open() { + ttEach(this, function(t) { + t.open(); + }); + return this; + }, + close: function close() { + ttEach(this, function(t) { + t.close(); + }); + return this; + }, + select: function select(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.select($el); + }); + return success; + }, + autocomplete: function autocomplete(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.autocomplete($el); + }); + return success; + }, + moveCursor: function moveCursoe(delta) { + var success = false; + ttEach(this.first(), function(t) { + success = t.moveCursor(delta); + }); + return success; + }, + val: function val(newVal) { + var query; + if (!arguments.length) { + ttEach(this.first(), function(t) { + query = t.getVal(); + }); + return query; + } else { + ttEach(this, function(t) { + t.setVal(_.toStr(newVal)); + }); + return this; + } + }, + destroy: function destroy() { + ttEach(this, function(typeahead, $input) { + revert($input); + typeahead.destroy(); + }); + return this; + } + }; + $.fn.typeahead = function(method) { + if (methods[method]) { + return methods[method].apply(this, [].slice.call(arguments, 1)); + } else { + return methods.initialize.apply(this, arguments); + } + }; + $.fn.typeahead.noConflict = function noConflict() { + $.fn.typeahead = old; + return this; + }; + function ttEach($els, fn) { + $els.each(function() { + var $input = $(this), typeahead; + (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input); + }); + } + function buildHintFromInput($input, www) { + return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({ + readonly: true, + required: false + }).removeAttr("id name placeholder").removeClass("required").attr({ + spellcheck: "false", + tabindex: -1 + }); + } + function prepInput($input, www) { + $input.data(keys.attrs, { + dir: $input.attr("dir"), + autocomplete: $input.attr("autocomplete"), + spellcheck: $input.attr("spellcheck"), + style: $input.attr("style") + }); + $input.addClass(www.classes.input).attr({ + spellcheck: false + }); + try { + !$input.attr("dir") && $input.attr("dir", "auto"); + } catch (e) {} + return $input; + } + function getBackgroundStyles($el) { + return { + backgroundAttachment: $el.css("background-attachment"), + backgroundClip: $el.css("background-clip"), + backgroundColor: $el.css("background-color"), + backgroundImage: $el.css("background-image"), + backgroundOrigin: $el.css("background-origin"), + backgroundPosition: $el.css("background-position"), + backgroundRepeat: $el.css("background-repeat"), + backgroundSize: $el.css("background-size") + }; + } + function revert($input) { + var www, $wrapper; + www = $input.data(keys.www); + $wrapper = $input.parent().filter(www.selectors.wrapper); + _.each($input.data(keys.attrs), function(val, key) { + _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val); + }); + $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input); + if ($wrapper.length) { + $input.detach().insertAfter($wrapper); + $wrapper.remove(); + } + } + function $elOrNull(obj) { + var isValid, $el; + isValid = _.isJQuery(obj) || _.isElement(obj); + $el = isValid ? $(obj).first() : []; + return $el.length ? $el : null; + } + })(); +}); \ No newline at end of file diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/search.json b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/search.json index 5493606..4e2520d 100644 --- a/docs/docsets/RxFlow.docset/Contents/Resources/Documents/search.json +++ b/docs/docsets/RxFlow.docset/Contents/Resources/Documents/search.json @@ -1 +1 @@ -{"Typealiases.html#/s:6RxFlow04NextB5Itemsa":{"name":"NextFlowItems","abstract":"

    typealias to allow compliance with older versions of RxFlow. NextFlowItems should be replaced by FlowContributors

    "},"Typealiases.html#/s:6RxFlow11Coordinatora":{"name":"Coordinator","abstract":"

    typealias to allow compliance with older versions of RxFlow. Coordinator should be replaced by FlowCoordinator

    "},"Protocols/Stepper.html#/s:6RxFlow7StepperP5steps0A5Relay07PublishE0CyAA4Step_pGvp":{"name":"steps","abstract":"

    the relay used to emit steps inside this Stepper

    ","parent_name":"Stepper"},"Protocols/Stepper.html#/s:6RxFlow7StepperP11initialStepAA0E0_pvp":{"name":"initialStep","abstract":"

    the initial step that will be emitted when listening to this Stepper

    ","parent_name":"Stepper"},"Protocols/Stepper.html#/s:6RxFlow7StepperP16readyToEmitStepsyyF":{"name":"readyToEmitSteps()","abstract":"

    function called when stepper is listened by the FlowCoordinator

    ","parent_name":"Stepper"},"Protocols/Presentable.html#/s:6RxFlow11PresentableP9rxVisible0A5Swift10ObservableCySbGvp":{"name":"rxVisible","abstract":"

    Rx Observable that triggers a bool indicating if the current Presentable is being displayed","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentableP11rxDismissed0A5Swift17PrimitiveSequenceVyAE11SingleTraitOytGvp":{"name":"rxDismissed","abstract":"

    Rx Observable (Single trait) triggered when this presentable is dismissed

    ","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentablePAASo16UIViewControllerCRbzrlE9rxVisible0A5Swift10ObservableCySbGvp":{"name":"rxVisible","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentablePAASo16UIViewControllerCRbzrlE11rxDismissed0A5Swift17PrimitiveSequenceVyAG11SingleTraitOytGvp":{"name":"rxDismissed","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentablePA2A0B0RzrlE9rxVisible0A5Swift10ObservableCySbGvp":{"name":"rxVisible","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentablePA2A0B0RzrlE11rxDismissed0A5Swift17PrimitiveSequenceVyAF11SingleTraitOytGvp":{"name":"rxDismissed","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentablePAASo8UIWindowCRbzrlE9rxVisible0A5Swift10ObservableCySbGvp":{"name":"rxVisible","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentablePAASo8UIWindowCRbzrlE11rxDismissed0A5Swift17PrimitiveSequenceVyAG11SingleTraitOytGvp":{"name":"rxDismissed","parent_name":"Presentable"},"Protocols/Flow.html#/s:6RxFlow0B0P4rootAA11Presentable_pvp":{"name":"root","abstract":"

    the Presentable on which rely the navigation inside this Flow. This method must always give the same instance

    ","parent_name":"Flow"},"Protocols/Flow.html#/s:6RxFlow0B0P5adapt4step0A5Swift17PrimitiveSequenceVyAF11SingleTraitOAA4Step_pGAaK_p_tF":{"name":"adapt(step:)","abstract":"

    Adapts an incoming step before the navigate(to:) function

    ","parent_name":"Flow"},"Protocols/Flow.html#/s:6RxFlow0B0P8navigate2toAA0B12ContributorsOAA4Step_p_tF":{"name":"navigate(to:)","abstract":"

    Resolves FlowContributors according to the Step, in the context of this very Flow

    ","parent_name":"Flow"},"Protocols/Flow.html":{"name":"Flow","abstract":"

    A Flow defines a clear navigation area. Combined to a Step it leads to a navigation action

    "},"Protocols/Presentable.html":{"name":"Presentable","abstract":"

    An abstraction of what can be presented to the screen. For now, UIViewControllers and Flows are Presentable

    "},"Protocols.html#/s:6RxFlow4StepP":{"name":"Step","abstract":"

    A Step describes a possible state of navigation inside a Flow

    "},"Protocols/Stepper.html":{"name":"Stepper","abstract":"

    a Stepper has only one purpose is: emits Steps that correspond to specific navigation states."},"Protocols.html#/s:6RxFlow14SynchronizableP":{"name":"Synchronizable","abstract":"

    Provides a function to prevent concurrent block execution

    "},"Extensions/Reactive.html#/s:7RxSwift8ReactiveV0A4FlowSo16UIViewControllerCRbzlE9dismissed0A5Cocoa12ControlEventVySbGvp":{"name":"dismissed","abstract":"

    Rx observable, triggered when the view is being dismissed

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/s:7RxSwift8ReactiveV0A4FlowSo16UIViewControllerCRbzlE9displayedAA10ObservableCySbGvp":{"name":"displayed","abstract":"

    Rx observable, triggered when the view appearance state changes

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/s:7RxSwift8ReactiveV0A4FlowSo8UIWindowCRbzlE15windowDidAppearAA10ObservableCyytGvp":{"name":"windowDidAppear","abstract":"

    Rx Observable that is triggered once the UIWindow is displayed

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/s:7RxSwift8ReactiveV0A4FlowAD0D11CoordinatorCRbzlE12willNavigateAA10ObservableCyAD0D0_p_AD4Step_ptGvp":{"name":"willNavigate","abstract":"

    Rx Observable emitted before the navigation to a Step within a Flow

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/s:7RxSwift8ReactiveV0A4FlowAD0D11CoordinatorCRbzlE11didNavigateAA10ObservableCyAD0D0_p_AD4Step_ptGvp":{"name":"didNavigate","abstract":"

    Rx Observable emitted after the navigation to a Step within a Flow

    ","parent_name":"Reactive"},"Extensions/ObservableType.html#/s:7RxSwift14ObservableTypeP0A4FlowE8pausable10withPauserAA0C0Cy7ElementQzGqd___tAaBRd__SbAIRtd__lF":{"name":"pausable(withPauser:)","abstract":"

    Pauses the elements of the source observable sequence based on the latest element from the second observable sequence.","parent_name":"ObservableType"},"Extensions/ObservableType.html#/s:7RxSwift14ObservableTypeP0A4FlowE8pausable10afterCount10withPauserAA0C0Cy7ElementQzGSi_qd__tAaBRd__SbAJRtd__lF":{"name":"pausable(afterCount:withPauser:)","abstract":"

    Pauses the elements of the source observable sequence based on the latest element from the second observable sequence.","parent_name":"ObservableType"},"Extensions/ObservableType.html":{"name":"ObservableType"},"Extensions/Reactive.html":{"name":"Reactive"},"Extensions.html#/c:objc(cs)UIViewController":{"name":"UIViewController"},"Extensions.html#/c:objc(cs)UIWindow":{"name":"UIWindow"},"Enums/RxFlowStep.html#/s:6RxFlow0aB4StepO4homeyA2CmF":{"name":"home","abstract":"

    can be used to express a Flow first step

    ","parent_name":"RxFlowStep"},"Enums/FlowContributors.html#/s:6RxFlow0B12ContributorsO8multipleyACSayAA0B11ContributorOG_tcACmF":{"name":"multiple(flowContributors:)","abstract":"

    a Flow will trigger several FlowContributor at the same time for the same Step

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/s:6RxFlow0B12ContributorsO3oneyAcA0B11ContributorO_tcACmF":{"name":"one(flowContributor:)","abstract":"

    a Flow will trigger only one FlowContributor for a Step

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/s:6RxFlow0B12ContributorsO3endyAcA4Step_p_tcACmF":{"name":"end(forwardToParentFlowWithStep:)","abstract":"

    a Flow will trigger a special FlowContributor that represents the dismissal of this Flow

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/s:6RxFlow0B12ContributorsO4noneyA2CmF":{"name":"none","abstract":"

    no further navigation will be triggered for a Step

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/s:6RxFlow0B12ContributorsO013triggerParentB0yAcA4Step_p_tcACmF":{"name":"triggerParentFlow(withStep:)","abstract":"

    same as .one(flowContributor: .forwardToParentFlow(withStep: Step)). Should not be used anymore

    ","parent_name":"FlowContributors"},"Enums/FlowContributor.html#/s:6RxFlow0B11ContributorO10contributeyAcA11Presentable_p_AA7Stepper_pSbtcACmF":{"name":"contribute(withNextPresentable:withNextStepper:allowStepWhenNotPresented:)","abstract":"

    the given stepper will emit steps, according to lifecycle of the given presentable, that will contribute to the current Flow","parent_name":"FlowContributor"},"Enums/FlowContributor.html#/s:6RxFlow0B11ContributorO016forwardToCurrentB0yAcA4Step_p_tcACmF":{"name":"forwardToCurrentFlow(withStep:)","abstract":"

    the “withStep” step will be forwarded to the current flow

    ","parent_name":"FlowContributor"},"Enums/FlowContributor.html#/s:6RxFlow0B11ContributorO015forwardToParentB0yAcA4Step_p_tcACmF":{"name":"forwardToParentFlow(withStep:)","abstract":"

    the “withStep” step will be forwarded to the parent flow

    ","parent_name":"FlowContributor"},"Enums/FlowContributor.html#/s:6RxFlow0B11ContributorO10contribute8withNextAcA11Presentable_AA7Stepperp_tFZ":{"name":"contribute(withNext:)","abstract":"

    Shortcut static func that returns a .contribute(withNextPresentable: _, withNextStepper: _)","parent_name":"FlowContributor"},"Enums/FlowContributor.html":{"name":"FlowContributor","abstract":"

    A FlowContributor describes the next thing that will contribute to a Flow.

    "},"Enums/FlowContributors.html":{"name":"FlowContributors","abstract":"

    FlowContributors represent the next things that will trigger"},"Enums/RxFlowStep.html":{"name":"RxFlowStep","abstract":"

    Standard RxFlow Steps

    "},"Classes/CompositeStepper.html#/s:6RxFlow7StepperP5steps0A5Relay07PublishE0CyAA4Step_pGvp":{"name":"steps","parent_name":"CompositeStepper"},"Classes/CompositeStepper.html#/s:6RxFlow16CompositeStepperC8steppersACSayAA0D0_pG_tcfc":{"name":"init(steppers:)","abstract":"

    Initialize

    ","parent_name":"CompositeStepper"},"Classes/CompositeStepper.html#/s:6RxFlow7StepperP16readyToEmitStepsyyF":{"name":"readyToEmitSteps()","parent_name":"CompositeStepper"},"Classes/DefaultStepper.html#/s:6RxFlow14DefaultStepperCACycfc":{"name":"init()","abstract":"

    Initialize the DefaultStepper

    ","parent_name":"DefaultStepper"},"Classes/OneStepper.html#/s:6RxFlow7StepperP5steps0A5Relay07PublishE0CyAA4Step_pGvp":{"name":"steps","parent_name":"OneStepper"},"Classes/OneStepper.html#/s:6RxFlow10OneStepperC14withSingleStepAcA0G0_p_tcfc":{"name":"init(withSingleStep:)","abstract":"

    Initialize the OneStepper

    ","parent_name":"OneStepper"},"Classes/OneStepper.html#/s:6RxFlow7StepperP11initialStepAA0E0_pvp":{"name":"initialStep","parent_name":"OneStepper"},"Classes/FlowCoordinator.html#/s:6RxFlow0B11CoordinatorC10coordinate4flow4withyAA0B0_p_AA7Stepper_ptF":{"name":"coordinate(flow:with:)","abstract":"

    Undocumented

    ","parent_name":"FlowCoordinator"},"Classes/Flows.html#/s:6RxFlow5FlowsC9whenReady5flows5blockySayAA0B0_pG_ySayxGctSo16UIViewControllerCRbzlFZ":{"name":"whenReady(flows:block:)","abstract":"

    Allow to be triggered only when Flows given as parameters are ready to be displayed.","parent_name":"Flows"},"Classes/Flows.html#/s:6RxFlow5FlowsC9whenReady5flow15flow25flow35flow45flow55blockyAA0B0_p_AaK_pAaK_pAaK_pAaK_pyx_q_q0_q1_q2_tctSo16UIViewControllerCRbzAMRb_AMRb0_AMRb1_AMRb2_r3_lFZ":{"name":"whenReady(flow1:flow2:flow3:flow4:flow5:block:)","abstract":"

    Allow to be triggered only when Flows given as parameters are ready to be displayed.","parent_name":"Flows"},"Classes/Flows.html#/s:6RxFlow5FlowsC9whenReady5flow15flow25flow35flow45blockyAA0B0_p_AaJ_pAaJ_pAaJ_pyx_q_q0_q1_tctSo16UIViewControllerCRbzALRb_ALRb0_ALRb1_r2_lFZ":{"name":"whenReady(flow1:flow2:flow3:flow4:block:)","abstract":"

    Allow to be triggered only when Flows given as parameters are ready to be displayed.","parent_name":"Flows"},"Classes/Flows.html#/s:6RxFlow5FlowsC9whenReady5flow15flow25flow35blockyAA0B0_p_AaI_pAaI_pyx_q_q0_tctSo16UIViewControllerCRbzAKRb_AKRb0_r1_lFZ":{"name":"whenReady(flow1:flow2:flow3:block:)","abstract":"

    Allow to be triggered only when Flows given as parameters are ready to be displayed.","parent_name":"Flows"},"Classes/Flows.html#/s:6RxFlow5FlowsC9whenReady5flow15flow25blockyAA0B0_p_AaH_pyx_q_tctSo16UIViewControllerCRbzAJRb_r0_lFZ":{"name":"whenReady(flow1:flow2:block:)","abstract":"

    Allow to be triggered only when Flows given as parameters are ready to be displayed.","parent_name":"Flows"},"Classes/Flows.html#/s:6RxFlow5FlowsC9whenReady5flow15blockyAA0B0_p_yxctSo16UIViewControllerCRbzlFZ":{"name":"whenReady(flow1:block:)","abstract":"

    Allow to be triggered only when Flow given as parameters is ready to be displayed.","parent_name":"Flows"},"Classes/Flows.html":{"name":"Flows","abstract":"

    Utility functions to synchronize Flows readyness

    "},"Classes/FlowCoordinator.html":{"name":"FlowCoordinator","abstract":"

    A FlowCoordinator handles the navigation of a Flow, based on its Stepper and the FlowContributors it emits

    "},"Classes/OneStepper.html":{"name":"OneStepper","abstract":"

    A Simple Stepper that has one goal: emit a single Step once initialized

    "},"Classes/DefaultStepper.html":{"name":"DefaultStepper","abstract":"

    A Simple Stepper that has one goal: emit a first default step equal to RxFlowStep.home

    "},"Classes/CompositeStepper.html":{"name":"CompositeStepper","abstract":"

    A Stepper that combines multiple steppers. All those Steppers will be associated"},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Enums.html":{"name":"Enumerations","abstract":"

    The following enumerations are available globally.

    "},"Extensions.html":{"name":"Extensions","abstract":"

    The following extensions are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "},"Typealiases.html":{"name":"Type Aliases","abstract":"

    The following type aliases are available globally.

    "}} \ No newline at end of file +{"Protocols/Stepper.html#/steps":{"name":"steps","abstract":"

    the relay used to emit steps inside this Stepper

    ","parent_name":"Stepper"},"Protocols/Stepper.html#/initialStep":{"name":"initialStep","abstract":"

    the initial step that will be emitted when listening to this Stepper

    ","parent_name":"Stepper"},"Protocols/Stepper.html#/readyToEmitSteps()":{"name":"readyToEmitSteps()","abstract":"

    function called when stepper is listened by the FlowCoordinator

    ","parent_name":"Stepper"},"Protocols/Presentable.html#/rxVisible":{"name":"rxVisible","abstract":"

    Rx Observable that triggers a bool indicating if the current Presentable is being displayed","parent_name":"Presentable"},"Protocols/Presentable.html#/rxDismissed":{"name":"rxDismissed","abstract":"

    Rx Observable (Single trait) triggered when this presentable is dismissed

    ","parent_name":"Presentable"},"Protocols/Flow.html#/root":{"name":"root","abstract":"

    the Presentable on which rely the navigation inside this Flow. This method must always give the same instance

    ","parent_name":"Flow"},"Protocols/Flow.html#/adapt(step:)":{"name":"adapt(step:)","abstract":"

    Adapts an incoming step before the navigate(to:) function

    ","parent_name":"Flow"},"Protocols/Flow.html#/navigate(to:)":{"name":"navigate(to:)","abstract":"

    Resolves FlowContributors according to the Step, in the context of this very Flow

    ","parent_name":"Flow"},"Protocols/Flow.html":{"name":"Flow","abstract":"

    A Flow defines a clear navigation area. Combined to a Step it leads to a navigation action

    "},"Protocols/Presentable.html":{"name":"Presentable","abstract":"

    An abstraction of what can be presented to the screen. For now, UIViewControllers and Flows are Presentable

    "},"Protocols.html#/Step":{"name":"Step","abstract":"

    A Step describes a possible state of navigation inside a Flow

    "},"Protocols/Stepper.html":{"name":"Stepper","abstract":"

    a Stepper has only one purpose is: emits Steps that correspond to specific navigation states."},"Protocols.html#/Synchronizable":{"name":"Synchronizable","abstract":"

    Provides a function to prevent concurrent block execution

    "},"Extensions/Reactive.html#/dismissed":{"name":"dismissed","abstract":"

    Rx observable, triggered when the view is being dismissed

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/displayed":{"name":"displayed","abstract":"

    Rx observable, triggered when the view appearance state changes

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/windowDidAppear":{"name":"windowDidAppear","abstract":"

    Rx Observable that is triggered once the UIWindow is displayed

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/willNavigate":{"name":"willNavigate","abstract":"

    Rx Observable emitted before the navigation to a Step within a Flow

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/didNavigate":{"name":"didNavigate","abstract":"

    Rx Observable emitted after the navigation to a Step within a Flow

    ","parent_name":"Reactive"},"Extensions/ObservableType.html#/pausable(withPauser:)":{"name":"pausable(withPauser:)","abstract":"

    Pauses the elements of the source observable sequence based on the latest element from the second observable sequence.","parent_name":"ObservableType"},"Extensions/ObservableType.html#/pausable(afterCount:withPauser:)":{"name":"pausable(afterCount:withPauser:)","abstract":"

    Pauses the elements of the source observable sequence based on the latest element from the second observable sequence.","parent_name":"ObservableType"},"Extensions/ObservableType.html":{"name":"ObservableType"},"Extensions/Reactive.html":{"name":"Reactive"},"Extensions.html#/UIViewController":{"name":"UIViewController"},"Extensions.html#/UIWindow":{"name":"UIWindow"},"Enums/RxFlowStep.html#/home":{"name":"home","abstract":"

    can be used to express a Flow first step

    ","parent_name":"RxFlowStep"},"Enums/FlowContributors.html#/multiple(flowContributors:)":{"name":"multiple(flowContributors:)","abstract":"

    a Flow will trigger several FlowContributor at the same time for the same Step

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/one(flowContributor:)":{"name":"one(flowContributor:)","abstract":"

    a Flow will trigger only one FlowContributor for a Step

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/end(forwardToParentFlowWithStep:)":{"name":"end(forwardToParentFlowWithStep:)","abstract":"

    a Flow will trigger a special FlowContributor that represents the dismissal of this Flow

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/none":{"name":"none","abstract":"

    no further navigation will be triggered for a Step

    ","parent_name":"FlowContributors"},"Enums/FlowContributor.html#/contribute(withNextPresentable:withNextStepper:allowStepWhenNotPresented:)":{"name":"contribute(withNextPresentable:withNextStepper:allowStepWhenNotPresented:)","abstract":"

    the given stepper will emit steps, according to lifecycle of the given presentable, that will contribute to the current Flow","parent_name":"FlowContributor"},"Enums/FlowContributor.html#/forwardToCurrentFlow(withStep:)":{"name":"forwardToCurrentFlow(withStep:)","abstract":"

    the “withStep” step will be forwarded to the current flow

    ","parent_name":"FlowContributor"},"Enums/FlowContributor.html#/forwardToParentFlow(withStep:)":{"name":"forwardToParentFlow(withStep:)","abstract":"

    the “withStep” step will be forwarded to the parent flow

    ","parent_name":"FlowContributor"},"Enums/FlowContributor.html#/contribute(withNext:)":{"name":"contribute(withNext:)","abstract":"

    Shortcut static func that returns a .contribute(withNextPresentable: _, withNextStepper: _)","parent_name":"FlowContributor"},"Enums/Flows/ExecuteStrategy.html#/ready":{"name":"ready","parent_name":"ExecuteStrategy"},"Enums/Flows/ExecuteStrategy.html#/created":{"name":"created","parent_name":"ExecuteStrategy"},"Enums/Flows/ExecuteStrategy.html":{"name":"ExecuteStrategy","parent_name":"Flows"},"Enums/Flows.html#/use(_:when:block:)":{"name":"use(_:when:block:)","parent_name":"Flows"},"Enums/Flows.html#/use(_:_:_:_:_:when:block:)":{"name":"use(_:_:_:_:_:when:block:)","abstract":"

    Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation","parent_name":"Flows"},"Enums/Flows.html#/use(_:_:_:_:when:block:)":{"name":"use(_:_:_:_:when:block:)","abstract":"

    Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation","parent_name":"Flows"},"Enums/Flows.html#/use(_:_:_:when:block:)":{"name":"use(_:_:_:when:block:)","abstract":"

    Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation","parent_name":"Flows"},"Enums/Flows.html#/use(_:_:when:block:)":{"name":"use(_:_:when:block:)","abstract":"

    Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation","parent_name":"Flows"},"Enums/Flows.html":{"name":"Flows","abstract":"

    Utility functions to synchronize Flows readyness

    "},"Enums/FlowContributor.html":{"name":"FlowContributor","abstract":"

    A FlowContributor describes the next thing that will contribute to a Flow.

    "},"Enums/FlowContributors.html":{"name":"FlowContributors","abstract":"

    FlowContributors represent the next things that will trigger"},"Enums/RxFlowStep.html":{"name":"RxFlowStep","abstract":"

    Standard RxFlow Steps

    "},"Classes/CompositeStepper.html#/steps":{"name":"steps","parent_name":"CompositeStepper"},"Classes/CompositeStepper.html#/init(steppers:)":{"name":"init(steppers:)","abstract":"

    Initialize

    ","parent_name":"CompositeStepper"},"Classes/CompositeStepper.html#/readyToEmitSteps()":{"name":"readyToEmitSteps()","parent_name":"CompositeStepper"},"Classes/DefaultStepper.html#/init()":{"name":"init()","abstract":"

    Initialize the DefaultStepper

    ","parent_name":"DefaultStepper"},"Classes/OneStepper.html#/steps":{"name":"steps","parent_name":"OneStepper"},"Classes/OneStepper.html#/init(withSingleStep:)":{"name":"init(withSingleStep:)","abstract":"

    Initialize the OneStepper

    ","parent_name":"OneStepper"},"Classes/OneStepper.html#/initialStep":{"name":"initialStep","parent_name":"OneStepper"},"Classes/FlowCoordinator.html#/coordinate(flow:with:)":{"name":"coordinate(flow:with:)","abstract":"

    Execute the navigation of the Flow

    ","parent_name":"FlowCoordinator"},"Classes/FlowCoordinator.html#/navigate(to:)":{"name":"navigate(to:)","abstract":"

    allow to drive the navigation from the outside of a flow

    ","parent_name":"FlowCoordinator"},"Classes/FlowCoordinator.html":{"name":"FlowCoordinator","abstract":"

    A FlowCoordinator handles the navigation of a Flow, based on its Stepper and the FlowContributors it emits

    "},"Classes/OneStepper.html":{"name":"OneStepper","abstract":"

    A Simple Stepper that has one goal: emit a single Step once initialized

    "},"Classes/DefaultStepper.html":{"name":"DefaultStepper","abstract":"

    A Simple Stepper that has one goal: emit a first default step equal to RxFlowStep.home

    "},"Classes/CompositeStepper.html":{"name":"CompositeStepper","abstract":"

    A Stepper that combines multiple steppers. All those Steppers will be associated"},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Enums.html":{"name":"Enumerations","abstract":"

    The following enumerations are available globally.

    "},"Extensions.html":{"name":"Extensions","abstract":"

    The following extensions are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "}} \ No newline at end of file diff --git a/docs/docsets/RxFlow.docset/Contents/Resources/docSet.dsidx b/docs/docsets/RxFlow.docset/Contents/Resources/docSet.dsidx index cf6278c..13e0e13 100644 Binary files a/docs/docsets/RxFlow.docset/Contents/Resources/docSet.dsidx and b/docs/docsets/RxFlow.docset/Contents/Resources/docSet.dsidx differ diff --git a/docs/docsets/RxFlow.tgz b/docs/docsets/RxFlow.tgz index af334d7..d42e99a 100644 Binary files a/docs/docsets/RxFlow.tgz and b/docs/docsets/RxFlow.tgz differ diff --git a/docs/img/spinner.gif b/docs/img/spinner.gif new file mode 100644 index 0000000..e3038d0 Binary files /dev/null and b/docs/img/spinner.gif differ diff --git a/docs/index.html b/docs/index.html index a91b263..27f82ce 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,12 +8,20 @@ + + +
    -

    RxFlow Docs (98% documented)

    +

    RxFlow 2.9.0 Docs (0% documented)

    +

    +

    + +
    +

    @@ -38,9 +46,6 @@ - @@ -55,6 +60,12 @@ + + @@ -70,10 +81,10 @@ Reactive @@ -87,24 +98,13 @@ Presentable - - - @@ -148,9 +148,9 @@

    About

    You will find a very detail explanation of the whole project on my blog:

    The Jazzy documentation can be seen here as well: Documentation

    @@ -272,7 +272,7 @@

    How to declare } -

    The idea is to keep the Steps navigation independent as much as possible. For instance, calling a Step showMovieDetail(withId: Int) might be a bad idea since it tighlty couples the fact of selecting a movie with the consequence of showing the movie detail screen. It is not up to the emitter of the Step to decide where to navigate, this decision belongs to the Flow.

    +

    The idea is to keep the Steps navigation independent as much as possible. For instance, calling a Step showMovieDetail(withId: Int) might be a bad idea since it tightly couples the fact of selecting a movie with the consequence of showing the movie detail screen. It is not up to the emitter of the Step to decide where to navigate, this decision belongs to the Flow.

    How to declare a Flow

    The following Flow is used as a Navigation stack. All you have to do is:

    @@ -347,6 +347,18 @@

    How to declare a } } + + +

    From the AppDelegate you can reach the FlowCoordinator and call the navigate(to:) function when receiving a notification for instance.

    + +

    The step passed to the function will then be passed to all the existing Flows so you can adapt the navigation.

    +
    func userNotificationCenter(_ center: UNUserNotificationCenter,
    +                            didReceive response: UNNotificationResponse,
    +                            withCompletionHandler completionHandler: @escaping () -> Void) {
    +    // example of how DeepLink can be handled
    +    self.coordinator.navigate(to: DemoStep.movieIsPicked(withId: 23452))
    +}
    +

    How to adapt a Step before it triggers a navigation ?

    A Flow has a adapt(step:) -> Single<Step> function that by default returns the step it has been given @@ -405,17 +417,25 @@

    Is it possi

    Of course, it is the aim of a Coordinator. Inside a Flow we can present UIViewControllers and also new Flows. The function Flows.whenReady() allows to be triggered when the new Flow is ready to be displayed and gives us back its root Presentable.

    For instance, from the WishlistFlow, we launch the SettingsFlow in a popup.

    -
        private func navigateToSettings() -> FlowContributors {
    -        let settingsStepper = SettingsStepper()
    -        let settingsFlow = SettingsFlow(withServices: self.services, andStepper: settingsStepper)
    +
    private func navigateToSettings() -> FlowContributors {
    +    let settingsStepper = SettingsStepper()
    +    let settingsFlow = SettingsFlow(withServices: self.services, andStepper: settingsStepper)
     
    -        Flows.whenReady(flow1: settingsFlow) { [unowned self] (root: UISplitViewController) in
    -            self.rootViewController.present(root, animated: true)
    -        }
    -        return .one(flowContributor: .contribute(withNextPresentable: settingsFlow, withNextStepper: settingsStepper))
    +    Flows.use(settingsFlow, when: .ready) { [unowned self] root in
    +        self.rootViewController.present(root, animated: true)
    +    }
    +
    +    return .one(flowContributor: .contribute(withNextPresentable: settingsFlow, withNextStepper: settingsStepper))
         }
     
    +

    The Flows.use(when:) takes an ExecuteStrategy as a second parameter. It has two possible values:

    + +
      +
    • .created: The completion block will be executed instantly
    • +
    • .ready: The completion block will be executed once the sub flows (SettingsFlow in the example) have emitted a first step
    • +
    +

    For more complex cases, see the DashboardFlow.swift and the SettingsFlow.swift files in which we handle a UITabBarController and a UISplitViewController.

    How to bootstrap the RxFlow process

    @@ -476,8 +496,8 @@

    Tools and dependencies

    diff --git a/docs/js/jazzy.js b/docs/js/jazzy.js index c31dc05..1e55d6e 100755 --- a/docs/js/jazzy.js +++ b/docs/js/jazzy.js @@ -23,7 +23,7 @@ function openCurrentItemIfClosed() { if (window.jazzy.docset) { return; } - var $link = $(`.token[href="${location.hash}"]`); + var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); $content = itemLinkToContent($link); if ($content.is(':hidden')) { toggleItem($link, $content); @@ -57,3 +57,14 @@ $("a:not('.token')").on('click', function() { openCurrentItemIfClosed(); } }); + +// KaTeX rendering +if ("katex" in window) { + $($('.math').each( (_, element) => { + katex.render(element.textContent, element, { + displayMode: $(element).hasClass('m-block'), + throwOnError: false, + trust: true + }); + })) +} diff --git a/docs/js/jazzy.search.js b/docs/js/jazzy.search.js new file mode 100644 index 0000000..e3d1ab9 --- /dev/null +++ b/docs/js/jazzy.search.js @@ -0,0 +1,70 @@ +$(function(){ + var $typeahead = $('[data-typeahead]'); + var $form = $typeahead.parents('form'); + var searchURL = $form.attr('action'); + + function displayTemplate(result) { + return result.name; + } + + function suggestionTemplate(result) { + var t = '
    '; + t += '' + result.name + ''; + if (result.parent_name) { + t += '' + result.parent_name + ''; + } + t += '
    '; + return t; + } + + $typeahead.one('focus', function() { + $form.addClass('loading'); + + $.getJSON(searchURL).then(function(searchData) { + const searchIndex = lunr(function() { + this.ref('url'); + this.field('name'); + this.field('abstract'); + for (const [url, doc] of Object.entries(searchData)) { + this.add({url: url, name: doc.name, abstract: doc.abstract}); + } + }); + + $typeahead.typeahead( + { + highlight: true, + minLength: 3, + autoselect: true + }, + { + limit: 10, + display: displayTemplate, + templates: { suggestion: suggestionTemplate }, + source: function(query, sync) { + const lcSearch = query.toLowerCase(); + const results = searchIndex.query(function(q) { + q.term(lcSearch, { boost: 100 }); + q.term(lcSearch, { + boost: 10, + wildcard: lunr.Query.wildcard.TRAILING + }); + }).map(function(result) { + var doc = searchData[result.ref]; + doc.url = result.ref; + return doc; + }); + sync(results); + } + } + ); + $form.removeClass('loading'); + $typeahead.trigger('focus'); + }); + }); + + var baseURL = searchURL.slice(0, -"search.json".length); + + $typeahead.on('typeahead:select', function(e, result) { + window.location = baseURL + result.url; + }); +}); diff --git a/docs/js/jquery.min.js b/docs/js/jquery.min.js index a1c07fd..b061403 100755 --- a/docs/js/jquery.min.js +++ b/docs/js/jquery.min.js @@ -1,2 +1,2 @@ -/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
    ",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
    ",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 00){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}(); diff --git a/docs/js/typeahead.jquery.js b/docs/js/typeahead.jquery.js new file mode 100644 index 0000000..3a2d2ab --- /dev/null +++ b/docs/js/typeahead.jquery.js @@ -0,0 +1,1694 @@ +/*! + * typeahead.js 1.3.1 + * https://github.com/corejavascript/typeahead.js + * Copyright 2013-2020 Twitter, Inc. and other contributors; Licensed MIT + */ + + +(function(root, factory) { + if (typeof define === "function" && define.amd) { + define([ "jquery" ], function(a0) { + return factory(a0); + }); + } else if (typeof module === "object" && module.exports) { + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +})(this, function($) { + var _ = function() { + "use strict"; + return { + isMsie: function() { + return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false; + }, + isBlankString: function(str) { + return !str || /^\s*$/.test(str); + }, + escapeRegExChars: function(str) { + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + }, + isString: function(obj) { + return typeof obj === "string"; + }, + isNumber: function(obj) { + return typeof obj === "number"; + }, + isArray: $.isArray, + isFunction: $.isFunction, + isObject: $.isPlainObject, + isUndefined: function(obj) { + return typeof obj === "undefined"; + }, + isElement: function(obj) { + return !!(obj && obj.nodeType === 1); + }, + isJQuery: function(obj) { + return obj instanceof $; + }, + toStr: function toStr(s) { + return _.isUndefined(s) || s === null ? "" : s + ""; + }, + bind: $.proxy, + each: function(collection, cb) { + $.each(collection, reverseArgs); + function reverseArgs(index, value) { + return cb(value, index); + } + }, + map: $.map, + filter: $.grep, + every: function(obj, test) { + var result = true; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (!(result = test.call(null, val, key, obj))) { + return false; + } + }); + return !!result; + }, + some: function(obj, test) { + var result = false; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (result = test.call(null, val, key, obj)) { + return false; + } + }); + return !!result; + }, + mixin: $.extend, + identity: function(x) { + return x; + }, + clone: function(obj) { + return $.extend(true, {}, obj); + }, + getIdGenerator: function() { + var counter = 0; + return function() { + return counter++; + }; + }, + templatify: function templatify(obj) { + return $.isFunction(obj) ? obj : template; + function template() { + return String(obj); + } + }, + defer: function(fn) { + setTimeout(fn, 0); + }, + debounce: function(func, wait, immediate) { + var timeout, result; + return function() { + var context = this, args = arguments, later, callNow; + later = function() { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + } + }; + callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + } + return result; + }; + }, + throttle: function(func, wait) { + var context, args, timeout, result, previous, later; + previous = 0; + later = function() { + previous = new Date(); + timeout = null; + result = func.apply(context, args); + }; + return function() { + var now = new Date(), remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + } else if (!timeout) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }, + stringify: function(val) { + return _.isString(val) ? val : JSON.stringify(val); + }, + guid: function() { + function _p8(s) { + var p = (Math.random().toString(16) + "000000000").substr(2, 8); + return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p; + } + return "tt-" + _p8() + _p8(true) + _p8(true) + _p8(); + }, + noop: function() {} + }; + }(); + var WWW = function() { + "use strict"; + var defaultClassNames = { + wrapper: "twitter-typeahead", + input: "tt-input", + hint: "tt-hint", + menu: "tt-menu", + dataset: "tt-dataset", + suggestion: "tt-suggestion", + selectable: "tt-selectable", + empty: "tt-empty", + open: "tt-open", + cursor: "tt-cursor", + highlight: "tt-highlight" + }; + return build; + function build(o) { + var www, classes; + classes = _.mixin({}, defaultClassNames, o); + www = { + css: buildCss(), + classes: classes, + html: buildHtml(classes), + selectors: buildSelectors(classes) + }; + return { + css: www.css, + html: www.html, + classes: www.classes, + selectors: www.selectors, + mixin: function(o) { + _.mixin(o, www); + } + }; + } + function buildHtml(c) { + return { + wrapper: '', + menu: '
    ' + }; + } + function buildSelectors(classes) { + var selectors = {}; + _.each(classes, function(v, k) { + selectors[k] = "." + v; + }); + return selectors; + } + function buildCss() { + var css = { + wrapper: { + position: "relative", + display: "inline-block" + }, + hint: { + position: "absolute", + top: "0", + left: "0", + borderColor: "transparent", + boxShadow: "none", + opacity: "1" + }, + input: { + position: "relative", + verticalAlign: "top", + backgroundColor: "transparent" + }, + inputWithNoHint: { + position: "relative", + verticalAlign: "top" + }, + menu: { + position: "absolute", + top: "100%", + left: "0", + zIndex: "100", + display: "none" + }, + ltr: { + left: "0", + right: "auto" + }, + rtl: { + left: "auto", + right: " 0" + } + }; + if (_.isMsie()) { + _.mixin(css.input, { + backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)" + }); + } + return css; + } + }(); + var EventBus = function() { + "use strict"; + var namespace, deprecationMap; + namespace = "typeahead:"; + deprecationMap = { + render: "rendered", + cursorchange: "cursorchanged", + select: "selected", + autocomplete: "autocompleted" + }; + function EventBus(o) { + if (!o || !o.el) { + $.error("EventBus initialized without el"); + } + this.$el = $(o.el); + } + _.mixin(EventBus.prototype, { + _trigger: function(type, args) { + var $e = $.Event(namespace + type); + this.$el.trigger.call(this.$el, $e, args || []); + return $e; + }, + before: function(type) { + var args, $e; + args = [].slice.call(arguments, 1); + $e = this._trigger("before" + type, args); + return $e.isDefaultPrevented(); + }, + trigger: function(type) { + var deprecatedType; + this._trigger(type, [].slice.call(arguments, 1)); + if (deprecatedType = deprecationMap[type]) { + this._trigger(deprecatedType, [].slice.call(arguments, 1)); + } + } + }); + return EventBus; + }(); + var EventEmitter = function() { + "use strict"; + var splitter = /\s+/, nextTick = getNextTick(); + return { + onSync: onSync, + onAsync: onAsync, + off: off, + trigger: trigger + }; + function on(method, types, cb, context) { + var type; + if (!cb) { + return this; + } + types = types.split(splitter); + cb = context ? bindContext(cb, context) : cb; + this._callbacks = this._callbacks || {}; + while (type = types.shift()) { + this._callbacks[type] = this._callbacks[type] || { + sync: [], + async: [] + }; + this._callbacks[type][method].push(cb); + } + return this; + } + function onAsync(types, cb, context) { + return on.call(this, "async", types, cb, context); + } + function onSync(types, cb, context) { + return on.call(this, "sync", types, cb, context); + } + function off(types) { + var type; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + while (type = types.shift()) { + delete this._callbacks[type]; + } + return this; + } + function trigger(types) { + var type, callbacks, args, syncFlush, asyncFlush; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + args = [].slice.call(arguments, 1); + while ((type = types.shift()) && (callbacks = this._callbacks[type])) { + syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args)); + asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args)); + syncFlush() && nextTick(asyncFlush); + } + return this; + } + function getFlush(callbacks, context, args) { + return flush; + function flush() { + var cancelled; + for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) { + cancelled = callbacks[i].apply(context, args) === false; + } + return !cancelled; + } + } + function getNextTick() { + var nextTickFn; + if (window.setImmediate) { + nextTickFn = function nextTickSetImmediate(fn) { + setImmediate(function() { + fn(); + }); + }; + } else { + nextTickFn = function nextTickSetTimeout(fn) { + setTimeout(function() { + fn(); + }, 0); + }; + } + return nextTickFn; + } + function bindContext(fn, context) { + return fn.bind ? fn.bind(context) : function() { + fn.apply(context, [].slice.call(arguments, 0)); + }; + } + }(); + var highlight = function(doc) { + "use strict"; + var defaults = { + node: null, + pattern: null, + tagName: "strong", + className: null, + wordsOnly: false, + caseSensitive: false, + diacriticInsensitive: false + }; + var accented = { + A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]", + B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]", + C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]", + D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]", + E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]", + F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]", + G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]", + H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]", + I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]", + J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]", + K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]", + L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]", + M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]", + N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]", + O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]", + P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]", + Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]", + R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]", + S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]", + T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]", + U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]", + V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]", + W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]", + X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]", + Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]", + Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]" + }; + return function hightlight(o) { + var regex; + o = _.mixin({}, defaults, o); + if (!o.node || !o.pattern) { + return; + } + o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ]; + regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive); + traverse(o.node, hightlightTextNode); + function hightlightTextNode(textNode) { + var match, patternNode, wrapperNode; + if (match = regex.exec(textNode.data)) { + wrapperNode = doc.createElement(o.tagName); + o.className && (wrapperNode.className = o.className); + patternNode = textNode.splitText(match.index); + patternNode.splitText(match[0].length); + wrapperNode.appendChild(patternNode.cloneNode(true)); + textNode.parentNode.replaceChild(wrapperNode, patternNode); + } + return !!match; + } + function traverse(el, hightlightTextNode) { + var childNode, TEXT_NODE_TYPE = 3; + for (var i = 0; i < el.childNodes.length; i++) { + childNode = el.childNodes[i]; + if (childNode.nodeType === TEXT_NODE_TYPE) { + i += hightlightTextNode(childNode) ? 1 : 0; + } else { + traverse(childNode, hightlightTextNode); + } + } + } + }; + function accent_replacer(chr) { + return accented[chr.toUpperCase()] || chr; + } + function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) { + var escapedPatterns = [], regexStr; + for (var i = 0, len = patterns.length; i < len; i++) { + var escapedWord = _.escapeRegExChars(patterns[i]); + if (diacriticInsensitive) { + escapedWord = escapedWord.replace(/\S/g, accent_replacer); + } + escapedPatterns.push(escapedWord); + } + regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")"; + return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i"); + } + }(window.document); + var Input = function() { + "use strict"; + var specialKeyCodeMap; + specialKeyCodeMap = { + 9: "tab", + 27: "esc", + 37: "left", + 39: "right", + 13: "enter", + 38: "up", + 40: "down" + }; + function Input(o, www) { + var id; + o = o || {}; + if (!o.input) { + $.error("input is missing"); + } + www.mixin(this); + this.$hint = $(o.hint); + this.$input = $(o.input); + this.$menu = $(o.menu); + id = this.$input.attr("id") || _.guid(); + this.$menu.attr("id", id + "_listbox"); + this.$hint.attr({ + "aria-hidden": true + }); + this.$input.attr({ + "aria-owns": id + "_listbox", + role: "combobox", + "aria-autocomplete": "list", + "aria-expanded": false + }); + this.query = this.$input.val(); + this.queryWhenFocused = this.hasFocus() ? this.query : null; + this.$overflowHelper = buildOverflowHelper(this.$input); + this._checkLanguageDirection(); + if (this.$hint.length === 0) { + this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop; + } + this.onSync("cursorchange", this._updateDescendent); + } + Input.normalizeQuery = function(str) { + return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " "); + }; + _.mixin(Input.prototype, EventEmitter, { + _onBlur: function onBlur() { + this.resetInputValue(); + this.trigger("blurred"); + }, + _onFocus: function onFocus() { + this.queryWhenFocused = this.query; + this.trigger("focused"); + }, + _onKeydown: function onKeydown($e) { + var keyName = specialKeyCodeMap[$e.which || $e.keyCode]; + this._managePreventDefault(keyName, $e); + if (keyName && this._shouldTrigger(keyName, $e)) { + this.trigger(keyName + "Keyed", $e); + } + }, + _onInput: function onInput() { + this._setQuery(this.getInputValue()); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + _managePreventDefault: function managePreventDefault(keyName, $e) { + var preventDefault; + switch (keyName) { + case "up": + case "down": + preventDefault = !withModifier($e); + break; + + default: + preventDefault = false; + } + preventDefault && $e.preventDefault(); + }, + _shouldTrigger: function shouldTrigger(keyName, $e) { + var trigger; + switch (keyName) { + case "tab": + trigger = !withModifier($e); + break; + + default: + trigger = true; + } + return trigger; + }, + _checkLanguageDirection: function checkLanguageDirection() { + var dir = (this.$input.css("direction") || "ltr").toLowerCase(); + if (this.dir !== dir) { + this.dir = dir; + this.$hint.attr("dir", dir); + this.trigger("langDirChanged", dir); + } + }, + _setQuery: function setQuery(val, silent) { + var areEquivalent, hasDifferentWhitespace; + areEquivalent = areQueriesEquivalent(val, this.query); + hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false; + this.query = val; + if (!silent && !areEquivalent) { + this.trigger("queryChanged", this.query); + } else if (!silent && hasDifferentWhitespace) { + this.trigger("whitespaceChanged", this.query); + } + }, + _updateDescendent: function updateDescendent(event, id) { + this.$input.attr("aria-activedescendant", id); + }, + bind: function() { + var that = this, onBlur, onFocus, onKeydown, onInput; + onBlur = _.bind(this._onBlur, this); + onFocus = _.bind(this._onFocus, this); + onKeydown = _.bind(this._onKeydown, this); + onInput = _.bind(this._onInput, this); + this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown); + if (!_.isMsie() || _.isMsie() > 9) { + this.$input.on("input.tt", onInput); + } else { + this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) { + if (specialKeyCodeMap[$e.which || $e.keyCode]) { + return; + } + _.defer(_.bind(that._onInput, that, $e)); + }); + } + return this; + }, + focus: function focus() { + this.$input.focus(); + }, + blur: function blur() { + this.$input.blur(); + }, + getLangDir: function getLangDir() { + return this.dir; + }, + getQuery: function getQuery() { + return this.query || ""; + }, + setQuery: function setQuery(val, silent) { + this.setInputValue(val); + this._setQuery(val, silent); + }, + hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() { + return this.query !== this.queryWhenFocused; + }, + getInputValue: function getInputValue() { + return this.$input.val(); + }, + setInputValue: function setInputValue(value) { + this.$input.val(value); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + resetInputValue: function resetInputValue() { + this.setInputValue(this.query); + }, + getHint: function getHint() { + return this.$hint.val(); + }, + setHint: function setHint(value) { + this.$hint.val(value); + }, + clearHint: function clearHint() { + this.setHint(""); + }, + clearHintIfInvalid: function clearHintIfInvalid() { + var val, hint, valIsPrefixOfHint, isValid; + val = this.getInputValue(); + hint = this.getHint(); + valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0; + isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow(); + !isValid && this.clearHint(); + }, + hasFocus: function hasFocus() { + return this.$input.is(":focus"); + }, + hasOverflow: function hasOverflow() { + var constraint = this.$input.width() - 2; + this.$overflowHelper.text(this.getInputValue()); + return this.$overflowHelper.width() >= constraint; + }, + isCursorAtEnd: function() { + var valueLength, selectionStart, range; + valueLength = this.$input.val().length; + selectionStart = this.$input[0].selectionStart; + if (_.isNumber(selectionStart)) { + return selectionStart === valueLength; + } else if (document.selection) { + range = document.selection.createRange(); + range.moveStart("character", -valueLength); + return valueLength === range.text.length; + } + return true; + }, + destroy: function destroy() { + this.$hint.off(".tt"); + this.$input.off(".tt"); + this.$overflowHelper.remove(); + this.$hint = this.$input = this.$overflowHelper = $("
    "); + }, + setAriaExpanded: function setAriaExpanded(value) { + this.$input.attr("aria-expanded", value); + } + }); + return Input; + function buildOverflowHelper($input) { + return $('').css({ + position: "absolute", + visibility: "hidden", + whiteSpace: "pre", + fontFamily: $input.css("font-family"), + fontSize: $input.css("font-size"), + fontStyle: $input.css("font-style"), + fontVariant: $input.css("font-variant"), + fontWeight: $input.css("font-weight"), + wordSpacing: $input.css("word-spacing"), + letterSpacing: $input.css("letter-spacing"), + textIndent: $input.css("text-indent"), + textRendering: $input.css("text-rendering"), + textTransform: $input.css("text-transform") + }).insertAfter($input); + } + function areQueriesEquivalent(a, b) { + return Input.normalizeQuery(a) === Input.normalizeQuery(b); + } + function withModifier($e) { + return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey; + } + }(); + var Dataset = function() { + "use strict"; + var keys, nameGenerator; + keys = { + dataset: "tt-selectable-dataset", + val: "tt-selectable-display", + obj: "tt-selectable-object" + }; + nameGenerator = _.getIdGenerator(); + function Dataset(o, www) { + o = o || {}; + o.templates = o.templates || {}; + o.templates.notFound = o.templates.notFound || o.templates.empty; + if (!o.source) { + $.error("missing source"); + } + if (!o.node) { + $.error("missing node"); + } + if (o.name && !isValidName(o.name)) { + $.error("invalid dataset name: " + o.name); + } + www.mixin(this); + this.highlight = !!o.highlight; + this.name = _.toStr(o.name || nameGenerator()); + this.limit = o.limit || 5; + this.displayFn = getDisplayFn(o.display || o.displayKey); + this.templates = getTemplates(o.templates, this.displayFn); + this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source; + this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async; + this._resetLastSuggestion(); + this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name); + } + Dataset.extractData = function extractData(el) { + var $el = $(el); + if ($el.data(keys.obj)) { + return { + dataset: $el.data(keys.dataset) || "", + val: $el.data(keys.val) || "", + obj: $el.data(keys.obj) || null + }; + } + return null; + }; + _.mixin(Dataset.prototype, EventEmitter, { + _overwrite: function overwrite(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (this.async && this.templates.pending) { + this._renderPending(query); + } else if (!this.async && this.templates.notFound) { + this._renderNotFound(query); + } else { + this._empty(); + } + this.trigger("rendered", suggestions, false, this.name); + }, + _append: function append(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length && this.$lastSuggestion.length) { + this._appendSuggestions(query, suggestions); + } else if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (!this.$lastSuggestion.length && this.templates.notFound) { + this._renderNotFound(query); + } + this.trigger("rendered", suggestions, true, this.name); + }, + _renderSuggestions: function renderSuggestions(query, suggestions) { + var $fragment; + $fragment = this._getSuggestionsFragment(query, suggestions); + this.$lastSuggestion = $fragment.children().last(); + this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions)); + }, + _appendSuggestions: function appendSuggestions(query, suggestions) { + var $fragment, $lastSuggestion; + $fragment = this._getSuggestionsFragment(query, suggestions); + $lastSuggestion = $fragment.children().last(); + this.$lastSuggestion.after($fragment); + this.$lastSuggestion = $lastSuggestion; + }, + _renderPending: function renderPending(query) { + var template = this.templates.pending; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _renderNotFound: function renderNotFound(query) { + var template = this.templates.notFound; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _empty: function empty() { + this.$el.empty(); + this._resetLastSuggestion(); + }, + _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) { + var that = this, fragment; + fragment = document.createDocumentFragment(); + _.each(suggestions, function getSuggestionNode(suggestion) { + var $el, context; + context = that._injectQuery(query, suggestion); + $el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable); + fragment.appendChild($el[0]); + }); + this.highlight && highlight({ + className: this.classes.highlight, + node: fragment, + pattern: query + }); + return $(fragment); + }, + _getFooter: function getFooter(query, suggestions) { + return this.templates.footer ? this.templates.footer({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _getHeader: function getHeader(query, suggestions) { + return this.templates.header ? this.templates.header({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _resetLastSuggestion: function resetLastSuggestion() { + this.$lastSuggestion = $(); + }, + _injectQuery: function injectQuery(query, obj) { + return _.isObject(obj) ? _.mixin({ + _query: query + }, obj) : obj; + }, + update: function update(query) { + var that = this, canceled = false, syncCalled = false, rendered = 0; + this.cancel(); + this.cancel = function cancel() { + canceled = true; + that.cancel = $.noop; + that.async && that.trigger("asyncCanceled", query, that.name); + }; + this.source(query, sync, async); + !syncCalled && sync([]); + function sync(suggestions) { + if (syncCalled) { + return; + } + syncCalled = true; + suggestions = (suggestions || []).slice(0, that.limit); + rendered = suggestions.length; + that._overwrite(query, suggestions); + if (rendered < that.limit && that.async) { + that.trigger("asyncRequested", query, that.name); + } + } + function async(suggestions) { + suggestions = suggestions || []; + if (!canceled && rendered < that.limit) { + that.cancel = $.noop; + var idx = Math.abs(rendered - that.limit); + rendered += idx; + that._append(query, suggestions.slice(0, idx)); + that.async && that.trigger("asyncReceived", query, that.name); + } + } + }, + cancel: $.noop, + clear: function clear() { + this._empty(); + this.cancel(); + this.trigger("cleared"); + }, + isEmpty: function isEmpty() { + return this.$el.is(":empty"); + }, + destroy: function destroy() { + this.$el = $("
    "); + } + }); + return Dataset; + function getDisplayFn(display) { + display = display || _.stringify; + return _.isFunction(display) ? display : displayFn; + function displayFn(obj) { + return obj[display]; + } + } + function getTemplates(templates, displayFn) { + return { + notFound: templates.notFound && _.templatify(templates.notFound), + pending: templates.pending && _.templatify(templates.pending), + header: templates.header && _.templatify(templates.header), + footer: templates.footer && _.templatify(templates.footer), + suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate + }; + function userSuggestionTemplate(context) { + var template = templates.suggestion; + return $(template(context)).attr("id", _.guid()); + } + function suggestionTemplate(context) { + return $('
    ').attr("id", _.guid()).text(displayFn(context)); + } + } + function isValidName(str) { + return /^[_a-zA-Z0-9-]+$/.test(str); + } + }(); + var Menu = function() { + "use strict"; + function Menu(o, www) { + var that = this; + o = o || {}; + if (!o.node) { + $.error("node is required"); + } + www.mixin(this); + this.$node = $(o.node); + this.query = null; + this.datasets = _.map(o.datasets, initializeDataset); + function initializeDataset(oDataset) { + var node = that.$node.find(oDataset.node).first(); + oDataset.node = node.length ? node : $("
    ").appendTo(that.$node); + return new Dataset(oDataset, www); + } + } + _.mixin(Menu.prototype, EventEmitter, { + _onSelectableClick: function onSelectableClick($e) { + this.trigger("selectableClicked", $($e.currentTarget)); + }, + _onRendered: function onRendered(type, dataset, suggestions, async) { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetRendered", dataset, suggestions, async); + }, + _onCleared: function onCleared() { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetCleared"); + }, + _propagate: function propagate() { + this.trigger.apply(this, arguments); + }, + _allDatasetsEmpty: function allDatasetsEmpty() { + return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) { + var isEmpty = dataset.isEmpty(); + this.$node.attr("aria-expanded", !isEmpty); + return isEmpty; + }, this)); + }, + _getSelectables: function getSelectables() { + return this.$node.find(this.selectors.selectable); + }, + _removeCursor: function _removeCursor() { + var $selectable = this.getActiveSelectable(); + $selectable && $selectable.removeClass(this.classes.cursor); + }, + _ensureVisible: function ensureVisible($el) { + var elTop, elBottom, nodeScrollTop, nodeHeight; + elTop = $el.position().top; + elBottom = elTop + $el.outerHeight(true); + nodeScrollTop = this.$node.scrollTop(); + nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10); + if (elTop < 0) { + this.$node.scrollTop(nodeScrollTop + elTop); + } else if (nodeHeight < elBottom) { + this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight)); + } + }, + bind: function() { + var that = this, onSelectableClick; + onSelectableClick = _.bind(this._onSelectableClick, this); + this.$node.on("click.tt", this.selectors.selectable, onSelectableClick); + this.$node.on("mouseover", this.selectors.selectable, function() { + that.setCursor($(this)); + }); + this.$node.on("mouseleave", function() { + that._removeCursor(); + }); + _.each(this.datasets, function(dataset) { + dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that); + }); + return this; + }, + isOpen: function isOpen() { + return this.$node.hasClass(this.classes.open); + }, + open: function open() { + this.$node.scrollTop(0); + this.$node.addClass(this.classes.open); + }, + close: function close() { + this.$node.attr("aria-expanded", false); + this.$node.removeClass(this.classes.open); + this._removeCursor(); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.attr("dir", dir); + }, + selectableRelativeToCursor: function selectableRelativeToCursor(delta) { + var $selectables, $oldCursor, oldIndex, newIndex; + $oldCursor = this.getActiveSelectable(); + $selectables = this._getSelectables(); + oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1; + newIndex = oldIndex + delta; + newIndex = (newIndex + 1) % ($selectables.length + 1) - 1; + newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex; + return newIndex === -1 ? null : $selectables.eq(newIndex); + }, + setCursor: function setCursor($selectable) { + this._removeCursor(); + if ($selectable = $selectable && $selectable.first()) { + $selectable.addClass(this.classes.cursor); + this._ensureVisible($selectable); + } + }, + getSelectableData: function getSelectableData($el) { + return $el && $el.length ? Dataset.extractData($el) : null; + }, + getActiveSelectable: function getActiveSelectable() { + var $selectable = this._getSelectables().filter(this.selectors.cursor).first(); + return $selectable.length ? $selectable : null; + }, + getTopSelectable: function getTopSelectable() { + var $selectable = this._getSelectables().first(); + return $selectable.length ? $selectable : null; + }, + update: function update(query) { + var isValidUpdate = query !== this.query; + if (isValidUpdate) { + this.query = query; + _.each(this.datasets, updateDataset); + } + return isValidUpdate; + function updateDataset(dataset) { + dataset.update(query); + } + }, + empty: function empty() { + _.each(this.datasets, clearDataset); + this.query = null; + this.$node.addClass(this.classes.empty); + function clearDataset(dataset) { + dataset.clear(); + } + }, + destroy: function destroy() { + this.$node.off(".tt"); + this.$node = $("
    "); + _.each(this.datasets, destroyDataset); + function destroyDataset(dataset) { + dataset.destroy(); + } + } + }); + return Menu; + }(); + var Status = function() { + "use strict"; + function Status(options) { + this.$el = $("", { + role: "status", + "aria-live": "polite" + }).css({ + position: "absolute", + padding: "0", + border: "0", + height: "1px", + width: "1px", + "margin-bottom": "-1px", + "margin-right": "-1px", + overflow: "hidden", + clip: "rect(0 0 0 0)", + "white-space": "nowrap" + }); + options.$input.after(this.$el); + _.each(options.menu.datasets, _.bind(function(dataset) { + if (dataset.onSync) { + dataset.onSync("rendered", _.bind(this.update, this)); + dataset.onSync("cleared", _.bind(this.cleared, this)); + } + }, this)); + } + _.mixin(Status.prototype, { + update: function update(event, suggestions) { + var length = suggestions.length; + var words; + if (length === 1) { + words = { + result: "result", + is: "is" + }; + } else { + words = { + result: "results", + is: "are" + }; + } + this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate."); + }, + cleared: function() { + this.$el.text(""); + } + }); + return Status; + }(); + var DefaultMenu = function() { + "use strict"; + var s = Menu.prototype; + function DefaultMenu() { + Menu.apply(this, [].slice.call(arguments, 0)); + } + _.mixin(DefaultMenu.prototype, Menu.prototype, { + open: function open() { + !this._allDatasetsEmpty() && this._show(); + return s.open.apply(this, [].slice.call(arguments, 0)); + }, + close: function close() { + this._hide(); + return s.close.apply(this, [].slice.call(arguments, 0)); + }, + _onRendered: function onRendered() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onRendered.apply(this, [].slice.call(arguments, 0)); + }, + _onCleared: function onCleared() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onCleared.apply(this, [].slice.call(arguments, 0)); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl); + return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0)); + }, + _hide: function hide() { + this.$node.hide(); + }, + _show: function show() { + this.$node.css("display", "block"); + } + }); + return DefaultMenu; + }(); + var Typeahead = function() { + "use strict"; + function Typeahead(o, www) { + var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged; + o = o || {}; + if (!o.input) { + $.error("missing input"); + } + if (!o.menu) { + $.error("missing menu"); + } + if (!o.eventBus) { + $.error("missing event bus"); + } + www.mixin(this); + this.eventBus = o.eventBus; + this.minLength = _.isNumber(o.minLength) ? o.minLength : 1; + this.input = o.input; + this.menu = o.menu; + this.enabled = true; + this.autoselect = !!o.autoselect; + this.active = false; + this.input.hasFocus() && this.activate(); + this.dir = this.input.getLangDir(); + this._hacks(); + this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this); + onFocused = c(this, "activate", "open", "_onFocused"); + onBlurred = c(this, "deactivate", "_onBlurred"); + onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed"); + onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed"); + onEscKeyed = c(this, "isActive", "_onEscKeyed"); + onUpKeyed = c(this, "isActive", "open", "_onUpKeyed"); + onDownKeyed = c(this, "isActive", "open", "_onDownKeyed"); + onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed"); + onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed"); + onQueryChanged = c(this, "_openIfActive", "_onQueryChanged"); + onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged"); + this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this); + } + _.mixin(Typeahead.prototype, { + _hacks: function hacks() { + var $input, $menu; + $input = this.input.$input || $("
    "); + $menu = this.menu.$node || $("
    "); + $input.on("blur.tt", function($e) { + var active, isActive, hasActive; + active = document.activeElement; + isActive = $menu.is(active); + hasActive = $menu.has(active).length > 0; + if (_.isMsie() && (isActive || hasActive)) { + $e.preventDefault(); + $e.stopImmediatePropagation(); + _.defer(function() { + $input.focus(); + }); + } + }); + $menu.on("mousedown.tt", function($e) { + $e.preventDefault(); + }); + }, + _onSelectableClicked: function onSelectableClicked(type, $el) { + this.select($el); + }, + _onDatasetCleared: function onDatasetCleared() { + this._updateHint(); + }, + _onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) { + this._updateHint(); + if (this.autoselect) { + var cursorClass = this.selectors.cursor.substr(1); + this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass); + } + this.eventBus.trigger("render", suggestions, async, dataset); + }, + _onAsyncRequested: function onAsyncRequested(type, dataset, query) { + this.eventBus.trigger("asyncrequest", query, dataset); + }, + _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) { + this.eventBus.trigger("asynccancel", query, dataset); + }, + _onAsyncReceived: function onAsyncReceived(type, dataset, query) { + this.eventBus.trigger("asyncreceive", query, dataset); + }, + _onFocused: function onFocused() { + this._minLengthMet() && this.menu.update(this.input.getQuery()); + }, + _onBlurred: function onBlurred() { + if (this.input.hasQueryChangedSinceLastFocus()) { + this.eventBus.trigger("change", this.input.getQuery()); + } + }, + _onEnterKeyed: function onEnterKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + if (this.select($selectable)) { + $e.preventDefault(); + $e.stopPropagation(); + } + } else if (this.autoselect) { + if (this.select(this.menu.getTopSelectable())) { + $e.preventDefault(); + $e.stopPropagation(); + } + } + }, + _onTabKeyed: function onTabKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + this.select($selectable) && $e.preventDefault(); + } else if (this.autoselect) { + if ($selectable = this.menu.getTopSelectable()) { + this.autocomplete($selectable) && $e.preventDefault(); + } + } + }, + _onEscKeyed: function onEscKeyed() { + this.close(); + }, + _onUpKeyed: function onUpKeyed() { + this.moveCursor(-1); + }, + _onDownKeyed: function onDownKeyed() { + this.moveCursor(+1); + }, + _onLeftKeyed: function onLeftKeyed() { + if (this.dir === "rtl" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onRightKeyed: function onRightKeyed() { + if (this.dir === "ltr" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onQueryChanged: function onQueryChanged(e, query) { + this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty(); + }, + _onWhitespaceChanged: function onWhitespaceChanged() { + this._updateHint(); + }, + _onLangDirChanged: function onLangDirChanged(e, dir) { + if (this.dir !== dir) { + this.dir = dir; + this.menu.setLanguageDirection(dir); + } + }, + _openIfActive: function openIfActive() { + this.isActive() && this.open(); + }, + _minLengthMet: function minLengthMet(query) { + query = _.isString(query) ? query : this.input.getQuery() || ""; + return query.length >= this.minLength; + }, + _updateHint: function updateHint() { + var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match; + $selectable = this.menu.getTopSelectable(); + data = this.menu.getSelectableData($selectable); + val = this.input.getInputValue(); + if (data && !_.isBlankString(val) && !this.input.hasOverflow()) { + query = Input.normalizeQuery(val); + escapedQuery = _.escapeRegExChars(query); + frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i"); + match = frontMatchRegEx.exec(data.val); + match && this.input.setHint(val + match[1]); + } else { + this.input.clearHint(); + } + }, + isEnabled: function isEnabled() { + return this.enabled; + }, + enable: function enable() { + this.enabled = true; + }, + disable: function disable() { + this.enabled = false; + }, + isActive: function isActive() { + return this.active; + }, + activate: function activate() { + if (this.isActive()) { + return true; + } else if (!this.isEnabled() || this.eventBus.before("active")) { + return false; + } else { + this.active = true; + this.eventBus.trigger("active"); + return true; + } + }, + deactivate: function deactivate() { + if (!this.isActive()) { + return true; + } else if (this.eventBus.before("idle")) { + return false; + } else { + this.active = false; + this.close(); + this.eventBus.trigger("idle"); + return true; + } + }, + isOpen: function isOpen() { + return this.menu.isOpen(); + }, + open: function open() { + if (!this.isOpen() && !this.eventBus.before("open")) { + this.input.setAriaExpanded(true); + this.menu.open(); + this._updateHint(); + this.eventBus.trigger("open"); + } + return this.isOpen(); + }, + close: function close() { + if (this.isOpen() && !this.eventBus.before("close")) { + this.input.setAriaExpanded(false); + this.menu.close(); + this.input.clearHint(); + this.input.resetInputValue(); + this.eventBus.trigger("close"); + } + return !this.isOpen(); + }, + setVal: function setVal(val) { + this.input.setQuery(_.toStr(val)); + }, + getVal: function getVal() { + return this.input.getQuery(); + }, + select: function select($selectable) { + var data = this.menu.getSelectableData($selectable); + if (data && !this.eventBus.before("select", data.obj, data.dataset)) { + this.input.setQuery(data.val, true); + this.eventBus.trigger("select", data.obj, data.dataset); + this.close(); + return true; + } + return false; + }, + autocomplete: function autocomplete($selectable) { + var query, data, isValid; + query = this.input.getQuery(); + data = this.menu.getSelectableData($selectable); + isValid = data && query !== data.val; + if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) { + this.input.setQuery(data.val); + this.eventBus.trigger("autocomplete", data.obj, data.dataset); + return true; + } + return false; + }, + moveCursor: function moveCursor(delta) { + var query, $candidate, data, suggestion, datasetName, cancelMove, id; + query = this.input.getQuery(); + $candidate = this.menu.selectableRelativeToCursor(delta); + data = this.menu.getSelectableData($candidate); + suggestion = data ? data.obj : null; + datasetName = data ? data.dataset : null; + id = $candidate ? $candidate.attr("id") : null; + this.input.trigger("cursorchange", id); + cancelMove = this._minLengthMet() && this.menu.update(query); + if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) { + this.menu.setCursor($candidate); + if (data) { + if (typeof data.val === "string") { + this.input.setInputValue(data.val); + } + } else { + this.input.resetInputValue(); + this._updateHint(); + } + this.eventBus.trigger("cursorchange", suggestion, datasetName); + return true; + } + return false; + }, + destroy: function destroy() { + this.input.destroy(); + this.menu.destroy(); + } + }); + return Typeahead; + function c(ctx) { + var methods = [].slice.call(arguments, 1); + return function() { + var args = [].slice.call(arguments); + _.each(methods, function(method) { + return ctx[method].apply(ctx, args); + }); + }; + } + }(); + (function() { + "use strict"; + var old, keys, methods; + old = $.fn.typeahead; + keys = { + www: "tt-www", + attrs: "tt-attrs", + typeahead: "tt-typeahead" + }; + methods = { + initialize: function initialize(o, datasets) { + var www; + datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1); + o = o || {}; + www = WWW(o.classNames); + return this.each(attach); + function attach() { + var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor; + _.each(datasets, function(d) { + d.highlight = !!o.highlight; + }); + $input = $(this); + $wrapper = $(www.html.wrapper); + $hint = $elOrNull(o.hint); + $menu = $elOrNull(o.menu); + defaultHint = o.hint !== false && !$hint; + defaultMenu = o.menu !== false && !$menu; + defaultHint && ($hint = buildHintFromInput($input, www)); + defaultMenu && ($menu = $(www.html.menu).css(www.css.menu)); + $hint && $hint.val(""); + $input = prepInput($input, www); + if (defaultHint || defaultMenu) { + $wrapper.css(www.css.wrapper); + $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint); + $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null); + } + MenuConstructor = defaultMenu ? DefaultMenu : Menu; + eventBus = new EventBus({ + el: $input + }); + input = new Input({ + hint: $hint, + input: $input, + menu: $menu + }, www); + menu = new MenuConstructor({ + node: $menu, + datasets: datasets + }, www); + status = new Status({ + $input: $input, + menu: menu + }); + typeahead = new Typeahead({ + input: input, + menu: menu, + eventBus: eventBus, + minLength: o.minLength, + autoselect: o.autoselect + }, www); + $input.data(keys.www, www); + $input.data(keys.typeahead, typeahead); + } + }, + isEnabled: function isEnabled() { + var enabled; + ttEach(this.first(), function(t) { + enabled = t.isEnabled(); + }); + return enabled; + }, + enable: function enable() { + ttEach(this, function(t) { + t.enable(); + }); + return this; + }, + disable: function disable() { + ttEach(this, function(t) { + t.disable(); + }); + return this; + }, + isActive: function isActive() { + var active; + ttEach(this.first(), function(t) { + active = t.isActive(); + }); + return active; + }, + activate: function activate() { + ttEach(this, function(t) { + t.activate(); + }); + return this; + }, + deactivate: function deactivate() { + ttEach(this, function(t) { + t.deactivate(); + }); + return this; + }, + isOpen: function isOpen() { + var open; + ttEach(this.first(), function(t) { + open = t.isOpen(); + }); + return open; + }, + open: function open() { + ttEach(this, function(t) { + t.open(); + }); + return this; + }, + close: function close() { + ttEach(this, function(t) { + t.close(); + }); + return this; + }, + select: function select(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.select($el); + }); + return success; + }, + autocomplete: function autocomplete(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.autocomplete($el); + }); + return success; + }, + moveCursor: function moveCursoe(delta) { + var success = false; + ttEach(this.first(), function(t) { + success = t.moveCursor(delta); + }); + return success; + }, + val: function val(newVal) { + var query; + if (!arguments.length) { + ttEach(this.first(), function(t) { + query = t.getVal(); + }); + return query; + } else { + ttEach(this, function(t) { + t.setVal(_.toStr(newVal)); + }); + return this; + } + }, + destroy: function destroy() { + ttEach(this, function(typeahead, $input) { + revert($input); + typeahead.destroy(); + }); + return this; + } + }; + $.fn.typeahead = function(method) { + if (methods[method]) { + return methods[method].apply(this, [].slice.call(arguments, 1)); + } else { + return methods.initialize.apply(this, arguments); + } + }; + $.fn.typeahead.noConflict = function noConflict() { + $.fn.typeahead = old; + return this; + }; + function ttEach($els, fn) { + $els.each(function() { + var $input = $(this), typeahead; + (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input); + }); + } + function buildHintFromInput($input, www) { + return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({ + readonly: true, + required: false + }).removeAttr("id name placeholder").removeClass("required").attr({ + spellcheck: "false", + tabindex: -1 + }); + } + function prepInput($input, www) { + $input.data(keys.attrs, { + dir: $input.attr("dir"), + autocomplete: $input.attr("autocomplete"), + spellcheck: $input.attr("spellcheck"), + style: $input.attr("style") + }); + $input.addClass(www.classes.input).attr({ + spellcheck: false + }); + try { + !$input.attr("dir") && $input.attr("dir", "auto"); + } catch (e) {} + return $input; + } + function getBackgroundStyles($el) { + return { + backgroundAttachment: $el.css("background-attachment"), + backgroundClip: $el.css("background-clip"), + backgroundColor: $el.css("background-color"), + backgroundImage: $el.css("background-image"), + backgroundOrigin: $el.css("background-origin"), + backgroundPosition: $el.css("background-position"), + backgroundRepeat: $el.css("background-repeat"), + backgroundSize: $el.css("background-size") + }; + } + function revert($input) { + var www, $wrapper; + www = $input.data(keys.www); + $wrapper = $input.parent().filter(www.selectors.wrapper); + _.each($input.data(keys.attrs), function(val, key) { + _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val); + }); + $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input); + if ($wrapper.length) { + $input.detach().insertAfter($wrapper); + $wrapper.remove(); + } + } + function $elOrNull(obj) { + var isValid, $el; + isValid = _.isJQuery(obj) || _.isElement(obj); + $el = isValid ? $(obj).first() : []; + return $el.length ? $el : null; + } + })(); +}); \ No newline at end of file diff --git a/docs/search.json b/docs/search.json index 5493606..4e2520d 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -{"Typealiases.html#/s:6RxFlow04NextB5Itemsa":{"name":"NextFlowItems","abstract":"

    typealias to allow compliance with older versions of RxFlow. NextFlowItems should be replaced by FlowContributors

    "},"Typealiases.html#/s:6RxFlow11Coordinatora":{"name":"Coordinator","abstract":"

    typealias to allow compliance with older versions of RxFlow. Coordinator should be replaced by FlowCoordinator

    "},"Protocols/Stepper.html#/s:6RxFlow7StepperP5steps0A5Relay07PublishE0CyAA4Step_pGvp":{"name":"steps","abstract":"

    the relay used to emit steps inside this Stepper

    ","parent_name":"Stepper"},"Protocols/Stepper.html#/s:6RxFlow7StepperP11initialStepAA0E0_pvp":{"name":"initialStep","abstract":"

    the initial step that will be emitted when listening to this Stepper

    ","parent_name":"Stepper"},"Protocols/Stepper.html#/s:6RxFlow7StepperP16readyToEmitStepsyyF":{"name":"readyToEmitSteps()","abstract":"

    function called when stepper is listened by the FlowCoordinator

    ","parent_name":"Stepper"},"Protocols/Presentable.html#/s:6RxFlow11PresentableP9rxVisible0A5Swift10ObservableCySbGvp":{"name":"rxVisible","abstract":"

    Rx Observable that triggers a bool indicating if the current Presentable is being displayed","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentableP11rxDismissed0A5Swift17PrimitiveSequenceVyAE11SingleTraitOytGvp":{"name":"rxDismissed","abstract":"

    Rx Observable (Single trait) triggered when this presentable is dismissed

    ","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentablePAASo16UIViewControllerCRbzrlE9rxVisible0A5Swift10ObservableCySbGvp":{"name":"rxVisible","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentablePAASo16UIViewControllerCRbzrlE11rxDismissed0A5Swift17PrimitiveSequenceVyAG11SingleTraitOytGvp":{"name":"rxDismissed","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentablePA2A0B0RzrlE9rxVisible0A5Swift10ObservableCySbGvp":{"name":"rxVisible","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentablePA2A0B0RzrlE11rxDismissed0A5Swift17PrimitiveSequenceVyAF11SingleTraitOytGvp":{"name":"rxDismissed","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentablePAASo8UIWindowCRbzrlE9rxVisible0A5Swift10ObservableCySbGvp":{"name":"rxVisible","parent_name":"Presentable"},"Protocols/Presentable.html#/s:6RxFlow11PresentablePAASo8UIWindowCRbzrlE11rxDismissed0A5Swift17PrimitiveSequenceVyAG11SingleTraitOytGvp":{"name":"rxDismissed","parent_name":"Presentable"},"Protocols/Flow.html#/s:6RxFlow0B0P4rootAA11Presentable_pvp":{"name":"root","abstract":"

    the Presentable on which rely the navigation inside this Flow. This method must always give the same instance

    ","parent_name":"Flow"},"Protocols/Flow.html#/s:6RxFlow0B0P5adapt4step0A5Swift17PrimitiveSequenceVyAF11SingleTraitOAA4Step_pGAaK_p_tF":{"name":"adapt(step:)","abstract":"

    Adapts an incoming step before the navigate(to:) function

    ","parent_name":"Flow"},"Protocols/Flow.html#/s:6RxFlow0B0P8navigate2toAA0B12ContributorsOAA4Step_p_tF":{"name":"navigate(to:)","abstract":"

    Resolves FlowContributors according to the Step, in the context of this very Flow

    ","parent_name":"Flow"},"Protocols/Flow.html":{"name":"Flow","abstract":"

    A Flow defines a clear navigation area. Combined to a Step it leads to a navigation action

    "},"Protocols/Presentable.html":{"name":"Presentable","abstract":"

    An abstraction of what can be presented to the screen. For now, UIViewControllers and Flows are Presentable

    "},"Protocols.html#/s:6RxFlow4StepP":{"name":"Step","abstract":"

    A Step describes a possible state of navigation inside a Flow

    "},"Protocols/Stepper.html":{"name":"Stepper","abstract":"

    a Stepper has only one purpose is: emits Steps that correspond to specific navigation states."},"Protocols.html#/s:6RxFlow14SynchronizableP":{"name":"Synchronizable","abstract":"

    Provides a function to prevent concurrent block execution

    "},"Extensions/Reactive.html#/s:7RxSwift8ReactiveV0A4FlowSo16UIViewControllerCRbzlE9dismissed0A5Cocoa12ControlEventVySbGvp":{"name":"dismissed","abstract":"

    Rx observable, triggered when the view is being dismissed

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/s:7RxSwift8ReactiveV0A4FlowSo16UIViewControllerCRbzlE9displayedAA10ObservableCySbGvp":{"name":"displayed","abstract":"

    Rx observable, triggered when the view appearance state changes

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/s:7RxSwift8ReactiveV0A4FlowSo8UIWindowCRbzlE15windowDidAppearAA10ObservableCyytGvp":{"name":"windowDidAppear","abstract":"

    Rx Observable that is triggered once the UIWindow is displayed

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/s:7RxSwift8ReactiveV0A4FlowAD0D11CoordinatorCRbzlE12willNavigateAA10ObservableCyAD0D0_p_AD4Step_ptGvp":{"name":"willNavigate","abstract":"

    Rx Observable emitted before the navigation to a Step within a Flow

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/s:7RxSwift8ReactiveV0A4FlowAD0D11CoordinatorCRbzlE11didNavigateAA10ObservableCyAD0D0_p_AD4Step_ptGvp":{"name":"didNavigate","abstract":"

    Rx Observable emitted after the navigation to a Step within a Flow

    ","parent_name":"Reactive"},"Extensions/ObservableType.html#/s:7RxSwift14ObservableTypeP0A4FlowE8pausable10withPauserAA0C0Cy7ElementQzGqd___tAaBRd__SbAIRtd__lF":{"name":"pausable(withPauser:)","abstract":"

    Pauses the elements of the source observable sequence based on the latest element from the second observable sequence.","parent_name":"ObservableType"},"Extensions/ObservableType.html#/s:7RxSwift14ObservableTypeP0A4FlowE8pausable10afterCount10withPauserAA0C0Cy7ElementQzGSi_qd__tAaBRd__SbAJRtd__lF":{"name":"pausable(afterCount:withPauser:)","abstract":"

    Pauses the elements of the source observable sequence based on the latest element from the second observable sequence.","parent_name":"ObservableType"},"Extensions/ObservableType.html":{"name":"ObservableType"},"Extensions/Reactive.html":{"name":"Reactive"},"Extensions.html#/c:objc(cs)UIViewController":{"name":"UIViewController"},"Extensions.html#/c:objc(cs)UIWindow":{"name":"UIWindow"},"Enums/RxFlowStep.html#/s:6RxFlow0aB4StepO4homeyA2CmF":{"name":"home","abstract":"

    can be used to express a Flow first step

    ","parent_name":"RxFlowStep"},"Enums/FlowContributors.html#/s:6RxFlow0B12ContributorsO8multipleyACSayAA0B11ContributorOG_tcACmF":{"name":"multiple(flowContributors:)","abstract":"

    a Flow will trigger several FlowContributor at the same time for the same Step

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/s:6RxFlow0B12ContributorsO3oneyAcA0B11ContributorO_tcACmF":{"name":"one(flowContributor:)","abstract":"

    a Flow will trigger only one FlowContributor for a Step

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/s:6RxFlow0B12ContributorsO3endyAcA4Step_p_tcACmF":{"name":"end(forwardToParentFlowWithStep:)","abstract":"

    a Flow will trigger a special FlowContributor that represents the dismissal of this Flow

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/s:6RxFlow0B12ContributorsO4noneyA2CmF":{"name":"none","abstract":"

    no further navigation will be triggered for a Step

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/s:6RxFlow0B12ContributorsO013triggerParentB0yAcA4Step_p_tcACmF":{"name":"triggerParentFlow(withStep:)","abstract":"

    same as .one(flowContributor: .forwardToParentFlow(withStep: Step)). Should not be used anymore

    ","parent_name":"FlowContributors"},"Enums/FlowContributor.html#/s:6RxFlow0B11ContributorO10contributeyAcA11Presentable_p_AA7Stepper_pSbtcACmF":{"name":"contribute(withNextPresentable:withNextStepper:allowStepWhenNotPresented:)","abstract":"

    the given stepper will emit steps, according to lifecycle of the given presentable, that will contribute to the current Flow","parent_name":"FlowContributor"},"Enums/FlowContributor.html#/s:6RxFlow0B11ContributorO016forwardToCurrentB0yAcA4Step_p_tcACmF":{"name":"forwardToCurrentFlow(withStep:)","abstract":"

    the “withStep” step will be forwarded to the current flow

    ","parent_name":"FlowContributor"},"Enums/FlowContributor.html#/s:6RxFlow0B11ContributorO015forwardToParentB0yAcA4Step_p_tcACmF":{"name":"forwardToParentFlow(withStep:)","abstract":"

    the “withStep” step will be forwarded to the parent flow

    ","parent_name":"FlowContributor"},"Enums/FlowContributor.html#/s:6RxFlow0B11ContributorO10contribute8withNextAcA11Presentable_AA7Stepperp_tFZ":{"name":"contribute(withNext:)","abstract":"

    Shortcut static func that returns a .contribute(withNextPresentable: _, withNextStepper: _)","parent_name":"FlowContributor"},"Enums/FlowContributor.html":{"name":"FlowContributor","abstract":"

    A FlowContributor describes the next thing that will contribute to a Flow.

    "},"Enums/FlowContributors.html":{"name":"FlowContributors","abstract":"

    FlowContributors represent the next things that will trigger"},"Enums/RxFlowStep.html":{"name":"RxFlowStep","abstract":"

    Standard RxFlow Steps

    "},"Classes/CompositeStepper.html#/s:6RxFlow7StepperP5steps0A5Relay07PublishE0CyAA4Step_pGvp":{"name":"steps","parent_name":"CompositeStepper"},"Classes/CompositeStepper.html#/s:6RxFlow16CompositeStepperC8steppersACSayAA0D0_pG_tcfc":{"name":"init(steppers:)","abstract":"

    Initialize

    ","parent_name":"CompositeStepper"},"Classes/CompositeStepper.html#/s:6RxFlow7StepperP16readyToEmitStepsyyF":{"name":"readyToEmitSteps()","parent_name":"CompositeStepper"},"Classes/DefaultStepper.html#/s:6RxFlow14DefaultStepperCACycfc":{"name":"init()","abstract":"

    Initialize the DefaultStepper

    ","parent_name":"DefaultStepper"},"Classes/OneStepper.html#/s:6RxFlow7StepperP5steps0A5Relay07PublishE0CyAA4Step_pGvp":{"name":"steps","parent_name":"OneStepper"},"Classes/OneStepper.html#/s:6RxFlow10OneStepperC14withSingleStepAcA0G0_p_tcfc":{"name":"init(withSingleStep:)","abstract":"

    Initialize the OneStepper

    ","parent_name":"OneStepper"},"Classes/OneStepper.html#/s:6RxFlow7StepperP11initialStepAA0E0_pvp":{"name":"initialStep","parent_name":"OneStepper"},"Classes/FlowCoordinator.html#/s:6RxFlow0B11CoordinatorC10coordinate4flow4withyAA0B0_p_AA7Stepper_ptF":{"name":"coordinate(flow:with:)","abstract":"

    Undocumented

    ","parent_name":"FlowCoordinator"},"Classes/Flows.html#/s:6RxFlow5FlowsC9whenReady5flows5blockySayAA0B0_pG_ySayxGctSo16UIViewControllerCRbzlFZ":{"name":"whenReady(flows:block:)","abstract":"

    Allow to be triggered only when Flows given as parameters are ready to be displayed.","parent_name":"Flows"},"Classes/Flows.html#/s:6RxFlow5FlowsC9whenReady5flow15flow25flow35flow45flow55blockyAA0B0_p_AaK_pAaK_pAaK_pAaK_pyx_q_q0_q1_q2_tctSo16UIViewControllerCRbzAMRb_AMRb0_AMRb1_AMRb2_r3_lFZ":{"name":"whenReady(flow1:flow2:flow3:flow4:flow5:block:)","abstract":"

    Allow to be triggered only when Flows given as parameters are ready to be displayed.","parent_name":"Flows"},"Classes/Flows.html#/s:6RxFlow5FlowsC9whenReady5flow15flow25flow35flow45blockyAA0B0_p_AaJ_pAaJ_pAaJ_pyx_q_q0_q1_tctSo16UIViewControllerCRbzALRb_ALRb0_ALRb1_r2_lFZ":{"name":"whenReady(flow1:flow2:flow3:flow4:block:)","abstract":"

    Allow to be triggered only when Flows given as parameters are ready to be displayed.","parent_name":"Flows"},"Classes/Flows.html#/s:6RxFlow5FlowsC9whenReady5flow15flow25flow35blockyAA0B0_p_AaI_pAaI_pyx_q_q0_tctSo16UIViewControllerCRbzAKRb_AKRb0_r1_lFZ":{"name":"whenReady(flow1:flow2:flow3:block:)","abstract":"

    Allow to be triggered only when Flows given as parameters are ready to be displayed.","parent_name":"Flows"},"Classes/Flows.html#/s:6RxFlow5FlowsC9whenReady5flow15flow25blockyAA0B0_p_AaH_pyx_q_tctSo16UIViewControllerCRbzAJRb_r0_lFZ":{"name":"whenReady(flow1:flow2:block:)","abstract":"

    Allow to be triggered only when Flows given as parameters are ready to be displayed.","parent_name":"Flows"},"Classes/Flows.html#/s:6RxFlow5FlowsC9whenReady5flow15blockyAA0B0_p_yxctSo16UIViewControllerCRbzlFZ":{"name":"whenReady(flow1:block:)","abstract":"

    Allow to be triggered only when Flow given as parameters is ready to be displayed.","parent_name":"Flows"},"Classes/Flows.html":{"name":"Flows","abstract":"

    Utility functions to synchronize Flows readyness

    "},"Classes/FlowCoordinator.html":{"name":"FlowCoordinator","abstract":"

    A FlowCoordinator handles the navigation of a Flow, based on its Stepper and the FlowContributors it emits

    "},"Classes/OneStepper.html":{"name":"OneStepper","abstract":"

    A Simple Stepper that has one goal: emit a single Step once initialized

    "},"Classes/DefaultStepper.html":{"name":"DefaultStepper","abstract":"

    A Simple Stepper that has one goal: emit a first default step equal to RxFlowStep.home

    "},"Classes/CompositeStepper.html":{"name":"CompositeStepper","abstract":"

    A Stepper that combines multiple steppers. All those Steppers will be associated"},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Enums.html":{"name":"Enumerations","abstract":"

    The following enumerations are available globally.

    "},"Extensions.html":{"name":"Extensions","abstract":"

    The following extensions are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "},"Typealiases.html":{"name":"Type Aliases","abstract":"

    The following type aliases are available globally.

    "}} \ No newline at end of file +{"Protocols/Stepper.html#/steps":{"name":"steps","abstract":"

    the relay used to emit steps inside this Stepper

    ","parent_name":"Stepper"},"Protocols/Stepper.html#/initialStep":{"name":"initialStep","abstract":"

    the initial step that will be emitted when listening to this Stepper

    ","parent_name":"Stepper"},"Protocols/Stepper.html#/readyToEmitSteps()":{"name":"readyToEmitSteps()","abstract":"

    function called when stepper is listened by the FlowCoordinator

    ","parent_name":"Stepper"},"Protocols/Presentable.html#/rxVisible":{"name":"rxVisible","abstract":"

    Rx Observable that triggers a bool indicating if the current Presentable is being displayed","parent_name":"Presentable"},"Protocols/Presentable.html#/rxDismissed":{"name":"rxDismissed","abstract":"

    Rx Observable (Single trait) triggered when this presentable is dismissed

    ","parent_name":"Presentable"},"Protocols/Flow.html#/root":{"name":"root","abstract":"

    the Presentable on which rely the navigation inside this Flow. This method must always give the same instance

    ","parent_name":"Flow"},"Protocols/Flow.html#/adapt(step:)":{"name":"adapt(step:)","abstract":"

    Adapts an incoming step before the navigate(to:) function

    ","parent_name":"Flow"},"Protocols/Flow.html#/navigate(to:)":{"name":"navigate(to:)","abstract":"

    Resolves FlowContributors according to the Step, in the context of this very Flow

    ","parent_name":"Flow"},"Protocols/Flow.html":{"name":"Flow","abstract":"

    A Flow defines a clear navigation area. Combined to a Step it leads to a navigation action

    "},"Protocols/Presentable.html":{"name":"Presentable","abstract":"

    An abstraction of what can be presented to the screen. For now, UIViewControllers and Flows are Presentable

    "},"Protocols.html#/Step":{"name":"Step","abstract":"

    A Step describes a possible state of navigation inside a Flow

    "},"Protocols/Stepper.html":{"name":"Stepper","abstract":"

    a Stepper has only one purpose is: emits Steps that correspond to specific navigation states."},"Protocols.html#/Synchronizable":{"name":"Synchronizable","abstract":"

    Provides a function to prevent concurrent block execution

    "},"Extensions/Reactive.html#/dismissed":{"name":"dismissed","abstract":"

    Rx observable, triggered when the view is being dismissed

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/displayed":{"name":"displayed","abstract":"

    Rx observable, triggered when the view appearance state changes

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/windowDidAppear":{"name":"windowDidAppear","abstract":"

    Rx Observable that is triggered once the UIWindow is displayed

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/willNavigate":{"name":"willNavigate","abstract":"

    Rx Observable emitted before the navigation to a Step within a Flow

    ","parent_name":"Reactive"},"Extensions/Reactive.html#/didNavigate":{"name":"didNavigate","abstract":"

    Rx Observable emitted after the navigation to a Step within a Flow

    ","parent_name":"Reactive"},"Extensions/ObservableType.html#/pausable(withPauser:)":{"name":"pausable(withPauser:)","abstract":"

    Pauses the elements of the source observable sequence based on the latest element from the second observable sequence.","parent_name":"ObservableType"},"Extensions/ObservableType.html#/pausable(afterCount:withPauser:)":{"name":"pausable(afterCount:withPauser:)","abstract":"

    Pauses the elements of the source observable sequence based on the latest element from the second observable sequence.","parent_name":"ObservableType"},"Extensions/ObservableType.html":{"name":"ObservableType"},"Extensions/Reactive.html":{"name":"Reactive"},"Extensions.html#/UIViewController":{"name":"UIViewController"},"Extensions.html#/UIWindow":{"name":"UIWindow"},"Enums/RxFlowStep.html#/home":{"name":"home","abstract":"

    can be used to express a Flow first step

    ","parent_name":"RxFlowStep"},"Enums/FlowContributors.html#/multiple(flowContributors:)":{"name":"multiple(flowContributors:)","abstract":"

    a Flow will trigger several FlowContributor at the same time for the same Step

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/one(flowContributor:)":{"name":"one(flowContributor:)","abstract":"

    a Flow will trigger only one FlowContributor for a Step

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/end(forwardToParentFlowWithStep:)":{"name":"end(forwardToParentFlowWithStep:)","abstract":"

    a Flow will trigger a special FlowContributor that represents the dismissal of this Flow

    ","parent_name":"FlowContributors"},"Enums/FlowContributors.html#/none":{"name":"none","abstract":"

    no further navigation will be triggered for a Step

    ","parent_name":"FlowContributors"},"Enums/FlowContributor.html#/contribute(withNextPresentable:withNextStepper:allowStepWhenNotPresented:)":{"name":"contribute(withNextPresentable:withNextStepper:allowStepWhenNotPresented:)","abstract":"

    the given stepper will emit steps, according to lifecycle of the given presentable, that will contribute to the current Flow","parent_name":"FlowContributor"},"Enums/FlowContributor.html#/forwardToCurrentFlow(withStep:)":{"name":"forwardToCurrentFlow(withStep:)","abstract":"

    the “withStep” step will be forwarded to the current flow

    ","parent_name":"FlowContributor"},"Enums/FlowContributor.html#/forwardToParentFlow(withStep:)":{"name":"forwardToParentFlow(withStep:)","abstract":"

    the “withStep” step will be forwarded to the parent flow

    ","parent_name":"FlowContributor"},"Enums/FlowContributor.html#/contribute(withNext:)":{"name":"contribute(withNext:)","abstract":"

    Shortcut static func that returns a .contribute(withNextPresentable: _, withNextStepper: _)","parent_name":"FlowContributor"},"Enums/Flows/ExecuteStrategy.html#/ready":{"name":"ready","parent_name":"ExecuteStrategy"},"Enums/Flows/ExecuteStrategy.html#/created":{"name":"created","parent_name":"ExecuteStrategy"},"Enums/Flows/ExecuteStrategy.html":{"name":"ExecuteStrategy","parent_name":"Flows"},"Enums/Flows.html#/use(_:when:block:)":{"name":"use(_:when:block:)","parent_name":"Flows"},"Enums/Flows.html#/use(_:_:_:_:_:when:block:)":{"name":"use(_:_:_:_:_:when:block:)","abstract":"

    Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation","parent_name":"Flows"},"Enums/Flows.html#/use(_:_:_:_:when:block:)":{"name":"use(_:_:_:_:when:block:)","abstract":"

    Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation","parent_name":"Flows"},"Enums/Flows.html#/use(_:_:_:when:block:)":{"name":"use(_:_:_:when:block:)","abstract":"

    Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation","parent_name":"Flows"},"Enums/Flows.html#/use(_:_:when:block:)":{"name":"use(_:_:when:block:)","abstract":"

    Allow to be triggered etiher when Flows given as parameters are ready to be displayed or right after their instantiation","parent_name":"Flows"},"Enums/Flows.html":{"name":"Flows","abstract":"

    Utility functions to synchronize Flows readyness

    "},"Enums/FlowContributor.html":{"name":"FlowContributor","abstract":"

    A FlowContributor describes the next thing that will contribute to a Flow.

    "},"Enums/FlowContributors.html":{"name":"FlowContributors","abstract":"

    FlowContributors represent the next things that will trigger"},"Enums/RxFlowStep.html":{"name":"RxFlowStep","abstract":"

    Standard RxFlow Steps

    "},"Classes/CompositeStepper.html#/steps":{"name":"steps","parent_name":"CompositeStepper"},"Classes/CompositeStepper.html#/init(steppers:)":{"name":"init(steppers:)","abstract":"

    Initialize

    ","parent_name":"CompositeStepper"},"Classes/CompositeStepper.html#/readyToEmitSteps()":{"name":"readyToEmitSteps()","parent_name":"CompositeStepper"},"Classes/DefaultStepper.html#/init()":{"name":"init()","abstract":"

    Initialize the DefaultStepper

    ","parent_name":"DefaultStepper"},"Classes/OneStepper.html#/steps":{"name":"steps","parent_name":"OneStepper"},"Classes/OneStepper.html#/init(withSingleStep:)":{"name":"init(withSingleStep:)","abstract":"

    Initialize the OneStepper

    ","parent_name":"OneStepper"},"Classes/OneStepper.html#/initialStep":{"name":"initialStep","parent_name":"OneStepper"},"Classes/FlowCoordinator.html#/coordinate(flow:with:)":{"name":"coordinate(flow:with:)","abstract":"

    Execute the navigation of the Flow

    ","parent_name":"FlowCoordinator"},"Classes/FlowCoordinator.html#/navigate(to:)":{"name":"navigate(to:)","abstract":"

    allow to drive the navigation from the outside of a flow

    ","parent_name":"FlowCoordinator"},"Classes/FlowCoordinator.html":{"name":"FlowCoordinator","abstract":"

    A FlowCoordinator handles the navigation of a Flow, based on its Stepper and the FlowContributors it emits

    "},"Classes/OneStepper.html":{"name":"OneStepper","abstract":"

    A Simple Stepper that has one goal: emit a single Step once initialized

    "},"Classes/DefaultStepper.html":{"name":"DefaultStepper","abstract":"

    A Simple Stepper that has one goal: emit a first default step equal to RxFlowStep.home

    "},"Classes/CompositeStepper.html":{"name":"CompositeStepper","abstract":"

    A Stepper that combines multiple steppers. All those Steppers will be associated"},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "},"Enums.html":{"name":"Enumerations","abstract":"

    The following enumerations are available globally.

    "},"Extensions.html":{"name":"Extensions","abstract":"

    The following extensions are available globally.

    "},"Protocols.html":{"name":"Protocols","abstract":"

    The following protocols are available globally.

    "}} \ No newline at end of file