file_name
stringlengths
3
137
prefix
stringlengths
0
918k
suffix
stringlengths
0
962k
middle
stringlengths
0
812k
packed-tuple-struct-size.rs
// run-pass #![allow(dead_code)] #![allow(non_camel_case_types)] use std::mem; #[repr(packed)] struct P1S4(u8,[u8; 3]); #[repr(packed(2))] struct P2S4(u8,[u8; 3]); #[repr(packed)] struct
(u8, u32); #[repr(packed(2))] struct P2S6(u8, u32); #[repr(packed)] struct P1S13(i64, f32, u8); #[repr(packed(2))] struct P2S14(i64, f32, u8); #[repr(packed(4))] struct P4S16(u8, f32, i64, u16); #[repr(C, packed(4))] struct P4CS20(u8, f32, i64, u16); enum Foo { Bar = 1, Baz = 2 } #[repr(packed)] struct P1S3_Foo(u8, u16, Foo); #[repr(packed(2))] struct P2_Foo(Foo); #[repr(packed(2))] struct P2S3_Foo(u8, u16, Foo); #[repr(packed)] struct P1S7_Option(f32, u8, u16, Option<Box<f64>>); #[repr(packed(2))] struct P2_Option(Option<Box<f64>>); #[repr(packed(2))] struct P2S7_Option(f32, u8, u16, Option<Box<f64>>); fn align_to(value: usize, align: usize) -> usize { (value + (align - 1)) & !(align - 1) } macro_rules! check { ($t:ty, $align:expr, $size:expr) => ({ assert_eq!(mem::align_of::<$t>(), $align); assert_eq!(mem::size_of::<$t>(), $size); }); } pub fn main() { check!(P1S4, 1, 4); check!(P1S5, 1, 5); check!(P1S13, 1, 13); check!(P1S3_Foo, 1, 3 + mem::size_of::<Foo>()); check!(P1S7_Option, 1, 7 + mem::size_of::<Option<Box<f64>>>()); check!(P2S4, 1, 4); check!(P2S6, 2, 6); check!(P2S14, 2, 14); check!(P4S16, 4, 16); check!(P4CS20, 4, 20); check!(P2S3_Foo, 2, align_to(3 + mem::size_of::<P2_Foo>(), 2)); check!(P2S7_Option, 2, align_to(7 + mem::size_of::<P2_Option>(), 2)); }
P1S5
reactor.go
package consensus import ( "errors" "fmt" "reflect" "sync" "time" "github.com/gogo/protobuf/proto" cstypes "github.com/celestiaorg/celestia-core/consensus/types" "github.com/celestiaorg/celestia-core/libs/bits" tmevents "github.com/celestiaorg/celestia-core/libs/events" tmjson "github.com/celestiaorg/celestia-core/libs/json" "github.com/celestiaorg/celestia-core/libs/log" tmsync "github.com/celestiaorg/celestia-core/libs/sync" "github.com/celestiaorg/celestia-core/p2p" tmcons "github.com/celestiaorg/celestia-core/proto/tendermint/consensus" tmproto "github.com/celestiaorg/celestia-core/proto/tendermint/types" sm "github.com/celestiaorg/celestia-core/state" "github.com/celestiaorg/celestia-core/types" tmtime "github.com/celestiaorg/celestia-core/types/time" ) const ( StateChannel = byte(0x20) DataChannel = byte(0x21) VoteChannel = byte(0x22) VoteSetBitsChannel = byte(0x23) maxMsgSize = 1048576 // 1MB; NOTE/TODO: keep in sync with types.PartSet sizes. blocksToContributeToBecomeGoodPeer = 10000 votesToContributeToBecomeGoodPeer = 10000 ) //----------------------------------------------------------------------------- // Reactor defines a reactor for the consensus service. type Reactor struct { p2p.BaseReactor // BaseService + p2p.Switch conS *State mtx tmsync.RWMutex waitSync bool eventBus *types.EventBus Metrics *Metrics } type ReactorOption func(*Reactor) // NewReactor returns a new Reactor with the given // consensusState. func NewReactor(consensusState *State, waitSync bool, options ...ReactorOption) *Reactor { conR := &Reactor{ conS: consensusState, waitSync: waitSync, Metrics: NopMetrics(), } conR.BaseReactor = *p2p.NewBaseReactor("Consensus", conR) for _, option := range options { option(conR) } return conR } // OnStart implements BaseService by subscribing to events, which later will be // broadcasted to other peers and starting state if we're not in fast sync. func (conR *Reactor) OnStart() error { conR.Logger.Info("Reactor ", "waitSync", conR.WaitSync()) // start routine that computes peer statistics for evaluating peer quality go conR.peerStatsRoutine() conR.subscribeToBroadcastEvents() if !conR.WaitSync() { err := conR.conS.Start() if err != nil { return err } } return nil } // OnStop implements BaseService by unsubscribing from events and stopping // state. func (conR *Reactor) OnStop() { conR.unsubscribeFromBroadcastEvents() if err := conR.conS.Stop(); err != nil { conR.Logger.Error("Error stopping consensus state", "err", err) } if !conR.WaitSync() { conR.conS.Wait() } } // SwitchToConsensus switches from fast_sync mode to consensus mode. // It resets the state, turns off fast_sync, and starts the consensus state-machine func (conR *Reactor) SwitchToConsensus(state sm.State, skipWAL bool) { conR.Logger.Info("SwitchToConsensus") // We have no votes, so reconstruct LastCommit from SeenCommit. if state.LastBlockHeight > 0 { conR.conS.reconstructLastCommit(state) } // NOTE: The line below causes broadcastNewRoundStepRoutine() to broadcast a // NewRoundStepMessage. conR.conS.updateToState(state) conR.mtx.Lock() conR.waitSync = false conR.mtx.Unlock() conR.Metrics.FastSyncing.Set(0) conR.Metrics.StateSyncing.Set(0) if skipWAL { conR.conS.doWALCatchup = false } err := conR.conS.Start() if err != nil { panic(fmt.Sprintf(`Failed to start consensus state: %v conS: %+v conR: %+v`, err, conR.conS, conR)) } } // GetChannels implements Reactor func (conR *Reactor) GetChannels() []*p2p.ChannelDescriptor { // TODO optimize return []*p2p.ChannelDescriptor{ { ID: StateChannel, Priority: 5, SendQueueCapacity: 100, RecvMessageCapacity: maxMsgSize, }, { ID: DataChannel, // maybe split between gossiping current block and catchup stuff // once we gossip the whole block there's nothing left to send until next height or round Priority: 10, SendQueueCapacity: 100, RecvBufferCapacity: 50 * 4096, RecvMessageCapacity: maxMsgSize, }, { ID: VoteChannel, Priority: 5, SendQueueCapacity: 100, RecvBufferCapacity: 100 * 100, RecvMessageCapacity: maxMsgSize, }, { ID: VoteSetBitsChannel, Priority: 1, SendQueueCapacity: 2, RecvBufferCapacity: 1024, RecvMessageCapacity: maxMsgSize, }, } } // InitPeer implements Reactor by creating a state for the peer. func (conR *Reactor) InitPeer(peer p2p.Peer) p2p.Peer { peerState := NewPeerState(peer).SetLogger(conR.Logger) peer.Set(types.PeerStateKey, peerState) return peer } // AddPeer implements Reactor by spawning multiple gossiping goroutines for the // peer. func (conR *Reactor) AddPeer(peer p2p.Peer) { if !conR.IsRunning() { return } peerState, ok := peer.Get(types.PeerStateKey).(*PeerState) if !ok { panic(fmt.Sprintf("peer %v has no state", peer)) } // Begin routines for this peer. go conR.gossipDataRoutine(peer, peerState) go conR.gossipVotesRoutine(peer, peerState) go conR.queryMaj23Routine(peer, peerState) // Send our state to peer. // If we're fast_syncing, broadcast a RoundStepMessage later upon SwitchToConsensus(). if !conR.WaitSync() { conR.sendNewRoundStepMessage(peer) } } // RemovePeer is a noop. func (conR *Reactor) RemovePeer(peer p2p.Peer, reason interface{}) { if !conR.IsRunning() { return } // TODO // ps, ok := peer.Get(PeerStateKey).(*PeerState) // if !ok { // panic(fmt.Sprintf("Peer %v has no state", peer)) // } // ps.Disconnect() } // Receive implements Reactor // NOTE: We process these messages even when we're fast_syncing. // Messages affect either a peer state or the consensus state. // Peer state updates can happen in parallel, but processing of // proposals, block parts, and votes are ordered by the receiveRoutine // NOTE: blocks on consensus state for proposals, block parts, and votes // XXX: do not call any methods that can block or incur heavy processing. // https://github.com/tendermint/tendermint/issues/2888 func (conR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) { if !conR.IsRunning() { conR.Logger.Debug("Receive", "src", src, "chId", chID, "bytes", msgBytes) return } msg, err := decodeMsg(msgBytes) if err != nil { conR.Logger.Error("Error decoding message", "src", src, "chId", chID, "err", err) conR.Switch.StopPeerForError(src, err) return } if err = msg.ValidateBasic(); err != nil { conR.Logger.Error("Peer sent us invalid msg", "peer", src, "msg", msg, "err", err) conR.Switch.StopPeerForError(src, err) return } conR.Logger.Debug("Receive", "src", src, "chId", chID, "msg", msg) // Get peer states ps, ok := src.Get(types.PeerStateKey).(*PeerState) if !ok { panic(fmt.Sprintf("Peer %v has no state", src)) } switch chID { case StateChannel: switch msg := msg.(type) { case *NewRoundStepMessage: conR.conS.mtx.Lock() initialHeight := conR.conS.state.InitialHeight conR.conS.mtx.Unlock() if err = msg.ValidateHeight(initialHeight); err != nil { conR.Logger.Error("Peer sent us invalid msg", "peer", src, "msg", msg, "err", err) conR.Switch.StopPeerForError(src, err) return } ps.ApplyNewRoundStepMessage(msg) case *NewValidBlockMessage: ps.ApplyNewValidBlockMessage(msg) case *HasVoteMessage: ps.ApplyHasVoteMessage(msg) case *VoteSetMaj23Message: cs := conR.conS cs.mtx.Lock() height, votes := cs.Height, cs.Votes cs.mtx.Unlock() if height != msg.Height { return } // Peer claims to have a maj23 for some BlockID at H,R,S, err := votes.SetPeerMaj23(msg.Round, msg.Type, ps.peer.ID(), msg.BlockID) if err != nil { conR.Switch.StopPeerForError(src, err) return } // Respond with a VoteSetBitsMessage showing which votes we have. // (and consequently shows which we don't have) var ourVotes *bits.BitArray switch msg.Type { case tmproto.PrevoteType: ourVotes = votes.Prevotes(msg.Round).BitArrayByBlockID(msg.BlockID) case tmproto.PrecommitType: ourVotes = votes.Precommits(msg.Round).BitArrayByBlockID(msg.BlockID) default: panic("Bad VoteSetBitsMessage field Type. Forgot to add a check in ValidateBasic?") } src.TrySend(VoteSetBitsChannel, MustEncode(&VoteSetBitsMessage{ Height: msg.Height, Round: msg.Round, Type: msg.Type, BlockID: msg.BlockID, Votes: ourVotes, })) default: conR.Logger.Error(fmt.Sprintf("Unknown message type %v", reflect.TypeOf(msg))) } case DataChannel: if conR.WaitSync() { conR.Logger.Info("Ignoring message received during sync", "msg", msg) return } switch msg := msg.(type) { case *ProposalMessage: ps.SetHasProposal(msg.Proposal) conR.conS.peerMsgQueue <- msgInfo{msg, src.ID()} case *ProposalPOLMessage: ps.ApplyProposalPOLMessage(msg) case *BlockPartMessage: ps.SetHasProposalBlockPart(msg.Height, msg.Round, int(msg.Part.Index)) conR.Metrics.BlockParts.With("peer_id", string(src.ID())).Add(1) conR.conS.peerMsgQueue <- msgInfo{msg, src.ID()} default: conR.Logger.Error(fmt.Sprintf("Unknown message type %v", reflect.TypeOf(msg))) } case VoteChannel: if conR.WaitSync() { conR.Logger.Info("Ignoring message received during sync", "msg", msg) return } switch msg := msg.(type) { case *VoteMessage: cs := conR.conS cs.mtx.RLock() height, valSize, lastCommitSize := cs.Height, cs.Validators.Size(), cs.LastCommit.Size() cs.mtx.RUnlock() ps.EnsureVoteBitArrays(height, valSize) ps.EnsureVoteBitArrays(height-1, lastCommitSize) ps.SetHasVote(msg.Vote) cs.peerMsgQueue <- msgInfo{msg, src.ID()} default: // don't punish (leave room for soft upgrades) conR.Logger.Error(fmt.Sprintf("Unknown message type %v", reflect.TypeOf(msg))) } case VoteSetBitsChannel: if conR.WaitSync() { conR.Logger.Info("Ignoring message received during sync", "msg", msg) return } switch msg := msg.(type) { case *VoteSetBitsMessage: cs := conR.conS cs.mtx.Lock() height, votes := cs.Height, cs.Votes cs.mtx.Unlock() if height == msg.Height { var ourVotes *bits.BitArray switch msg.Type { case tmproto.PrevoteType: ourVotes = votes.Prevotes(msg.Round).BitArrayByBlockID(msg.BlockID) case tmproto.PrecommitType: ourVotes = votes.Precommits(msg.Round).BitArrayByBlockID(msg.BlockID) default: panic("Bad VoteSetBitsMessage field Type. Forgot to add a check in ValidateBasic?") } ps.ApplyVoteSetBitsMessage(msg, ourVotes) } else { ps.ApplyVoteSetBitsMessage(msg, nil) } default: // don't punish (leave room for soft upgrades) conR.Logger.Error(fmt.Sprintf("Unknown message type %v", reflect.TypeOf(msg))) } default: conR.Logger.Error(fmt.Sprintf("Unknown chId %X", chID)) } } // SetEventBus sets event bus. func (conR *Reactor) SetEventBus(b *types.EventBus) { conR.eventBus = b conR.conS.SetEventBus(b) } // WaitSync returns whether the consensus reactor is waiting for state/fast sync. func (conR *Reactor) WaitSync() bool { conR.mtx.RLock() defer conR.mtx.RUnlock() return conR.waitSync } //-------------------------------------- // subscribeToBroadcastEvents subscribes for new round steps and votes // using internal pubsub defined on state to broadcast // them to peers upon receiving. func (conR *Reactor) subscribeToBroadcastEvents() { const subscriber = "consensus-reactor" if err := conR.conS.evsw.AddListenerForEvent(subscriber, types.EventNewRoundStep, func(data tmevents.EventData) { conR.broadcastNewRoundStepMessage(data.(*cstypes.RoundState)) }); err != nil { conR.Logger.Error("Error adding listener for events", "err", err) } if err := conR.conS.evsw.AddListenerForEvent(subscriber, types.EventValidBlock, func(data tmevents.EventData) { conR.broadcastNewValidBlockMessage(data.(*cstypes.RoundState)) }); err != nil { conR.Logger.Error("Error adding listener for events", "err", err) } if err := conR.conS.evsw.AddListenerForEvent(subscriber, types.EventVote, func(data tmevents.EventData) { conR.broadcastHasVoteMessage(data.(*types.Vote)) }); err != nil { conR.Logger.Error("Error adding listener for events", "err", err) } } func (conR *Reactor) unsubscribeFromBroadcastEvents() { const subscriber = "consensus-reactor" conR.conS.evsw.RemoveListener(subscriber) } func (conR *Reactor) broadcastNewRoundStepMessage(rs *cstypes.RoundState) { nrsMsg := makeRoundStepMessage(rs) conR.Switch.Broadcast(StateChannel, MustEncode(nrsMsg)) } func (conR *Reactor) broadcastNewValidBlockMessage(rs *cstypes.RoundState) { csMsg := &NewValidBlockMessage{ Height: rs.Height, Round: rs.Round, BlockPartSetHeader: rs.ProposalBlockParts.Header(), BlockParts: rs.ProposalBlockParts.BitArray(), IsCommit: rs.Step == cstypes.RoundStepCommit, } conR.Switch.Broadcast(StateChannel, MustEncode(csMsg)) } // Broadcasts HasVoteMessage to peers that care. func (conR *Reactor) broadcastHasVoteMessage(vote *types.Vote) { msg := &HasVoteMessage{ Height: vote.Height, Round: vote.Round, Type: vote.Type, Index: vote.ValidatorIndex, } conR.Switch.Broadcast(StateChannel, MustEncode(msg)) /* // TODO: Make this broadcast more selective. for _, peer := range conR.Switch.Peers().List() { ps, ok := peer.Get(PeerStateKey).(*PeerState) if !ok { panic(fmt.Sprintf("Peer %v has no state", peer)) } prs := ps.GetRoundState() if prs.Height == vote.Height { // TODO: Also filter on round? peer.TrySend(StateChannel, struct{ ConsensusMessage }{msg}) } else { // Height doesn't match // TODO: check a field, maybe CatchupCommitRound? // TODO: But that requires changing the struct field comment. } } */ } func makeRoundStepMessage(rs *cstypes.RoundState) (nrsMsg *NewRoundStepMessage) { nrsMsg = &NewRoundStepMessage{ Height: rs.Height, Round: rs.Round, Step: rs.Step, SecondsSinceStartTime: int64(time.Since(rs.StartTime).Seconds()), LastCommitRound: rs.LastCommit.GetRound(), } return } func (conR *Reactor) sendNewRoundStepMessage(peer p2p.Peer) { rs := conR.conS.GetRoundState() nrsMsg := makeRoundStepMessage(rs) peer.Send(StateChannel, MustEncode(nrsMsg)) } func (conR *Reactor) gossipDataRoutine(peer p2p.Peer, ps *PeerState) { logger := conR.Logger.With("peer", peer) OUTER_LOOP: for { // Manage disconnects from self or peer. if !peer.IsRunning() || !conR.IsRunning() { logger.Info("Stopping gossipDataRoutine for peer") return } rs := conR.conS.GetRoundState() prs := ps.GetRoundState() // Send proposal Block parts? if rs.ProposalBlockParts.HasHeader(prs.ProposalBlockPartSetHeader) { if index, ok := rs.ProposalBlockParts.BitArray().Sub(prs.ProposalBlockParts.Copy()).PickRandom(); ok { part := rs.ProposalBlockParts.GetPart(index) msg := &BlockPartMessage{ Height: rs.Height, // This tells peer that this part applies to us. Round: rs.Round, // This tells peer that this part applies to us. Part: part, } logger.Debug("Sending block part", "height", prs.Height, "round", prs.Round) if peer.Send(DataChannel, MustEncode(msg)) { ps.SetHasProposalBlockPart(prs.Height, prs.Round, index) } continue OUTER_LOOP } } // If the peer is on a previous height that we have, help catch up. if (0 < prs.Height) && (prs.Height < rs.Height) && (prs.Height >= conR.conS.blockStore.Base()) { heightLogger := logger.With("height", prs.Height) // if we never received the commit message from the peer, the block parts wont be initialized if prs.ProposalBlockParts == nil { blockMeta := conR.conS.blockStore.LoadBlockMeta(prs.Height) if blockMeta == nil { heightLogger.Error("Failed to load block meta", "blockstoreBase", conR.conS.blockStore.Base(), "blockstoreHeight", conR.conS.blockStore.Height()) time.Sleep(conR.conS.config.PeerGossipSleepDuration) } else { ps.InitProposalBlockParts(blockMeta.BlockID.PartSetHeader) } // continue the loop since prs is a copy and not effected by this initialization continue OUTER_LOOP } conR.gossipDataForCatchup(heightLogger, rs, prs, ps, peer) continue OUTER_LOOP } // If height and round don't match, sleep. if (rs.Height != prs.Height) || (rs.Round != prs.Round) { // logger.Info("Peer Height|Round mismatch, sleeping", // "peerHeight", prs.Height, "peerRound", prs.Round, "peer", peer) time.Sleep(conR.conS.config.PeerGossipSleepDuration) continue OUTER_LOOP } // By here, height and round match. // Proposal block parts were already matched and sent if any were wanted. // (These can match on hash so the round doesn't matter) // Now consider sending other things, like the Proposal itself. // Send Proposal && ProposalPOL BitArray? if rs.Proposal != nil && !prs.Proposal { // Proposal: share the proposal metadata with peer. { msg := &ProposalMessage{Proposal: rs.Proposal} logger.Debug("Sending proposal", "height", prs.Height, "round", prs.Round) if peer.Send(DataChannel, MustEncode(msg)) { // NOTE[ZM]: A peer might have received different proposal msg so this Proposal msg will be rejected! ps.SetHasProposal(rs.Proposal) } } // ProposalPOL: lets peer know which POL votes we have so far. // Peer must receive ProposalMessage first. // rs.Proposal was validated, so rs.Proposal.POLRound <= rs.Round, // so we definitely have rs.Votes.Prevotes(rs.Proposal.POLRound). if 0 <= rs.Proposal.POLRound { msg := &ProposalPOLMessage{ Height: rs.Height, ProposalPOLRound: rs.Proposal.POLRound, ProposalPOL: rs.Votes.Prevotes(rs.Proposal.POLRound).BitArray(), } logger.Debug("Sending POL", "height", prs.Height, "round", prs.Round) peer.Send(DataChannel, MustEncode(msg)) } continue OUTER_LOOP } // Nothing to do. Sleep. time.Sleep(conR.conS.config.PeerGossipSleepDuration) continue OUTER_LOOP } } func (conR *Reactor) gossipDataForCatchup(logger log.Logger, rs *cstypes.RoundState, prs *cstypes.PeerRoundState, ps *PeerState, peer p2p.Peer) { if index, ok := prs.ProposalBlockParts.Not().PickRandom(); ok { // Ensure that the peer's PartSetHeader is correct blockMeta := conR.conS.blockStore.LoadBlockMeta(prs.Height) if blockMeta == nil { logger.Error("Failed to load block meta", "ourHeight", rs.Height, "blockstoreBase", conR.conS.blockStore.Base(), "blockstoreHeight", conR.conS.blockStore.Height()) time.Sleep(conR.conS.config.PeerGossipSleepDuration) return } else if !blockMeta.BlockID.PartSetHeader.Equals(prs.ProposalBlockPartSetHeader) { logger.Info("Peer ProposalBlockPartSetHeader mismatch, sleeping", "blockPartSetHeader", blockMeta.BlockID.PartSetHeader, "peerBlockPartSetHeader", prs.ProposalBlockPartSetHeader) time.Sleep(conR.conS.config.PeerGossipSleepDuration) return } // Load the part part := conR.conS.blockStore.LoadBlockPart(prs.Height, index) if part == nil { logger.Error("Could not load part", "index", index, "blockPartSetHeader", blockMeta.BlockID.PartSetHeader, "peerBlockPartSetHeader", prs.ProposalBlockPartSetHeader) time.Sleep(conR.conS.config.PeerGossipSleepDuration) return } // Send the part msg := &BlockPartMessage{ Height: prs.Height, // Not our height, so it doesn't matter. Round: prs.Round, // Not our height, so it doesn't matter. Part: part, } logger.Debug("Sending block part for catchup", "round", prs.Round, "index", index) if peer.Send(DataChannel, MustEncode(msg)) { ps.SetHasProposalBlockPart(prs.Height, prs.Round, index) } else { logger.Debug("Sending block part for catchup failed") } return } // logger.Info("No parts to send in catch-up, sleeping") time.Sleep(conR.conS.config.PeerGossipSleepDuration) } func (conR *Reactor) gossipVotesRoutine(peer p2p.Peer, ps *PeerState) { logger := conR.Logger.With("peer", peer) // Simple hack to throttle logs upon sleep. var sleeping = 0 OUTER_LOOP: for { // Manage disconnects from self or peer. if !peer.IsRunning() || !conR.IsRunning() { logger.Info("Stopping gossipVotesRoutine for peer") return } rs := conR.conS.GetRoundState() prs := ps.GetRoundState() switch sleeping { case 1: // First sleep sleeping = 2 case 2: // No more sleep sleeping = 0 } // logger.Debug("gossipVotesRoutine", "rsHeight", rs.Height, "rsRound", rs.Round, // "prsHeight", prs.Height, "prsRound", prs.Round, "prsStep", prs.Step) // If height matches, then send LastCommit, Prevotes, Precommits. if rs.Height == prs.Height { heightLogger := logger.With("height", prs.Height) if conR.gossipVotesForHeight(heightLogger, rs, prs, ps) { continue OUTER_LOOP } } // Special catchup logic. // If peer is lagging by height 1, send LastCommit. if prs.Height != 0 && rs.Height == prs.Height+1 { if ps.PickSendVote(rs.LastCommit) { logger.Debug("Picked rs.LastCommit to send", "height", prs.Height) continue OUTER_LOOP } } // Catchup logic // If peer is lagging by more than 1, send Commit. if prs.Height != 0 && rs.Height >= prs.Height+2 && prs.Height >= conR.conS.blockStore.Base() { // Load the block commit for prs.Height, // which contains precommit signatures for prs.Height. if commit := conR.conS.blockStore.LoadBlockCommit(prs.Height); commit != nil { if ps.PickSendVote(commit) { logger.Debug("Picked Catchup commit to send", "height", prs.Height) continue OUTER_LOOP } } } if sleeping == 0 { // We sent nothing. Sleep... sleeping = 1 logger.Debug("No votes to send, sleeping", "rs.Height", rs.Height, "prs.Height", prs.Height, "localPV", rs.Votes.Prevotes(rs.Round).BitArray(), "peerPV", prs.Prevotes, "localPC", rs.Votes.Precommits(rs.Round).BitArray(), "peerPC", prs.Precommits) } else if sleeping == 2 { // Continued sleep... sleeping = 1 } time.Sleep(conR.conS.config.PeerGossipSleepDuration) continue OUTER_LOOP } } func (conR *Reactor) gossipVotesForHeight( logger log.Logger, rs *cstypes.RoundState, prs *cstypes.PeerRoundState, ps *PeerState, ) bool { // If there are lastCommits to send... if prs.Step == cstypes.RoundStepNewHeight { if ps.PickSendVote(rs.LastCommit) { logger.Debug("Picked rs.LastCommit to send") return true } } // If there are POL prevotes to send... if prs.Step <= cstypes.RoundStepPropose && prs.Round != -1 && prs.Round <= rs.Round && prs.ProposalPOLRound != -1 { if polPrevotes := rs.Votes.Prevotes(prs.ProposalPOLRound); polPrevotes != nil { if ps.PickSendVote(polPrevotes) { logger.Debug("Picked rs.Prevotes(prs.ProposalPOLRound) to send", "round", prs.ProposalPOLRound) return true } } } // If there are prevotes to send... if prs.Step <= cstypes.RoundStepPrevoteWait && prs.Round != -1 && prs.Round <= rs.Round { if ps.PickSendVote(rs.Votes.Prevotes(prs.Round)) { logger.Debug("Picked rs.Prevotes(prs.Round) to send", "round", prs.Round) return true } } // If there are precommits to send... if prs.Step <= cstypes.RoundStepPrecommitWait && prs.Round != -1 && prs.Round <= rs.Round { if ps.PickSendVote(rs.Votes.Precommits(prs.Round)) { logger.Debug("Picked rs.Precommits(prs.Round) to send", "round", prs.Round) return true } } // If there are prevotes to send...Needed because of validBlock mechanism if prs.Round != -1 && prs.Round <= rs.Round { if ps.PickSendVote(rs.Votes.Prevotes(prs.Round)) { logger.Debug("Picked rs.Prevotes(prs.Round) to send", "round", prs.Round) return true } } // If there are POLPrevotes to send... if prs.ProposalPOLRound != -1 { if polPrevotes := rs.Votes.Prevotes(prs.ProposalPOLRound); polPrevotes != nil { if ps.PickSendVote(polPrevotes) { logger.Debug("Picked rs.Prevotes(prs.ProposalPOLRound) to send", "round", prs.ProposalPOLRound) return true } } } return false } // NOTE: `queryMaj23Routine` has a simple crude design since it only comes // into play for liveness when there's a signature DDoS attack happening. func (conR *Reactor) queryMaj23Routine(peer p2p.Peer, ps *PeerState) { logger := conR.Logger.With("peer", peer) OUTER_LOOP: for { // Manage disconnects from self or peer. if !peer.IsRunning() || !conR.IsRunning() { logger.Info("Stopping queryMaj23Routine for peer") return } // Maybe send Height/Round/Prevotes { rs := conR.conS.GetRoundState() prs := ps.GetRoundState() if rs.Height == prs.Height { if maj23, ok := rs.Votes.Prevotes(prs.Round).TwoThirdsMajority(); ok { peer.TrySend(StateChannel, MustEncode(&VoteSetMaj23Message{ Height: prs.Height, Round: prs.Round, Type: tmproto.PrevoteType, BlockID: maj23, })) time.Sleep(conR.conS.config.PeerQueryMaj23SleepDuration) } } } // Maybe send Height/Round/Precommits { rs := conR.conS.GetRoundState() prs := ps.GetRoundState() if rs.Height == prs.Height { if maj23, ok := rs.Votes.Precommits(prs.Round).TwoThirdsMajority(); ok { peer.TrySend(StateChannel, MustEncode(&VoteSetMaj23Message{ Height: prs.Height, Round: prs.Round, Type: tmproto.PrecommitType, BlockID: maj23, })) time.Sleep(conR.conS.config.PeerQueryMaj23SleepDuration) } } } // Maybe send Height/Round/ProposalPOL { rs := conR.conS.GetRoundState() prs := ps.GetRoundState() if rs.Height == prs.Height && prs.ProposalPOLRound >= 0 { if maj23, ok := rs.Votes.Prevotes(prs.ProposalPOLRound).TwoThirdsMajority(); ok { peer.TrySend(StateChannel, MustEncode(&VoteSetMaj23Message{ Height: prs.Height, Round: prs.ProposalPOLRound, Type: tmproto.PrevoteType, BlockID: maj23, })) time.Sleep(conR.conS.config.PeerQueryMaj23SleepDuration) } } } // Little point sending LastCommitRound/LastCommit, // These are fleeting and non-blocking. // Maybe send Height/CatchupCommitRound/CatchupCommit. { prs := ps.GetRoundState() if prs.CatchupCommitRound != -1 && prs.Height > 0 && prs.Height <= conR.conS.blockStore.Height() && prs.Height >= conR.conS.blockStore.Base() { if commit := conR.conS.LoadCommit(prs.Height); commit != nil { peer.TrySend(StateChannel, MustEncode(&VoteSetMaj23Message{ Height: prs.Height, Round: commit.Round, Type: tmproto.PrecommitType, BlockID: commit.BlockID, })) time.Sleep(conR.conS.config.PeerQueryMaj23SleepDuration) } } } time.Sleep(conR.conS.config.PeerQueryMaj23SleepDuration) continue OUTER_LOOP } } func (conR *Reactor) peerStatsRoutine() { for { if !conR.IsRunning() { conR.Logger.Info("Stopping peerStatsRoutine") return } select { case msg := <-conR.conS.statsMsgQueue: // Get peer peer := conR.Switch.Peers().Get(msg.PeerID) if peer == nil { conR.Logger.Debug("Attempt to update stats for non-existent peer", "peer", msg.PeerID) continue } // Get peer state ps, ok := peer.Get(types.PeerStateKey).(*PeerState) if !ok { panic(fmt.Sprintf("Peer %v has no state", peer)) } switch msg.Msg.(type) { case *VoteMessage: if numVotes := ps.RecordVote(); numVotes%votesToContributeToBecomeGoodPeer == 0 { conR.Switch.MarkPeerAsGood(peer) } case *BlockPartMessage: if numParts := ps.RecordBlockPart(); numParts%blocksToContributeToBecomeGoodPeer == 0 { conR.Switch.MarkPeerAsGood(peer) } } case <-conR.conS.Quit(): return case <-conR.Quit(): return } } } // String returns a string representation of the Reactor. // NOTE: For now, it is just a hard-coded string to avoid accessing unprotected shared variables. // TODO: improve! func (conR *Reactor) String() string { // better not to access shared variables return "ConsensusReactor" // conR.StringIndented("") } // StringIndented returns an indented string representation of the Reactor func (conR *Reactor) StringIndented(indent string) string { s := "ConsensusReactor{\n" s += indent + " " + conR.conS.StringIndented(indent+" ") + "\n" for _, peer := range conR.Switch.Peers().List() { ps, ok := peer.Get(types.PeerStateKey).(*PeerState) if !ok { panic(fmt.Sprintf("Peer %v has no state", peer)) } s += indent + " " + ps.StringIndented(indent+" ") + "\n" } s += indent + "}" return s } // ReactorMetrics sets the metrics func ReactorMetrics(metrics *Metrics) ReactorOption { return func(conR *Reactor) { conR.Metrics = metrics } } //----------------------------------------------------------------------------- var ( ErrPeerStateHeightRegression = errors.New("error peer state height regression") ErrPeerStateInvalidStartTime = errors.New("error peer state invalid startTime") ) // PeerState contains the known state of a peer, including its connection and // threadsafe access to its PeerRoundState. // NOTE: THIS GETS DUMPED WITH rpc/core/consensus.go. // Be mindful of what you Expose. type PeerState struct { peer p2p.Peer logger log.Logger mtx sync.Mutex // NOTE: Modify below using setters, never directly. PRS cstypes.PeerRoundState `json:"round_state"` // Exposed. Stats *peerStateStats `json:"stats"` // Exposed. } // peerStateStats holds internal statistics for a peer. type peerStateStats struct { Votes int `json:"votes"` BlockParts int `json:"block_parts"` } func (pss peerStateStats) String() string { return fmt.Sprintf("peerStateStats{votes: %d, blockParts: %d}", pss.Votes, pss.BlockParts) } // NewPeerState returns a new PeerState for the given Peer func NewPeerState(peer p2p.Peer) *PeerState { return &PeerState{ peer: peer, logger: log.NewNopLogger(), PRS: cstypes.PeerRoundState{ Round: -1, ProposalPOLRound: -1, LastCommitRound: -1, CatchupCommitRound: -1, }, Stats: &peerStateStats{}, } } // SetLogger allows to set a logger on the peer state. Returns the peer state // itself. func (ps *PeerState) SetLogger(logger log.Logger) *PeerState { ps.logger = logger return ps } // GetRoundState returns an shallow copy of the PeerRoundState. // There's no point in mutating it since it won't change PeerState. func (ps *PeerState) GetRoundState() *cstypes.PeerRoundState { ps.mtx.Lock() defer ps.mtx.Unlock() prs := ps.PRS // copy return &prs } // ToJSON returns a json of PeerState. func (ps *PeerState) ToJSON() ([]byte, error) { ps.mtx.Lock() defer ps.mtx.Unlock() return tmjson.Marshal(ps) } // GetHeight returns an atomic snapshot of the PeerRoundState's height // used by the mempool to ensure peers are caught up before broadcasting new txs func (ps *PeerState) GetHeight() int64 { ps.mtx.Lock() defer ps.mtx.Unlock() return ps.PRS.Height } // SetHasProposal sets the given proposal as known for the peer. func (ps *PeerState) SetHasProposal(proposal *types.Proposal) { ps.mtx.Lock() defer ps.mtx.Unlock() if ps.PRS.Height != proposal.Height || ps.PRS.Round != proposal.Round { return } if ps.PRS.Proposal { return } ps.PRS.Proposal = true // ps.PRS.ProposalBlockParts is set due to NewValidBlockMessage if ps.PRS.ProposalBlockParts != nil { return } ps.PRS.ProposalBlockPartSetHeader = proposal.BlockID.PartSetHeader ps.PRS.ProposalBlockParts = bits.NewBitArray(int(proposal.BlockID.PartSetHeader.Total)) ps.PRS.ProposalPOLRound = proposal.POLRound ps.PRS.ProposalPOL = nil // Nil until ProposalPOLMessage received. } // InitProposalBlockParts initializes the peer's proposal block parts header and bit array.
if ps.PRS.ProposalBlockParts != nil { return } ps.PRS.ProposalBlockPartSetHeader = partSetHeader ps.PRS.ProposalBlockParts = bits.NewBitArray(int(partSetHeader.Total)) } // SetHasProposalBlockPart sets the given block part index as known for the peer. func (ps *PeerState) SetHasProposalBlockPart(height int64, round int32, index int) { ps.mtx.Lock() defer ps.mtx.Unlock() if ps.PRS.Height != height || ps.PRS.Round != round { return } ps.PRS.ProposalBlockParts.SetIndex(index, true) } // PickSendVote picks a vote and sends it to the peer. // Returns true if vote was sent. func (ps *PeerState) PickSendVote(votes types.VoteSetReader) bool { if vote, ok := ps.PickVoteToSend(votes); ok { msg := &VoteMessage{vote} ps.logger.Debug("Sending vote message", "ps", ps, "vote", vote) if ps.peer.Send(VoteChannel, MustEncode(msg)) { ps.SetHasVote(vote) return true } return false } return false } // PickVoteToSend picks a vote to send to the peer. // Returns true if a vote was picked. // NOTE: `votes` must be the correct Size() for the Height(). func (ps *PeerState) PickVoteToSend(votes types.VoteSetReader) (vote *types.Vote, ok bool) { ps.mtx.Lock() defer ps.mtx.Unlock() if votes.Size() == 0 { return nil, false } height, round, votesType, size := votes.GetHeight(), votes.GetRound(), tmproto.SignedMsgType(votes.Type()), votes.Size() // Lazily set data using 'votes'. if votes.IsCommit() { ps.ensureCatchupCommitRound(height, round, size) } ps.ensureVoteBitArrays(height, size) psVotes := ps.getVoteBitArray(height, round, votesType) if psVotes == nil { return nil, false // Not something worth sending } if index, ok := votes.BitArray().Sub(psVotes).PickRandom(); ok { return votes.GetByIndex(int32(index)), true } return nil, false } func (ps *PeerState) getVoteBitArray(height int64, round int32, votesType tmproto.SignedMsgType) *bits.BitArray { if !types.IsVoteTypeValid(votesType) { return nil } if ps.PRS.Height == height { if ps.PRS.Round == round { switch votesType { case tmproto.PrevoteType: return ps.PRS.Prevotes case tmproto.PrecommitType: return ps.PRS.Precommits } } if ps.PRS.CatchupCommitRound == round { switch votesType { case tmproto.PrevoteType: return nil case tmproto.PrecommitType: return ps.PRS.CatchupCommit } } if ps.PRS.ProposalPOLRound == round { switch votesType { case tmproto.PrevoteType: return ps.PRS.ProposalPOL case tmproto.PrecommitType: return nil } } return nil } if ps.PRS.Height == height+1 { if ps.PRS.LastCommitRound == round { switch votesType { case tmproto.PrevoteType: return nil case tmproto.PrecommitType: return ps.PRS.LastCommit } } return nil } return nil } // 'round': A round for which we have a +2/3 commit. func (ps *PeerState) ensureCatchupCommitRound(height int64, round int32, numValidators int) { if ps.PRS.Height != height { return } /* NOTE: This is wrong, 'round' could change. e.g. if orig round is not the same as block LastCommit round. if ps.CatchupCommitRound != -1 && ps.CatchupCommitRound != round { panic(fmt.Sprintf( "Conflicting CatchupCommitRound. Height: %v, Orig: %v, New: %v", height, ps.CatchupCommitRound, round)) } */ if ps.PRS.CatchupCommitRound == round { return // Nothing to do! } ps.PRS.CatchupCommitRound = round if round == ps.PRS.Round { ps.PRS.CatchupCommit = ps.PRS.Precommits } else { ps.PRS.CatchupCommit = bits.NewBitArray(numValidators) } } // EnsureVoteBitArrays ensures the bit-arrays have been allocated for tracking // what votes this peer has received. // NOTE: It's important to make sure that numValidators actually matches // what the node sees as the number of validators for height. func (ps *PeerState) EnsureVoteBitArrays(height int64, numValidators int) { ps.mtx.Lock() defer ps.mtx.Unlock() ps.ensureVoteBitArrays(height, numValidators) } func (ps *PeerState) ensureVoteBitArrays(height int64, numValidators int) { if ps.PRS.Height == height { if ps.PRS.Prevotes == nil { ps.PRS.Prevotes = bits.NewBitArray(numValidators) } if ps.PRS.Precommits == nil { ps.PRS.Precommits = bits.NewBitArray(numValidators) } if ps.PRS.CatchupCommit == nil { ps.PRS.CatchupCommit = bits.NewBitArray(numValidators) } if ps.PRS.ProposalPOL == nil { ps.PRS.ProposalPOL = bits.NewBitArray(numValidators) } } else if ps.PRS.Height == height+1 { if ps.PRS.LastCommit == nil { ps.PRS.LastCommit = bits.NewBitArray(numValidators) } } } // RecordVote increments internal votes related statistics for this peer. // It returns the total number of added votes. func (ps *PeerState) RecordVote() int { ps.mtx.Lock() defer ps.mtx.Unlock() ps.Stats.Votes++ return ps.Stats.Votes } // VotesSent returns the number of blocks for which peer has been sending us // votes. func (ps *PeerState) VotesSent() int { ps.mtx.Lock() defer ps.mtx.Unlock() return ps.Stats.Votes } // RecordBlockPart increments internal block part related statistics for this peer. // It returns the total number of added block parts. func (ps *PeerState) RecordBlockPart() int { ps.mtx.Lock() defer ps.mtx.Unlock() ps.Stats.BlockParts++ return ps.Stats.BlockParts } // BlockPartsSent returns the number of useful block parts the peer has sent us. func (ps *PeerState) BlockPartsSent() int { ps.mtx.Lock() defer ps.mtx.Unlock() return ps.Stats.BlockParts } // SetHasVote sets the given vote as known by the peer func (ps *PeerState) SetHasVote(vote *types.Vote) { ps.mtx.Lock() defer ps.mtx.Unlock() ps.setHasVote(vote.Height, vote.Round, vote.Type, vote.ValidatorIndex) } func (ps *PeerState) setHasVote(height int64, round int32, voteType tmproto.SignedMsgType, index int32) { logger := ps.logger.With( "peerH/R", fmt.Sprintf("%d/%d", ps.PRS.Height, ps.PRS.Round), "H/R", fmt.Sprintf("%d/%d", height, round)) logger.Debug("setHasVote", "type", voteType, "index", index) // NOTE: some may be nil BitArrays -> no side effects. psVotes := ps.getVoteBitArray(height, round, voteType) if psVotes != nil { psVotes.SetIndex(int(index), true) } } // ApplyNewRoundStepMessage updates the peer state for the new round. func (ps *PeerState) ApplyNewRoundStepMessage(msg *NewRoundStepMessage) { ps.mtx.Lock() defer ps.mtx.Unlock() // Ignore duplicates or decreases if CompareHRS(msg.Height, msg.Round, msg.Step, ps.PRS.Height, ps.PRS.Round, ps.PRS.Step) <= 0 { return } // Just remember these values. psHeight := ps.PRS.Height psRound := ps.PRS.Round psCatchupCommitRound := ps.PRS.CatchupCommitRound psCatchupCommit := ps.PRS.CatchupCommit startTime := tmtime.Now().Add(-1 * time.Duration(msg.SecondsSinceStartTime) * time.Second) ps.PRS.Height = msg.Height ps.PRS.Round = msg.Round ps.PRS.Step = msg.Step ps.PRS.StartTime = startTime if psHeight != msg.Height || psRound != msg.Round { ps.PRS.Proposal = false ps.PRS.ProposalBlockPartSetHeader = types.PartSetHeader{} ps.PRS.ProposalBlockParts = nil ps.PRS.ProposalPOLRound = -1 ps.PRS.ProposalPOL = nil // We'll update the BitArray capacity later. ps.PRS.Prevotes = nil ps.PRS.Precommits = nil } if psHeight == msg.Height && psRound != msg.Round && msg.Round == psCatchupCommitRound { // Peer caught up to CatchupCommitRound. // Preserve psCatchupCommit! // NOTE: We prefer to use prs.Precommits if // pr.Round matches pr.CatchupCommitRound. ps.PRS.Precommits = psCatchupCommit } if psHeight != msg.Height { // Shift Precommits to LastCommit. if psHeight+1 == msg.Height && psRound == msg.LastCommitRound { ps.PRS.LastCommitRound = msg.LastCommitRound ps.PRS.LastCommit = ps.PRS.Precommits } else { ps.PRS.LastCommitRound = msg.LastCommitRound ps.PRS.LastCommit = nil } // We'll update the BitArray capacity later. ps.PRS.CatchupCommitRound = -1 ps.PRS.CatchupCommit = nil } } // ApplyNewValidBlockMessage updates the peer state for the new valid block. func (ps *PeerState) ApplyNewValidBlockMessage(msg *NewValidBlockMessage) { ps.mtx.Lock() defer ps.mtx.Unlock() if ps.PRS.Height != msg.Height { return } if ps.PRS.Round != msg.Round && !msg.IsCommit { return } ps.PRS.ProposalBlockPartSetHeader = msg.BlockPartSetHeader ps.PRS.ProposalBlockParts = msg.BlockParts } // ApplyProposalPOLMessage updates the peer state for the new proposal POL. func (ps *PeerState) ApplyProposalPOLMessage(msg *ProposalPOLMessage) { ps.mtx.Lock() defer ps.mtx.Unlock() if ps.PRS.Height != msg.Height { return } if ps.PRS.ProposalPOLRound != msg.ProposalPOLRound { return } // TODO: Merge onto existing ps.PRS.ProposalPOL? // We might have sent some prevotes in the meantime. ps.PRS.ProposalPOL = msg.ProposalPOL } // ApplyHasVoteMessage updates the peer state for the new vote. func (ps *PeerState) ApplyHasVoteMessage(msg *HasVoteMessage) { ps.mtx.Lock() defer ps.mtx.Unlock() if ps.PRS.Height != msg.Height { return } ps.setHasVote(msg.Height, msg.Round, msg.Type, msg.Index) } // ApplyVoteSetBitsMessage updates the peer state for the bit-array of votes // it claims to have for the corresponding BlockID. // `ourVotes` is a BitArray of votes we have for msg.BlockID // NOTE: if ourVotes is nil (e.g. msg.Height < rs.Height), // we conservatively overwrite ps's votes w/ msg.Votes. func (ps *PeerState) ApplyVoteSetBitsMessage(msg *VoteSetBitsMessage, ourVotes *bits.BitArray) { ps.mtx.Lock() defer ps.mtx.Unlock() votes := ps.getVoteBitArray(msg.Height, msg.Round, msg.Type) if votes != nil { if ourVotes == nil { votes.Update(msg.Votes) } else { otherVotes := votes.Sub(ourVotes) hasVotes := otherVotes.Or(msg.Votes) votes.Update(hasVotes) } } } // String returns a string representation of the PeerState func (ps *PeerState) String() string { return ps.StringIndented("") } // StringIndented returns a string representation of the PeerState func (ps *PeerState) StringIndented(indent string) string { ps.mtx.Lock() defer ps.mtx.Unlock() return fmt.Sprintf(`PeerState{ %s Key %v %s RoundState %v %s Stats %v %s}`, indent, ps.peer.ID(), indent, ps.PRS.StringIndented(indent+" "), indent, ps.Stats, indent) } //----------------------------------------------------------------------------- // Messages // Message is a message that can be sent and received on the Reactor type Message interface { ValidateBasic() error } func init() { tmjson.RegisterType(&NewRoundStepMessage{}, "tendermint/NewRoundStepMessage") tmjson.RegisterType(&NewValidBlockMessage{}, "tendermint/NewValidBlockMessage") tmjson.RegisterType(&ProposalMessage{}, "tendermint/Proposal") tmjson.RegisterType(&ProposalPOLMessage{}, "tendermint/ProposalPOL") tmjson.RegisterType(&BlockPartMessage{}, "tendermint/BlockPart") tmjson.RegisterType(&VoteMessage{}, "tendermint/Vote") tmjson.RegisterType(&HasVoteMessage{}, "tendermint/HasVote") tmjson.RegisterType(&VoteSetMaj23Message{}, "tendermint/VoteSetMaj23") tmjson.RegisterType(&VoteSetBitsMessage{}, "tendermint/VoteSetBits") } func decodeMsg(bz []byte) (msg Message, err error) { pb := &tmcons.Message{} if err = proto.Unmarshal(bz, pb); err != nil { return msg, err } return MsgFromProto(pb) } //------------------------------------- // NewRoundStepMessage is sent for every step taken in the ConsensusState. // For every height/round/step transition type NewRoundStepMessage struct { Height int64 Round int32 Step cstypes.RoundStepType SecondsSinceStartTime int64 LastCommitRound int32 } // ValidateBasic performs basic validation. func (m *NewRoundStepMessage) ValidateBasic() error { if m.Height < 0 { return errors.New("negative Height") } if m.Round < 0 { return errors.New("negative Round") } if !m.Step.IsValid() { return errors.New("invalid Step") } // NOTE: SecondsSinceStartTime may be negative // LastCommitRound will be -1 for the initial height, but we don't know what height this is // since it can be specified in genesis. The reactor will have to validate this via // ValidateHeight(). if m.LastCommitRound < -1 { return errors.New("invalid LastCommitRound (cannot be < -1)") } return nil } // ValidateHeight validates the height given the chain's initial height. func (m *NewRoundStepMessage) ValidateHeight(initialHeight int64) error { if m.Height < initialHeight { return fmt.Errorf("invalid Height %v (lower than initial height %v)", m.Height, initialHeight) } if m.Height == initialHeight && m.LastCommitRound != -1 { return fmt.Errorf("invalid LastCommitRound %v (must be -1 for initial height %v)", m.LastCommitRound, initialHeight) } if m.Height > initialHeight && m.LastCommitRound < 0 { return fmt.Errorf("LastCommitRound can only be negative for initial height %v", // nolint initialHeight) } return nil } // String returns a string representation. func (m *NewRoundStepMessage) String() string { return fmt.Sprintf("[NewRoundStep H:%v R:%v S:%v LCR:%v]", m.Height, m.Round, m.Step, m.LastCommitRound) } //------------------------------------- // NewValidBlockMessage is sent when a validator observes a valid block B in some round r, // i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r. // In case the block is also committed, then IsCommit flag is set to true. type NewValidBlockMessage struct { Height int64 Round int32 BlockPartSetHeader types.PartSetHeader BlockParts *bits.BitArray IsCommit bool } // ValidateBasic performs basic validation. func (m *NewValidBlockMessage) ValidateBasic() error { if m.Height < 0 { return errors.New("negative Height") } if m.Round < 0 { return errors.New("negative Round") } if err := m.BlockPartSetHeader.ValidateBasic(); err != nil { return fmt.Errorf("wrong BlockPartSetHeader: %v", err) } if m.BlockParts.Size() == 0 { return errors.New("empty blockParts") } if m.BlockParts.Size() != int(m.BlockPartSetHeader.Total) { return fmt.Errorf("blockParts bit array size %d not equal to BlockPartSetHeader.Total %d", m.BlockParts.Size(), m.BlockPartSetHeader.Total) } if m.BlockParts.Size() > int(types.MaxBlockPartsCount) { return fmt.Errorf("blockParts bit array is too big: %d, max: %d", m.BlockParts.Size(), types.MaxBlockPartsCount) } return nil } // String returns a string representation. func (m *NewValidBlockMessage) String() string { return fmt.Sprintf("[ValidBlockMessage H:%v R:%v BP:%v BA:%v IsCommit:%v]", m.Height, m.Round, m.BlockPartSetHeader, m.BlockParts, m.IsCommit) } //------------------------------------- // ProposalMessage is sent when a new block is proposed. type ProposalMessage struct { Proposal *types.Proposal } // ValidateBasic performs basic validation. func (m *ProposalMessage) ValidateBasic() error { return m.Proposal.ValidateBasic() } // String returns a string representation. func (m *ProposalMessage) String() string { return fmt.Sprintf("[Proposal %v]", m.Proposal) } //------------------------------------- // ProposalPOLMessage is sent when a previous proposal is re-proposed. type ProposalPOLMessage struct { Height int64 ProposalPOLRound int32 ProposalPOL *bits.BitArray } // ValidateBasic performs basic validation. func (m *ProposalPOLMessage) ValidateBasic() error { if m.Height < 0 { return errors.New("negative Height") } if m.ProposalPOLRound < 0 { return errors.New("negative ProposalPOLRound") } if m.ProposalPOL.Size() == 0 { return errors.New("empty ProposalPOL bit array") } if m.ProposalPOL.Size() > types.MaxVotesCount { return fmt.Errorf("proposalPOL bit array is too big: %d, max: %d", m.ProposalPOL.Size(), types.MaxVotesCount) } return nil } // String returns a string representation. func (m *ProposalPOLMessage) String() string { return fmt.Sprintf("[ProposalPOL H:%v POLR:%v POL:%v]", m.Height, m.ProposalPOLRound, m.ProposalPOL) } //------------------------------------- // BlockPartMessage is sent when gossipping a piece of the proposed block. type BlockPartMessage struct { Height int64 Round int32 Part *types.Part } // ValidateBasic performs basic validation. func (m *BlockPartMessage) ValidateBasic() error { if m.Height < 0 { return errors.New("negative Height") } if m.Round < 0 { return errors.New("negative Round") } if err := m.Part.ValidateBasic(); err != nil { return fmt.Errorf("wrong Part: %v", err) } return nil } // String returns a string representation. func (m *BlockPartMessage) String() string { return fmt.Sprintf("[BlockPart H:%v R:%v P:%v]", m.Height, m.Round, m.Part) } //------------------------------------- // VoteMessage is sent when voting for a proposal (or lack thereof). type VoteMessage struct { Vote *types.Vote } // ValidateBasic performs basic validation. func (m *VoteMessage) ValidateBasic() error { return m.Vote.ValidateBasic() } // String returns a string representation. func (m *VoteMessage) String() string { return fmt.Sprintf("[Vote %v]", m.Vote) } //------------------------------------- // HasVoteMessage is sent to indicate that a particular vote has been received. type HasVoteMessage struct { Height int64 Round int32 Type tmproto.SignedMsgType Index int32 } // ValidateBasic performs basic validation. func (m *HasVoteMessage) ValidateBasic() error { if m.Height < 0 { return errors.New("negative Height") } if m.Round < 0 { return errors.New("negative Round") } if !types.IsVoteTypeValid(m.Type) { return errors.New("invalid Type") } if m.Index < 0 { return errors.New("negative Index") } return nil } // String returns a string representation. func (m *HasVoteMessage) String() string { return fmt.Sprintf("[HasVote VI:%v V:{%v/%02d/%v}]", m.Index, m.Height, m.Round, m.Type) } //------------------------------------- // VoteSetMaj23Message is sent to indicate that a given BlockID has seen +2/3 votes. type VoteSetMaj23Message struct { Height int64 Round int32 Type tmproto.SignedMsgType BlockID types.BlockID } // ValidateBasic performs basic validation. func (m *VoteSetMaj23Message) ValidateBasic() error { if m.Height < 0 { return errors.New("negative Height") } if m.Round < 0 { return errors.New("negative Round") } if !types.IsVoteTypeValid(m.Type) { return errors.New("invalid Type") } if err := m.BlockID.ValidateBasic(); err != nil { return fmt.Errorf("wrong BlockID: %v", err) } return nil } // String returns a string representation. func (m *VoteSetMaj23Message) String() string { return fmt.Sprintf("[VSM23 %v/%02d/%v %v]", m.Height, m.Round, m.Type, m.BlockID) } //------------------------------------- // VoteSetBitsMessage is sent to communicate the bit-array of votes seen for the BlockID. type VoteSetBitsMessage struct { Height int64 Round int32 Type tmproto.SignedMsgType BlockID types.BlockID Votes *bits.BitArray } // ValidateBasic performs basic validation. func (m *VoteSetBitsMessage) ValidateBasic() error { if m.Height < 0 { return errors.New("negative Height") } if !types.IsVoteTypeValid(m.Type) { return errors.New("invalid Type") } if err := m.BlockID.ValidateBasic(); err != nil { return fmt.Errorf("wrong BlockID: %v", err) } // NOTE: Votes.Size() can be zero if the node does not have any if m.Votes.Size() > types.MaxVotesCount { return fmt.Errorf("votes bit array is too big: %d, max: %d", m.Votes.Size(), types.MaxVotesCount) } return nil } // String returns a string representation. func (m *VoteSetBitsMessage) String() string { return fmt.Sprintf("[VSB %v/%02d/%v %v %v]", m.Height, m.Round, m.Type, m.BlockID, m.Votes) } //-------------------------------------
func (ps *PeerState) InitProposalBlockParts(partSetHeader types.PartSetHeader) { ps.mtx.Lock() defer ps.mtx.Unlock()
platform.js
/*================================================== * Platform Utility Functions and Constants *================================================== */ Timeline.Platform.os = { isMac: false, isWin: false, isWin32: false, isUnix: false }; Timeline.Platform.browser = { isIE: false, isNetscape: false, isMozilla: false, isFirefox: false, isOpera: false, isSafari: false, majorVersion: 0, minorVersion: 0 }; (function() { var an = navigator.appName.toLowerCase(); var ua = navigator.userAgent.toLowerCase(); /* * Operating system */ Timeline.Platform.os.isMac = (ua.indexOf('mac') != -1);
Timeline.Platform.os.isWin = (ua.indexOf('win') != -1); Timeline.Platform.os.isWin32 = Timeline.Platform.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 ); Timeline.Platform.os.isUnix = (ua.indexOf('x11') != -1); /* * Browser */ Timeline.Platform.browser.isIE = (an.indexOf("microsoft") != -1); Timeline.Platform.browser.isNetscape = (an.indexOf("netscape") != -1); Timeline.Platform.browser.isMozilla = (ua.indexOf("mozilla") != -1); Timeline.Platform.browser.isFirefox = (ua.indexOf("firefox") != -1); Timeline.Platform.browser.isOpera = (an.indexOf("opera") != -1); //Timeline.Platform.browser.isSafari = (an.indexOf("safari") != -1); var parseVersionString = function(s) { var a = s.split("."); Timeline.Platform.browser.majorVersion = parseInt(a[0]); Timeline.Platform.browser.minorVersion = parseInt(a[1]); }; var indexOf = function(s, sub, start) { var i = s.indexOf(sub, start); return i >= 0 ? i : s.length; }; if (Timeline.Platform.browser.isMozilla) { var offset = ua.indexOf("mozilla/"); if (offset >= 0) { parseVersionString(ua.substring(offset + 8, indexOf(ua, " ", offset))); } } if (Timeline.Platform.browser.isIE) { var offset = ua.indexOf("msie "); if (offset >= 0) { parseVersionString(ua.substring(offset + 5, indexOf(ua, ";", offset))); } } if (Timeline.Platform.browser.isNetscape) { var offset = ua.indexOf("rv:"); if (offset >= 0) { parseVersionString(ua.substring(offset + 3, indexOf(ua, ")", offset))); } } if (Timeline.Platform.browser.isFirefox) { var offset = ua.indexOf("firefox/"); if (offset >= 0) { parseVersionString(ua.substring(offset + 8, indexOf(ua, " ", offset))); } } })(); Timeline.Platform.getDefaultLocale = function() { return Timeline.Platform.clientLocale; };
cor-por-categoria.js
let url_atual = window.location.href; window.onload = function(){ if(url_atual.indexOf('/noticias') != -1){ document.getElementsByClassName('cat-ativa')[0].style.borderBottom = "solid 5px #ffffff" let corForteCat = "#0396f8" let corFracaCat = "#b3dffc" corDaCategoriaHome(corForteCat, corFracaCat) }else if(url_atual.indexOf('/tv') != -1){ document.getElementsByClassName('cat-ativa')[1].style.borderBottom = "solid 5px #ffffff" let corForteCat = "#fd0000" let corFracaCat = "#f9b1b1" corDaCategoriaHome(corForteCat, corFracaCat) }else if(url_atual.indexOf('/cinema') != -1){ document.getElementsByClassName('cat-ativa')[2].style.borderBottom = "solid 5px #ffffff" let corForteCat = "#f07f16" let corFracaCat = "#f4c497" corDaCategoriaHome(corForteCat, corFracaCat) }else if(url_atual.indexOf('/musica') != -1){ document.getElementsByClassName('cat-ativa')[3].style.borderBottom = "solid 5px #ffffff" let corForteCat = "#e6be67" let corFracaCat = "#e5dac3" corDaCategoriaHome(corForteCat, corFracaCat) }else if(url_atual.indexOf('/quadrinhos') != -1){ document.getElementsByClassName('cat-ativa')[4].style.borderBottom = "solid 5px #ffffff" let corForteCat = "#3ca03c" let corFracaCat = "#c9eac9" corDaCategoriaHome(corForteCat, corFracaCat) }else if(url_atual.indexOf('/games') != -1){ document.getElementsByClassName('cat-ativa')[5].style.borderBottom = "solid 5px #ffffff" let corForteCat = "#9659f7" let corFracaCat = "#d4bef7" corDaCategoriaHome(corForteCat, corFracaCat) } } function co
orForteCat, corFracaCat){ document.getElementsByTagName('header')[0].style.backgroundColor = corForteCat document.getElementsByClassName('mais-opcoes')[0].style.backgroundColor = corForteCat document.getElementById('menu-mobile').style.backgroundColor = corForteCat document.getElementsByClassName('titulo-mais-lidas')[0].style.color = corForteCat document.getElementsByClassName('titulo-noticias-categoria')[0].style.color = corForteCat for(let i= 0; i<document.getElementsByTagName('button').length; i++){ document.getElementsByTagName('button')[i].style.backgroundColor = corForteCat } for(let i= 0; i<document.getElementsByClassName('mais-lidas-unidade-categoria').length; i++){ document.getElementsByClassName('mais-lidas-unidade-categoria')[i].style.backgroundColor = corFracaCat } for(let i= 0; i<document.getElementsByClassName('noticia-categoria').length; i++){ document.getElementsByClassName('noticia-categoria')[i].style.backgroundColor = corFracaCat } document.getElementById('rede-social-color').style.backgroundColor = corForteCat document.getElementById('desenvolvimento').style.backgroundColor = corForteCat }
rDaCategoriaHome(c
metaspace.rs
use serde::{Deserialize, Serialize}; use crate::tokenizer::{Decoder, PreTokenizedString, PreTokenizer, Result, SplitDelimiterBehavior}; #[derive(Serialize, Deserialize, Clone, Debug)] /// Replaces all the whitespaces by the provided meta character and then /// splits on this character #[serde(tag = "type")] pub struct Metaspace { replacement: char, str_rep: String, add_prefix_space: bool, } impl Metaspace { pub fn new(replacement: char, add_prefix_space: bool) -> Self { Self { replacement, str_rep: replacement.to_string(), add_prefix_space, } } } impl Default for Metaspace { fn default() -> Self { Self::new('▁', true) } } impl PreTokenizer for Metaspace { fn pre_tokenize(&self, pretokenized: &mut PreTokenizedString) -> Result<()> { pretokenized.split(|_, mut normalized| { if self.add_prefix_space && !normalized.get().starts_with(self.replacement) { normalized.prepend(&self.str_rep); } normalized.replace(' ', &self.str_rep)?; normalized.split(self.replacement, SplitDelimiterBehavior::MergedWithNext) }) } } impl Decoder for Metaspace { fn decode(&self, tokens: Vec<String>) -> Result<String> { Ok(tokens .iter() .flat_map(|t| t.chars()) .enumerate() .filter_map(|(i, c)| { if c == self.replacement { if i == 0 && self.add_prefix_space { None } else { Some(' ') } } else { Some(c) } }) .collect::<String>()) } } #[cfg(test)] mod tests { use super::*; use crate::OffsetReferential; #[test] fn ba
{ let pretok = Metaspace::new('▁', true); let mut pretokenized = PreTokenizedString::from("Hey friend!"); pretok.pre_tokenize(&mut pretokenized).unwrap(); assert_eq!( pretokenized .get_splits(OffsetReferential::Normalized) .into_iter() .map(|(s, o, _)| (s, o)) .collect::<Vec<_>>(), vec![("▁Hey", (0, 6)), ("▁friend!", (6, 16))] ); assert_eq!( pretokenized .get_splits(OffsetReferential::Original) .into_iter() .map(|(s, o, _)| (s, o)) .collect::<Vec<_>>(), vec![("▁Hey", (0, 3)), ("▁friend!", (3, 11))] ); } #[test] fn multiple_spaces() { let pretok = Metaspace::new('▁', true); let mut pretokenized = PreTokenizedString::from("Hey friend!"); pretok.pre_tokenize(&mut pretokenized).unwrap(); assert_eq!( pretokenized .get_splits(OffsetReferential::Normalized) .into_iter() .map(|(s, o, _)| (s, o)) .collect::<Vec<_>>(), vec![ ("▁Hey", (0, 6)), ("▁", (6, 9)), ("▁", (9, 12)), ("▁friend!", (12, 22)), ] ); assert_eq!( pretokenized .get_splits(OffsetReferential::Original) .into_iter() .map(|(s, o, _)| (s, o)) .collect::<Vec<_>>(), vec![ ("▁Hey", (0, 3)), ("▁", (3, 4)), ("▁", (4, 5)), ("▁friend!", (5, 13)), ] ); } #[test] fn decode() { let decoder = Metaspace::new('▁', true); let res = decoder .decode(vec!["▁Hey".into(), "▁friend!".into()]) .unwrap(); assert_eq!(&res, "Hey friend!") } }
sic()
Calendar.tsx
import { computed, defineComponent, h, ref, PropType, CSSProperties, Fragment, toRef } from 'vue' import { format, getYear, addMonths, startOfDay, startOfMonth, getMonth } from 'date-fns/esm' import { useMergedState } from 'vooks' import { dateArray } from '../../date-picker/src/utils' import { ChevronLeftIcon, ChevronRightIcon } from '../../_internal/icons' import { NBaseIcon } from '../../_internal' import { call } from '../../_utils' import type { ExtractPublicPropTypes, MaybeArray } from '../../_utils' import { NButton } from '../../button' import { NButtonGroup } from '../../button-group' import { useConfig, useLocale, useTheme, useThemeClass } from '../../_mixins' import type { ThemeProps } from '../../_mixins' import { calendarLight } from '../styles' import type { CalendarTheme } from '../styles' import type { OnUpdateValue, DateItem, OnPanelChange } from './interface' import style from './styles/index.cssr' const calendarProps = { ...(useTheme.props as ThemeProps<CalendarTheme>), isDateDisabled: Function as PropType<(date: number) => boolean | undefined>, value: Number, defaultValue: { type: Number as PropType<number | null>, default: null }, onPanelChange: Function as PropType<OnPanelChange>, 'onUpdate:value': [Function, Array] as PropType<MaybeArray<OnUpdateValue>>, onUpdateValue: [Function, Array] as PropType<MaybeArray<OnUpdateValue>> } as const export type CalendarProps = ExtractPublicPropTypes<typeof calendarProps> export default defineComponent({ name: 'Calendar', props: calendarProps, setup (props) { const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props) const themeRef = useTheme( 'Calendar', '-calendar', style, calendarLight, props, mergedClsPrefixRef ) const { localeRef, dateLocaleRef } = useLocale('DatePicker') const now = Date.now() // ts => timestamp const monthTsRef = ref(startOfMonth(now).valueOf()) const uncontrolledValueRef = ref<number | null>(props.defaultValue || null) const mergedValueRef = useMergedState( toRef(props, 'value'), uncontrolledValueRef ) function doUpdateValue (value: number, time: DateItem): void { const { onUpdateValue, 'onUpdate:value': _onUpdateValue } = props if (onUpdateValue) { call(onUpdateValue, value, time) } if (_onUpdateValue) { call(_onUpdateValue, value, time) } uncontrolledValueRef.value = value } function handlePrevClick (): void { const monthTs = addMonths(monthTsRef.value, -1).valueOf() monthTsRef.value = monthTs props.onPanelChange?.({ year: getYear(monthTs), month: getMonth(monthTs) + 1 }) } function handleNextClick (): void { const monthTs = addMonths(monthTsRef.value, 1).valueOf() monthTsRef.value = monthTs props.onPanelChange?.({ year: getYear(monthTs), month: getMonth(monthTs) + 1 }) } function handleTodayClick (): void { const { value: monthTs } = monthTsRef const oldYear = getYear(monthTs) const oldMonth = getMonth(monthTs) const newMonthTs = startOfMonth(now).valueOf() monthTsRef.value = newMonthTs const newYear = getYear(newMonthTs) const newMonth = getMonth(newMonthTs) if (oldYear !== newYear || oldMonth !== newMonth) { props.onPanelChange?.({ year: newYear, month: newMonth + 1 }) } } const cssVarsRef = computed(() => { const { common: { cubicBezierEaseInOut }, self: { borderColor, borderColorModal, borderColorPopover, borderRadius, titleFontSize, textColor, titleFontWeight, titleTextColor, dayTextColor, fontSize, lineHeight, dateColorCurrent, dateTextColorCurrent, cellColorHover, cellColor, cellColorModal, barColor, cellColorPopover, cellColorHoverModal, cellColorHoverPopover } } = themeRef.value return { '--n-bezier': cubicBezierEaseInOut, '--n-border-color': borderColor, '--n-border-color-modal': borderColorModal, '--n-border-color-popover': borderColorPopover, '--n-border-radius': borderRadius, '--n-text-color': textColor, '--n-title-font-weight': titleFontWeight, '--n-title-font-size': titleFontSize, '--n-title-text-color': titleTextColor, '--n-day-text-color': dayTextColor, '--n-font-size': fontSize, '--n-line-height': lineHeight, '--n-date-color-current': dateColorCurrent, '--n-date-text-color-current': dateTextColorCurrent, '--n-cell-color': cellColor, '--n-cell-color-modal': cellColorModal, '--n-cell-color-popover': cellColorPopover, '--n-cell-color-hover': cellColorHover, '--n-cell-color-hover-modal': cellColorHoverModal, '--n-cell-color-hover-popover': cellColorHoverPopover, '--n-bar-color': barColor } }) const themeClassHandle = inlineThemeDisabled ? useThemeClass('calendar', undefined, cssVarsRef, props) : undefined return { mergedClsPrefix: mergedClsPrefixRef, locale: localeRef, dateLocale: dateLocaleRef, now, mergedValue: mergedValueRef, monthTs: monthTsRef, dateItems: computed(() => { return dateArray( monthTsRef.value, mergedValueRef.value, now, localeRef.value.firstDayOfWeek, true ) }), doUpdateValue, handleTodayClick, handlePrevClick, handleNextClick, mergedTheme: themeRef, cssVars: inlineThemeDisabled ? undefined : cssVarsRef, themeClass: themeClassHandle?.themeClass, onRender: themeClassHandle?.onRender } }, render () { const { isDateDisabled, mergedClsPrefix, monthTs, cssVars, mergedValue, mergedTheme, $slots, locale: { monthBeforeYear, today }, dateLocale: { locale }, handleTodayClick, handlePrevClick, handleNextClick, onRender } = this onRender?.() const normalizedValue = mergedValue && startOfDay(mergedValue).valueOf() const localeMonth = format(monthTs, 'MMMM', { locale }) const year = getYear(monthTs) const title = monthBeforeYear ? `${localeMonth} ${year}` : `${year} ${localeMonth}` return ( <div class={[`${mergedClsPrefix}-calendar`, this.themeClass]} style={cssVars as CSSProperties} > <div class={`${mergedClsPrefix}-calendar-header`}> <div class={`${mergedClsPrefix}-calendar-header__title`}>{title}</div> <div class={`${mergedClsPrefix}-calendar-header__extra`}> <NButtonGroup> {{ default: () => ( <> <NButton size="small" onClick={handlePrevClick} theme={mergedTheme.peers.Button} themeOverrides={mergedTheme.peerOverrides.Button}
icon: () => ( <NBaseIcon clsPrefix={mergedClsPrefix} class={`${mergedClsPrefix}-calendar-prev-btn`} > {{ default: () => <ChevronLeftIcon /> }} </NBaseIcon> ) }} </NButton> <NButton size="small" onClick={handleTodayClick} theme={mergedTheme.peers.Button} themeOverrides={mergedTheme.peerOverrides.Button} > {{ default: () => today }} </NButton> <NButton size="small" onClick={handleNextClick} theme={mergedTheme.peers.Button} themeOverrides={mergedTheme.peerOverrides.Button} > {{ icon: () => ( <NBaseIcon clsPrefix={mergedClsPrefix} class={`${mergedClsPrefix}-calendar-next-btn`} > {{ default: () => <ChevronRightIcon /> }} </NBaseIcon> ) }} </NButton> </> ) }} </NButtonGroup> </div> </div> <div class={`${mergedClsPrefix}-calendar-dates`}> {this.dateItems.map( ({ dateObject, ts, inCurrentMonth, isCurrentDate }, index) => { const { year, month, date } = dateObject const fullDate = format(ts, 'yyyy-MM-dd') // 'notInCurrentMonth' and 'disabled' are both disabled styles, but 'disabled''s cursor are not-allowed const notInCurrentMonth = !inCurrentMonth const disabled = isDateDisabled?.(ts) === true const selected = normalizedValue === startOfDay(ts).valueOf() return ( <div key={isCurrentDate ? 'current' : index} class={[ `${mergedClsPrefix}-calendar-cell`, disabled && `${mergedClsPrefix}-calendar-cell--disabled`, notInCurrentMonth && `${mergedClsPrefix}-calendar-cell--other-month`, disabled && `${mergedClsPrefix}-calendar-cell--not-allowed`, isCurrentDate && `${mergedClsPrefix}-calendar-cell--current`, selected && `${mergedClsPrefix}-calendar-cell--selected` ]} onClick={() => { if (disabled) return this.doUpdateValue(ts, { year, month: month + 1, date }) this.monthTs = startOfMonth(ts).valueOf() }} > <div class={`${mergedClsPrefix}-calendar-date`}> {disabled ? ( <div class={`${mergedClsPrefix}-calendar-date__date`} title={fullDate} key="disabled" > {date} </div> ) : ( <div class={`${mergedClsPrefix}-calendar-date__date`} title={fullDate} key="available" > {date} </div> )} {index < 7 && ( <div class={`${mergedClsPrefix}-calendar-date__day`} title={fullDate} > {format(ts, 'EEE', { locale })} </div> )} </div> {$slots.default?.({ year, month: month + 1, date })} <div class={`${mergedClsPrefix}-calendar-cell__bar`} key={month} /> </div> ) } )} </div> </div> ) } })
> {{
test.py
# Copyright 2015 The go-python Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. ## py2/py3 compat from __future__ import print_function import structs
s = structs.S() print("s = %s" % (s,)) print("s.Init()") s.Init() print("s.Upper('boo')= %s" % repr(s.Upper("boo")).lstrip('u')) print("s1 = structs.S1()") s1 = structs.S1() print("s1 = %s" %(s1,)) try: s1 = structs.S1(1) except Exception as err: print("caught error: %s" % (err,)) pass try: s1 = structs.S1() print("s1.private = %s" % (s1.private,)) except Exception as err: print("caught error: %s" % (err,)) pass print("s2 = structs.S2()") s2 = structs.S2(1) print("s2 = %s" % (s2,)) try: s2 = structs.S2(1,2) except Exception as err: print("caught error: %s" % (err,)) pass try: s2 = structs.S2(42) print("s2 = %s" % (s2,)) print("s2.Public = %s" % (s2.Public,)) print("s2.private = %s" % (s2.private,)) except Exception as err: print("caught error: %s" % (err,)) pass class S2Child(structs.S2): def __init__(self, a, b): super(S2Child, self).__init__(a) self.local = b def __str__(self): return ("S2Child{S2: %s, local: %d}" % (super(S2Child, self).__str__(), self.local)) try: s2child = S2Child(42, 123) print("s2child = %s" % (s2child,)) print("s2child.Public = %s" % (s2child.Public,)) print("s2child.local = %s" % (s2child.local,)) print("s2child.private = %s" % (s2child.private,)) except Exception as err: print("caught error: %s" % (err,)) pass print("OK")
print("s = structs.S()")
logging.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import sys import logging import functools import paddle.distributed as dist logger_initialized = {} @functools.lru_cache() def get_logger(name='srnet', log_file=None, log_level=logging.INFO): """Initialize and get a logger by name. If the logger has not been initialized, this method will initialize the logger by adding one or two handlers, otherwise the initialized logger will be directly returned. During initialization, a StreamHandler will always be added. If `log_file` is specified a FileHandler will also be added. Args: name (str): Logger name. log_file (str | None): The log filename. If specified, a FileHandler will be added to the logger. log_level (int): The logger level. Note that only the process of rank 0 is affected, and other processes will set the level to "Error" thus be silent most of the time. Returns: logging.Logger: The expected logger. """ logger = logging.getLogger(name) if name in logger_initialized: return logger for logger_name in logger_initialized: if name.startswith(logger_name): return logger formatter = logging.Formatter( '[%(asctime)s] %(name)s %(levelname)s: %(message)s', datefmt="%Y/%m/%d %H:%M:%S") stream_handler = logging.StreamHandler(stream=sys.stdout) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) if log_file is not None and dist.get_rank() == 0: log_file_folder = os.path.split(log_file)[0] os.makedirs(log_file_folder, exist_ok=True) file_handler = logging.FileHandler(log_file, 'a') file_handler.setFormatter(formatter) logger.addHandler(file_handler) if dist.get_rank() == 0: logger.setLevel(log_level) else:
logger.setLevel(logging.ERROR) logger_initialized[name] = True return logger
box1.rs
// box1.rs // // At compile time, Rust needs to know how much space a type takes up. This becomes problematic // for recursive types, where a value can have as part of itself another value of the same type. // To get around the issue, we can use a `Box` - a smart pointer used to store data on the heap, // which also allows us to wrap a recursive type. // // The recursive type we're implementing in this exercise is the `cons list` - a data structure // frequently found in functional programming languages. Each item in a cons list contains two // elements: the value of the current item and the next item. The last item is a value called `Nil`. // // Step 1: use a `Box` in the enum definition to make the code compile // Step 2: create both empty and non-empty cons lists by replacing `unimplemented!()` //
// Note: the tests should not be changed // // Execute `rustlings hint box1` for hints :) /* #[derive(PartialEq, Debug)] pub enum List { Cons(i32, List), Nil, } fn main() { println!("This is an empty cons list: {:?}", create_empty_list()); println!( "This is a non-empty cons list: {:?}", create_non_empty_list() ); } pub fn create_empty_list() -> List { unimplemented!() } pub fn create_non_empty_list() -> List { unimplemented!() } #[cfg(test)] mod tests { use super::*; #[test] fn test_create_empty_list() { assert_eq!(List::Nil, create_empty_list()) } #[test] fn test_create_non_empty_list() { assert_ne!(create_empty_list(), create_non_empty_list()) } } */
msg.py
def
(): print("olá mundo!!!")
mensagem
lib.rs
//! # Day 07: Handy Haversacks //! //! [GitHub source](https://github.com/nbigaouette/advent_of_code_2019/tree/master/day07) //! //! [Benchmarking report](../../../day07/target/criterion/report/index.html) //! //! ## Part One //! //! You land at the regional airport in time for your next flight. In fact, it looks like you'll even have time to //! grab some food: all flights are currently delayed due to _issues in luggage processing_. //! //! Due to recent aviation regulations, many rules (your puzzle input) are being enforced about bags and their //! contents; bags must be color-coded and must contain specific quantities of other color-coded bags. Apparently, //! nobody responsible for these regulations considered how long they would take to enforce! //! //! For example, consider the following rules: //! //! ```text //! light red bags contain 1 bright white bag, 2 muted yellow bags. //! dark orange bags contain 3 bright white bags, 4 muted yellow bags. //! bright white bags contain 1 shiny gold bag. //! muted yellow bags contain 2 shiny gold bags, 9 faded blue bags. //! shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags. //! dark olive bags contain 3 faded blue bags, 4 dotted black bags. //! vibrant plum bags contain 5 faded blue bags, 6 dotted black bags. //! faded blue bags contain no other bags. //! dotted black bags contain no other bags. //! ``` //! //! These rules specify the required contents for 9 bag types. In this example, every `faded blue` bag is empty, //! every `vibrant plum` bag contains 11 bags (5 `faded blue` and 6 `dotted black`), and so on. //! //! You have a `_shiny gold_` bag. If you wanted to carry it in at least one other bag, how many different bag //! colors would be valid for the outermost bag? (In other words: how many colors can, eventually, contain at //! least one `shiny gold` bag?) //! //! In the above rules, the following options would be available to you: //! //! * A `bright white` bag, which can hold your `shiny gold` bag directly. //! * A `muted yellow` bag, which can hold your `shiny gold` bag directly, plus some other bags. //! * A `dark orange` bag, which can hold `bright white` and `muted yellow` bags, either of which could then hold //! your `shiny gold` bag. //! * A `light red` bag, which can hold `bright white` and `muted yellow` bags, either of which could then hold your `shiny gold` bag. //! //! So, in this example, the number of bag colors that can eventually contain at least one `shiny gold` bag is `_4_`. //! //! _How many bag colors can eventually contain at least one `shiny gold` bag?_ (The list of rules is quite long; make //! sure you get all of it.) //! //! ## Part Two //! //! It's getting pretty expensive to fly these days - not because of ticket prices, but because of the ridiculous number //! of bags you need to buy! //! //! Consider again your `shiny gold` bag and the rules from the above example: //! //! * `faded blue` bags contain `0` other bags. //! * `dotted black` bags contain `0` other bags. //! * `vibrant plum` bags contain `11` other bags: 5 `faded blue` bags and 6 `dotted black` bags. //! * `dark olive` bags contain `7` other bags: 3 `faded blue` bags and 4 `dotted black` bags. //! //! So, a single `shiny gold` bag must contain 1 `dark olive` bag (and the 7 bags within it) plus 2 `vibrant plum` bags //! (and the 11 bags within _each_ of those): `1 + 1*7 + 2 + 2*11` = `_32_` bags! //! //! Of course, the actual rules have a small chance of going several levels deeper than this example; be sure to count //! all of the bags, even if the nesting becomes topologically impractical! //! //! Here's another example: //! //! ```text //! shiny gold bags contain 2 dark red bags. //! dark red bags contain 2 dark orange bags. //! dark orange bags contain 2 dark yellow bags. //! dark yellow bags contain 2 dark green bags. //! dark green bags contain 2 dark blue bags. //! dark blue bags contain 2 dark violet bags. //! dark violet bags contain no other bags. //! ``` //! //! In this example, a single `shiny gold` bag must contain `_126_` other bags. //! //! _How many individual bags are required inside your single `shiny gold` bag?_ //! use std::{collections::HashMap, fmt::Debug}; pub use anyhow::{Context, Result}; use shrinkwraprs::Shrinkwrap; pub mod initial; pub use crate::initial::Day07Initial; #[derive(Debug, Shrinkwrap, PartialEq)] pub struct Day07Entry(usize); type Day07SolutionPart1 = usize; type Day07SolutionPart2 = usize; pub trait AoC<'a>: Debug { type SolutionPart1; type SolutionPart2;
} fn new(input: &'a str) -> Self where Self: Sized; fn solution_part1(&self) -> Self::SolutionPart1 { unimplemented!() } fn solution_part2(&self) -> Self::SolutionPart2 { unimplemented!() } } pub fn parse_input<'a>(input: &'a str) -> HashMap<&'a str, Vec<(usize, &'a str)>> { input .trim() .lines() .map(str::trim) .map(|line| { let mut entry_iter = line.split(" bags contain "); let bag_containing = entry_iter.next().expect("a containing bag"); let contained_bags_sentence = entry_iter.next().expect("contained bags"); let contained_bags: Vec<(usize, &'a str)> = match contained_bags_sentence { "no other bags." => Vec::new(), contained_bags_sentence => contained_bags_sentence .split(", ") .map(|entry| { let mut entry_iter = entry.split(' '); let count_str = entry_iter.next().expect("a count string"); let bag_color = entry .trim_start_matches(count_str) .trim_end_matches('.') .trim_end_matches("bags") .trim_end_matches("bag") .trim(); let count: usize = count_str.parse().expect("a count number"); (count, bag_color) }) .collect(), }; (bag_containing, contained_bags) }) .collect() } pub static PUZZLE_INPUT: &str = include_str!("../input"); pub mod benchmark { use super::*; pub type BenchmarkVector<'a> = Vec< Box< dyn AoC<'a, SolutionPart1 = Day07SolutionPart1, SolutionPart2 = Day07SolutionPart2> + 'a, >, >; pub fn to_benchmark<'a>() -> BenchmarkVector<'a> { vec![Box::new(Day07Initial::new(PUZZLE_INPUT))] } } #[cfg(test)] mod tests { use std::env; use pretty_assertions::assert_eq; use super::*; pub fn init_logger() { env::var("RUST_LOG") .or_else(|_| -> Result<String, ()> { let rust_log = "debug".to_string(); println!("Environment variable 'RUST_LOG' not set."); println!("Setting to: {}", rust_log); env::set_var("RUST_LOG", &rust_log); Ok(rust_log) }) .unwrap(); let _ = env_logger::try_init(); } #[test] fn parse_single() { init_logger(); let input = "light red bags contain 1 bright white bag, 2 muted yellow bags."; let expected = [("light red", vec![(1, "bright white"), (2, "muted yellow")])] .iter() .cloned() .collect::<HashMap<&str, Vec<(usize, &str)>>>(); let rules = parse_input(input); assert_eq!(rules.len(), 1); assert_eq!(rules, expected); } #[test] fn parse() { init_logger(); let input = "light red bags contain 1 bright white bag, 2 muted yellow bags. dark orange bags contain 3 bright white bags, 4 muted yellow bags. bright white bags contain 1 shiny gold bag. muted yellow bags contain 2 shiny gold bags, 9 faded blue bags. shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags. dark olive bags contain 3 faded blue bags, 4 dotted black bags. vibrant plum bags contain 5 faded blue bags, 6 dotted black bags. faded blue bags contain no other bags. dotted black bags contain no other bags."; let expected = [ ("light red", vec![(1, "bright white"), (2, "muted yellow")]), ( "dark orange", vec![(3, "bright white"), (4, "muted yellow")], ), ("bright white", vec![(1, "shiny gold")]), ("muted yellow", vec![(2, "shiny gold"), (9, "faded blue")]), ("shiny gold", vec![(1, "dark olive"), (2, "vibrant plum")]), ("dark olive", vec![(3, "faded blue"), (4, "dotted black")]), ("vibrant plum", vec![(5, "faded blue"), (6, "dotted black")]), ("faded blue", vec![]), ("dotted black", vec![]), ] .iter() .cloned() .collect::<HashMap<&str, Vec<(usize, &str)>>>(); let rules = parse_input(input); assert_eq!(rules.len(), 9); assert_eq!(rules, expected); } }
fn description(&self) -> &'static str { "None"
float64.rs
use super::{check_dtype, HasPandasColumn, PandasColumn, PandasColumnObject}; use anyhow::anyhow; use connectorx::ConnectorAgentError; use fehler::throws; use ndarray::{ArrayViewMut2, Axis, Ix2}; use numpy::PyArray; use pyo3::{FromPyObject, PyAny, PyResult}; use std::any::TypeId; // Float pub struct Float64Block<'a> { data: ArrayViewMut2<'a, f64>, } impl<'a> FromPyObject<'a> for Float64Block<'a> { fn extract(ob: &'a PyAny) -> PyResult<Self> { check_dtype(ob, "float64")?; let array = ob.downcast::<PyArray<f64, Ix2>>()?; let data = unsafe { array.as_array_mut() }; Ok(Float64Block { data }) } } impl<'a> Float64Block<'a> { #[throws(ConnectorAgentError)] pub fn split(self) -> Vec<Float64Column<'a>> { let mut ret = vec![]; let mut view = self.data; let nrows = view.ncols(); while view.nrows() > 0 { let (col, rest) = view.split_at(Axis(0), 1); view = rest; ret.push(Float64Column { data: col .into_shape(nrows)? .into_slice() .ok_or_else(|| anyhow!("get None for splitted Float64 data"))?, i: 0, })
ret } } pub struct Float64Column<'a> { data: &'a mut [f64], i: usize, } impl<'a> PandasColumnObject for Float64Column<'a> { fn typecheck(&self, id: TypeId) -> bool { id == TypeId::of::<f64>() || id == TypeId::of::<Option<f64>>() } fn len(&self) -> usize { self.data.len() } fn typename(&self) -> &'static str { std::any::type_name::<f64>() } } impl<'a> PandasColumn<f64> for Float64Column<'a> { #[throws(ConnectorAgentError)] fn write(&mut self, val: f64) { unsafe { *self.data.get_unchecked_mut(self.i) = val }; self.i += 1; } } impl<'a> PandasColumn<Option<f64>> for Float64Column<'a> { #[throws(ConnectorAgentError)] fn write(&mut self, val: Option<f64>) { match val { None => unsafe { *self.data.get_unchecked_mut(self.i) = f64::NAN }, Some(val) => unsafe { *self.data.get_unchecked_mut(self.i) = val }, } self.i += 1; } } impl HasPandasColumn for f64 { type PandasColumn<'a> = Float64Column<'a>; } impl HasPandasColumn for Option<f64> { type PandasColumn<'a> = Float64Column<'a>; } impl<'a> Float64Column<'a> { pub fn partition(self, counts: &[usize]) -> Vec<Float64Column<'a>> { let mut partitions = vec![]; let mut data = self.data; for &c in counts { let (splitted, rest) = data.split_at_mut(c); data = rest; partitions.push(Float64Column { data: splitted, i: 0, }); } partitions } }
}
msg_server_approve_revoke_x_509_root_cert.go
package keeper import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" ) func (k msgServer) ApproveRevokeX509RootCert(goCtx context.Context, msg *types.MsgApproveRevokeX509RootCert) (*types.MsgApproveRevokeX509RootCertResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // check if signer has root certificate approval role signerAddr, err := sdk.AccAddressFromBech32(msg.Signer) if err != nil { return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid Address: (%s)", err) } if !k.dclauthKeeper.HasRole(ctx, signerAddr, types.RootCertificateApprovalRole) { return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "MsgApproveRevokeX509RootCert transaction should be signed by "+ "an account with the \"%s\" role", types.RootCertificateApprovalRole, ) } // get proposed certificate revocation revocation, found := k.GetProposedCertificateRevocation(ctx, msg.Subject, msg.SubjectKeyId) if !found
// check if proposed certificate revocation already has approval form signer if revocation.HasApprovalFrom(signerAddr) { return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "Certificate revocation associated with subject=%v and subjectKeyID=%v combination "+ "already has approval from=%v", msg.Subject, msg.SubjectKeyId, msg.Signer, ) } // append approval revocation.Approvals = append(revocation.Approvals, signerAddr.String()) // check if proposed certificate revocation has enough approvals if len(revocation.Approvals) == types.RootCertificateApprovals { certificates, found := k.GetApprovedCertificates(ctx, msg.Subject, msg.SubjectKeyId) if !found { return nil, types.NewErrCertificateDoesNotExist(msg.Subject, msg.SubjectKeyId) } k.AddRevokedCertificates(ctx, certificates) k.RemoveApprovedCertificates(ctx, msg.Subject, msg.SubjectKeyId) k.RevokeChildCertificates(ctx, msg.Subject, msg.SubjectKeyId) k.RemoveProposedCertificateRevocation(ctx, msg.Subject, msg.SubjectKeyId) // remove from root certs index, add to revoked root certs certId := types.CertificateIdentifier{ Subject: msg.Subject, SubjectKeyId: msg.SubjectKeyId, } k.RemoveApprovedRootCertificate(ctx, certId) k.AddRevokedRootCertificate(ctx, certId) // remove from subject -> subject key ID map k.RemoveApprovedCertificateBySubject(ctx, msg.Subject, msg.SubjectKeyId) } else { k.SetProposedCertificateRevocation(ctx, revocation) } return &types.MsgApproveRevokeX509RootCertResponse{}, nil }
{ return nil, types.NewErrProposedCertificateRevocationDoesNotExist(msg.Subject, msg.SubjectKeyId) }
main-es2015.7533b710fffc0ccbd61e.js
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{0:function(e,t,n){e.exports=n("zUnb")},"2QA8":function(e,t,n){"use strict";n.d(t,"a",function(){return l});const l="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()},"2fFW":function(e,t,n){"use strict";n.d(t,"a",function(){return r});let l=!1;const r={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){l=e},get useDeprecatedSynchronousErrorHandling(){return l}}},"5+tZ":function(e,t,n){"use strict";n.d(t,"a",function(){return a});var l=n("ZUHj"),r=n("l7GE"),i=n("51Dv"),o=n("lJxs"),s=n("Cfvw");function a(e,t,n=Number.POSITIVE_INFINITY){return"function"==typeof t?l=>l.pipe(a((n,l)=>Object(s.a)(e(n,l)).pipe(Object(o.a)((e,r)=>t(n,e,l,r))),n)):("number"==typeof t&&(n=t),t=>t.lift(new u(e,n)))}class u{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new c(e,this.project,this.concurrent))}}class c extends r.a{constructor(e,t,n=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)}_tryNext(e){let t;const n=this.index++;try{t=this.project(e,n)}catch(l){return void this.destination.error(l)}this.active++,this._innerSub(t,e,n)}_innerSub(e,t,n){const r=new i.a(this,void 0,void 0);this.destination.add(r),Object(l.a)(this,e,t,n,r)}_complete(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()}notifyNext(e,t,n,l,r){this.destination.next(t)}notifyComplete(e){const t=this.buffer;this.remove(e),this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}},"51Dv":function(e,t,n){"use strict";n.d(t,"a",function(){return r});var l=n("7o/Q");class r extends l.a{constructor(e,t,n){super(),this.parent=e,this.outerValue=t,this.outerIndex=n,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}},"7LN8":function(e,t,n){var l=n("mrSG").__decorate,r=n("mrSG").__metadata;Object.defineProperty(t,"__esModule",{value:!0});var i=n("8Y7J"),o=n("SVse"),s=n("8Y7J"),a=function(){return l([s.Component({selector:"p-header",template:"<ng-content></ng-content>"})],function(){})}();t.Header=a;var u=function(){return l([s.Component({selector:"p-footer",template:"<ng-content></ng-content>"})],function(){})}();t.Footer=u;var c=function(){function e(e){this.template=e}return e.prototype.getType=function(){return this.name},l([i.Input(),r("design:type",String)],e.prototype,"type",void 0),l([i.Input("pTemplate"),r("design:type",String)],e.prototype,"name",void 0),l([i.Directive({selector:"[pTemplate]",host:{}})],e)}();t.PrimeTemplate=c;var d=function(){function e(){this.filterType="text",this.exportable=!0,this.resizable=!0,this.sortFunction=new i.EventEmitter}return e.prototype.ngAfterContentInit=function(){var e=this;this.templates.forEach(function(t){switch(t.getType()){case"header":e.headerTemplate=t.template;break;case"body":e.bodyTemplate=t.template;break;case"footer":e.footerTemplate=t.template;break;case"filter":e.filterTemplate=t.template;break;case"editor":e.editorTemplate=t.template;break;default:e.bodyTemplate=t.template}})},l([i.Input(),r("design:type",String)],e.prototype,"field",void 0),l([i.Input(),r("design:type",String)],e.prototype,"colId",void 0),l([i.Input(),r("design:type",String)],e.prototype,"sortField",void 0),l([i.Input(),r("design:type",String)],e.prototype,"filterField",void 0),l([i.Input(),r("design:type",String)],e.prototype,"header",void 0),l([i.Input(),r("design:type",String)],e.prototype,"footer",void 0),l([i.Input(),r("design:type",Object)],e.prototype,"sortable",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"editable",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"filter",void 0),l([i.Input(),r("design:type",String)],e.prototype,"filterMatchMode",void 0),l([i.Input(),r("design:type",String)],e.prototype,"filterType",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"excludeGlobalFilter",void 0),l([i.Input(),r("design:type",Number)],e.prototype,"rowspan",void 0),l([i.Input(),r("design:type",Number)],e.prototype,"colspan",void 0),l([i.Input(),r("design:type",String)],e.prototype,"scope",void 0),l([i.Input(),r("design:type",Object)],e.prototype,"style",void 0),l([i.Input(),r("design:type",String)],e.prototype,"styleClass",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"exportable",void 0),l([i.Input(),r("design:type",Object)],e.prototype,"headerStyle",void 0),l([i.Input(),r("design:type",String)],e.prototype,"headerStyleClass",void 0),l([i.Input(),r("design:type",Object)],e.prototype,"bodyStyle",void 0),l([i.Input(),r("design:type",String)],e.prototype,"bodyStyleClass",void 0),l([i.Input(),r("design:type",Object)],e.prototype,"footerStyle",void 0),l([i.Input(),r("design:type",String)],e.prototype,"footerStyleClass",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"hidden",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"expander",void 0),l([i.Input(),r("design:type",String)],e.prototype,"selectionMode",void 0),l([i.Input(),r("design:type",String)],e.prototype,"filterPlaceholder",void 0),l([i.Input(),r("design:type",Number)],e.prototype,"filterMaxlength",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"frozen",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"resizable",void 0),l([i.Output(),r("design:type",i.EventEmitter)],e.prototype,"sortFunction",void 0),l([i.ContentChildren(c),r("design:type",i.QueryList)],e.prototype,"templates",void 0),l([i.ContentChild(i.TemplateRef),r("design:type",i.TemplateRef)],e.prototype,"template",void 0),l([s.Component({selector:"p-column",template:""})],e)}();t.Column=d;var h=function(){function e(){}return l([i.ContentChildren(d),r("design:type",i.QueryList)],e.prototype,"columns",void 0),l([s.Component({selector:"p-row",template:""})],e)}();t.Row=h;var p=function(){function e(){}return l([i.Input(),r("design:type",Boolean)],e.prototype,"frozen",void 0),l([i.ContentChildren(h),r("design:type",i.QueryList)],e.prototype,"rows",void 0),l([s.Component({selector:"p-headerColumnGroup",template:""})],e)}();t.HeaderColumnGroup=p;var f=function(){function e(){}return l([i.Input(),r("design:type",Boolean)],e.prototype,"frozen",void 0),l([i.ContentChildren(h),r("design:type",i.QueryList)],e.prototype,"rows",void 0),l([s.Component({selector:"p-footerColumnGroup",template:""})],e)}();t.FooterColumnGroup=f,t.SharedModule=function(){return l([i.NgModule({imports:[o.CommonModule],exports:[a,u,d,c,h,p,f],declarations:[a,u,d,c,h,p,f]})],function(){})}()},"7o/Q":function(e,t,n){"use strict";n.d(t,"a",function(){return u});var l=n("n6bG"),r=n("gRHU"),i=n("quSY"),o=n("2QA8"),s=n("2fFW"),a=n("NJ4a");class u extends i.a{constructor(e,t,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=r.a;break;case 1:if(!e){this.destination=r.a;break}if("object"==typeof e){e instanceof u?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new c(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new c(this,e,t,n)}}[o.a](){return this}static create(e,t,n){const l=new u(e,t,n);return l.syncErrorThrowable=!1,l}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class c extends u{constructor(e,t,n,i){let o;super(),this._parentSubscriber=e;let s=this;Object(l.a)(t)?o=t:t&&(o=t.next,n=t.error,i=t.complete,t!==r.a&&(s=Object.create(t),Object(l.a)(s.unsubscribe)&&this.add(s.unsubscribe.bind(s)),s.unsubscribe=this.unsubscribe.bind(this))),this._context=s,this._next=o,this._error=n,this._complete=i}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;s.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:n}=s.a;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):Object(a.a)(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;Object(a.a)(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);s.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(n){if(this.unsubscribe(),s.a.useDeprecatedSynchronousErrorHandling)throw n;Object(a.a)(n)}}__tryOrSetError(e,t,n){if(!s.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(l){return s.a.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=l,e.syncErrorThrown=!0,!0):(Object(a.a)(l),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}},"8Y7J":function(e,t,n){"use strict";n.r(t);var l=n("XNiG"),r=n("quSY"),i=n("HDdC"),o=n("VRyK"),s=n("oB13"),a=n("x+ZX");function u(){return new l.a}n.d(t,"\u0275angular_packages_core_core_r",function(){return Ky}),n.d(t,"\u0275angular_packages_core_core_o",function(){return qy}),n.d(t,"\u0275angular_packages_core_core_p",function(){return Wy}),n.d(t,"\u0275angular_packages_core_core_q",function(){return Gy}),n.d(t,"\u0275angular_packages_core_core_s",function(){return Zy}),n.d(t,"\u0275angular_packages_core_core_f",function(){return av}),n.d(t,"\u0275angular_packages_core_core_m",function(){return Wd}),n.d(t,"\u0275angular_packages_core_core_n",function(){return Xd}),n.d(t,"\u0275angular_packages_core_core_l",function(){return Dy}),n.d(t,"\u0275angular_packages_core_core_k",function(){return Ey}),n.d(t,"\u0275angular_packages_core_core_a",function(){return De}),n.d(t,"\u0275angular_packages_core_core_b",function(){return $}),n.d(t,"\u0275angular_packages_core_core_c",function(){return ht}),n.d(t,"\u0275angular_packages_core_core_d",function(){return et}),n.d(t,"\u0275angular_packages_core_core_e",function(){return ot}),n.d(t,"\u0275angular_packages_core_core_j",function(){return cm}),n.d(t,"\u0275angular_packages_core_core_t",function(){return Lv}),n.d(t,"\u0275angular_packages_core_core_v",function(){return Ov}),n.d(t,"\u0275angular_packages_core_core_u",function(){return Rv}),n.d(t,"\u0275angular_packages_core_core_y",function(){return Mv}),n.d(t,"\u0275angular_packages_core_core_w",function(){return Nv}),n.d(t,"\u0275angular_packages_core_core_x",function(){return Pv}),n.d(t,"\u0275angular_packages_core_core_bb",function(){return vf}),n.d(t,"\u0275angular_packages_core_core_bc",function(){return jr}),n.d(t,"\u0275angular_packages_core_core_bd",function(){return fl}),n.d(t,"\u0275angular_packages_core_core_be",function(){return Dl}),n.d(t,"\u0275angular_packages_core_core_bf",function(){return zl}),n.d(t,"\u0275angular_packages_core_core_bj",function(){return oo}),n.d(t,"\u0275angular_packages_core_core_bp",function(){return Tr}),n.d(t,"\u0275angular_packages_core_core_bo",function(){return Hn}),n.d(t,"\u0275angular_packages_core_core_g",function(){return kd}),n.d(t,"\u0275angular_packages_core_core_h",function(){return Ad}),n.d(t,"\u0275angular_packages_core_core_i",function(){return Td}),n.d(t,"\u0275angular_packages_core_core_bh",function(){return Ki}),n.d(t,"\u0275angular_packages_core_core_bn",function(){return At}),n.d(t,"\u0275angular_packages_core_core_bk",function(){return g}),n.d(t,"\u0275angular_packages_core_core_bl",function(){return m}),n.d(t,"\u0275angular_packages_core_core_bq",function(){return I}),n.d(t,"\u0275angular_packages_core_core_z",function(){return ef}),n.d(t,"\u0275angular_packages_core_core_ba",function(){return Dh}),n.d(t,"createPlatform",function(){return sy}),n.d(t,"assertPlatform",function(){return uy}),n.d(t,"destroyPlatform",function(){return cy}),n.d(t,"getPlatform",function(){return dy}),n.d(t,"PlatformRef",function(){return hy}),n.d(t,"ApplicationRef",function(){return fy}),n.d(t,"createPlatformFactory",function(){return ay}),n.d(t,"NgProbeToken",function(){return oy}),n.d(t,"enableProdMode",function(){return fi}),n.d(t,"isDevMode",function(){return pi}),n.d(t,"APP_ID",function(){return sv}),n.d(t,"PACKAGE_ROOT_URL",function(){return fv}),n.d(t,"PLATFORM_INITIALIZER",function(){return dv}),n.d(t,"PLATFORM_ID",function(){return hv}),n.d(t,"APP_BOOTSTRAP_LISTENER",function(){return pv}),n.d(t,"APP_INITIALIZER",function(){return iv}),n.d(t,"ApplicationInitStatus",function(){return ov}),n.d(t,"DebugElement",function(){return By}),n.d(t,"DebugEventListener",function(){return Iy}),n.d(t,"DebugNode",function(){return Vy}),n.d(t,"asNativeElements",function(){return xy}),n.d(t,"getDebugNode",function(){return Ly}),n.d(t,"Testability",function(){return Qv}),n.d(t,"TestabilityRegistry",function(){return Yv}),n.d(t,"setTestabilityGetter",function(){return Xv}),n.d(t,"TRANSLATIONS",function(){return Uy}),n.d(t,"TRANSLATIONS_FORMAT",function(){return zy}),n.d(t,"LOCALE_ID",function(){return Hy}),n.d(t,"MissingTranslationStrategy",function(){return $y}),n.d(t,"ApplicationModule",function(){return Qy}),n.d(t,"wtfCreateScope",function(){return Fv}),n.d(t,"wtfLeave",function(){return Vv}),n.d(t,"wtfStartTimeRange",function(){return Bv}),n.d(t,"wtfEndTimeRange",function(){return jv}),n.d(t,"Type",function(){return Q}),n.d(t,"EventEmitter",function(){return Mg}),n.d(t,"ErrorHandler",function(){return ei}),n.d(t,"Sanitizer",function(){return Bi}),n.d(t,"SecurityContext",function(){return Vi}),n.d(t,"Attribute",function(){return S}),n.d(t,"ANALYZE_FOR_ENTRY_COMPONENTS",function(){return pt}),n.d(t,"ContentChild",function(){return mt}),n.d(t,"ContentChildren",function(){return gt}),n.d(t,"Query",function(){return ft}),n.d(t,"ViewChild",function(){return yt}),n.d(t,"ViewChildren",function(){return vt}),n.d(t,"Component",function(){return $m}),n.d(t,"Directive",function(){return zm}),n.d(t,"HostBinding",function(){return Km}),n.d(t,"HostListener",function(){return Zm}),n.d(t,"Input",function(){return Wm}),n.d(t,"Output",function(){return Gm}),n.d(t,"Pipe",function(){return qm}),n.d(t,"NgModule",function(){return nv}),n.d(t,"CUSTOM_ELEMENTS_SCHEMA",function(){return ti}),n.d(t,"NO_ERRORS_SCHEMA",function(){return ni}),n.d(t,"ViewEncapsulation",function(){return kt}),n.d(t,"Version",function(){return $d}),n.d(t,"VERSION",function(){return qd}),n.d(t,"InjectFlags",function(){return _}),n.d(t,"\u0275\u0275defineInjectable",function(){return D}),n.d(t,"defineInjectable",function(){return x}),n.d(t,"\u0275\u0275defineInjector",function(){return k}),n.d(t,"forwardRef",function(){return M}),n.d(t,"resolveForwardRef",function(){return L}),n.d(t,"Injectable",function(){return ye}),n.d(t,"INJECTOR",function(){return Ee}),n.d(t,"Injector",function(){return xe}),n.d(t,"\u0275\u0275inject",function(){return q}),n.d(t,"inject",function(){return W}),n.d(t,"ReflectiveInjector",function(){return dt}),n.d(t,"ResolvedReflectiveFactory",function(){return lt}),n.d(t,"ReflectiveKey",function(){return Ze}),n.d(t,"InjectionToken",function(){return we}),n.d(t,"Inject",function(){return v}),n.d(t,"Optional",function(){return y}),n.d(t,"Self",function(){return b}),n.d(t,"SkipSelf",function(){return C}),n.d(t,"Host",function(){return w}),n.d(t,"NgZone",function(){return zv}),n.d(t,"\u0275NoopNgZone",function(){return Zv}),n.d(t,"RenderComponentType",function(){return Md}),n.d(t,"Renderer",function(){return Fd}),n.d(t,"Renderer2",function(){return Hd}),n.d(t,"RendererFactory2",function(){return Bd}),n.d(t,"RendererStyleFlags2",function(){return jd}),n.d(t,"RootRenderer",function(){return Vd}),n.d(t,"COMPILER_OPTIONS",function(){return xv}),n.d(t,"Compiler",function(){return Dv}),n.d(t,"CompilerFactory",function(){return kv}),n.d(t,"ModuleWithComponentFactories",function(){return mv}),n.d(t,"ComponentFactory",function(){return fd}),n.d(t,"\u0275ComponentFactory",function(){return fd}),n.d(t,"ComponentRef",function(){return pd}),n.d(t,"ComponentFactoryResolver",function(){return yd}),n.d(t,"ElementRef",function(){return Od}),n.d(t,"NgModuleFactory",function(){return Sd}),n.d(t,"NgModuleRef",function(){return wd}),n.d(t,"NgModuleFactoryLoader",function(){return im}),n.d(t,"getModuleFactory",function(){return hm}),n.d(t,"QueryList",function(){return Lg}),n.d(t,"SystemJsNgModuleLoader",function(){return Cy}),n.d(t,"SystemJsNgModuleLoaderConfig",function(){return yy}),n.d(t,"TemplateRef",function(){return ch}),n.d(t,"ViewContainerRef",function(){return ph}),n.d(t,"EmbeddedViewRef",function(){return _y}),n.d(t,"ViewRef",function(){return Sy}),n.d(t,"ChangeDetectionStrategy",function(){return bt}),n.d(t,"ChangeDetectorRef",function(){return rh}),n.d(t,"DefaultIterableDiffer",function(){return Kd}),n.d(t,"IterableDiffers",function(){return nh}),n.d(t,"KeyValueDiffers",function(){return lh}),n.d(t,"SimpleChange",function(){return Lc}),n.d(t,"WrappedValue",function(){return Ru}),n.d(t,"platformCore",function(){return jy}),n.d(t,"\u0275ALLOW_MULTIPLE_PLATFORMS",function(){return iy}),n.d(t,"\u0275APP_ID_RANDOM_PROVIDER",function(){return uv}),n.d(t,"\u0275defaultIterableDiffers",function(){return ah}),n.d(t,"\u0275defaultKeyValueDiffers",function(){return uh}),n.d(t,"\u0275devModeEqual",function(){return Tu}),n.d(t,"\u0275isListLikeIterable",function(){return Ou}),n.d(t,"\u0275ChangeDetectorStatus",function(){return Ct}),n.d(t,"\u0275isDefaultChangeDetectionStrategy",function(){return wt}),n.d(t,"\u0275Console",function(){return gv}),n.d(t,"\u0275setCurrentInjector",function(){return U}),n.d(t,"\u0275getInjectableDef",function(){return A}),n.d(t,"\u0275APP_ROOT",function(){return Wc}),n.d(t,"\u0275ivyEnabled",function(){return vy}),n.d(t,"\u0275CodegenComponentFactoryResolver",function(){return bd}),n.d(t,"\u0275clearResolutionOfComponentResourcesQueue",function(){return Dt}),n.d(t,"\u0275resolveComponentResources",function(){return St}),n.d(t,"\u0275ReflectionCapabilities",function(){return ne}),n.d(t,"\u0275RenderDebugInfo",function(){return Ld}),n.d(t,"\u0275_sanitizeHtml",function(){return Li}),n.d(t,"\u0275_sanitizeStyle",function(){return Ui}),n.d(t,"\u0275_sanitizeUrl",function(){return yi}),n.d(t,"\u0275global",function(){return V}),n.d(t,"\u0275looseIdentical",function(){return Au}),n.d(t,"\u0275stringify",function(){return N}),n.d(t,"\u0275makeDecorator",function(){return p}),n.d(t,"\u0275isObservable",function(){return vu}),n.d(t,"\u0275isPromise",function(){return mu}),n.d(t,"\u0275clearOverrides",function(){return EC}),n.d(t,"\u0275initServicesIfNeeded",function(){return jb}),n.d(t,"\u0275overrideComponentView",function(){return IC}),n.d(t,"\u0275overrideProvider",function(){return _C}),n.d(t,"\u0275NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR",function(){return af}),n.d(t,"\u0275\u0275defineBase",function(){return Wt}),n.d(t,"\u0275\u0275defineComponent",function(){return Bt}),n.d(t,"\u0275\u0275defineDirective",function(){return Gt}),n.d(t,"\u0275\u0275definePipe",function(){return Kt}),n.d(t,"\u0275\u0275defineNgModule",function(){return zt}),n.d(t,"\u0275detectChanges",function(){return da}),n.d(t,"\u0275renderComponent",function(){return Tc}),n.d(t,"\u0275Render3ComponentFactory",function(){return yf}),n.d(t,"\u0275Render3ComponentRef",function(){return bf}),n.d(t,"\u0275\u0275directiveInject",function(){return Ua}),n.d(t,"\u0275\u0275injectAttribute",function(){return za}),n.d(t,"\u0275\u0275getFactoryOf",function(){return Zr}),n.d(t,"\u0275\u0275getInheritedFactory",function(){return Qr}),n.d(t,"\u0275\u0275setComponentScope",function(){return jt}),n.d(t,"\u0275\u0275setNgModuleScope",function(){return $t}),n.d(t,"\u0275\u0275templateRefExtractor",function(){return rm}),n.d(t,"\u0275\u0275ProvidersFeature",function(){return hd}),n.d(t,"\u0275\u0275InheritDefinitionFeature",function(){return Uc}),n.d(t,"\u0275\u0275NgOnChangesFeature",function(){return Fc}),n.d(t,"\u0275LifecycleHooksFeature",function(){return Pc}),n.d(t,"\u0275Render3NgModuleRef",function(){return fg}),n.d(t,"\u0275markDirty",function(){return ha}),n.d(t,"\u0275NgModuleFactory",function(){return gg}),n.d(t,"\u0275NO_CHANGE",function(){return lo}),n.d(t,"\u0275\u0275container",function(){return Na}),n.d(t,"\u0275\u0275nextContext",function(){return _u}),n.d(t,"\u0275\u0275elementStart",function(){return ou}),n.d(t,"\u0275\u0275namespaceHTML",function(){return Yl}),n.d(t,"\u0275\u0275namespaceMathML",function(){return Ql}),n.d(t,"\u0275\u0275namespaceSVG",function(){return Zl}),n.d(t,"\u0275\u0275element",function(){return au}),n.d(t,"\u0275\u0275listener",function(){return yu}),n.d(t,"\u0275\u0275text",function(){return cc}),n.d(t,"\u0275\u0275embeddedViewStart",function(){return pu}),n.d(t,"\u0275\u0275projection",function(){return Du}),n.d(t,"\u0275\u0275bind",function(){return Hu}),n.d(t,"\u0275\u0275interpolation1",function(){return qu}),n.d(t,"\u0275\u0275interpolation2",function(){return Wu}),n.d(t,"\u0275\u0275interpolation3",function(){return Gu}),n.d(t,"\u0275\u0275interpolation4",function(){return Ku}),n.d(t,"\u0275\u0275interpolation5",function(){return Zu}),n.d(t,"\u0275\u0275interpolation6",function(){return Qu}),n.d(t,"\u0275\u0275interpolation7",function(){return Yu}),n.d(t,"\u0275\u0275interpolation8",function(){return Ju}),n.d(t,"\u0275\u0275interpolationV",function(){return $u}),n.d(t,"\u0275\u0275pipeBind1",function(){return kg}),n.d(t,"\u0275\u0275pipeBind2",function(){return Ag}),n.d(t,"\u0275\u0275pipeBind3",function(){return Tg}),n.d(t,"\u0275\u0275pipeBind4",function(){return Rg}),n.d(t,"\u0275\u0275pipeBindV",function(){return Og}),n.d(t,"\u0275\u0275pureFunction0",function(){return vg}),n.d(t,"\u0275\u0275pureFunction1",function(){return yg}),n.d(t,"\u0275\u0275pureFunction2",function(){return bg}),n.d(t,"\u0275\u0275pureFunction3",function(){return Cg}),n.d(t,"\u0275\u0275pureFunction4",function(){return wg}),n.d(t,"\u0275\u0275pureFunction5",function(){return Sg}),n.d(t,"\u0275\u0275pureFunction6",function(){return _g}),n.d(t,"\u0275\u0275pureFunction7",function(){return Ig}),n.d(t,"\u0275\u0275pureFunction8",function(){return Eg}),n.d(t,"\u0275\u0275pureFunctionV",function(){return Dg}),n.d(t,"\u0275\u0275getCurrentView",function(){return gu}),n.d(t,"\u0275getDirectives",function(){return bc}),n.d(t,"\u0275getHostElement",function(){return wc}),n.d(t,"\u0275\u0275restoreView",function(){return El}),n.d(t,"\u0275\u0275containerRefreshStart",function(){return Ma}),n.d(t,"\u0275\u0275containerRefreshEnd",function(){return La}),n.d(t,"\u0275\u0275queryRefresh",function(){return Yg}),n.d(t,"\u0275\u0275viewQuery",function(){return Xg}),n.d(t,"\u0275\u0275staticViewQuery",function(){return Jg}),n.d(t,"\u0275\u0275staticContentQuery",function(){return nm}),n.d(t,"\u0275\u0275loadViewQuery",function(){return em}),n.d(t,"\u0275\u0275contentQuery",function(){return tm}),n.d(t,"\u0275\u0275loadContentQuery",function(){return lm}),n.d(t,"\u0275\u0275elementEnd",function(){return su}),n.d(t,"\u0275\u0275elementProperty",function(){return Uu}),n.d(t,"\u0275\u0275property",function(){return ju}),n.d(t,"\u0275\u0275propertyInterpolate",function(){return Xu}),n.d(t,"\u0275\u0275propertyInterpolate1",function(){return ec}),n.d(t,"\u0275\u0275propertyInterpolate2",function(){return tc}),n.d(t,"\u0275\u0275propertyInterpolate3",function(){return nc}),n.d(t,"\u0275\u0275propertyInterpolate4",function(){return lc}),n.d(t,"\u0275\u0275propertyInterpolate5",function(){return rc}),n.d(t,"\u0275\u0275propertyInterpolate6",function(){return ic}),n.d(t,"\u0275\u0275propertyInterpolate7",function(){return oc}),n.d(t,"\u0275\u0275propertyInterpolate8",function(){return sc}),n.d(t,"\u0275\u0275propertyInterpolateV",function(){return ac}),n.d(t,"\u0275\u0275componentHostSyntheticProperty",function(){return zu}),n.d(t,"\u0275\u0275componentHostSyntheticListener",function(){return bu}),n.d(t,"\u0275\u0275projectionDef",function(){return Eu}),n.d(t,"\u0275\u0275reference",function(){return ja}),n.d(t,"\u0275\u0275enableBindings",function(){return hl}),n.d(t,"\u0275\u0275disableBindings",function(){return pl}),n.d(t,"\u0275\u0275allocHostVars",function(){return ca}),n.d(t,"\u0275\u0275elementAttribute",function(){return uu}),n.d(t,"\u0275\u0275elementContainerStart",function(){return du}),n.d(t,"\u0275\u0275elementContainerEnd",function(){return hu}),n.d(t,"\u0275\u0275elementStyling",function(){return $a}),n.d(t,"\u0275\u0275elementStylingMap",function(){return Xa}),n.d(t,"\u0275\u0275elementStyleProp",function(){return Ga}),n.d(t,"\u0275\u0275elementStylingApply",function(){return tu}),n.d(t,"\u0275\u0275elementClassProp",function(){return Qa}),n.d(t,"\u0275\u0275elementHostAttrs",function(){return cu}),n.d(t,"\u0275\u0275elementHostStyling",function(){return qa}),n.d(t,"\u0275\u0275elementHostStylingMap",function(){return eu}),n.d(t,"\u0275\u0275elementHostStyleProp",function(){return Ka}),n.d(t,"\u0275\u0275elementHostClassProp",function(){return Ya}),n.d(t,"\u0275\u0275elementHostStylingApply",function(){return nu}),n.d(t,"\u0275\u0275select",function(){return uc}),n.d(t,"\u0275\u0275textBinding",function(){return dc}),n.d(t,"\u0275\u0275template",function(){return Pa}),n.d(t,"\u0275\u0275embeddedViewEnd",function(){return fu}),n.d(t,"\u0275store",function(){return Ba}),n.d(t,"\u0275\u0275load",function(){return Ha}),n.d(t,"\u0275\u0275pipe",function(){return xg}),n.d(t,"\u0275whenRendered",function(){return Mc}),n.d(t,"\u0275\u0275i18n",function(){return Jf}),n.d(t,"\u0275\u0275i18nAttributes",function(){return Xf}),n.d(t,"\u0275\u0275i18nExp",function(){return ng}),n.d(t,"\u0275\u0275i18nStart",function(){return $f}),n.d(t,"\u0275\u0275i18nEnd",function(){return Kf}),n.d(t,"\u0275\u0275i18nApply",function(){return lg}),n.d(t,"\u0275\u0275i18nPostprocess",function(){return Gf}),n.d(t,"\u0275i18nConfigureLocalize",function(){return cg}),n.d(t,"\u0275\u0275i18nLocalize",function(){return hg}),n.d(t,"\u0275setClassMetadata",function(){return mg}),n.d(t,"\u0275\u0275resolveWindow",function(){return ln}),n.d(t,"\u0275\u0275resolveDocument",function(){return rn}),n.d(t,"\u0275\u0275resolveBody",function(){return on}),n.d(t,"\u0275compileComponent",function(){return Tm}),n.d(t,"\u0275compileDirective",function(){return Rm}),n.d(t,"\u0275compileNgModule",function(){return Cm}),n.d(t,"\u0275compileNgModuleDefs",function(){return wm}),n.d(t,"\u0275patchComponentDefWithScope",function(){return Dm}),n.d(t,"\u0275resetCompiledComponents",function(){return Im}),n.d(t,"\u0275flushModuleScopingQueueAsMuchAsPossible",function(){return ym}),n.d(t,"\u0275transitiveScopesFor",function(){return xm}),n.d(t,"\u0275compilePipe",function(){return Um}),n.d(t,"\u0275\u0275sanitizeHtml",function(){return zi}),n.d(t,"\u0275\u0275sanitizeStyle",function(){return $i}),n.d(t,"\u0275\u0275defaultStyleSanitizer",function(){return Qi}),n.d(t,"\u0275\u0275sanitizeScript",function(){return Gi}),n.d(t,"\u0275\u0275sanitizeUrl",function(){return qi}),n.d(t,"\u0275\u0275sanitizeResourceUrl",function(){return Wi}),n.d(t,"\u0275\u0275sanitizeUrlOrResourceUrl",function(){return Zi}),n.d(t,"\u0275bypassSanitizationTrustHtml",function(){return ii}),n.d(t,"\u0275bypassSanitizationTrustStyle",function(){return oi}),n.d(t,"\u0275bypassSanitizationTrustScript",function(){return si}),n.d(t,"\u0275bypassSanitizationTrustUrl",function(){return ai}),n.d(t,"\u0275bypassSanitizationTrustResourceUrl",function(){return ui}),n.d(t,"\u0275getLContext",function(){return tr}),n.d(t,"\u0275NG_ELEMENT_ID",function(){return Ft}),n.d(t,"\u0275NG_COMPONENT_DEF",function(){return Ot}),n.d(t,"\u0275NG_DIRECTIVE_DEF",function(){return Nt}),n.d(t,"\u0275NG_PIPE_DEF",function(){return Pt}),n.d(t,"\u0275NG_MODULE_DEF",function(){return Mt}),n.d(t,"\u0275NG_BASE_DEF",function(){return Lt}),n.d(t,"\u0275NG_INJECTABLE_DEF",function(){return R}),n.d(t,"\u0275NG_INJECTOR_DEF",function(){return O}),n.d(t,"\u0275bindPlayerFactory",function(){return io}),n.d(t,"\u0275addPlayer",function(){return hc}),n.d(t,"\u0275getPlayers",function(){return pc}),n.d(t,"\u0275compileNgModuleFactory__POST_R3__",function(){return ny}),n.d(t,"\u0275isBoundToModule__POST_R3__",function(){return ry}),n.d(t,"\u0275SWITCH_COMPILE_COMPONENT__POST_R3__",function(){return Qm}),n.d(t,"\u0275SWITCH_COMPILE_DIRECTIVE__POST_R3__",function(){return Ym}),n.d(t,"\u0275SWITCH_COMPILE_PIPE__POST_R3__",function(){return Jm}),n.d(t,"\u0275SWITCH_COMPILE_NGMODULE__POST_R3__",function(){return lv}),n.d(t,"\u0275getDebugNode__POST_R3__",function(){return My}),n.d(t,"\u0275SWITCH_COMPILE_INJECTABLE__POST_R3__",function(){return be}),n.d(t,"\u0275SWITCH_IVY_ENABLED__POST_R3__",function(){return my}),n.d(t,"\u0275SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__",function(){return ih}),n.d(t,"\u0275Compiler_compileModuleSync__POST_R3__",function(){return yv}),n.d(t,"\u0275Compiler_compileModuleAsync__POST_R3__",function(){return Cv}),n.d(t,"\u0275Compiler_compileModuleAndAllComponentsSync__POST_R3__",function(){return Sv}),n.d(t,"\u0275Compiler_compileModuleAndAllComponentsAsync__POST_R3__",function(){return Iv}),n.d(t,"\u0275SWITCH_ELEMENT_REF_FACTORY__POST_R3__",function(){return Nd}),n.d(t,"\u0275SWITCH_TEMPLATE_REF_FACTORY__POST_R3__",function(){return dh}),n.d(t,"\u0275SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__",function(){return fh}),n.d(t,"\u0275SWITCH_RENDERER2_FACTORY__POST_R3__",function(){return Ud}),n.d(t,"\u0275getModuleFactory__POST_R3__",function(){return dm}),n.d(t,"\u0275registerNgModuleType",function(){return um}),n.d(t,"\u0275publishGlobalUtil",function(){return Ac}),n.d(t,"\u0275publishDefaultGlobalUtils",function(){return kc}),n.d(t,"\u0275createInjector",function(){return Jc}),n.d(t,"\u0275registerModuleFactory",function(){return sm}),n.d(t,"\u0275EMPTY_ARRAY",function(){return cp}),n.d(t,"\u0275EMPTY_MAP",function(){return dp}),n.d(t,"\u0275and",function(){return Yy}),n.d(t,"\u0275ccf",function(){return Dp}),n.d(t,"\u0275cmf",function(){return DC}),n.d(t,"\u0275crt",function(){return Ph}),n.d(t,"\u0275did",function(){return Yp}),n.d(t,"\u0275eld",function(){return Jy}),n.d(t,"\u0275getComponentViewDefinitionFactory",function(){return xp}),n.d(t,"\u0275inlineInterpolate",function(){return ap}),n.d(t,"\u0275interpolate",function(){return sp}),n.d(t,"\u0275mod",function(){return vp}),n.d(t,"\u0275mpd",function(){return mp}),n.d(t,"\u0275ncd",function(){return ab}),n.d(t,"\u0275nov",function(){return Vp}),n.d(t,"\u0275pid",function(){return Jp}),n.d(t,"\u0275prd",function(){return Xp}),n.d(t,"\u0275pad",function(){return db}),n.d(t,"\u0275pod",function(){return hb}),n.d(t,"\u0275ppd",function(){return cb}),n.d(t,"\u0275qud",function(){return lb}),n.d(t,"\u0275ted",function(){return fb}),n.d(t,"\u0275unv",function(){return Rh}),n.d(t,"\u0275vid",function(){return vb});const c="__annotations__",d="__parameters__",h="__prop__metadata__";function p(e,t,n,l,r){const i=f(t);function o(...e){if(this instanceof o)return i.call(this,...e),this;const t=new o(...e);return function(n){return r&&r(n,...e),(n.hasOwnProperty(c)?n[c]:Object.defineProperty(n,c,{value:[]})[c]).push(t),l&&l(n),n}}return n&&(o.prototype=Object.create(n.prototype)),o.prototype.ngMetadataName=e,o.annotationCls=o,o}function f(e){return function(...t){if(e){const n=e(...t);for(const e in n)this[e]=n[e]}}}function g(e,t,n){const l=f(t);function r(...e){if(this instanceof r)return l.apply(this,e),this;const t=new r(...e);return n.annotation=t,n;function n(e,n,l){const r=e.hasOwnProperty(d)?e[d]:Object.defineProperty(e,d,{value:[]})[d];for(;r.length<=l;)r.push(null);return(r[l]=r[l]||[]).push(t),e}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=e,r.annotationCls=r,r}function m(e,t,n,l){const r=f(t);function i(...e){if(this instanceof i)return r.apply(this,e),this;const t=new i(...e);return function(n,r){const i=n.constructor,o=i.hasOwnProperty(h)?i[h]:Object.defineProperty(i,h,{value:{}})[h];o[r]=o.hasOwnProperty(r)&&o[r]||[],o[r].unshift(t),l&&l(n,r,...e)}}return n&&(i.prototype=Object.create(n.prototype)),i.prototype.ngMetadataName=e,i.annotationCls=i,i}const v=g("Inject",e=>({token:e})),y=g("Optional"),b=g("Self"),C=g("SkipSelf"),w=g("Host"),S=g("Attribute",e=>({attributeName:e}));var _=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}({});function I(e){for(let t in e)if(e[t]===I)return t;throw Error("Could not find renamed property on target object.")}function E(e,t){for(const n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function D(e){return{providedIn:e.providedIn||null,factory:e.factory,value:void 0}}const x=D;function k(e){return{factory:e.factory,providers:e.providers||[],imports:e.imports||[]}}function A(e){return e&&e.hasOwnProperty(R)?e[R]:null}function T(e){return e&&e.hasOwnProperty(O)?e[O]:null}const R=I({ngInjectableDef:I}),O=I({ngInjectorDef:I});function N(e){if("string"==typeof e)return e;if(e instanceof Array)return"["+e.map(N).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}const P=I({__forward_ref__:I});function M(e){return e.__forward_ref__=M,e.toString=function(){return N(this())},e}function L(e){const t=e;return"function"==typeof t&&t.hasOwnProperty(P)&&t.__forward_ref__===M?t():e}function F(){const e="undefined"!=typeof globalThis&&globalThis,t="undefined"!=typeof window&&window,n="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,l="undefined"!=typeof global&&global;return e||l||t||n}const V=F();function B(){const e=V.ng;if(!e||!e.\u0275compilerFacade)throw new Error("Angular JIT compilation failed: '@angular/compiler' not loaded!\n - JIT compilation is discouraged for production use-cases! Consider AOT mode instead.\n - Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?\n - Alternatively provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.");return e.\u0275compilerFacade}let j,H=void 0;function U(e){const t=H;return H=e,t}function z(e){const t=j;return j=e,t}function $(e,t=_.Default){if(void 0===H)throw new Error("inject() must be called from an injection context");return null===H?G(e,void 0,t):H.get(e,t&_.Optional?null:void 0,t)}function q(e,t=_.Default){return(j||$)(e,t)}const W=q;function G(e,t,n){const l=A(e);if(l&&"root"==l.providedIn)return void 0===l.value?l.value=l.factory():l.value;if(n&_.Optional)return null;if(void 0!==t)return t;throw new Error(`Injector: NOT_FOUND [${N(e)}]`)}function K(e){const t=[];for(let n=0;n<e.length;n++){const l=e[n];if(Array.isArray(l)){if(0===l.length)throw new Error("Arguments array must have arguments.");let e=void 0,n=_.Default;for(let t=0;t<l.length;t++){const r=l[t];r instanceof y||"Optional"===r.ngMetadataName?n|=_.Optional:r instanceof C||"SkipSelf"===r.ngMetadataName?n|=_.SkipSelf:r instanceof b||"Self"===r.ngMetadataName?n|=_.Self:e=r instanceof v?r.token:r}t.push(q(e,n))}else t.push(q(l))}return t}const Z={"\u0275\u0275defineInjectable":D,"\u0275\u0275defineInjector":k,"\u0275\u0275inject":q,"\u0275\u0275getFactoryOf":function(e){const t=e,n=A(t)||T(t);return n&&void 0!==n.factory?n.factory:null}},Q=Function;function Y(e){return"function"==typeof e}const J=/^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*arguments\)/,X=/^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{/,ee=/^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(/,te=/^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{\s+super\(\.\.\.arguments\)/;class ne{constructor(e){this._reflect=e||V.Reflect}isReflectionEnabled(){return!0}factory(e){return(...t)=>new e(...t)}_zipTypesAndAnnotations(e,t){let n;n=void 0===e?new Array(t.length):new Array(e.length);for(let l=0;l<n.length;l++)n[l]=void 0===e?[]:e[l]!=Object?[e[l]]:[],t&&null!=t[l]&&(n[l]=n[l].concat(t[l]));return n}_ownParameters(e,t){const n=e.toString();if(J.exec(n)||te.exec(n)||X.exec(n)&&!ee.exec(n))return null;if(e.parameters&&e.parameters!==t.parameters)return e.parameters;const l=e.ctorParameters;if(l&&l!==t.ctorParameters){const e="function"==typeof l?l():l,t=e.map(e=>e&&e.type),n=e.map(e=>e&&le(e.decorators));return this._zipTypesAndAnnotations(t,n)}const r=e.hasOwnProperty(d)&&e[d],i=this._reflect&&this._reflect.getOwnMetadata&&this._reflect.getOwnMetadata("design:paramtypes",e);return i||r?this._zipTypesAndAnnotations(i,r):new Array(e.length).fill(void 0)}parameters(e){if(!Y(e))return[];const t=re(e);let n=this._ownParameters(e,t);return n||t===Object||(n=this.parameters(t)),n||[]}_ownAnnotations(e,t){if(e.annotations&&e.annotations!==t.annotations){let t=e.annotations;return"function"==typeof t&&t.annotations&&(t=t.annotations),t}return e.decorators&&e.decorators!==t.decorators?le(e.decorators):e.hasOwnProperty(c)?e[c]:null}annotations(e){if(!Y(e))return[];const t=re(e),n=this._ownAnnotations(e,t)||[];return(t!==Object?this.annotations(t):[]).concat(n)}_ownPropMetadata(e,t){if(e.propMetadata&&e.propMetadata!==t.propMetadata){let t=e.propMetadata;return"function"==typeof t&&t.propMetadata&&(t=t.propMetadata),t}if(e.propDecorators&&e.propDecorators!==t.propDecorators){const t=e.propDecorators,n={};return Object.keys(t).forEach(e=>{n[e]=le(t[e])}),n}return e.hasOwnProperty(h)?e[h]:null}propMetadata(e){if(!Y(e))return{};const t=re(e),n={};if(t!==Object){const e=this.propMetadata(t);Object.keys(e).forEach(t=>{n[t]=e[t]})}const l=this._ownPropMetadata(e,t);return l&&Object.keys(l).forEach(e=>{const t=[];n.hasOwnProperty(e)&&t.push(...n[e]),t.push(...l[e]),n[e]=t}),n}ownPropMetadata(e){return Y(e)&&this._ownPropMetadata(e,re(e))||{}}hasLifecycleHook(e,t){return e instanceof Q&&t in e.prototype}guards(e){return{}}getter(e){return new Function("o","return o."+e+";")}setter(e){return new Function("o","v","return o."+e+" = v;")}method(e){return new Function("o","args",`if (!o.${e}) throw new Error('"${e}" is undefined');\n return o.${e}.apply(o, args);`)}importUri(e){return"object"==typeof e&&e.filePath?e.filePath:`./${N(e)}`}resourceUri(e){return`./${N(e)}`}resolveIdentifier(e,t,n,l){return l}resolveEnum(e,t){return e[t]}}function le(e){return e?e.map(e=>new(0,e.type.annotationCls)(...e.args?e.args:[])):[]}function re(e){const t=e.prototype?Object.getPrototypeOf(e.prototype):null;return(t?t.constructor:null)||Object}let ie=null;function oe(){return ie=ie||new ne}function se(e){return ae(oe().parameters(e))}function ae(e){const t=B();return e.map(e=>(function(e,t){const n={token:null,host:!1,optional:!1,resolved:e.R3ResolvedDependencyType.Token,self:!1,skipSelf:!1};function l(t){n.resolved=e.R3ResolvedDependencyType.Token,n.token=t}if(Array.isArray(t)){if(0===t.length)throw new Error("Dependency array must have arguments.");for(let r=0;r<t.length;r++){const i=t[r];if(void 0!==i)if(i instanceof y||"Optional"===i.__proto__.ngMetadataName)n.optional=!0;else if(i instanceof C||"SkipSelf"===i.__proto__.ngMetadataName)n.skipSelf=!0;else if(i instanceof b||"Self"===i.__proto__.ngMetadataName)n.self=!0;else if(i instanceof w||"Host"===i.__proto__.ngMetadataName)n.host=!0;else if(i instanceof v)n.token=i.token;else if(i instanceof S){if(void 0===i.attributeName)throw new Error("Attribute name must be defined.");n.token=i.attributeName,n.resolved=e.R3ResolvedDependencyType.Attribute}else l(i)}}else l(t);return n})(t,e))}function ue(e,t){let n=null;e.hasOwnProperty(R)||Object.defineProperty(e,R,{get:()=>{if(null===n){const l=t||{providedIn:null},r=de(l)||pe(l)||he(l)||fe(l),i={name:e.name,type:e,typeArgumentCount:0,providedIn:l.providedIn,ctorDeps:se(e),userDeps:void 0};if((de(l)||pe(l))&&void 0!==l.deps&&(i.userDeps=ae(l.deps)),r)if(de(l))i.useClass=l.useClass;else if(he(l))i.useValue=l.useValue;else if(pe(l))i.useFactory=l.useFactory;else{if(!fe(l))throw new Error("Unreachable state.");i.useExisting=l.useExisting}else i.useClass=e;n=B().compileInjectable(Z,`ng:///${e.name}/ngInjectableDef.js`,i)}return n}})}const ce=I({provide:String,useValue:I});function de(e){return void 0!==e.useClass}function he(e){return ce in e}function pe(e){return void 0!==e.useFactory}function fe(e){return void 0!==e.useExisting}const ge=I({provide:String,useValue:I}),me=[];function ve(e,t){if(!t){const t=(new ne).parameters(e);return()=>new e(...K(t))}if(ge in t){const e=t;return()=>e.useValue}if(t.useExisting){const e=t;return()=>q(e.useExisting)}if(t.useFactory){const e=t;return()=>e.useFactory(...K(e.deps||me))}if(t.useClass){const n=t;let l=t.deps;if(!l){const t=new ne;l=t.parameters(e)}return()=>new n.useClass(...K(l))}{let n=t.deps;if(!n){const t=new ne;n=t.parameters(e)}return()=>new e(...K(n))}}const ye=p("Injectable",void 0,void 0,void 0,(e,t)=>Ce(e,t)),be=ue,Ce=function(e,t){t&&void 0!==t.providedIn&&!A(e)&&(e.ngInjectableDef=D({providedIn:t.providedIn,factory:ve(e,t)}))};class we{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.ngInjectableDef=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.ngInjectableDef=D({providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const Se="__source",_e=new Object,Ie=_e,Ee=new we("INJECTOR",-1);class De{get(e,t=_e){if(t===_e){const t=new Error(`NullInjectorError: No provider for ${N(e)}!`);throw t.name="NullInjectorError",t}return t}}const xe=(()=>{class e{static create(e,t){return Array.isArray(e)?new Fe(e,t):new Fe(e.providers,e.parent,e.name||null)}}return e.THROW_IF_NOT_FOUND=_e,e.NULL=new De,e.ngInjectableDef=D({providedIn:"any",factory:()=>q(Ee)}),e.__NG_ELEMENT_ID__=-1,e})(),ke=function(e){return e},Ae=[],Te=ke,Re=function(){return Array.prototype.slice.call(arguments)},Oe=I({provide:String,useValue:I}),Ne="ngTokenPath",Pe="ngTempTokenPath",Me=/\n/gm,Le="\u0275";class Fe{constructor(e,t=xe.NULL,n=null){this.parent=t,this.source=n;const l=this._records=new Map;l.set(xe,{token:xe,fn:ke,deps:Ae,value:this,useNew:!1}),l.set(Ee,{token:Ee,fn:ke,deps:Ae,value:this,useNew:!1}),function e(t,n){if(n)if((n=L(n))instanceof Array)for(let l=0;l<n.length;l++)e(t,n[l]);else{if("function"==typeof n)throw He("Function/Class not supported",n);if(!n||"object"!=typeof n||!n.provide)throw He("Unexpected provider",n);{let e=L(n.provide);const l=function(e){const t=function(e){let t=Ae;const n=e.deps;if(n&&n.length){t=[];for(let e=0;e<n.length;e++){let l=6,r=L(n[e]);if(r instanceof Array)for(let e=0,t=r;e<t.length;e++){const n=t[e];n instanceof y||n==y?l|=1:n instanceof C||n==C?l&=-3:n instanceof b||n==b?l&=-5:r=n instanceof v?n.token:L(n)}t.push({token:r,options:l})}}else if(e.useExisting)t=[{token:L(e.useExisting),options:6}];else if(!(n||Oe in e))throw He("'deps' required",e);return t}(e);let n=ke,l=Ae,r=!1,i=L(e.provide);if(Oe in e)l=e.useValue;else if(e.useFactory)n=e.useFactory;else if(e.useExisting);else if(e.useClass)r=!0,n=L(e.useClass);else{if("function"!=typeof i)throw He("StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable",e);r=!0,n=i}return{deps:t,fn:n,useNew:r,value:l}}(n);if(!0===n.multi){let l=t.get(e);if(l){if(l.fn!==Re)throw Ve(e)}else t.set(e,l={token:n.provide,deps:[],useNew:!1,fn:Re,value:Ae});l.deps.push({token:e=n,options:6})}const r=t.get(e);if(r&&r.fn==Re)throw Ve(e);t.set(e,l)}}}(l,e)}get(e,t,n=_.Default){const l=this._records.get(e);try{return function e(t,n,l,r,i,o){try{return function(t,n,l,r,i,o){let s;if(!n||o&_.SkipSelf)o&_.Self||(s=r.get(t,i,_.Default));else{if((s=n.value)==Te)throw Error(Le+"Circular dependency");if(s===Ae){n.value=Te;let t=void 0,i=n.useNew,o=n.fn,a=n.deps,u=Ae;if(a.length){u=[];for(let t=0;t<a.length;t++){const n=a[t],i=n.options,o=2&i?l.get(n.token):void 0;u.push(e(n.token,o,l,o||4&i?r:xe.NULL,1&i?null:xe.THROW_IF_NOT_FOUND,_.Default))}}n.value=s=i?new o(...u):o.apply(t,u)}}return s}(t,n,l,r,i,o)}catch(s){throw s instanceof Error||(s=new Error(s)),(s[Pe]=s[Pe]||[]).unshift(t),n&&n.value==Te&&(n.value=Ae),s}}(e,l,this._records,this.parent,t,n)}catch(r){return Be(r,e,"StaticInjectorError",this.source)}}toString(){const e=[];return this._records.forEach((t,n)=>e.push(N(n))),`StaticInjector[${e.join(", ")}]`}}function Ve(e){return He("Cannot mix multi providers and regular providers",e)}function Be(e,t,n,l){const r=e[Pe];throw t[Se]&&r.unshift(t[Se]),e.message=je("\n"+e.message,r,n,l),e[Ne]=r,e[Pe]=null,e}function je(e,t,n,l=null){e=e&&"\n"===e.charAt(0)&&e.charAt(1)==Le?e.substr(2):e;let r=N(t);if(t instanceof Array)r=t.map(N).join(" -> ");else if("object"==typeof t){let e=[];for(let n in t)if(t.hasOwnProperty(n)){let l=t[n];e.push(n+":"+("string"==typeof l?JSON.stringify(l):N(l)))}r=`{${e.join(", ")}}`}return`${n}${l?"("+l+")":""}[${r}]: ${e.replace(Me,"\n ")}`}function He(e,t){return new Error(je(e,t,"StaticInjectorError"))}const Ue="ngDebugContext",ze="ngOriginalError",$e="ngErrorLogger";function qe(e){return e.length>1?" ("+function(e){const t=[];for(let n=0;n<e.length;++n){if(t.indexOf(e[n])>-1)return t.push(e[n]),t;t.push(e[n])}return t}(e.slice().reverse()).map(e=>N(e.token)).join(" -> ")+")":""}function We(e,t,n,l){const r=[t],i=n(r),o=l?function(e,t){const n=`${i} caused by: ${t instanceof Error?t.message:t}`,l=Error(n);return l[ze]=t,l}(0,l):Error(i);return o.addKey=Ge,o.keys=r,o.injectors=[e],o.constructResolvingMessage=n,o[ze]=l,o}function Ge(e,t){this.injectors.push(e),this.keys.push(t),this.message=this.constructResolvingMessage(this.keys)}function Ke(e,t){const n=[];for(let l=0,r=t.length;l<r;l++){const e=t[l];n.push(e&&0!=e.length?e.map(N).join(" "):"?")}return Error("Cannot resolve all parameters for '"+N(e)+"'("+n.join(", ")+"). Make sure that all the parameters are decorated with Inject or have valid type annotations and that '"+N(e)+"' is decorated with Injectable.")}class Ze{constructor(e,t){if(this.token=e,this.id=t,!e)throw new Error("Token must be defined!");this.displayName=N(this.token)}static get(e){return Ye.get(L(e))}static get numberOfKeys(){return Ye.numberOfKeys}}class Qe{constructor(){this._allKeys=new Map}get(e){if(e instanceof Ze)return e;if(this._allKeys.has(e))return this._allKeys.get(e);const t=new Ze(e,Ze.numberOfKeys);return this._allKeys.set(e,t),t}get numberOfKeys(){return this._allKeys.size}}const Ye=new Qe;class Je{constructor(e){this.reflectionCapabilities=e}updateCapabilities(e){this.reflectionCapabilities=e}factory(e){return this.reflectionCapabilities.factory(e)}parameters(e){return this.reflectionCapabilities.parameters(e)}annotations(e){return this.reflectionCapabilities.annotations(e)}propMetadata(e){return this.reflectionCapabilities.propMetadata(e)}hasLifecycleHook(e,t){return this.reflectionCapabilities.hasLifecycleHook(e,t)}getter(e){return this.reflectionCapabilities.getter(e)}setter(e){return this.reflectionCapabilities.setter(e)}method(e){return this.reflectionCapabilities.method(e)}importUri(e){return this.reflectionCapabilities.importUri(e)}resourceUri(e){return this.reflectionCapabilities.resourceUri(e)}resolveIdentifier(e,t,n,l){return this.reflectionCapabilities.resolveIdentifier(e,t,n,l)}resolveEnum(e,t){return this.reflectionCapabilities.resolveEnum(e,t)}}const Xe=new Je(new ne);class et{constructor(e,t,n){this.key=e,this.optional=t,this.visibility=n}static fromKey(e){return new et(e,!1,null)}}const tt=[];class nt{constructor(e,t,n){this.key=e,this.resolvedFactories=t,this.multiProvider=n,this.resolvedFactory=this.resolvedFactories[0]}}class lt{constructor(e,t){this.factory=e,this.dependencies=t}}function rt(e){let t,n;if(e.useClass){const l=L(e.useClass);t=Xe.factory(l),n=st(l)}else e.useExisting?(t=(e=>e),n=[et.fromKey(Ze.get(e.useExisting))]):e.useFactory?(t=e.useFactory,n=function(e,t){if(t){const n=t.map(e=>[e]);return t.map(t=>at(e,t,n))}return st(e)}(e.useFactory,e.deps)):(t=(()=>e.useValue),n=tt);return new lt(t,n)}function it(e){return new nt(Ze.get(e.provide),[rt(e)],e.multi||!1)}function ot(e){const t=function(e,t){for(let n=0;n<e.length;n++){const l=e[n],r=t.get(l.key.id);if(r){if(l.multiProvider!==r.multiProvider)throw Error(`Cannot mix multi providers and regular providers, got: ${r} ${l}`);if(l.multiProvider)for(let e=0;e<l.resolvedFactories.length;e++)r.resolvedFactories.push(l.resolvedFactories[e]);else t.set(l.key.id,l)}else{let e;e=l.multiProvider?new nt(l.key,l.resolvedFactories.slice(),l.multiProvider):l,t.set(l.key.id,e)}}return t}(function e(t,n){return t.forEach(t=>{if(t instanceof Q)n.push({provide:t,useClass:t});else if(t&&"object"==typeof t&&void 0!==t.provide)n.push(t);else{if(!(t instanceof Array))throw function(e){return Error(`Invalid provider - only instances of Provider and Type are allowed, got: ${t}`)}();e(t,n)}}),n}(e,[]).map(it),new Map);return Array.from(t.values())}function st(e){const t=Xe.parameters(e);if(!t)return[];if(t.some(e=>null==e))throw Ke(e,t);return t.map(n=>at(e,n,t))}function at(e,t,n){let l=null,r=!1;if(!Array.isArray(t))return ut(t instanceof v?t.token:t,r,null);let i=null;for(let o=0;o<t.length;++o){const e=t[o];e instanceof Q?l=e:e instanceof v?l=e.token:e instanceof y?r=!0:e instanceof b||e instanceof C?i=e:e instanceof we&&(l=e)}if(null!=(l=L(l)))return ut(l,r,i);throw Ke(e,n)}function ut(e,t,n){return new et(Ze.get(e),t,n)}const ct=new Object;class dt{static resolve(e){return ot(e)}static resolveAndCreate(e,t){const n=dt.resolve(e);return dt.fromResolvedProviders(n,t)}static fromResolvedProviders(e,t){return new ht(e,t)}}const ht=(()=>{class e{constructor(e,t){this._constructionCounter=0,this._providers=e,this.parent=t||null;const n=e.length;this.keyIds=new Array(n),this.objs=new Array(n);for(let l=0;l<n;l++)this.keyIds[l]=e[l].key.id,this.objs[l]=ct}get(e,t=Ie){return this._getByKey(Ze.get(e),null,t)}resolveAndCreateChild(e){const t=dt.resolve(e);return this.createChildFromResolved(t)}createChildFromResolved(t){const n=new e(t);return n.parent=this,n}resolveAndInstantiate(e){return this.instantiateResolved(dt.resolve([e])[0])}instantiateResolved(e){return this._instantiateProvider(e)}getProviderAtIndex(e){if(e<0||e>=this._providers.length)throw function(e){return Error(`Index ${e} is out-of-bounds.`)}(e);return this._providers[e]}_new(e){if(this._constructionCounter++>this._getMaxNumberOfObjects())throw We(this,e.key,function(e){return`Cannot instantiate cyclic dependency!${qe(e)}`});return this._instantiateProvider(e)}_getMaxNumberOfObjects(){return this.objs.length}_instantiateProvider(e){if(e.multiProvider){const t=new Array(e.resolvedFactories.length);for(let n=0;n<e.resolvedFactories.length;++n)t[n]=this._instantiate(e,e.resolvedFactories[n]);return t}return this._instantiate(e,e.resolvedFactories[0])}_instantiate(e,t){const n=t.factory;let l,r;try{l=t.dependencies.map(e=>this._getByReflectiveDependency(e))}catch(o){throw o.addKey&&o.addKey(this,e.key),o}try{r=n(...l)}catch(o){throw We(this,e.key,function(e){const t=N(e[0].token);return`${i.message}: Error during instantiation of ${t}!${qe(e)}.`},i=o)}var i;return r}_getByReflectiveDependency(e){return this._getByKey(e.key,e.visibility,e.optional?null:Ie)}_getByKey(t,n,l){return t===e.INJECTOR_KEY?this:n instanceof b?this._getByKeySelf(t,l):this._getByKeyDefault(t,l,n)}_getObjByKeyId(e){for(let t=0;t<this.keyIds.length;t++)if(this.keyIds[t]===e)return this.objs[t]===ct&&(this.objs[t]=this._new(this._providers[t])),this.objs[t];return ct}_throwOrNull(e,t){if(t!==Ie)return t;throw function(e,t){return We(e,t,function(e){return`No provider for ${N(e[0].token)}!${qe(e)}`})}(this,e)}_getByKeySelf(e,t){const n=this._getObjByKeyId(e.id);return n!==ct?n:this._throwOrNull(e,t)}_getByKeyDefault(t,n,l){let r;for(r=l instanceof C?this.parent:this;r instanceof e;){const e=r,n=e._getObjByKeyId(t.id);if(n!==ct)return n;r=e.parent}return null!==r?r.get(t.token,n):this._throwOrNull(t,n)}get displayName(){return`ReflectiveInjector(providers: [${function(e,t){const n=new Array(e._providers.length);for(let l=0;l<e._providers.length;++l)n[l]=t(e.getProviderAtIndex(l));return n}(this,e=>' "'+e.key.displayName+'" ').join(", ")}])`}toString(){return this.displayName}}return e.INJECTOR_KEY=Ze.get(xe),e})(),pt=new we("AnalyzeForEntryComponents");class ft{}const gt=m("ContentChildren",(e,t={})=>Object.assign({selector:e,first:!1,isViewQuery:!1,descendants:!1},t),ft),mt=m("ContentChild",(e,t={})=>Object.assign({selector:e,first:!0,isViewQuery:!1,descendants:!0},t),ft),vt=m("ViewChildren",(e,t={})=>Object.assign({selector:e,first:!1,isViewQuery:!0,descendants:!0},t),ft),yt=m("ViewChild",(e,t)=>Object.assign({selector:e,first:!0,isViewQuery:!0,descendants:!0},t),ft),bt=function(){var e={OnPush:0,Default:1};return e[e.OnPush]="OnPush",e[e.Default]="Default",e}(),Ct=function(){var e={CheckOnce:0,Checked:1,CheckAlways:2,Detached:3,Errored:4,Destroyed:5};return e[e.CheckOnce]="CheckOnce",e[e.Checked]="Checked",e[e.CheckAlways]="CheckAlways",e[e.Detached]="Detached",e[e.Errored]="Errored",e[e.Destroyed]="Destroyed",e}();function wt(e){return null==e||e===bt.Default}function St(e){const t=[],n=new Map;function l(t){let l=n.get(t);if(!l){const r=e(t);n.set(t,l=r.then(xt))}return l}return _t.forEach((e,n)=>{const r=[];e.templateUrl&&r.push(l(e.templateUrl).then(t=>{e.template=t}));const i=e.styleUrls,o=e.styles||(e.styles=[]),s=e.styles.length;i&&i.forEach((t,n)=>{o.push(""),r.push(l(t).then(l=>{o[s+n]=l,i.splice(i.indexOf(t),1),0==i.length&&(e.styleUrls=void 0)}))});const a=Promise.all(r).then(()=>(function(e){It.delete(e)})(n));t.push(a)}),Dt(),Promise.all(t).then(()=>void 0)}let _t=new Map;const It=new Set;function Et(e){return!!(e.templateUrl&&!e.template||e.styleUrls&&e.styleUrls.length)}function Dt(){const e=_t;return _t=new Map,e}function xt(e){return"string"==typeof e?e:e.text()}const kt=function(){var e={Emulated:0,Native:1,None:2,ShadowDom:3};return e[e.Emulated]="Emulated",e[e.Native]="Native",e[e.None]="None",e[e.ShadowDom]="ShadowDom",e}();function At(e){return""+{toString:e}}const Tt={},Rt=[],Ot=I({ngComponentDef:I}),Nt=I({ngDirectiveDef:I}),Pt=I({ngPipeDef:I}),Mt=I({ngModuleDef:I}),Lt=I({ngBaseDef:I}),Ft=I({__NG_ELEMENT_ID__:I});let Vt=0;function Bt(e){const t=e.type,n=t.prototype,l={},r={type:t,providersResolver:null,consts:e.consts,vars:e.vars,factory:e.factory,template:e.template||null,ngContentSelectors:e.ngContentSelectors,hostBindings:e.hostBindings||null,contentQueries:e.contentQueries||null,declaredInputs:l,inputs:null,outputs:null,exportAs:e.exportAs||null,onChanges:null,onInit:n.ngOnInit||null,doCheck:n.ngDoCheck||null,afterContentInit:n.ngAfterContentInit||null,afterContentChecked:n.ngAfterContentChecked||null,afterViewInit:n.ngAfterViewInit||null,afterViewChecked:n.ngAfterViewChecked||null,onDestroy:n.ngOnDestroy||null,onPush:e.changeDetection===bt.OnPush,directiveDefs:null,pipeDefs:null,selectors:e.selectors,viewQuery:e.viewQuery||null,features:e.features||null,data:e.data||{},encapsulation:e.encapsulation||kt.Emulated,id:"c",styles:e.styles||Rt,_:null,setInput:null,schemas:e.schemas||null};return r._=At(()=>{const n=e.directives,i=e.features,o=e.pipes;r.id+=Vt++,r.inputs=qt(e.inputs,l),r.outputs=qt(e.outputs),i&&i.forEach(e=>e(r)),r.directiveDefs=n?()=>("function"==typeof n?n():n).map(Ht):null,r.pipeDefs=o?()=>("function"==typeof o?o():o).map(Ut):null,t.hasOwnProperty(R)||(t[R]=D({factory:e.factory}))}),r}function jt(e,t,n){const l=e.ngComponentDef;l.directiveDefs=(()=>t.map(Ht)),l.pipeDefs=(()=>n.map(Ut))}function Ht(e){return Zt(e)||Qt(e)}function Ut(e){return Yt(e)}function zt(e){return{type:e.type,bootstrap:e.bootstrap||Rt,declarations:e.declarations||Rt,imports:e.imports||Rt,exports:e.exports||Rt,transitiveCompileScopes:null,schemas:e.schemas||null}}function $t(e,t){return At(()=>{const n=Xt(e,!0);n.declarations=t.declarations||Rt,n.imports=t.imports||Rt,n.exports=t.exports||Rt})}function qt(e,t){if(null==e)return Tt;const n={};for(const l in e)if(e.hasOwnProperty(l)){let r=e[l],i=r;Array.isArray(r)&&(i=r[1],r=r[0]),n[r]=l,t&&(t[r]=i)}return n}function Wt(e){const t={};return{inputs:qt(e.inputs,t),declaredInputs:t,outputs:qt(e.outputs),viewQuery:e.viewQuery||null,contentQueries:e.contentQueries||null}}const Gt=Bt;function Kt(e){return{name:e.name,factory:e.factory,pure:!1!==e.pure,onDestroy:e.type.prototype.ngOnDestroy||null}}function Zt(e){return e[Ot]||null}function Qt(e){return e[Nt]||null}function Yt(e){return e[Pt]||null}function Jt(e){return e[Lt]||null}function Xt(e,t){const n=e[Mt]||null;if(!n&&!0===t)throw new Error(`Type ${N(e)} does not have 'ngModuleDef' property.`);return n}function en(e){return"function"==typeof e?e.name||e:"string"==typeof e?e:null==e?"":""+e}function tn(e){return"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type:en(e)}const nn=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(V))();function ln(e){return{name:"window",target:e.ownerDocument.defaultView}}function rn(e){return{name:"document",target:e.ownerDocument}}function on(e){return{name:"body",target:e.ownerDocument.body}}const sn="\ufffd";function an(e){return e.indexOf(sn)>=0}function un(e){return e instanceof Function?e():e}const cn=0,dn=1,hn=2,pn=3,fn=4,gn=5,mn=6,vn=7,yn=8,bn=9,Cn=10,wn=11,Sn=12,_n=13,In=14,En=15,Dn=16,xn=17,kn=18,An=20,Tn=1,Rn=2,On=7,Nn=8,Pn="__ngContext__";function Mn(e){for(;Array.isArray(e);)e=e[cn];return e}function Ln(e){return Array.isArray(e)&&"object"==typeof e[Tn]}function Fn(e){return Array.isArray(e)&&!0===e[Tn]}function Vn(e,t){return Mn(t[e+An])}function Bn(e,t){return Mn(t[e.index])}function jn(e,t){return t[dn].data[e+An]}function Hn(e,t){return e[t+An]}function Un(e,t){const n=t[e];return Ln(n)?n:n[cn]}function zn(e){return 1==(1&e.flags)}function $n(e){return null!==e.template}function qn(e){return 0!=(512&e[hn])}function Wn(e){return e[Pn]}function Gn(e){const t=Wn(e);return t?Array.isArray(t)?t:t.lView:null}function Kn(e){return Fn(e[pn])}function Zn(e){e[kn]=0}const Qn=8,Yn=8,Jn=9,Xn=-1;class el{constructor(e,t,n){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=n}}function tl(e,t,n,l,r,i){const{onChanges:o,onInit:s,doCheck:a}=t;r>=0&&(!n.preOrderHooks||r===n.preOrderHooks.length)&&(o||s||a)&&(n.preOrderHooks||(n.preOrderHooks=[])).push(l),i>=0&&(!n.preOrderCheckHooks||i===n.preOrderCheckHooks.length)&&(o||a)&&(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(l),o&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e,o),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,o)),s&&(n.preOrderHooks||(n.preOrderHooks=[])).push(-e,s),a&&((n.preOrderHooks||(n.preOrderHooks=[])).push(e,a),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(e,a))}function nl(e,t){if(e.firstTemplatePass)for(let n=t.directiveStart,l=t.directiveEnd;n<l;n++){const t=e.data[n];t.afterContentInit&&(e.contentHooks||(e.contentHooks=[])).push(-n,t.afterContentInit),t.afterContentChecked&&((e.contentHooks||(e.contentHooks=[])).push(n,t.afterContentChecked),(e.contentCheckHooks||(e.contentCheckHooks=[])).push(n,t.afterContentChecked)),t.afterViewInit&&(e.viewHooks||(e.viewHooks=[])).push(-n,t.afterViewInit),t.afterViewChecked&&((e.viewHooks||(e.viewHooks=[])).push(n,t.afterViewChecked),(e.viewCheckHooks||(e.viewCheckHooks=[])).push(n,t.afterViewChecked)),null!=t.onDestroy&&(e.destroyHooks||(e.destroyHooks=[])).push(n,t.onDestroy)}}function ll(e,t,n,l){n||rl(e,t.preOrderHooks,t.preOrderCheckHooks,n,0,void 0!==l?l:null)}function rl(e,t,n,l,r,i){if(l)return;const o=(3&e[hn])===r?t:n;o&&function(e,t,n,l){const r=null!=l?l:-1;let i=0;for(let o=void 0!==l?65535&e[kn]:0;o<t.length;o++)if("number"==typeof t[o+1]){if(i=t[o],null!=l&&i>=l)break}else t[o]<0&&(e[kn]+=65536),(i<r||-1==r)&&(il(e,n,t,o),e[kn]=(4294901760&e[kn])+o+2),o++}(e,o,r,i),null==i&&(3&e[hn])===r&&3!==r&&(e[hn]&=1023,e[hn]+=1)}function il(e,t,n,l){const r=n[l]<0,i=n[l+1],o=e[r?-n[l]:n[l]];r?e[hn]>>10<e[kn]>>16&&(3&e[hn])===t&&(e[hn]+=1024,i.call(o)):i.call(o)}let ol,sl=null;function al(e){sl=e}let ul,cl=null;function dl(e){cl=e}function hl(){ul=!0}function pl(){ul=!1}function fl(){return yl}const gl=1;let ml,vl,yl,bl=gl,Cl=0,wl=0;function Sl(e=null){ql!==e&&(Gl(null==e?-1:e),bl=gl,Cl=0,wl=0)}function _l(){bl+=1+wl,Cl=0,wl=0}function Il(e){Cl+=e,wl=Math.max(wl,Cl)}function El(e){Ol=e}function Dl(){return ml}function xl(e){ml=e}function kl(e,t){ml=e,yl=t}function Al(){return vl}function Tl(e){vl=e}function Rl(e=yl){return 4==(4&e[hn])}let Ol=null,Nl=!1;function Pl(){return Nl}function Ml(e){Nl=e}let Ll=-1;function Fl(){return Ll}function Vl(e){Ll=e}let Bl=0;function jl(){return Bl}function Hl(e){Bl=e}function Ul(e,t){const n=yl;return e&&(Ll=e[dn].bindingStartIndex),ml=t,vl=!0,yl=Ol=e,n}function zl(e=1){return(Ol=function(e,t){for(;e>0;)t=t[xn],e--;return t}(e,Ol))[bn]}function $l(e){const t=yl[dn];if(Rl(yl))yl[hn]&=-5;else try{Zn(yl),rl(yl,t.viewHooks,t.viewCheckHooks,Nl,2,void 0)}finally{yl[hn]&=-73,yl[vn]=t.bindingStartIndex}al(null),Ul(e,null)}let ql=-1;function Wl(){return ql}function Gl(e){ql=e,al(null)}let Kl=null;function Zl(){Kl="http://www.w3.org/2000/svg"}function Ql(){Kl="http://www.w3.org/1998/MathML/"}function Yl(){Kl=null}const Jl=function(){var e={Important:1,DashCase:2};return e[e.Important]="Important",e[e.DashCase]="DashCase",e}();function Xl(e){return!!e.listen}const er={createRenderer:(e,t)=>document};function tr(e){let t=Wn(e);if(t){if(Array.isArray(t)){const l=t;let r,i=void 0,o=void 0;if((n=e)&&n.constructor&&n.constructor.ngComponentDef){if(-1==(r=sr(l,e)))throw new Error("The provided component was not found in the application");i=e}else if(e&&e.constructor&&e.constructor.ngDirectiveDef){if(-1==(r=function(e,t){let n=e[dn].firstChild;for(;n;){const l=n.directiveEnd;for(let r=n.directiveStart;r<l;r++)if(e[r]===t)return n.index;n=or(n)}return-1}(l,e)))throw new Error("The provided directive was not found in the application");o=ar(r,l,!1)}else if(-1==(r=ir(l,e)))return null;const s=Mn(l[r]),a=Wn(s),u=a&&!Array.isArray(a)?a:nr(l,r,s);if(i&&void 0===u.component&&(u.component=i,rr(u.component,u)),o&&void 0===u.directives){u.directives=o;for(let e=0;e<o.length;e++)rr(o[e],u)}rr(u.native,u),t=u}}else{const n=e;let l=n;for(;l=l.parentNode;){const e=Wn(l);if(e){let l;if(!(l=Array.isArray(e)?e:e.lView))return null;const r=ir(l,n);if(r>=0){const e=Mn(l[r]),n=nr(l,r,e);rr(e,n),t=n;break}}}}var n;return t||null}function nr(e,t,n){return{lView:e,nodeIndex:t,native:n,component:void 0,directives:void 0,localRefs:void 0}}function lr(e){let t,n=Wn(e);if(Array.isArray(n)){const l=sr(n,e),r=nr(n,l,(t=Un(l,n))[cn]);r.component=e,rr(e,r),rr(r.native,r)}else t=Un(n.nodeIndex,n.lView);return t}function rr(e,t){e[Pn]=t}function ir(e,t){let n=e[dn].firstChild;for(;n;){if(Bn(n,e)===t)return n.index;n=or(n)}return-1}function or(e){if(e.child)return e.child;if(e.next)return e.next;for(;e.parent&&!e.parent.next;)e=e.parent;return e.parent&&e.parent.next}function sr(e,t){const n=e[dn].components;if(n)for(let l=0;l<n.length;l++){const r=n[l];if(Un(r,e)[bn]===t)return r}else if(Un(An,e)[bn]===t)return An;return-1}function ar(e,t,n){const l=t[dn].data[e];let r=l.directiveStart;return 0==r?Rt:(!n&&1&l.flags&&r++,t.slice(r,l.directiveEnd))}class ur{constructor(){this._players=[]}flushPlayers(){for(let e=0;e<this._players.length;e++){const t=this._players[e];t.parent||0!==t.state||t.play()}this._players.length=0}queuePlayer(e){this._players.push(e)}}const cr=0,dr="@";function hr(e,t,n,l){const r=[e||null,0,[],n||[null,null],l||[null,null],[0,0],[0],[0],null,null];return pr(r,cr),r}function pr(e,t,n=-1,l){const r=e[2],i=2*t,o=i+2;for(let a=r.length;a<o;a+=2)r.push(-1,null);const s=i+0;n>=0&&-1===r[s]&&(r[s]=n,r[i+1]=l||null)}function fr(e,t){let n=e,l=t[n],r=t;for(;Array.isArray(l);)r=l,l=l[cn];if(i=r,Array.isArray(i)&&"number"==typeof i[Tn])return r;{const i=jn(e-An,t).stylingTemplate;return r!==t&&(n=cn),r[n]=i?function(e,t){const n=t.slice();for(let l=0;l<10;l++){const e=t[l];Array.isArray(e)&&(n[l]=e.slice())}return n[0]=e,n[1]|=16,n}(l,i):hr(l)}var i}function gr(e){return e[0]===dr}function mr(e){return 0!=(8&e.flags)}function vr(e){return 0!=(16&e.flags)}function yr(e,t,n,l,r,i){return i=i||n,r?e[r]=l:e.push(l),!!l&&(l.addEventListener(200,()=>{const t=e.indexOf(l);t&&(t<e[0]?e[t]=null:e.splice(t,1)),l.destroy()}),(t.playerHandler||(t.playerHandler=new ur)).queuePlayer(l,i),!0)}function br(e){return e[9]}function Cr(e){return e[9]=[5,null,null,null,null]}function wr(e,t){const n=fl()[Sn],l=Xl(n);let r=0;for(;r<t.length;){const i=t[r];if("number"==typeof i){if(0!==i)break;r++;const o=t[r++],s=t[r++],a=t[r++];l?n.setAttribute(e,s,a,o):e.setAttributeNS(o,s,a)}else{const o=i,s=t[++r];gr(o)?l&&n.setProperty(e,o,s):l?n.setAttribute(e,o,s):e.setAttribute(o,s),r++}}return r}function Sr(e,t){for(let n=t;n<e.length;n++){const t=e[n];if(1===t||2===t)return n}return-1}function _r(e){return 3===e||4===e}function Ir(e){return e!==Xn}function Er(e){return 32767&e}function Dr(e){return e>>16}function xr(e,t){let n=Dr(e),l=t;for(;n>0;)l=l[xn],n--;return l}function kr(e){const t=e[pn];return Fn(t)?t[pn]:t}function Ar(e){let t=e[mn];for(;t&&2===t.type;)t=(e=e[xn])[mn];return e}function Tr(e){return function(e){let t=Ln(e)?e:Gn(e);for(;t&&!(512&t[hn]);)t=kr(t);return t}(e)[bn]}let Rr=!0;function Or(e){const t=Rr;return Rr=e,t}const Nr=255;let Pr=0;function Mr(e,t){const n=Fr(e,t);if(-1!==n)return n;const l=t[dn];l.firstTemplatePass&&(e.injectorIndex=t.length,Lr(l.data,e),Lr(t,null),Lr(l.blueprint,null));const r=Vr(e,t),i=Er(r),o=xr(r,t),s=e.injectorIndex;if(Ir(r)){const e=o[dn].data;for(let n=0;n<8;n++)t[s+n]=o[i+n]|e[i+n]}return t[s+Yn]=r,s}function Lr(e,t){e.push(0,0,0,0,0,0,0,0,t)}function Fr(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null==t[e.injectorIndex+Yn]?-1:e.injectorIndex}function Vr(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let n=t[mn],l=1;for(;n&&-1===n.injectorIndex;)n=(t=t[xn])?t[mn]:null,l++;return n?n.injectorIndex|l<<16:-1}function Br(e,t,n){!function(e,t,n){let l="string"!=typeof n?n[Ft]:n.charCodeAt(0)||0;null==l&&(l=n[Ft]=Pr++);const r=l&Nr,i=1<<r,o=64&r,s=32&r,a=t.data;128&r?o?s?a[e+7]|=i:a[e+6]|=i:s?a[e+5]|=i:a[e+4]|=i:o?s?a[e+3]|=i:a[e+2]|=i:s?a[e+1]|=i:a[e]|=i}(e,t[dn],n)}function jr(e,t){const n=e.attrs;if(n){const e=n.length;let l=0;for(;l<e;){const r=n[l];if(_r(r))break;if(0===r)l+=2;else if("number"==typeof r){if(l++,1===r&&"class"===t){let t="";for(;l<e&&"string"==typeof n[l];)t+=" "+n[l++];return t.trim()}if(2===r&&"style"===t){let t="";for(;l<e&&"string"==typeof n[l];)t+=`${n[l++]}: ${n[l++]}; `;return t.trim()}for(;l<e&&"string"==typeof n[l];)l++}else{if(r===t)return n[l+1];l+=2}}}return null}function Hr(e,t,n,l=_.Default,r){if(e){const r=function(e){if("string"==typeof e)return e.charCodeAt(0)||0;const t=e[Ft];return"number"==typeof t&&t>0?t&Nr:t}(n);if("function"==typeof r){const i=Dl(),o=fl();kl(e,t);try{const e=r();if(null!=e||l&_.Optional)return e;throw new Error(`No provider for ${tn(n)}!`)}finally{kl(i,o)}}else if("number"==typeof r){if(-1===r)return new Kr(e,t);let i=null,o=Fr(e,t),s=Xn,a=l&_.Host?Ar(t)[mn]:null;for((-1===o||l&_.SkipSelf)&&(s=-1===o?Vr(e,t):t[o+Yn],Gr(l,!1)?(i=t[dn],o=Er(s),t=xr(s,t)):o=-1);-1!==o;){s=t[o+Yn];const e=t[dn];if(Wr(r,o,e.data)){const e=zr(o,t,n,i,l,a);if(e!==Ur)return e}Gr(l,t[dn].data[o+Qn]===a)&&Wr(r,o,t)?(i=e,o=Er(s),t=xr(s,t)):o=-1}}}if(l&_.Optional&&void 0===r&&(r=null),0==(l&(_.Self|_.Host))){const e=t[Cn],i=z(void 0);try{return e?e.get(n,r,l&_.Optional):G(n,r,l&_.Optional)}finally{z(i)}}if(l&_.Optional)return r;throw new Error(`NodeInjector: NOT_FOUND [${tn(n)}]`)}const Ur={};function zr(e,t,n,l,r,i){const o=t[dn],s=o.data[e+Qn],a=$r(s,t,n,null==l?zn(s)&&Rr:l!=o&&3===s.type,r&_.Host&&i===s);return null!==a?qr(o.data,t,a,s):Ur}function $r(e,t,n,l,r){const i=e.providerIndexes,o=t[dn].data,s=65535&i,a=e.directiveStart,u=i>>16,c=r?s+u:e.directiveEnd;for(let d=l?s:s+u;d<c;d++){const e=o[d];if(d<a&&n===e||d>=a&&e.type===n)return d}if(r){const e=o[a];if(e&&$n(e)&&e.type===n)return a}return null}function qr(e,t,n,l){let r=t[n];if(null!==(i=r)&&"object"==typeof i&&Object.getPrototypeOf(i)==el.prototype){const i=r;if(i.resolving)throw new Error(`Circular dep for ${tn(e[n])}`);const o=Or(i.canSeeViewProviders);let s;i.resolving=!0,i.injectImpl&&(s=z(i.injectImpl));const a=Dl(),u=fl();kl(l,t);try{r=t[n]=i.factory(null,e,t,l)}finally{i.injectImpl&&z(s),Or(o),i.resolving=!1,kl(a,u)}}var i;return r}function Wr(e,t,n){const l=64&e,r=32&e;let i;return!!((i=128&e?l?r?n[t+7]:n[t+6]:r?n[t+5]:n[t+4]:l?r?n[t+3]:n[t+2]:r?n[t+1]:n[t])&1<<e)}function Gr(e,t){return!(e&_.Self||e&_.Host&&t)}class Kr{constructor(e,t){this._tNode=e,this._lView=t}get(e,t){return Hr(this._tNode,this._lView,e,void 0,t)}}function Zr(e){const t=e,n=Zt(t)||Qt(t)||Yt(t)||A(t)||T(t);return n&&void 0!==n.factory?n.factory:null}function Qr(e){const t=Zr(Object.getPrototypeOf(e.prototype).constructor);return null!==t?t:e=>new e}function Yr(e){return e[Ue]}function Jr(e){return e[ze]}function Xr(e,...t){e.error(...t)}class ei{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),n=this._findContext(e),l=function(e){return e[$e]||Xr}(e);l(this._console,"ERROR",e),t&&l(this._console,"ORIGINAL ERROR",t),n&&l(this._console,"ERROR CONTEXT",n)}_findContext(e){return e?Yr(e)?Yr(e):this._findContext(Jr(e)):null}_findOriginalError(e){let t=Jr(e);for(;t&&Jr(t);)t=Jr(t);return t}}const ti={name:"custom-elements"},ni={name:"no-errors-schema"},li="__SANITIZER_TRUSTED_BRAND__";function ri(e,t){return e instanceof String&&e[li]===t}function ii(e){return ci(e,"Html")}function oi(e){return ci(e,"Style")}function si(e){return ci(e,"Script")}function ai(e){return ci(e,"Url")}function ui(e){return ci(e,"ResourceUrl")}function ci(e,t){const n=new String(e);return n[li]=t,n}let di=!0,hi=!1;function pi(){return hi=!0,di}function fi(){if(hi)throw new Error("Cannot enable prod mode after platform setup.");di=!1}class gi{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),this.inertBodyElement=this.inertDocument.body,null==this.inertBodyElement){const e=this.inertDocument.createElement("html");this.inertDocument.appendChild(e),this.inertBodyElement=this.inertDocument.createElement("body"),e.appendChild(this.inertBodyElement)}this.inertBodyElement.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>',!this.inertBodyElement.querySelector||this.inertBodyElement.querySelector("svg")?(this.inertBodyElement.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',this.getInertBodyElement=this.inertBodyElement.querySelector&&this.inertBodyElement.querySelector("svg img")&&function(){try{return!!window.DOMParser}catch(e){return!1}}()?this.getInertBodyElement_DOMParser:this.getInertBodyElement_InertDocument):this.getInertBodyElement=this.getInertBodyElement_XHR}getInertBodyElement_XHR(e){e="<body><remove></remove>"+e+"</body>";try{e=encodeURI(e)}catch(l){return null}const t=new XMLHttpRequest;t.responseType="document",t.open("GET","data:text/html;charset=utf-8,"+e,!1),t.send(void 0);const n=t.response.body;return n.removeChild(n.firstChild),n}getInertBodyElement_DOMParser(e){e="<body><remove></remove>"+e+"</body>";try{const n=(new window.DOMParser).parseFromString(e,"text/html").body;return n.removeChild(n.firstChild),n}catch(t){return null}}getInertBodyElement_InertDocument(e){const t=this.inertDocument.createElement("template");return"content"in t?(t.innerHTML=e,t):(this.inertBodyElement.innerHTML=e,this.defaultDoc.documentMode&&this.stripCustomNsAttrs(this.inertBodyElement),this.inertBodyElement)}stripCustomNsAttrs(e){const t=e.attributes;for(let l=t.length-1;0<l;l--){const n=t.item(l).name;"xmlns:ns1"!==n&&0!==n.indexOf("ns1:")||e.removeAttribute(n)}let n=e.firstChild;for(;n;)n.nodeType===Node.ELEMENT_NODE&&this.stripCustomNsAttrs(n),n=n.nextSibling}}const mi=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:\/?#]*(?:[\/?#]|$))/gi,vi=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;function yi(e){return(e=String(e)).match(mi)||e.match(vi)?e:(pi()&&console.warn(`WARNING: sanitizing unsafe URL value ${e} (see http://g.co/ng/security#xss)`),"unsafe:"+e)}function bi(e){return(e=String(e)).split(",").map(e=>yi(e.trim())).join(", ")}function Ci(e){const t={};for(const n of e.split(","))t[n]=!0;return t}function wi(...e){const t={};for(const n of e)for(const e in n)n.hasOwnProperty(e)&&(t[e]=!0);return t}const Si=Ci("area,br,col,hr,img,wbr"),_i=Ci("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Ii=Ci("rp,rt"),Ei=wi(Ii,_i),Di=wi(Si,wi(_i,Ci("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),wi(Ii,Ci("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Ei),xi=Ci("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),ki=Ci("srcset"),Ai=wi(xi,ki,Ci("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),Ci("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),Ti=Ci("script,style,template");class Ri{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,n=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?n=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,n&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let e=this.checkClobberedElement(t,t.nextSibling);if(e){t=e;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!Di.hasOwnProperty(t))return this.sanitizedSomething=!0,!Ti.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const n=e.attributes;for(let l=0;l<n.length;l++){const e=n.item(l),t=e.name,r=t.toLowerCase();if(!Ai.hasOwnProperty(r)){this.sanitizedSomething=!0;continue}let i=e.value;xi[r]&&(i=yi(i)),ki[r]&&(i=bi(i)),this.buf.push(" ",t,'="',Pi(i),'"')}return this.buf.push(">"),!0}endElement(e){const t=e.nodeName.toLowerCase();Di.hasOwnProperty(t)&&!Si.hasOwnProperty(t)&&(this.buf.push("</"),this.buf.push(t),this.buf.push(">"))}chars(e){this.buf.push(Pi(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`);return t}}const Oi=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ni=/([^\#-~ |!])/g;function Pi(e){return e.replace(/&/g,"&amp;").replace(Oi,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(Ni,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}let Mi;function Li(e,t){let n=null;try{Mi=Mi||new gi(e);let l=t?String(t):"";n=Mi.getInertBodyElement(l);let r=5,i=l;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,l=i,i=n.innerHTML,n=Mi.getInertBodyElement(l)}while(l!==i);const o=new Ri,s=o.sanitizeChildren(Fi(n)||n);return pi()&&o.sanitizedSomething&&console.warn("WARNING: sanitizing HTML stripped some content, see http://g.co/ng/security#xss"),s}finally{if(n){const e=Fi(n)||n;for(;e.firstChild;)e.removeChild(e.firstChild)}}}function Fi(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}const Vi=function(){var e={NONE:0,HTML:1,STYLE:2,SCRIPT:3,URL:4,RESOURCE_URL:5};return e[e.NONE]="NONE",e[e.HTML]="HTML",e[e.STYLE]="STYLE",e[e.SCRIPT]="SCRIPT",e[e.URL]="URL",e[e.RESOURCE_URL]="RESOURCE_URL",e}();class Bi{}const ji=new RegExp("^([-,.\"'%_!# a-zA-Z0-9]+|(?:(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?|(?:rgb|hsl)a?|(?:repeating-)?(?:linear|radial)-gradient|(?:calc|attr))\\([-0-9.%, #a-zA-Z]+\\))$","g"),Hi=/^url\(([^)]+)\)$/;function Ui(e){if(!(e=String(e).trim()))return"";const t=e.match(Hi);return t&&yi(t[1])===t[1]||e.match(ji)&&function(e){let t=!0,n=!0;for(let l=0;l<e.length;l++){const r=e.charAt(l);"'"===r&&n?t=!t:'"'===r&&t&&(n=!n)}return t&&n}(e)?e:(pi()&&console.warn(`WARNING: sanitizing unsafe style value ${e} (see http://g.co/ng/security#xss).`),"unsafe")}function zi(e){const t=Yi();return t?t.sanitize(Vi.HTML,e)||"":ri(e,"Html")?e.toString():Li(document,en(e))}function $i(e){const t=Yi();return t?t.sanitize(Vi.STYLE,e)||"":ri(e,"Style")?e.toString():Ui(en(e))}function qi(e){const t=Yi();return t?t.sanitize(Vi.URL,e)||"":ri(e,"Url")?e.toString():yi(en(e))}function Wi(e){const t=Yi();if(t)return t.sanitize(Vi.RESOURCE_URL,e)||"";if(ri(e,"ResourceUrl"))return e.toString();throw new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)")}function Gi(e){const t=Yi();if(t)return t.sanitize(Vi.SCRIPT,e)||"";if(ri(e,"Script"))return e.toString();throw new Error("unsafe value used in a script context")}function Ki(e,t){return"src"===t&&("embed"===e||"frame"===e||"iframe"===e||"media"===e||"script"===e)||"href"===t&&("base"===e||"link"===e)?Wi:qi}function Zi(e,t,n){return Ki(t,n)(e)}const Qi=function(e,t){return void 0===t?"background-image"===e||"background"===e||"border-image"===e||"filter"===e||"list-style"===e||"list-style-image"===e:$i(t)};function Yi(){const e=fl();return e&&e[_n]}const Ji=/([A-Z])/g;function Xi(e){try{return null!=e?e.toString().slice(0,30):e}catch(t){return"[ERROR] Exception while trying to serialize the value"}}const eo={marker:"element"},to={marker:"comment"};function no(e){throw new Error(`Multiple components match node with tagname ${e.tagName}`)}const lo={};function ro(e,t,n,l){const r=e[8],i=function(e,t){for(let n=1;n<e.length;n+=3)if(e[n+0]>t)return n;return e.length}(r,t);r.splice(i,0,t,n,l)}function io(e,t){return new oo(e,t)}class oo{constructor(e,t){this.fn=e,this.value=t}}function so(e,t,n=0){const l=hr();return ao(l,e,t,n),l}function ao(e,t,n,l){if(16&e[1])return;pr(e,l);let r=null,i=null,o=-1;for(let s=n;s<t.length;s++){const n=t[s];"number"==typeof n?o=n:1==o?uo(r=r||e[4],n,!0,l):2==o&&uo(i=i||e[3],n,t[++s],l)}}function uo(e,t,n,l){for(let r=2;r<e.length;r+=3)if(e[r+0]===t)return void(Xo(e[r+1],n,e[r+2],l)&&is(r,e,t,n,l));is(null,e,t,n,l)}function co(e,t,n,l){const r=t[4];let i=l||2;for(;i<r.length;)r[i+1]&&Co(e,r[i+0],!0,n,null),i+=3;return i}function ho(e,t,n,l){const r=t[3];let i=l||2;for(;i<r.length;){const t=r[i+1];t&&bo(e,r[i+0],t,n,null),i+=3}return i}function po(e,t,n,l){for(let r=n;r<l;r+=4)if(jo(e,r)===t)return r;return-1}function fo(e,t,n,l=0){n=n||null;const r=ns(e,!0,l,t=t||null),i=ns(e,!1,l,n);if(r&&i)return;t=t===lo?ts(e,!0,l):t,n=n===lo?ts(e,!1,l):n;const o=e[0],s=t instanceof oo?new Zo(t,o,1):null,a=n instanceof oo?new Zo(n,o,2):null,u=s?t.value:t,c=a?n.value:n;let d=Rt,h=!1,p=!1;const f=s?1:0;Oo(e,s,1)&&(No(e,s,1),p=!0);const g=a?3:0;Oo(e,a,3)&&(No(e,a,3),p=!0),r||("string"==typeof u?(d=u.split(/\s+/),h=!0):d=u?Object.keys(u):Rt);const m=Ao(e);let v=function(e){return e[6][2]}(e),y=e.length;if(!i){const t=go(e,l,g,m,v,c?Object.keys(c):Rt,c||Tt,n,!1);t&&(v+=4*t,y+=4*t)}if(!r){const n=u||Tt;go(e,l,f,v,y,d,h||n,t,!0)}p&&Uo(e,!0)}function go(e,t,n,l,r,i,o,s,a){let u=!1;const c=1+4*t,d=e[a?6:7],h=d[c+1],p=d[c+3];let f=1===d[c+0]||!(d[c+2]||!s),g=0,m=0;const v=!0===o;let y=l,b=i.length;for(;y<h;){const l=jo(e,y);if(b)for(let r=0;r<i.length;r++){const s=i[r],c=s?a?s:ls(s):null;if(c&&l===c){const l=Bo(e,y),s=Qo(e,y),a=!!v||o[c],d=Vo(e,y);Ko(d,l,a)&&Xo(l,a,s,t)&&(Ro(e,y,a),Po(e,y,n,t),Go(e,d,a)&&(wo(e,y,!0),u=!0)),i[r]=null,b--;break}}y+=4}if(b){const l=a?null:Jo(e,t);e:for(let s=0;s<i.length;s++){const c=i[s];if(!c)continue;const d=!!v||o[c],p=a?c:ls(c),b=y>=h;for(let l=y;l<r;l+=4)if(jo(e,l)===p){const r=Qo(e,l),i=Mo(e,l),o=Bo(e,l),s=Vo(e,l);Xo(o,d,r,t)&&(b&&(zo(e,y,l),g++),Ko(s,o,d)&&((null===d||void 0===d&&d!==o)&&(f=!0),Ro(e,y,d),(null!==o||Go(e,s,d))&&(wo(e,y,!0),u=!0)),r===t&&n===i||Po(e,y,n,t)),y+=4;continue e}null!=d&&(f=!0,g++,$o(e,b?y:h+4*m,a,p,1|Wo(e,p,a,l),d,t,n),m++,r+=4,y+=4,u=!0)}}for(;y<r;){f=!0;const l=Bo(e,y),r=Vo(e,y);Qo(e,y),null!=l&&(f=!0),Ko(r,l,null)&&(Ro(e,y,null),Go(e,r,l)&&(wo(e,y,!0),u=!0),Po(e,y,n,t)),y+=4}return function(e,t,n,l,r,i,o,s){const a=e[n?6:7],u=1+4*t;if(s){const e=r+4*o;for(let t=u+4;t<a.length;t+=4)a[t+1]=e,a[t+0]=1}a[u+0]=0,a[u+1]=r,a[u+2]=l,a[u+3]=o;let c=o;for(let d=1;d<u;d+=4)c+=a[d+3];if(!n){const t=e[6],n=i-t[2];for(let e=1;e<t.length;e+=4)t[e+1]+=n}a[0]=c}(e,t,a,s,h,r,g,f=f||p!==g),u&&Ho(e,!0),m}function mo(e,t,n,l=0,r){yo(e,t,n,!0,l,r)}function vo(e,t,n,l=0,r){yo(e,t,n,!1,l,r)}function yo(e,t,n,l,r,i){const o=function(e,t,n,l){const r=e[2][2*t+0],i=e[5];return i[r+2+(l?i[r+0]:0)+n]}(e,r,t,l),s=Bo(e,o),a=Vo(e,o),u=Qo(e,o),c=n instanceof oo?n.value:n;if(Ko(a,s,c)&&(i||Xo(s,c,u,r))){const t=2==(2&a),l=e[0],i=n instanceof oo?new Zo(n,l,t?1:2):null,s=i?n.value:n,c=Mo(e,o);let d=!1,h=i?c:0;if(Oo(e,i,c)){const t=No(e,i,c);h=i?t:0,d=!0}if((d||u!==r)&&Po(e,o,h,r),u!==r){const t=jo(e,o),n=Jo(e,r);!function(e,l,r){n&&n(t)?e[l]|=4:e[l]&=-5}(e,o)}Ro(e,o,s);const p=ko(a),f=Bo(e,p);if(!f||Ko(a,f,s)){let t=!1,n=!0;!qo(s)&&qo(f)&&(t=!0,n=!1),wo(e,p,t),wo(e,o,n),Ho(e,!0)}d&&Uo(e,!0)}}function bo(e,t,n,l,r,i,o){n=r&&n?r(t,n):n,i||o?(i&&i.setValue(t,n),o&&o.setValue(t,n)):n?(n=n.toString(),Xl(l)?l.setStyle(e,t,n,Jl.DashCase):e.style.setProperty(t,n)):Xl(l)?l.removeStyle(e,t,Jl.DashCase):e.style.removeProperty(t)}function Co(e,t,n,l,r,i){r||i?(r&&r.setValue(t,n),i&&i.setValue(t,n)):""!==t&&(n?Xl(l)?l.addClass(e,t):e.classList.add(t):Xl(l)?l.removeClass(e,t):e.classList.remove(t))}function wo(e,t,n){const l=t>=10?t+0:t;n?e[l]|=1:e[l]&=-2}function So(e,t){return 1==(1&e[t>=10?t+0:t])}function _o(e,t){return 2==(2&e[t>=10?t+0:t])}function Io(e,t){return 4==(4&e[t>=10?t+0:t])}function Eo(e,t,n){return 31&e|t<<5|n<<19}function Do(e,t){const n=xo(t);return(2&t?e[4]:e[3])[n]}function xo(e){return e>>5&16383}function ko(e){const t=e>>19&16383;return t>=10?t:-1}function Ao(e){return e[7][2]}function To(e,t,n){e[t+1]=n}function Ro(e,t,n){e[t+2]=n}function Oo(e,t,n){const l=e[9];if(t){if(!l||0===n)return!0}else if(!l)return!1;return l[n]!==t}function No(e,t,n){let l=e[9]||Cr(e);return n>0?l[n]=t:(l.splice(n=l[0],0,t,null),l[0]+=2),n}function Po(e,t,n,l){const r=function(e,t){return n<<16|e}(l);e[t+3]=r}function Mo(e,t){return e[t+3]>>16&65535}function Lo(e,t){const n=Mo(e,t);if(n){const t=e[9];if(t)return t[n]}return null}function Fo(e,t,n){e[1===t?t:t+0]=n}function Vo(e,t){return e[1===t?t:t+0]}function Bo(e,t){return e[t+2]}function jo(e,t){return e[t+1]}function Ho(e,t){wo(e,1,t)}function Uo(e,t){t?e[1]|=8:e[1]&=-9}function zo(e,t,n){if(t===n)return;const l=Bo(e,t),r=jo(e,t),i=Vo(e,t),o=Mo(e,t),s=Qo(e,t);let a=i,u=Vo(e,n);const c=ko(a);if(c>=0){const t=Vo(e,c);Fo(e,c,Eo(t,xo(t),n))}const d=ko(u);if(d>=0){const n=Vo(e,d);Fo(e,d,Eo(n,xo(n),t))}Ro(e,t,Bo(e,n)),To(e,t,jo(e,n)),Fo(e,t,Vo(e,n)),Po(e,t,Mo(e,n),Qo(e,n)),Ro(e,n,l),To(e,n,r),Fo(e,n,i),Po(e,n,o,s)}function $o(e,t,n,l,r,i,o,s){const a=t<e.length;e.splice(t,0,1|r|(n?2:0),l,i,0),Po(e,t,s,o),a&&function(e,n){for(let l=t+4;l<e.length;l+=4){const t=ko(Vo(e,l));if(t>0){const n=xo(Vo(e,t));Fo(e,t,Eo((So(e,t)?1:0)|(_o(e,t)?2:0)|(Io(e,t)?4:0),n,l))}}}(e)}function qo(e,t){return null!==e}function Wo(e,t,n,l){let r,i=l&&l(t)?4:0;return n?(i|=2,r=Yo(e[4],t)):r=Yo(e[3],t),Eo(i,r=r>0?r+1:0,0)}function Go(e,t,n){const l=Do(e,t);return!l||Ko(t,l,n)}function Ko(e,t,n){return!(2&e)&&t&&n&&4&e?t.toString()!==n.toString():t!==n}class Zo{constructor(e,t,n){this._element=t,this._type=n,this._values={},this._dirty=!1,this._factory=e}setValue(e,t){this._values[e]!==t&&(this._values[e]=t,this._dirty=!0)}buildPlayer(e,t){if(this._dirty){const n=this._factory.fn(this._element,this._type,this._values,t,e||null);return this._values={},this._dirty=!1,n}}}function Qo(e,t){return 65535&e[t+3]}function Yo(e,t){for(let n=2;n<e.length;n+=3)if(e[n]===t)return n;return-1}function Jo(e,t){const n=e[2];return n[2*t+1]||n[1]||null}function Xo(e,t,n,l){return null==e||(null!=t?l<=n:n===l)}function es(e){const t=e[4];let n=t[1];if(null===n){n="";for(let e=2;e<t.length;e+=3)t[e+1]&&(n+=(n.length?" ":"")+t[e]);t[1]=n}return n}function ts(e,t,n){return e[t?6:7][1+4*n+2]||null}function ns(e,t,n,l){return!e[t?6:7][1+4*n+0]&&(l===lo||ts(e,t,n)===l)}function ls(e){return e.replace(/[a-z][A-Z]/g,e=>`${e.charAt(0)}-${e.charAt(1).toLowerCase()}`)}function rs(e,t,n,l,r=0){const i=e[n?6:7];if(t>0){const e=1+4*t;for(;i.length<e;)i.push(0,l,null,0)}i.push(0,l,null,r)}function is(e,t,n,l,r){return null===e&&(e=t.length,t.push(null,null,null),t[e+0]=n),t[e+1]=l,t[e+2]=r,e}const os="ng-template";function ss(e,t){const n=e.length,l=e.indexOf(t),r=l+t.length;return!(-1===l||l>0&&" "!==e[l-1]||r<n&&" "!==e[r])}function as(e,t,n){return t===(0!==e.type||n?e.tagName:os)}function us(e,t,n){let l=4;const r=e.attrs||[],i=function(e){for(let t=0;t<e.length;t++)if(_r(e[t]))return t;return e.length}(r);let o=!1;for(let s=0;s<t.length;s++){const a=t[s];if("number"!=typeof a){if(!o)if(4&l){if(l=2|1&l,""!==a&&!as(e,a,n)||""===a&&1===t.length){if(cs(l))return!1;o=!0}}else{const u=8&l?a:t[++s];if(8&l&&e.stylingTemplate){if(!ss(ds(e),u)){if(cs(l))return!1;o=!0}continue}const c=hs(8&l?"class":a,r,0==e.type&&e.tagName!==os,n);if(-1===c){if(cs(l))return!1;o=!0;continue}if(""!==u){let e;e=c>i?"":r[c+1];const t=8&l?e:null;if(t&&!ss(t,u)||2&l&&u!==e){if(cs(l))return!1;o=!0}}}}else{if(!o&&!cs(l)&&!cs(a))return!1;if(o&&cs(a))continue;o=!1,l=a|1&l}}return cs(l)||o}function cs(e){return 0==(1&e)}function ds(e){return e.stylingTemplate?es(e.stylingTemplate):""}function hs(e,t,n,l){if(null===t)return-1;let r=0;if(l||!n){let n=!1;for(;r<t.length;){const l=t[r];if(l===e)return r;if(3===l)n=!0;else{if(1===l){let e=t[++r];for(;"string"==typeof e;)e=t[++r];continue}if(4===l)break;if(0===l){r+=4;continue}}r+=n?1:2}return-1}return function(e,t){let n=e.indexOf(4);if(n>-1)for(n++;n<e.length;){if(e[n]===t)return n;n++}return-1}(t,e)}function ps(e,t,n=!1){for(let l=0;l<t.length;l++)if(us(e,t[l],n))return!0;return!1}function fs(e,t){e:for(let n=0;n<t.length;n++){const l=t[n];if(e.length===l.length){for(let t=0;t<e.length;t++)if(e[t]!==l[t])continue e;return!0}}return!1}const gs=(()=>Promise.resolve(null))();function ms(e){const t=e[dn],n=Rl(e);if(t.firstTemplatePass=!1,e[vn]=t.bindingStartIndex,!n){const n=Pl();ll(e,t,n,void 0),function(e){for(let t=e[In];null!==t;t=t[fn])if(t.length<An&&-1===t[Rn]){const e=t;for(let t=0;t<e[Nn].length;t++){const n=e[Nn][t];Ss(n,n[dn],n[bn])}}}(e),vs(t,e),Zn(e),rl(e,t.contentHooks,t.contentCheckHooks,n,1,void 0),function(e,t){const n=Wl();try{if(e.expandoInstructions){let n=t[vn]=e.expandoStartIndex;Vl(n);let l=-1,r=-1;for(let i=0;i<e.expandoInstructions.length;i++){const o=e.expandoInstructions[i];if("number"==typeof o){if(o<=0){Sl(r=-o);const t=e.expandoInstructions[++i];l=n+=Jn+t}else n+=o;Vl(n)}else null!==o&&(t[vn]=n,o(2,Mn(t[l]),r),_l()),l++}}}finally{Sl(n)}}(t,e)}n&&t.staticContentQueries&&vs(t,e),function(e){if(null!=e)for(let t=0;t<e.length;t++)Ws(e[t])}(t.components)}function vs(e,t){if(null!=e.contentQueries){Hl(0);for(let n=0;n<e.contentQueries.length;n++){const l=e.contentQueries[n];e.data[l].contentQueries(2,t[l],l)}}}function ys(e,t){const n=t||fl()[Sn],l=Kl;return Xl(n)?n.createElement(e,l):null===l?n.createElement(e):n.createElementNS(l,e)}function bs(e,t,n,l,r,i,o,s,a,u){const c=t.blueprint.slice();return c[cn]=r,c[hn]=140|l,Zn(c),c[pn]=c[xn]=e,c[bn]=n,c[wn]=o||e&&e[wn],c[Sn]=s||e&&e[Sn],c[_n]=a||e&&e[_n]||null,c[Cn]=u||e&&e[Cn]||null,c[mn]=i,c}function Cs(e,t,n,l,r){const i=fl(),o=i[dn],s=e+An;i[s]=n;const a=Dl(),u=Al();let c=o.data[s];if(null==c){const e=u?a:a&&a.parent;c=o.data[s]=Os(e&&e!==i[mn]?e:null,t,s,l,r)}return a&&(!u||null!=a.child||null===c.parent&&2!==a.type?u||(a.next=c):a.child=c),null==o.firstChild&&(o.firstChild=c),xl(c),Tl(!0),c}function ws(e,t,n,l){let r=e.node;return null==r&&(e.node=r=Os(t,2,n,null,null)),l[mn]=r}function Ss(e,t,n){const l=Al(),r=Dl();let i;if(512&e[hn])Qs(Tr(e));else try{Tl(!0),xl(null),i=Ul(e,e[mn]),Zn(e),Is(t.template,Es(e),n),e[dn].firstTemplatePass=!1,ms(e)}finally{$l(i),Tl(l),xl(r)}}function _s(e,t,n){const l=e[wn],r=Ul(e,e[mn]),i=!Pl(),o=Rl(e);try{i&&!o&&l.begin&&l.begin(),o&&(n&&Is(n,1,t),ms(e),e[hn]&=-5),Zn(e),n&&Is(n,2,t),ms(e)}finally{i&&!o&&l.end&&l.end(),$l(r)}}function Is(e,t,n){Yl();const l=Wl();try{Sl(null),e(t,n)}finally{Gl(l)}}function Es(e){return Rl(e)?1:2}function Ds(e,t,n,l){if(e.firstTemplatePass&&!t.stylingTemplate){const e=Sr(n,l);e>=0&&(t.stylingTemplate=so(n,e))}}function xs(e,t,n){if(function(e){return 0!=(4&e.flags)}(t)){const l=t.directiveEnd;for(let r=t.directiveStart;r<l;r++){const t=e.data[r];t.contentQueries&&t.contentQueries(1,n[r],r)}}}function ks(e,t,n,l=Bn){if(!ul)return;const r=Dl();e.firstTemplatePass&&function(e,t,n,l,r){const i=r?{"":-1}:null;if(n){Us(l,e.data.length,n.length);for(let e=0;e<n.length;e++){const t=n[e];t.providersResolver&&t.providersResolver(t)}Fs(e,l,n.length);const r=e.preOrderHooks&&e.preOrderHooks.length||0,o=e.preOrderCheckHooks&&e.preOrderCheckHooks.length||0,s=l.index-An;for(let l=0;l<n.length;l++){const a=n[l],u=e.data.length;zs(e,t,a,a.factory),Hs(e.data.length-1,a,i),tl(u,a,e,s,r,o)}}i&&function(e,t,n){if(t){const l=e.localNames=[];for(let e=0;e<t.length;e+=2){const r=n[t[e+1]];if(null==r)throw new Error(`Export of name '${t[e+1]}' not found!`);l.push(t[e],r)}}}(l,r,i)}(e,t,function(e,t,n){const l=e.directiveRegistry;let r=null;if(l)for(let i=0;i<l.length;i++){const e=l[i];ps(n,e.selectors,!1)&&(r||(r=[]),Br(Mr(Dl(),t),t,e.type),$n(e)?(1&n.flags&&no(n),n.flags=1,r.unshift(e)):r.push(e))}return r}(e,t,r),r,n||null),function(e,t,n){const l=n.directiveStart,r=n.directiveEnd;!e.firstTemplatePass&&l<r&&Mr(n,t);for(let i=l;i<r;i++){const l=e.data[i];$n(l)&&$s(t,n,l),Vs(t,qr(e.data,t,i,n),l,i)}}(e,t,r),function(e,t,n){const l=n.directiveStart,r=n.directiveEnd,i=e.expandoInstructions,o=e.firstTemplatePass,s=n.index-An,a=Wl();try{Sl(s);for(let s=l;s<r;s++){const l=e.data[s],r=t[s];l.hostBindings?(Ls(l,i,r,n,o),_l()):o&&i.push(null)}}finally{Sl(a)}}(e,t,r),function(e,t,n){const l=t.localNames;if(l){let r=t.index+1;for(let i=0;i<l.length;i+=2){const o=l[i+1],s=-1===o?n(t,e):e[o];e[r++]=s}}}(t,r,l)}function As(e,t,n,l,r,i,o){return e.ngPrivateData||(e.ngPrivateData=Ts(-1,e,t,n,l,r,i,o))}function Ts(e,t,n,l,r,i,o,s){const a=An+n,u=a+l,c=function(e,t){const n=new Array(t).fill(null,0,e).fill(lo,e);return n[vn]=e,n}(a,u);return c[dn]={id:e,blueprint:c,template:t,viewQuery:o,node:null,data:c.slice().fill(null,a),bindingStartIndex:a,viewQueryStartIndex:u,expandoStartIndex:u,expandoInstructions:null,firstTemplatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:"function"==typeof r?r():r,pipeRegistry:"function"==typeof i?i():i,firstChild:null,schemas:s}}function Rs(e,t){const n=e.createRenderer(null,null);return"string"==typeof t?Xl(n)?n.selectRootElement(t):n.querySelector(t):t}function Os(e,t,n,l,r){return{type:t,index:n,injectorIndex:e?e.injectorIndex:-1,directiveStart:-1,directiveEnd:-1,propertyMetadataStartIndex:-1,propertyMetadataEndIndex:-1,flags:0,providerIndexes:0,tagName:l,attrs:r,localNames:null,initialInputs:void 0,inputs:void 0,outputs:void 0,tViews:null,next:null,projectionNext:null,child:null,parent:e,stylingTemplate:null,projection:null,onElementCreationFns:null}}function Ns(e,t){const n=fl()[dn];let l=null;const r=e.directiveStart,i=e.directiveEnd;if(i>r){const e=0===t,o=n.data;for(let t=r;t<i;t++){const n=o[t],r=e?n.inputs:n.outputs;for(let e in r)if(r.hasOwnProperty(e)){const n=r[e];(l=l||{}).hasOwnProperty(e)?l[e].push(t,e,n):l[e]=[t,e,n]}}}return l}const Ps={class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"};function Ms(e,t,n,l,r,i){if(n===lo)return;const o=fl(),s=Vn(e,o),a=jn(e,o);let u,c;if(!r&&(u=la(a))&&(c=u[t]))aa(o,c,n),zn(a)&&function(t,n){const l=Un(e+An,t);16&l[hn]||(l[hn]|=64)}(o);else if(3===a.type){!function(e,t,n,l,r){const i=t[vn]-1,o=l[i];o[0]==sn&&(l[i]=n+o,r||(-1==e.propertyMetadataStartIndex&&(e.propertyMetadataStartIndex=i),e.propertyMetadataEndIndex=i+1))}(a,o,t=Ps[t]||t,o[dn].data,r);const e=i?i(a,o):o[Sn];n=null!=l?l(n,a.tagName||"",t):n,Xl(e)?e.setProperty(s,t,n):gr(t)||(s.setProperty?s.setProperty(t,n):s[t]=n)}}function Ls(e,t,n,l,r){const i=t.length;dl(e),e.hostBindings(1,n,l.index-An),dl(null),i===t.length&&r&&t.push(e.hostBindings)}function Fs(e,t,n){const l=-(t.index-An),r=e.data.length-(65535&t.providerIndexes);(e.expandoInstructions||(e.expandoInstructions=[])).push(l,r,n)}function Vs(e,t,n,l){const r=Dl();Bs(e,r,t),r&&r.attrs&&function(e,t,n,l){let i=r.initialInputs;(void 0===i||e>=i.length)&&(i=function(e,t,n){const l=n.initialInputs||(n.initialInputs=[]);l[e]=null;const r=n.attrs;let i=0;for(;i<r.length;){const n=r[i];if(0===n){i+=4;continue}if(5===n){i+=2;continue}if("number"==typeof n)break;const o=t[n],s=r[i+1];void 0!==o&&(l[e]||(l[e]=[])).push(n,o,s),i+=2}return l}(e,n.inputs,r));const o=i[e];if(o){const e=n.setInput;for(let l=0;l<o.length;){const r=o[l++],i=o[l++],s=o[l++];e?n.setInput(t,s,r,i):t[i]=s}}}(l,t,n),e[dn].firstTemplatePass&&n.contentQueries&&(r.flags|=4),$n(n)&&(Un(r.index,e)[bn]=t)}function Bs(e,t,n){const l=Bn(t,e);rr(n,e),l&&rr(l,e)}function js(e){const t=fl()[dn];(t.components||(t.components=[])).push(e.index)}function Hs(e,t,n){if(n){if(t.exportAs)for(let l=0;l<t.exportAs.length;l++)n[t.exportAs[l]]=e;t.template&&(n[""]=e)}}function Us(e,t,n){e.flags=1&e.flags,e.directiveStart=t,e.directiveEnd=t+n,e.providerIndexes=t}function zs(e,t,n,l){e.data.push(n);const r=new el(l,$n(n),null);e.blueprint.push(r),t.push(r)}function $s(e,t,n){const l=Bn(t,e),r=Gs(e,bs(e,As(n.template,n.consts,n.vars,n.directiveDefs,n.pipeDefs,n.viewQuery,n.schemas),null,n.onPush?64:16,e[t.index],t,e[wn],e[wn].createRenderer(l,n)));r[mn]=t,e[t.index]=r,e[dn].firstTemplatePass&&js(t)}function qs(e,t,n,l,r){return[e,!0,r?-1:0,t,null,null,l,n,[]]}function Ws(e){const t=fl(),n=Un(e,t);(128==(128&n[hn])||Rl(t))&&80&n[hn]&&(function(e){const t=e[dn];for(let n=e.length;n<t.blueprint.length;n++)e[n]=t.blueprint[n]}(n),Xs(n,n[bn]))}function Gs(e,t){return e[In]?e[En][fn]=t:e[In]=t,e[En]=t,t}function Ks(e){for(;e;){e[hn]|=64;const t=kr(e);if(qn(e)&&!t)return e;e=t}return null}function Zs(e,t){const n=0===e.flags;if(e.flags|=t,n&&e.clean==gs){let t;e.clean=new Promise(e=>t=e),e.scheduler(()=>{if(1&e.flags&&(e.flags&=-2,Qs(e)),2&e.flags){e.flags&=-3;const t=e.playerHandler;t&&t.flushPlayers()}e.clean=gs,t(null)})}}function Qs(e){for(let t=0;t<e.components.length;t++){const n=e.components[t];_s(Gn(n),n)}}function Ys(e,t){const n=e[wn];n.begin&&n.begin();try{Rl(e)&&Xs(e,t),Xs(e,t)}catch(l){throw sa(e,l),l}finally{n.end&&n.end()}}function Js(e){Qs(e[bn])}function Xs(e,t){const n=e[dn],l=Ul(e,e[mn]),r=n.template,i=Rl(e);try{Zn(e),i&&ea(1,n,t),Is(r,Es(e),t),ms(e),i&&!n.staticViewQueries||ea(2,n,t)}finally{$l(l)}}function ea(e,t,n){const l=t.viewQuery;l&&(Hl(t.viewQueryStartIndex),l(e,n))}function ta(e,t="",n=""){const l=e[dn].data,r=e[vn]-1;return null==l[r]?l[r]=sn+t+sn+n:null}const na=gs;function la(e){return e?(void 0===e.inputs&&(e.inputs=Ns(e,0)),e.inputs):null}function ra(e){return e[yn]||(e[yn]=[])}function ia(e){return e[dn].cleanup||(e[dn].cleanup=[])}function oa(e,t){return t[e.index][Sn]}function sa(e,t){const n=e[Cn],l=n?n.get(ei,null):null;l&&l.handleError(t)}function aa(e,t,n){const l=e[dn];for(let r=0;r<t.length;){const i=t[r++],o=t[r++],s=t[r++],a=e[i],u=l.data[i];u.setInput?u.setInput(a,n,o,s):a[s]=n}}function ua(e){let t;if(t=e.onElementCreationFns){for(let e=0;e<t.length;e++)t[e]();e.onElementCreationFns=null}}function ca(e){const t=fl(),n=t[dn];n.firstTemplatePass&&(function(e,t,n){const l=e.expandoInstructions,r=l.length;r>=2&&l[r-2]===t.hostBindings?l[r-1]=l[r-1]+n:l.push(t.hostBindings,n)}(n,cl,e),function(e,t,n){for(let l=0;l<n;l++)t.push(lo),e.blueprint.push(lo),e.data.push(null)}(n,t,e))}function da(e){Ys(lr(e),e)}function ha(e){Zs(Ks(lr(e))[bn],1)}function pa(e,t){const n=t[pn];return-1===e.index?Fn(n)?n:null:n}function fa(e,t){const n=pa(e,t);return n?ka(t[Sn],n[On]):null}const ga=[];function ma(e,t,n,l,r){const i=e[dn].node;let o=-1,s=e,a=i.child;for(;a;){let e=null;if(3===a.type||4===a.type){va(t,n,l,Bn(a,s),a,r);const i=s[a.index];Fn(i)&&(va(t,n,l,i[On],a,r),i[Nn].length&&(e=(s=i[Nn][0])[dn].node,r=i[On]))}else if(0===a.type){const i=s[a.index];va(t,n,l,i[On],a,r),i[Nn].length&&(e=(s=i[Nn][0])[dn].node,r=i[On])}else if(1===a.type){const i=Ar(s),u=i[mn].projection[a.projection];if(Array.isArray(u))for(let e of u)va(t,n,l,e,a,r);else ga[++o]=a,ga[++o]=s,u&&(e=(s=i[pn])[dn].data[u.index])}else e=a.child;if(null===e)for(null===a.projectionNext&&2&a.flags&&(s=ga[o--],a=ga[o--]),e=2&a.flags?a.projectionNext:4===a.type&&a.child||a.next;!e;){if(null===(a=a.parent||s[mn])||a===i)return;if(0===a.type&&(r=(s=kr(s))[a.index][On]),2===a.type){for(;!s[fn]&&s[pn]&&(!a.parent||!a.parent.next);){if(a===i)return;if(Fn(s=s[pn])){a=s[mn],r=(s=s[pn])[a.index][On];break}a=s[mn]}e=s[fn]?(s=s[fn])[mn]:4===a.type&&a.child||a.next}else e=a.next}a=e}}function va(e,t,n,l,r,i){0===e?Da(t,n,l,i||null):1===e?Ra(t,l,zn(r)):2===e&&t.destroyNode(l)}function ya(e,t){return Xl(t)?t.createText(en(e)):t.createTextNode(en(e))}function ba(e,t,n){const l=fa(e[dn].node,e);l&&ma(e,t?0:1,e[Sn],l,n)}function Ca(e,t,n){const l=t[Nn];n>0&&(l[n-1][fn]=e),n<l.length?(e[fn]=l[n],l.splice(n,0,e)):(l.push(e),e[fn]=null),e[pn]=t,e[gn]&&e[gn].insertView(n),e[hn]|=128}function wa(e,t){const n=e[Nn],l=n[t];return l&&(t>0&&(n[t-1][fn]=l[fn]),n.splice(t,1),ba(l,!1),128&l[hn]&&!(256&l[hn])&&l[gn]&&l[gn].removeView(),l[pn]=null,l[fn]=null,l[hn]&=-129),l}function Sa(e,t){const n=e[Nn][t];n&&(wa(e,t),_a(n))}function _a(e){if(!(256&e[hn])){const t=e[Sn];Xl(t)&&t.destroyNode&&ma(e,2,t,null),function(e){let t=e[In];if(!t)return Ea(e);for(;t;){let n=null;if(Ln(t))n=t[In];else{const e=t[Nn];e.length>0&&(n=e[0])}if(!n){for(;t&&!t[fn]&&t!==e;)Ea(t),t=Ia(t,e);Ea(t||e),n=t&&t[fn]}t=n}}(e)}}function Ia(e,t){let n;return Ln(e)&&(n=e[mn])&&2===n.type?pa(n,e):e[pn]===t?null:e[pn]}function Ea(e){if(Ln(e)&&!(256&e[hn])){e[hn]&=-129,e[hn]|=256,function(e){const t=e[dn];let n;if(null!=t&&null!=(n=t.destroyHooks))for(let l=0;l<n.length;l+=2){const t=e[n[l]];t instanceof el||n[l+1].call(t)}}(e),function(e){const t=e[dn].cleanup;if(null!=t){const n=e[yn];for(let l=0;l<t.length-1;l+=2)if("string"==typeof t[l]){const r=t[l+1],i="function"==typeof r?r(e):Mn(e[r]),o=n[t[l+2]],s=t[l+3];"boolean"==typeof s?i.removeEventListener(t[l],o,s):s>=0?n[s]():n[-s].unsubscribe(),l+=2}else t[l].call(n[t[l+1]]);e[yn]=null}}(e);const t=e[mn];t&&3===t.type&&Xl(e[Sn])&&e[Sn].destroy(),Kn(e)&&e[gn]&&e[gn].removeView()}}function Da(e,t,n,l){Xl(e)?e.insertBefore(t,n,l):t.insertBefore(n,l,!0)}function xa(e,t,n,l){l?Da(e,t,n,l):function(e,t,n){Xl(e)?e.appendChild(t,n):t.appendChild(n)}(e,t,n)}function ka(e,t){return Xl(e)?e.parentNode(t):t.parentNode}function Aa(e,t,n){const l=function(e,t){if(qn(t))return ka(t[Sn],Bn(e,t));const n=function(e){for(;null!=e.parent&&(4===e.parent.type||5===e.parent.type);)e=e.parent;return e}(e).parent;if(null==n){const e=t[mn];return 2===e.type?fa(e,t):function(e){const t=e[mn];return t&&3===t.type?Bn(t,kr(e)):null}(t)}if(1&n.flags){const e=t[dn].data,l=e[e[n.index].directiveStart].encapsulation;if(l!==kt.ShadowDom&&l!==kt.Native)return null}return Bn(n,t)}(t,n);if(null!=l){const r=n[Sn],i=function(e,t){if(2===e.type){const n=pa(e,t),l=n[Nn];return Ta(l.indexOf(t),l,n[On])}return 4===e.type||5===e.type?Bn(e,t):null}(t.parent||n[mn],n);if(Array.isArray(e))for(let t of e)xa(r,l,t,i);else xa(r,l,e,i)}}function Ta(e,t,n){if(e+1<t.length){const l=t[e+1],r=l[mn];return r.child?Bn(r.child,l):n}return n}function Ra(e,t,n){const l=ka(e,t);l&&function(e,t,n,l){Xl(e)?e.removeChild(t,n,l):t.removeChild(n)}(e,l,t,n)}function Oa(e,t,n,l){const r=Bn(e,l);Aa(r,t,n),rr(r,l);const i=l[e.index];if(0===e.type){const e=i[Nn];for(let t=0;t<e.length;t++)ba(e[t],!0,i[On])}else{if(4===e.type){let r=e.child;for(;r;)Oa(r,t,n,l),r=r.next}Fn(i)&&Aa(i[On],t,n)}}function Na(e){const t=Va(e,null,null),n=fl();n[dn].firstTemplatePass&&(t.tViews=[]),Fa(n,t),Tl(!1)}function Pa(e,t,n,l,r,i,o,s){const a=fl(),u=a[dn],c=Va(e,r||null,i||null);u.firstTemplatePass&&(c.tViews=Ts(-1,t,n,l,u.directiveRegistry,u.pipeRegistry,null,null)),ks(u,a,o,s),Fa(a,c),rr(Bn(c,a),a),nl(u,c),Tl(!1)}function Ma(e){const t=fl(),n=t[dn];xl(Hn(n.data,e)),Tl(!0),t[e+An][Rn]=0,ll(t,n,Pl(),void 0)}function La(){let e=Dl();Al()?Tl(!1):xl(e=e.parent);const t=fl()[e.index],n=t[Rn];for(;n<t[Nn].length;)Sa(t,n)}function Fa(e,t){const n=e[gn];if(n){const l=e[t.index];l[gn]?n.insertNodeBeforeViews(t):(n.addNode(t),l[gn]=n.container())}}function Va(e,t,n){const l=fl(),r=e+An,i=l[Sn].createComment(""),o=Cs(e,0,i,t,n),s=l[r]=qs(l[r],l,i,o);return Aa(i,o,l),Gs(l,s),o}function Ba(e,t){const n=fl(),l=n[dn],r=e+An;r>=l.data.length&&(l.data[r]=null,l.blueprint[r]=null),n[r]=t}function ja(e){return Hn(Ol,e)}function Ha(e){return Hn(fl(),e)}function Ua(e,t=_.Default){e=L(e);const n=fl();return null==n?q(e,t):Hr(Dl(),n,e,t)}function za(e){return jr(Dl(),e)}function $a(e,t,n){const l=Dl();l.stylingTemplate||(l.stylingTemplate=hr()),Wa(l,e,t,n,cr)}function qa(e,t,n){const l=Dl();l.stylingTemplate||(l.stylingTemplate=hr());const r=ru();pr(l.stylingTemplate,r),(l.onElementCreationFns=l.onElementCreationFns||[]).push(()=>{Wa(l,e,t,n,r),function(e,t){let n=e[8];n||(n=e[8]=[cr]),n[0]=t}(l.stylingTemplate,r)})}function Wa(e,t,n,l,r){!function(e,t,n,l,r){if(16&e[1])return;if(!function(e,t,n,l){const r=e[2],i=2*t;return!(i<r.length&&r[i+0]>=0||(pr(e,t,e[5].length,l),0))}(e,t,0,r))return;l&&(l=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(ls(e[n]));return t}(l));const i=e[5],o=i[1],s=i[0],a=e[6],u=e[7],c=4*s;let d=10+c,h=d+4*o,p=h+c;const f=i.length;i.push(l?l.length:0,n?n.length:0);let g=0;const m=[];if(l&&l.length)for(let D=0;D<l.length;D++){const t=l[D];let n=po(e,t,10,d);-1==n&&(n=d+g,g+=4,m.push(t)),i.push(n)}const v=[];if(n&&n.length)for(let D=0;D<n.length;D++){const t=n[D];let l=po(e,t,d,h);-1==l?(l=h+g,g+=4,v.push(t)):l+=4*m.length,i.push(l)}let y=2;if(m.length)for(;y<f;){const e=i[y+0],t=i[y+1];if(t){const n=y+2+e;for(let e=n;e<n+t;e++)i[e]+=4*m.length}y+=2+(e+t)}const b=v.length+m.length;for(let D=10;D<e.length;D+=4){const t=D>=h,n=D>=(t?p:d),l=Vo(e,D),r=xo(l);let i=ko(l);Fo(e,D,Eo(l,r,i+=t?n?4*m.length:0:4*b+4*(n?m.length:0)))}for(let D=0;D<4*m.length;D++)e.splice(p,0,null),e.splice(d,0,null),d++,h++,p+=2;for(let D=0;D<4*v.length;D++)e.splice(h,0,null),e.push(null),h++,p++;const C=e[4],w=e[3];for(let D=0;D<b;D++){const n=D>=m.length,l=n?D-m.length:D,i=n?v[l]:m[l];let a,u;n?(a=p+4*(o+l),u=d+4*(o+l)):(a=h+4*(s+l),u=10+4*(s+l));let c=n?C:w,f=Yo(c,i);-1===f?f=is(null,c,i,!n&&null,t)+1:f+=1;const g=Wo(e,i,n,r||null);Fo(e,u,Eo(g,f,a)),To(e,u,i),Ro(e,u,null),Po(e,u,0,t),Fo(e,a,Eo(g,f,u)),To(e,a,i),Ro(e,a,null),Po(e,a,0,t)}i[1]=o+v.length,i[0]=s+m.length,a[0]+=v.length,u[0]+=m.length;const S=4*m.length,_=4*v.length,I=u.length;rs(e,t,!1,h+4*s,m.length);for(let D=1;D<I;D+=4)u[D+1]+=_+S;const E=a.length;rs(e,t,!0,p+4*o,v.length);for(let D=1;D<E;D+=4)a[D+1]+=2*S+_;Fo(e,1,Eo(0,0,h))}(e.stylingTemplate,r,t,n,l)}function Ga(e,t,n,l,r){const i=Za(n,l);vo(iu(e,fl()),t,i,cr,r)}function Ka(e,t,n,l){const r=ru(),i=iu(Wl(),fl());ro(i,r,vo,[i,e,Za(t,n),r,l])}function Za(e,t){let n=null;return null!==e&&(n=t?en(e)+t:e),n}function Qa(e,t,n,l){const r=n instanceof oo?n:Ja(n);mo(iu(e,fl()),t,r,cr,l)}function Ya(e,t,n){const l=ru(),r=iu(Wl(),fl());ro(r,l,mo,[r,e,t instanceof oo?t:Ja(t),l,n])}function Ja(e){return"boolean"==typeof e?e:!!e||null}function Xa(e,t,n){const l=fl(),r=iu(e,l),i=jn(e,l);if(mr(i)&&t!==lo){const e=es(r),n=(e.length?e+" ":"")+function(e){return e&&"string"!=typeof e&&(e=Object.keys(e).join(" ")),e||""}(t);aa(l,i.inputs.class,n),t=lo}if(vr(i)&&n!==lo){const e=es(r),t=(e.length?e+" ":"")+function(e){let t="";if(e){const n=Object.keys(e);for(let l=0;l<n.length;l++){const r=n[l];t+=(l?";":"")+`${r}:${e[r]}`}}return t}(n);aa(l,i.inputs.style,t),n=lo}fo(r,t,n)}function eu(e,t){const n=ru(),l=iu(Wl(),fl());ro(l,n,fo,[l,e,t,n])}function tu(e){lu(cr,e)}function nu(){lu(ru(),Wl())}function lu(e,t){const n=fl(),l=3===jn(t,n).type?n[Sn]:null,r=0!=(8&n[hn]);(function(e,t,n,l,r,i,o=0){let s=0;if(function(e,t){const n=e[8];return!n||n[0]===t}(e,o)&&(function(e){const t=e[8];if(t){for(let e=1;e<t.length;e+=3)t[e+1].apply(this,t[e+2]);t.length=1}}(e),function(e){return So(e,1)}(e))){const r=e[0],i=8&e[1],o=Ao(e);for(let n=10;n<e.length;n+=4)if(So(e,n)){const i=Vo(e,n),s=Qo(e,n),a=jo(e,n),u=Bo(e,n),c=4&i?Jo(e,s):null,d=Lo(e,n),h=!!(2&i);let p=u;n<o&&!qo(p)&&(p=Bo(e,ko(i))),qo(p)||(p=Do(e,i)),t&&(!l||p)&&(h?Co(r,a,!!p,t,null,d):bo(r,a,p,t,c,null,d)),wo(e,n,!1)}if(i){const t=Array.isArray(n)?Tr(n):n,i=br(e),o=i[0];for(let e=1;e<o;e+=2){const n=i[e],o=e+1,a=i[o];if(n){const e=n.buildPlayer(a,l);void 0!==e&&(null!=e&&yr(i,t,r,e,o)&&s++,a&&a.destroy())}else a&&a.destroy()}Uo(e,!1)}Ho(e,!1)}return s})(iu(t,n),l,n,r,0,0,e)>0&&Zs(Tr(n),2),al(null)}function ru(){return bl+Cl}function iu(e,t){let n=sl;return n||al(n=fr(e+An,t)),n}function ou(e,t,n,l){const r=fl(),i=r[dn],o=ys(t),s=r[Sn],a=Cs(e,3,o,t,n||null);let u=0,c=0;if(n&&(Ds(i,a,n,wr(o,n)),a.stylingTemplate&&(u=ho(o,a.stylingTemplate,s),c=co(o,a.stylingTemplate,s))),Aa(o,a,r),ks(i,r,l),0===ol&&rr(o,r),ol++,i.firstTemplatePass){const e=la(a);e&&e.hasOwnProperty("class")&&(a.flags|=8),e&&e.hasOwnProperty("style")&&(a.flags|=16)}a.stylingTemplate&&(co(o,a.stylingTemplate,s,c),ho(o,a.stylingTemplate,s,u));const d=r[gn];d&&(d.addNode(a),r[gn]=d.clone()),xs(i,a,r)}function su(){let e=Dl();Al()?Tl(!1):xl(e=e.parent),e.onElementCreationFns&&ua(e);const t=fl(),n=t[gn];n&&(t[gn]=n.parent),nl(fl()[dn],e),ol--;let l=null;mr(e)&&(l=fr(e.index,t),aa(t,e.inputs.class,es(l))),vr(e)&&(l=l||fr(e.index,t),aa(t,e.inputs.style,function(e){const t=l[3];let n=t[1];if(null===n){n="";for(let e=2;e<t.length;e+=3){const l=t[e+1];null!==l&&(n+=(n.length?";":"")+`${t[e]}:${l}`)}t[1]=n}return n}()))}function au(e,t,n,l){ou(e,t,n,l),su()}function uu(e,t,n,l,r){if(n!==lo){const i=fl(),o=i[Sn],s=Vn(e,i);if(null==n)Xl(o)?o.removeAttribute(s,t,r):s.removeAttribute(t);else{const a=jn(e,i),u=null==l?en(n):l(n,a.tagName||"",t);Xl(o)?o.setAttribute(s,t,u,r):r?s.setAttributeNS(r,t,u):s.setAttribute(t,u)}}}function cu(e){const t=Wl(),n=fl(),l=jn(t,n);if(3===l.type){const t=Sr(e,wr(Bn(l,n),e));if(t>=0){const n=ru();l.stylingTemplate?ao(l.stylingTemplate,e,t,n):l.stylingTemplate=so(e,t,n)}}}function du(e,t,n){const l=fl(),r=l[dn],i=l[Sn].createComment(""),o=Cs(e,4,i,"ng-container",t||null);t&&Ds(r,o,t,0),Aa(i,o,l),ks(r,l,n),rr(i,l);const s=l[gn];s&&(s.addNode(o),l[gn]=s.clone()),xs(r,o,l)}function hu(){let e=Dl();const t=fl(),n=t[dn];Al()?Tl(!1):xl(e=e.parent);const l=t[gn];l&&(t[gn]=l.parent),e.onElementCreationFns&&ua(e),nl(n,e)}function pu(e,t,n){const l=fl(),r=Dl(),i=2===r.type?r.parent:r,o=l[i.index];let s=function(e,t,n){const l=e[Nn];for(let r=t;r<l.length;r++){const t=l[r][dn].id;if(t===n)return l[r];if(!(t<n))break;Sa(e,r)}return null}(o,o[Rn],e);if(s)Tl(!0),Ul(s,s[dn].node);else{s=bs(l,function(e,t,n,l){const r=fl()[dn],i=l.tViews;return(e>=i.length||null==i[e])&&(i[e]=Ts(e,null,t,n,r.directiveRegistry,r.pipeRegistry,null,null)),i[e]}(e,t,n,i),null,16,null,null),o[gn]&&(s[gn]=o[gn].createView());const a=Al()?r:r&&r.parent;ws(s[dn],a,e,s),Ul(s,s[dn].node)}return o&&(Rl(s)&&Ca(s,o,o[Rn]),o[Rn]++),Rl(s)?3:2}function fu(){const e=fl(),t=e[mn];Rl(e)&&(ms(e),e[hn]&=-5),Zn(e),ms(e),$l(e[pn][pn]),xl(t),Tl(!1)}function gu(){return fl()}function mu(e){return!!e&&"function"==typeof e.then}function vu(e){return!!e&&"function"==typeof e.subscribe}function yu(e,t,n=!1,l){Cu(e,t,n,l)}function bu(e,t,n=!1,l){Cu(e,t,n,l,oa)}function Cu(e,t,n=!1,l,r){const i=fl(),o=Dl(),s=i[dn],a=s.firstTemplatePass&&(s.cleanup||(s.cleanup=[]));let u=!0;if(3===o.type){const s=Bn(o,i),c=l?l(s):{},d=c.target||s,h=r?r(o,i):i[Sn],p=ra(i),f=p.length,g=l?e=>l(Mn(e[o.index])).target:o.index;if(Xl(h)){let n=null;if(!l&&function(e){return e.directiveEnd>e.directiveStart}(o)&&(n=function(e,t,n){const l=e[dn].cleanup;if(null!=l)for(let r=0;r<l.length-1;r+=2){const i=l[r];if(i===t&&l[r+1]===n){const t=e[yn],n=l[r+2];return t.length>n?t[n]:null}"string"==typeof i&&(r+=2)}return null}(i,e,o.index)),null!==n)t.__ngNextListenerFn__=n.__ngNextListenerFn__,n.__ngNextListenerFn__=t,u=!1;else{t=Su(o,i,t,!1);const n=h.listen(c.name||d,e,t);p.push(t,n),a&&a.push(e,g,f,f+1)}}else t=Su(o,i,t,!0),d.addEventListener(e,t,n),p.push(t),a&&a.push(e,g,f,n)}void 0===o.outputs&&(o.outputs=Ns(o,1));const c=o.outputs;let d;if(u&&c&&(d=c[e])){const n=d.length;if(n){const l=ra(i);for(let r=0;r<n;r+=3){const n=i[d[r]][d[r+2]].subscribe(t),s=l.length;l.push(t,n),a&&a.push(e,o.index,s,-(s+1))}}}}function wu(e,t,n){try{return!1!==t(n)}catch(l){return sa(e,l),!1}}function Su(e,t,n,l){return function r(i){const o=1&e.flags?Un(e.index,t):t;0==(32&t[hn])&&Ks(o);let s=wu(t,n,i),a=r.__ngNextListenerFn__;for(;a;)s=wu(t,a,i)&&s,a=a.__ngNextListenerFn__;return l&&!1===s&&(i.preventDefault(),i.returnValue=!1),s}}function _u(e=1){return zl(e)}function Iu(e,t){let n=null;const l=function(e){const t=e.attrs;if(null!=t){const e=t.indexOf(5);if(0==(1&e))return t[e+1]}return null}(e);for(let r=0;r<t.length;r++){const i=t[r];if("*"!==i){if(null===l?ps(e,i,!0):fs(l,i))return r}else n=r}return n}function Eu(e){const t=Ar(fl())[mn];if(!t.projection){const n=t.projection=new Array(e?e.length:1).fill(null),l=n.slice();let r=t.child;for(;null!==r;){const t=e?Iu(r,e):0;null!==t&&(l[t]?l[t].projectionNext=r:n[t]=r,l[t]=r),r=r.next}}}function Du(e,t=0,n){const l=fl(),r=Cs(e,1,null,null,n||null);null===r.projection&&(r.projection=t),Tl(!1),function e(t,n,l,r){const i=r[pn];let o=r[mn].projection[l];if(Array.isArray(o))Aa(o,n,t);else for(;o;)1===o.type?e(t,n,o.projection,Ar(i)):(o.flags|=2,Oa(o,n,t,i)),o=o.projectionNext}(l,r,t,Ar(l))}let xu=null;function ku(){if(!xu){const e=V.Symbol;if(e&&e.iterator)xu=e.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;t<e.length;++t){const n=e[t];"entries"!==n&&"size"!==n&&Map.prototype[n]===Map.prototype.entries&&(xu=n)}}}return xu}function Au(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}function Tu(e,t){const n=Ou(e),l=Ou(t);if(n&&l)return function(e,t,n){const l=e[ku()](),r=t[ku()]();for(;;){const e=l.next(),t=r.next();if(e.done&&t.done)return!0;if(e.done||t.done)return!1;if(!n(e.value,t.value))return!1}}(e,t,Tu);{const r=e&&("object"==typeof e||"function"==typeof e),i=t&&("object"==typeof t||"function"==typeof t);return!(n||!r||l||!i)||Au(e,t)}}class Ru{constructor(e){this.wrapped=e}static wrap(e){return new Ru(e)}static unwrap(e){return Ru.isWrapped(e)?e.wrapped:e}static isWrapped(e){return e instanceof Ru}}function Ou(e){return!!Nu(e)&&(Array.isArray(e)||!(e instanceof Map)&&ku()in e)}function Nu(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function Pu(e,t,n){return e[t]=n}function Mu(e,t){return e[t]}function Lu(e,t,n){return r=n,((l=e[t])==l||r==r)&&l!==r&&(e[t]=n,!0);var l,r}function Fu(e,t,n,l){const r=Lu(e,t,n);return Lu(e,t+1,l)||r}function Vu(e,t,n,l,r){const i=Fu(e,t,n,l);return Lu(e,t+2,r)||i}function Bu(e,t,n,l,r,i){const o=Fu(e,t,n,l);return Fu(e,t+2,r,i)||o}function ju(e,t,n,l){return Ms(Wl(),e,Hu(t),n,l),ju}function Hu(e){const t=fl(),n=t[vn]++;return ta(t),Lu(t,n,e)?e:lo}function Uu(e,t,n,l,r){Ms(e,t,n,l,r)}function zu(e,t,n,l,r){Ms(e,t,n,l,r,oa)}function $u(e){let t=!1;const n=fl(),l=n[dn].data;let r=n[vn];if(null==l[r]){for(let t=2;t<e.length;t+=2)l[r++]=e[t];r=n[vn]}for(let o=1;o<e.length;o+=2)Lu(n,r++,e[o])&&(t=!0);if(n[vn]=r,ta(n,e[0],e[e.length-1]),!t)return lo;let i=e[0];for(let o=1;o<e.length;o+=2)i+=en(e[o])+e[o+1];return i}function qu(e,t,n){const l=fl(),r=Lu(l,l[vn]++,t);return ta(l,e,n),r?e+en(t)+n:lo}function Wu(e,t,n,l,r){const i=fl(),o=i[vn],s=Fu(i,o,t,l);return i[vn]+=2,ta(i,e,r)&&(i[dn].data[o]=n),s?e+en(t)+n+en(l)+r:lo}function Gu(e,t,n,l,r,i,o){const s=fl(),a=s[vn],u=Vu(s,a,t,l,i);if(s[vn]+=3,ta(s,e,o)){const e=s[dn].data;e[a]=n,e[a+1]=r}return u?e+en(t)+n+en(l)+r+en(i)+o:lo}function Ku(e,t,n,l,r,i,o,s,a){const u=fl(),c=u[vn],d=Bu(u,c,t,l,i,s);if(u[vn]+=4,ta(u,e,a)){const e=u[dn].data;e[c]=n,e[c+1]=r,e[c+2]=o}return d?e+en(t)+n+en(l)+r+en(i)+o+en(s)+a:lo}function Zu(e,t,n,l,r,i,o,s,a,u,c){const d=fl(),h=d[vn];let p=Bu(d,h,t,l,i,s);if(p=Lu(d,h+4,u)||p,d[vn]+=5,ta(d,e,c)){const e=d[dn].data;e[h]=n,e[h+1]=r,e[h+2]=o,e[h+3]=a}return p?e+en(t)+n+en(l)+r+en(i)+o+en(s)+a+en(u)+c:lo}function Qu(e,t,n,l,r,i,o,s,a,u,c,d,h){const p=fl(),f=p[vn];let g=Bu(p,f,t,l,i,s);if(g=Fu(p,f+4,u,d)||g,p[vn]+=6,ta(p,e,h)){const e=p[dn].data;e[f]=n,e[f+1]=r,e[f+2]=o,e[f+3]=a,e[f+4]=c}return g?e+en(t)+n+en(l)+r+en(i)+o+en(s)+a+en(u)+c+en(d)+h:lo}function Yu(e,t,n,l,r,i,o,s,a,u,c,d,h,p,f){const g=fl(),m=g[vn];let v=Bu(g,m,t,l,i,s);if(v=Vu(g,m+4,u,d,p)||v,g[vn]+=7,ta(g,e,f)){const e=g[dn].data;e[m]=n,e[m+1]=r,e[m+2]=o,e[m+3]=a,e[m+4]=c,e[m+5]=h}return v?e+en(t)+n+en(l)+r+en(i)+o+en(s)+a+en(u)+c+en(d)+h+en(p)+f:lo}function Ju(e,t,n,l,r,i,o,s,a,u,c,d,h,p,f,g,m){const v=fl(),y=v[vn];let b=Bu(v,y,t,l,i,s);if(b=Bu(v,y+4,u,d,p,g)||b,v[vn]+=8,ta(v,e,m)){const e=v[dn].data;e[y]=n,e[y+1]=r,e[y+2]=o,e[y+3]=a,e[y+4]=c,e[y+5]=h,e[y+6]=f}return b?e+en(t)+n+en(l)+r+en(i)+o+en(s)+a+en(u)+c+en(d)+h+en(p)+f+en(g)+m:lo}function Xu(e,t,n){return ec(e,"",t,"",n),Xu}function ec(e,t,n,l,r){return Ms(Wl(),e,qu(t,n,l),r),ec}function tc(e,t,n,l,r,i,o){return Ms(Wl(),e,Wu(t,n,l,r,i),o),tc}function nc(e,t,n,l,r,i,o,s,a){return Ms(Wl(),e,Gu(t,n,l,r,i,o,s),a),nc}function lc(e,t,n,l,r,i,o,s,a,u,c){return Ms(Wl(),e,Ku(t,n,l,r,i,o,s,a,u),c),lc}function rc(e,t,n,l,r,i,o,s,a,u,c,d,h){return Ms(Wl(),e,Zu(t,n,l,r,i,o,s,a,u,c,d),h),rc}function ic(e,t,n,l,r,i,o,s,a,u,c,d,h,p,f){return Ms(Wl(),e,Qu(t,n,l,r,i,o,s,a,u,c,d,h,p),f),ic}function oc(e,t,n,l,r,i,o,s,a,u,c,d,h,p,f,g,m){return Ms(Wl(),e,Yu(t,n,l,r,i,o,s,a,u,c,d,h,p,f,g),m),oc}function sc(e,t,n,l,r,i,o,s,a,u,c,d,h,p,f,g,m,v,y){return Ms(Wl(),e,Ju(t,n,l,r,i,o,s,a,u,c,d,h,p,f,g,m,v),y),sc}function ac(e,t,n){return Ms(Wl(),e,$u(t),n),ac}function uc(e){const t=fl();ll(t,t[dn],Pl(),e),Gl(e)}function cc(e,t){const n=fl(),l=ya(t,n[Sn]),r=Cs(e,3,l,null,null);Tl(!1),Aa(l,r,n)}function dc(e,t){if(t!==lo){const n=fl(),l=Vn(e,n),r=n[Sn];Xl(r)?r.setValue(l,en(t)):l.textContent=en(t)}}function hc(e,t){const n=tr(e);if(!n)return;const l=n.native,r=n.lView,i=function(e,t){if(!(t=t||tr(l)))return null;const{lView:n,nodeIndex:r}=t,i=fr(r,n);return br(i)||Cr(i)}(0,n),o=Tr(r);yr(i,o,l,t,0,e),Zs(o,2)}function pc(e){const t=tr(e);if(!t)return[];const n=fr(t.nodeIndex,t.lView),l=n?br(n):null;return l?function(e){const t=[],n=e[0];for(let l=2;l<n;l+=2){const n=e[l];n&&t.push(n)}for(let l=n;l<e.length;l++)t.push(e[l]);return t}(l):[]}function fc(e){const t=Sc(e);return void 0===t.component&&(t.component=function(e,n){const l=n[dn].data[t.nodeIndex];return 1&l.flags?n[l.directiveStart]:null}(0,t.lView)),t.component}function gc(e){return Sc(e).lView[bn]}function mc(e){let t,n=Cc(e).lView;for(;null===n[cn]&&(t=kr(n));)n=t;return 512&n[hn]?null:n[bn]}function vc(e){return[...Tr(e).components]}function yc(e){const t=Cc(e);return new Kr(t.lView[dn].data[t.nodeIndex],t.lView)}function bc(e){const t=Cc(e);return void 0===t.directives&&(t.directives=ar(t.nodeIndex,t.lView,!1)),t.directives||[]}function Cc(e,t=!0){const n=tr(e);if(!n&&t)throw new Error("Invalid ng target");return n}function wc(e){return tr(e).native}function Sc(e){if(!(e instanceof Node))throw new Error("Expecting instance of DOM Node");return Cc(e)}function _c(e){return"boolean"==typeof e.useCapture}function Ic(e){const t=Sc(e).lView,n=t[yn],l=t[dn].cleanup,r=[];if(l&&n)for(let i=0;i<l.length;){const o=l[i++],s=l[i++];if("string"==typeof o){const a=o,u=Mn(t[s]),c=n[l[i++]],d=l[i++],h="boolean"==typeof d?d:!(d>=0)&&null;e==u&&r.push({element:e,name:a,callback:c,useCapture:h})}}return r.sort(Ec),r}function Ec(e,t){return e.name==t.name?0:e.name<t.name?-1:1}const Dc="ng";let xc=!1;function kc(){xc||(xc=!0,Ac("getComponent",fc),Ac("getContext",gc),Ac("getListeners",Ic),Ac("getViewComponent",mc),Ac("getHostElement",wc),Ac("getInjector",yc),Ac("getRootComponents",vc),Ac("getDirectives",bc),Ac("getPlayers",pc),Ac("markDirty",ha))}function Ac(e,t){if(V){let n=V[Dc];n||(n=V[Dc]={}),n[e]=t}}function Tc(e,t={}){const n=t.rendererFactory||er,l=t.sanitizer||null,r=Zt(e);r.type!=e&&(r.type=e);const i=Rs(n,t.host||r.selectors[0][0]),o=r.onPush?576:528,s=Nc(t.scheduler,t.playerHandler),a=n.createRenderer(i,r),u=bs(null,Ts(-1,null,1,0,null,null,null,null),s,o,null,null,n,a,void 0,t.injector||null),c=Ul(u,null);let d;try{n.begin&&n.begin();const e=Rc(i,r,u,n,a,l);d=Oc(e,r,u,s,t.hostFeatures||null),Gs(u,e),ms(u),u[hn]&=-5,Zn(u),ms(u)}finally{$l(c),n.end&&n.end()}return d}function Rc(e,t,n,l,r,i){vl=!1,ml=null,ol=0,ul=!0;const o=n[dn],s=Cs(0,3,e,null,null),a=bs(n,As(t.template,t.consts,t.vars,t.directiveDefs,t.pipeDefs,t.viewQuery,t.schemas),null,t.onPush?64:16,n[An],s,l,r,i);return o.firstTemplatePass&&(Br(Mr(s,n),n,t.type),s.flags=1,Us(s,n.length,1),js(s)),n[An]=a}function Oc(e,t,n,l,r){const i=n[dn],o=function(e,t,n){const l=Dl();e.firstTemplatePass&&(n.providersResolver&&n.providersResolver(n),Fs(e,l,1),zs(e,t,n,n.factory));const r=qr(e.data,t,t.length-1,l);return Bs(t,l,r),r}(i,n,t);l.components.push(o),e[bn]=o,r&&r.forEach(e=>e(o,t)),t.contentQueries&&t.contentQueries(1,o,n.length-1);const s=Dl();if(i.firstTemplatePass&&t.hostBindings&&(Sl(s.index-An),Ls(t,i.expandoInstructions,o,s,i.firstTemplatePass),s.onElementCreationFns&&ua(s),Sl(null)),s.stylingTemplate){const t=e[cn];co(t,s.stylingTemplate,e[Sn]),ho(t,s.stylingTemplate,e[Sn])}return o}function Nc(e,t){return{components:[],scheduler:e||nn,clean:na,playerHandler:t||null,flags:0}}function Pc(e,t){const n=Gn(e)[dn],l=n.data.length-1;tl(l,t,n,-1,-1,-1),nl(n,{directiveStart:l,directiveEnd:l+1})}function Mc(e){return Tr(e).clean}class Lc{constructor(e,t,n){this.previousValue=e,this.currentValue=t,this.firstChange=n}isFirstChange(){return this.firstChange}}function Fc(){return Vc.ngInherit=!0,Vc}function Vc(e){e.type.prototype.ngOnChanges&&(e.setInput=Bc,e.onChanges=function(){const e=Hc(this),t=e&&e.current;if(t){const n=e.previous;if(n===Tt)e.previous=t;else for(let e in t)n[e]=t[e];e.current=null,this.ngOnChanges(t)}})}function Bc(e,t,n,l){const r=Hc(e)||function(e,t){return e[jc]={previous:Tt,current:null}}(e),i=r.current||(r.current={}),o=r.previous,s=this.declaredInputs[n],a=o[s];i[s]=new Lc(a&&a.currentValue,t,o===Tt),e[l]=t}const jc="__ngSimpleChanges__";function Hc(e){return e[jc]||null}function Uc(e){let t=Object.getPrototypeOf(e.type.prototype).constructor;for(;t;){let n=void 0;if($n(e))n=t.ngComponentDef||t.ngDirectiveDef;else{if(t.ngComponentDef)throw new Error("Directives cannot inherit Components");n=t.ngDirectiveDef}const l=t.ngBaseDef;if(l||n){const t=e;t.inputs=zc(e.inputs),t.declaredInputs=zc(e.declaredInputs),t.outputs=zc(e.outputs)}if(l){const t=l.viewQuery,n=l.contentQueries;t&&$c(e,t),n&&qc(e,n),E(e.inputs,l.inputs),E(e.declaredInputs,l.declaredInputs),E(e.outputs,l.outputs)}if(n){const t=e.hostBindings,l=n.hostBindings;l&&(e.hostBindings=t?(e,n,r)=>{Il(1);try{l(e,n,r)}finally{Il(-1)}t(e,n,r)}:l);const r=n.viewQuery,i=n.contentQueries;r&&$c(e,r),i&&qc(e,i),E(e.inputs,n.inputs),E(e.declaredInputs,n.declaredInputs),E(e.outputs,n.outputs),e.afterContentChecked=e.afterContentChecked||n.afterContentChecked,e.afterContentInit=e.afterContentInit||n.afterContentInit,e.afterViewChecked=e.afterViewChecked||n.afterViewChecked,e.afterViewInit=e.afterViewInit||n.afterViewInit,e.doCheck=e.doCheck||n.doCheck,e.onDestroy=e.onDestroy||n.onDestroy,e.onInit=e.onInit||n.onInit;const o=n.features;if(o)for(const n of o)n&&n.ngInherit&&n(e)}else{const n=t.prototype;n&&(e.afterContentChecked=e.afterContentChecked||n.ngAfterContentChecked,e.afterContentInit=e.afterContentInit||n.ngAfterContentInit,e.afterViewChecked=e.afterViewChecked||n.ngAfterViewChecked,e.afterViewInit=e.afterViewInit||n.ngAfterViewInit,e.doCheck=e.doCheck||n.ngDoCheck,e.onDestroy=e.onDestroy||n.ngOnDestroy,e.onInit=e.onInit||n.ngOnInit,n.ngOnChanges&&Fc()(e))}t=Object.getPrototypeOf(t)}}function zc(e){return e===Tt?{}:e===Rt?[]:e}function $c(e,t){const n=e.viewQuery;e.viewQuery=n?(e,l)=>{t(e,l),n(e,l)}:t}function qc(e,t){const n=e.contentQueries;e.contentQueries=n?(e,l,r)=>{t(e,l,r),n(e,l,r)}:t}const Wc=new we("The presence of this token marks an injector as being the root injector."),Gc={},Kc={},Zc=[];let Qc=void 0;function Yc(){return void 0===Qc&&(Qc=new De),Qc}function Jc(e,t=null,n=null,l){return t=t||Yc(),new Xc(e,n,t,l)}class Xc{constructor(e,t,n,l=null){this.parent=n,this.records=new Map,this.injectorDefTypes=new Set,this.onDestroy=new Set,this._destroyed=!1;const r=[];ld([e],e=>this.processInjectorType(e,[],r)),t&&ld(t,n=>this.processProvider(n,e,t)),this.records.set(Ee,nd(void 0,this)),this.isRootInjector=this.records.has(Wc),this.injectorDefTypes.forEach(e=>this.get(e)),this.source=l||(e instanceof Array?null:N(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=xe.THROW_IF_NOT_FOUND,n=_.Default){this.assertNotDestroyed();const l=U(this);try{if(!(n&_.SkipSelf)){let t=this.records.get(e);if(void 0===t){const n=("function"==typeof(r=e)||"object"==typeof r&&r instanceof we)&&A(e);n&&this.injectableDefInScope(n)&&(t=nd(ed(e),Gc),this.records.set(e,t))}if(void 0!==t)return this.hydrate(e,t)}return(n&_.Self?Yc():this.parent).get(e,n&_.Optional?null:t)}catch(i){if("NullInjectorError"===i.name){if((i[Pe]=i[Pe]||[]).unshift(N(e)),l)throw i;return Be(i,e,"R3InjectorError",this.source)}throw i}finally{U(l)}var r}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,n){if(!(e=L(e)))return;let l=T(e);const r=null==l&&e.ngModule||void 0,i=void 0===r?e:r,o=-1!==n.indexOf(i),s=void 0!==r&&e.providers||Zc;if(void 0!==r&&(l=T(r)),null==l)return;if(this.injectorDefTypes.add(i),this.records.set(i,nd(l.factory,Gc)),null!=l.imports&&!o){n.push(i);try{ld(l.imports,e=>this.processInjectorType(e,t,n))}finally{}}const a=l.providers;if(null!=a&&!o){const t=e;ld(a,e=>this.processProvider(e,t,a))}const u=e.ngModule;ld(s,e=>this.processProvider(e,u,s))}processProvider(e,t,n){let l=id(e=L(e))?e:L(e&&e.provide);const r=function(e,t,n){let l=td(e,t,n);return rd(e)?nd(void 0,e.useValue):nd(l,Gc)}(e,t,n);if(id(e)||!0!==e.multi){const e=this.records.get(l);if(e&&void 0!==e.multi)throw new Error(`Mixed multi-provider for ${N(l)}`)}else{let t=this.records.get(l);if(t){if(void 0===t.multi)throw new Error(`Mixed multi-provider for ${l}.`)}else(t=nd(void 0,Gc,!0)).factory=(()=>K(t.multi)),this.records.set(l,t);l=e,t.multi.push(e)}this.records.set(l,r)}hydrate(e,t){if(t.value===Kc)throw new Error(`Cannot instantiate cyclic dependency! ${N(e)}`);var n;return t.value===Gc&&(t.value=Kc,t.value=t.factory()),"object"==typeof t.value&&t.value&&null!==(n=t.value)&&"object"==typeof n&&"function"==typeof n.ngOnDestroy&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){return!!e.providedIn&&("string"==typeof e.providedIn?"any"===e.providedIn||"root"===e.providedIn&&this.isRootInjector:this.injectorDefTypes.has(e.providedIn))}}function ed(e){const t=A(e);if(null===t){const t=T(e);if(null!==t)return t.factory;if(e instanceof we)throw new Error(`Token ${N(e)} is missing an ngInjectableDef definition.`);if(e instanceof Function){const t=e.length;if(t>0){const n=new Array(t).fill("?");throw new Error(`Can't resolve all parameters for ${N(e)}: (${n.join(", ")}).`)}return()=>new e}throw new Error("unreachable")}return t.factory}function td(e,t,n){let l=void 0;if(id(e))return ed(L(e));if(rd(e))l=(()=>L(e.useValue));else if((r=e)&&r.useExisting)l=(()=>q(L(e.useExisting)));else if(e&&e.useFactory)l=(()=>e.useFactory(...K(e.deps||[])));else{const r=L(e&&(e.useClass||e.provide));if(!r){let l="";throw t&&n&&(l=` - only instances of Provider and Type are allowed, got: [${n.map(t=>t==e?"?"+e+"?":"...").join(", ")}]`),new Error(`Invalid provider for the NgModule '${N(t)}'`+l)}if(!e.deps)return ed(r);l=(()=>new r(...K(e.deps)))}var r;return l}function nd(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function ld(e,t){e.forEach(e=>Array.isArray(e)?ld(e,t):t(e))}function rd(e){return null!==e&&"object"==typeof e&&Oe in e}function id(e){return"function"==typeof e}function od(e,t,n,l,r){if(e=L(e),Array.isArray(e))for(let i=0;i<e.length;i++)od(e[i],t,n,l,r);else{const i=fl();let o=id(e)?e:L(e.provide),s=td(e);const a=Dl(),u=65535&a.providerIndexes,c=a.directiveStart,d=a.providerIndexes>>16;if(e.useClass||id(e)){const n=(e.useClass||e).prototype.ngOnDestroy;if(n){const e=i[dn];(e.destroyHooks||(e.destroyHooks=[])).push(t.length,n)}}if(id(e)||!e.multi){const e=new el(s,r,Ua),l=ad(o,t,r?u:u+d,c);-1==l?(Br(Mr(a,i),i,o),t.push(o),a.directiveStart++,a.directiveEnd++,r&&(a.providerIndexes+=65536),n.push(e),i.push(e)):(n[l]=e,i[l]=e)}else{const e=ad(o,t,u+d,c),h=ad(o,t,u,u+d),p=e>=0&&n[e],f=h>=0&&n[h];if(r&&!f||!r&&!p){Br(Mr(a,i),i,o);const e=function(e,t,n,l,r){const i=new el(e,n,Ua);return i.multi=[],i.index=t,i.componentProviders=0,sd(i,r,l&&!n),i}(r?cd:ud,n.length,r,l,s);!r&&f&&(n[h].providerFactory=e),t.push(o),a.directiveStart++,a.directiveEnd++,r&&(a.providerIndexes+=65536),n.push(e),i.push(e)}else sd(n[r?h:e],s,!r&&l);!r&&l&&f&&n[h].componentProviders++}}}function sd(e,t,n){e.multi.push(t),n&&e.componentProviders++}function ad(e,t,n,l){for(let r=n;r<l;r++)if(t[r]===e)return r;return-1}function ud(e,t,n,l){return dd(this.multi,[])}function cd(e,t,n,l){const r=this.multi;let i;if(this.providerFactory){const e=this.providerFactory.componentProviders,o=qr(t,n,this.providerFactory.index,l);dd(r,i=o.slice(0,e));for(let t=e;t<o.length;t++)i.push(o[t])}else dd(r,i=[]);return i}function dd(e,t){for(let n=0;n<e.length;n++)t.push((0,e[n])());return t}function hd(e,t=[]){return n=>{n.providersResolver=((n,l)=>(function(e,t,n){const l=fl()[dn];if(l.firstTemplatePass){const r=$n(e);od(n,l.data,l.blueprint,r,!0),od(t,l.data,l.blueprint,r,!1)}})(n,l?l(e):e,t))}}class pd{}class fd{}function gd(e){const t=Error(`No component factory found for ${N(e)}. Did you add it to @NgModule.entryComponents?`);return t[md]=e,t}const md="ngComponent";class vd{resolveComponentFactory(e){throw gd(e)}}const yd=(()=>{class e{}return e.NULL=new vd,e})();class bd{constructor(e,t,n){this._parent=t,this._ngModule=n,this._factories=new Map;for(let l=0;l<e.length;l++){const t=e[l];this._factories.set(t.componentType,t)}}resolveComponentFactory(e){let t=this._factories.get(e);if(!t&&this._parent&&(t=this._parent.resolveComponentFactory(e)),!t)throw gd(e);return new Cd(t,this._ngModule)}}class Cd extends fd{constructor(e,t){super(),this.factory=e,this.ngModule=t,this.selector=e.selector,this.componentType=e.componentType,this.ngContentSelectors=e.ngContentSelectors,this.inputs=e.inputs,this.outputs=e.outputs}create(e,t,n,l){return this.factory.create(e,t,n,l||this.ngModule)}}class wd{}class Sd{}class _d{constructor(e,t,n){this._context=t,this._componentIndex=n,this._appRef=null,this._viewContainerRef=null,this._tViewNode=null,this._lView=e}get rootNodes(){return null==this._lView[cn]?function e(t,n,l){let r=n.child;for(;r;){const n=Bn(r,t);if(n&&l.push(n),4===r.type)e(t,r,l);else if(1===r.type){const e=Ar(t),n=e[mn],i=kr(e);let o=n.projection[r.projection];for(;o&&i;)l.push(Bn(o,i)),o=o.next}r=r.next}return l}(this._lView,this._lView[mn],[]):[]}get context(){return this._context?this._context:this._lookUpContext()}get destroyed(){return 256==(256&this._lView[hn])}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._viewContainerRef){const e=this._viewContainerRef.indexOf(this);e>-1&&this._viewContainerRef.detach(e),this._viewContainerRef=null}_a(this._lView)}onDestroy(e){var t,n;n=e,ra(t=this._lView).push(n),t[dn].firstTemplatePass&&ia(t).push(t[yn].length-1,null)}markForCheck(){Ks(this._lView)}detach(){this._lView[hn]&=-129}reattach(){this._lView[hn]|=128}detectChanges(){Ys(this._lView,this.context)}checkNoChanges(){!function(e,t){Ml(!0);try{Ys(e,t)}finally{Ml(!1)}}(this._lView,this.context)}attachToViewContainerRef(e){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=e}detachFromAppRef(){var e;this._appRef=null,ma(e=this._lView,1,e[Sn],null)}attachToAppRef(e){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}_lookUpContext(){return this._context=kr(this._lView)[this._componentIndex]}}class Id extends _d{constructor(e){super(e,null,-1),this._view=e}detectChanges(){Js(this._view)}checkNoChanges(){!function(e){Ml(!0);try{Js(e)}finally{Ml(!1)}}(this._view)}get context(){return null}}let Ed,Dd,xd;function kd(e,t,n){return Ed||(Ed=class extends e{}),new Ed(Bn(t,n))}function Ad(e,t,n,l){if(Dd||(Dd=class extends e{constructor(e,t,n,l,r){super(),this._declarationParentView=e,this.elementRef=t,this._tView=n,this._hostLContainer=l,this._injectorIndex=r}createEmbeddedView(e,t,n){const l=this._declarationParentView[gn];l&&null==this._hostLContainer[gn]&&(this._hostLContainer[gn]=l.container());const r=function(e,t,n,l,r){const i=Al(),o=Dl();Tl(!0),xl(null);const s=bs(n,e,t,16,null,null);return s[xn]=n,l&&(s[gn]=l.createView()),ws(e,null,-1,s),e.firstTemplatePass&&(e.node.injectorIndex=r),Tl(i),xl(o),s}(this._tView,e,this._declarationParentView,this._hostLContainer[gn],this._injectorIndex);t&&Ca(r,t,n),Ss(r,this._tView,e);const i=new _d(r,e,-1);return i._tViewNode=r[mn],i}}),0===n.type){const e=l[n.index];return new Dd(l,kd(t,n,l),n.tViews,e,n.injectorIndex)}return null}function Td(e,t,n){if(zn(e)){const l=e.directiveStart,r=Un(e.index,t);return new _d(r,n,l)}if(3===e.type||0===e.type||4===e.type){const e=Ar(t);return new _d(e,e[bn],-1)}return null}function Rd(...e){}const Od=(()=>{class e{constructor(e){this.nativeElement=e}}return e.__NG_ELEMENT_ID__=(()=>Pd(e)),e})(),Nd=function(e){return kd(e,Dl(),fl())},Pd=Rd;class Md{constructor(e,t,n,l,r,i){this.id=e,this.templateUrl=t,this.slotCount=n,this.encapsulation=l,this.styles=r,this.animations=i}}class Ld{}class Fd{}class Vd{}class Bd{}const jd=function(){var e={Important:1,DashCase:2};return e[e.Important]="Important",e[e.DashCase]="DashCase",e}(),Hd=(()=>{class e{}return e.__NG_ELEMENT_ID__=(()=>zd()),e})(),Ud=function(){return function(e){const t=fl()[Sn];if(Xl(t))return t;throw new Error("Cannot inject Renderer2 when the application uses Renderer3!")}()},zd=Rd;class $d{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const qd=new $d("8.0.3");class Wd{constructor(){}supports(e){return Ou(e)}create(e){return new Kd(e)}}const Gd=(e,t)=>t;class Kd{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||Gd}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,n=this._removalsHead,l=0,r=null;for(;t||n;){const i=!n||t&&t.currentIndex<Jd(n,l,r)?t:n,o=Jd(i,l,r),s=i.currentIndex;if(i===n)l--,n=n._nextRemoved;else if(t=t._next,null==i.previousIndex)l++;else{r||(r=[]);const e=o-l,t=s-l;if(e!=t){for(let n=0;n<e;n++){const l=n<r.length?r[n]:r[n]=0,i=l+n;t<=i&&i<e&&(r[n]=l+1)}r[i.previousIndex]=t-e}}o!==s&&e(i,o,s)}}forEachPreviousItem(e){let t;for(t=this._previousItHead;null!==t;t=t._nextPrevious)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachMovedItem(e){let t;for(t=this._movesHead;null!==t;t=t._nextMoved)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}forEachIdentityChange(e){let t;for(t=this._identityChangesHead;null!==t;t=t._nextIdentityChange)e(t)}diff(e){if(null==e&&(e=[]),!Ou(e))throw new Error(`Error trying to diff '${N(e)}'. Only arrays and iterables are allowed`);return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t,n,l,r=this._itHead,i=!1;if(Array.isArray(e)){this.length=e.length;for(let t=0;t<this.length;t++)l=this._trackByFn(t,n=e[t]),null!==r&&Au(r.trackById,l)?(i&&(r=this._verifyReinsertion(r,n,l,t)),Au(r.item,n)||this._addIdentityChange(r,n)):(r=this._mismatch(r,n,l,t),i=!0),r=r._next}else t=0,function(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)t(e[n]);else{const n=e[ku()]();let l;for(;!(l=n.next()).done;)t(l.value)}}(e,e=>{l=this._trackByFn(t,e),null!==r&&Au(r.trackById,l)?(i&&(r=this._verifyReinsertion(r,e,l,t)),Au(r.item,e)||this._addIdentityChange(r,e)):(r=this._mismatch(r,e,l,t),i=!0),r=r._next,t++}),this.length=t;return this._truncate(r),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e,t;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=t)e.previousIndex=e.currentIndex,t=e._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,n,l){let r;return null===e?r=this._itTail:(r=e._prev,this._remove(e)),null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(n,l))?(Au(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,r,l)):null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Au(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,r,l)):e=this._addAfter(new Zd(t,n),r,l),e}_verifyReinsertion(e,t,n,l){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?e=this._reinsertAfter(r,e._prev,l):e.currentIndex!=l&&(e.currentIndex=l,this._addToMoves(e,l)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const l=e._prevRemoved,r=e._nextRemoved;return null===l?this._removalsHead=r:l._nextRemoved=r,null===r?this._removalsTail=l:r._prevRemoved=l,this._insertAfter(e,t,n),this._addToMoves(e,n),e}_moveAfter(e,t,n){return this._unlink(e),this._insertAfter(e,t,n),this._addToMoves(e,n),e}_addAfter(e,t,n){return this._insertAfter(e,t,n),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,n){const l=null===t?this._itHead:t._next;return e._next=l,e._prev=t,null===l?this._itTail=e:l._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new Yd),this._linkedRecords.put(e),e.currentIndex=n,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,n=e._next;return null===t?this._itHead=n:t._next=n,null===n?this._itTail=t:n._prev=t,e}_addToMoves(e,t){return e.previousIndex===t?e:(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e,e)}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new Yd),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class Zd{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Qd{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===t||t<=n.currentIndex)&&Au(n.trackById,e))return n;return null}remove(e){const t=e._prevDup,n=e._nextDup;return null===t?this._head=n:t._nextDup=n,null===n?this._tail=t:n._prevDup=t,null===this._head}}class Yd{constructor(){this.map=new Map}put(e){const t=e.trackById;let n=this.map.get(t);n||(n=new Qd,this.map.set(t,n)),n.add(e)}get(e,t){const n=this.map.get(e);return n?n.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Jd(e,t,n){const l=e.previousIndex;if(null===l)return l;let r=0;return n&&l<n.length&&(r=n[l]),l+t+r}class Xd{constructor(){}supports(e){return e instanceof Map||Nu(e)}create(){return new eh}}class eh{constructor(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}get isDirty(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead}forEachItem(e){let t;for(t=this._mapHead;null!==t;t=t._next)e(t)}forEachPreviousItem(e){let t;for(t=this._previousMapHead;null!==t;t=t._nextPrevious)e(t)}forEachChangedItem(e){let t;for(t=this._changesHead;null!==t;t=t._nextChanged)e(t)}forEachAddedItem(e){let t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)}forEachRemovedItem(e){let t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)}diff(e){if(e){if(!(e instanceof Map||Nu(e)))throw new Error(`Error trying to diff '${N(e)}'. Only maps and objects are allowed`)}else e=new Map;return this.check(e)?this:null}onDestroy(){}check(e){this._reset();let t=this._mapHead;if(this._appendAfter=null,this._forEach(e,(e,n)=>{if(t&&t.key===n)this._maybeAddToChanges(t,e),this._appendAfter=t,t=t._next;else{const l=this._getOrCreateRecordForKey(n,e);t=this._insertBeforeOrAppend(t,l)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let e=t;null!==e;e=e._nextRemoved)e===this._mapHead&&(this._mapHead=null),this._records.delete(e.key),e._nextRemoved=e._next,e.previousValue=e.currentValue,e.currentValue=null,e._prev=null,e._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const n=e._prev;return t._next=e,t._prev=n,e._prev=t,n&&(n._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const n=this._records.get(e);this._maybeAddToChanges(n,t);const l=n._prev,r=n._next;return l&&(l._next=r),r&&(r._prev=l),n._next=null,n._prev=null,n}const n=new th(e);return this._records.set(e,n),n.currentValue=t,this._addToAdditions(n),n}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Au(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(n=>t(e[n],n))}}class th{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}const nh=(()=>{class e{constructor(e){this.factories=e}static create(t,n){if(null!=n){const e=n.factories.slice();t=t.concat(e)}return new e(t)}static extend(t){return{provide:e,useFactory:n=>{if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return e.create(t,n)},deps:[[e,new C,new y]]}}find(e){const t=this.factories.find(t=>t.supports(e));if(null!=t)return t;throw new Error(`Cannot find a differ supporting object '${e}' of type '${n=e,n.name||typeof n}'`);var n}}return e.ngInjectableDef=D({providedIn:"root",factory:()=>new e([new Wd])}),e})(),lh=(()=>{class e{constructor(e){this.factories=e}static create(t,n){if(n){const e=n.factories.slice();t=t.concat(e)}return new e(t)}static extend(t){return{provide:e,useFactory:n=>{if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return e.create(t,n)},deps:[[e,new C,new y]]}}find(e){const t=this.factories.find(t=>t.supports(e));if(t)return t;throw new Error(`Cannot find a differ supporting object '${e}'`)}}return e.ngInjectableDef=D({providedIn:"root",factory:()=>new e([new Xd])}),e})(),rh=(()=>{class e{}return e.__NG_ELEMENT_ID__=(()=>oh()),e})(),ih=function(){return Td(Dl(),fl(),null)},oh=(...e)=>{},sh=[new Xd],ah=new nh([new Wd]),uh=new lh(sh),ch=(()=>{class e{}return e.__NG_ELEMENT_ID__=(()=>hh(e,Od)),e})(),dh=function(e,t){return Ad(e,t,Dl(),fl())},hh=Rd,ph=(()=>{class e{}return e.__NG_ELEMENT_ID__=(()=>gh(e,Od)),e})(),fh=function(e,t){return function(e,t,n,l){let r;xd||(xd=class extends e{constructor(e,t,n){super(),this._lContainer=e,this._hostTNode=t,this._hostView=n,this._viewRefs=[]}get element(){return kd(t,this._hostTNode,this._hostView)}get injector(){return new Kr(this._hostTNode,this._hostView)}get parentInjector(){const e=Vr(this._hostTNode,this._hostView),t=xr(e,this._hostView),n=function(e,t,n){if(n.parent&&-1!==n.parent.injectorIndex){const e=n.parent.injectorIndex;let t=n.parent;for(;null!=t.parent&&e==t.injectorIndex;)t=t.parent;return t}let l=Dr(e),r=t,i=t[mn];for(;l>1;)i=(r=r[xn])[mn],l--;return i}(e,this._hostView,this._hostTNode);return Ir(e)&&null!=n?new Kr(n,t):new Kr(null,this._hostView)}clear(){for(;this._lContainer[Nn].length;)this.remove(0)}get(e){return this._viewRefs[e]||null}get length(){return this._lContainer[Nn].length}createEmbeddedView(e,t,n){const l=this._adjustIndex(n),r=e.createEmbeddedView(t||{},this._lContainer,l);return r.attachToViewContainerRef(this),this._viewRefs.splice(l,0,r),r}createComponent(e,t,n,l,r){const i=n||this.parentInjector;!r&&null==e.ngModule&&i&&(r=i.get(wd,null));const o=e.create(i,l,void 0,r);return this.insert(o.hostView,t),o}insert(e,t){if(e.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");const n=e._lView,l=this._adjustIndex(t);return Kn(n)?this.move(e,l):(Ca(n,this._lContainer,l),ba(n,!0,Ta(l,this._lContainer[Nn],this._lContainer[On])),e.attachToViewContainerRef(this),this._viewRefs.splice(l,0,e),e)}move(e,t){if(e.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");const n=this.indexOf(e);return-1!==n&&this.detach(n),this.insert(e,t),e}indexOf(e){return this._viewRefs.indexOf(e)}remove(e){const t=this._adjustIndex(e,-1);Sa(this._lContainer,t),this._viewRefs.splice(t,1)}detach(e){const t=this._adjustIndex(e,-1),n=wa(this._lContainer,t);return n&&null!=this._viewRefs.splice(t,1)[0]?new _d(n,n[bn],-1):null}_adjustIndex(e,t=0){return null==e?this._lContainer[Nn].length+t:e}});const i=l[n.index];if(Fn(i))(r=i)[Rn]=-1;else{const e=l[Sn].createComment("");if(qn(l)){const t=l[Sn],r=Bn(n,l);Da(t,ka(t,r),e,function(e,t){return Xl(e)?e.nextSibling(t):t.nextSibling}(t,r))}else Aa(e,n,l);l[n.index]=r=qs(i,l,e,n,!0),Gs(l,r)}return new xd(r,n,l)}(e,t,Dl(),fl())},gh=Rd;function mh(e,t,n,l){let r=`ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '${t}'. Current value: '${n}'.`;return l&&(r+=" It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?"),function(e,t){const n=new Error(e);return vh(n,t),n}(r,e)}function vh(e,t){e[Ue]=t,e[$e]=t.logError.bind(t)}function yh(e){return new Error(`ViewDestroyedError: Attempt to use a destroyed view: ${e}`)}function bh(e,t,n){const l=e.state,r=1792&l;return r===t?(e.state=-1793&l|n,e.initIndex=-1,!0):r===n}function Ch(e,t,n){return(1792&e.state)===t&&e.initIndex<=n&&(e.initIndex=n+1,!0)}function wh(e,t){return e.nodes[t]}function Sh(e,t){return e.nodes[t]}function _h(e,t){return e.nodes[t]}function Ih(e,t){return e.nodes[t]}function Eh(e,t){return e.nodes[t]}class Dh{}const xh={setCurrentNode:void 0,createRootView:void 0,createEmbeddedView:void 0,createComponentView:void 0,createNgModuleRef:void 0,overrideProvider:void 0,overrideComponentView:void 0,clearOverrides:void 0,checkAndUpdateView:void 0,checkNoChangesView:void 0,destroyView:void 0,resolveDep:void 0,createDebugContext:void 0,handleEvent:void 0,updateDirectives:void 0,updateRenderer:void 0,dirtyParentQueries:void 0},kh=()=>{},Ah=new Map;function Th(e){let t=Ah.get(e);return t||(t=N(e)+"_"+Ah.size,Ah.set(e,t)),t}function Rh(e,t,n,l){if(Ru.isWrapped(l)){l=Ru.unwrap(l);const r=e.def.nodes[t].bindingIndex+n,i=Ru.unwrap(e.oldValues[r]);e.oldValues[r]=new Ru(i)}return l}const Oh="$$undefined",Nh="$$empty";function Ph(e){return{id:Oh,styles:e.styles,encapsulation:e.encapsulation,data:e.data}}let Mh=0;function Lh(e,t,n,l){return!(!(2&e.state)&&Au(e.oldValues[t.bindingIndex+n],l))}function Fh(e,t,n,l){return!!Lh(e,t,n,l)&&(e.oldValues[t.bindingIndex+n]=l,!0)}function Vh(e,t,n,l){const r=e.oldValues[t.bindingIndex+n];if(1&e.state||!Tu(r,l)){const i=t.bindings[n].name;throw mh(xh.createDebugContext(e,t.nodeIndex),`${i}: ${r}`,`${i}: ${l}`,0!=(1&e.state))}}function Bh(e){let t=e;for(;t;)2&t.def.flags&&(t.state|=8),t=t.viewContainerParent||t.parent}function jh(e,t){let n=e;for(;n&&n!==t;)n.state|=64,n=n.viewContainerParent||n.parent}function Hh(e,t,n,l){try{return Bh(33554432&e.def.nodes[t].flags?Sh(e,t).componentView:e),xh.handleEvent(e,t,n,l)}catch(r){e.root.errorHandler.handleError(r)}}function Uh(e){return e.parent?Sh(e.parent,e.parentNodeDef.nodeIndex):null}function zh(e){return e.parent?e.parentNodeDef.parent:null}function $h(e,t){switch(201347067&t.flags){case 1:return Sh(e,t.nodeIndex).renderElement;case 2:return wh(e,t.nodeIndex).renderText}}function qh(e){return!!e.parent&&!!(32768&e.parentNodeDef.flags)}function Wh(e){return!(!e.parent||32768&e.parentNodeDef.flags)}function Gh(e){return 1<<e%32}function Kh(e){const t={};let n=0;const l={};return e&&e.forEach(([e,r])=>{"number"==typeof e?(t[e]=r,n|=Gh(e)):l[e]=r}),{matchedQueries:t,references:l,matchedQueryIds:n}}function Zh(e,t){return e.map(e=>{let n,l;return Array.isArray(e)?[l,n]=e:(l=0,n=e),n&&("function"==typeof n||"object"==typeof n)&&t&&Object.defineProperty(n,Se,{value:t,configurable:!0}),{flags:l,token:n,tokenKey:Th(n)}})}function Qh(e,t,n){let l=n.renderParent;return l?0==(1&l.flags)||0==(33554432&l.flags)||l.element.componentRendererType&&l.element.componentRendererType.encapsulation===kt.Native?Sh(e,n.renderParent.nodeIndex).renderElement:void 0:t}const Yh=new WeakMap;function Jh(e){let t=Yh.get(e);return t||((t=e(()=>kh)).factory=e,Yh.set(e,t)),t}function Xh(e,t,n,l,r){3===t&&(n=e.renderer.parentNode($h(e,e.def.lastRenderRootNode))),ep(e,t,0,e.def.nodes.length-1,n,l,r)}function ep(e,t,n,l,r,i,o){for(let s=n;s<=l;s++){const n=e.def.nodes[s];11&n.flags&&np(e,n,t,r,i,o),s+=n.childCount}}function tp(e,t,n,l,r,i){let o=e;for(;o&&!qh(o);)o=o.parent;const s=o.parent,a=zh(o),u=a.nodeIndex+a.childCount;for(let c=a.nodeIndex+1;c<=u;c++){const e=s.def.nodes[c];e.ngContentIndex===t&&np(s,e,n,l,r,i),c+=e.childCount}if(!s.parent){const o=e.root.projectableNodes[t];if(o)for(let t=0;t<o.length;t++)lp(e,o[t],n,l,r,i)}}function np(e,t,n,l,r,i){if(8&t.flags)tp(e,t.ngContent.index,n,l,r,i);else{const o=$h(e,t);if(3===n&&33554432&t.flags&&48&t.bindingFlags?(16&t.bindingFlags&&lp(e,o,n,l,r,i),32&t.bindingFlags&&lp(Sh(e,t.nodeIndex).componentView,o,n,l,r,i)):lp(e,o,n,l,r,i),16777216&t.flags){const o=Sh(e,t.nodeIndex).viewContainer._embeddedViews;for(let e=0;e<o.length;e++)Xh(o[e],n,l,r,i)}1&t.flags&&!t.element.name&&ep(e,n,t.nodeIndex+1,t.nodeIndex+t.childCount,l,r,i)}}function lp(e,t,n,l,r,i){const o=e.renderer;switch(n){case 1:o.appendChild(l,t);break;case 2:o.insertBefore(l,t,r);break;case 3:o.removeChild(l,t);break;case 0:i.push(t)}}const rp=/^:([^:]+):(.+)$/;function ip(e){if(":"===e[0]){const t=e.match(rp);return[t[1],t[2]]}return["",e]}function op(e){let t=0;for(let n=0;n<e.length;n++)t|=e[n].flags;return t}function sp(e,t){let n="";for(let l=0;l<2*e;l+=2)n=n+t[l]+up(t[l+1]);return n+t[2*e]}function ap(e,t,n,l,r,i,o,s,a,u,c,d,h,p,f,g,m,v,y,b){switch(e){case 1:return t+up(n)+l;case 2:return t+up(n)+l+up(r)+i;case 3:return t+up(n)+l+up(r)+i+up(o)+s;case 4:return t+up(n)+l+up(r)+i+up(o)+s+up(a)+u;case 5:return t+up(n)+l+up(r)+i+up(o)+s+up(a)+u+up(c)+d;case 6:return t+up(n)+l+up(r)+i+up(o)+s+up(a)+u+up(c)+d+up(h)+p;case 7:return t+up(n)+l+up(r)+i+up(o)+s+up(a)+u+up(c)+d+up(h)+p+up(f)+g;case 8:return t+up(n)+l+up(r)+i+up(o)+s+up(a)+u+up(c)+d+up(h)+p+up(f)+g+up(m)+v;case 9:return t+up(n)+l+up(r)+i+up(o)+s+up(a)+u+up(c)+d+up(h)+p+up(f)+g+up(m)+v+up(y)+b;default:throw new Error("Does not support more than 9 expressions")}}function up(e){return null!=e?e.toString():""}const cp=[],dp={},hp=new Object,pp=Th(xe),fp=Th(Ee),gp=Th(wd);function mp(e,t,n,l){return n=L(n),{index:-1,deps:Zh(l,N(t)),flags:e,token:t,value:n}}function vp(e){const t={},n=[];let l=!1;for(let r=0;r<e.length;r++){const i=e[r];i.token===Wc&&!0===i.value&&(l=!0),1073741824&i.flags&&n.push(i.token),i.index=r,t[Th(i.token)]=i}return{factory:null,providersByKey:t,providers:e,modules:n,isRoot:l}}function yp(e,t,n=xe.THROW_IF_NOT_FOUND){const l=U(e);try{if(8&t.flags)return t.token;if(2&t.flags&&(n=null),1&t.flags)return e._parent.get(t.token,n);const o=t.tokenKey;switch(o){case pp:case fp:case gp:return e}const s=e._def.providersByKey[o];let a;if(s){let t=e._providers[s.index];return void 0===t&&(t=e._providers[s.index]=bp(e,s)),t===hp?void 0:t}if((a=A(t.token))&&(r=e,null!=(i=a).providedIn&&(function(e,t){return e._def.modules.indexOf(i.providedIn)>-1}(r)||"root"===i.providedIn&&r._def.isRoot))){const n=e._providers.length;return e._def.providers[n]=e._def.providersByKey[t.tokenKey]={flags:5120,value:a.factory,deps:[],index:n,token:t.token},e._providers[n]=hp,e._providers[n]=bp(e,e._def.providersByKey[t.tokenKey])}return 4&t.flags?n:e._parent.get(t.token,n)}finally{U(l)}var r,i}function bp(e,t){let n;switch(201347067&t.flags){case 512:n=function(e,t,n){const l=n.length;switch(l){case 0:return new t;case 1:return new t(yp(e,n[0]));case 2:return new t(yp(e,n[0]),yp(e,n[1]));case 3:return new t(yp(e,n[0]),yp(e,n[1]),yp(e,n[2]));default:const r=new Array(l);for(let t=0;t<l;t++)r[t]=yp(e,n[t]);return new t(...r)}}(e,t.value,t.deps);break;case 1024:n=function(e,t,n){const l=n.length;switch(l){case 0:return t();case 1:return t(yp(e,n[0]));case 2:return t(yp(e,n[0]),yp(e,n[1]));case 3:return t(yp(e,n[0]),yp(e,n[1]),yp(e,n[2]));default:const r=Array(l);for(let t=0;t<l;t++)r[t]=yp(e,n[t]);return t(...r)}}(e,t.value,t.deps);break;case 2048:n=yp(e,t.deps[0]);break;case 256:n=t.value}return n===hp||null===n||"object"!=typeof n||131072&t.flags||"function"!=typeof n.ngOnDestroy||(t.flags|=131072),void 0===n?hp:n}function Cp(e,t){const n=e.viewContainer._embeddedViews;if((null==t||t>=n.length)&&(t=n.length-1),t<0)return null;const l=n[t];return l.viewContainerParent=null,Ip(n,t),xh.dirtyParentQueries(l),Sp(l),l}function wp(e,t,n){const l=t?$h(t,t.def.lastRenderRootNode):e.renderElement,r=n.renderer.parentNode(l),i=n.renderer.nextSibling(l);Xh(n,2,r,i,void 0)}function Sp(e){Xh(e,3,null,null,void 0)}function _p(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function Ip(e,t){t>=e.length-1?e.pop():e.splice(t,1)}const Ep=new Object;function Dp(e,t,n,l,r,i){return new kp(e,t,n,l,r,i)}function xp(e){return e.viewDefFactory}class kp extends fd{constructor(e,t,n,l,r,i){super(),this.selector=e,this.componentType=t,this._inputs=l,this._outputs=r,this.ngContentSelectors=i,this.viewDefFactory=n}get inputs(){const e=[],t=this._inputs;for(let n in t)e.push({propName:n,templateName:t[n]});return e}get outputs(){const e=[];for(let t in this._outputs)e.push({propName:t,templateName:this._outputs[t]});return e}create(e,t,n,l){if(!l)throw new Error("ngModule should be provided");const r=Jh(this.viewDefFactory),i=r.nodes[0].element.componentProvider.nodeIndex,o=xh.createRootView(e,t||[],n,r,l,Ep),s=_h(o,i).instance;return n&&o.renderer.setAttribute(Sh(o,0).renderElement,"ng-version",qd.full),new Ap(o,new Np(o),s)}}class Ap extends pd{constructor(e,t,n){super(),this._view=e,this._viewRef=t,this._component=n,this._elDef=this._view.def.nodes[0],this.hostView=t,this.changeDetectorRef=t,this.instance=n}get location(){return new Od(Sh(this._view,this._elDef.nodeIndex).renderElement)}get injector(){return new Fp(this._view,this._elDef)}get componentType(){return this._component.constructor}destroy(){this._viewRef.destroy()}onDestroy(e){this._viewRef.onDestroy(e)}}function Tp(e,t,n){return new Rp(e,t,n)}class Rp{constructor(e,t,n){this._view=e,this._elDef=t,this._data=n,this._embeddedViews=[]}get element(){return new Od(this._data.renderElement)}get injector(){return new Fp(this._view,this._elDef)}get parentInjector(){let e=this._view,t=this._elDef.parent;for(;!t&&e;)t=zh(e),e=e.parent;return e?new Fp(e,t):new Fp(this._view,null)}clear(){for(let e=this._embeddedViews.length-1;e>=0;e--){const t=Cp(this._data,e);xh.destroyView(t)}}get(e){const t=this._embeddedViews[e];if(t){const e=new Np(t);return e.attachToViewContainerRef(this),e}return null}get length(){return this._embeddedViews.length}createEmbeddedView(e,t,n){const l=e.createEmbeddedView(t||{});return this.insert(l,n),l}createComponent(e,t,n,l,r){const i=n||this.parentInjector;r||e instanceof Cd||(r=i.get(wd));const o=e.create(i,l,void 0,r);return this.insert(o.hostView,t),o}insert(e,t){if(e.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");const n=e;return function(e,t,n,l){let r=t.viewContainer._embeddedViews;null==n&&(n=r.length),l.viewContainerParent=e,_p(r,n,l),function(e,t){const n=Uh(t);if(!n||n===e||16&t.state)return;t.state|=16;let l=n.template._projectedViews;l||(l=n.template._projectedViews=[]),l.push(t),function(e,n){if(4&n.flags)return;t.parent.def.nodeFlags|=4,n.flags|=4;let l=n.parent;for(;l;)l.childFlags|=4,l=l.parent}(0,t.parentNodeDef)}(t,l),xh.dirtyParentQueries(l),wp(t,n>0?r[n-1]:null,l)}(this._view,this._data,t,n._view),n.attachToViewContainerRef(this),e}move(e,t){if(e.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");const n=this._embeddedViews.indexOf(e._view);return function(e,t,l){const r=e.viewContainer._embeddedViews,i=r[n];Ip(r,n),null==l&&(l=r.length),_p(r,l,i),xh.dirtyParentQueries(i),Sp(i),wp(e,l>0?r[l-1]:null,i)}(this._data,0,t),e}indexOf(e){return this._embeddedViews.indexOf(e._view)}remove(e){const t=Cp(this._data,e);t&&xh.destroyView(t)}detach(e){const t=Cp(this._data,e);return t?new Np(t):null}}function Op(e){return new Np(e)}class Np{constructor(e){this._view=e,this._viewContainerRef=null,this._appRef=null}get rootNodes(){return function(e){const t=[];return Xh(e,0,void 0,void 0,t),t}(this._view)}get context(){return this._view.context}get destroyed(){return 0!=(128&this._view.state)}markForCheck(){Bh(this._view)}detach(){this._view.state&=-5}detectChanges(){const e=this._view.root.rendererFactory;e.begin&&e.begin();try{xh.checkAndUpdateView(this._view)}finally{e.end&&e.end()}}checkNoChanges(){xh.checkNoChangesView(this._view)}reattach(){this._view.state|=4}onDestroy(e){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(e)}destroy(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),xh.destroyView(this._view)}detachFromAppRef(){this._appRef=null,Sp(this._view),xh.dirtyParentQueries(this._view)}attachToAppRef(e){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}attachToViewContainerRef(e){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=e}}function Pp(e,t){return new Mp(e,t)}class Mp extends ch{constructor(e,t){super(),this._parentView=e,this._def=t}createEmbeddedView(e){return new Np(xh.createEmbeddedView(this._parentView,this._def,this._def.element.template,e))}get elementRef(){return new Od(Sh(this._parentView,this._def.nodeIndex).renderElement)}}function Lp(e,t){return new Fp(e,t)}class Fp{constructor(e,t){this.view=e,this.elDef=t}get(e,t=xe.THROW_IF_NOT_FOUND){return xh.resolveDep(this.view,this.elDef,!!this.elDef&&0!=(33554432&this.elDef.flags),{flags:0,token:e,tokenKey:Th(e)},t)}}function Vp(e,t){const n=e.def.nodes[t];if(1&n.flags){const t=Sh(e,n.nodeIndex);return n.element.template?t.template:t.renderElement}if(2&n.flags)return wh(e,n.nodeIndex).renderText;if(20240&n.flags)return _h(e,n.nodeIndex).instance;throw new Error(`Illegal state: read nodeValue for node index ${t}`)}function Bp(e){return new jp(e.renderer)}class jp{constructor(e){this.delegate=e}selectRootElement(e){return this.delegate.selectRootElement(e)}createElement(e,t){const[n,l]=ip(t),r=this.delegate.createElement(l,n);return e&&this.delegate.appendChild(e,r),r}createViewRoot(e){return e}createTemplateAnchor(e){const t=this.delegate.createComment("");return e&&this.delegate.appendChild(e,t),t}createText(e,t){const n=this.delegate.createText(t);return e&&this.delegate.appendChild(e,n),n}projectNodes(e,t){for(let n=0;n<t.length;n++)this.delegate.appendChild(e,t[n])}attachViewAfter(e,t){const n=this.delegate.parentNode(e),l=this.delegate.nextSibling(e);for(let r=0;r<t.length;r++)this.delegate.insertBefore(n,t[r],l)}detachView(e){for(let t=0;t<e.length;t++){const n=e[t],l=this.delegate.parentNode(n);this.delegate.removeChild(l,n)}}destroyView(e,t){for(let n=0;n<t.length;n++)this.delegate.destroyNode(t[n])}listen(e,t,n){return this.delegate.listen(e,t,n)}listenGlobal(e,t,n){return this.delegate.listen(e,t,n)}setElementProperty(e,t,n){this.delegate.setProperty(e,t,n)}setElementAttribute(e,t,n){const[l,r]=ip(t);null!=n?this.delegate.setAttribute(e,r,n,l):this.delegate.removeAttribute(e,r,l)}setBindingDebugInfo(e,t,n){}setElementClass(e,t,n){n?this.delegate.addClass(e,t):this.delegate.removeClass(e,t)}setElementStyle(e,t,n){null!=n?this.delegate.setStyle(e,t,n):this.delegate.removeStyle(e,t)}invokeElementMethod(e,t,n){e[t].apply(e,n)}setText(e,t){this.delegate.setValue(e,t)}animate(){throw new Error("Renderer.animate is no longer supported!")}}function Hp(e,t,n,l){return new Up(e,t,n,l)}class Up{constructor(e,t,n,l){this._moduleType=e,this._parent=t,this._bootstrapComponents=n,this._def=l,this._destroyListeners=[],this._destroyed=!1,this.injector=this,function(e){const t=e._def,n=e._providers=new Array(t.providers.length);for(let l=0;l<t.providers.length;l++){const r=t.providers[l];4096&r.flags||void 0===n[l]&&(n[l]=bp(e,r))}}(this)}get(e,t=xe.THROW_IF_NOT_FOUND,n=_.Default){let l=0;return n&_.SkipSelf?l|=1:n&_.Self&&(l|=4),yp(this,{token:e,tokenKey:Th(e),flags:l},t)}get instance(){return this.get(this._moduleType)}get componentFactoryResolver(){return this.get(yd)}destroy(){if(this._destroyed)throw new Error(`The ng module ${N(this.instance.constructor)} has already been destroyed.`);this._destroyed=!0,function(e,t){const n=e._def,l=new Set;for(let r=0;r<n.providers.length;r++)if(131072&n.providers[r].flags){const t=e._providers[r];if(t&&t!==hp){const e=t.ngOnDestroy;"function"!=typeof e||l.has(t)||(e.apply(t),l.add(t))}}}(this),this._destroyListeners.forEach(e=>e())}onDestroy(e){this._destroyListeners.push(e)}}const zp=Th(Fd),$p=Th(Hd),qp=Th(Od),Wp=Th(ph),Gp=Th(ch),Kp=Th(rh),Zp=Th(xe),Qp=Th(Ee);function Yp(e,t,n,l,r,i,o,s){const a=[];if(o)for(let c in o){const[e,t]=o[c];a[e]={flags:8,name:c,nonMinifiedName:t,ns:null,securityContext:null,suffix:null}}const u=[];if(s)for(let c in s)u.push({type:1,propName:c,target:null,eventName:s[c]});return ef(e,t|=16384,n,l,r,r,i,a,u)}function Jp(e,t,n){return ef(-1,e|=16,null,0,t,t,n)}function Xp(e,t,n,l,r){return ef(-1,e,t,0,n,l,r)}function ef(e,t,n,l,r,i,o,s,a){const{matchedQueries:u,references:c,matchedQueryIds:d}=Kh(n);a||(a=[]),s||(s=[]),i=L(i);const h=Zh(o,N(r));return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:e,flags:t,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:u,matchedQueryIds:d,references:c,ngContentIndex:-1,childCount:l,bindings:s,bindingFlags:op(s),outputs:a,element:null,provider:{token:r,value:i,deps:h},text:null,query:null,ngContent:null}}function tf(e,t){return of(e,t)}function nf(e,t){let n=e;for(;n.parent&&!qh(n);)n=n.parent;return sf(n.parent,zh(n),!0,t.provider.value,t.provider.deps)}function lf(e,t){const n=sf(e,t.parent,(32768&t.flags)>0,t.provider.value,t.provider.deps);if(t.outputs.length)for(let l=0;l<t.outputs.length;l++){const r=t.outputs[l],i=n[r.propName];if(!vu(i))throw new Error(`@Output ${r.propName} not initialized in '${n.constructor.name}'.`);{const n=i.subscribe(rf(e,t.parent.nodeIndex,r.eventName));e.disposables[t.outputIndex+l]=n.unsubscribe.bind(n)}}return n}function rf(e,t,n){return l=>Hh(e,t,n,l)}function of(e,t){const n=(8192&t.flags)>0,l=t.provider;switch(201347067&t.flags){case 512:return sf(e,t.parent,n,l.value,l.deps);case 1024:return function(e,t,n,l,r){const i=r.length;switch(i){case 0:return l();case 1:return l(uf(e,t,n,r[0]));case 2:return l(uf(e,t,n,r[0]),uf(e,t,n,r[1]));case 3:return l(uf(e,t,n,r[0]),uf(e,t,n,r[1]),uf(e,t,n,r[2]));default:const o=Array(i);for(let l=0;l<i;l++)o[l]=uf(e,t,n,r[l]);return l(...o)}}(e,t.parent,n,l.value,l.deps);case 2048:return uf(e,t.parent,n,l.deps[0]);case 256:return l.value}}function sf(e,t,n,l,r){const i=r.length;switch(i){case 0:return new l;case 1:return new l(uf(e,t,n,r[0]));case 2:return new l(uf(e,t,n,r[0]),uf(e,t,n,r[1]));case 3:return new l(uf(e,t,n,r[0]),uf(e,t,n,r[1]),uf(e,t,n,r[2]));default:const o=new Array(i);for(let l=0;l<i;l++)o[l]=uf(e,t,n,r[l]);return new l(...o)}}const af={};function uf(e,t,n,l,r=xe.THROW_IF_NOT_FOUND){if(8&l.flags)return l.token;const i=e;2&l.flags&&(r=null);const o=l.tokenKey;o===Kp&&(n=!(!t||!t.element.componentView)),t&&1&l.flags&&(n=!1,t=t.parent);let s=e;for(;s;){if(t)switch(o){case zp:return Bp(cf(s,t,n));case $p:return cf(s,t,n).renderer;case qp:return new Od(Sh(s,t.nodeIndex).renderElement);case Wp:return Sh(s,t.nodeIndex).viewContainer;case Gp:if(t.element.template)return Sh(s,t.nodeIndex).template;break;case Kp:return Op(cf(s,t,n));case Zp:case Qp:return Lp(s,t);default:const e=(n?t.element.allProviders:t.element.publicProviders)[o];if(e){let t=_h(s,e.nodeIndex);return t||(t={instance:of(s,e)},s.nodes[e.nodeIndex]=t),t.instance}}n=qh(s),t=zh(s),s=s.parent,4&l.flags&&(s=null)}const a=i.root.injector.get(l.token,af);return a!==af||r===af?a:i.root.ngModule.injector.get(l.token,r)}function cf(e,t,n){let l;if(n)l=Sh(e,t.nodeIndex).componentView;else for(l=e;l.parent&&!qh(l);)l=l.parent;return l}function df(e,t,n,l,r,i){if(32768&n.flags){const t=Sh(e,n.parent.nodeIndex).componentView;2&t.def.flags&&(t.state|=8)}if(t.instance[n.bindings[l].name]=r,524288&n.flags){i=i||{};const t=Ru.unwrap(e.oldValues[n.bindingIndex+l]);i[n.bindings[l].nonMinifiedName]=new Lc(t,r,0!=(2&e.state))}return e.oldValues[n.bindingIndex+l]=r,i}function hf(e,t){if(!(e.def.nodeFlags&t))return;const n=e.def.nodes;let l=0;for(let r=0;r<n.length;r++){const i=n[r];let o=i.parent;for(!o&&i.flags&t&&ff(e,r,i.flags&t,l++),0==(i.childFlags&t)&&(r+=i.childCount);o&&1&o.flags&&r===o.nodeIndex+o.childCount;)o.directChildFlags&t&&(l=pf(e,o,t,l)),o=o.parent}}function pf(e,t,n,l){for(let r=t.nodeIndex+1;r<=t.nodeIndex+t.childCount;r++){const t=e.def.nodes[r];t.flags&n&&ff(e,r,t.flags&n,l++),r+=t.childCount}return l}function ff(e,t,n,l){const r=_h(e,t);if(!r)return;const i=r.instance;i&&(xh.setCurrentNode(e,t),1048576&n&&Ch(e,512,l)&&i.ngAfterContentInit(),2097152&n&&i.ngAfterContentChecked(),4194304&n&&Ch(e,768,l)&&i.ngAfterViewInit(),8388608&n&&i.ngAfterViewChecked(),131072&n&&i.ngOnDestroy())}function gf(e){const t=[];for(let n in e)e.hasOwnProperty(n)&&t.push({propName:e[n],templateName:n});return t}const mf=new we("ROOT_CONTEXT_TOKEN",{providedIn:"root",factory:()=>Nc(q(vf))}),vf=new we("SCHEDULER_TOKEN",{providedIn:"root",factory:()=>nn});class yf extends fd{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=e.selectors[0][0],this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return gf(this.componentDef.inputs)}get outputs(){return gf(this.componentDef.outputs)}create(e,t,n,l){const r=void 0===n,i=(l=l||this.ngModule)?function(e,t){return{get:(n,l,r)=>{const i=e.get(n,af,r);return i!==af||l===af?i:t.get(n,l,r)}}}(e,l.injector):e,o=i.get(Bd,er),s=i.get(Bi,null),a=r?ys(this.selector,o.createRenderer(null,this.componentDef)):Rs(o,n),u=this.componentDef.onPush?576:528,c="string"==typeof n&&/^#root-ng-internal-isolated-\d+/.test(n),d=r||c?Nc():i.get(mf),h=o.createRenderer(a,this.componentDef);n&&a&&(Xl(h)?h.setAttribute(a,"ng-version",qd.full):a.setAttribute("ng-version",qd.full));const p=bs(null,Ts(-1,null,1,0,null,null,null,null),d,u,null,null,o,h,s,i),f=Ul(p,null);let g,m;try{const e=Rc(a,this.componentDef,p,o,h);m=jn(0,p),t&&(m.projection=t.map(e=>Array.from(e))),g=Oc(e,this.componentDef,p,d,[Pc]),Gs(p,e),ms(p)}finally{$l(f)}const v=new bf(this.componentType,g,kd(Od,m,p),p,m);return r&&(v.hostView._tViewNode.child=m),v}}class bf extends pd{constructor(e,t,n,l,r){super(),this.location=n,this._rootLView=l,this._tNode=r,this.destroyCbs=[],this.instance=t,this.hostView=this.changeDetectorRef=new Id(l),this.hostView._tViewNode=ws(l[dn],null,-1,l),this.componentType=e}get injector(){return new Kr(this._tNode,this._rootLView)}destroy(){this.destroyCbs.forEach(e=>e()),this.destroyCbs=null,!this.hostView.destroyed&&this.hostView.destroy()}onDestroy(e){this.destroyCbs.push(e)}}function Cf(e,t){for(let n=0;n<e.length;n++)t.push(e[n])}function wf(e,t){void 0===t&&(t=e);for(let n=0;n<e.length;n++){let l=e[n];Array.isArray(l)?(t===e&&(t=e.slice(0,n)),wf(l,t)):t!==e&&t.push(l)}return t}const Sf="\ufffd",_f=/^\s*(\ufffd\d+:?\d*\ufffd)\s*,\s*(select|plural)\s*,/,If=/\ufffd\/?\*(\d+:\d+)\ufffd/gi,Ef=/\ufffd(\/?[#*]\d+):?\d*\ufffd/gi,Df=/\ufffd(\d+):?\d*\ufffd/gi,xf=/({\s*\ufffd\d+:?\d*\ufffd\s*,\s*\S{6}\s*,[\s\S]*})/gi,kf=0,Af=/\[(\ufffd.+?\ufffd?)\]/,Tf=/\[(\ufffd.+?\ufffd?)\]|(\ufffd\/?\*\d+:\d+\ufffd)/g,Rf=/({\s*)(VAR_(PLURAL|SELECT)(_\d+)?)(\s*,)/g,Of=/\ufffdI18N_EXP_(ICU(_\d+)?)\ufffd/g,Nf=/\/\*/,Pf=/\d+\:(\d+)/;function Mf(e){if(!e)return[];let t=0;const n=[],l=[],r=/[{}]/g;let i;for(r.lastIndex=0;i=r.exec(e);){const r=i.index;if("}"==i[0]){if(n.pop(),0==n.length){const n=e.substring(t,r);_f.test(n)?l.push(Lf(n)):n&&l.push(n),t=r+1}}else{if(0==n.length){const n=e.substring(t,r);l.push(n),t=r+1}n.push("{")}}const o=e.substring(t);return""!=o&&l.push(o),l}function Lf(e){const t=[],n=[];let l=1,r=0;const i=Mf(e=e.replace(_f,function(e,t,n){return l="select"===n?0:1,r=parseInt(t.substr(1),10),""}));for(let a=0;a<i.length;){let e=i[a++].trim();1===l&&(e=e.replace(/\s*(?:=)?(\w+)\s*/,"$1")),e.length&&t.push(e);const r=Mf(i[a++]);r.length&&n.push(r)}return o=t.indexOf("other"),s='Missing key "other" in ICU statement.',o<=-1&&function(e){throw new Error(`ASSERTION ERROR: ${e}`)}(s),{type:l,mainBinding:r,cases:t,values:n};var o,s}function Ff(e){let t,n,l="",r=0,i=!1;for(;null!==(t=If.exec(e));)i?t[0]===`${Sf}/*${n}${Sf}`&&(r=t.index,i=!1):(l+=e.substring(r,t.index+t[0].length),n=t[1],i=!0);return l+e.substr(r)}function Vf(e,t,n,l=null){const r=[null,null],i=e.split(Df);let o=0;for(let s=0;s<i.length;s++){const e=i[s];if(1&s){const t=parseInt(e,10);r.push(-1-t),o|=Uf(t)}else""!==e&&r.push(e)}return r.push(t<<2|(n?1:0)),n&&r.push(n,l),r[0]=o,r[1]=r.length-2,r}function Bf(e,t=0){let n;t|=Uf(e.mainBinding);for(let l=0;l<e.values.length;l++){const r=e.values[l];for(let e=0;e<r.length;e++){const l=r[e];if("string"==typeof l)for(;n=Df.exec(l);)t|=Uf(parseInt(n[1],10));else t=Bf(l,t)}}return t}const jf=[];let Hf=-1;function Uf(e){return 1<<Math.min(e,31)}const zf=[];function $f(e,t,n){const l=fl()[dn];jf[++Hf]=e,l.firstTemplatePass&&null===l.data[e+An]&&function(e,t,n,l){const r=fl(),i=e.blueprint.length-An;qf=0;const o=Dl(),s=Al()?Dl():o&&o.parent;let a=s&&s!==r[mn]?s.index-An:t,u=0;zf[u]=a;const c=[];t>0&&o!==s&&c.push(o.index<<3|0);const d=[],h=[],p=function(e,t){if("number"!=typeof t)return Ff(e);{const n=e.indexOf(`:${t}${Sf}`)+2+t.toString().length,l=e.search(new RegExp(`${Sf}\\/\\*\\d+:${t}${Sf}`));return Ff(e.substring(n,l))}}(n,l).split(Ef);for(let f=0;f<p.length;f++){let e=p[f];if(1&f)if("/"===e.charAt(0)){if("#"===e.charAt(1)){const t=parseInt(e.substr(2),10);a=zf[--u],c.push(t<<3|5)}}else{const t=parseInt(e.substr(1),10);c.push(t<<3|0,a<<17|1),"#"===e.charAt(0)&&(zf[++u]=a=t)}else{const t=Mf(e);for(let e=0;e<t.length;e++)if(1&e){const n=i+qf++;c.push(to,"",n,a<<17|1);const l=t[e],r=Bf(l);og(h,l,n,n);const o=h.length-1;d.push(Uf(l.mainBinding),3,-1-l.mainBinding,n<<2|2,o,r,2,n<<2|3,o)}else if(""!==t[e]){const n=t[e],l=n.match(Df),r=i+qf++;c.push(l?"":n,r,a<<17|1),l&&Cf(Vf(n,r),d)}}}(function(e,t){const n=e[dn];if(n.firstTemplatePass){for(let l=0;l<t;l++)n.blueprint.push(null),n.data.push(null),e.push(null);n.expandoInstructions?n.expandoInstructions.push(t):n.expandoStartIndex+=t}})(r,qf),e.data[t+An]={vars:qf,create:c,update:d,icus:h.length?h:null}}(l,e,t,n)}let qf;function Wf(e,t,n){const l=e.next,r=fl();n||(n=t),n===t&&e!==t.child?(e.next=t.child,t.child=e):n!==t&&e!==n.next?(e.next=n.next,n.next=e):e.next=null,t!==r[mn]&&(e.parent=t);let i=e.next;for(;i;)i.next===e&&(i.next=l),i=i.next;Aa(Bn(e,r),e,r);const o=r[e.index];return 0!==e.type&&Fn(o)&&Aa(o[On],e,r),e}function Gf(e,t={}){let n=e;if(Af.test(e)){const e={},t=[kf];if(n=n.replace(Tf,(n,l,r)=>{const i=l||r;if(!e[i]){const t=[];i.split("|").forEach(e=>{const n=e.match(Pf),l=n?parseInt(n[1],10):kf,r=Nf.test(e);t.push([l,r,e])}),e[i]=t}if(!e[i].length)throw new Error(`i18n postprocess: unmatched placeholder - ${i}`);const o=t[t.length-1],s=e[i];let a=0;for(let e=0;e<s.length;e++)if(s[e][0]===o){a=e;break}const[u,c,d]=s[a];return c?t.pop():o!==u&&t.push(u),s.splice(a,1),d}),Object.keys(e).some(t=>!!e[t].length))throw new Error(`i18n postprocess: unmatched values - ${JSON.stringify(e)}`)}return Object.keys(t).length?n=(n=n.replace(Rf,(e,n,l,r,i,o)=>t.hasOwnProperty(l)?`${n}${t[l]}${o}`:e)).replace(Of,(e,n)=>{if(t.hasOwnProperty(n)){const l=t[n];if(!l.length)throw new Error(`i18n postprocess: unmatched ICU - ${e} with key: ${n}`);return l.shift()}return e}):n}function Kf(){!function(e){const t=fl(),n=jf[Hf--],l=e.data[n+An];let r=Dl();const i=Qf(n,l.create,0,t);for(let o=n+1;o<=r.index-An;o++)-1===i.indexOf(o)&&Yf(o,t)}(fl()[dn])}function Zf(e,t,n,l){const r=Dl(),i=Cs(e,t,n,l,null);return r.next===i&&(r.next=null),i}function Qf(e,t,n,l){const r=fl()[Sn];let i=null,o=null;const s=[];for(let a=0;a<t.length;a++){const n=t[a];if("string"==typeof n){const e=ya(n,r),l=t[++a];o=i,i=Zf(l,3,e,null),s.push(l),Tl(!1)}else if("number"==typeof n)switch(7&n){case 1:const r=n>>>17;let u;o=Wf(i,u=r===e?l[mn]:jn(r,l),o);break;case 0:const c=n>>>3;s.push(c),o=i,(i=jn(c,l))&&(xl(i),3===i.type&&Tl(!0));break;case 5:o=i=jn(n>>>3,l),xl(i),Tl(!1);break;case 4:uu(n>>>3,t[++a],t[++a]);break;default:throw new Error(`Unable to determine the type of mutate operation for "${n}"`)}else switch(n){case to:const e=t[++a],u=t[++a],c=r.createComment(e);o=i,i=Zf(u,5,c,null),s.push(u),rr(c,l),i.activeCaseIndex=null,Tl(!1);break;case eo:const d=t[++a],h=t[++a];o=i,i=Zf(h,3,r.createElement(d),d),s.push(h);break;default:throw new Error(`Unable to determine the type of mutate operation for "${n}"`)}}return Tl(!1),s}function Yf(e,t){const n=jn(e,t),l=Vn(e,t);l&&Ra(t[Sn],l);const r=Ha(e);if(Fn(r)){const e=r;0!==n.type&&Ra(t[Sn],e[On])}}function Jf(e,t,n){$f(e,t,n),Kf()}function Xf(e,t){const n=fl()[dn];n.firstTemplatePass&&null===n.data[e+An]&&function(e,t,n){const l=Dl().index-An,r=[];for(let i=0;i<n.length;i+=2){const e=n[i],t=n[i+1].split(xf);for(let n=0;n<t.length;n++){const i=t[n];1&n||""!==i&&(i.match(Df)?Cf(Vf(i,l,e),r):uu(l,e,i))}}e.data[t+An]=r}(n,e,t)}let eg=0,tg=0;function ng(e){e!==lo&&(eg|=1<<tg),tg++}function lg(e){if(tg){const t=fl(),n=t[dn].data[e+An];let l,r=null;Array.isArray(n)?l=n:(l=n.update,r=n.icus),function e(t,n,l,r,i,o=!1){let s=!1;for(let a=0;a<t.length;a++){const u=t[a],c=t[++a];if(o||u&r){let o="";for(let u=a+1;u<=a+c;u++){const a=t[u];if("string"==typeof a)o+=a;else if("number"==typeof a)if(a<0)o+=en(i[l-a]);else{const c=a>>>2;let d,h,p;switch(3&a){case 1:uu(c,t[++u],o,t[++u]);break;case 0:dc(c,o);break;case 2:if(h=n[d=t[++u]],null!==(p=jn(c,i)).activeCaseIndex){const e=h.remove[p.activeCaseIndex];for(let t=0;t<e.length;t++){const l=e[t];switch(7&l){case 3:Yf(l>>>3,i);break;case 6:const r=jn(e[t+1]>>>3,i).activeCaseIndex;null!==r&&Cf(n[l>>>3].remove[r],e)}}}const f=ig(h,o);p.activeCaseIndex=-1!==f?f:null,Qf(-1,h.create[f],0,i),s=!0;break;case 3:h=n[d=t[++u]],p=jn(c,i),e(h.update[p.activeCaseIndex],n,l,r,i,s)}}}}a+=c}}(l,r,t[vn]-tg-1,eg,t),eg=0,tg=0}}const rg=function(){var e={Zero:0,One:1,Two:2,Few:3,Many:4,Other:5};return e[e.Zero]="Zero",e[e.One]="One",e[e.Two]="Two",e[e.Few]="Few",e[e.Many]="Many",e[e.Other]="Other",e}();function ig(e,t){let n=e.cases.indexOf(t);if(-1===n)switch(e.type){case 1:{const l=function(e,n){switch(function(e,t){"string"==typeof t&&(t=parseInt(t,10));const n=t,l=n.toString().replace(/^[^.]*\.?/,""),r=Math.floor(Math.abs(n)),i=l.length,o=parseInt(l,10),s=parseInt(n.toString().replace(/^[^.]*\.?|0+$/g,""),10)||0;switch(e.split("-")[0].toLowerCase()){case"af":case"asa":case"az":case"bem":case"bez":case"bg":case"brx":case"ce":case"cgg":case"chr":case"ckb":case"ee":case"el":case"eo":case"es":case"eu":case"fo":case"fur":case"gsw":case"ha":case"haw":case"hu":case"jgo":case"jmc":case"ka":case"kk":case"kkj":case"kl":case"ks":case"ksb":case"ky":case"lb":case"lg":case"mas":case"mgo":case"ml":case"mn":case"nb":case"nd":case"ne":case"nn":case"nnh":case"nyn":case"om":case"or":case"os":case"ps":case"rm":case"rof":case"rwk":case"saq":case"seh":case"sn":case"so":case"sq":case"ta":case"te":case"teo":case"tk":case"tr":case"ug":case"uz":case"vo":case"vun":case"wae":case"xog":return 1===n?rg.One:rg.Other;case"ak":case"ln":case"mg":case"pa":case"ti":return n===Math.floor(n)&&n>=0&&n<=1?rg.One:rg.Other;case"am":case"as":case"bn":case"fa":case"gu":case"hi":case"kn":case"mr":case"zu":return 0===r||1===n?rg.One:rg.Other;case"ar":return 0===n?rg.Zero:1===n?rg.One:2===n?rg.Two:n%100===Math.floor(n%100)&&n%100>=3&&n%100<=10?rg.Few:n%100===Math.floor(n%100)&&n%100>=11&&n%100<=99?rg.Many:rg.Other;case"ast":case"ca":case"de":case"en":case"et":case"fi":case"fy":case"gl":case"it":case"nl":case"sv":case"sw":case"ur":case"yi":return 1===r&&0===i?rg.One:rg.Other;case"be":return n%10==1&&n%100!=11?rg.One:n%10===Math.floor(n%10)&&n%10>=2&&n%10<=4&&!(n%100>=12&&n%100<=14)?rg.Few:n%10==0||n%10===Math.floor(n%10)&&n%10>=5&&n%10<=9||n%100===Math.floor(n%100)&&n%100>=11&&n%100<=14?rg.Many:rg.Other;case"br":return n%10==1&&n%100!=11&&n%100!=71&&n%100!=91?rg.One:n%10==2&&n%100!=12&&n%100!=72&&n%100!=92?rg.Two:n%10===Math.floor(n%10)&&(n%10>=3&&n%10<=4||n%10==9)&&!(n%100>=10&&n%100<=19||n%100>=70&&n%100<=79||n%100>=90&&n%100<=99)?rg.Few:0!==n&&n%1e6==0?rg.Many:rg.Other;case"bs":case"hr":case"sr":return 0===i&&r%10==1&&r%100!=11||o%10==1&&o%100!=11?rg.One:0===i&&r%10===Math.floor(r%10)&&r%10>=2&&r%10<=4&&!(r%100>=12&&r%100<=14)||o%10===Math.floor(o%10)&&o%10>=2&&o%10<=4&&!(o%100>=12&&o%100<=14)?rg.Few:rg.Other;case"cs":case"sk":return 1===r&&0===i?rg.One:r===Math.floor(r)&&r>=2&&r<=4&&0===i?rg.Few:0!==i?rg.Many:rg.Other;case"cy":return 0===n?rg.Zero:1===n?rg.One:2===n?rg.Two:3===n?rg.Few:6===n?rg.Many:rg.Other;case"da":return 1===n||0!==s&&(0===r||1===r)?rg.One:rg.Other;case"dsb":case"hsb":return 0===i&&r%100==1||o%100==1?rg.One:0===i&&r%100==2||o%100==2?rg.Two:0===i&&r%100===Math.floor(r%100)&&r%100>=3&&r%100<=4||o%100===Math.floor(o%100)&&o%100>=3&&o%100<=4?rg.Few:rg.Other;case"ff":case"fr":case"hy":case"kab":return 0===r||1===r?rg.One:rg.Other;case"fil":return 0===i&&(1===r||2===r||3===r)||0===i&&r%10!=4&&r%10!=6&&r%10!=9||0!==i&&o%10!=4&&o%10!=6&&o%10!=9?rg.One:rg.Other;case"ga":return 1===n?rg.One:2===n?rg.Two:n===Math.floor(n)&&n>=3&&n<=6?rg.Few:n===Math.floor(n)&&n>=7&&n<=10?rg.Many:rg.Other;case"gd":return 1===n||11===n?rg.One:2===n||12===n?rg.Two:n===Math.floor(n)&&(n>=3&&n<=10||n>=13&&n<=19)?rg.Few:rg.Other;case"gv":return 0===i&&r%10==1?rg.One:0===i&&r%10==2?rg.Two:0!==i||r%100!=0&&r%100!=20&&r%100!=40&&r%100!=60&&r%100!=80?0!==i?rg.Many:rg.Other:rg.Few;case"he":return 1===r&&0===i?rg.One:2===r&&0===i?rg.Two:0!==i||n>=0&&n<=10||n%10!=0?rg.Other:rg.Many;case"is":return 0===s&&r%10==1&&r%100!=11||0!==s?rg.One:rg.Other;case"ksh":return 0===n?rg.Zero:1===n?rg.One:rg.Other;case"kw":case"naq":case"se":case"smn":return 1===n?rg.One:2===n?rg.Two:rg.Other;case"lag":return 0===n?rg.Zero:0!==r&&1!==r||0===n?rg.Other:rg.One;case"lt":return n%10!=1||n%100>=11&&n%100<=19?n%10===Math.floor(n%10)&&n%10>=2&&n%10<=9&&!(n%100>=11&&n%100<=19)?rg.Few:0!==o?rg.Many:rg.Other:rg.One;case"lv":case"prg":return n%10==0||n%100===Math.floor(n%100)&&n%100>=11&&n%100<=19||2===i&&o%100===Math.floor(o%100)&&o%100>=11&&o%100<=19?rg.Zero:n%10==1&&n%100!=11||2===i&&o%10==1&&o%100!=11||2!==i&&o%10==1?rg.One:rg.Other;case"mk":return 0===i&&r%10==1||o%10==1?rg.One:rg.Other;case"mt":return 1===n?rg.One:0===n||n%100===Math.floor(n%100)&&n%100>=2&&n%100<=10?rg.Few:n%100===Math.floor(n%100)&&n%100>=11&&n%100<=19?rg.Many:rg.Other;case"pl":return 1===r&&0===i?rg.One:0===i&&r%10===Math.floor(r%10)&&r%10>=2&&r%10<=4&&!(r%100>=12&&r%100<=14)?rg.Few:0===i&&1!==r&&r%10===Math.floor(r%10)&&r%10>=0&&r%10<=1||0===i&&r%10===Math.floor(r%10)&&r%10>=5&&r%10<=9||0===i&&r%100===Math.floor(r%100)&&r%100>=12&&r%100<=14?rg.Many:rg.Other;case"pt":return n===Math.floor(n)&&n>=0&&n<=2&&2!==n?rg.One:rg.Other;case"ro":return 1===r&&0===i?rg.One:0!==i||0===n||1!==n&&n%100===Math.floor(n%100)&&n%100>=1&&n%100<=19?rg.Few:rg.Other;case"ru":case"uk":return 0===i&&r%10==1&&r%100!=11?rg.One:0===i&&r%10===Math.floor(r%10)&&r%10>=2&&r%10<=4&&!(r%100>=12&&r%100<=14)?rg.Few:0===i&&r%10==0||0===i&&r%10===Math.floor(r%10)&&r%10>=5&&r%10<=9||0===i&&r%100===Math.floor(r%100)&&r%100>=11&&r%100<=14?rg.Many:rg.Other;case"shi":return 0===r||1===n?rg.One:n===Math.floor(n)&&n>=2&&n<=10?rg.Few:rg.Other;case"si":return 0===n||1===n||0===r&&1===o?rg.One:rg.Other;case"sl":return 0===i&&r%100==1?rg.One:0===i&&r%100==2?rg.Two:0===i&&r%100===Math.floor(r%100)&&r%100>=3&&r%100<=4||0!==i?rg.Few:rg.Other;case"tzm":return n===Math.floor(n)&&n>=0&&n<=1||n===Math.floor(n)&&n>=11&&n<=99?rg.One:rg.Other;default:return rg.Other}}("en-US",t)){case rg.Zero:return"zero";case rg.One:return"one";case rg.Two:return"two";case rg.Few:return"few";case rg.Many:return"many";default:return"other"}}();-1===(n=e.cases.indexOf(l))&&"other"!==l&&(n=e.cases.indexOf("other"));break}case 0:n=e.cases.indexOf("other")}return n}function og(e,t,n,l){const r=[],i=[],o=[],s=[],a=[];for(let u=0;u<t.values.length;u++){const c=t.values[u],d=[];for(let e=0;e<c.length;e++){const t=c[e];if("string"!=typeof t){const n=d.push(t)-1;c[e]=`\x3c!--\ufffd${n}\ufffd--\x3e`}}const h=sg(c.join(""),n,d,e,l);r.push(h.create),i.push(h.remove),o.push(h.update),s.push(h.vars),a.push(h.childIcus)}e.push({type:t.type,vars:s,childIcus:a,cases:t.cases,create:r,remove:i,update:o}),qf+=Math.max(...s)}function sg(e,t,n,l,r){const i=new gi(document).getInertBodyElement(e);if(!i)throw new Error("Unable to generate inert body element");const o={vars:0,childIcus:[],create:[],remove:[],update:[]};return function e(t,n,l,r,i,o){if(t){const s=[];for(;t;){const a=t.nextSibling,u=o+ ++n.vars;switch(t.nodeType){case Node.ELEMENT_NODE:const a=t,c=a.tagName.toLowerCase();if(Di.hasOwnProperty(c)){n.create.push(eo,c,u,l<<17|1);const s=a.attributes;for(let e=0;e<s.length;e++){const t=s.item(e),l=t.name.toLowerCase();t.value.match(Df)?Ai.hasOwnProperty(l)&&Cf(xi[l]?Vf(t.value,u,t.name,yi):ki[l]?Vf(t.value,u,t.name,bi):Vf(t.value,u,t.name),n.update):n.create.push(u<<3|4,t.name,t.value)}e(t.firstChild,n,u,r,i,o),n.remove.push(u<<3|3)}else n.vars--;break;case Node.TEXT_NODE:const d=t.textContent||"",h=d.match(Df);n.create.push(h?"":d,u,l<<17|1),n.remove.push(u<<3|3),h&&Cf(Vf(d,u),n.update);break;case Node.COMMENT_NODE:const p=ag.exec(t.textContent||"");if(p){const e=parseInt(p[1],10);n.create.push(to,"",u,l<<17|1),s.push([r[e],u])}else n.vars--;break;default:n.vars--}t=a}for(let e=0;e<s.length;e++){const t=s[e][0],l=s[e][1];og(i,t,l,o+n.vars);const r=i.length-1;n.vars+=Math.max(...i[r].vars),n.childIcus.push(r);const a=Bf(t);n.update.push(Uf(t.mainBinding),3,-1-t.mainBinding,l<<2|2,r,a,2,l<<2|3,r),n.remove.push(r<<3|6,l<<3|3)}}}((Fi(i)||i).firstChild,o,t,n,l,r),o}const ag=/\ufffd(\d+)\ufffd/;let ug={};function cg(e={translations:{}}){ug=e.translations}const dg=/\{\$(.*?)\}/g;function hg(e,t={}){return void 0!==ug[e]&&(e=ug[e]),Object.keys(t).length?e.replace(dg,(e,n)=>t[n]||""):e}const pg={provide:yd,useClass:class extends yd{constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){const t=Zt(e);return new yf(t,this.ngModule)}},deps:[wd]};class fg extends wd{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[];const n=Xt(e);this._bootstrapComponents=un(n.bootstrap),this._r3Injector=Jc(e,t,[{provide:wd,useValue:this},pg],N(e)),this.instance=this.get(e)}get(e,t=xe.THROW_IF_NOT_FOUND,n=_.Default){return e===xe||e===wd||e===Ee?this:this._r3Injector.get(e,t,n)}get componentFactoryResolver(){return this.get(yd)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(e=>e()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class gg extends Sd{constructor(e){super(),this.moduleType=e}create(e){return new fg(this.moduleType,e)}}function mg(e,t,n,l){return At(()=>{const r=e,i=r.prototype?Object.getPrototypeOf(r.prototype):null,o=i&&i.constructor;null!==t&&(void 0===r.decorators||o&&o.decorators===r.decorators?r.decorators=t:r.decorators.push(...t)),null!==n&&(r.ctorParameters=n),null!==l&&(r.propDecorators=void 0===r.propDecorators||o&&o.propDecorators===r.propDecorators?l:Object.assign({},r.propDecorators,l))})}function vg(e,t,n){const l=Fl()+e,r=fl();return Rl()?Pu(r,l,n?t.call(n):t()):Mu(r,l)}function yg(e,t,n,l){const r=fl(),i=Fl()+e;return Lu(r,i,n)?Pu(r,i+1,l?t.call(l,n):t(n)):Mu(r,i+1)}function bg(e,t,n,l,r){const i=Fl()+e,o=fl();return Fu(o,i,n,l)?Pu(o,i+2,r?t.call(r,n,l):t(n,l)):Mu(o,i+2)}function Cg(e,t,n,l,r,i){const o=Fl()+e,s=fl();return Vu(s,o,n,l,r)?Pu(s,o+3,i?t.call(i,n,l,r):t(n,l,r)):Mu(s,o+3)}function wg(e,t,n,l,r,i,o){const s=Fl()+e,a=fl();return Bu(a,s,n,l,r,i)?Pu(a,s+4,o?t.call(o,n,l,r,i):t(n,l,r,i)):Mu(a,s+4)}function Sg(e,t,n,l,r,i,o,s){const a=Fl()+e,u=fl(),c=Bu(u,a,n,l,r,i);return Lu(u,a+4,o)||c?Pu(u,a+5,s?t.call(s,n,l,r,i,o):t(n,l,r,i,o)):Mu(u,a+5)}function _g(e,t,n,l,r,i,o,s,a){const u=Fl()+e,c=fl(),d=Bu(c,u,n,l,r,i);return Fu(c,u+4,o,s)||d?Pu(c,u+6,a?t.call(a,n,l,r,i,o,s):t(n,l,r,i,o,s)):Mu(c,u+6)}function Ig(e,t,n,l,r,i,o,s,a,u){const c=Fl()+e,d=fl();let h=Bu(d,c,n,l,r,i);return Vu(d,c+4,o,s,a)||h?Pu(d,c+7,u?t.call(u,n,l,r,i,o,s,a):t(n,l,r,i,o,s,a)):Mu(d,c+7)}function Eg(e,t,n,l,r,i,o,s,a,u,c){const d=Fl()+e,h=fl(),p=Bu(h,d,n,l,r,i);return Bu(h,d+4,o,s,a,u)||p?Pu(h,d+8,c?t.call(c,n,l,r,i,o,s,a,u):t(n,l,r,i,o,s,a,u)):Mu(h,d+8)}function Dg(e,t,n,l){let r=Fl()+e,i=!1;const o=fl();for(let s=0;s<n.length;s++)Lu(o,r++,n[s])&&(i=!0);return i?Pu(o,r,t.apply(l,n)):Mu(o,r)}function xg(e,t){const n=fl()[dn];let l;const r=e+An;n.firstTemplatePass?(l=function(e,t){if(t)for(let n=t.length-1;n>=0;n--){const l=t[n];if(e===l.name)return l}throw new Error(`The pipe '${e}' could not be found!`)}(t,n.pipeRegistry),n.data[r]=l,l.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(r,l.onDestroy)):l=n.data[r];const i=l.factory(null);return Ba(e,i),i}function kg(e,t,n){const l=Ha(e);return Pg(Ng(e)?yg(t,l.transform,n,l):l.transform(n))}function Ag(e,t,n,l){const r=Ha(e);return Pg(Ng(e)?bg(t,r.transform,n,l,r):r.transform(n,l))}function Tg(e,t,n,l,r){const i=Ha(e);return Pg(Ng(e)?Cg(t,i.transform,n,l,r,i):i.transform(n,l,r))}function Rg(e,t,n,l,r,i){const o=Ha(e);return Pg(Ng(e)?wg(t,o.transform,n,l,r,i,o):o.transform(n,l,r,i))}function Og(e,t,n){const l=Ha(e);return Pg(Ng(e)?Dg(t,l.transform,n,l):l.transform.apply(l,n))}function Ng(e){return fl()[dn].data[e+An].pure}function Pg(e){if(Ru.isWrapped(e)){e=Ru.unwrap(e);const t=fl();t[t[vn]]=lo}return e}class Mg extends l.a{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,n){let l,i=e=>null,o=()=>null;e&&"object"==typeof e?(l=this.__isAsync?t=>{setTimeout(()=>e.next(t))}:t=>{e.next(t)},e.error&&(i=this.__isAsync?t=>{setTimeout(()=>e.error(t))}:t=>{e.error(t)}),e.complete&&(o=this.__isAsync?()=>{setTimeout(()=>e.complete())}:()=>{e.complete()})):(l=this.__isAsync?t=>{setTimeout(()=>e(t))}:t=>{e(t)},t&&(i=this.__isAsync?e=>{setTimeout(()=>t(e))}:e=>{t(e)}),n&&(o=this.__isAsync?()=>{setTimeout(()=>n())}:()=>{n()}));const s=super.subscribe(l,i,o);return e instanceof r.a&&e.add(s),s}}class Lg{constructor(){this.dirty=!0,this._results=[],this.changes=new Mg,this.length=0}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}[ku()](){return this._results[ku()]()}toString(){return this._results.toString()}reset(e){this._results=wf(e),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]}notifyOnChanges(){this.changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}class Fg{constructor(e,t,n){this.parent=e,this.shallow=t,this.deep=n}track(e,t,n,l){n?this.deep=Zg(this.deep,e,t,null!=l?l:null):this.shallow=Zg(this.shallow,e,t,null!=l?l:null)}clone(){return new Fg(this,null,this.deep)}container(){const e=Vg(this.shallow),t=Vg(this.deep);return e||t?new Fg(this,e,t):null}createView(){const e=Bg(this.shallow),t=Bg(this.deep);return e||t?new Fg(this,e,t):null}insertView(e){jg(e,this.shallow),jg(e,this.deep)}addNode(e){Wg(this.deep,e,!1),Wg(this.shallow,e,!1)}insertNodeBeforeViews(e){Wg(this.deep,e,!0),Wg(this.shallow,e,!0)}removeView(){Hg(this.shallow),Hg(this.deep)}}function Vg(e){let t=null;for(;e;){const n=[];e.values.push(n),t={next:t,list:e.list,predicate:e.predicate,values:n,containerValues:null},e=e.next}return t}function Bg(e){let t=null;for(;e;)t={next:t,list:e.list,predicate:e.predicate,values:[],containerValues:e.values},e=e.next;return t}function jg(e,t){for(;t;)t.containerValues.splice(e,0,t.values),t.values.length&&t.list.setDirty(),t=t.next}function Hg(e){for(;e;){const t=e.containerValues,n=t.indexOf(e.values);t.splice(n,1)[0].length&&e.list.setDirty(),e=e.next}}function Ug(e,t){const n=e.localNames;if(n)for(let l=0;l<n.length;l+=2)if(n[l]===t)return n[l+1];return null}function zg(e,t,n){const l=e[Ft];if("function"==typeof l)return l();{const l=$r(t,n,e,!1,!1);if(null!==l)return qr(n[dn].data,n,l,t)}return null}function $g(e,t,n,l){const r=e[Ft]();return l?r?zg(l,t,n):null:r}function qg(e,t,n,l){return n?zg(n,e,t):l>-1?qr(t[dn].data,t,l,e):function(e,t){return 3===e.type||4===e.type?kd(Od,e,t):0===e.type?Ad(ch,Od,e,t):null}(e,t)}function Wg(e,t,n){const l=fl();for(;e;){const r=e.predicate,i=r.type;if(i){let o=null;if(i===ch)o=$g(i,t,l,r.read);else{const e=$r(t,l,i,!1,!1);null!==e&&(o=qg(t,l,r.read,e))}null!==o&&Gg(e,o,n)}else{const i=r.selector;for(let o=0;o<i.length;o++){const s=Ug(t,i[o]);if(null!==s){const i=qg(t,l,r.read,s);null!==i&&Gg(e,i,n)}}}e=e.next}}function Gg(e,t,n){n?e.values.splice(-1,0,t):e.values.push(t),e.list.setDirty()}function Kg(e,t){const n=Array.isArray(e);return{type:n?null:e,selector:n?e:null,read:t}}function Zg(e,t,n,l){return{next:e,list:t,predicate:Kg(n,l),values:t._valuesTree,containerValues:null}}function Qg(e,t,n){const l=fl(),r=new Lg,i=l[gn]||(l[gn]=new Fg(null,null,null));return r._valuesTree=[],r._static=!1,i.track(r,e,t,n),function(e,t,n){const l=ra(e);l.push(t),e[dn].firstTemplatePass&&ia(e).push(n,l.length-1)}(l,r,r.destroy),r}function Yg(e){const t=e,n=Rl();return!(!e.dirty||n!==t._static||(e.reset(t._valuesTree||[]),e.notifyOnChanges(),0))}function Jg(e,t,n){const l=Xg(e,t,n),r=fl()[dn];l._static=!0,r.staticViewQueries||(r.staticViewQueries=!0)}function Xg(e,t,n){const l=fl()[dn];l.firstTemplatePass&&l.expandoStartIndex++;const r=jl(),i=Qg(e,t,n);return Ba(r-An,i),Hl(r+1),i}function em(){const e=jl();return Hl(e+1),Ha(e-An)}function tm(e,t,n,l){const r=fl(),i=r[dn],o=Qg(t,n,l);if((r[Dn]||(r[Dn]=[])).push(o),i.firstTemplatePass){const t=i.contentQueries||(i.contentQueries=[]);e!==(i.contentQueries.length?i.contentQueries[i.contentQueries.length-1]:-1)&&t.push(e)}return o}function nm(e,t,n,l){const r=tm(e,t,n,l),i=fl()[dn];r._static=!0,i.staticContentQueries||(i.staticContentQueries=!0)}function lm(){const e=fl(),t=jl();return Hl(t+1),e[Dn][t]}function rm(e,t){return Ad(ch,Od,e,t)}class im{}const om=new Map;function sm(e,t){const n=om.get(e);am(e,n&&n.moduleType,t.moduleType),om.set(e,t)}function am(e,t,n){if(t&&t!==n)throw new Error(`Duplicate module registered for ${e} - ${N(t)} vs ${N(t.name)}`)}function um(e,t){am(e,om.get(e),t),om.set(e,t)}function cm(e){const t=om.get(e);if(!t)throw pm(e);return t}function dm(e){const t=om.get(e);if(!t)throw pm(e);return new gg(t)}const hm=cm;function pm(e){return new Error(`No module with ID ${e} loaded`)}const fm=(()=>({"\u0275\u0275defineBase":Wt,"\u0275\u0275defineComponent":Bt,"\u0275\u0275defineDirective":Gt,"\u0275\u0275defineInjectable":D,"\u0275\u0275defineInjector":k,"\u0275\u0275defineNgModule":zt,"\u0275\u0275definePipe":Kt,"\u0275\u0275directiveInject":Ua,"\u0275\u0275getFactoryOf":Zr,"\u0275\u0275getInheritedFactory":Qr,"\u0275\u0275inject":q,"\u0275\u0275injectAttribute":za,"\u0275\u0275templateRefExtractor":rm,"\u0275\u0275NgOnChangesFeature":Fc,"\u0275\u0275ProvidersFeature":hd,"\u0275\u0275InheritDefinitionFeature":Uc,"\u0275\u0275elementAttribute":uu,"\u0275\u0275bind":Hu,"\u0275\u0275container":Na,"\u0275\u0275nextContext":_u,"\u0275\u0275containerRefreshStart":Ma,"\u0275\u0275containerRefreshEnd":La,"\u0275\u0275namespaceHTML":Yl,"\u0275\u0275namespaceMathML":Ql,"\u0275\u0275namespaceSVG":Zl,"\u0275\u0275enableBindings":hl,"\u0275\u0275disableBindings":pl,"\u0275\u0275allocHostVars":ca,"\u0275\u0275elementStart":ou,"\u0275\u0275elementEnd":su,"\u0275\u0275element":au,"\u0275\u0275elementContainerStart":du,"\u0275\u0275elementContainerEnd":hu,"\u0275\u0275pureFunction0":vg,"\u0275\u0275pureFunction1":yg,"\u0275\u0275pureFunction2":bg,"\u0275\u0275pureFunction3":Cg,"\u0275\u0275pureFunction4":wg,"\u0275\u0275pureFunction5":Sg,"\u0275\u0275pureFunction6":_g,"\u0275\u0275pureFunction7":Ig,"\u0275\u0275pureFunction8":Eg,"\u0275\u0275pureFunctionV":Dg,"\u0275\u0275getCurrentView":gu,"\u0275\u0275restoreView":El,"\u0275\u0275interpolation1":qu,"\u0275\u0275interpolation2":Wu,"\u0275\u0275interpolation3":Gu,"\u0275\u0275interpolation4":Ku,"\u0275\u0275interpolation5":Zu,"\u0275\u0275interpolation6":Qu,"\u0275\u0275interpolation7":Yu,"\u0275\u0275interpolation8":Ju,"\u0275\u0275interpolationV":$u,"\u0275\u0275listener":yu,"\u0275\u0275load":Ha,"\u0275\u0275projection":Du,"\u0275\u0275elementProperty":Uu,"\u0275\u0275componentHostSyntheticProperty":zu,"\u0275\u0275componentHostSyntheticListener":bu,"\u0275\u0275pipeBind1":kg,"\u0275\u0275pipeBind2":Ag,"\u0275\u0275pipeBind3":Tg,"\u0275\u0275pipeBind4":Rg,"\u0275\u0275pipeBindV":Og,"\u0275\u0275projectionDef":Eu,"\u0275\u0275property":ju,"\u0275\u0275propertyInterpolate":Xu,"\u0275\u0275propertyInterpolate1":ec,"\u0275\u0275propertyInterpolate2":tc,"\u0275\u0275propertyInterpolate3":nc,"\u0275\u0275propertyInterpolate4":lc,"\u0275\u0275propertyInterpolate5":rc,"\u0275\u0275propertyInterpolate6":ic,"\u0275\u0275propertyInterpolate7":oc,"\u0275\u0275propertyInterpolate8":sc,"\u0275\u0275propertyInterpolateV":ac,"\u0275\u0275pipe":xg,"\u0275\u0275queryRefresh":Yg,"\u0275\u0275viewQuery":Xg,"\u0275\u0275staticViewQuery":Jg,"\u0275\u0275staticContentQuery":nm,"\u0275\u0275loadViewQuery":em,"\u0275\u0275contentQuery":tm,"\u0275\u0275loadContentQuery":lm,"\u0275\u0275reference":ja,"\u0275\u0275elementHostAttrs":cu,"\u0275\u0275elementStyling":$a,"\u0275\u0275elementStylingMap":Xa,"\u0275\u0275elementStyleProp":Ga,"\u0275\u0275elementStylingApply":tu,"\u0275\u0275elementClassProp":Qa,"\u0275\u0275elementHostStyling":qa,"\u0275\u0275elementHostStylingMap":eu,"\u0275\u0275elementHostStyleProp":Ka,"\u0275\u0275elementHostStylingApply":nu,"\u0275\u0275elementHostClassProp":Ya,"\u0275\u0275select":uc,"\u0275\u0275template":Pa,"\u0275\u0275text":cc,"\u0275\u0275textBinding":dc,"\u0275\u0275embeddedViewStart":pu,"\u0275\u0275embeddedViewEnd":fu,"\u0275\u0275i18n":Jf,"\u0275\u0275i18nAttributes":Xf,"\u0275\u0275i18nExp":ng,"\u0275\u0275i18nStart":$f,"\u0275\u0275i18nEnd":Kf,"\u0275\u0275i18nApply":lg,"\u0275\u0275i18nPostprocess":Gf,"\u0275\u0275i18nLocalize":hg,"\u0275\u0275resolveWindow":ln,"\u0275\u0275resolveDocument":rn,"\u0275\u0275resolveBody":on,"\u0275\u0275setComponentScope":jt,"\u0275\u0275setNgModuleScope":$t,"\u0275\u0275sanitizeHtml":zi,"\u0275\u0275sanitizeStyle":$i,"\u0275\u0275defaultStyleSanitizer":Qi,"\u0275\u0275sanitizeResourceUrl":Wi,"\u0275\u0275sanitizeScript":Gi,"\u0275\u0275sanitizeUrl":qi,"\u0275\u0275sanitizeUrlOrResourceUrl":Zi,"\u0275registerNgModuleType":um}))(),gm=[],mm=[];let vm=!1;function ym(){if(!vm){vm=!0;try{for(let e=mm.length-1;e>=0;e--){const{moduleType:t,ngModule:n}=mm[e];n.declarations&&n.declarations.every(bm)&&(mm.splice(e,1),Em(t,n))}}finally{vm=!1}}}function bm(e){return Array.isArray(e)?e.every(bm):!!L(e)}function Cm(e,t={}){wm(e,t),function(e,t){mm.push({moduleType:e,ngModule:t})}(e,t)}function wm(e,t){const n=wf(t.declarations||gm);let l=null;Object.defineProperty(e,Mt,{configurable:!0,get:()=>(null===l&&(l=B().compileNgModule(fm,`ng:///${e.name}/ngModuleDef.js`,{type:e,bootstrap:wf(t.bootstrap||gm).map(L),declarations:n.map(L),imports:wf(t.imports||gm).map(L).map(km),exports:wf(t.exports||gm).map(L).map(km),emitInline:!0,schemas:t.schemas?wf(t.schemas):null})),l)}),t.id&&um(t.id,e);let r=null;Object.defineProperty(e,O,{get:()=>{if(null===r){const n={name:e.name,type:e,deps:se(e),providers:t.providers||gm,imports:[(t.imports||gm).map(L),(t.exports||gm).map(L)]};r=B().compileInjector(fm,`ng:///${e.name}/ngInjectorDef.js`,n)}return r},configurable:!1})}let Sm=new Map,_m=new Map;function Im(){Sm=new Map,_m=new Map,mm.length=0}function Em(e,t){const n=wf(t.declarations||gm),l=xm(e);n.forEach(t=>{t.hasOwnProperty(Ot)?Dm(Zt(t),l):t.hasOwnProperty(Nt)||t.hasOwnProperty(Pt)||(t.ngSelectorScope=e)})}function Dm(e,t){e.directiveDefs=(()=>Array.from(t.compilation.directives).map(e=>e.hasOwnProperty(Ot)?Zt(e):Qt(e)).filter(e=>!!e)),e.pipeDefs=(()=>Array.from(t.compilation.pipes).map(e=>Yt(e))),e.schemas=t.schemas,e.template.ngPrivateData=void 0}function xm(e,t){if(!Am(e))throw new Error(`${e.name} does not have an ngModuleDef`);const n=Xt(e);if(null!==n.transitiveCompileScopes)return n.transitiveCompileScopes;const l={schemas:n.schemas||null,compilation:{directives:new Set,pipes:new Set},exported:{directives:new Set,pipes:new Set}};return un(n.declarations).forEach(e=>{Yt(e)?l.compilation.pipes.add(e):l.compilation.directives.add(e)}),un(n.imports).forEach(e=>{const n=e;if(!Am(n))throw new Error(`Importing ${n.name} which does not have an ngModuleDef`);t&&t(n);const r=xm(n,t);r.exported.directives.forEach(e=>l.compilation.directives.add(e)),r.exported.pipes.forEach(e=>l.compilation.pipes.add(e))}),un(n.exports).forEach(e=>{const n=e;if(Am(n)){const e=xm(n,t);e.exported.directives.forEach(e=>{l.compilation.directives.add(e),l.exported.directives.add(e)}),e.exported.pipes.forEach(e=>{l.compilation.pipes.add(e),l.exported.pipes.add(e)})}else Yt(n)?l.exported.pipes.add(n):l.exported.directives.add(n)}),n.transitiveCompileScopes=l,l}function km(e){return function(e){return void 0!==e.ngModule}(e)?e.ngModule:e}function Am(e){return!!Xt(e)}function Tm(e,t){let n=null;!function(e,t){Et(t)&&(_t.set(e,t),It.add(e))}(e,t),Object.defineProperty(e,Ot,{get:()=>{const l=B();if(null===n){if(Et(t)){const n=[`Component '${e.name}' is not resolved:`];throw t.templateUrl&&n.push(` - templateUrl: ${t.templateUrl}`),t.styleUrls&&t.styleUrls.length&&n.push(` - styleUrls: ${JSON.stringify(t.styleUrls)}`),n.push("Did you run and wait for 'resolveComponentResources()'?"),new Error(n.join("\n"))}const r=t.templateUrl||`ng:///${e.name}/template.html`,i=Object.assign({},Nm(e,t),{typeSourceSpan:l.createParseSourceSpan("Component",e.name,r),template:t.template||"",preserveWhitespaces:t.preserveWhitespaces||!1,styles:t.styles||Rt,animations:t.animations,directives:[],changeDetection:t.changeDetection,pipes:new Map,encapsulation:t.encapsulation||kt.Emulated,interpolation:t.interpolation,viewProviders:t.viewProviders||null});if(i.usesInheritance&&Pm(e),n=l.compileComponent(fm,r,i),ym(),function(t){return void 0!==e.ngSelectorScope}()){const t=xm(e.ngSelectorScope);Dm(n,t)}}return n},configurable:!1}),ue(e)}function Rm(e,t){let n=null;Object.defineProperty(e,Nt,{get:()=>{if(null===n){const l=e&&e.name,r=`ng:///${l}/ngDirectiveDef.js`,i=B(),o=Nm(e,t);o.typeSourceSpan=i.createParseSourceSpan("Directive",l,r),o.usesInheritance&&Pm(e),n=i.compileDirective(fm,r,o)}return n},configurable:!1}),ue(e)}function Om(e){return Object.getPrototypeOf(e.prototype)===Object.prototype}function Nm(e,t){const n=oe().ownPropMetadata(e);return{name:e.name,type:e,typeArgumentCount:0,selector:t.selector,deps:se(e),host:t.host||Tt,propMetadata:n,inputs:t.inputs||Rt,outputs:t.outputs||Rt,queries:Vm(e,n,Bm),lifecycle:{usesOnChanges:e.prototype.hasOwnProperty("ngOnChanges")},typeSourceSpan:null,usesInheritance:!Om(e),exportAs:(l=t.exportAs,void 0===l?null:l.split(",").map(e=>e.trim())),providers:t.providers||null,viewQueries:Vm(e,n,jm)};var l}function Pm(e){const t=Object.prototype;let n=Object.getPrototypeOf(e);for(;n&&n!==t;){if(!Qt(n)&&!Zt(n)&&!Jt(n)){const e=Lm(n);e&&Mm(n,e)}n=Object.getPrototypeOf(n)}}function Mm(e,t){let n=null;Object.defineProperty(e,Lt,{get:()=>{if(null===n){const l=`ng://${e&&e.name}/ngBaseDef.js`,r=B();n=r.compileBase(fm,l,t)}return n},configurable:!1})}function Lm(e){const t=oe().ownPropMetadata(e),n=Vm(e,t,jm),l=Vm(e,t,Bm);let r,i;for(const o in t)t[o].forEach(e=>{"Input"===e.ngMetadataName?(r=r||{})[o]=e.bindingPropertyName?[e.bindingPropertyName,o]:o:"Output"===e.ngMetadataName&&((i=i||{})[o]=e.bindingPropertyName||o)});return r||i||n.length||l.length?{inputs:r,outputs:i,viewQueries:n,queries:l}:null}function Fm(e,t){return{propertyName:e,predicate:(n=t.selector,"string"==typeof n?n.split(",").map(e=>e.trim()):L(n)),descendants:t.descendants,first:t.first,read:t.read?t.read:null,static:!!t.static};var n}function Vm(e,t,n){const l=[];for(const r in t)if(t.hasOwnProperty(r)){const i=t[r];i.forEach(t=>{if(n(t)){if(!t.selector)throw new Error(`Can't construct a query for the property "${r}" of `+`"${tn(e)}" since the query selector wasn't defined.`);if(i.some(Hm))throw new Error("Cannot combine @Input decorators with query decorators");l.push(Fm(r,t))}})}return l}function Bm(e){const t=e.ngMetadataName;return"ContentChild"===t||"ContentChildren"===t}function jm(e){const t=e.ngMetadataName;return"ViewChild"===t||"ViewChildren"===t}function Hm(e){return"Input"===e.ngMetadataName}function Um(e,t){let n=null;Object.defineProperty(e,Pt,{get:()=>{if(null===n){const l=e.name;n=B().compilePipe(fm,`ng:///${l}/ngPipeDef.js`,{type:e,typeArgumentCount:0,name:l,deps:se(e),pipeName:t.name,pure:void 0===t.pure||t.pure})}return n},configurable:!1})}const zm=p("Directive",(e={})=>e,void 0,void 0,(e,t)=>ev(e,t)),$m=p("Component",(e={})=>Object.assign({changeDetection:bt.Default},e),zm,void 0,(e,t)=>Xm(e,t)),qm=p("Pipe",e=>Object.assign({pure:!0},e),void 0,void 0,(e,t)=>tv(e,t)),Wm=m("Input",e=>({bindingPropertyName:e})),Gm=m("Output",e=>({bindingPropertyName:e})),Km=m("HostBinding",e=>({hostPropertyName:e})),Zm=m("HostListener",(e,t)=>({eventName:e,args:t})),Qm=Tm,Ym=Rm,Jm=Um,Xm=Rd,ev=Rd,tv=Rd,nv=p("NgModule",e=>e,void 0,void 0,(e,t)=>rv(e,t)),lv=Cm,rv=function(e,t){let n=t&&t.imports||[];t&&t.exports&&(n=[...n,t.exports]),e.ngInjectorDef=k({factory:ve(e,{useClass:e}),providers:t&&t.providers,imports:n})},iv=new we("Application Initializer"),ov=(()=>(class{constructor(e){this.appInits=e,this.initialized=!1,this.done=!1,this.donePromise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}runInitializers(){if(this.initialized)return;const e=[],t=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n<this.appInits.length;n++){const t=this.appInits[n]();mu(t)&&e.push(t)}Promise.all(e).then(()=>{t()}).catch(e=>{this.reject(e)}),0===e.length&&t(),this.initialized=!0}}))(),sv=new we("AppId");function av(){return`${cv()}${cv()}${cv()}`}const uv={provide:sv,useFactory:av,deps:[]};function cv(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const dv=new we("Platform Initializer"),hv=new we("Platform ID"),pv=new we("appBootstrapListener"),fv=new we("Application Packages Root URL"),gv=(()=>(class{log(e){console.log(e)}warn(e){console.warn(e)}}))();class mv{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}function vv(){throw new Error("Runtime compiler is not loaded")}const yv=function(e){return new gg(e)},bv=vv,Cv=function(e){return Promise.resolve(yv(e))},wv=vv,Sv=function(e){const t=yv(e),n=un(Xt(e).declarations).reduce((e,t)=>{const n=Zt(t);return n&&e.push(new yf(n)),e},[]);return new mv(t,n)},_v=vv,Iv=function(e){return Promise.resolve(Sv(e))},Ev=vv,Dv=(()=>(class{constructor(){this.compileModuleSync=bv,this.compileModuleAsync=wv,this.compileModuleAndAllComponentsSync=_v,this.compileModuleAndAllComponentsAsync=Ev}clearCache(){}clearCacheFor(e){}getModuleId(e){}}))(),xv=new we("compilerOptions");class kv{}let Av,Tv;function Rv(){const e=V.wtf;return!(!e||!(Av=e.trace)||(Tv=Av.events,0))}function Ov(e,t=null){return Tv.createScope(e,t)}function Nv(e,t){return Av.leaveScope(e,t),t}function Pv(e,t){return Av.beginTimeRange(e,t)}function Mv(e){Av.endTimeRange(e)}const Lv=Rv(),Fv=Lv?Ov:(e,t)=>(function(e,t){return null}),Vv=Lv?Nv:(e,t)=>t,Bv=Lv?Pv:(e,t)=>null,jv=Lv?Mv:e=>null,Hv=(()=>Promise.resolve(0))();function Uv(e){"undefined"==typeof Zone?Hv.then(()=>{e&&e.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",e)}class zv{constructor({enableLongStackTrace:e=!1}){if(this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Mg(!1),this.onMicrotaskEmpty=new Mg(!1),this.onStable=new Mg(!1),this.onError=new Mg(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");var t;Zone.assertZonePatched(),this._nesting=0,this._outer=this._inner=Zone.current,Zone.wtfZoneSpec&&(this._inner=this._inner.fork(Zone.wtfZoneSpec)),Zone.TaskTrackingZoneSpec&&(this._inner=this._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(this._inner=this._inner.fork(Zone.longStackTraceZoneSpec)),(t=this)._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(e,n,l,r,i,o)=>{try{return Gv(t),e.invokeTask(l,r,i,o)}finally{Kv(t)}},onInvoke:(e,n,l,r,i,o,s)=>{try{return Gv(t),e.invoke(l,r,i,o,s)}finally{Kv(t)}},onHasTask:(e,n,l,r)=>{e.hasTask(l,r),n===l&&("microTask"==r.change?(t.hasPendingMicrotasks=r.microTask,Wv(t)):"macroTask"==r.change&&(t.hasPendingMacrotasks=r.macroTask))},onHandleError:(e,n,l,r)=>(e.handleError(l,r),t.runOutsideAngular(()=>t.onError.emit(r)),!1)})}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!zv.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(zv.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,n){return this._inner.run(e,t,n)}runTask(e,t,n,l){const r=this._inner,i=r.scheduleEventTask("NgZoneEvent: "+l,e,qv,$v,$v);try{return r.runTask(i,t,n)}finally{r.cancelTask(i)}}runGuarded(e,t,n){return this._inner.runGuarded(e,t,n)}runOutsideAngular(e){return this._outer.run(e)}}function $v(){}const qv={};function Wv(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function Gv(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function Kv(e){e._nesting--,Wv(e)}class Zv{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Mg,this.onMicrotaskEmpty=new Mg,this.onStable=new Mg,this.onError=new Mg}run(e){return e()}runGuarded(e){return e()}runOutsideAngular(e){return e()}runTask(e){return e()}}const Qv=(()=>(class{constructor(e){this._ngZone=e,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),e.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{zv.assertNotInAngularZone(),Uv(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())Uv(()=>{for(;0!==this._callbacks.length;){let e=this._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb(this._didWork)}this._didWork=!1});else{let e=this.getPendingTasks();this._callbacks=this._callbacks.filter(t=>!t.updateCb||!t.updateCb(e)||(clearTimeout(t.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(e=>({source:e.source,creationLocation:e.creationLocation,data:e.data})):[]}addCallback(e,t,n){let l=-1;t&&t>0&&(l=setTimeout(()=>{this._callbacks=this._callbacks.filter(e=>e.timeoutId!==l),e(this._didWork,this.getPendingTasks())},t)),this._callbacks.push({doneCb:e,timeoutId:l,updateCb:n})}whenStable(e,t,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(e,t,n),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(e,t,n){return[]}}))(),Yv=(()=>{class e{constructor(){this._applications=new Map,ty.addToWindow(this)}registerApplication(e,t){this._applications.set(e,t)}unregisterApplication(e){this._applications.delete(e)}unregisterAllApplications(){this._applications.clear()}getTestability(e){return this._applications.get(e)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(e,t=!0){return ty.findTestabilityInTree(this,e,t)}}return e.ctorParameters=(()=>[]),e})();class Jv{addToWindow(e){}findTestabilityInTree(e,t,n){return null}}function Xv(e){ty=e}let ey,ty=new Jv;function ny(e,t,n){const l=new gg(n);if(0===_t.size)return Promise.resolve(l);const r=function(e){const t=[];return e.forEach(e=>e&&t.push(...e)),t}(e.get(xv,[]).concat(t).map(e=>e.providers));if(0===r.length)return Promise.resolve(l);const i=B(),o=xe.create({providers:r}).get(i.ResourceLoader);return St(e=>Promise.resolve(o.get(e))).then(()=>l)}let ly=function(e){return e instanceof Cd};function ry(e){return e.isBoundToModule}const iy=new we("AllowMultipleToken");class oy{constructor(e,t){this.name=e,this.token=t}}function sy(e){if(ey&&!ey.destroyed&&!ey.injector.get(iy,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");ey=e.get(hy);const t=e.get(dv,null);return t&&t.forEach(e=>e()),ey}function ay(e,t,n=[]){const l=`Platform: ${t}`,r=new we(l);return(t=[])=>{let i=dy();if(!i||i.injector.get(iy,!1))if(e)e(n.concat(t).concat({provide:r,useValue:!0}));else{const e=n.concat(t).concat({provide:r,useValue:!0});sy(xe.create({providers:e,name:l}))}return uy(r)}}function uy(e){const t=dy();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}function cy(){ey&&!ey.destroyed&&ey.destroy()}function dy(){return ey&&!ey.destroyed?ey:null}const hy=(()=>(class{constructor(e){this._injector=e,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(e,t){const n="noop"===(r=t?t.ngZone:void 0)?new Zv:("zone.js"===r?void 0:r)||new zv({enableLongStackTrace:pi()}),l=[{provide:zv,useValue:n}];var r;return n.run(()=>{const t=xe.create({providers:l,parent:this.injector,name:e.moduleType.name}),r=e.create(t),i=r.injector.get(ei,null);if(!i)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return r.onDestroy(()=>gy(this._modules,r)),n.runOutsideAngular(()=>n.onError.subscribe({next:e=>{i.handleError(e)}})),function(e,t,n){try{const r=n();return mu(r)?r.catch(n=>{throw t.runOutsideAngular(()=>e.handleError(n)),n}):r}catch(l){throw t.runOutsideAngular(()=>e.handleError(l)),l}}(i,n,()=>{const e=r.injector.get(ov);return e.runInitializers(),e.donePromise.then(()=>(this._moduleDoBootstrap(r),r))})})}bootstrapModule(e,t=[]){const n=py({},t);return function(e,t,n){return e.get(kv).createCompiler([t]).compileModuleAsync(n)}(this.injector,n,e).then(e=>this.bootstrapModuleFactory(e,n))}_moduleDoBootstrap(e){const t=e.injector.get(fy);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(e=>t.bootstrap(e));else{if(!e.instance.ngDoBootstrap)throw new Error(`The module ${N(e.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. `+"Please define one of these.");e.instance.ngDoBootstrap(t)}this._modules.push(e)}onDestroy(e){this._destroyListeners.push(e)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(e=>e.destroy()),this._destroyListeners.forEach(e=>e()),this._destroyed=!0}get destroyed(){return this._destroyed}}))();function py(e,t){return Array.isArray(t)?t.reduce(py,e):Object.assign({},e,t)}const fy=(()=>{class e{constructor(e,t,n,l,r,c){this._zone=e,this._console=t,this._injector=n,this._exceptionHandler=l,this._componentFactoryResolver=r,this._initStatus=c,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=pi(),this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const d=new i.a(e=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{e.next(this._stable),e.complete()})}),h=new i.a(e=>{let t;this._zone.runOutsideAngular(()=>{t=this._zone.onStable.subscribe(()=>{zv.assertNotInAngularZone(),Uv(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,e.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{zv.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{e.next(!1)}))});return()=>{t.unsubscribe(),n.unsubscribe()}});this.isStable=Object(o.a)(d,h.pipe(e=>Object(a.a)()(Object(s.a)(u)(e))))}bootstrap(e,t){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let n;n=e instanceof fd?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(n.componentType);const l=ly(n)?null:this._injector.get(wd),r=n.create(xe.NULL,[],t||n.selector,l);r.onDestroy(()=>{this._unloadComponent(r)});const i=r.injector.get(Qv,null);return i&&r.injector.get(Yv).registerApplication(r.location.nativeElement,i),this._loadComponent(r),pi()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");const t=e._tickScope();try{this._runningTick=!0;for(let e of this._views)e.detectChanges();if(this._enforceNoNewChanges)for(let e of this._views)e.checkNoChanges()}catch(n){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(n))}finally{this._runningTick=!1,Vv(t)}}attachView(e){const t=e;this._views.push(t),t.attachToAppRef(this)}detachView(e){const t=e;gy(this._views,t),t.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(pv,[]).concat(this._bootstrapListeners).forEach(t=>t(e))}_unloadComponent(e){this.detachView(e.hostView),gy(this.components,e)}ngOnDestroy(){this._views.slice().forEach(e=>e.destroy())}get viewCount(){return this._views.length}}return e._tickScope=Fv("ApplicationRef#tick()"),e})();function gy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const my=!0,vy=!1;class yy{}const by={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"},Cy=(()=>(class{constructor(e,t){this._compiler=e,this._config=t||by}load(e){return!vy&&this._compiler instanceof Dv?this.loadFactory(e):this.loadAndCompile(e)}loadAndCompile(e){let[t,l]=e.split("#");return void 0===l&&(l="default"),n("crnd")(t).then(e=>e[l]).then(e=>wy(e,t,l)).then(e=>this._compiler.compileModuleAsync(e))}loadFactory(e){let[t,l]=e.split("#"),r="NgFactory";return void 0===l&&(l="default",r=""),n("crnd")(this._config.factoryPathPrefix+t+this._config.factoryPathSuffix).then(e=>e[l+r]).then(e=>wy(e,t,l))}}))();function wy(e,t,n){if(!e)throw new Error(`Cannot find '${n}' in '${t}'`);return e}class Sy extends rh{}class _y extends Sy{}class Iy{constructor(e,t){this.name=e,this.callback=t}}class Ey{constructor(e,t,n){this.listeners=[],this.parent=null,this._debugContext=n,this.nativeNode=e,t&&t instanceof Dy&&t.addChild(this)}get injector(){return this._debugContext.injector}get componentInstance(){return this._debugContext.component}get context(){return this._debugContext.context}get references(){return this._debugContext.references}get providerTokens(){return this._debugContext.providerTokens}}class Dy extends Ey{constructor(e,t,n){super(e,t,n),this.properties={},this.attributes={},this.classes={},this.styles={},this.childNodes=[],this.nativeElement=e}addChild(e){e&&(this.childNodes.push(e),e.parent=this)}removeChild(e){const t=this.childNodes.indexOf(e);-1!==t&&(e.parent=null,this.childNodes.splice(t,1))}insertChildrenAfter(e,t){const n=this.childNodes.indexOf(e);-1!==n&&(this.childNodes.splice(n+1,0,...t),t.forEach(t=>{t.parent&&t.parent.removeChild(t),e.parent=this}))}insertBefore(e,t){const n=this.childNodes.indexOf(e);-1===n?this.addChild(t):(t.parent&&t.parent.removeChild(t),t.parent=this,this.childNodes.splice(n,0,t))}query(e){return this.queryAll(e)[0]||null}queryAll(e){const t=[];return function e(t,n,l){t.childNodes.forEach(t=>{t instanceof Dy&&(n(t)&&l.push(t),e(t,n,l))})}(this,e,t),t}queryAllNodes(e){const t=[];return function e(t,n,l){t instanceof Dy&&t.childNodes.forEach(t=>{n(t)&&l.push(t),t instanceof Dy&&e(t,n,l)})}(this,e,t),t}get children(){return this.childNodes.filter(e=>e instanceof Dy)}triggerEventHandler(e,t){this.listeners.forEach(n=>{n.name==e&&n.callback(t)})}}function xy(e){return e.map(e=>e.nativeElement)}class ky{constructor(e){this.nativeNode=e}get parent(){const e=this.nativeNode.parentNode;return e?new Ay(e):null}get injector(){return yc(this.nativeNode)}get componentInstance(){const e=this.nativeNode;return e&&(fc(e)||mc(e))}get context(){return gc(this.nativeNode)}get listeners(){return Ic(this.nativeNode).filter(_c)}get references(){return function(e){const t=Cc(e);return void 0===t.localRefs&&(t.localRefs=function(e,n){const l=e[dn].data[t.nodeIndex];if(l&&l.localNames){const t={};let n=l.index+1;for(let r=0;r<l.localNames.length;r+=2)t[l.localNames[r]]=e[n],n++;return t}return null}(t.lView)),t.localRefs||{}}(this.nativeNode)}get providerTokens(){return function(e){const t=Cc(e,!1);if(!t)return[];const n=t.lView[dn],l=n.data[t.nodeIndex],r=[],i=l.directiveEnd;for(let s=65535&l.providerIndexes;s<i;s++){let e=n.data[s];void 0!==(o=e).type&&void 0!==o.template&&void 0!==o.declaredInputs&&(e=e.type),r.push(e)}var o;return r}(this.nativeNode)}}class Ay extends ky{constructor(e){super(e)}get nativeElement(){return this.nativeNode.nodeType==Node.ELEMENT_NODE?this.nativeNode:null}get name(){return this.nativeElement.nodeName}get properties(){const e=Cc(this.nativeNode),t=e.lView,n=t[dn].data,l=n[e.nodeIndex],r=function(e,t,n){const l={};let r=function(t,n){let l=e.propertyMetadataStartIndex-1,r=n[l];for(;"string"==typeof r&&!an(r);)r=n[--l];return l+1}(0,n);for(;r<e.propertyMetadataEndIndex;){let e,i=n[r];for(;!an(i);)e=(e||"")+en(t[r])+n[r],i=n[++r];e=void 0===e?t[r]:e+=t[r];const o=i.split(sn),s=o[0];s&&(l[s]=o[1]&&o[2]?o[1]+e+o[2]:e),r++}return l}(l,t,n),i=function(e,t,n){const l={};let r=e.directiveEnd,i=n[r];for(;"string"==typeof i;)l[i.split(sn)[0]]=t[r],i=n[++r];return l}(l,t,n),o=function(e){const t=e.classes;let n="";for(const l of Object.keys(t))t[l]&&(n=n?n+` ${l}`:l);return n}(this),s=Object.assign({},r,i);return o&&(s.className=s.className?s.className+` ${o}`:o),s}get attributes(){const e={},t=this.nativeElement;if(t){const n=t.attributes;for(let t=0;t<n.length;t++){const l=n[t];e[l.name]=l.value}}return e}get classes(){const e={},t=this.nativeElement;if(t){const n=Sc(t),l=fr(n.nodeIndex,n.lView);if(l){for(let t=10;t<l.length;t+=4)if(_o(l,t)){const n=jo(l,t),r=Bo(l,t);"boolean"==typeof r&&(e[n]=r)}}else{const n=t.classList;for(let t=0;t<n.length;t++)e[n[t]]=!0}}return e}get styles(){const e={},t=this.nativeElement;if(t){const n=Sc(t),l=fr(n.nodeIndex,n.lView);if(l){for(let t=10;t<l.length;t+=4)if(!_o(l,t)){const n=jo(l,t),r=Bo(l,t);null!==r&&(e[n]=r)}}else{const n=t.style;for(let t=0;t<n.length;t++){const l=n.item(t);e[l]=n.getPropertyValue(l)}}}return e}get childNodes(){const e=this.nativeNode.childNodes,t=[];for(let n=0;n<e.length;n++)t.push(My(e[n]));return t}get children(){const e=this.nativeElement;if(!e)return[];const t=e.children,n=[];for(let l=0;l<t.length;l++)n.push(My(t[l]));return n}query(e){return this.queryAll(e)[0]||null}queryAll(e){const t=[];return Ty(this,e,t,!0),t}queryAllNodes(e){const t=[];return Ty(this,e,t,!1),t}triggerEventHandler(e,t){this.listeners.forEach(n=>{n.name===e&&n.callback(t)})}}function Ty(e,t,n,l){const r=Cc(e.nativeNode);Ry(r.lView[dn].data[r.nodeIndex],r.lView,t,n,l,e.nativeNode)}function Ry(e,t,n,l,r,i){if(3===e.type||4===e.type){if(Ny(Bn(e,t),n,l,r,i),zn(e)){const o=Un(e.index,t);o&&o[dn].firstChild&&Ry(o[dn].firstChild,o,n,l,r,i)}else e.child&&Ry(e.child,t,n,l,r,i);const o=t[e.index];Fn(o)&&Oy(o,n,l,r,i)}else if(0===e.type){const o=t[e.index];Ny(o[On],n,l,r,i),Oy(o,n,l,r,i)}else if(1===e.type){const o=Ar(t),s=o[mn].projection[e.projection];if(Array.isArray(s))for(let e of s)Ny(e,n,l,r,i);else if(s){const e=o[pn];Ry(e[dn].data[s.index],e,n,l,r,i)}}else e.child&&Ry(e.child,t,n,l,r,i);const o=2&e.flags?e.projectionNext:e.next;o&&Ry(o,t,n,l,r,i)}function Oy(e,t,n,l,r){for(let i=0;i<e[Nn].length;i++){const o=e[Nn][i];Ry(o[dn].node,o,t,n,l,r)}}function Ny(e,t,n,l,r){if(r!==e){const r=Ly(e);r&&(!l||r instanceof Ay)&&t(r)&&n.push(r)}}const Py=new Map;function My(e){return e instanceof Node?e.nodeType==Node.ELEMENT_NODE?new Ay(e):new ky(e):null}const Ly=function(e){return Py.get(e)||null};function Fy(e){Py.set(e.nativeNode,e)}const Vy=Ey,By=Dy,jy=ay(null,"core",[{provide:hv,useValue:"unknown"},{provide:hy,deps:[xe]},{provide:Yv,deps:[]},{provide:gv,deps:[]}]),Hy=new we("LocaleId"),Uy=new we("Translations"),zy=new we("TranslationsFormat"),$y=function(){var e={Error:0,Warning:1,Ignore:2};return e[e.Error]="Error",e[e.Warning]="Warning",e[e.Ignore]="Ignore",e}();function qy(){return ah}function Wy(){return uh}function Gy(e){return e||"en-US"}const Ky=[{provide:fy,useClass:fy,deps:[zv,gv,xe,ei,yd,ov]},{provide:vf,deps:[zv],useFactory:Zy},{provide:ov,useClass:ov,deps:[[new y,iv]]},{provide:Dv,useClass:Dv,deps:[]},uv,{provide:nh,useFactory:qy,deps:[]},{provide:lh,useFactory:Wy,deps:[]},{provide:Hy,useFactory:Gy,deps:[[new v(Hy),new y,new C]]}];function Zy(e){let t=[];return e.onStable.subscribe(()=>{for(;t.length;)t.pop()()}),function(e){t.push(e)}}const Qy=(()=>(class{constructor(e){}}))();function Yy(e,t,n,l,r,i){e|=1;const{matchedQueries:o,references:s,matchedQueryIds:a}=Kh(t);return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:e,checkIndex:-1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:o,matchedQueryIds:a,references:s,ngContentIndex:n,childCount:l,bindings:[],bindingFlags:0,outputs:[],element:{ns:null,name:null,attrs:null,template:i?Jh(i):null,componentProvider:null,componentView:null,componentRendererType:null,publicProviders:null,allProviders:null,handleEvent:r||kh},provider:null,text:null,query:null,ngContent:null}}function Jy(e,t,n,l,r,i,o=[],s,a,u,c,d){u||(u=kh);const{matchedQueries:h,references:p,matchedQueryIds:f}=Kh(n);let g=null,m=null;i&&([g,m]=ip(i)),s=s||[];const v=new Array(s.length);for(let C=0;C<s.length;C++){const[e,t,n]=s[C],[l,r]=ip(t);let i=void 0,o=void 0;switch(15&e){case 4:o=n;break;case 1:case 8:i=n}v[C]={flags:e,ns:l,name:r,nonMinifiedName:r,securityContext:i,suffix:o}}a=a||[];const y=new Array(a.length);for(let C=0;C<a.length;C++){const[e,t]=a[C];y[C]={type:0,target:e,eventName:t,propName:null}}const b=(o=o||[]).map(([e,t])=>{const[n,l]=ip(e);return[n,l,t]});return d=function(e){if(e&&e.id===Oh){const t=null!=e.encapsulation&&e.encapsulation!==kt.None||e.styles.length||Object.keys(e.data).length;e.id=t?`c${Mh++}`:Nh}return e&&e.id===Nh&&(e=null),e||null}(d),c&&(t|=33554432),{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:e,flags:t|=1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:h,matchedQueryIds:f,references:p,ngContentIndex:l,childCount:r,bindings:v,bindingFlags:op(v),outputs:y,element:{ns:g,name:m,attrs:b,template:null,componentProvider:null,componentView:c||null,componentRendererType:d,publicProviders:null,allProviders:null,handleEvent:u||kh},provider:null,text:null,query:null,ngContent:null}}function Xy(e,t,n){const l=n.element,r=e.root.selectorOrNode,i=e.renderer;let o;if(e.parent||!r){o=l.name?i.createElement(l.name,l.ns):i.createComment("");const r=Qh(e,t,n);r&&i.appendChild(r,o)}else o=i.selectRootElement(r,!!l.componentRendererType&&l.componentRendererType.encapsulation===kt.ShadowDom);if(l.attrs)for(let s=0;s<l.attrs.length;s++){const[e,t,n]=l.attrs[s];i.setAttribute(o,t,n,e)}return o}function eb(e,t,n,l){for(let o=0;o<n.outputs.length;o++){const s=n.outputs[o],a=tb(e,n.nodeIndex,(i=s.eventName,(r=s.target)?`${r}:${i}`:i));let u=s.target,c=e;"component"===s.target&&(u=null,c=t);const d=c.renderer.listen(u||l,s.eventName,a);e.disposables[n.outputIndex+o]=d}var r,i}function tb(e,t,n){return l=>Hh(e,t,n,l)}function nb(e,t,n,l){if(!Fh(e,t,n,l))return!1;const r=t.bindings[n],i=Sh(e,t.nodeIndex),o=i.renderElement,s=r.name;switch(15&r.flags){case 1:!function(e,t,n,l,r,i){const o=t.securityContext;let s=o?e.root.sanitizer.sanitize(o,i):i;s=null!=s?s.toString():null;const a=e.renderer;null!=i?a.setAttribute(n,r,s,l):a.removeAttribute(n,r,l)}(e,r,o,r.ns,s,l);break;case 2:!function(e,t,n,l){const r=e.renderer;l?r.addClass(t,n):r.removeClass(t,n)}(e,o,s,l);break;case 4:!function(e,t,n,l,r){let i=e.root.sanitizer.sanitize(Vi.STYLE,r);if(null!=i){i=i.toString();const e=t.suffix;null!=e&&(i+=e)}else i=null;const o=e.renderer;null!=i?o.setStyle(n,l,i):o.removeStyle(n,l)}(e,r,o,s,l);break;case 8:!function(e,t,n,l,r){const i=t.securityContext;let o=i?e.root.sanitizer.sanitize(i,r):r;e.renderer.setProperty(n,l,o)}(33554432&t.flags&&32&r.flags?i.componentView:e,r,o,s,l)}return!0}function lb(e,t,n){let l=[];for(let r in n)l.push({propName:r,bindingType:n[r]});return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:-1,flags:e,childFlags:0,directChildFlags:0,childMatchedQueries:0,ngContentIndex:-1,matchedQueries:{},matchedQueryIds:0,references:{},childCount:0,bindings:[],bindingFlags:0,outputs:[],element:null,provider:null,text:null,query:{id:t,filterId:Gh(t),bindings:l},ngContent:null}}function rb(e){const t=e.def.nodeMatchedQueries;for(;e.parent&&Wh(e);){let n=e.parentNodeDef;e=e.parent;const l=n.nodeIndex+n.childCount;for(let r=0;r<=l;r++){const l=e.def.nodes[r];67108864&l.flags&&536870912&l.flags&&(l.query.filterId&t)===l.query.filterId&&Eh(e,r).setDirty(),!(1&l.flags&&r+l.childCount<n.nodeIndex)&&67108864&l.childFlags&&536870912&l.childFlags||(r+=l.childCount)}}if(134217728&e.def.nodeFlags)for(let n=0;n<e.def.nodes.length;n++){const t=e.def.nodes[n];134217728&t.flags&&536870912&t.flags&&Eh(e,n).setDirty(),n+=t.childCount}}function ib(e,t){const n=Eh(e,t.nodeIndex);if(!n.dirty)return;let l,r=void 0;if(67108864&t.flags){const n=t.parent.parent;r=ob(e,n.nodeIndex,n.nodeIndex+n.childCount,t.query,[]),l=_h(e,t.parent.nodeIndex).instance}else 134217728&t.flags&&(r=ob(e,0,e.def.nodes.length-1,t.query,[]),l=e.component);n.reset(r);const i=t.query.bindings;let o=!1;for(let s=0;s<i.length;s++){const e=i[s];let t;switch(e.bindingType){case 0:t=n.first;break;case 1:t=n,o=!0}l[e.propName]=t}o&&n.notifyOnChanges()}function ob(e,t,n,l,r){for(let i=t;i<=n;i++){const t=e.def.nodes[i],n=t.matchedQueries[l.id];if(null!=n&&r.push(sb(e,t,n)),1&t.flags&&t.element.template&&(t.element.template.nodeMatchedQueries&l.filterId)===l.filterId){const n=Sh(e,i);if((t.childMatchedQueries&l.filterId)===l.filterId&&(ob(e,i+1,i+t.childCount,l,r),i+=t.childCount),16777216&t.flags){const e=n.viewContainer._embeddedViews;for(let t=0;t<e.length;t++){const i=e[t],o=Uh(i);o&&o===n&&ob(i,0,i.def.nodes.length-1,l,r)}}const o=n.template._projectedViews;if(o)for(let e=0;e<o.length;e++){const t=o[e];ob(t,0,t.def.nodes.length-1,l,r)}}(t.childMatchedQueries&l.filterId)!==l.filterId&&(i+=t.childCount)}return r}function sb(e,t,n){if(null!=n)switch(n){case 1:return Sh(e,t.nodeIndex).renderElement;case 0:return new Od(Sh(e,t.nodeIndex).renderElement);case 2:return Sh(e,t.nodeIndex).template;case 3:return Sh(e,t.nodeIndex).viewContainer;case 4:return _h(e,t.nodeIndex).instance}}function ab(e,t){return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:-1,flags:8,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:e,childCount:0,bindings:[],bindingFlags:0,outputs:[],element:null,provider:null,text:null,query:null,ngContent:{index:t}}}function ub(e,t,n){const l=Qh(e,t,n);l&&tp(e,n.ngContent.index,1,l,null,void 0)}function cb(e,t){return pb(128,e,new Array(t+1))}function db(e,t){return pb(32,e,new Array(t))}function hb(e,t){const n=Object.keys(t),l=n.length,r=new Array(l);for(let i=0;i<l;i++){const e=n[i];r[t[e]]=e}return pb(64,e,r)}function pb(e,t,n){const l=new Array(n.length);for(let r=0;r<n.length;r++){const e=n[r];l[r]={flags:8,name:e,ns:null,nonMinifiedName:e,securityContext:null,suffix:null}}return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:e,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:-1,childCount:0,bindings:l,bindingFlags:op(l),outputs:[],element:null,provider:null,text:null,query:null,ngContent:null}}function fb(e,t,n){const l=new Array(n.length-1);for(let r=1;r<n.length;r++)l[r-1]={flags:8,name:null,ns:null,nonMinifiedName:null,securityContext:null,suffix:n[r]};return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:e,flags:2,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:t,childCount:0,bindings:l,bindingFlags:8,outputs:[],element:null,provider:null,text:{prefix:n[0]},query:null,ngContent:null}}function gb(e,t,n){let l;const r=e.renderer;l=r.createText(n.text.prefix);const i=Qh(e,t,n);return i&&r.appendChild(i,l),{renderText:l}}function mb(e,t){return(null!=e?e.toString():"")+t.suffix}function vb(e,t,n,l){let r=0,i=0,o=0,s=0,a=0,u=null,c=null,d=!1,h=!1,p=null;for(let f=0;f<t.length;f++){const e=t[f];if(e.nodeIndex=f,e.parent=u,e.bindingIndex=r,e.outputIndex=i,e.renderParent=c,o|=e.flags,a|=e.matchedQueryIds,e.element){const t=e.element;t.publicProviders=u?u.element.publicProviders:Object.create(null),t.allProviders=t.publicProviders,d=!1,h=!1,e.element.template&&(a|=e.element.template.nodeMatchedQueries)}if(bb(u,e,t.length),r+=e.bindings.length,i+=e.outputs.length,!c&&3&e.flags&&(p=e),20224&e.flags){d||(d=!0,u.element.publicProviders=Object.create(u.element.publicProviders),u.element.allProviders=u.element.publicProviders);const t=0!=(32768&e.flags);0==(8192&e.flags)||t?u.element.publicProviders[Th(e.provider.token)]=e:(h||(h=!0,u.element.allProviders=Object.create(u.element.publicProviders)),u.element.allProviders[Th(e.provider.token)]=e),t&&(u.element.componentProvider=e)}if(u?(u.childFlags|=e.flags,u.directChildFlags|=e.flags,u.childMatchedQueries|=e.matchedQueryIds,e.element&&e.element.template&&(u.childMatchedQueries|=e.element.template.nodeMatchedQueries)):s|=e.flags,e.childCount>0)u=e,yb(e)||(c=e);else for(;u&&f===u.nodeIndex+u.childCount;){const e=u.parent;e&&(e.childFlags|=u.childFlags,e.childMatchedQueries|=u.childMatchedQueries),c=(u=e)&&yb(u)?u.renderParent:u}}return{factory:null,nodeFlags:o,rootNodeFlags:s,nodeMatchedQueries:a,flags:e,nodes:t,updateDirectives:n||kh,updateRenderer:l||kh,handleEvent:(e,n,l,r)=>t[n].element.handleEvent(e,l,r),bindingCount:r,outputCount:i,lastRenderRootNode:p}}function yb(e){return 0!=(1&e.flags)&&null===e.element.name}function bb(e,t,n){const l=t.element&&t.element.template;if(l){if(!l.lastRenderRootNode)throw new Error("Illegal State: Embedded templates without nodes are not allowed!");if(l.lastRenderRootNode&&16777216&l.lastRenderRootNode.flags)throw new Error(`Illegal State: Last root node of a template can't have embedded views, at index ${t.nodeIndex}!`)}if(20224&t.flags&&0==(1&(e?e.flags:0)))throw new Error(`Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index ${t.nodeIndex}!`);if(t.query){if(67108864&t.flags&&(!e||0==(16384&e.flags)))throw new Error(`Illegal State: Content Query nodes need to be children of directives, at index ${t.nodeIndex}!`);if(134217728&t.flags&&e)throw new Error(`Illegal State: View Query nodes have to be top level nodes, at index ${t.nodeIndex}!`)}if(t.childCount){const l=e?e.nodeIndex+e.childCount:n-1;if(t.nodeIndex<=l&&t.nodeIndex+t.childCount>l)throw new Error(`Illegal State: childCount of node leads outside of parent, at index ${t.nodeIndex}!`)}}function Cb(e,t,n,l){const r=_b(e.root,e.renderer,e,t,n);return Ib(r,e.component,l),Eb(r),r}function wb(e,t,n){const l=_b(e,e.renderer,null,null,t);return Ib(l,n,n),Eb(l),l}function Sb(e,t,n,l){const r=t.element.componentRendererType;let i;return i=r?e.root.rendererFactory.createRenderer(l,r):e.root.renderer,_b(e.root,i,e,t.element.componentProvider,n)}function _b(e,t,n,l,r){const i=new Array(r.nodes.length),o=r.outputCount?new Array(r.outputCount):null;return{def:r,parent:n,viewContainerParent:null,parentNodeDef:l,context:null,component:null,nodes:i,state:13,root:e,renderer:t,oldValues:new Array(r.bindingCount),disposables:o,initIndex:-1}}function Ib(e,t,n){e.component=t,e.context=n}function Eb(e){let t;qh(e)&&(t=Sh(e.parent,e.parentNodeDef.parent.nodeIndex).renderElement);const n=e.def,l=e.nodes;for(let r=0;r<n.nodes.length;r++){const i=n.nodes[r];let o;switch(xh.setCurrentNode(e,r),201347067&i.flags){case 1:const n=Xy(e,t,i);let s=void 0;if(33554432&i.flags){const t=Jh(i.element.componentView);s=xh.createComponentView(e,i,t,n)}eb(e,s,i,n),o={renderElement:n,componentView:s,viewContainer:null,template:i.element.template?Pp(e,i):void 0},16777216&i.flags&&(o.viewContainer=Tp(e,i,o));break;case 2:o=gb(e,t,i);break;case 512:case 1024:case 2048:case 256:(o=l[r])||4096&i.flags||(o={instance:tf(e,i)});break;case 16:o={instance:nf(e,i)};break;case 16384:(o=l[r])||(o={instance:lf(e,i)}),32768&i.flags&&Ib(Sh(e,i.parent.nodeIndex).componentView,o.instance,o.instance);break;case 32:case 64:case 128:o={value:void 0};break;case 67108864:case 134217728:o=new Lg;break;case 8:ub(e,t,i),o=void 0}l[r]=o}Pb(e,Nb.CreateViewNodes),Vb(e,201326592,268435456,0)}function Db(e){Ab(e),xh.updateDirectives(e,1),Mb(e,Nb.CheckNoChanges),xh.updateRenderer(e,1),Pb(e,Nb.CheckNoChanges),e.state&=-97}function xb(e){1&e.state?(e.state&=-2,e.state|=2):e.state&=-3,bh(e,0,256),Ab(e),xh.updateDirectives(e,0),Mb(e,Nb.CheckAndUpdate),Vb(e,67108864,536870912,0);let t=bh(e,256,512);hf(e,2097152|(t?1048576:0)),xh.updateRenderer(e,0),Pb(e,Nb.CheckAndUpdate),Vb(e,134217728,536870912,0),hf(e,8388608|((t=bh(e,512,768))?4194304:0)),2&e.def.flags&&(e.state&=-9),e.state&=-97,bh(e,768,1024)}function kb(e,t,n,l,r,i,o,s,a,u,c,d,h){return 0===n?function(e,t,n,l,r,i,o,s,a,u,c,d){switch(201347067&t.flags){case 1:return function(e,t,n,l,r,i,o,s,a,u,c,d){const h=t.bindings.length;let p=!1;return h>0&&nb(e,t,0,n)&&(p=!0),h>1&&nb(e,t,1,l)&&(p=!0),h>2&&nb(e,t,2,r)&&(p=!0),h>3&&nb(e,t,3,i)&&(p=!0),h>4&&nb(e,t,4,o)&&(p=!0),h>5&&nb(e,t,5,s)&&(p=!0),h>6&&nb(e,t,6,a)&&(p=!0),h>7&&nb(e,t,7,u)&&(p=!0),h>8&&nb(e,t,8,c)&&(p=!0),h>9&&nb(e,t,9,d)&&(p=!0),p}(e,t,n,l,r,i,o,s,a,u,c,d);case 2:return function(e,t,n,l,r,i,o,s,a,u,c,d){let h=!1;const p=t.bindings,f=p.length;if(f>0&&Fh(e,t,0,n)&&(h=!0),f>1&&Fh(e,t,1,l)&&(h=!0),f>2&&Fh(e,t,2,r)&&(h=!0),f>3&&Fh(e,t,3,i)&&(h=!0),f>4&&Fh(e,t,4,o)&&(h=!0),f>5&&Fh(e,t,5,s)&&(h=!0),f>6&&Fh(e,t,6,a)&&(h=!0),f>7&&Fh(e,t,7,u)&&(h=!0),f>8&&Fh(e,t,8,c)&&(h=!0),f>9&&Fh(e,t,9,d)&&(h=!0),h){let h=t.text.prefix;f>0&&(h+=mb(n,p[0])),f>1&&(h+=mb(l,p[1])),f>2&&(h+=mb(r,p[2])),f>3&&(h+=mb(i,p[3])),f>4&&(h+=mb(o,p[4])),f>5&&(h+=mb(s,p[5])),f>6&&(h+=mb(a,p[6])),f>7&&(h+=mb(u,p[7])),f>8&&(h+=mb(c,p[8])),f>9&&(h+=mb(d,p[9]));const g=wh(e,t.nodeIndex).renderText;e.renderer.setValue(g,h)}return h}(e,t,n,l,r,i,o,s,a,u,c,d);case 16384:return function(e,t,n,l,r,i,o,s,a,u,c,d){const h=_h(e,t.nodeIndex),p=h.instance;let f=!1,g=void 0;const m=t.bindings.length;return m>0&&Lh(e,t,0,n)&&(f=!0,g=df(e,h,t,0,n,g)),m>1&&Lh(e,t,1,l)&&(f=!0,g=df(e,h,t,1,l,g)),m>2&&Lh(e,t,2,r)&&(f=!0,g=df(e,h,t,2,r,g)),m>3&&Lh(e,t,3,i)&&(f=!0,g=df(e,h,t,3,i,g)),m>4&&Lh(e,t,4,o)&&(f=!0,g=df(e,h,t,4,o,g)),m>5&&Lh(e,t,5,s)&&(f=!0,g=df(e,h,t,5,s,g)),m>6&&Lh(e,t,6,a)&&(f=!0,g=df(e,h,t,6,a,g)),m>7&&Lh(e,t,7,u)&&(f=!0,g=df(e,h,t,7,u,g)),m>8&&Lh(e,t,8,c)&&(f=!0,g=df(e,h,t,8,c,g)),m>9&&Lh(e,t,9,d)&&(f=!0,g=df(e,h,t,9,d,g)),g&&p.ngOnChanges(g),65536&t.flags&&Ch(e,256,t.nodeIndex)&&p.ngOnInit(),262144&t.flags&&p.ngDoCheck(),f}(e,t,n,l,r,i,o,s,a,u,c,d);case 32:case 64:case 128:return function(e,t,n,l,r,i,o,s,a,u,c,d){const h=t.bindings;let p=!1;const f=h.length;if(f>0&&Fh(e,t,0,n)&&(p=!0),f>1&&Fh(e,t,1,l)&&(p=!0),f>2&&Fh(e,t,2,r)&&(p=!0),f>3&&Fh(e,t,3,i)&&(p=!0),f>4&&Fh(e,t,4,o)&&(p=!0),f>5&&Fh(e,t,5,s)&&(p=!0),f>6&&Fh(e,t,6,a)&&(p=!0),f>7&&Fh(e,t,7,u)&&(p=!0),f>8&&Fh(e,t,8,c)&&(p=!0),f>9&&Fh(e,t,9,d)&&(p=!0),p){const p=Ih(e,t.nodeIndex);let g;switch(201347067&t.flags){case 32:g=new Array(h.length),f>0&&(g[0]=n),f>1&&(g[1]=l),f>2&&(g[2]=r),f>3&&(g[3]=i),f>4&&(g[4]=o),f>5&&(g[5]=s),f>6&&(g[6]=a),f>7&&(g[7]=u),f>8&&(g[8]=c),f>9&&(g[9]=d);break;case 64:g={},f>0&&(g[h[0].name]=n),f>1&&(g[h[1].name]=l),f>2&&(g[h[2].name]=r),f>3&&(g[h[3].name]=i),f>4&&(g[h[4].name]=o),f>5&&(g[h[5].name]=s),f>6&&(g[h[6].name]=a),f>7&&(g[h[7].name]=u),f>8&&(g[h[8].name]=c),f>9&&(g[h[9].name]=d);break;case 128:const e=n;switch(f){case 1:g=e.transform(n);break;case 2:g=e.transform(l);break;case 3:g=e.transform(l,r);break;case 4:g=e.transform(l,r,i);break;case 5:g=e.transform(l,r,i,o);break;case 6:g=e.transform(l,r,i,o,s);break;case 7:g=e.transform(l,r,i,o,s,a);break;case 8:g=e.transform(l,r,i,o,s,a,u);break;case 9:g=e.transform(l,r,i,o,s,a,u,c);break;case 10:g=e.transform(l,r,i,o,s,a,u,c,d)}}p.value=g}return p}(e,t,n,l,r,i,o,s,a,u,c,d);default:throw"unreachable"}}(e,t,l,r,i,o,s,a,u,c,d,h):function(e,t,n){switch(201347067&t.flags){case 1:return function(e,t,n){let l=!1;for(let r=0;r<n.length;r++)nb(e,t,r,n[r])&&(l=!0);return l}(e,t,n);case 2:return function(e,t,n){const l=t.bindings;let r=!1;for(let i=0;i<n.length;i++)Fh(e,t,i,n[i])&&(r=!0);if(r){let r="";for(let e=0;e<n.length;e++)r+=mb(n[e],l[e]);r=t.text.prefix+r;const i=wh(e,t.nodeIndex).renderText;e.renderer.setValue(i,r)}return r}(e,t,n);case 16384:return function(e,t,n){const l=_h(e,t.nodeIndex),r=l.instance;let i=!1,o=void 0;for(let s=0;s<n.length;s++)Lh(e,t,s,n[s])&&(i=!0,o=df(e,l,t,s,n[s],o));return o&&r.ngOnChanges(o),65536&t.flags&&Ch(e,256,t.nodeIndex)&&r.ngOnInit(),262144&t.flags&&r.ngDoCheck(),i}(e,t,n);case 32:case 64:case 128:return function(e,t,n){const l=t.bindings;let r=!1;for(let i=0;i<n.length;i++)Fh(e,t,i,n[i])&&(r=!0);if(r){const r=Ih(e,t.nodeIndex);let i;switch(201347067&t.flags){case 32:i=n;break;case 64:i={};for(let t=0;t<n.length;t++)i[l[t].name]=n[t];break;case 128:const e=n[0],r=n.slice(1);i=e.transform(...r)}r.value=i}return r}(e,t,n);default:throw"unreachable"}}(e,t,l)}function Ab(e){const t=e.def;if(4&t.nodeFlags)for(let n=0;n<t.nodes.length;n++){const l=t.nodes[n];if(4&l.flags){const t=Sh(e,n).template._projectedViews;if(t)for(let n=0;n<t.length;n++){const l=t[n];l.state|=32,jh(l,e)}}else 0==(4&l.childFlags)&&(n+=l.childCount)}}function Tb(e,t,n,l,r,i,o,s,a,u,c,d,h){return 0===n?function(e,t,n,l,r,i,o,s,a,u,c,d){const h=t.bindings.length;h>0&&Vh(e,t,0,n),h>1&&Vh(e,t,1,l),h>2&&Vh(e,t,2,r),h>3&&Vh(e,t,3,i),h>4&&Vh(e,t,4,o),h>5&&Vh(e,t,5,s),h>6&&Vh(e,t,6,a),h>7&&Vh(e,t,7,u),h>8&&Vh(e,t,8,c),h>9&&Vh(e,t,9,d)}(e,t,l,r,i,o,s,a,u,c,d,h):function(e,t,n){for(let l=0;l<n.length;l++)Vh(e,t,l,n[l])}(e,t,l),!1}function Rb(e,t){if(Eh(e,t.nodeIndex).dirty)throw mh(xh.createDebugContext(e,t.nodeIndex),`Query ${t.query.id} not dirty`,`Query ${t.query.id} dirty`,0!=(1&e.state))}function Ob(e){if(!(128&e.state)){if(Mb(e,Nb.Destroy),Pb(e,Nb.Destroy),hf(e,131072),e.disposables)for(let t=0;t<e.disposables.length;t++)e.disposables[t]();!function(e){if(!(16&e.state))return;const t=Uh(e);if(t){const n=t.template._projectedViews;n&&(Ip(n,n.indexOf(e)),xh.dirtyParentQueries(e))}}(e),e.renderer.destroyNode&&function(e){const t=e.def.nodes.length;for(let n=0;n<t;n++){const t=e.def.nodes[n];1&t.flags?e.renderer.destroyNode(Sh(e,n).renderElement):2&t.flags?e.renderer.destroyNode(wh(e,n).renderText):(67108864&t.flags||134217728&t.flags)&&Eh(e,n).destroy()}}(e),qh(e)&&e.renderer.destroy(),e.state|=128}}const Nb=function(){var e={CreateViewNodes:0,CheckNoChanges:1,CheckNoChangesProjectedViews:2,CheckAndUpdate:3,CheckAndUpdateProjectedViews:4,Destroy:5};return e[e.CreateViewNodes]="CreateViewNodes",e[e.CheckNoChanges]="CheckNoChanges",e[e.CheckNoChangesProjectedViews]="CheckNoChangesProjectedViews",e[e.CheckAndUpdate]="CheckAndUpdate",e[e.CheckAndUpdateProjectedViews]="CheckAndUpdateProjectedViews",e[e.Destroy]="Destroy",e}();function Pb(e,t){const n=e.def;if(33554432&n.nodeFlags)for(let l=0;l<n.nodes.length;l++){const r=n.nodes[l];33554432&r.flags?Lb(Sh(e,l).componentView,t):0==(33554432&r.childFlags)&&(l+=r.childCount)}}function Mb(e,t){const n=e.def;if(16777216&n.nodeFlags)for(let l=0;l<n.nodes.length;l++){const r=n.nodes[l];if(16777216&r.flags){const n=Sh(e,l).viewContainer._embeddedViews;for(let e=0;e<n.length;e++)Lb(n[e],t)}else 0==(16777216&r.childFlags)&&(l+=r.childCount)}}function Lb(e,t){const n=e.state;switch(t){case Nb.CheckNoChanges:0==(128&n)&&(12==(12&n)?Db(e):64&n&&Fb(e,Nb.CheckNoChangesProjectedViews));break;case Nb.CheckNoChangesProjectedViews:0==(128&n)&&(32&n?Db(e):64&n&&Fb(e,t));break;case Nb.CheckAndUpdate:0==(128&n)&&(12==(12&n)?xb(e):64&n&&Fb(e,Nb.CheckAndUpdateProjectedViews));break;case Nb.CheckAndUpdateProjectedViews:0==(128&n)&&(32&n?xb(e):64&n&&Fb(e,t));break;case Nb.Destroy:Ob(e);break;case Nb.CreateViewNodes:Eb(e)}}function Fb(e,t){Mb(e,t),Pb(e,t)}function Vb(e,t,n,l){if(!(e.def.nodeFlags&t&&e.def.nodeFlags&n))return;const r=e.def.nodes.length;for(let i=0;i<r;i++){const r=e.def.nodes[i];if(r.flags&t&&r.flags&n)switch(xh.setCurrentNode(e,r.nodeIndex),l){case 0:ib(e,r);break;case 1:Rb(e,r)}r.childFlags&t&&r.childFlags&n||(i+=r.childCount)}}let Bb=!1;function jb(){if(Bb)return;Bb=!0;const e=pi()?{setCurrentNode:uC,createRootView:Ub,createEmbeddedView:$b,createComponentView:qb,createNgModuleRef:Wb,overrideProvider:Qb,overrideComponentView:Yb,clearOverrides:Jb,checkAndUpdateView:nC,checkNoChangesView:lC,destroyView:rC,createDebugContext:(e,t)=>new vC(e,t),handleEvent:cC,updateDirectives:dC,updateRenderer:hC}:{setCurrentNode:()=>{},createRootView:Hb,createEmbeddedView:Cb,createComponentView:Sb,createNgModuleRef:Hp,overrideProvider:kh,overrideComponentView:kh,clearOverrides:kh,checkAndUpdateView:xb,checkNoChangesView:Db,destroyView:Ob,createDebugContext:(e,t)=>new vC(e,t),handleEvent:(e,t,n,l)=>e.def.handleEvent(e,t,n,l),updateDirectives:(e,t)=>e.def.updateDirectives(0===t?eC:tC,e),updateRenderer:(e,t)=>e.def.updateRenderer(0===t?eC:tC,e)};xh.setCurrentNode=e.setCurrentNode,xh.createRootView=e.createRootView,xh.createEmbeddedView=e.createEmbeddedView,xh.createComponentView=e.createComponentView,xh.createNgModuleRef=e.createNgModuleRef,xh.overrideProvider=e.overrideProvider,xh.overrideComponentView=e.overrideComponentView,xh.clearOverrides=e.clearOverrides,xh.checkAndUpdateView=e.checkAndUpdateView,xh.checkNoChangesView=e.checkNoChangesView,xh.destroyView=e.destroyView,xh.resolveDep=uf,xh.createDebugContext=e.createDebugContext,xh.handleEvent=e.handleEvent,xh.updateDirectives=e.updateDirectives,xh.updateRenderer=e.updateRenderer,xh.dirtyParentQueries=rb}function Hb(e,t,n,l,r,i){const o=r.injector.get(Bd);return wb(zb(e,r,o,t,n),l,i)}function Ub(e,t,n,l,r,i){const o=r.injector.get(Bd),s=zb(e,r,new wC(o),t,n),a=Xb(l);return bC(iC.create,wb,null,[s,a,i])}function zb(e,t,n,l,r){const i=t.injector.get(Bi),o=t.injector.get(ei),s=n.createRenderer(null,null);return{ngModule:t,injector:e,projectableNodes:l,selectorOrNode:r,sanitizer:i,rendererFactory:n,renderer:s,errorHandler:o}}function $b(e,t,n,l){const r=Xb(n);return bC(iC.create,Cb,null,[e,t,r,l])}function qb(e,t,n,l){return n=Zb.get(t.element.componentProvider.provider.token)||Xb(n),bC(iC.create,Sb,null,[e,t,n,l])}function Wb(e,t,n,l){return Hp(e,t,n,function(e){const{hasOverrides:t,hasDeprecatedOverrides:n}=function(e){let t=!1,n=!1;return 0===Gb.size?{hasOverrides:t,hasDeprecatedOverrides:n}:(e.providers.forEach(e=>{const l=Gb.get(e.token);3840&e.flags&&l&&(t=!0,n=n||l.deprecatedBehavior)}),e.modules.forEach(e=>{Kb.forEach((l,r)=>{A(r).providedIn===e&&(t=!0,n=n||l.deprecatedBehavior)})}),{hasOverrides:t,hasDeprecatedOverrides:n})}(e);return t?(function(e){for(let t=0;t<e.providers.length;t++){const l=e.providers[t];n&&(l.flags|=4096);const r=Gb.get(l.token);r&&(l.flags=-3841&l.flags|r.flags,l.deps=Zh(r.deps),l.value=r.value)}if(Kb.size>0){let t=new Set(e.modules);Kb.forEach((l,r)=>{if(t.has(A(r).providedIn)){let t={token:r,flags:l.flags|(n?4096:0),deps:Zh(l.deps),value:l.value,index:e.providers.length};e.providers.push(t),e.providersByKey[Th(r)]=t}})}}(e=e.factory(()=>kh)),e):e}(l))}const Gb=new Map,Kb=new Map,Zb=new Map;function Qb(e){let t;Gb.set(e.token,e),"function"==typeof e.token&&(t=A(e.token))&&"function"==typeof t.providedIn&&Kb.set(e.token,e)}function Yb(e,t){const n=Jh(xp(t)),l=Jh(n.nodes[0].element.componentView);Zb.set(e,l)}function Jb(){Gb.clear(),Kb.clear(),Zb.clear()}function Xb(e){if(0===Gb.size)return e;const t=function(e){const t=[];let n=null;for(let l=0;l<e.nodes.length;l++){const r=e.nodes[l];1&r.flags&&(n=r),n&&3840&r.flags&&Gb.has(r.provider.token)&&(t.push(n.nodeIndex),n=null)}return t}(e);if(0===t.length)return e;e=e.factory(()=>kh);for(let l=0;l<t.length;l++)n(e,t[l]);return e;function n(e,t){for(let n=t+1;n<e.nodes.length;n++){const t=e.nodes[n];if(1&t.flags)return;if(3840&t.flags){const e=t.provider,n=Gb.get(e.token);n&&(t.flags=-3841&t.flags|n.flags,e.deps=Zh(n.deps),e.value=n.value)}}}}function eC(e,t,n,l,r,i,o,s,a,u,c,d,h){const p=e.def.nodes[t];return kb(e,p,n,l,r,i,o,s,a,u,c,d,h),224&p.flags?Ih(e,t).value:void 0}function tC(e,t,n,l,r,i,o,s,a,u,c,d,h){const p=e.def.nodes[t];return Tb(e,p,n,l,r,i,o,s,a,u,c,d,h),224&p.flags?Ih(e,t).value:void 0}function nC(e){return bC(iC.detectChanges,xb,null,[e])}function lC(e){return bC(iC.checkNoChanges,Db,null,[e])}function rC(e){return bC(iC.destroy,Ob,null,[e])}const iC=function(){var e={create:0,detectChanges:1,checkNoChanges:2,destroy:3,handleEvent:4};return e[e.create]="create",e[e.detectChanges]="detectChanges",e[e.checkNoChanges]="checkNoChanges",e[e.destroy]="destroy",e[e.handleEvent]="handleEvent",e}();let oC,sC,aC;function uC(e,t){sC=e,aC=t}function cC(e,t,n,l){return uC(e,t),bC(iC.handleEvent,e.def.handleEvent,null,[e,t,n,l])}function dC(e,t){if(128&e.state)throw yh(iC[oC]);return uC(e,gC(e,0)),e.def.updateDirectives(function(e,n,l,...r){const i=e.def.nodes[n];return 0===t?pC(e,i,l,r):fC(e,i,l,r),16384&i.flags&&uC(e,gC(e,n)),224&i.flags?Ih(e,i.nodeIndex).value:void 0},e)}function hC(e,t){if(128&e.state)throw yh(iC[oC]);return uC(e,mC(e,0)),e.def.updateRenderer(function(e,n,l,...r){const i=e.def.nodes[n];return 0===t?pC(e,i,l,r):fC(e,i,l,r),3&i.flags&&uC(e,mC(e,n)),224&i.flags?Ih(e,i.nodeIndex).value:void 0},e)}function pC(e,t,n,l){if(kb(e,t,n,...l)){const o=1===n?l[0]:l;if(16384&t.flags){const n={};for(let e=0;e<t.bindings.length;e++){const l=t.bindings[e],s=o[e];8&l.flags&&(n[(r=l.nonMinifiedName,i=void 0,i=r.replace(/[$@]/g,"_"),`ng-reflect-${r=i.replace(Ji,(...e)=>"-"+e[1].toLowerCase())}`)]=Xi(s))}const l=t.parent,s=Sh(e,l.nodeIndex).renderElement;if(l.element.name)for(let t in n){const l=n[t];null!=l?e.renderer.setAttribute(s,t,l):e.renderer.removeAttribute(s,t)}else e.renderer.setValue(s,`bindings=${JSON.stringify(n,null,2)}`)}}var r,i}function fC(e,t,n,l){Tb(e,t,n,...l)}function gC(e,t){for(let n=t;n<e.def.nodes.length;n++){const t=e.def.nodes[n];if(16384&t.flags&&t.bindings&&t.bindings.length)return n}return null}function mC(e,t){for(let n=t;n<e.def.nodes.length;n++){const t=e.def.nodes[n];if(3&t.flags&&t.bindings&&t.bindings.length)return n}return null}class vC{constructor(e,t){this.view=e,this.nodeIndex=t,null==t&&(this.nodeIndex=t=0),this.nodeDef=e.def.nodes[t];let n=this.nodeDef,l=e;for(;n&&0==(1&n.flags);)n=n.parent;if(!n)for(;!n&&l;)n=zh(l),l=l.parent;this.elDef=n,this.elView=l}get elOrCompView(){return Sh(this.elView,this.elDef.nodeIndex).componentView||this.view}get injector(){return Lp(this.elView,this.elDef)}get component(){return this.elOrCompView.component}get context(){return this.elOrCompView.context}get providerTokens(){const e=[];if(this.elDef)for(let t=this.elDef.nodeIndex+1;t<=this.elDef.nodeIndex+this.elDef.childCount;t++){const n=this.elView.def.nodes[t];20224&n.flags&&e.push(n.provider.token),t+=n.childCount}return e}get references(){const e={};if(this.elDef){yC(this.elView,this.elDef,e);for(let t=this.elDef.nodeIndex+1;t<=this.elDef.nodeIndex+this.elDef.childCount;t++){const n=this.elView.def.nodes[t];20224&n.flags&&yC(this.elView,n,e),t+=n.childCount}}return e}get componentRenderElement(){const e=function(e){for(;e&&!qh(e);)e=e.parent;return e.parent?Sh(e.parent,zh(e).nodeIndex):null}(this.elOrCompView);return e?e.renderElement:void 0}get renderNode(){return 2&this.nodeDef.flags?$h(this.view,this.nodeDef):$h(this.elView,this.elDef)}logError(e,...t){let n,l;2&this.nodeDef.flags?(n=this.view.def,l=this.nodeDef.nodeIndex):(n=this.elView.def,l=this.elDef.nodeIndex);const r=function(e,t){let n=-1;for(let l=0;l<=t;l++)3&e.nodes[l].flags&&n++;return n}(n,l);let i=-1;n.factory(()=>++i===r?e.error.bind(e,...t):kh),i<r&&(e.error("Illegal state: the ViewDefinitionFactory did not call the logger!"),e.error(...t))}}function yC(e,t,n){for(let l in t.references)n[l]=sb(e,t,t.references[l])}function bC(e,t,n,l){const r=oC,i=sC,o=aC;try{oC=e;const a=t.apply(n,l);return sC=i,aC=o,oC=r,a}catch(s){if(Yr(s)||!sC)throw s;throw function(e,t){return e instanceof Error||(e=new Error(e.toString())),vh(e,t),e}(s,CC())}}function CC(){return sC?new vC(sC,aC):null}class wC{constructor(e){this.delegate=e}createRenderer(e,t){return new SC(this.delegate.createRenderer(e,t))}begin(){this.delegate.begin&&this.delegate.begin()}end(){this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.delegate.whenRenderingDone?this.delegate.whenRenderingDone():Promise.resolve(null)}}class SC{constructor(e){this.delegate=e,this.debugContextFactory=CC,this.data=this.delegate.data}createDebugContext(e){return this.debugContextFactory(e)}destroyNode(e){!function(e){Py.delete(e.nativeNode)}(Ly(e)),this.delegate.destroyNode&&this.delegate.destroyNode(e)}destroy(){this.delegate.destroy()}createElement(e,t){const n=this.delegate.createElement(e,t),l=this.createDebugContext(n);if(l){const t=new Dy(n,null,l);t.name=e,Fy(t)}return n}createComment(e){const t=this.delegate.createComment(e),n=this.createDebugContext(t);return n&&Fy(new Ey(t,null,n)),t}createText(e){const t=this.delegate.createText(e),n=this.createDebugContext(t);return n&&Fy(new Ey(t,null,n)),t}appendChild(e,t){const n=Ly(e),l=Ly(t);n&&l&&n instanceof Dy&&n.addChild(l),this.delegate.appendChild(e,t)}insertBefore(e,t,n){const l=Ly(e),r=Ly(t),i=Ly(n);l&&r&&l instanceof Dy&&l.insertBefore(i,r),this.delegate.insertBefore(e,t,n)}removeChild(e,t){const n=Ly(e),l=Ly(t);n&&l&&n instanceof Dy&&n.removeChild(l),this.delegate.removeChild(e,t)}selectRootElement(e,t){const n=this.delegate.selectRootElement(e,t),l=CC();return l&&Fy(new Dy(n,null,l)),n}setAttribute(e,t,n,l){const r=Ly(e);r&&r instanceof Dy&&(r.attributes[l?l+":"+t:t]=n),this.delegate.setAttribute(e,t,n,l)}removeAttribute(e,t,n){const l=Ly(e);l&&l instanceof Dy&&(l.attributes[n?n+":"+t:t]=null),this.delegate.removeAttribute(e,t,n)}addClass(e,t){const n=Ly(e);n&&n instanceof Dy&&(n.classes[t]=!0),this.delegate.addClass(e,t)}removeClass(e,t){const n=Ly(e);n&&n instanceof Dy&&(n.classes[t]=!1),this.delegate.removeClass(e,t)}setStyle(e,t,n,l){const r=Ly(e);r&&r instanceof Dy&&(r.styles[t]=n),this.delegate.setStyle(e,t,n,l)}removeStyle(e,t,n){const l=Ly(e);l&&l instanceof Dy&&(l.styles[t]=null),this.delegate.removeStyle(e,t,n)}setProperty(e,t,n){const l=Ly(e);l&&l instanceof Dy&&(l.properties[t]=n),this.delegate.setProperty(e,t,n)}listen(e,t,n){if("string"!=typeof e){const l=Ly(e);l&&l.listeners.push(new Iy(t,n))}return this.delegate.listen(e,t,n)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setValue(e,t){return this.delegate.setValue(e,t)}}function _C(e){return jb(),xh.overrideProvider(e)}function IC(e,t){return jb(),xh.overrideComponentView(e,t)}function EC(){return jb(),xh.clearOverrides()}function DC(e,t,n){return new xC(e,t,n)}class xC extends Sd{constructor(e,t,n){super(),this.moduleType=e,this._bootstrapComponents=t,this._ngModuleDefFactory=n}create(e){jb();const t=function(e){const t=Array.from(e.providers),n=Array.from(e.modules),l={};for(const r in e.providersByKey)l[r]=e.providersByKey[r];return{factory:e.factory,isRoot:e.isRoot,providers:t,modules:n,providersByKey:l}}(Jh(this._ngModuleDefFactory));return xh.createNgModuleRef(this.moduleType,e||xe.NULL,this._bootstrapComponents,t)}}},"9ppp":function(e,t,n){"use strict";function l(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}n.d(t,"a",function(){return r}),l.prototype=Object.create(Error.prototype);const r=l},Cfvw:function(e,t,n){"use strict";var l=n("HDdC"),r=n("SeVD"),i=n("quSY"),o=n("kJWO"),s=n("jZKg"),a=n("Lhse"),u=n("c2HN"),c=n("I55L");function d(e,t){return t?function(e,t){if(null!=e){if(function(e){return e&&"function"==typeof e[o.a]}(e))return function(e,t){return new l.a(n=>{const l=new i.a;return l.add(t.schedule(()=>{const r=e[o.a]();l.add(r.subscribe({next(e){l.add(t.schedule(()=>n.next(e)))},error(e){l.add(t.schedule(()=>n.error(e)))},complete(){l.add(t.schedule(()=>n.complete()))}}))})),l})}(e,t);if(Object(u.a)(e))return function(e,t){return new l.a(n=>{const l=new i.a;return l.add(t.schedule(()=>e.then(e=>{l.add(t.schedule(()=>{n.next(e),l.add(t.schedule(()=>n.complete()))}))},e=>{l.add(t.schedule(()=>n.error(e)))}))),l})}(e,t);if(Object(c.a)(e))return Object(s.a)(e,t);if(function(e){return e&&"function"==typeof e[a.a]}(e)||"string"==typeof e)return function(e,t){if(!e)throw new Error("Iterable cannot be null");return new l.a(n=>{const l=new i.a;let r;return l.add(()=>{r&&"function"==typeof r.return&&r.return()}),l.add(t.schedule(()=>{r=e[a.a](),l.add(t.schedule(function(){if(n.closed)return;let e,t;try{const i=r.next();e=i.value,t=i.done}catch(l){return void n.error(l)}t?n.complete():(n.next(e),this.schedule())}))})),l})}(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}(e,t):e instanceof l.a?e:new l.a(Object(r.a)(e))}n.d(t,"a",function(){return d})},DH7j:function(e,t,n){"use strict";n.d(t,"a",function(){return l});const l=Array.isArray||(e=>e&&"number"==typeof e.length)},HDdC:function(e,t,n){"use strict";var l=n("7o/Q"),r=n("2QA8"),i=n("gRHU"),o=n("kJWO"),s=n("mCNh"),a=n("2fFW");n.d(t,"a",function(){return u});const u=(()=>{class e{constructor(e){this._isScalar=!1,e&&(this._subscribe=e)}lift(t){const n=new e;return n.source=this,n.operator=t,n}subscribe(e,t,n){const{operator:o}=this,s=function(e,t,n){if(e){if(e instanceof l.a)return e;if(e[r.a])return e[r.a]()}return e||t||n?new l.a(e,t,n):new l.a(i.a)}(e,t,n);if(s.add(o?o.call(s,this.source):this.source||a.a.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),a.a.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s}_trySubscribe(e){try{return this._subscribe(e)}catch(t){a.a.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){const{closed:t,destination:n,isStopped:r}=e;if(t||r)return!1;e=n&&n instanceof l.a?n:null}return!0}(e)?e.error(t):console.warn(t)}}forEach(e,t){return new(t=c(t))((t,n)=>{let l;l=this.subscribe(t=>{try{e(t)}catch(r){n(r),l&&l.unsubscribe()}},n,t)})}_subscribe(e){const{source:t}=this;return t&&t.subscribe(e)}[o.a](){return this}pipe(...e){return 0===e.length?this:Object(s.b)(e)(this)}toPromise(e){return new(e=c(e))((e,t)=>{let n;this.subscribe(e=>n=e,e=>t(e),()=>e(n))})}}return e.create=(t=>new e(t)),e})();function c(e){if(e||(e=a.a.Promise||Promise),!e)throw new Error("no Promise impl found");return e}},I55L:function(e,t,n){"use strict";n.d(t,"a",function(){return l});const l=e=>e&&"number"==typeof e.length&&"function"!=typeof e},KqfI:function(e,t,n){"use strict";function l(){}n.d(t,"a",function(){return l})},Lhse:function(e,t,n){"use strict";function l(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.d(t,"a",function(){return r});const r=l()},NJ4a:function(e,t,n){"use strict";function l(e){setTimeout(()=>{throw e},0)}n.d(t,"a",function(){return l})},SVse:function(e,t,n){"use strict";n.r(t),n.d(t,"\u0275angular_packages_common_common_e",function(){return yt}),n.d(t,"\u0275angular_packages_common_common_j",function(){return qe}),n.d(t,"\u0275angular_packages_common_common_i",function(){return ze}),n.d(t,"\u0275angular_packages_common_common_h",function(){return Ue}),n.d(t,"\u0275angular_packages_common_common_m",function(){return pt}),n.d(t,"\u0275angular_packages_common_common_l",function(){return dt}),n.d(t,"\u0275angular_packages_common_common_k",function(){return ct}),n.d(t,"\u0275angular_packages_common_common_d",function(){return $}),n.d(t,"\u0275angular_packages_common_common_a",function(){return ke}),n.d(t,"\u0275angular_packages_common_common_b",function(){return Oe}),n.d(t,"\u0275angular_packages_common_common_g",function(){return Ut}),n.d(t,"\u0275angular_packages_common_common_f",function(){return dn}),n.d(t,"\u0275registerLocaleData",function(){return g}),n.d(t,"registerLocaleData",function(){return g}),n.d(t,"formatDate",function(){return ee}),n.d(t,"formatCurrency",function(){return _e}),n.d(t,"formatNumber",function(){return Ee}),n.d(t,"formatPercent",function(){return Ie}),n.d(t,"NgLocaleLocalization",function(){return Re}),n.d(t,"NgLocalization",function(){return Ae}),n.d(t,"Plural",function(){return y}),n.d(t,"NumberFormatStyle",function(){return v}),n.d(t,"FormStyle",function(){return b}),n.d(t,"TranslationWidth",function(){return C}),n.d(t,"FormatWidth",function(){return w}),n.d(t,"NumberSymbol",function(){return S}),n.d(t,"WeekDay",function(){return _}),n.d(t,"getNumberOfCurrencyDigits",function(){return G}),n.d(t,"getCurrencySymbol",function(){return q}),n.d(t,"getLocaleDayPeriods",function(){return E}),n.d(t,"getLocaleDayNames",function(){return D}),n.d(t,"getLocaleMonthNames",function(){return x}),n.d(t,"getLocaleId",function(){return I}),n.d(t,"getLocaleEraNames",function(){return k}),n.d(t,"getLocaleWeekEndRange",function(){return T}),n.d(t,"getLocaleFirstDayOfWeek",function(){return A}),n.d(t,"getLocaleDateFormat",function(){return R}),n.d(t,"getLocaleDateTimeFormat",function(){return N}),n.d(t,"getLocaleExtraDayPeriodRules",function(){return j}),n.d(t,"getLocaleExtraDayPeriods",function(){return H}),n.d(t,"getLocalePluralCase",function(){return V}),n.d(t,"getLocaleTimeFormat",function(){return O}),n.d(t,"getLocaleNumberSymbol",function(){return P}),n.d(t,"getLocaleNumberFormat",function(){return M}),n.d(t,"getLocaleCurrencyName",function(){return F}),n.d(t,"getLocaleCurrencySymbol",function(){return L}),n.d(t,"\u0275parseCookieValue",function(){return Ne}),n.d(t,"CommonModule",function(){return hn}),n.d(t,"DeprecatedI18NPipesModule",function(){return pn}),n.d(t,"NgClass",function(){return Ke}),n.d(t,"NgClassBase",function(){return Ge}),n.d(t,"NgForOf",function(){return Ye}),n.d(t,"NgForOfContext",function(){return Qe}),n.d(t,"NgIf",function(){return Xe}),n.d(t,"NgIfContext",function(){return et}),n.d(t,"NgPlural",function(){return ot}),n.d(t,"NgPluralCase",function(){return st}),n.d(t,"NgStyle",function(){return mt}),n.d(t,"NgStyleBase",function(){return gt}),n.d(t,"NgSwitch",function(){return lt}),n.d(t,"NgSwitchCase",function(){return rt}),n.d(t,"NgSwitchDefault",function(){return it}),n.d(t,"NgTemplateOutlet",function(){return vt}),n.d(t,"NgComponentOutlet",function(){return Ze}),n.d(t,"DOCUMENT",function(){return fn}),n.d(t,"AsyncPipe",function(){return Gt}),n.d(t,"DatePipe",function(){return Jt}),n.d(t,"I18nPluralPipe",function(){return en}),n.d(t,"I18nSelectPipe",function(){return tn}),n.d(t,"JsonPipe",function(){return nn}),n.d(t,"LowerCasePipe",function(){return Kt}),n.d(t,"CurrencyPipe",function(){return sn}),n.d(t,"DecimalPipe",function(){return rn}),n.d(t,"PercentPipe",function(){return on}),n.d(t,"SlicePipe",function(){return cn}),n.d(t,"UpperCasePipe",function(){return Yt}),n.d(t,"TitleCasePipe",function(){return Qt}),n.d(t,"KeyValuePipe",function(){return ln}),n.d(t,"DeprecatedDatePipe",function(){return Lt}),n.d(t,"DeprecatedCurrencyPipe",function(){return Ht}),n.d(t,"DeprecatedDecimalPipe",function(){return Bt}),n.d(t,"DeprecatedPercentPipe",function(){return jt}),n.d(t,"\u0275PLATFORM_BROWSER_ID",function(){return gn}),n.d(t,"\u0275PLATFORM_SERVER_ID",function(){return mn}),n.d(t,"\u0275PLATFORM_WORKER_APP_ID",function(){return vn}),n.d(t,"\u0275PLATFORM_WORKER_UI_ID",function(){return yn}),n.d(t,"isPlatformBrowser",function(){return bn}),n.d(t,"isPlatformServer",function(){return Cn}),n.d(t,"isPlatformWorkerApp",function(){return wn}),n.d(t,"isPlatformWorkerUi",function(){return Sn}),n.d(t,"VERSION",function(){return _n}),n.d(t,"ViewportScroller",function(){return In}),n.d(t,"\u0275NullViewportScroller",function(){return Dn}),n.d(t,"\u0275NgClassImplProvider__POST_R3__",function(){return $e}),n.d(t,"\u0275NgClassR2Impl",function(){return He}),n.d(t,"\u0275NgClassImpl",function(){return je}),n.d(t,"\u0275NgStyleImplProvider__POST_R3__",function(){return ht}),n.d(t,"\u0275NgStyleR2Impl",function(){return ut}),n.d(t,"\u0275NgStyleImpl",function(){return at}),n.d(t,"\u0275ngStyleDirectiveDef__POST_R3__",function(){return ft}),n.d(t,"\u0275ngClassDirectiveDef__POST_R3__",function(){return We}),n.d(t,"PlatformLocation",function(){return r}),n.d(t,"LOCATION_INITIALIZED",function(){return i}),n.d(t,"LocationStrategy",function(){return o}),n.d(t,"APP_BASE_HREF",function(){return s}),n.d(t,"HashLocationStrategy",function(){return c}),n.d(t,"PathLocationStrategy",function(){return d}),n.d(t,"Location",function(){return a});var l=n("8Y7J");class r{}const i=new l.InjectionToken("Location Initialized");class o{}const s=new l.InjectionToken("appBaseHref"),a=(()=>{class e{constructor(t,n){this._subject=new l.EventEmitter,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=n,this._baseHref=e.stripTrailingSlash(u(r)),this._platformStrategy.onPopState(e=>{this._subject.emit({url:this.path(!0),pop:!0,state:e.state,type:e.type})})}path(e=!1){return this.normalize(this._platformStrategy.path(e))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,n=""){return this.path()==this.normalize(t+e.normalizeQueryParams(n))}normalize(t){return e.stripTrailingSlash(function(e,t){return e&&t.startsWith(e)?t.substring(e.length):t}(this._baseHref,u(t)))}prepareExternalUrl(e){return e&&"/"!==e[0]&&(e="/"+e),this._platformStrategy.prepareExternalUrl(e)}go(t,n="",l=null){this._platformStrategy.pushState(l,"",t,n),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+e.normalizeQueryParams(n)),l)}replaceState(t,n="",l=null){this._platformStrategy.replaceState(l,"",t,n),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+e.normalizeQueryParams(n)),l)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}onUrlChange(e){this._urlChangeListeners.push(e),this.subscribe(e=>{this._notifyUrlChangeListeners(e.url,e.state)})}_notifyUrlChangeListeners(e="",t){this._urlChangeListeners.forEach(n=>n(e,t))}subscribe(e,t,n){return this._subject.subscribe({next:e,error:t,complete:n})}static normalizeQueryParams(e){return e&&"?"!==e[0]?"?"+e:e}static joinWithSlash(e,t){if(0==e.length)return t;if(0==t.length)return e;let n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,2==n?e+t.substring(1):1==n?e+t:e+"/"+t}static stripTrailingSlash(e){const t=e.match(/#|\?|$/),n=t&&t.index||e.length;return e.slice(0,n-("/"===e[n-1]?1:0))+e.slice(n)}}return e})();function u(e){return e.replace(/\/index.html$/,"")}const c=(()=>(class extends o{constructor(e,t){super(),this._platformLocation=e,this._baseHref="",null!=t&&(this._baseHref=t)}onPopState(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)}getBaseHref(){return this._baseHref}path(e=!1){let t=this._platformLocation.hash;return null==t&&(t="#"),t.length>0?t.substring(1):t}prepareExternalUrl(e){const t=a.joinWithSlash(this._baseHref,e);return t.length>0?"#"+t:t}pushState(e,t,n,l){let r=this.prepareExternalUrl(n+a.normalizeQueryParams(l));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.pushState(e,t,r)}replaceState(e,t,n,l){let r=this.prepareExternalUrl(n+a.normalizeQueryParams(l));0==r.length&&(r=this._platformLocation.pathname),this._platformLocation.replaceState(e,t,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}))(),d=(()=>(class extends o{constructor(e,t){if(super(),this._platformLocation=e,null==t&&(t=this._platformLocation.getBaseHrefFromDOM()),null==t)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=t}onPopState(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)}getBaseHref(){return this._baseHref}prepareExternalUrl(e){return a.joinWithSlash(this._baseHref,e)}path(e=!1){const t=this._platformLocation.pathname+a.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&e?`${t}${n}`:t}pushState(e,t,n,l){const r=this.prepareExternalUrl(n+a.normalizeQueryParams(l));this._platformLocation.pushState(e,t,r)}replaceState(e,t,n,l){const r=this.prepareExternalUrl(n+a.normalizeQueryParams(l));this._platformLocation.replaceState(e,t,r)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}))(),h=void 0;var p=["en",[["a","p"],["AM","PM"],h],[["AM","PM"],h,h],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],h,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],h,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",h,"{1} 'at' {0}",h],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"$","US Dollar",{},function(e){let t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===n?1:5}];const f={};function g(e,t,n){"string"!=typeof t&&(n=t,t=e[0]),t=t.toLowerCase().replace(/_/g,"-"),f[t]=e,n&&(f[t][19]=n)}const m={ADP:[void 0,void 0,0],AFN:[void 0,void 0,0],ALL:[void 0,void 0,0],AMD:[void 0,void 0,0],AOA:[void 0,"Kz"],ARS:[void 0,"$"],AUD:["A$","$"],BAM:[void 0,"KM"],BBD:[void 0,"$"],BDT:[void 0,"\u09f3"],BHD:[void 0,void 0,3],BIF:[void 0,void 0,0],BMD:[void 0,"$"],BND:[void 0,"$"],BOB:[void 0,"Bs"],BRL:["R$"],BSD:[void 0,"$"],BWP:[void 0,"P"],BYN:[void 0,"\u0440.",2],BYR:[void 0,void 0,0],BZD:[void 0,"$"],CAD:["CA$","$",2],CHF:[void 0,void 0,2],CLF:[void 0,void 0,4],CLP:[void 0,"$",0],CNY:["CN\xa5","\xa5"],COP:[void 0,"$",0],CRC:[void 0,"\u20a1",2],CUC:[void 0,"$"],CUP:[void 0,"$"],CZK:[void 0,"K\u010d",2],DJF:[void 0,void 0,0],DKK:[void 0,"kr",2],DOP:[void 0,"$"],EGP:[void 0,"E\xa3"],ESP:[void 0,"\u20a7",0],EUR:["\u20ac"],FJD:[void 0,"$"],FKP:[void 0,"\xa3"],GBP:["\xa3"],GEL:[void 0,"\u20be"],GIP:[void 0,"\xa3"],GNF:[void 0,"FG",0],GTQ:[void 0,"Q"],GYD:[void 0,"$",0],HKD:["HK$","$"],HNL:[void 0,"L"],HRK:[void 0,"kn"],HUF:[void 0,"Ft",2],IDR:[void 0,"Rp",0],ILS:["\u20aa"],INR:["\u20b9"],IQD:[void 0,void 0,0],IRR:[void 0,void 0,0],ISK:[void 0,"kr",0],ITL:[void 0,void 0,0],JMD:[void 0,"$"],JOD:[void 0,void 0,3],JPY:["\xa5",void 0,0],KHR:[void 0,"\u17db"],KMF:[void 0,"CF",0],KPW:[void 0,"\u20a9",0],KRW:["\u20a9",void 0,0],KWD:[void 0,void 0,3],KYD:[void 0,"$"],KZT:[void 0,"\u20b8"],LAK:[void 0,"\u20ad",0],LBP:[void 0,"L\xa3",0],LKR:[void 0,"Rs"],LRD:[void 0,"$"],LTL:[void 0,"Lt"],LUF:[void 0,void 0,0],LVL:[void 0,"Ls"],LYD:[void 0,void 0,3],MGA:[void 0,"Ar",0],MGF:[void 0,void 0,0],MMK:[void 0,"K",0],MNT:[void 0,"\u20ae",0],MRO:[void 0,void 0,0],MUR:[void 0,"Rs",0],MXN:["MX$","$"],MYR:[void 0,"RM"],NAD:[void 0,"$"],NGN:[void 0,"\u20a6"],NIO:[void 0,"C$"],NOK:[void 0,"kr",2],NPR:[void 0,"Rs"],NZD:["NZ$","$"],OMR:[void 0,void 0,3],PHP:[void 0,"\u20b1"],PKR:[void 0,"Rs",0],PLN:[void 0,"z\u0142"],PYG:[void 0,"\u20b2",0],RON:[void 0,"lei"],RSD:[void 0,void 0,0],RUB:[void 0,"\u20bd"],RUR:[void 0,"\u0440."],RWF:[void 0,"RF",0],SBD:[void 0,"$"],SEK:[void 0,"kr",2],SGD:[void 0,"$"],SHP:[void 0,"\xa3"],SLL:[void 0,void 0,0],SOS:[void 0,void 0,0],SRD:[void 0,"$"],SSP:[void 0,"\xa3"],STD:[void 0,void 0,0],STN:[void 0,"Db"],SYP:[void 0,"\xa3",0],THB:[void 0,"\u0e3f"],TMM:[void 0,void 0,0],TND:[void 0,void 0,3],TOP:[void 0,"T$"],TRL:[void 0,void 0,0],TRY:[void 0,"\u20ba"],TTD:[void 0,"$"],TWD:["NT$","$",2],TZS:[void 0,void 0,0],UAH:[void 0,"\u20b4"],UGX:[void 0,void 0,0],USD:["$"],UYI:[void 0,void 0,0],UYU:[void 0,"$"],UZS:[void 0,void 0,0],VEF:[void 0,"Bs"],VND:["\u20ab",void 0,0],VUV:[void 0,void 0,0],XAF:["FCFA",void 0,0],XCD:["EC$","$"],XOF:["CFA",void 0,0],XPF:["CFPF",void 0,0],YER:[void 0,void 0,0],ZAR:[void 0,"R"],ZMK:[void 0,void 0,0],ZMW:[void 0,"ZK"],ZWD:[void 0,void 0,0]},v=function(){var e={Decimal:0,Percent:1,Currency:2,Scientific:3};return e[e.Decimal]="Decimal",e[e.Percent]="Percent",e[e.Currency]="Currency",e[e.Scientific]="Scientific",e}(),y=function(){var e={Zero:0,One:1,Two:2,Few:3,Many:4,Other:5};return e[e.Zero]="Zero",e[e.One]="One",e[e.Two]="Two",e[e.Few]="Few",e[e.Many]="Many",e[e.Other]="Other",e}(),b=function(){var e={Format:0,Standalone:1};return e[e.Format]="Format",e[e.Standalone]="Standalone",e}(),C=function(){var e={Narrow:0,Abbreviated:1,Wide:2,Short:3};return e[e.Narrow]="Narrow",e[e.Abbreviated]="Abbreviated",e[e.Wide]="Wide",e[e.Short]="Short",e}(),w=function(){var e={Short:0,Medium:1,Long:2,Full:3};return e[e.Short]="Short",e[e.Medium]="Medium",e[e.Long]="Long",e[e.Full]="Full",e}(),S=function(){var e={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};return e[e.Decimal]="Decimal",e[e.Group]="Group",e[e.List]="List",e[e.PercentSign]="PercentSign",e[e.PlusSign]="PlusSign",e[e.MinusSign]="MinusSign",e[e.Exponential]="Exponential",e[e.SuperscriptingExponent]="SuperscriptingExponent",e[e.PerMille]="PerMille",e[e.Infinity]="Infinity",e[e.NaN]="NaN",e[e.TimeSeparator]="TimeSeparator",e[e.CurrencyDecimal]="CurrencyDecimal",e[e.CurrencyGroup]="CurrencyGroup",e}(),_=function(){var e={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};return e[e.Sunday]="Sunday",e[e.Monday]="Monday",e[e.Tuesday]="Tuesday",e[e.Wednesday]="Wednesday",e[e.Thursday]="Thursday",e[e.Friday]="Friday",e[e.Saturday]="Saturday",e}();function I(e){return $(e)[0]}function E(e,t,n){const l=$(e),r=U([l[1],l[2]],t);return U(r,n)}function D(e,t,n){const l=$(e),r=U([l[3],l[4]],t);return U(r,n)}function x(e,t,n){const l=$(e),r=U([l[5],l[6]],t);return U(r,n)}function k(e,t){return U($(e)[7],t)}function A(e){return $(e)[8]}function T(e){return $(e)[9]}function R(e,t){return U($(e)[10],t)}function O(e,t){return U($(e)[11],t)}function N(e,t){return U($(e)[12],t)}function P(e,t){const n=$(e),l=n[13][t];if(void 0===l){if(t===S.CurrencyDecimal)return n[13][S.Decimal];if(t===S.CurrencyGroup)return n[13][S.Group]}return l}function M(e,t){return $(e)[14][t]}function L(e){return $(e)[15]||null}function F(e){return $(e)[16]||null}function V(e){return $(e)[18]}function B(e){if(!e[19])throw new Error(`Missing extra locale data for the locale "${e[0]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function j(e){const t=$(e);return B(t),(t[19][2]||[]).map(e=>"string"==typeof e?z(e):[z(e[0]),z(e[1])])}function H(e,t,n){const l=$(e);B(l);const r=U([l[19][0],l[19][1]],t)||[];return U(r,n)||[]}function U(e,t){for(let n=t;n>-1;n--)if(void 0!==e[n])return e[n];throw new Error("Locale data API: locale data undefined")}function z(e){const[t,n]=e.split(":");return{hours:+t,minutes:+n}}function $(e){const t=e.toLowerCase().replace(/_/g,"-");let n=f[t];if(n)return n;const l=t.split("-")[0];if(n=f[l])return n;if("en"===l)return p;throw new Error(`Missing locale data for the locale "${e}".`)}function q(e,t,n="en"){const l=function(e){return $(e)[17]}(n)[e]||m[e]||[],r=l[1];return"narrow"===t&&"string"==typeof r?r:l[0]||e}const W=2;function G(e){let t;const n=m[e];return n&&(t=n[2]),"number"==typeof t?t:W}const K=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,Z={},Q=/((?:[^GyMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/,Y=function(){var e={Short:0,ShortGMT:1,Long:2,Extended:3};return e[e.Short]="Short",e[e.ShortGMT]="ShortGMT",e[e.Long]="Long",e[e.Extended]="Extended",e}(),J=function(){var e={FullYear:0,Month:1,Date:2,Hours:3,Minutes:4,Seconds:5,FractionalSeconds:6,Day:7};return e[e.FullYear]="FullYear",e[e.Month]="Month",e[e.Date]="Date",e[e.Hours]="Hours",e[e.Minutes]="Minutes",e[e.Seconds]="Seconds",e[e.FractionalSeconds]="FractionalSeconds",e[e.Day]="Day",e}(),X=function(){var e={DayPeriods:0,Days:1,Months:2,Eras:3};return e[e.DayPeriods]="DayPeriods",e[e.Days]="Days",e[e.Months]="Months",e[e.Eras]="Eras",e}();function ee(e,t,n,l){let r=function(e){if(he(e))return e;if("number"==typeof e&&!isNaN(e))return new Date(e);if("string"==typeof e){e=e.trim();const t=parseFloat(e);if(!isNaN(e-t))return new Date(t);if(/^(\d{4}-\d{1,2}-\d{1,2})$/.test(e)){const[t,n,l]=e.split("-").map(e=>+e);return new Date(t,n-1,l)}let n;if(n=e.match(K))return de(n)}const t=new Date(e);if(!he(t))throw new Error(`Unable to convert "${e}" into a date`);return t}(e);t=function e(t,n){const l=I(t);if(Z[l]=Z[l]||{},Z[l][n])return Z[l][n];let r="";switch(n){case"shortDate":r=R(t,w.Short);break;case"mediumDate":r=R(t,w.Medium);break;case"longDate":r=R(t,w.Long);break;case"fullDate":r=R(t,w.Full);break;case"shortTime":r=O(t,w.Short);break;case"mediumTime":r=O(t,w.Medium);break;case"longTime":r=O(t,w.Long);break;case"fullTime":r=O(t,w.Full);break;case"short":const l=e(t,"shortTime"),i=e(t,"shortDate");r=te(N(t,w.Short),[l,i]);break;case"medium":const o=e(t,"mediumTime"),s=e(t,"mediumDate");r=te(N(t,w.Medium),[o,s]);break;case"long":const a=e(t,"longTime"),u=e(t,"longDate");r=te(N(t,w.Long),[a,u]);break;case"full":const c=e(t,"fullTime"),d=e(t,"fullDate");r=te(N(t,w.Full),[c,d])}return r&&(Z[l][n]=r),r}(n,t)||t;let i,o=[];for(;t;){if(!(i=Q.exec(t))){o.push(t);break}{const e=(o=o.concat(i.slice(1))).pop();if(!e)break;t=e}}let s=r.getTimezoneOffset();l&&(s=ce(l,s),r=function(e,t,n){const l=e.getTimezoneOffset();return function(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}(e,-1*(ce(t,l)-l))}(r,l));let a="";return o.forEach(e=>{const t=function(e){if(ue[e])return ue[e];let t;switch(e){case"G":case"GG":case"GGG":t=re(X.Eras,C.Abbreviated);break;case"GGGG":t=re(X.Eras,C.Wide);break;case"GGGGG":t=re(X.Eras,C.Narrow);break;case"y":t=le(J.FullYear,1,0,!1,!0);break;case"yy":t=le(J.FullYear,2,0,!0,!0);break;case"yyy":t=le(J.FullYear,3,0,!1,!0);break;case"yyyy":t=le(J.FullYear,4,0,!1,!0);break;case"M":case"L":t=le(J.Month,1,1);break;case"MM":case"LL":t=le(J.Month,2,1);break;case"MMM":t=re(X.Months,C.Abbreviated);break;case"MMMM":t=re(X.Months,C.Wide);break;case"MMMMM":t=re(X.Months,C.Narrow);break;case"LLL":t=re(X.Months,C.Abbreviated,b.Standalone);break;case"LLLL":t=re(X.Months,C.Wide,b.Standalone);break;case"LLLLL":t=re(X.Months,C.Narrow,b.Standalone);break;case"w":t=ae(1);break;case"ww":t=ae(2);break;case"W":t=ae(1,!0);break;case"d":t=le(J.Date,1);break;case"dd":t=le(J.Date,2);break;case"E":case"EE":case"EEE":t=re(X.Days,C.Abbreviated);break;case"EEEE":t=re(X.Days,C.Wide);break;case"EEEEE":t=re(X.Days,C.Narrow);break;case"EEEEEE":t=re(X.Days,C.Short);break;case"a":case"aa":case"aaa":t=re(X.DayPeriods,C.Abbreviated);break;case"aaaa":t=re(X.DayPeriods,C.Wide);break;case"aaaaa":t=re(X.DayPeriods,C.Narrow);break;case"b":case"bb":case"bbb":t=re(X.DayPeriods,C.Abbreviated,b.Standalone,!0);break;case"bbbb":t=re(X.DayPeriods,C.Wide,b.Standalone,!0);break;case"bbbbb":t=re(X.DayPeriods,C.Narrow,b.Standalone,!0);break;case"B":case"BB":case"BBB":t=re(X.DayPeriods,C.Abbreviated,b.Format,!0);break;case"BBBB":t=re(X.DayPeriods,C.Wide,b.Format,!0);break;case"BBBBB":t=re(X.DayPeriods,C.Narrow,b.Format,!0);break;case"h":t=le(J.Hours,1,-12);break;case"hh":t=le(J.Hours,2,-12);break;case"H":t=le(J.Hours,1);break;case"HH":t=le(J.Hours,2);break;case"m":t=le(J.Minutes,1);break;case"mm":t=le(J.Minutes,2);break;case"s":t=le(J.Seconds,1);break;case"ss":t=le(J.Seconds,2);break;case"S":t=le(J.FractionalSeconds,1);break;case"SS":t=le(J.FractionalSeconds,2);break;case"SSS":t=le(J.FractionalSeconds,3);break;case"Z":case"ZZ":case"ZZZ":t=ie(Y.Short);break;case"ZZZZZ":t=ie(Y.Extended);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":t=ie(Y.ShortGMT);break;case"OOOO":case"ZZZZ":case"zzzz":t=ie(Y.Long);break;default:return null}return ue[e]=t,t}(e);a+=t?t(r,n,s):"''"===e?"'":e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),a}function te(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,function(e,n){return null!=t&&n in t?t[n]:e})),e}function ne(e,t,n="-",l,r){let i="";(e<0||r&&e<=0)&&(r?e=1-e:(e=-e,i=n));let o=String(e);for(;o.length<t;)o="0"+o;return l&&(o=o.substr(o.length-t)),i+o}function le(e,t,n=0,l=!1,r=!1){return function(i,o){let s=function(e,t){switch(e){case J.FullYear:return t.getFullYear();case J.Month:return t.getMonth();case J.Date:return t.getDate();case J.Hours:return t.getHours();case J.Minutes:return t.getMinutes();case J.Seconds:return t.getSeconds();case J.FractionalSeconds:return t.getMilliseconds();case J.Day:return t.getDay();default:throw new Error(`Unknown DateType value "${e}".`)}}(e,i);if((n>0||s>-n)&&(s+=n),e===J.Hours)0===s&&-12===n&&(s=12);else if(e===J.FractionalSeconds)return a=t,ne(s,3).substr(0,a);var a;const u=P(o,S.MinusSign);return ne(s,t,u,l,r)}}function re(e,t,n=b.Format,l=!1){return function(r,i){return function(e,t,n,l,r,i){switch(n){case X.Months:return x(t,r,l)[e.getMonth()];case X.Days:return D(t,r,l)[e.getDay()];case X.DayPeriods:const o=e.getHours(),s=e.getMinutes();if(i){const e=j(t),n=H(t,r,l);let i;if(e.forEach((e,t)=>{if(Array.isArray(e)){const{hours:l,minutes:r}=e[0],{hours:a,minutes:u}=e[1];o>=l&&s>=r&&(o<a||o===a&&s<u)&&(i=n[t])}else{const{hours:l,minutes:r}=e;l===o&&r===s&&(i=n[t])}}),i)return i}return E(t,r,l)[o<12?0:1];case X.Eras:return k(t,l)[e.getFullYear()<=0?0:1];default:throw new Error(`unexpected translation type ${n}`)}}(r,i,e,t,n,l)}}function ie(e){return function(t,n,l){const r=-1*l,i=P(n,S.MinusSign),o=r>0?Math.floor(r/60):Math.ceil(r/60);switch(e){case Y.Short:return(r>=0?"+":"")+ne(o,2,i)+ne(Math.abs(r%60),2,i);case Y.ShortGMT:return"GMT"+(r>=0?"+":"")+ne(o,1,i);case Y.Long:return"GMT"+(r>=0?"+":"")+ne(o,2,i)+":"+ne(Math.abs(r%60),2,i);case Y.Extended:return 0===l?"Z":(r>=0?"+":"")+ne(o,2,i)+":"+ne(Math.abs(r%60),2,i);default:throw new Error(`Unknown zone width "${e}"`)}}}const oe=0,se=4;function ae(e,t=!1){return function(n,l){let r;if(t){const e=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,t=n.getDate();r=1+Math.floor((t+e)/7)}else{const e=function(e){const t=new Date(e,oe,1).getDay();return new Date(e,0,1+(t<=se?se:se+7)-t)}(n.getFullYear()),t=(i=n,new Date(i.getFullYear(),i.getMonth(),i.getDate()+(se-i.getDay()))).getTime()-e.getTime();r=1+Math.round(t/6048e5)}var i;return ne(r,e,P(l,S.MinusSign))}}const ue={};function ce(e,t){e=e.replace(/:/g,"");const n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(n)?t:n}function de(e){const t=new Date(0);let n=0,l=0;const r=e[8]?t.setUTCFullYear:t.setFullYear,i=e[8]?t.setUTCHours:t.setHours;e[9]&&(n=Number(e[9]+e[10]),l=Number(e[9]+e[11])),r.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));const o=Number(e[4]||0)-n,s=Number(e[5]||0)-l,a=Number(e[6]||0),u=Math.round(1e3*parseFloat("0."+(e[7]||0)));return i.call(t,o,s,a,u),t}function he(e){return e instanceof Date&&!isNaN(e.valueOf())}const pe=/^(\d+)?\.((\d+)(-(\d+))?)?$/,fe=22,ge=".",me="0",ve=";",ye=",",be="#",Ce="\xa4",we="%";function Se(e,t,n,l,r,i,o=!1){let s="",a=!1;if(isFinite(e)){let u=function(t){let n,l,r,i,o,s=Math.abs(e)+"",a=0;for((l=s.indexOf(ge))>-1&&(s=s.replace(ge,"")),(r=s.search(/e/i))>0?(l<0&&(l=r),l+=+s.slice(r+1),s=s.substring(0,r)):l<0&&(l=s.length),r=0;s.charAt(r)===me;r++);if(r===(o=s.length))n=[0],l=1;else{for(o--;s.charAt(o)===me;)o--;for(l-=r,n=[],i=0;r<=o;r++,i++)n[i]=Number(s.charAt(r))}return l>fe&&(n=n.splice(0,fe-1),a=l-1,l=1),{digits:n,exponent:a,integerLen:l}}();o&&(u=function(e){if(0===e.digits[0])return e;const t=e.digits.length-e.integerLen;return e.exponent?e.exponent+=2:(0===t?e.digits.push(0,0):1===t&&e.digits.push(0),e.integerLen+=2),e}(u));let c=t.minInt,d=t.minFrac,h=t.maxFrac;if(i){const e=i.match(pe);if(null===e)throw new Error(`${i} is not a valid digit info`);const t=e[1],n=e[3],l=e[5];null!=t&&(c=xe(t)),null!=n&&(d=xe(n)),null!=l?h=xe(l):null!=n&&d>h&&(h=d)}!function(e,t,n){if(t>n)throw new Error(`The minimum number of digits after fraction (${t}) is higher than the maximum (${n}).`);let l=e.digits,r=l.length-e.integerLen;const i=Math.min(Math.max(t,r),n);let o=i+e.integerLen,s=l[o];if(o>0){l.splice(Math.max(e.integerLen,o));for(let e=o;e<l.length;e++)l[e]=0}else{r=Math.max(0,r),e.integerLen=1,l.length=Math.max(1,o=i+1),l[0]=0;for(let e=1;e<o;e++)l[e]=0}if(s>=5)if(o-1<0){for(let t=0;t>o;t--)l.unshift(0),e.integerLen++;l.unshift(1),e.integerLen++}else l[o-1]++;for(;r<Math.max(0,i);r++)l.push(0);let a=0!==i;const u=t+e.integerLen,c=l.reduceRight(function(e,t,n,l){return l[n]=(t+=e)<10?t:t-10,a&&(0===l[n]&&n>=u?l.pop():a=!1),t>=10?1:0},0);c&&(l.unshift(c),e.integerLen++)}(u,d,h);let p=u.digits,f=u.integerLen;const g=u.exponent;let m=[];for(a=p.every(e=>!e);f<c;f++)p.unshift(0);for(;f<0;f++)p.unshift(0);f>0?m=p.splice(f,p.length):(m=p,p=[0]);const v=[];for(p.length>=t.lgSize&&v.unshift(p.splice(-t.lgSize,p.length).join(""));p.length>t.gSize;)v.unshift(p.splice(-t.gSize,p.length).join(""));p.length&&v.unshift(p.join("")),s=v.join(P(n,l)),m.length&&(s+=P(n,r)+m.join("")),g&&(s+=P(n,S.Exponential)+"+"+g)}else s=P(n,S.Infinity);return e<0&&!a?t.negPre+s+t.negSuf:t.posPre+s+t.posSuf}function _e(e,t,n,l,r){const i=De(M(t,v.Currency),P(t,S.MinusSign));return i.minFrac=G(l),i.maxFrac=i.minFrac,Se(e,i,t,S.CurrencyGroup,S.CurrencyDecimal,r).replace(Ce,n).replace(Ce,"")}function Ie(e,t,n){return Se(e,De(M(t,v.Percent),P(t,S.MinusSign)),t,S.Group,S.Decimal,n,!0).replace(new RegExp(we,"g"),P(t,S.PercentSign))}function Ee(e,t,n){return Se(e,De(M(t,v.Decimal),P(t,S.MinusSign)),t,S.Group,S.Decimal,n)}function De(e,t="-"){const n={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},l=e.split(ve),r=l[0],i=l[1],o=-1!==r.indexOf(ge)?r.split(ge):[r.substring(0,r.lastIndexOf(me)+1),r.substring(r.lastIndexOf(me)+1)],s=o[0],a=o[1]||"";n.posPre=s.substr(0,s.indexOf(be));for(let c=0;c<a.length;c++){const e=a.charAt(c);e===me?n.minFrac=n.maxFrac=c+1:e===be?n.maxFrac=c+1:n.posSuf+=e}const u=s.split(ye);if(n.gSize=u[1]?u[1].length:0,n.lgSize=u[2]||u[1]?(u[2]||u[1]).length:0,i){const e=r.length-n.posPre.length-n.posSuf.length,t=i.indexOf(be);n.negPre=i.substr(0,t).replace(/'/g,""),n.negSuf=i.substr(t+e).replace(/'/g,"")}else n.negPre=t+n.posPre,n.negSuf=n.posSuf;return n}function xe(e){const t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t}const ke=new l.InjectionToken("UseV4Plurals");class Ae{}function Te(e,t,n,l){let r=`=${e}`;if(t.indexOf(r)>-1)return r;if(r=n.getPluralCategory(e,l),t.indexOf(r)>-1)return r;if(t.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${e}"`)}const Re=(()=>(class extends Ae{constructor(e,t){super(),this.locale=e,this.deprecatedPluralFn=t}getPluralCategory(e,t){switch(this.deprecatedPluralFn?this.deprecatedPluralFn(t||this.locale,e):V(t||this.locale)(e)){case y.Zero:return"zero";case y.One:return"one";case y.Two:return"two";case y.Few:return"few";case y.Many:return"many";default:return"other"}}}))();function Oe(e,t){"string"==typeof t&&(t=parseInt(t,10));const n=t,l=n.toString().replace(/^[^.]*\.?/,""),r=Math.floor(Math.abs(n)),i=l.length,o=parseInt(l,10),s=parseInt(n.toString().replace(/^[^.]*\.?|0+$/g,""),10)||0;switch(e.split("-")[0].toLowerCase()){case"af":case"asa":case"az":case"bem":case"bez":case"bg":case"brx":case"ce":case"cgg":case"chr":case"ckb":case"ee":case"el":case"eo":case"es":case"eu":case"fo":case"fur":case"gsw":case"ha":case"haw":case"hu":case"jgo":case"jmc":case"ka":case"kk":case"kkj":case"kl":case"ks":case"ksb":case"ky":case"lb":case"lg":case"mas":case"mgo":case"ml":case"mn":case"nb":case"nd":case"ne":case"nn":case"nnh":case"nyn":case"om":case"or":case"os":case"ps":case"rm":case"rof":case"rwk":case"saq":case"seh":case"sn":case"so":case"sq":case"ta":case"te":case"teo":case"tk":case"tr":case"ug":case"uz":case"vo":case"vun":case"wae":case"xog":return 1===n?y.One:y.Other;case"ak":case"ln":case"mg":case"pa":case"ti":return n===Math.floor(n)&&n>=0&&n<=1?y.One:y.Other;case"am":case"as":case"bn":case"fa":case"gu":case"hi":case"kn":case"mr":case"zu":return 0===r||1===n?y.One:y.Other;case"ar":return 0===n?y.Zero:1===n?y.One:2===n?y.Two:n%100===Math.floor(n%100)&&n%100>=3&&n%100<=10?y.Few:n%100===Math.floor(n%100)&&n%100>=11&&n%100<=99?y.Many:y.Other;case"ast":case"ca":case"de":case"en":case"et":case"fi":case"fy":case"gl":case"it":case"nl":case"sv":case"sw":case"ur":case"yi":return 1===r&&0===i?y.One:y.Other;case"be":return n%10==1&&n%100!=11?y.One:n%10===Math.floor(n%10)&&n%10>=2&&n%10<=4&&!(n%100>=12&&n%100<=14)?y.Few:n%10==0||n%10===Math.floor(n%10)&&n%10>=5&&n%10<=9||n%100===Math.floor(n%100)&&n%100>=11&&n%100<=14?y.Many:y.Other;case"br":return n%10==1&&n%100!=11&&n%100!=71&&n%100!=91?y.One:n%10==2&&n%100!=12&&n%100!=72&&n%100!=92?y.Two:n%10===Math.floor(n%10)&&(n%10>=3&&n%10<=4||n%10==9)&&!(n%100>=10&&n%100<=19||n%100>=70&&n%100<=79||n%100>=90&&n%100<=99)?y.Few:0!==n&&n%1e6==0?y.Many:y.Other;case"bs":case"hr":case"sr":return 0===i&&r%10==1&&r%100!=11||o%10==1&&o%100!=11?y.One:0===i&&r%10===Math.floor(r%10)&&r%10>=2&&r%10<=4&&!(r%100>=12&&r%100<=14)||o%10===Math.floor(o%10)&&o%10>=2&&o%10<=4&&!(o%100>=12&&o%100<=14)?y.Few:y.Other;case"cs":case"sk":return 1===r&&0===i?y.One:r===Math.floor(r)&&r>=2&&r<=4&&0===i?y.Few:0!==i?y.Many:y.Other;case"cy":return 0===n?y.Zero:1===n?y.One:2===n?y.Two:3===n?y.Few:6===n?y.Many:y.Other;case"da":return 1===n||0!==s&&(0===r||1===r)?y.One:y.Other;case"dsb":case"hsb":return 0===i&&r%100==1||o%100==1?y.One:0===i&&r%100==2||o%100==2?y.Two:0===i&&r%100===Math.floor(r%100)&&r%100>=3&&r%100<=4||o%100===Math.floor(o%100)&&o%100>=3&&o%100<=4?y.Few:y.Other;case"ff":case"fr":case"hy":case"kab":return 0===r||1===r?y.One:y.Other;case"fil":return 0===i&&(1===r||2===r||3===r)||0===i&&r%10!=4&&r%10!=6&&r%10!=9||0!==i&&o%10!=4&&o%10!=6&&o%10!=9?y.One:y.Other;case"ga":return 1===n?y.One:2===n?y.Two:n===Math.floor(n)&&n>=3&&n<=6?y.Few:n===Math.floor(n)&&n>=7&&n<=10?y.Many:y.Other;case"gd":return 1===n||11===n?y.One:2===n||12===n?y.Two:n===Math.floor(n)&&(n>=3&&n<=10||n>=13&&n<=19)?y.Few:y.Other;case"gv":return 0===i&&r%10==1?y.One:0===i&&r%10==2?y.Two:0!==i||r%100!=0&&r%100!=20&&r%100!=40&&r%100!=60&&r%100!=80?0!==i?y.Many:y.Other:y.Few;case"he":return 1===r&&0===i?y.One:2===r&&0===i?y.Two:0!==i||n>=0&&n<=10||n%10!=0?y.Other:y.Many;case"is":return 0===s&&r%10==1&&r%100!=11||0!==s?y.One:y.Other;case"ksh":return 0===n?y.Zero:1===n?y.One:y.Other;case"kw":case"naq":case"se":case"smn":return 1===n?y.One:2===n?y.Two:y.Other;case"lag":return 0===n?y.Zero:0!==r&&1!==r||0===n?y.Other:y.One;case"lt":return n%10!=1||n%100>=11&&n%100<=19?n%10===Math.floor(n%10)&&n%10>=2&&n%10<=9&&!(n%100>=11&&n%100<=19)?y.Few:0!==o?y.Many:y.Other:y.One;case"lv":case"prg":return n%10==0||n%100===Math.floor(n%100)&&n%100>=11&&n%100<=19||2===i&&o%100===Math.floor(o%100)&&o%100>=11&&o%100<=19?y.Zero:n%10==1&&n%100!=11||2===i&&o%10==1&&o%100!=11||2!==i&&o%10==1?y.One:y.Other;case"mk":return 0===i&&r%10==1||o%10==1?y.One:y.Other;case"mt":return 1===n?y.One:0===n||n%100===Math.floor(n%100)&&n%100>=2&&n%100<=10?y.Few:n%100===Math.floor(n%100)&&n%100>=11&&n%100<=19?y.Many:y.Other;case"pl":return 1===r&&0===i?y.One:0===i&&r%10===Math.floor(r%10)&&r%10>=2&&r%10<=4&&!(r%100>=12&&r%100<=14)?y.Few:0===i&&1!==r&&r%10===Math.floor(r%10)&&r%10>=0&&r%10<=1||0===i&&r%10===Math.floor(r%10)&&r%10>=5&&r%10<=9||0===i&&r%100===Math.floor(r%100)&&r%100>=12&&r%100<=14?y.Many:y.Other;case"pt":return n===Math.floor(n)&&n>=0&&n<=2&&2!==n?y.One:y.Other;case"ro":return 1===r&&0===i?y.One:0!==i||0===n||1!==n&&n%100===Math.floor(n%100)&&n%100>=1&&n%100<=19?y.Few:y.Other;case"ru":case"uk":return 0===i&&r%10==1&&r%100!=11?y.One:0===i&&r%10===Math.floor(r%10)&&r%10>=2&&r%10<=4&&!(r%100>=12&&r%100<=14)?y.Few:0===i&&r%10==0||0===i&&r%10===Math.floor(r%10)&&r%10>=5&&r%10<=9||0===i&&r%100===Math.floor(r%100)&&r%100>=11&&r%100<=14?y.Many:y.Other;case"shi":return 0===r||1===n?y.One:n===Math.floor(n)&&n>=2&&n<=10?y.Few:y.Other;case"si":return 0===n||1===n||0===r&&1===o?y.One:y.Other;case"sl":return 0===i&&r%100==1?y.One:0===i&&r%100==2?y.Two:0===i&&r%100===Math.floor(r%100)&&r%100>=3&&r%100<=4||0!==i?y.Few:y.Other;case"tzm":return n===Math.floor(n)&&n>=0&&n<=1||n===Math.floor(n)&&n>=11&&n<=99?y.One:y.Other;default:return y.Other}}function Ne(e,t){t=encodeURIComponent(t);for(const n of e.split(";")){const e=n.indexOf("="),[l,r]=-1==e?[n,""]:[n.slice(0,e),n.slice(e+1)];if(l.trim()===t)return decodeURIComponent(r)}return null}class Pe{constructor(e,t){this._name=e,this._options=t,this.value=null,this._lastSetValue=null,this._lastSetValueType=0,this._lastSetValueIdentityChange=!1}setValue(e){if(Array.isArray(e))this._lastSetValueType=4;else if(e instanceof Set)this._lastSetValueType=8;else if(e&&"string"==typeof e){if(!(4&this._options))throw new Error(this._name+" string values are not allowed");this._lastSetValueType=1}else this._lastSetValueType=e?2:0;this._lastSetValueIdentityChange=!0,this._lastSetValue=e||null}hasValueChanged(){let e=this._lastSetValueIdentityChange;if(!(e||14&this._lastSetValueType))return!1;let t=null;const n=!!(1&this._options),l=!!(8&this._options),r=!!(2&this._options);switch(this._lastSetValueType){case 1:const i=this._lastSetValue.split(/\s+/g);16&this._options?(t={},i.forEach((e,n)=>t[e]=!0)):t=i.reduce((e,t,n)=>e+(n?" ":"")+t);break;case 2:const o=this._lastSetValue,s=Object.keys(o);e||(e=!this.value||function(e,t,n){const l=e;if(!Be(Object.keys(t),l))return!0;for(let r=0;r<l.length;r++){const e=l[r];if(t[e]!==n[e])return!0}return!1}(s,this.value,o)),e&&(t=Me(this._name,n,l,r,o,s));break;case 4:case 8:const a=Array.from(this._lastSetValue);e||(e=!Be(Object.keys(this.value),a)),e&&(t=Me(this._name,n,l,r,a));break;default:t=null}return e&&(this.value=t),e}}function Me(e,t,n,l,r,i){const o={};if(i)for(let s=0;s<i.length;s++){let e=i[s];Fe(o,e=t?e.trim():e,r[e],n,l)}else for(let s=0;s<r.length;s++){let n=r[s];Le(e,n),Fe(o,n=t?n.trim():n,!0,!1,l)}return o}function Le(e,t){if("string"!=typeof t)throw new Error(`${e} can only toggle CSS classes expressed as strings, got ${t}`)}function Fe(e,t,n,l,r){if(r&&t.indexOf(" ")>0){const r=t.split(/\s+/g);for(let t=0;t<r.length;t++)Ve(e,r[t],n,l)}else Ve(e,t,n,l)}function Ve(e,t,n,l){if(l){const e=function(e,t){const n=e.indexOf(".");if(n>0){const l=e.substr(n+1);e=e.substring(0,n),null!=t&&(t+=l)}return{key:e,value:t}}(t,n);n=e.value,t=e.key}e[t]=n}function Be(e,t){if(e&&t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(-1===t.indexOf(e[n]))return!1;return!0}return!1}class je{}const He=(()=>(class{constructor(e,t,n,l){this._iterableDiffers=e,this._keyValueDiffers=t,this._ngEl=n,this._renderer=l,this._initialClasses=[]}getValue(){return null}setClass(e){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof e?e.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}setNgClass(e){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof e?e.split(/\s+/):e,this._rawClass&&(Object(l["\u0275isListLikeIterable"])(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}applyChanges(){if(this._iterableDiffer){const e=this._iterableDiffer.diff(this._rawClass);e&&this._applyIterableChanges(e)}else if(this._keyValueDiffer){const e=this._keyValueDiffer.diff(this._rawClass);e&&this._applyKeyValueChanges(e)}}_applyKeyValueChanges(e){e.forEachAddedItem(e=>this._toggleClass(e.key,e.currentValue)),e.forEachChangedItem(e=>this._toggleClass(e.key,e.currentValue)),e.forEachRemovedItem(e=>{e.previousValue&&this._toggleClass(e.key,!1)})}_applyIterableChanges(e){e.forEachAddedItem(e=>{if("string"!=typeof e.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${Object(l["\u0275stringify"])(e.item)}`);this._toggleClass(e.item,!0)}),e.forEachRemovedItem(e=>this._toggleClass(e.item,!1))}_applyClasses(e){e&&(Array.isArray(e)||e instanceof Set?e.forEach(e=>this._toggleClass(e,!0)):Object.keys(e).forEach(t=>this._toggleClass(t,!!e[t])))}_removeClasses(e){e&&(Array.isArray(e)||e instanceof Set?e.forEach(e=>this._toggleClass(e,!1)):Object.keys(e).forEach(e=>this._toggleClass(e,!1)))}_toggleClass(e,t){(e=e.trim())&&e.split(/\s+/g).forEach(e=>{t?this._renderer.addClass(this._ngEl.nativeElement,e):this._renderer.removeClass(this._ngEl.nativeElement,e)})}}))(),Ue=(()=>(class{constructor(){this._value=null,this._ngClassDiffer=new Pe("NgClass",23),this._classStringDiffer=null}getValue(){return this._value}setClass(e){(e||this._classStringDiffer)&&(this._classStringDiffer=this._classStringDiffer||new Pe("class",20),this._classStringDiffer.setValue(e))}setNgClass(e){this._ngClassDiffer.setValue(e)}applyChanges(){const e=!!this._classStringDiffer&&this._classStringDiffer.hasValueChanged(),t=this._ngClassDiffer.hasValueChanged();if(e||t){let e=this._ngClassDiffer.value;if(this._classStringDiffer){let t=this._classStringDiffer.value;t&&(e=e?Object.assign({},t,e):t)}this._value=e}}}))(),ze={provide:je,useClass:He},$e={provide:je,useClass:Ue},qe=ze,We=Object(l["\u0275\u0275defineDirective"])({type:function(){},selectors:null,factory:()=>{},hostBindings:function(e,t,n){1&e&&Object(l["\u0275\u0275elementHostStyling"])(),2&e&&(Object(l["\u0275\u0275elementHostStylingMap"])(t.getValue()),Object(l["\u0275\u0275elementHostStylingApply"])())}}),Ge=(()=>{class e{constructor(e){this._delegate=e}getValue(){return this._delegate.getValue()}}return e.ngDirectiveDef=void 0,e})(),Ke=(()=>(class extends Ge{constructor(e){super(e)}set klass(e){this._delegate.setClass(e)}set ngClass(e){this._delegate.setNgClass(e)}ngDoCheck(){this._delegate.applyChanges()}}))(),Ze=(()=>(class{constructor(e){this._viewContainerRef=e,this._componentRef=null,this._moduleRef=null}ngOnChanges(e){if(this._viewContainerRef.clear(),this._componentRef=null,this.ngComponentOutlet){const t=this.ngComponentOutletInjector||this._viewContainerRef.parentInjector;if(e.ngComponentOutletNgModuleFactory)if(this._moduleRef&&this._moduleRef.destroy(),this.ngComponentOutletNgModuleFactory){const e=t.get(l.NgModuleRef);this._moduleRef=this.ngComponentOutletNgModuleFactory.create(e.injector)}else this._moduleRef=null;const n=(this._moduleRef?this._moduleRef.componentFactoryResolver:t.get(l.ComponentFactoryResolver)).resolveComponentFactory(this.ngComponentOutlet);this._componentRef=this._viewContainerRef.createComponent(n,this._viewContainerRef.length,t,this.ngComponentOutletContent)}}ngOnDestroy(){this._moduleRef&&this._moduleRef.destroy()}}))();class Qe{constructor(e,t,n,l){this.$implicit=e,this.ngForOf=t,this.index=n,this.count=l}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}const Ye=(()=>(class{constructor(e,t,n){this._viewContainer=e,this._template=t,this._differs=n,this._ngForOfDirty=!0,this._differ=null}set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){Object(l.isDevMode)()&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn(`trackBy must be a function, but received ${JSON.stringify(e)}. `+"See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information."),this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;if(!this._differ&&n)try{this._differ=this._differs.find(n).create(this.ngForTrackBy)}catch(t){throw new Error(`Cannot find a differ supporting object '${n}' of type '${e=n,e.name||typeof e}'. NgFor only supports binding to Iterables such as Arrays.`)}}var e;if(this._differ){const e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){const t=[];e.forEachOperation((e,n,l)=>{if(null==e.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new Qe(null,this._ngForOf,-1,-1),l),r=new Je(e,n);t.push(r)}else if(null==l)this._viewContainer.remove(n);else{const r=this._viewContainer.get(n);this._viewContainer.move(r,l);const i=new Je(e,r);t.push(i)}});for(let n=0;n<t.length;n++)this._perViewChange(t[n].view,t[n].record);for(let n=0,l=this._viewContainer.length;n<l;n++){const e=this._viewContainer.get(n);e.context.index=n,e.context.count=l,e.context.ngForOf=this._ngForOf}e.forEachIdentityChange(e=>{this._viewContainer.get(e.currentIndex).context.$implicit=e.item})}_perViewChange(e,t){e.context.$implicit=t.item}static ngTemplateContextGuard(e,t){return!0}}))();class Je{constructor(e,t){this.record=e,this.view=t}}const Xe=(()=>(class{constructor(e,t){this._viewContainer=e,this._context=new et,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=t}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){tt("ngIfThen",e),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){tt("ngIfElse",e),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateGuard_ngIf(e,t){return!0}}))();class et{constructor(){this.$implicit=null,this.ngIf=null}}function tt(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${Object(l["\u0275stringify"])(t)}'.`)}class nt{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}const lt=(()=>(class{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(e){this._ngSwitch=e,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(e){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(e)}_matchCase(e){const t=e==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||t,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),t}_updateDefaultCases(e){if(this._defaultViews&&e!==this._defaultUsed){this._defaultUsed=e;for(let t=0;t<this._defaultViews.length;t++)this._defaultViews[t].enforceState(e)}}}))(),rt=(()=>(class{constructor(e,t,n){this.ngSwitch=n,n._addCase(),this._view=new nt(e,t)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}))(),it=(()=>(class{constructor(e,t,n){n._addDefault(new nt(e,t))}}))(),ot=(()=>(class{constructor(e){this._localization=e,this._caseViews={}}set ngPlural(e){this._switchValue=e,this._updateView()}addCase(e,t){this._caseViews[e]=t}_updateView(){this._clearViews();const e=Object.keys(this._caseViews),t=Te(this._switchValue,e,this._localization);this._activateView(this._caseViews[t])}_clearViews(){this._activeView&&this._activeView.destroy()}_activateView(e){e&&(this._activeView=e,this._activeView.create())}}))(),st=(()=>(class{constructor(e,t,n,l){this.value=e;const r=!isNaN(Number(e));l.addCase(r?`=${e}`:e,new nt(n,t))}}))();class at{}const ut=(()=>(class{constructor(e,t,n){this._ngEl=e,this._differs=t,this._renderer=n}getValue(){return null}setNgStyle(e){this._ngStyle=e,!this._differ&&e&&(this._differ=this._differs.find(e).create())}applyChanges(){if(this._differ){const e=this._differ.diff(this._ngStyle);e&&this._applyChanges(e)}}_applyChanges(e){e.forEachRemovedItem(e=>this._setStyle(e.key,null)),e.forEachAddedItem(e=>this._setStyle(e.key,e.currentValue)),e.forEachChangedItem(e=>this._setStyle(e.key,e.currentValue))}_setStyle(e,t){const[n,l]=e.split(".");null!=(t=null!=t&&l?`${t}${l}`:t)?this._renderer.setStyle(this._ngEl.nativeElement,n,t):this._renderer.removeStyle(this._ngEl.nativeElement,n)}}))(),ct=(()=>(class{constructor(){this._differ=new Pe("NgStyle",8),this._value=null}getValue(){return this._value}setNgStyle(e){this._differ.setValue(e)}applyChanges(){this._differ.hasValueChanged()&&(this._value=this._differ.value)}}))(),dt={provide:at,useClass:ut},ht={provide:at,useClass:ct},pt=dt,ft=Object(l["\u0275\u0275defineDirective"])({type:function(){},selectors:null,factory:()=>{},hostBindings:function(e,t,n){1&e&&Object(l["\u0275\u0275elementHostStyling"])(),2&e&&(Object(l["\u0275\u0275elementHostStylingMap"])(null,t.getValue()),Object(l["\u0275\u0275elementHostStylingApply"])())}}),gt=(()=>{class e{constructor(e){this._delegate=e}getValue(){return this._delegate.getValue()}}return e.ngDirectiveDef=void 0,e})(),mt=(()=>(class extends gt{constructor(e){super(e)}set ngStyle(e){this._delegate.setNgStyle(e)}ngDoCheck(){this._delegate.applyChanges()}}))(),vt=(()=>(class{constructor(e){this._viewContainerRef=e,this._viewRef=null,this.ngTemplateOutletContext=null,this.ngTemplateOutlet=null}ngOnChanges(e){this._shouldRecreateView(e)?(this._viewRef&&this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._viewRef)),this.ngTemplateOutlet&&(this._viewRef=this._viewContainerRef.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext))):this._viewRef&&this.ngTemplateOutletContext&&this._updateExistingContext(this.ngTemplateOutletContext)}_shouldRecreateView(e){const t=e.ngTemplateOutletContext;return!!e.ngTemplateOutlet||t&&this._hasContextShapeChanged(t)}_hasContextShapeChanged(e){const t=Object.keys(e.previousValue||{}),n=Object.keys(e.currentValue||{});if(t.length===n.length){for(let e of n)if(-1===t.indexOf(e))return!0;return!1}return!0}_updateExistingContext(e){for(let t of Object.keys(e))this._viewRef.context[t]=this.ngTemplateOutletContext[t]}}))(),yt=[Ke,Ze,Ye,Xe,vt,mt,lt,rt,it,ot,st];function bt(e,t){return Error(`InvalidPipeArgument: '${t}' for pipe '${Object(l["\u0275stringify"])(e)}'`)}class Ct{static format(e,t,n,l={}){const{minimumIntegerDigits:r,minimumFractionDigits:i,maximumFractionDigits:o,currency:s,currencyAsSymbol:a=!1}=l,u={minimumIntegerDigits:r,minimumFractionDigits:i,maximumFractionDigits:o,style:v[n].toLowerCase()};return n==v.Currency&&(u.currency="string"==typeof s?s:void 0,u.currencyDisplay=a?"symbol":"code"),new Intl.NumberFormat(t,u).format(e)}}const wt=/((?:[^yMLdHhmsazZEwGjJ']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|J+|j+|m+|s+|a|z|Z|G+|w+))(.*)/,St={yMMMdjms:Nt(Ot([Tt("year",1),Rt("month",3),Tt("day",1),Tt("hour",1),Tt("minute",1),Tt("second",1)])),yMdjm:Nt(Ot([Tt("year",1),Tt("month",1),Tt("day",1),Tt("hour",1),Tt("minute",1)])),yMMMMEEEEd:Nt(Ot([Tt("year",1),Rt("month",4),Rt("weekday",4),Tt("day",1)])),yMMMMd:Nt(Ot([Tt("year",1),Rt("month",4),Tt("day",1)])),yMMMd:Nt(Ot([Tt("year",1),Rt("month",3),Tt("day",1)])),yMd:Nt(Ot([Tt("year",1),Tt("month",1),Tt("day",1)])),jms:Nt(Ot([Tt("hour",1),Tt("second",1),Tt("minute",1)])),jm:Nt(Ot([Tt("hour",1),Tt("minute",1)]))},_t={yyyy:Nt(Tt("year",4)),yy:Nt(Tt("year",2)),y:Nt(Tt("year",1)),MMMM:Nt(Rt("month",4)),MMM:Nt(Rt("month",3)),MM:Nt(Tt("month",2)),M:Nt(Tt("month",1)),LLLL:Nt(Rt("month",4)),L:Nt(Rt("month",1)),dd:Nt(Tt("day",2)),d:Nt(Tt("day",1)),HH:It(Dt(Nt(At(Tt("hour",2),!1)))),H:Dt(Nt(At(Tt("hour",1),!1))),hh:It(Dt(Nt(At(Tt("hour",2),!0)))),h:Dt(Nt(At(Tt("hour",1),!0))),jj:Nt(Tt("hour",2)),j:Nt(Tt("hour",1)),mm:It(Nt(Tt("minute",2))),m:Nt(Tt("minute",1)),ss:It(Nt(Tt("second",2))),s:Nt(Tt("second",1)),sss:Nt(Tt("second",3)),EEEE:Nt(Rt("weekday",4)),EEE:Nt(Rt("weekday",3)),EE:Nt(Rt("weekday",2)),E:Nt(Rt("weekday",1)),a:Et(Nt(At(Tt("hour",1),!0))),Z:kt("short"),z:kt("long"),ww:Nt({}),w:Nt({}),G:Nt(Rt("era",1)),GG:Nt(Rt("era",2)),GGG:Nt(Rt("era",3)),GGGG:Nt(Rt("era",4))};function It(e){return function(t,n){const l=e(t,n);return 1==l.length?"0"+l:l}}function Et(e){return function(t,n){return e(t,n).split(" ")[1]}}function Dt(e){return function(t,n){return e(t,n).split(" ")[0]}}function xt(e,t,n){return new Intl.DateTimeFormat(t,n).format(e).replace(/[\u200e\u200f]/g,"")}function kt(e){const t={hour:"2-digit",hour12:!1,timeZoneName:e};return function(e,n){const l=xt(e,n,t);return l?l.substring(3):""}}function At(e,t){return e.hour12=t,e}function Tt(e,t){const n={};return n[e]=2===t?"2-digit":"numeric",n}function Rt(e,t){const n={};return n[e]=t<4?t>1?"short":"narrow":"long",n}function Ot(e){return e.reduce((e,t)=>Object.assign({},e,t),{})}function Nt(e){return(t,n)=>xt(t,n,e)}const Pt=new Map;class Mt{static format(e,t,n){return function(e,t,n){const l=St[e];if(l)return l(t,n);const r=e;let i=Pt.get(r);if(!i){let t;i=[],wt.exec(e);let n=e;for(;n;)(t=wt.exec(n))?n=(i=i.concat(t.slice(1))).pop():(i.push(n),n=null);Pt.set(r,i)}return i.reduce((e,l)=>{const r=_t[l];return e+(r?r(t,n):function(e){return"''"===e?"'":e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}(l))},"")}(n,e,t)}}const Lt=(()=>{class e{constructor(e){this._locale=e}transform(t,n="mediumDate"){if(null==t||""===t||t!=t)return null;let l;if("string"==typeof t&&(t=t.trim()),Ft(t))l=t;else if(isNaN(t-parseFloat(t)))if("string"==typeof t&&/^(\d{4}-\d{1,2}-\d{1,2})$/.test(t)){const[e,n,r]=t.split("-").map(e=>parseInt(e,10));l=new Date(e,n-1,r)}else l=new Date(t);else l=new Date(parseFloat(t));if(!Ft(l)){let n;if("string"!=typeof t||!(n=t.match(K)))throw bt(e,t);l=de(n)}return Mt.format(l,this._locale,e._ALIASES[n]||n)}}return e._ALIASES={medium:"yMMMdjms",short:"yMdjm",fullDate:"yMMMMEEEEd",longDate:"yMMMMd",mediumDate:"yMMMd",shortDate:"yMd",mediumTime:"jms",shortTime:"jm"},e})();function Ft(e){return e instanceof Date&&!isNaN(e.valueOf())}function Vt(e,t,n,l,r,i=null,o=!1){if(null==n)return null;if("number"!=typeof(n="string"!=typeof n||isNaN(+n-parseFloat(n))?n:+n))throw bt(e,n);let s,a,u;if(l!==v.Currency&&(s=1,a=0,u=3),r){const e=r.match(pe);if(null===e)throw new Error(`${r} is not a valid digit info for number pipes`);null!=e[1]&&(s=xe(e[1])),null!=e[3]&&(a=xe(e[3])),null!=e[5]&&(u=xe(e[5]))}return Ct.format(n,t,l,{minimumIntegerDigits:s,minimumFractionDigits:a,maximumFractionDigits:u,currency:i,currencyAsSymbol:o})}const Bt=(()=>{class e{constructor(e){this._locale=e}transform(t,n){return Vt(e,this._locale,t,v.Decimal,n)}}return e})(),jt=(()=>{class e{constructor(e){this._locale=e}transform(t,n){return Vt(e,this._locale,t,v.Percent,n)}}return e})(),Ht=(()=>{class e{constructor(e){this._locale=e}transform(t,n="USD",l=!1,r){return Vt(e,this._locale,t,v.Currency,r,n,l)}}return e})(),Ut=[Bt,jt,Ht,Lt];class zt{createSubscription(e,t){return e.subscribe({next:t,error:e=>{throw e}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class $t{createSubscription(e,t){return e.then(t,e=>{throw e})}dispose(e){}onDestroy(e){}}const qt=new $t,Wt=new zt,Gt=(()=>{class e{constructor(e){this._ref=e,this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(e){return this._obj?e!==this._obj?(this._dispose(),this.transform(e)):Object(l["\u0275looseIdentical"])(this._latestValue,this._latestReturnedValue)?this._latestReturnedValue:(this._latestReturnedValue=this._latestValue,l.WrappedValue.wrap(this._latestValue)):(e&&this._subscribe(e),this._latestReturnedValue=this._latestValue,this._latestValue)}_subscribe(e){this._obj=e,this._strategy=this._selectStrategy(e),this._subscription=this._strategy.createSubscription(e,t=>this._updateLatestValue(e,t))}_selectStrategy(t){if(Object(l["\u0275isPromise"])(t))return qt;if(Object(l["\u0275isObservable"])(t))return Wt;throw bt(e,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null}_updateLatestValue(e,t){e===this._obj&&(this._latestValue=t,this._ref.markForCheck())}}return e})(),Kt=(()=>{class e{transform(t){if(!t)return t;if("string"!=typeof t)throw bt(e,t);return t.toLowerCase()}}return e})(),Zt=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])\S*/g,Qt=(()=>{class e{transform(t){if(!t)return t;if("string"!=typeof t)throw bt(e,t);return t.replace(Zt,e=>e[0].toUpperCase()+e.substr(1).toLowerCase())}}return e})(),Yt=(()=>{class e{transform(t){if(!t)return t;if("string"!=typeof t)throw bt(e,t);return t.toUpperCase()}}return e})(),Jt=(()=>{class e{constructor(e){this.locale=e}transform(t,n="mediumDate",l,r){if(null==t||""===t||t!=t)return null;try{return ee(t,n,r||this.locale,l)}catch(i){throw bt(e,i.message)}}}return e})(),Xt=/#/g,en=(()=>{class e{constructor(e){this._localization=e}transform(t,n,l){if(null==t)return"";if("object"!=typeof n||null===n)throw bt(e,n);return n[Te(t,Object.keys(n),this._localization,l)].replace(Xt,t.toString())}}return e})(),tn=(()=>{class e{transform(t,n){if(null==t)return"";if("object"!=typeof n||"string"!=typeof t)throw bt(e,n);return n.hasOwnProperty(t)?n[t]:n.hasOwnProperty("other")?n.other:""}}return e})(),nn=(()=>(class{transform(e){return JSON.stringify(e,null,2)}}))(),ln=(()=>(class{constructor(e){this.differs=e,this.keyValues=[]}transform(e,t=function(e,t){const n=e.key,l=t.key;if(n===l)return 0;if(void 0===n)return 1;if(void 0===l)return-1;if(null===n)return 1;if(null===l)return-1;if("string"==typeof n&&"string"==typeof l)return n<l?-1:1;if("number"==typeof n&&"number"==typeof l)return n-l;if("boolean"==typeof n&&"boolean"==typeof l)return n<l?-1:1;const r=String(n),i=String(l);return r==i?0:r<i?-1:1}){if(!e||!(e instanceof Map)&&"object"!=typeof e)return null;this.differ||(this.differ=this.differs.find(e).create());const n=this.differ.diff(e);return n&&(this.keyValues=[],n.forEachItem(e=>{this.keyValues.push(function(t,n){return{key:e.key,value:e.currentValue}}())}),this.keyValues.sort(t)),this.keyValues}}))(),rn=(()=>{class e{constructor(e){this._locale=e}transform(t,n,l){if(an(t))return null;l=l||this._locale;try{return Ee(un(t),l,n)}catch(r){throw bt(e,r.message)}}}return e})(),on=(()=>{class e{constructor(e){this._locale=e}transform(t,n,l){if(an(t))return null;l=l||this._locale;try{return Ie(un(t),l,n)}catch(r){throw bt(e,r.message)}}}return e})(),sn=(()=>{class e{constructor(e){this._locale=e}transform(t,n,l="symbol",r,i){if(an(t))return null;i=i||this._locale,"boolean"==typeof l&&(console&&console.warn&&console.warn('Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are "code", "symbol" or "symbol-narrow".'),l=l?"symbol":"code");let o=n||"USD";"code"!==l&&(o="symbol"===l||"symbol-narrow"===l?q(o,"symbol"===l?"wide":"narrow",i):l);try{return _e(un(t),i,o,n,r)}catch(s){throw bt(e,s.message)}}}return e})();function an(e){return null==e||""===e||e!=e}function un(e){if("string"==typeof e&&!isNaN(Number(e)-parseFloat(e)))return Number(e);if("number"!=typeof e)throw new Error(`${e} is not a number`);return e}const cn=(()=>{class e{transform(t,n,l){if(null==t)return t;if(!this.supports(t))throw bt(e,t);return t.slice(n,l)}supports(e){return"string"==typeof e||Array.isArray(e)}}return e})(),dn=[Gt,Yt,Kt,nn,cn,rn,on,Qt,sn,Jt,en,tn,ln],hn=(()=>(class{}))(),pn=(()=>(class{}))(),fn=new l.InjectionToken("DocumentToken"),gn="browser",mn="server",vn="browserWorkerApp",yn="browserWorkerUi";function bn(e){return e===gn}function Cn(e){return e===mn}function wn(e){return e===vn}function Sn(e){return e===yn}const _n=new l.Version("8.0.3"),In=(()=>{class e{}return e.ngInjectableDef=Object(l["\u0275\u0275defineInjectable"])({providedIn:"root",factory:()=>new En(Object(l["\u0275\u0275inject"])(fn),window,Object(l["\u0275\u0275inject"])(l.ErrorHandler))}),e})();class En{constructor(e,t,n){this.document=e,this.window=t,this.errorHandler=n,this.offset=(()=>[0,0])}setOffset(e){this.offset=Array.isArray(e)?()=>e:e}getScrollPosition(){return this.supportScrollRestoration()?[this.window.scrollX,this.window.scrollY]:[0,0]}scrollToPosition(e){this.supportScrollRestoration()&&this.window.scrollTo(e[0],e[1])}scrollToAnchor(e){if(this.supportScrollRestoration()){e=this.window.CSS&&this.window.CSS.escape?this.window.CSS.escape(e):e.replace(/(\"|\'\ |:|\.|\[|\]|,|=)/g,"\\$1");try{const n=this.document.querySelector(`#${e}`);if(n)return void this.scrollToElement(n);const l=this.document.querySelector(`[name='${e}']`);if(l)return void this.scrollToElement(l)}catch(t){this.errorHandler.handleError(t)}}}setHistoryScrollRestoration(e){if(this.supportScrollRestoration()){const t=this.window.history;t&&t.scrollRestoration&&(t.scrollRestoration=e)}}scrollToElement(e){const t=e.getBoundingClientRect(),n=t.left+this.window.pageXOffset,l=t.top+this.window.pageYOffset,r=this.offset();this.window.scrollTo(n-r[0],l-r[1])}supportScrollRestoration(){try{return!!this.window&&!!this.window.scrollTo}catch(e){return!1}}}class Dn{setOffset(e){}getScrollPosition(){return[0,0]}scrollToPosition(e){}scrollToAnchor(e){}setHistoryScrollRestoration(e){}}},SeVD:function(e,t,n){"use strict";var l=n("ngJS"),r=n("NJ4a"),i=n("Lhse"),o=n("kJWO"),s=n("I55L"),a=n("c2HN"),u=n("XoHu");n.d(t,"a",function(){return c});const c=e=>{if(e&&"function"==typeof e[o.a])return(e=>t=>{const n=e[o.a]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(t)})(e);if(Object(s.a)(e))return Object(l.a)(e);if(Object(a.a)(e))return(e=>t=>(e.then(e=>{t.closed||(t.next(e),t.complete())},e=>t.error(e)).then(null,r.a),t))(e);if(e&&"function"==typeof e[i.a])return(e=>t=>{const n=e[i.a]();for(;;){const e=n.next();if(e.done){t.complete();break}if(t.next(e.value),t.closed)break}return"function"==typeof n.return&&t.add(()=>{n.return&&n.return()}),t})(e);{const t=Object(u.a)(e)?"an invalid object":`'${e}'`;throw new TypeError(`You provided ${t} where a stream was expected.`+" You can provide an Observable, Promise, Array, or Iterable.")}}},SpAZ:function(e,t,n){"use strict";function l(e){return e}n.d(t,"a",function(){return l})},VRyK:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var l=n("HDdC"),r=n("z+Ro"),i=n("bHdf"),o=n("yCtX");function s(...e){let t=Number.POSITIVE_INFINITY,n=null,s=e[e.length-1];return Object(r.a)(s)?(n=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(t=e.pop())):"number"==typeof s&&(t=e.pop()),null===n&&1===e.length&&e[0]instanceof l.a?e[0]:Object(i.a)(t)(Object(o.a)(e,n))}},XNiG:function(e,t,n){"use strict";var l=n("HDdC"),r=n("7o/Q"),i=n("quSY"),o=n("9ppp");class s extends i.a{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}var a=n("2QA8");n.d(t,"b",function(){return u}),n.d(t,"a",function(){return c});class u extends r.a{constructor(e){super(e),this.destination=e}}const c=(()=>{class e extends l.a{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[a.a](){return new u(this)}lift(e){const t=new d(this,this);return t.operator=e,t}next(e){if(this.closed)throw new o.a;if(!this.isStopped){const{observers:t}=this,n=t.length,l=t.slice();for(let r=0;r<n;r++)l[r].next(e)}}error(e){if(this.closed)throw new o.a;this.hasError=!0,this.thrownError=e,this.isStopped=!0;const{observers:t}=this,n=t.length,l=t.slice();for(let r=0;r<n;r++)l[r].error(e);this.observers.length=0}complete(){if(this.closed)throw new o.a;this.isStopped=!0;const{observers:e}=this,t=e.length,n=e.slice();for(let l=0;l<t;l++)n[l].complete();this.observers.length=0}unsubscribe(){this.isStopped=!0,this.closed=!0,this.observers=null}_trySubscribe(e){if(this.closed)throw new o.a;return super._trySubscribe(e)}_subscribe(e){if(this.closed)throw new o.a;return this.hasError?(e.error(this.thrownError),i.a.EMPTY):this.isStopped?(e.complete(),i.a.EMPTY):(this.observers.push(e),new s(this,e))}asObservable(){const e=new l.a;return e.source=this,e}}return e.create=((e,t)=>new d(e,t)),e})();class d extends c{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):i.a.EMPTY}}},XoHu:function(e,t,n){"use strict";function l(e){return null!==e&&"object"==typeof e}n.d(t,"a",function(){return l})},YROV:function(e,t){e.exports=function(e){var t={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b"},n={className:"number",begin:"#[0-9A-Fa-f]+"};return{case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:"\\#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},{className:"selector-attr",begin:"\\[",end:"\\]",illegal:"$"},{className:"selector-tag",begin:"\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b",relevance:0},{begin:":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)"},{begin:"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)"},t,{className:"attribute",begin:"\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b",illegal:"[^\\s]"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:":",end:";",contains:[t,n,e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"meta",begin:"!important"}]},{begin:"@",end:"[{;]",keywords:"mixin include extend for if else each while charset import debug media page content font-face namespace warn",contains:[t,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n,e.CSS_NUMBER_MODE,{begin:"\\s[A-Za-z0-9_.-]+",relevance:0}]}]}}},ZUHj:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var l=n("51Dv"),r=n("SeVD"),i=n("HDdC");function o(e,t,n,o,s=new l.a(e,n,o)){if(!s.closed)return t instanceof i.a?t.subscribe(s):Object(r.a)(t)(s)}},aCrv:function(e,t,n){var l,r=function(){this._tweens={},this._tweensAddedDuringUpdate={}};r.prototype={getAll:function(){return Object.keys(this._tweens).map((function(e){return this._tweens[e]}).bind(this))},removeAll:function(){this._tweens={}},add:function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},remove:function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},update:function(e,t){var n=Object.keys(this._tweens);if(0===n.length)return!1;for(e=void 0!==e?e:o.now();n.length>0;){this._tweensAddedDuringUpdate={};for(var l=0;l<n.length;l++){var r=this._tweens[n[l]];r&&!1===r.update(e)&&(r._isPlaying=!1,t||delete this._tweens[n[l]])}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var i,o=new r;o.Group=r,o._nextId=0,o.nextId=function(){return o._nextId++},o.now="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},o.Tween=function(e,t){this._object=e,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=o.Easing.Linear.None,this._interpolationFunction=o.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onRepeatCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=t||o,this._id=o.nextId()},o.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(e,t){return this._valuesEnd=Object.create(e),void 0!==t&&(this._duration=t),this},duration:function(e){return this._duration=e,this},start:function(e){for(var t in this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=void 0!==e?"string"==typeof e?o.now()+parseFloat(e):e:o.now(),this._startTime+=this._delayTime,this._valuesEnd){if(this._valuesEnd[t]instanceof Array){if(0===this._valuesEnd[t].length)continue;this._valuesEnd[t]=[this._object[t]].concat(this._valuesEnd[t])}void 0!==this._object[t]&&(this._valuesStart[t]=this._object[t],this._valuesStart[t]instanceof Array==0&&(this._valuesStart[t]*=1),this._valuesStartRepeat[t]=this._valuesStart[t]||0)}return this},stop:function(){return this._isPlaying?(this._group.remove(this),this._isPlaying=!1,null!==this._onStopCallback&&this._onStopCallback(this._object),this.stopChainedTweens(),this):this},end:function(){return this.update(1/0),this},stopChainedTweens:function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop()},group:function(e){return this._group=e,this},delay:function(e){return this._delayTime=e,this},repeat:function(e){return this._repeat=e,this},repeatDelay:function(e){return this._repeatDelayTime=e,this},yoyo:function(e){return this._yoyo=e,this},easing:function(e){return this._easingFunction=e,this},interpolation:function(e){return this._interpolationFunction=e,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(e){return this._onStartCallback=e,this},onUpdate:function(e){return this._onUpdateCallback=e,this},onRepeat:function(e){return this._onRepeatCallback=e,this},onComplete:function(e){return this._onCompleteCallback=e,this},onStop:function(e){return this._onStopCallback=e,this},update:function(e){var t,n,l;if(e<this._startTime)return!0;for(t in!1===this._onStartCallbackFired&&(null!==this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(e-this._startTime)/this._duration,l=this._easingFunction(n=0===this._duration||n>1?1:n),this._valuesEnd)if(void 0!==this._valuesStart[t]){var r=this._valuesStart[t]||0,i=this._valuesEnd[t];i instanceof Array?this._object[t]=this._interpolationFunction(i,l):("string"==typeof i&&(i="+"===i.charAt(0)||"-"===i.charAt(0)?r+parseFloat(i):parseFloat(i)),"number"==typeof i&&(this._object[t]=r+(i-r)*l))}if(null!==this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1===n){if(this._repeat>0){for(t in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat){if("string"==typeof this._valuesEnd[t]&&(this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(this._valuesEnd[t])),this._yoyo){var o=this._valuesStartRepeat[t];this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=o}this._valuesStart[t]=this._valuesStartRepeat[t]}return this._yoyo&&(this._reversed=!this._reversed),this._startTime=void 0!==this._repeatDelayTime?e+this._repeatDelayTime:e+this._delayTime,null!==this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}null!==this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var s=0,a=this._chainedTweens.length;s<a;s++)this._chainedTweens[s].start(this._startTime+this._duration);return!1}return!0}},o.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-o.Easing.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*o.Easing.Bounce.In(2*e):.5*o.Easing.Bounce.Out(2*e-1)+.5}}},o.Interpolation={Linear:function(e,t){var n=e.length-1,l=n*t,r=Math.floor(l),i=o.Interpolation.Utils.Linear;return t<0?i(e[0],e[1],l):t>1?i(e[n],e[n-1],n-l):i(e[r],e[r+1>n?n:r+1],l-r)},Bezier:function(e,t){for(var n=0,l=e.length-1,r=Math.pow,i=o.Interpolation.Utils.Bernstein,s=0;s<=l;s++)n+=r(1-t,l-s)*r(t,s)*e[s]*i(l,s);return n},CatmullRom:function(e,t){var n=e.length-1,l=n*t,r=Math.floor(l),i=o.Interpolation.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(l=n*(1+t))),i(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],l-r)):t<0?e[0]-(i(e[0],e[0],e[1],e[1],-l)-e[0]):t>1?e[n]-(i(e[n],e[n],e[n-1],e[n-1],l-n)-e[n]):i(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],l-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=o.Interpolation.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(i=[1],function(e){var t=1;if(i[e])return i[e];for(var n=e;n>1;n--)t*=n;return i[e]=t,t}),CatmullRom:function(e,t,n,l,r){var i=.5*(n-e),o=.5*(l-t),s=r*r;return(2*t-2*n+i+o)*(r*s)+(-3*t+3*n-2*i-o)*s+i*r+t}}},void 0===(l=(function(){return o}).apply(t,[]))||(e.exports=l)},bHdf:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var l=n("5+tZ"),r=n("SpAZ");function i(e=Number.POSITIVE_INFINITY){return Object(l.a)(r.a,e)}},c2HN:function(e,t,n){"use strict";function l(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}n.d(t,"a",function(){return l})},crnd:function(e,t){function n(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="crnd"},g4HV:function(e,t,n){var l=n("mrSG").__decorate,r=n("mrSG").__metadata;Object.defineProperty(t,"__esModule",{value:!0});var i=n("8Y7J"),o=n("SVse"),s=n("sdDj"),a=function(){function e(e,t,n){this.el=e,this.domHandler=t,this.zone=n,this.tooltipPosition="right",this.tooltipEvent="hover",this.appendTo="body",this.tooltipZIndex="auto",this.escape=!0}return e.prototype.ngAfterViewInit=function(){var e=this;this.zone.runOutsideAngular(function(){"hover"===e.tooltipEvent?(e.mouseEnterListener=e.onMouseEnter.bind(e),e.mouseLeaveListener=e.onMouseLeave.bind(e),e.clickListener=e.onClick.bind(e),e.el.nativeElement.addEventListener("mouseenter",e.mouseEnterListener),e.el.nativeElement.addEventListener("mouseleave",e.mouseLeaveListener),e.el.nativeElement.addEventListener("click",e.clickListener)):"focus"===e.tooltipEvent&&(e.focusListener=e.onFocus.bind(e),e.blurListener=e.onBlur.bind(e),e.el.nativeElement.addEventListener("focus",e.focusListener),e.el.nativeElement.addEventListener("blur",e.blurListener))})},e.prototype.onMouseEnter=function(e){this.container||this.showTimeout||this.activate()},e.prototype.onMouseLeave=function(e){this.deactivate()},e.prototype.onFocus=function(e){this.activate()},e.prototype.onBlur=function(e){this.deactivate()},e.prototype.onClick=function(e){this.deactivate()},e.prototype.activate=function(){var e=this;this.active=!0,this.clearHideTimeout(),this.showDelay?this.showTimeout=setTimeout(function(){e.show()},this.showDelay):this.show(),this.life&&(this.hideTimeout=setTimeout(function(){e.hide()},this.showDelay?this.life+this.showDelay:this.life))},e.prototype.deactivate=function(){var e=this;this.active=!1,this.clearShowTimeout(),this.hideDelay?(this.clearHideTimeout(),this.hideTimeout=setTimeout(function(){e.hide()},this.hideDelay)):this.hide()},Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(e){this._text=e,this.active&&(this._text?this.container&&this.container.offsetParent?this.updateText():this.show():this.hide())},enumerable:!0,configurable:!0}),e.prototype.create=function(){this.container=document.createElement("div");var e=document.createElement("div");e.className="ui-tooltip-arrow",this.container.appendChild(e),this.tooltipText=document.createElement("div"),this.tooltipText.className="ui-tooltip-text ui-shadow ui-corner-all",this.updateText(),this.positionStyle&&(this.container.style.position=this.positionStyle),this.container.appendChild(this.tooltipText),"body"===this.appendTo?document.body.appendChild(this.container):this.domHandler.appendChild(this.container,"target"===this.appendTo?this.el.nativeElement:this.appendTo),this.container.style.display="inline-block"},e.prototype.show=function(){this.text&&!this.disabled&&(this.create(),this.align(),this.domHandler.fadeIn(this.container,250),this.container.style.zIndex="auto"===this.tooltipZIndex?++s.DomHandler.zindex:this.tooltipZIndex,this.bindDocumentResizeListener())},e.prototype.hide=function(){this.remove()},e.prototype.updateText=function(){this.escape?(this.tooltipText.innerHTML="",this.tooltipText.appendChild(document.createTextNode(this._text))):this.tooltipText.innerHTML=this._text},e.prototype.align=function(){switch(this.tooltipPosition){case"top":this.alignTop(),this.isOutOfBounds()&&this.alignBottom();break;case"bottom":this.alignBottom(),this.isOutOfBounds()&&this.alignTop();break;case"left":this.alignLeft(),this.isOutOfBounds()&&(this.alignRight(),this.isOutOfBounds()&&(this.alignTop(),this.isOutOfBounds()&&this.alignBottom()));break;case"right":this.alignRight(),this.isOutOfBounds()&&(this.alignLeft(),this.isOutOfBounds()&&(this.alignTop(),this.isOutOfBounds()&&this.alignBottom()))}},e.prototype.getHostOffset=function(){if("body"===this.appendTo||"target"===this.appendTo){var e=this.el.nativeElement.getBoundingClientRect();return{left:e.left+this.domHandler.getWindowScrollLeft(),top:e.top+this.domHandler.getWindowScrollTop()}}return{left:0,top:0}},e.prototype.alignRight=function(){this.preAlign("right");var e=this.getHostOffset(),t=e.left+this.domHandler.getOuterWidth(this.el.nativeElement),n=e.top+(this.domHandler.getOuterHeight(this.el.nativeElement)-this.domHandler.getOuterHeight(this.container))/2;this.container.style.left=t+"px",this.container.style.top=n+"px"},e.prototype.alignLeft=function(){this.preAlign("left");var e=this.getHostOffset(),t=e.left-this.domHandler.getOuterWidth(this.container),n=e.top+(this.domHandler.getOuterHeight(this.el.nativeElement)-this.domHandler.getOuterHeight(this.container))/2;this.container.style.left=t+"px",this.container.style.top=n+"px"},e.prototype.alignTop=function(){this.preAlign("top");var e=this.getHostOffset(),t=e.left+(this.domHandler.getOuterWidth(this.el.nativeElement)-this.domHandler.getOuterWidth(this.container))/2,n=e.top-this.domHandler.getOuterHeight(this.container);this.container.style.left=t+"px",this.container.style.top=n+"px"},e.prototype.alignBottom=function(){this.preAlign("bottom");var e=this.getHostOffset(),t=e.left+(this.domHandler.getOuterWidth(this.el.nativeElement)-this.domHandler.getOuterWidth(this.container))/2,n=e.top+this.domHandler.getOuterHeight(this.el.nativeElement);this.container.style.left=t+"px",this.container.style.top=n+"px"},e.prototype.preAlign=function(e){this.container.style.left="-999px",this.container.style.top="-999px";var t="ui-tooltip ui-widget ui-tooltip-"+e;this.container.className=this.tooltipStyleClass?t+" "+this.tooltipStyleClass:t},e.prototype.isOutOfBounds=function(){var e=this.container.getBoundingClientRect(),t=e.top,n=e.left,l=this.domHandler.getOuterWidth(this.container),r=this.domHandler.getOuterHeight(this.container),i=this.domHandler.getViewport();return n+l>i.width||n<0||t<0||t+r>i.height},e.prototype.onWindowResize=function(e){this.hide()},e.prototype.bindDocumentResizeListener=function(){var e=this;this.zone.runOutsideAngular(function(){e.resizeListener=e.onWindowResize.bind(e),window.addEventListener("resize",e.resizeListener)})},e.prototype.unbindDocumentResizeListener=function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},e.prototype.unbindEvents=function(){"hover"===this.tooltipEvent?(this.el.nativeElement.removeEventListener("mouseenter",this.mouseEnterListener),this.el.nativeElement.removeEventListener("mouseleave",this.mouseLeaveListener),this.el.nativeElement.removeEventListener("click",this.clickListener)):"focus"===this.tooltipEvent&&(this.el.nativeElement.removeEventListener("focus",this.focusListener),this.el.nativeElement.removeEventListener("blur",this.blurListener)),this.unbindDocumentResizeListener()},e.prototype.remove=function(){this.container&&this.container.parentElement&&("body"===this.appendTo?document.body.removeChild(this.container):"target"===this.appendTo?this.el.nativeElement.removeChild(this.container):this.domHandler.removeChild(this.container,this.appendTo)),this.unbindDocumentResizeListener(),this.clearTimeouts(),this.container=null},e.prototype.clearShowTimeout=function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null)},e.prototype.clearHideTimeout=function(){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)},e.prototype.clearTimeouts=function(){this.clearShowTimeout(),this.clearHideTimeout()},e.prototype.ngOnDestroy=function(){this.unbindEvents(),this.remove()},l([i.Input(),r("design:type",String)],e.prototype,"tooltipPosition",void 0),l([i.Input(),r("design:type",String)],e.prototype,"tooltipEvent",void 0),l([i.Input(),r("design:type",Object)],e.prototype,"appendTo",void 0),l([i.Input(),r("design:type",String)],e.prototype,"positionStyle",void 0),l([i.Input(),r("design:type",String)],e.prototype,"tooltipStyleClass",void 0),l([i.Input(),r("design:type",String)],e.prototype,"tooltipZIndex",void 0),l([i.Input("tooltipDisabled"),r("design:type",Boolean)],e.prototype,"disabled",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"escape",void 0),l([i.Input(),r("design:type",Number)],e.prototype,"showDelay",void 0),l([i.Input(),r("design:type",Number)],e.prototype,"hideDelay",void 0),l([i.Input(),r("design:type",Number)],e.prototype,"life",void 0),l([i.Input("pTooltip"),r("design:type",String),r("design:paramtypes",[String])],e.prototype,"text",null),l([i.Directive({selector:"[pTooltip]",providers:[s.DomHandler]})],e)}();t.Tooltip=a,t.TooltipModule=function(){return l([i.NgModule({imports:[o.CommonModule],exports:[a],declarations:[a]})],function(){})}()},gRHU:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var l=n("2fFW"),r=n("NJ4a");const i={closed:!0,next(e){},error(e){if(l.a.useDeprecatedSynchronousErrorHandling)throw e;Object(r.a)(e)},complete(){}}},jZKg:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var l=n("HDdC"),r=n("quSY");function i(e,t){return new l.a(n=>{const l=new r.a;let i=0;return l.add(t.schedule(function(){i!==e.length?(n.next(e[i++]),n.closed||l.add(this.schedule())):n.complete()})),l})}},jctj:function(e,t){e.exports=function(e){var t={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:"[A-Za-z0-9\\._:-]+",relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/},{begin:/[^\s"'=<>`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],case_insensitive:!0,contains:[{className:"meta",begin:"<!DOCTYPE",end:">",relevance:10,contains:[{begin:"\\[",end:"\\]"}]},e.COMMENT("\x3c!--","--\x3e",{relevance:10}),{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{begin:/<\?(php)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]},{className:"tag",begin:"<style(?=\\s|>|$)",end:">",keywords:{name:"style"},contains:[t],starts:{end:"</style>",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:"<script(?=\\s|>|$)",end:">",keywords:{name:"script"},contains:[t],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["actionscript","javascript","handlebars","xml"]}},{className:"tag",begin:"</?",end:"/?>",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0},t]}]}}},kJWO:function(e,t,n){"use strict";n.d(t,"a",function(){return l});const l="function"==typeof Symbol&&Symbol.observable||"@@observable"},l7GE:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var l=n("7o/Q");class r extends l.a{notifyNext(e,t,n,l,r){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}},lJxs:function(e,t,n){"use strict";n.d(t,"a",function(){return r});var l=n("7o/Q");function r(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new i(e,t))}}class i{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new o(e,this.project,this.thisArg))}}class o extends l.a{constructor(e,t,n){super(e),this.project=t,this.count=0,this.thisArg=n||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}},mCNh:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i});var l=n("KqfI");function r(...e){return i(e)}function i(e){return e?1===e.length?e[0]:function(t){return e.reduce((e,t)=>t(e),t)}:l.a}},mrSG:function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",function(){return r}),n.d(t,"__assign",function(){return i}),n.d(t,"__rest",function(){return o}),n.d(t,"__decorate",function(){return s}),n.d(t,"__param",function(){return a}),n.d(t,"__metadata",function(){return u}),n.d(t,"__awaiter",function(){return c}),n.d(t,"__generator",function(){return d}),n.d(t,"__exportStar",function(){return h}),n.d(t,"__values",function(){return p}),n.d(t,"__read",function(){return f}),n.d(t,"__spread",function(){return g}),n.d(t,"__await",function(){return m}),n.d(t,"__asyncGenerator",function(){return v}),n.d(t,"__asyncDelegator",function(){return y}),n.d(t,"__asyncValues",function(){return b}),n.d(t,"__makeTemplateObject",function(){return C}),n.d(t,"__importStar",function(){return w}),n.d(t,"__importDefault",function(){return S});var l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function r(e,t){function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,l=arguments.length;n<l;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function o(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(l=Object.getOwnPropertySymbols(e);r<l.length;r++)t.indexOf(l[r])<0&&(n[l[r]]=e[l[r]])}return n}function s(e,t,n,l){var r,i=arguments.length,o=i<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,n):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,l);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(i<3?r(o):i>3?r(t,n,o):r(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function a(e,t){return function(n,l){t(n,l,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,n,l){return new(n||(n=Promise))(function(r,i){function o(e){try{a(l.next(e))}catch(t){i(t)}}function s(e){try{a(l.throw(e))}catch(t){i(t)}}function a(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,s)}a((l=l.apply(e,t||[])).next())})}function d(e,t){var n,l,r,i,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,l&&(r=2&i[0]?l.return:i[0]?l.throw||((r=l.return)&&r.call(l),0):l.next)&&!(r=r.call(l,i[1])).done)return r;switch(l=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,l=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(r=(r=o.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){o.label=i[1];break}if(6===i[0]&&o.label<r[1]){o.label=r[1],r=i;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(i);break}r[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(s){i=[6,s],l=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function h(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function p(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var l,r,i=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(l=i.next()).done;)o.push(l.value)}catch(s){r={error:s}}finally{try{l&&!l.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function v(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l,r=n.apply(e,t||[]),i=[];return l={},o("next"),o("throw"),o("return"),l[Symbol.asyncIterator]=function(){return this},l;function o(e){r[e]&&(l[e]=function(t){return new Promise(function(n,l){i.push([e,t,n,l])>1||s(e,t)})})}function s(e,t){try{(n=r[e](t)).value instanceof m?Promise.resolve(n.value.v).then(a,u):c(i[0][2],n)}catch(l){c(i[0][3],l)}var n}function a(e){s("next",e)}function u(e){s("throw",e)}function c(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function y(e){var t,n;return t={},l("next"),l("throw",function(e){throw e}),l("return"),t[Symbol.iterator]=function(){return this},t;function l(l,r){t[l]=e[l]?function(t){return(n=!n)?{value:m(e[l](t)),done:"return"===l}:r?r(t):t}:r}}function b(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=p(e),t={},l("next"),l("throw"),l("return"),t[Symbol.asyncIterator]=function(){return this},t);function l(n){t[n]=e[n]&&function(t){return new Promise(function(l,r){!function(e,t,n,l){Promise.resolve(l).then(function(t){e({value:t,done:n})},t)}(l,r,(t=e[n](t)).done,t.value)})}}}function C(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function w(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function S(e){return e&&e.__esModule?e:{default:e}}},n6bG:function(e,t,n){"use strict";function l(e){return"function"==typeof e}n.d(t,"a",function(){return l})},ngJS:function(e,t,n){"use strict";n.d(t,"a",function(){return l});const l=e=>t=>{for(let n=0,l=e.length;n<l&&!t.closed;n++)t.next(e[n]);t.complete()}},oB13:function(e,t,n){"use strict";var l=n("XNiG"),r=n("HDdC"),i=(n("7o/Q"),n("quSY")),o=n("x+ZX");const s=class extends r.a{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new i.a).add(this.source.subscribe(new u(this.getSubject(),this))),e.closed&&(this._connection=null,e=i.a.EMPTY)),e}refCount(){return Object(o.a)()(this)}}.prototype,a={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:s._subscribe},_isComplete:{value:s._isComplete,writable:!0},getSubject:{value:s.getSubject},connect:{value:s.connect},refCount:{value:s.refCount}};class u extends l.b{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}function c(e,t){return function(n){let l;if(l="function"==typeof e?e:function(){return e},"function"==typeof t)return n.lift(new d(l,t));const r=Object.create(n,a);return r.source=n,r.subjectFactory=l,r}}n.d(t,"a",function(){return c});class d{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:n}=this,l=this.subjectFactory(),r=n(l).subscribe(e);return r.add(t.subscribe(l)),r}}},pODc:function(e,t,n){var l=n("mrSG").__decorate,r=n("mrSG").__metadata;Object.defineProperty(t,"__esModule",{value:!0});var i=n("8Y7J"),o=n("SVse"),s=n("g4HV"),a=n("7LN8"),u=0,c=function(){function e(){this.orientation="top",this.onTabClick=new i.EventEmitter,this.onTabCloseClick=new i.EventEmitter}return e.prototype.getDefaultHeaderClass=function(e){var t="ui-state-default ui-corner-"+this.orientation;return e.headerStyleClass&&(t=t+" "+e.headerStyleClass),t},e.prototype.clickTab=function(e,t){this.onTabClick.emit({originalEvent:e,tab:t})},e.prototype.clickClose=function(e,t){this.onTabCloseClick.emit({originalEvent:e,tab:t})},l([i.Input(),r("design:type",Array)],e.prototype,"tabs",void 0),l([i.Input(),r("design:type",String)],e.prototype,"orientation",void 0),l([i.Output(),r("design:type",i.EventEmitter)],e.prototype,"onTabClick",void 0),l([i.Output(),r("design:type",i.EventEmitter)],e.prototype,"onTabCloseClick",void 0),l([i.Component({selector:"[p-tabViewNav]",host:{"[class.ui-tabview-nav]":"true","[class.ui-helper-reset]":"true","[class.ui-helper-clearfix]":"true","[class.ui-widget-header]":"true","[class.ui-corner-all]":"true"},template:'\n <ng-template ngFor let-tab [ngForOf]="tabs">\n <li [class]="getDefaultHeaderClass(tab)" [ngStyle]="tab.headerStyle" role="presentation"\n [ngClass]="{\'ui-tabview-selected ui-state-active\': tab.selected, \'ui-state-disabled\': tab.disabled}"\n (click)="clickTab($event,tab)" *ngIf="!tab.closed">\n <a [attr.id]="tab.id + \'-label\'" href="#" role="tab" [attr.aria-selected]="tab.selected" [attr.aria-controls]="tab.id" [pTooltip]="tab.tooltip" [tooltipPosition]="orientation">\n <ng-container *ngIf="!tab.headerTemplate">\n <span class="ui-tabview-left-icon" [ngClass]="tab.leftIcon" *ngIf="tab.leftIcon"></span>\n <span class="ui-tabview-title">{{tab.header}}</span>\n <span class="ui-tabview-right-icon" [ngClass]="tab.rightIcon" *ngIf="tab.rightIcon"></span>\n </ng-container>\n <ng-container *ngIf="tab.headerTemplate">\n <ng-container *ngTemplateOutlet="tab.headerTemplate"></ng-container>\n </ng-container>\n </a>\n <span *ngIf="tab.closable" class="ui-tabview-close pi pi-times" (click)="clickClose($event,tab)"></span>\n </li>\n </ng-template>\n '})],e)}();t.TabViewNav=c;var d=function(){function e(e){this.viewContainer=e,this.cache=!0,this.id="ui-tabpanel-"+u++}return e.prototype.ngAfterContentInit=function(){var e=this;this.templates.forEach(function(t){switch(t.getType()){case"header":e.headerTemplate=t.template;break;case"content":default:e.contentTemplate=t.template}})},Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(e){this._selected=e,this.loaded=!0},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.view=null},l([i.Input(),r("design:type",String)],e.prototype,"header",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"disabled",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"closable",void 0),l([i.Input(),r("design:type",Object)],e.prototype,"headerStyle",void 0),l([i.Input(),r("design:type",String)],e.prototype,"headerStyleClass",void 0),l([i.Input(),r("design:type",String)],e.prototype,"leftIcon",void 0),l([i.Input(),r("design:type",String)],e.prototype,"rightIcon",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"cache",void 0),l([i.Input(),r("design:type",Object)],e.prototype,"tooltip",void 0),l([i.ContentChildren(a.PrimeTemplate),r("design:type",i.QueryList)],e.prototype,"templates",void 0),l([i.Input(),r("design:type",Boolean),r("design:paramtypes",[Boolean])],e.prototype,"selected",null),l([i.Component({selector:"p-tabPanel",template:'\n <div [attr.id]="id" class="ui-tabview-panel ui-widget-content" [ngClass]="{\'ui-helper-hidden\': !selected}"\n role="tabpanel" [attr.aria-hidden]="!selected" [attr.aria-labelledby]="id + \'-label\'" *ngIf="!closed">\n <ng-content></ng-content>\n <ng-container *ngIf="contentTemplate && (cache ? loaded : selected)">\n <ng-container *ngTemplateOutlet="contentTemplate"></ng-container>\n </ng-container>\n </div>\n '})],e)}();t.TabPanel=d;var h=function(){function e(e){this.el=e,this.orientation="top",this.onChange=new i.EventEmitter,this.onClose=new i.EventEmitter,this.activeIndexChange=new i.EventEmitter}return e.prototype.ngAfterContentInit=function(){var e=this;this.initTabs(),this.tabPanels.changes.subscribe(function(t){e.initTabs()})},e.prototype.initTabs=function(){this.tabs=this.tabPanels.toArray(),!this.findSelectedTab()&&this.tabs.length&&(null!=this.activeIndex&&this.tabs.length>this.activeIndex?this.tabs[this.activeIndex].selected=!0:this.tabs[0].selected=!0)},e.prototype.open=function(e,t){if(t.disabled)e&&e.preventDefault();else{if(!t.selected){var n=this.findSelectedTab();n&&(n.selected=!1),t.selected=!0;var l=this.findTabIndex(t);this.preventActiveIndexPropagation=!0,this.activeIndexChange.emit(l),this.onChange.emit({originalEvent:e,index:l})}e&&e.preventDefault()}},e.prototype.close=function(e,t){var n=this;this.controlClose?this.onClose.emit({originalEvent:e,index:this.findTabIndex(t),close:function(){n.closeTab(t)}}):(this.closeTab(t),this.onClose.emit({originalEvent:e,index:this.findTabIndex(t)})),e.stopPropagation()},e.prototype.closeTab=function(e){if(!e.disabled){if(e.selected){e.selected=!1;for(var t=0;t<this.tabs.length;t++){var n=this.tabs[t];if(!n.closed&&!e.disabled){n.selected=!0;break}}}e.closed=!0}},e.prototype.findSelectedTab=function(){for(var e=0;e<this.tabs.length;e++)if(this.tabs[e].selected)return this.tabs[e];return null},e.prototype.findTabIndex=function(e){for(var t=-1,n=0;n<this.tabs.length;n++)if(this.tabs[n]==e){t=n;break}return t},e.prototype.getBlockableElement=function(){return this.el.nativeElement.children[0]},Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(e){this._activeIndex=e,this.preventActiveIndexPropagation?this.preventActiveIndexPropagation=!1:this.tabs&&this.tabs.length&&null!=this._activeIndex&&this.tabs.length>this._activeIndex&&(this.findSelectedTab().selected=!1,this.tabs[this._activeIndex].selected=!0)},enumerable:!0,configurable:!0}),l([i.Input(),r("design:type",String)],e.prototype,"orientation",void 0),l([i.Input(),r("design:type",Object)],e.prototype,"style",void 0),l([i.Input(),r("design:type",String)],e.prototype,"styleClass",void 0),l([i.Input(),r("design:type",Boolean)],e.prototype,"controlClose",void 0),l([i.ContentChildren(d),r("design:type",i.QueryList)],e.prototype,"tabPanels",void 0),l([i.Output(),r("design:type",i.EventEmitter)],e.prototype,"onChange",void 0),l([i.Output(),r("design:type",i.EventEmitter)],e.prototype,"onClose",void 0),l([i.Output(),r("design:type",i.EventEmitter)],e.prototype,"activeIndexChange",void 0),l([i.Input(),r("design:type",Number),r("design:paramtypes",[Number])],e.prototype,"activeIndex",null),l([i.Component({selector:"p-tabView",template:'\n <div [ngClass]="\'ui-tabview ui-widget ui-widget-content ui-corner-all ui-tabview-\' + orientation" [ngStyle]="style" [class]="styleClass">\n <ul p-tabViewNav role="tablist" *ngIf="orientation!=\'bottom\'" [tabs]="tabs" [orientation]="orientation"\n (onTabClick)="open($event.originalEvent, $event.tab)" (onTabCloseClick)="close($event.originalEvent, $event.tab)"></ul>\n <div class="ui-tabview-panels">\n <ng-content></ng-content>\n </div>\n <ul p-tabViewNav role="tablist" *ngIf="orientation==\'bottom\'" [tabs]="tabs" [orientation]="orientation"\n (onTabClick)="open($event.originalEvent, $event.tab)" (onTabCloseClick)="close($event.originalEvent, $event.tab)"></ul>\n </div>\n '})],e)}();t.TabView=h,t.TabViewModule=function(){return l([i.NgModule({imports:[o.CommonModule,a.SharedModule,s.TooltipModule],exports:[h,d,c,a.SharedModule],declarations:[h,d,c]})],function(){})}()},pw5m:function(e,t,n){"object"==typeof window&&window||"object"==typeof self&&self,function(e){var t,n=[],l=Object.keys,r={},i={},o=/^(no-?highlight|plain|text)$/i,s=/\blang(?:uage)?-([\w-]+)\b/i,a=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,u="</span>",c={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function d(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function h(e){return e.nodeName.toLowerCase()}function p(e,t){var n=e&&e.exec(t);return n&&0===n.index}function f(e){return o.test(e)}function g(e){var t,n={},l=Array.prototype.slice.call(arguments,1);for(t in e)n[t]=e[t];return l.forEach(function(e){for(t in e)n[t]=e[t]}),n}function m(e){var t=[];return function e(n,l){for(var r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?l+=r.nodeValue.length:1===r.nodeType&&(t.push({event:"start",offset:l,node:r}),l=e(r,l),h(r).match(/br|hr|img|input/)||t.push({event:"stop",offset:l,node:r}));return l}(e,0),t}function v(e){if(t&&!e.langApiRestored){for(var n in e.langApiRestored=!0,t)e[n]&&(e[t[n]]=e[n]);(e.contains||[]).concat(e.variants||[]).forEach(v)}}function y(e,t,n,i){function o(e,t){var n=m.case_insensitive?t[0].toLowerCase():t[0];return e.keywords.hasOwnProperty(n)&&e.keywords[n]}function s(e,t,n,l){var r='<span class="'+(l?"":c.classPrefix);return e?(r+=e+'">')+t+(n?"":u):t}function a(){S+=null!=C.subLanguage?function(){var e="string"==typeof C.subLanguage;if(e&&!r[C.subLanguage])return d(I);var t=e?y(C.subLanguage,I,!0,w[C.subLanguage]):b(I,C.subLanguage.length?C.subLanguage:void 0);return C.relevance>0&&(E+=t.relevance),e&&(w[C.subLanguage]=t.top),s(t.language,t.value,!1,!0)}():function(){var e,t,n,l;if(!C.keywords)return d(I);for(l="",t=0,C.lexemesRe.lastIndex=0,n=C.lexemesRe.exec(I);n;)l+=d(I.substring(t,n.index)),(e=o(C,n))?(E+=e[1],l+=s(e[0],d(n[0]))):l+=d(n[0]),t=C.lexemesRe.lastIndex,n=C.lexemesRe.exec(I);return l+d(I.substr(t))}(),I=""}function h(e){S+=e.className?s(e.className,"",!0):"",C=Object.create(e,{parent:{value:C}})}function f(e,t){if(I+=e,null==t)return a(),0;var l=function(e,t){var n,l,r;for(n=0,l=t.contains.length;n<l;n++)if(p(t.contains[n].beginRe,e))return t.contains[n].endSameAsBegin&&(t.contains[n].endRe=(r=t.contains[n].beginRe.exec(e)[0],new RegExp(r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"m"))),t.contains[n]}(t,C);if(l)return l.skip?I+=t:(l.excludeBegin&&(I+=t),a(),l.returnBegin||l.excludeBegin||(I=t)),h(l),l.returnBegin?0:t.length;var r=function e(t,n){if(p(t.endRe,n)){for(;t.endsParent&&t.parent;)t=t.parent;return t}if(t.endsWithParent)return e(t.parent,n)}(C,t);if(r){var i=C;i.skip?I+=t:(i.returnEnd||i.excludeEnd||(I+=t),a(),i.excludeEnd&&(I=t));do{C.className&&(S+=u),C.skip||C.subLanguage||(E+=C.relevance),C=C.parent}while(C!==r.parent);return r.starts&&(r.endSameAsBegin&&(r.starts.endRe=r.endRe),h(r.starts)),i.returnEnd?0:t.length}if(function(e,t){return!n&&p(C.illegalRe,e)}(t))throw new Error('Illegal lexeme "'+t+'" for mode "'+(C.className||"<unnamed>")+'"');return I+=t,t.length||1}var m=_(e);if(!m)throw new Error('Unknown language: "'+e+'"');!function(e){function t(e){return e&&e.source||e}function n(n,l){return new RegExp(t(n),"m"+(e.case_insensitive?"i":"")+(l?"g":""))}!function r(i,o){if(!i.compiled){if(i.compiled=!0,i.keywords=i.keywords||i.beginKeywords,i.keywords){var s={},a=function(t,n){e.case_insensitive&&(n=n.toLowerCase()),n.split(" ").forEach(function(e){var n=e.split("|");s[n[0]]=[t,n[1]?Number(n[1]):1]})};"string"==typeof i.keywords?a("keyword",i.keywords):l(i.keywords).forEach(function(e){a(e,i.keywords[e])}),i.keywords=s}i.lexemesRe=n(i.lexemes||/\w+/,!0),o&&(i.beginKeywords&&(i.begin="\\b("+i.beginKeywords.split(" ").join("|")+")\\b"),i.begin||(i.begin=/\B|\b/),i.beginRe=n(i.begin),i.endSameAsBegin&&(i.end=i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(i.endRe=n(i.end)),i.terminator_end=t(i.end)||"",i.endsWithParent&&o.terminator_end&&(i.terminator_end+=(i.end?"|":"")+o.terminator_end)),i.illegal&&(i.illegalRe=n(i.illegal)),null==i.relevance&&(i.relevance=1),i.contains||(i.contains=[]),i.contains=Array.prototype.concat.apply([],i.contains.map(function(e){return function(e){return e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map(function(t){return g(e,{variants:null},t)})),e.cached_variants||e.endsWithParent&&[g(e)]||[e]}("self"===e?i:e)})),i.contains.forEach(function(e){r(e,i)}),i.starts&&r(i.starts,o);var u=i.contains.map(function(e){return e.beginKeywords?"\\.?(?:"+e.begin+")\\.?":e.begin}).concat([i.terminator_end,i.illegal]).map(t).filter(Boolean);i.terminators=u.length?n(function(e,n){for(var l=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,i="",o=0;o<e.length;o++){var s=r,a=t(e[o]);for(o>0&&(i+="|");a.length>0;){var u=l.exec(a);if(null==u){i+=a;break}i+=a.substring(0,u.index),a=a.substring(u.index+u[0].length),"\\"==u[0][0]&&u[1]?i+="\\"+String(Number(u[1])+s):(i+=u[0],"("==u[0]&&r++)}}return i}(u),!0):{exec:function(){return null}}}}(e)}(m);var v,C=i||m,w={},S="";for(v=C;v!==m;v=v.parent)v.className&&(S=s(v.className,"",!0)+S);var I="",E=0;try{for(var D,x,k=0;C.terminators.lastIndex=k,D=C.terminators.exec(t);)x=f(t.substring(k,D.index),D[0]),k=D.index+x;for(f(t.substr(k)),v=C;v.parent;v=v.parent)v.className&&(S+=u);return{relevance:E,value:S,language:e,top:C}}catch(A){if(A.message&&-1!==A.message.indexOf("Illegal"))return{relevance:0,value:d(t)};throw A}}function b(e,t){t=t||c.languages||l(r);var n={relevance:0,value:d(e)},i=n;return t.filter(_).filter(I).forEach(function(t){var l=y(t,e,!1);l.language=t,l.relevance>i.relevance&&(i=l),l.relevance>n.relevance&&(i=n,n=l)}),i.language&&(n.second_best=i),n}function C(e){return c.tabReplace||c.useBR?e.replace(a,function(e,t){return c.useBR&&"\n"===e?"<br>":c.tabReplace?t.replace(/\t/g,c.tabReplace):""}):e}function w(e){var t,l,r,o,a,u=function(e){var t,n,l,r,i=e.className+" ";if(n=s.exec(i+=e.parentNode?e.parentNode.className:""))return _(n[1])?n[1]:"no-highlight";for(t=0,l=(i=i.split(/\s+/)).length;t<l;t++)if(f(r=i[t])||_(r))return r}(e);f(u)||(c.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n"):t=e,a=t.textContent,r=u?y(u,a,!0):b(a),(l=m(t)).length&&((o=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=r.value,r.value=function(e,t,l){var r=0,i="",o=[];function s(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function a(e){i+="<"+h(e)+n.map.call(e.attributes,function(e){return" "+e.nodeName+'="'+d(e.value).replace('"',"&quot;")+'"'}).join("")+">"}function u(e){i+="</"+h(e)+">"}function c(e){("start"===e.event?a:u)(e.node)}for(;e.length||t.length;){var p=s();if(i+=d(l.substring(r,p[0].offset)),r=p[0].offset,p===e){o.reverse().forEach(u);do{c(p.splice(0,1)[0]),p=s()}while(p===e&&p.length&&p[0].offset===r);o.reverse().forEach(a)}else"start"===p[0].event?o.push(p[0].node):o.pop(),c(p.splice(0,1)[0])}return i+d(l.substr(r))}(l,m(o),a)),r.value=C(r.value),e.innerHTML=r.value,e.className=function(e,t,n){var l=t?i[t]:n,r=[e.trim()];return e.match(/\bhljs\b/)||r.push("hljs"),-1===e.indexOf(l)&&r.push(l),r.join(" ").trim()}(e.className,u,r.language),e.result={language:r.language,re:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance}))}function S(){if(!S.called){S.called=!0;var e=document.querySelectorAll("pre code");n.forEach.call(e,w)}}function _(e){return e=(e||"").toLowerCase(),r[e]||r[i[e]]}function I(e){var t=_(e);return t&&!t.disableAutodetect}e.highlight=y,e.highlightAuto=b,e.fixMarkup=C,e.highlightBlock=w,e.configure=function(e){c=g(c,e)},e.initHighlighting=S,e.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",S,!1),addEventListener("load",S,!1)},e.registerLanguage=function(t,n){var l=r[t]=n(e);v(l),l.aliases&&l.aliases.forEach(function(e){i[e]=t})},e.listLanguages=function(){return l(r)},e.getLanguage=_,e.autoDetection=I,e.inherit=g,e.IDENT_RE="[a-zA-Z]\\w*",e.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",e.NUMBER_RE="\\b\\d+(\\.\\d+)?",e.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BINARY_NUMBER_RE="\\b(0b[01]+)",e.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BACKSLASH_ESCAPE={begin:"\\\\[\\s\\S]",relevance:0},e.APOS_STRING_MODE={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},e.QUOTE_STRING_MODE={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},e.PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e.COMMENT=function(t,n,l){var r=e.inherit({className:"comment",begin:t,end:n,contains:[]},l||{});return r.contains.push(e.PHRASAL_WORDS_MODE),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|XXX):",relevance:0}),r},e.C_LINE_COMMENT_MODE=e.COMMENT("//","$"),e.C_BLOCK_COMMENT_MODE=e.COMMENT("/\\*","\\*/"),e.HASH_COMMENT_MODE=e.COMMENT("#","$"),e.NUMBER_MODE={className:"number",begin:e.NUMBER_RE,relevance:0},e.C_NUMBER_MODE={className:"number",begin:e.C_NUMBER_RE,relevance:0},e.BINARY_NUMBER_MODE={className:"number",begin:e.BINARY_NUMBER_RE,relevance:0},e.CSS_NUMBER_MODE={className:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},e.REGEXP_MODE={className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}]},e.TITLE_MODE={className:"title",begin:e.IDENT_RE,relevance:0},e.UNDERSCORE_TITLE_MODE={className:"title",begin:e.UNDERSCORE_IDENT_RE,relevance:0},e.METHOD_GUARD={begin:"\\.\\s*"+e.UNDERSCORE_IDENT_RE,relevance:0}}(t)},quSY:function(e,t,n){"use strict";var l=n("DH7j"),r=n("XoHu"),i=n("n6bG");function o(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((e,t)=>`${t+1}) ${e.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}o.prototype=Object.create(Error.prototype);const s=o;n.d(t,"a",function(){return a});const a=(()=>{class e{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._unsubscribe=e)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:n,_unsubscribe:o,_subscriptions:a}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof e)n.remove(this);else if(null!==n)for(let e=0;e<n.length;++e)n[e].remove(this);if(Object(i.a)(o))try{o.call(this)}catch(c){t=c instanceof s?u(c.errors):[c]}if(Object(l.a)(a)){let e=-1,n=a.length;for(;++e<n;){const n=a[e];if(Object(r.a)(n))try{n.unsubscribe()}catch(c){t=t||[],c instanceof s?t=t.concat(u(c.errors)):t.push(c)}}}if(t)throw new s(t)}add(t){let n=t;if(!t)return e.EMPTY;switch(typeof t){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof e)){const t=n;(n=new e)._subscriptions=[t]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}let{_parentOrParents:l}=n;if(null===l)n._parentOrParents=this;else if(l instanceof e){if(l===this)return n;n._parentOrParents=[l,this]}else{if(-1!==l.indexOf(this))return n;l.push(this)}const r=this._subscriptions;return null===r?this._subscriptions=[n]:r.push(n),n}remove(e){const t=this._subscriptions;if(t){const n=t.indexOf(e);-1!==n&&t.splice(n,1)}}}return e.EMPTY=function(e){return e.closed=!0,e}(new e),e})();function u(e){return e.reduce((e,t)=>e.concat(t instanceof s?t.errors:t),[])}},r0Rl:function(e,t){e.exports=function(e){var t={keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class public private protected get set super static implements enum export import declare type namespace abstract as from extends async await",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document any number boolean string void Promise"},n={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},l={begin:"\\(",end:/\)/,keywords:t,contains:["self",e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.NUMBER_MODE]},r={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,n,l]};return{aliases:["ts"],keywords:t,contains:[{className:"meta",begin:/^\s*['"]use strict['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,{className:"subst",begin:"\\$\\{",end:"\\}"}]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"number",variants:[{begin:"\\b(0[bB][01]+)"},{begin:"\\b(0[oO][0-7]+)"},{begin:e.C_NUMBER_RE}],relevance:0},{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.REGEXP_MODE,{className:"function",begin:"(\\(.*?\\)|"+e.IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.IDENT_RE},{begin:/\(\s*\)/},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,contains:["self",e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}]}]}],relevance:0},{className:"function",begin:"function",end:/[\{;]/,excludeEnd:!0,keywords:t,contains:["self",e.inherit(e.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*"}),r],illegal:/%/,relevance:0},{beginKeywords:"constructor",end:/\{/,excludeEnd:!0,contains:["self",r]},{begin:/module\./,keywords:{built_in:"module"},relevance:0},{beginKeywords:"module",end:/\{/,excludeEnd:!0},{beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:"interface extends"},{begin:/\$[(.]/},{begin:"\\."+e.IDENT_RE,relevance:0},n,l]}}},sdDj:function(e,t,n){var l=n("mrSG").__decorate;Object.defineProperty(t,"__esModule",{value:!0});var r=n("8Y7J");t.DomHandler=function(){function e(){this.calculatedScrollbarWidth=null}return e.prototype.addClass=function(e,t){e.classList?e.classList.add(t):e.className+=" "+t},e.prototype.addMultipleClasses=function(e,t){if(e.classList)for(var n=t.split(" "),l=0;l<n.length;l++)e.classList.add(n[l]);else for(n=t.split(" "),l=0;l<n.length;l++)e.className+=" "+n[l]},e.prototype.removeClass=function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")},e.prototype.hasClass=function(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)},e.prototype.siblings=function(e){return Array.prototype.filter.call(e.parentNode.children,function(t){return t!==e})},e.prototype.find=function(e,t){return Array.from(e.querySelectorAll(t))},e.prototype.findSingle=function(e,t){return e.querySelector(t)},e.prototype.index=function(e){for(var t=e.parentNode.childNodes,n=0,l=0;l<t.length;l++){if(t[l]==e)return n;1==t[l].nodeType&&n++}return-1},e.prototype.indexWithinGroup=function(e,t){for(var n=e.parentNode.childNodes,l=0,r=0;r<n.length;r++){if(n[r]==e)return l;n[r].attributes&&n[r].attributes[t]&&1==n[r].nodeType&&l++}return-1},e.prototype.relativePosition=function(e,t){var n,l,r=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),i=t.offsetHeight,o=t.offsetWidth,s=t.getBoundingClientRect(),a=(this.getWindowScrollTop(),this.getViewport());s.top+i+r.height>a.height?s.top+(n=-1*r.height)<0&&(n=0):n=i,l=s.left+r.width>a.width?o-r.width:0,e.style.top=n+"px",e.style.left=l+"px"},e.prototype.absolutePosition=function(e,t){var n,l,r=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),i=r.height,o=r.width,s=t.offsetHeight,a=t.offsetWidth,u=t.getBoundingClientRect(),c=this.getWindowScrollTop(),d=this.getWindowScrollLeft(),h=this.getViewport();u.top+s+i>h.height?(n=u.top+c-i)<0&&(n=0+c):n=s+u.top+c,l=u.left+a+o>h.width?u.left+d+a-o:u.left+d,e.style.top=n+"px",e.style.left=l+"px"},e.prototype.getHiddenElementOuterHeight=function(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetHeight;return e.style.display="none",e.style.visibility="visible",t},e.prototype.getHiddenElementOuterWidth=function(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetWidth;return e.style.display="none",e.style.visibility="visible",t},e.prototype.getHiddenElementDimensions=function(e){var t={};return e.style.visibility="hidden",e.style.display="block",t.width=e.offsetWidth,t.height=e.offsetHeight,e.style.display="none",e.style.visibility="visible",t},e.prototype.scrollInView=function(e,t){var n=getComputedStyle(e).getPropertyValue("borderTopWidth"),l=n?parseFloat(n):0,r=getComputedStyle(e).getPropertyValue("paddingTop"),i=r?parseFloat(r):0,o=e.getBoundingClientRect(),s=t.getBoundingClientRect().top+document.body.scrollTop-(o.top+document.body.scrollTop)-l-i,a=e.scrollTop,u=e.clientHeight,c=this.getOuterHeight(t);s<0?e.scrollTop=a+s:s+c>u&&(e.scrollTop=a+s-u+c)},e.prototype.fadeIn=function(e,t){e.style.opacity=0;var n=+new Date,l=0,r=function(){l=+e.style.opacity.replace(",",".")+((new Date).getTime()-n)/t,e.style.opacity=l,n=+new Date,+l<1&&(window.requestAnimationFrame&&requestAnimationFrame(r)||setTimeout(r,16))};r()},e.prototype.fadeOut=function(e,t){var n=1,l=50/t,r=setInterval(function(){(n-=l)<=0&&(n=0,clearInterval(r)),e.style.opacity=n},50)},e.prototype.getWindowScrollTop=function(){var e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)},e.prototype.getWindowScrollLeft=function(){var e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)},e.prototype.matches=function(e,t){var n=Element.prototype;return(n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||function(e){return-1!==[].indexOf.call(document.querySelectorAll(e),this)}).call(e,t)},e.prototype.getOuterWidth=function(e,t){var n=e.offsetWidth;if(t){var l=getComputedStyle(e);n+=parseFloat(l.marginLeft)+parseFloat(l.marginRight)}return n},e.prototype.getHorizontalPadding=function(e){var t=getComputedStyle(e);return parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)},e.prototype.getHorizontalMargin=function(e){var t=getComputedStyle(e);return parseFloat(t.marginLeft)+parseFloat(t.marginRight)},e.prototype.innerWidth=function(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+(parseFloat(n.paddingLeft)+parseFloat(n.paddingRight))},e.prototype.width=function(e){var t=e.offsetWidth,n=getComputedStyle(e);return t-(parseFloat(n.paddingLeft)+parseFloat(n.paddingRight))},e.prototype.getInnerHeight=function(e){var t=e.offsetHeight,n=getComputedStyle(e);return t+(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom))},e.prototype.getOuterHeight=function(e,t){var n=e.offsetHeight;if(t){var l=getComputedStyle(e);n+=parseFloat(l.marginTop)+parseFloat(l.marginBottom)}return n},e.prototype.getHeight=function(e){var t=e.offsetHeight,n=getComputedStyle(e);return t-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth))},e.prototype.getWidth=function(e){var t=e.offsetWidth,n=getComputedStyle(e);return t-(parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth))},e.prototype.getViewport=function(){var e=window,t=document,n=t.documentElement,l=t.getElementsByTagName("body")[0];return{width:e.innerWidth||n.clientWidth||l.clientWidth,height:e.innerHeight||n.clientHeight||l.clientHeight}},e.prototype.getOffset=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft}},e.prototype.replaceElementWith=function(e,t){var n=e.parentNode;if(!n)throw"Can't replace element";return n.replaceChild(t,e)},e.prototype.getUserAgent=function(){return navigator.userAgent},e.prototype.isIE=function(){var e=window.navigator.userAgent;return e.indexOf("MSIE ")>0||(e.indexOf("Trident/")>0?(e.indexOf("rv:"),!0):e.indexOf("Edge/")>0)},e.prototype.appendChild=function(e,t){if(this.isElement(t))t.appendChild(e);else{if(!t.el||!t.el.nativeElement)throw"Cannot append "+t+" to "+e;t.el.nativeElement.appendChild(e)}},e.prototype.removeChild=function(e,t){if(this.isElement(t))t.removeChild(e);else{if(!t.el||!t.el.nativeElement)throw"Cannot remove "+e+" from "+t;t.el.nativeElement.removeChild(e)}},e.prototype.isElement=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName},e.prototype.calculateScrollbarWidth=function(){if(null!==this.calculatedScrollbarWidth)return this.calculatedScrollbarWidth;var e=document.createElement("div");e.className="ui-scrollbar-measure",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),this.calculatedScrollbarWidth=t,t},e.prototype.invokeElementMethod=function(e,t,n){e[t].apply(e,n)},e.prototype.clearSelection=function(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}},e.prototype.getBrowser=function(){if(!this.browser){var e=this.resolveUserAgent();this.browser={},e.browser&&(this.browser[e.browser]=!0,this.browser.version=e.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser},e.prototype.resolveUserAgent=function(){var e=navigator.userAgent.toLowerCase(),t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.prototype.isInteger=function(e){return Number.isInteger?Number.isInteger(e):"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},e.zindex=1e3,l([r.Injectable()],e)}()},"x+ZX":function(e,t,n){"use strict";n.d(t,"a",function(){return r});var l=n("7o/Q");function r(){return function(e){return e.lift(new i(e))}}class i{constructor(e){this.connectable=e}call(e,t){const{connectable:n}=this;n._refCount++;const l=new o(e,n),r=t.subscribe(l);return l.closed||(l.connection=n.connect()),r}}class o extends l.a{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:n}=this,l=e._connection;this.connection=null,!l||n&&l!==n||l.unsubscribe()}}},yCtX:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var l=n("HDdC"),r=n("ngJS"),i=n("jZKg");function o(e,t){return t?Object(i.a)(e,t):new l.a(Object(r.a)(e))}},"z+Ro":function(e,t,n){"use strict";function l(e){return e&&"function"==typeof e.schedule}n.d(t,"a",function(){return l})},zUnb:function(e,t,n){"use strict";n.r(t);var l=n("8Y7J"),r=n("jctj"),i=n.n(r),o=n("YROV"),s=n.n(o),a=n("r0Rl"),u=n.n(a);function c(){return[{name:"typescript",func:u.a},{name:"scss",func:s.a},{name:"xml",func:i.a}]}class d{}var h=n("HDdC"),p=n("quSY");class f extends p.a{constructor(e,t){super()}schedule(e,t=0){return this}}class g extends f{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const n=this.id,l=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(l,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(l,this.id,t),this}requestAsyncId(e,t,n=0){return setInterval(e.flush.bind(e,this),n)}recycleAsyncId(e,t,n=0){if(null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let n=!1,l=void 0;try{this.work(e)}catch(r){n=!0,l=!!r&&r||new Error(r)}if(n)return this.unsubscribe(),l}_unsubscribe(){const e=this.id,t=this.scheduler,n=t.actions,l=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==l&&n.splice(l,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}const m=(()=>{class e{constructor(t,n=e.now){this.SchedulerAction=t,this.now=n}schedule(e,t=0,n){return new this.SchedulerAction(this,e).schedule(n,t)}}return e.now=(()=>Date.now()),e})();class v extends m{constructor(e,t=m.now){super(e,()=>v.delegate&&v.delegate!==this?v.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,n){return v.delegate&&v.delegate!==this?v.delegate.schedule(e,t,n):super.schedule(e,t,n)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}}const y=new v(g);var b=n("DH7j");function C(e){const{subscriber:t,counter:n,period:l}=e;t.next(n),this.schedule({subscriber:t,counter:n+1,period:l},l)}var w=n("z+Ro"),S=n("yCtX"),_=n("jZKg");function I(...e){let t=e[e.length-1];return Object(w.a)(t)?(e.pop(),Object(_.a)(e,t)):Object(S.a)(e)}var E=n("bHdf");function D(){return Object(E.a)(1)}function x(...e){return D()(I(...e))}function k(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}k.prototype=Object.create(Error.prototype);const A=k;var T=n("7o/Q");function R(e,t){return function(n){return n.lift(new O(e,t))}}class O{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new N(e,this.predicate,this.thisArg))}}class N extends T.a{constructor(e,t,n){super(e),this.predicate=t,this.thisArg=n,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}t&&this.destination.next(e)}}function P(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}P.prototype=Object.create(Error.prototype);const M=P,L=new h.a(e=>e.complete());function F(e){return e?function(e){return new h.a(t=>e.schedule(()=>t.complete()))}(e):L}function V(e){return t=>0===e?F():t.lift(new B(e))}class B{constructor(e){if(this.total=e,this.total<0)throw new M}call(e,t){return t.subscribe(new j(e,this.total))}}class j extends T.a{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))}}function H(e=null){return t=>t.lift(new U(e))}class U{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new z(e,this.defaultValue))}}class z extends T.a{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function $(e=function(){return new A}){return t=>t.lift(new q(e))}class q{constructor(e){this.errorFactory=e}call(e,t){return t.subscribe(new W(e,this.errorFactory))}}class W extends T.a{constructor(e,t){super(e),this.errorFactory=t,this.hasValue=!1}_next(e){this.hasValue=!0,this.destination.next(e)}_complete(){if(this.hasValue)return this.destination.complete();{let t;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)}}}var G=n("SpAZ");function K(e,t){const n=arguments.length>=2;return l=>l.pipe(e?R((t,n)=>e(t,n,l)):G.a,V(1),n?H(t):$(()=>new A))}class Z{constructor(e,t){x(e.isStable.pipe(K(e=>!0===e)),function(e=0,t=y){var n;return n=e,(Object(b.a)(n)||!(n-parseFloat(n)+1>=0)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=y),new h.a(n=>(n.add(t.schedule(C,e,{subscriber:n,counter:0,period:e})),n))}(864e5)).subscribe(()=>{console.log("checking for update"),t.checkForUpdate()})}}class Q{constructor(e,t){this.updates=e,this.checkForUpdateService=t,this.title="app works!",this.singleSelectionList=[],this.singleSelectionselectedItems=[],this.singleSelectionSettings={},this.basicExampleList=[],this.basicExampleSelectedItems=[],this.basicExampleSettings={},this.selectedItems3=[],this.dropdownSettings3={},this.limitSelectionSelectedItems=[],this.limitSelectionSettings={},this.disableModeSelectedItems=[],this.disableModeSettings={},this.placeholderExampleList=[],this.placeholderExampleSelectedItems=[],this.placeholderExampleSettings={},this.resetExampleList=[],this.resetExampleSelectedItems=[],this.resetExampleSettings={},this.groupByExampleList=[],this.groupByExampleSelectedItems=[],this.groupByExampleSettings={},this.templatingExampleList=[],this.templatingExampleSelectedItems=[],this.templatingExampleSettings={},this.updates.available.subscribe(e=>{this.updateToLatest()}),this.updates.activated.subscribe(e=>{console.log("old version was",e.previous),console.log("new version is",e.current)})}updateToLatest(){console.log("Updating to latest version."),this.updates.activateUpdate().then(()=>document.location.reload())}ngOnInit(){this.singleSelectionList=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"},{id:5,itemName:"South Korea"}],this.singleSelectionselectedItems=[{id:2,itemName:"Singapore"}],this.singleSelectionSettings={singleSelection:!0,text:"Select Country"},this.basicExampleList=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"},{id:5,itemName:"South Korea"},{id:6,itemName:"Brazil"}],this.basicExampleSelectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"}],this.basicExampleSettings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,classes:"myclass custom-class"},this.selectedItems3=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:4,itemName:"Canada"},{id:5,itemName:"South Korea"}],this.dropdownSettings3={singleSelection:!1,text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,badgeShowLimit:3},this.limitSelectionSelectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"}],this.limitSelectionSettings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!1,classes:"myclass custom-class",limitSelection:4},this.disableModeSelectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"}],this.disableModeSettings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!1,classes:"myclass custom-class",limitSelection:2,disabled:!0},this.placeholderExampleList=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"},{id:5,itemName:"South Korea"}],this.placeholderExampleSelectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"}],this.placeholderExampleSettings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,classes:"myclass custom-class",searchPlaceholderText:"Custom Placeholder text"},this.resetExampleList=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"},{id:5,itemName:"South Korea"}],this.resetExampleSelectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"}],this.resetExampleSettings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!1,classes:"myclass custom-class"},this.groupByExampleList=[{id:1,itemName:"India",category:"asia"},{id:2,itemName:"Singapore",category:"asia pacific"},{id:3,itemName:"Germany",category:"Europe"},{id:4,itemName:"France",category:"Europe"},{id:5,itemName:"South Korea",category:"asia"},{id:6,itemName:"Sweden",category:"Europe"}],this.groupByExampleSelectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Germany"},{id:4,itemName:"France"}],this.groupByExampleSettings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,classes:"myclass custom-class",groupBy:"category"},this.groupByExampleSettings={singleSelection:!1,text:"Select Fields",selectAllText:"Select All",unSelectAllText:"UnSelect All",searchPlaceholderText:"Search Fields",enableSearchFilter:!0,badgeShowLimit:5,groupBy:"category"},this.templatingExampleList=[{id:1,itemName:"India",capital:"Delhi",image:"http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg"},{id:2,itemName:"Singapore",capital:"Singapore",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg"},{id:3,itemName:"United Kingdom",capital:"London",image:"http://www.sciencekids.co.nz/images/pictures/flags96/United_Kingdom.jpg"},{id:4,itemName:"Canada",capital:"Ottawa",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Canada.jpg"},{id:5,itemName:"South Korea",capital:"Seoul",image:"http://www.sciencekids.co.nz/images/pictures/flags96/South_Korea.jpg"},{id:6,itemName:"Brazil",capital:"Brasilia",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Brazil.jpg"}],this.templatingExampleSelectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"United Kingdom"},{id:4,itemName:"Canada"}],this.templatingExampleSettings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,classes:"myclass custom-class",showCheckbox:!0}}onItemSelect(e){console.log(e),console.log(this.basicExampleSelectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.basicExampleSelectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}showModel(){console.log(this.singleSelectionselectedItems)}changeData(){this.resetExampleSelectedItems=[]}}var Y=n("SVse"),J=n("Cfvw"),X=n("XNiG"),ee=n("9ppp");class te extends X.a{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new ee.a;return this._value}next(e){super.next(this._value=e)}}var ne=n("l7GE"),le=n("ZUHj");const re={};class ie{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new oe(e,this.resultSelector))}}class oe extends ne.a{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(re),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let n=0;n<t;n++){const t=e[n];this.add(Object(le.a)(this,t,t,n))}}}notifyComplete(e){0==(this.active-=1)&&this.destination.complete()}notifyNext(e,t,n,l,r){const i=this.values,o=this.toRespond?i[n]===re?--this.toRespond:this.toRespond:0;i[n]=t,0===o&&(this.resultSelector?this._tryResultSelector(i):this.destination.next(i.slice()))}_tryResultSelector(e){let t;try{t=this.resultSelector.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)}}function se(e){return new h.a(t=>{let n;try{n=e()}catch(l){return void t.error(l)}return(n?Object(J.a)(n):F()).subscribe(t)})}var ae=n("lJxs");function ue(e){return function(t){return 0===e?F():t.lift(new ce(e))}}class ce{constructor(e){if(this.total=e,this.total<0)throw new M}call(e,t){return t.subscribe(new de(e,this.total))}}class de extends T.a{constructor(e,t){super(e),this.total=t,this.ring=new Array,this.count=0}_next(e){const t=this.ring,n=this.total,l=this.count++;t.length<n?t.push(e):t[l%n]=e}_complete(){const e=this.destination;let t=this.count;if(t>0){const n=this.count>=this.total?this.total:this.count,l=this.ring;for(let r=0;r<n;r++){const r=t++%n;e.next(l[r])}}e.complete()}}function he(e,t){const n=arguments.length>=2;return l=>l.pipe(e?R((t,n)=>e(t,n,l)):G.a,ue(1),n?H(t):$(()=>new A))}var pe=n("51Dv");function fe(e){return function(t){const n=new ge(e),l=t.lift(n);return n.caught=l}}class ge{constructor(e){this.selector=e}call(e,t){return t.subscribe(new me(e,this.selector,this.caught))}}class me extends ne.a{constructor(e,t,n){super(e),this.selector=t,this.caught=n}error(e){if(!this.isStopped){let n;try{n=this.selector(e,this.caught)}catch(t){return void super.error(t)}this._unsubscribeAndRecycle();const l=new pe.a(this,void 0,void 0);this.add(l),Object(le.a)(this,n,void 0,void 0,l)}}}var ve=n("5+tZ");class ye{constructor(e,t,n){this.predicate=e,this.thisArg=t,this.source=n}call(e,t){return t.subscribe(new be(e,this.predicate,this.thisArg,this.source))}}class be extends T.a{constructor(e,t,n,l){super(e),this.predicate=t,this.thisArg=n,this.source=l,this.index=0,this.thisArg=n||this}notifyComplete(e){this.destination.next(e),this.destination.complete()}_next(e){let t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(n){return void this.destination.error(n)}t||this.notifyComplete(!1)}_complete(){this.notifyComplete(!0)}}function Ce(e,t){return"function"==typeof t?n=>n.pipe(Ce((n,l)=>Object(J.a)(e(n,l)).pipe(Object(ae.a)((e,r)=>t(n,e,l,r))))):t=>t.lift(new we(e))}class we{constructor(e){this.project=e}call(e,t){return t.subscribe(new Se(e,this.project))}}class Se extends ne.a{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const n=this.index++;try{t=this.project(e,n)}catch(l){return void this.destination.error(l)}this._innerSub(t,e,n)}_innerSub(e,t,n){const l=this.innerSubscription;l&&l.unsubscribe();const r=new pe.a(this,void 0,void 0);this.destination.add(r),this.innerSubscription=Object(le.a)(this,e,t,n,r)}_complete(){const{innerSubscription:e}=this;e&&!e.closed||super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=null}notifyComplete(e){this.destination.remove(e),this.innerSubscription=null,this.isStopped&&super._complete()}notifyNext(e,t,n,l,r){this.destination.next(t)}}function _e(e,t){let n=!1;return arguments.length>=2&&(n=!0),function(l){return l.lift(new Ie(e,t,n))}}class Ie{constructor(e,t,n=!1){this.accumulator=e,this.seed=t,this.hasSeed=n}call(e,t){return t.subscribe(new Ee(e,this.accumulator,this.seed,this.hasSeed))}}class Ee extends T.a{constructor(e,t,n,l){super(e),this.accumulator=t,this._seed=n,this.hasSeed=l,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let n;try{n=this.accumulator(this.seed,e,t)}catch(l){this.destination.error(l)}this.seed=n,this.destination.next(n)}}function De(e,t){return Object(ve.a)(e,t,1)}var xe=n("mCNh"),ke=n("KqfI"),Ae=n("n6bG");function Te(e,t,n){return function(l){return l.lift(new Re(e,t,n))}}class Re{constructor(e,t,n){this.nextOrObserver=e,this.error=t,this.complete=n}call(e,t){return t.subscribe(new Oe(e,this.nextOrObserver,this.error,this.complete))}}class Oe extends T.a{constructor(e,t,n,l){super(e),this._tapNext=ke.a,this._tapError=ke.a,this._tapComplete=ke.a,this._tapError=n||ke.a,this._tapComplete=l||ke.a,Object(Ae.a)(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||ke.a,this._tapError=t.error||ke.a,this._tapComplete=t.complete||ke.a)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}class Ne{constructor(e){this.callback=e}call(e,t){return t.subscribe(new Pe(e,this.callback))}}class Pe extends T.a{constructor(e,t){super(e),this.add(new p.a(t))}}let Me=null;function Le(){return Me}class Fe{constructor(){this.resourceLoaderType=null}get attrToPropMap(){return this._attrToPropMap}set attrToPropMap(e){this._attrToPropMap=e}}class Ve extends Fe{constructor(){super(),this._animationPrefix=null,this._transitionEnd=null;try{const t=this.createElement("div",document);if(null!=this.getStyle(t,"animationName"))this._animationPrefix="";else{const e=["Webkit","Moz","O","ms"];for(let n=0;n<e.length;n++)if(null!=this.getStyle(t,e[n]+"AnimationName")){this._animationPrefix="-"+e[n].toLowerCase()+"-";break}}const n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};Object.keys(n).forEach(e=>{null!=this.getStyle(t,e)&&(this._transitionEnd=n[e])})}catch(e){this._animationPrefix=null,this._transitionEnd=null}}getDistributedNodes(e){return e.getDistributedNodes()}resolveAndSetHref(e,t,n){e.href=null==n?t:t+"/../"+n}supportsDOMEvents(){return!0}supportsNativeShadowDOM(){return"function"==typeof document.body.createShadowRoot}getAnimationPrefix(){return this._animationPrefix?this._animationPrefix:""}getTransitionEnd(){return this._transitionEnd?this._transitionEnd:""}supportsAnimation(){return null!=this._animationPrefix&&null!=this._transitionEnd}}const Be={class:"className",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},je=3,He={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Ue={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},ze=(()=>{if(l["\u0275global"].Node)return l["\u0275global"].Node.prototype.contains||function(e){return!!(16&this.compareDocumentPosition(e))}})();class $e extends Ve{parse(e){throw new Error("parse not implemented")}static makeCurrent(){var e;e=new $e,Me||(Me=e)}hasProperty(e,t){return t in e}setProperty(e,t,n){e[t]=n}getProperty(e,t){return e[t]}invoke(e,t,n){e[t](...n)}logError(e){window.console&&(console.error?console.error(e):console.log(e))}log(e){window.console&&window.console.log&&window.console.log(e)}logGroup(e){window.console&&window.console.group&&window.console.group(e)}logGroupEnd(){window.console&&window.console.groupEnd&&window.console.groupEnd()}get attrToPropMap(){return Be}contains(e,t){return ze.call(e,t)}querySelector(e,t){return e.querySelector(t)}querySelectorAll(e,t){return e.querySelectorAll(t)}on(e,t,n){e.addEventListener(t,n,!1)}onAndCancel(e,t,n){return e.addEventListener(t,n,!1),()=>{e.removeEventListener(t,n,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}createMouseEvent(e){const t=this.getDefaultDocument().createEvent("MouseEvent");return t.initEvent(e,!0,!0),t}createEvent(e){const t=this.getDefaultDocument().createEvent("Event");return t.initEvent(e,!0,!0),t}preventDefault(e){e.preventDefault(),e.returnValue=!1}isPrevented(e){return e.defaultPrevented||null!=e.returnValue&&!e.returnValue}getInnerHTML(e){return e.innerHTML}getTemplateContent(e){return"content"in e&&this.isTemplateElement(e)?e.content:null}getOuterHTML(e){return e.outerHTML}nodeName(e){return e.nodeName}nodeValue(e){return e.nodeValue}type(e){return e.type}content(e){return this.hasProperty(e,"content")?e.content:e}firstChild(e){return e.firstChild}nextSibling(e){return e.nextSibling}parentElement(e){return e.parentNode}childNodes(e){return e.childNodes}childNodesAsList(e){const t=e.childNodes,n=new Array(t.length);for(let l=0;l<t.length;l++)n[l]=t[l];return n}clearNodes(e){for(;e.firstChild;)e.removeChild(e.firstChild)}appendChild(e,t){e.appendChild(t)}removeChild(e,t){e.removeChild(t)}replaceChild(e,t,n){e.replaceChild(t,n)}remove(e){return e.parentNode&&e.parentNode.removeChild(e),e}insertBefore(e,t,n){e.insertBefore(n,t)}insertAllBefore(e,t,n){n.forEach(n=>e.insertBefore(n,t))}insertAfter(e,t,n){e.insertBefore(n,t.nextSibling)}setInnerHTML(e,t){e.innerHTML=t}getText(e){return e.textContent}setText(e,t){e.textContent=t}getValue(e){return e.value}setValue(e,t){e.value=t}getChecked(e){return e.checked}setChecked(e,t){e.checked=t}createComment(e){return this.getDefaultDocument().createComment(e)}createTemplate(e){const t=this.getDefaultDocument().createElement("template");return t.innerHTML=e,t}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createElementNS(e,t,n){return(n=n||this.getDefaultDocument()).createElementNS(e,t)}createTextNode(e,t){return(t=t||this.getDefaultDocument()).createTextNode(e)}createScriptTag(e,t,n){const l=(n=n||this.getDefaultDocument()).createElement("SCRIPT");return l.setAttribute(e,t),l}createStyleElement(e,t){const n=(t=t||this.getDefaultDocument()).createElement("style");return this.appendChild(n,this.createTextNode(e,t)),n}createShadowRoot(e){return e.createShadowRoot()}getShadowRoot(e){return e.shadowRoot}getHost(e){return e.host}clone(e){return e.cloneNode(!0)}getElementsByClassName(e,t){return e.getElementsByClassName(t)}getElementsByTagName(e,t){return e.getElementsByTagName(t)}classList(e){return Array.prototype.slice.call(e.classList,0)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}hasClass(e,t){return e.classList.contains(t)}setStyle(e,t,n){e.style[t]=n}removeStyle(e,t){e.style[t]=""}getStyle(e,t){return e.style[t]}hasStyle(e,t,n){const l=this.getStyle(e,t)||"";return n?l==n:l.length>0}tagName(e){return e.tagName}attributeMap(e){const t=new Map,n=e.attributes;for(let l=0;l<n.length;l++){const e=n.item(l);t.set(e.name,e.value)}return t}hasAttribute(e,t){return e.hasAttribute(t)}hasAttributeNS(e,t,n){return e.hasAttributeNS(t,n)}getAttribute(e,t){return e.getAttribute(t)}getAttributeNS(e,t,n){return e.getAttributeNS(t,n)}setAttribute(e,t,n){e.setAttribute(t,n)}setAttributeNS(e,t,n,l){e.setAttributeNS(t,n,l)}removeAttribute(e,t){e.removeAttribute(t)}removeAttributeNS(e,t,n){e.removeAttributeNS(t,n)}templateAwareRoot(e){return this.isTemplateElement(e)?this.content(e):e}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}getBoundingClientRect(e){try{return e.getBoundingClientRect()}catch(t){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}}getTitle(e){return e.title}setTitle(e,t){e.title=t||""}elementMatches(e,t){return!!this.isElementNode(e)&&(e.matches&&e.matches(t)||e.msMatchesSelector&&e.msMatchesSelector(t)||e.webkitMatchesSelector&&e.webkitMatchesSelector(t))}isTemplateElement(e){return this.isElementNode(e)&&"TEMPLATE"===e.nodeName}isTextNode(e){return e.nodeType===Node.TEXT_NODE}isCommentNode(e){return e.nodeType===Node.COMMENT_NODE}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}hasShadowRoot(e){return null!=e.shadowRoot&&e instanceof HTMLElement}isShadowRoot(e){return e instanceof DocumentFragment}importIntoDoc(e){return document.importNode(this.templateAwareRoot(e),!0)}adoptNode(e){return document.adoptNode(e)}getHref(e){return e.getAttribute("href")}getEventKey(e){let t=e.key;if(null==t){if(null==(t=e.keyIdentifier))return"Unidentified";t.startsWith("U+")&&(t=String.fromCharCode(parseInt(t.substring(2),16)),e.location===je&&Ue.hasOwnProperty(t)&&(t=Ue[t]))}return He[t]||t}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getHistory(){return window.history}getLocation(){return window.location}getBaseHref(e){const t=We||(We=document.querySelector("base"))?We.getAttribute("href"):null;return null==t?null:(n=t,qe||(qe=document.createElement("a")),qe.setAttribute("href",n),"/"===qe.pathname.charAt(0)?qe.pathname:"/"+qe.pathname);var n}resetBaseElement(){We=null}getUserAgent(){return window.navigator.userAgent}setData(e,t,n){this.setAttribute(e,"data-"+t,n)}getData(e,t){return this.getAttribute(e,"data-"+t)}getComputedStyle(e){return getComputedStyle(e)}supportsWebAnimation(){return"function"==typeof Element.prototype.animate}performanceNow(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()}supportsCookies(){return!0}getCookie(e){return Object(Y["\u0275parseCookieValue"])(document.cookie,e)}setCookie(e,t){document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)}}let qe,We=null;function Ge(){return!!window.history.pushState}const Ke=(()=>{class e extends Y.PlatformLocation{constructor(e){super(),this._doc=e,this._init()}_init(){this.location=Le().getLocation(),this._history=Le().getHistory()}getBaseHrefFromDOM(){return Le().getBaseHref(this._doc)}onPopState(e){Le().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",e,!1)}onHashChange(e){Le().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",e,!1)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(e){this.location.pathname=e}pushState(e,t,n){Ge()?this._history.pushState(e,t,n):this.location.hash=n}replaceState(e,t,n){Ge()?this._history.replaceState(e,t,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}getState(){return this._history.state}}return e.ctorParameters=(()=>[{type:void 0,decorators:[{type:l.Inject,args:[Y.DOCUMENT]}]}]),e})(),Ze=new l.InjectionToken("TRANSITION_ID");function Qe(e,t,n){return()=>{n.get(l.ApplicationInitStatus).donePromise.then(()=>{const n=Le();Array.prototype.slice.apply(n.querySelectorAll(t,"style[ng-transition]")).filter(t=>n.getAttribute(t,"ng-transition")===e).forEach(e=>n.remove(e))})}}const Ye=[{provide:l.APP_INITIALIZER,useFactory:Qe,deps:[Ze,Y.DOCUMENT,l.Injector],multi:!0}];class Je{static init(){Object(l.setTestabilityGetter)(new Je)}addToWindow(e){l["\u0275global"].getAngularTestability=((t,n=!0)=>{const l=e.findTestabilityInTree(t,n);if(null==l)throw new Error("Could not find testability for element.");return l}),l["\u0275global"].getAllAngularTestabilities=(()=>e.getAllTestabilities()),l["\u0275global"].getAllAngularRootElements=(()=>e.getAllRootElements()),l["\u0275global"].frameworkStabilizers||(l["\u0275global"].frameworkStabilizers=[]),l["\u0275global"].frameworkStabilizers.push(e=>{const t=l["\u0275global"].getAllAngularTestabilities();let n=t.length,r=!1;const i=function(t){r=r||t,0==--n&&e(r)};t.forEach(function(e){e.whenStable(i)})})}findTestabilityInTree(e,t,n){if(null==t)return null;const l=e.getTestability(t);return null!=l?l:n?Le().isShadowRoot(t)?this.findTestabilityInTree(e,Le().getHost(t),!0):this.findTestabilityInTree(e,Le().parentElement(t),!0):null}}function Xe(e,t){"undefined"!=typeof COMPILED&&COMPILED||((l["\u0275global"].ng=l["\u0275global"].ng||{})[e]=t)}const et=(()=>({ApplicationRef:l.ApplicationRef,NgZone:l.NgZone}))();function tt(e){return Object(l.getDebugNode)(e)}const nt=new l.InjectionToken("EventManagerPlugins"),lt=(()=>(class{constructor(e,t){this._zone=t,this._eventNameToPlugin=new Map,e.forEach(e=>e.manager=this),this._plugins=e.slice().reverse()}addEventListener(e,t,n){return this._findPluginFor(t).addEventListener(e,t,n)}addGlobalEventListener(e,t,n){return this._findPluginFor(t).addGlobalEventListener(e,t,n)}getZone(){return this._zone}_findPluginFor(e){const t=this._eventNameToPlugin.get(e);if(t)return t;const n=this._plugins;for(let l=0;l<n.length;l++){const t=n[l];if(t.supports(e))return this._eventNameToPlugin.set(e,t),t}throw new Error(`No event manager plugin found for event ${e}`)}}))();class rt{constructor(e){this._doc=e}addGlobalEventListener(e,t,n){const l=Le().getGlobalEventTarget(this._doc,e);if(!l)throw new Error(`Unsupported event target ${l} for event ${t}`);return this.addEventListener(l,t,n)}}const it=(()=>(class{constructor(){this._stylesSet=new Set}addStyles(e){const t=new Set;e.forEach(e=>{this._stylesSet.has(e)||(this._stylesSet.add(e),t.add(e))}),this.onStylesAdded(t)}onStylesAdded(e){}getAllStyles(){return Array.from(this._stylesSet)}}))(),ot=(()=>(class extends it{constructor(e){super(),this._doc=e,this._hostNodes=new Set,this._styleNodes=new Set,this._hostNodes.add(e.head)}_addStylesToHost(e,t){e.forEach(e=>{const n=this._doc.createElement("style");n.textContent=e,this._styleNodes.add(t.appendChild(n))})}addHost(e){this._addStylesToHost(this._stylesSet,e),this._hostNodes.add(e)}removeHost(e){this._hostNodes.delete(e)}onStylesAdded(e){this._hostNodes.forEach(t=>this._addStylesToHost(e,t))}ngOnDestroy(){this._styleNodes.forEach(e=>Le().remove(e))}}))(),st={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},at=/%COMP%/g,ut="_nghost-%COMP%",ct="_ngcontent-%COMP%";function dt(e,t,n){for(let l=0;l<t.length;l++){let r=t[l];Array.isArray(r)?dt(e,r,n):(r=r.replace(at,e),n.push(r))}return n}function ht(e){return t=>{!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}const pt=(()=>(class{constructor(e,t,n){this.eventManager=e,this.sharedStylesHost=t,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new ft(e)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;switch(t.encapsulation){case l.ViewEncapsulation.Emulated:{let n=this.rendererByCompId.get(t.id);return n||(n=new vt(this.eventManager,this.sharedStylesHost,t,this.appId),this.rendererByCompId.set(t.id,n)),n.applyToHost(e),n}case l.ViewEncapsulation.Native:case l.ViewEncapsulation.ShadowDom:return new yt(this.eventManager,this.sharedStylesHost,e,t);default:if(!this.rendererByCompId.has(t.id)){const e=dt(t.id,t.styles,[]);this.sharedStylesHost.addStyles(e),this.rendererByCompId.set(t.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}))();class ft{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(st[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,n){e&&e.insertBefore(t,n)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let n="string"==typeof e?document.querySelector(e):e;if(!n)throw new Error(`The selector "${e}" did not match any elements`);return t||(n.textContent=""),n}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,n,l){if(l){t=`${l}:${t}`;const r=st[l];r?e.setAttributeNS(r,t,n):e.setAttribute(t,n)}else e.setAttribute(t,n)}removeAttribute(e,t,n){if(n){const l=st[n];l?e.removeAttributeNS(l,t):e.removeAttribute(`${n}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,n,r){r&l.RendererStyleFlags2.DashCase?e.style.setProperty(t,n,r&l.RendererStyleFlags2.Important?"important":""):e.style[t]=n}removeStyle(e,t,n){n&l.RendererStyleFlags2.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,n){mt(t,"property"),e[t]=n}setValue(e,t){e.nodeValue=t}listen(e,t,n){return mt(t,"listener"),"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,ht(n)):this.eventManager.addEventListener(e,t,ht(n))}}const gt=(()=>"@".charCodeAt(0))();function mt(e,t){if(e.charCodeAt(0)===gt)throw new Error(`Found the synthetic ${t} ${e}. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.`)}class vt extends ft{constructor(e,t,n,l){super(e),this.component=n;const r=dt(l+"-"+n.id,n.styles,[]);t.addStyles(r),this.contentAttr=ct.replace(at,l+"-"+n.id),this.hostAttr=ut.replace(at,l+"-"+n.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const n=super.createElement(e,t);return super.setAttribute(n,this.contentAttr,""),n}}class yt extends ft{constructor(e,t,n,r){super(e),this.sharedStylesHost=t,this.hostEl=n,this.component=r,this.shadowRoot=r.encapsulation===l.ViewEncapsulation.ShadowDom?n.attachShadow({mode:"open"}):n.createShadowRoot(),this.sharedStylesHost.addHost(this.shadowRoot);const i=dt(r.id,r.styles,[]);for(let l=0;l<i.length;l++){const e=document.createElement("style");e.textContent=i[l],this.shadowRoot.appendChild(e)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,n){return super.insertBefore(this.nodeOrShadowRoot(e),t,n)}removeChild(e,t){return super.removeChild(this.nodeOrShadowRoot(e),t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}}const bt=(()=>"undefined"!=typeof Zone&&Zone.__symbol__||function(e){return"__zone_symbol__"+e})(),Ct=bt("addEventListener"),wt=bt("removeEventListener"),St={},_t="__zone_symbol__propagationStopped",It=(()=>{const e="undefined"!=typeof Zone&&Zone[bt("BLACK_LISTED_EVENTS")];if(e){const t={};return e.forEach(e=>{t[e]=e}),t}})(),Et=function(e){return!!It&&It.hasOwnProperty(e)},Dt=function(e){const t=St[e.type];if(!t)return;const n=this[t];if(!n)return;const l=[e];if(1===n.length){const e=n[0];return e.zone!==Zone.current?e.zone.run(e.handler,this,l):e.handler.apply(this,l)}{const t=n.slice();for(let n=0;n<t.length&&!0!==e[_t];n++){const e=t[n];e.zone!==Zone.current?e.zone.run(e.handler,this,l):e.handler.apply(this,l)}}},xt=(()=>(class extends rt{constructor(e,t,n){super(e),this.ngZone=t,n&&Object(Y.isPlatformServer)(n)||this.patchEvent()}patchEvent(){if("undefined"==typeof Event||!Event||!Event.prototype)return;if(Event.prototype.__zone_symbol__stopImmediatePropagation)return;const e=Event.prototype.__zone_symbol__stopImmediatePropagation=Event.prototype.stopImmediatePropagation;Event.prototype.stopImmediatePropagation=function(){this&&(this[_t]=!0),e&&e.apply(this,arguments)}}supports(e){return!0}addEventListener(e,t,n){let r=n;if(!e[Ct]||l.NgZone.isInAngularZone()&&!Et(t))e.addEventListener(t,r,!1);else{let n=St[t];n||(n=St[t]=bt("ANGULAR"+t+"FALSE"));let l=e[n];const i=l&&l.length>0;l||(l=e[n]=[]);const o=Et(t)?Zone.root:Zone.current;if(0===l.length)l.push({zone:o,handler:r});else{let e=!1;for(let t=0;t<l.length;t++)if(l[t].handler===r){e=!0;break}e||l.push({zone:o,handler:r})}i||e[Ct](t,Dt,!1)}return()=>this.removeEventListener(e,t,r)}removeEventListener(e,t,n){let l=e[wt];if(!l)return e.removeEventListener.apply(e,[t,n,!1]);let r=St[t],i=r&&e[r];if(!i)return e.removeEventListener.apply(e,[t,n,!1]);let o=!1;for(let s=0;s<i.length;s++)if(i[s].handler===n){o=!0,i.splice(s,1);break}o?0===i.length&&l.apply(e,[t,Dt,!1]):e.removeEventListener.apply(e,[t,n,!1])}}))(),kt={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0},At=new l.InjectionToken("HammerGestureConfig"),Tt=new l.InjectionToken("HammerLoader"),Rt=(()=>(class{constructor(){this.events=[],this.overrides={}}buildHammer(e){const t=new Hammer(e,this.options);t.get("pinch").set({enable:!0}),t.get("rotate").set({enable:!0});for(const n in this.overrides)t.get(n).set(this.overrides[n]);return t}}))(),Ot=(()=>(class extends rt{constructor(e,t,n,l){super(e),this._config=t,this.console=n,this.loader=l}supports(e){return!(!kt.hasOwnProperty(e.toLowerCase())&&!this.isCustomEvent(e)||!window.Hammer&&!this.loader&&(this.console.warn(`The "${e}" event cannot be bound because Hammer.JS is not `+"loaded and no custom loader has been specified."),1))}addEventListener(e,t,n){const l=this.manager.getZone();if(t=t.toLowerCase(),!window.Hammer&&this.loader){let l=!1,r=()=>{l=!0};return this.loader().then(()=>{if(!window.Hammer)return this.console.warn("The custom HAMMER_LOADER completed, but Hammer.JS is not present."),void(r=(()=>{}));l||(r=this.addEventListener(e,t,n))}).catch(()=>{this.console.warn(`The "${t}" event cannot be bound because the custom `+"Hammer.JS loader failed."),r=(()=>{})}),()=>{r()}}return l.runOutsideAngular(()=>{const r=this._config.buildHammer(e),i=function(e){l.runGuarded(function(){n(e)})};return r.on(t,i),()=>{r.off(t,i),"function"==typeof r.destroy&&r.destroy()}})}isCustomEvent(e){return this._config.events.indexOf(e)>-1}}))(),Nt=["alt","control","meta","shift"],Pt={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey},Mt=(()=>{class e extends rt{constructor(e){super(e)}supports(t){return null!=e.parseEventName(t)}addEventListener(t,n,l){const r=e.parseEventName(n),i=e.eventCallback(r.fullKey,l,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Le().onAndCancel(t,r.domEventName,i))}static parseEventName(t){const n=t.toLowerCase().split("."),l=n.shift();if(0===n.length||"keydown"!==l&&"keyup"!==l)return null;const r=e._normalizeKey(n.pop());let i="";if(Nt.forEach(e=>{const t=n.indexOf(e);t>-1&&(n.splice(t,1),i+=e+".")}),i+=r,0!=n.length||0===r.length)return null;const o={};return o.domEventName=l,o.fullKey=i,o}static getEventFullKey(e){let t="",n=Le().getEventKey(e);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),Nt.forEach(l=>{l!=n&&(0,Pt[l])(e)&&(t+=l+".")}),t+=n}static eventCallback(t,n,l){return r=>{e.getEventFullKey(r)===t&&l.runGuarded(()=>n(r))}}static _normalizeKey(e){switch(e){case"esc":return"escape";default:return e}}}return e})();class Lt{}const Ft=(()=>(class extends Lt{constructor(e){super(),this._doc=e}sanitize(e,t){if(null==t)return null;switch(e){case l.SecurityContext.NONE:return t;case l.SecurityContext.HTML:return t instanceof Bt?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"HTML"),Object(l["\u0275_sanitizeHtml"])(this._doc,String(t)));case l.SecurityContext.STYLE:return t instanceof jt?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"Style"),Object(l["\u0275_sanitizeStyle"])(t));case l.SecurityContext.SCRIPT:if(t instanceof Ht)return t.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(t,"Script"),new Error("unsafe value used in a script context");case l.SecurityContext.URL:return t instanceof zt||t instanceof Ut?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"URL"),Object(l["\u0275_sanitizeUrl"])(String(t)));case l.SecurityContext.RESOURCE_URL:if(t instanceof zt)return t.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(t,"ResourceURL"),new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${e} (see http://g.co/ng/security#xss)`)}}checkNotSafeValue(e,t){if(e instanceof Vt)throw new Error(`Required a safe ${t}, got a ${e.getTypeName()} `+"(see http://g.co/ng/security#xss)")}bypassSecurityTrustHtml(e){return new Bt(e)}bypassSecurityTrustStyle(e){return new jt(e)}bypassSecurityTrustScript(e){return new Ht(e)}bypassSecurityTrustUrl(e){return new Ut(e)}bypassSecurityTrustResourceUrl(e){return new zt(e)}}))();class Vt{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}`+" (see http://g.co/ng/security#xss)"}}class Bt extends Vt{getTypeName(){return"HTML"}}class jt extends Vt{getTypeName(){return"Style"}}class Ht extends Vt{getTypeName(){return"Script"}}class Ut extends Vt{getTypeName(){return"URL"}}class zt extends Vt{getTypeName(){return"ResourceURL"}}const $t=[{provide:l.PLATFORM_ID,useValue:Y["\u0275PLATFORM_BROWSER_ID"]},{provide:l.PLATFORM_INITIALIZER,useValue:function(){$e.makeCurrent(),Je.init()},multi:!0},{provide:Y.PlatformLocation,useClass:Ke,deps:[Y.DOCUMENT]},{provide:Y.DOCUMENT,useFactory:function(){return document},deps:[]}],qt=Object(l.createPlatformFactory)(l.platformCore,"browser",$t);function Wt(){return new l.ErrorHandler}const Gt=(()=>{class e{constructor(e){if(e)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:e,providers:[{provide:l.APP_ID,useValue:t.appId},{provide:Ze,useExisting:l.APP_ID},Ye]}}}return e})();function Kt(){return new Zt(Object(l["\u0275\u0275inject"])(Y.DOCUMENT))}const Zt=(()=>{class e{constructor(e){this._doc=e,this._dom=Le()}addTag(e,t=!1){return e?this._getOrCreateElement(e,t):null}addTags(e,t=!1){return e?e.reduce((e,n)=>(n&&e.push(this._getOrCreateElement(n,t)),e),[]):[]}getTag(e){return e&&this._dom.querySelector(this._doc,`meta[${e}]`)||null}getTags(e){if(!e)return[];const t=this._dom.querySelectorAll(this._doc,`meta[${e}]`);return t?[].slice.call(t):[]}updateTag(e,t){if(!e)return null;t=t||this._parseSelector(e);const n=this.getTag(t);return n?this._setMetaElementAttributes(e,n):this._getOrCreateElement(e,!0)}removeTag(e){this.removeTagElement(this.getTag(e))}removeTagElement(e){e&&this._dom.remove(e)}_getOrCreateElement(e,t=!1){if(!t){const t=this._parseSelector(e),n=this.getTag(t);if(n&&this._containsAttributes(e,n))return n}const n=this._dom.createElement("meta");this._setMetaElementAttributes(e,n);const l=this._dom.getElementsByTagName(this._doc,"head")[0];return this._dom.appendChild(l,n),n}_setMetaElementAttributes(e,t){return Object.keys(e).forEach(n=>this._dom.setAttribute(t,n,e[n])),t}_parseSelector(e){const t=e.name?"name":"property";return`${t}="${e[t]}"`}_containsAttributes(e,t){return Object.keys(e).every(n=>this._dom.getAttribute(t,n)===e[n])}}return e.ngInjectableDef=Object(l["\u0275\u0275defineInjectable"])({factory:Kt,token:e,providedIn:"root"}),e})();function Qt(){return new Yt(Object(l["\u0275\u0275inject"])(Y.DOCUMENT))}const Yt=(()=>{class e{constructor(e){this._doc=e}getTitle(){return Le().getTitle(this._doc)}setTitle(e){Le().setTitle(this._doc,e)}}return e.ngInjectableDef=Object(l["\u0275\u0275defineInjectable"])({factory:Qt,token:e,providedIn:"root"}),e})();"undefined"!=typeof window&&window;class Jt{constructor(e,t){this.id=e,this.url=t}}class Xt extends Jt{constructor(e,t,n="imperative",l=null){super(e,t),this.navigationTrigger=n,this.restoredState=l}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class en extends Jt{constructor(e,t,n){super(e,t),this.urlAfterRedirects=n}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class tn extends Jt{constructor(e,t,n){super(e,t),this.reason=n}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class nn extends Jt{constructor(e,t,n){super(e,t),this.error=n}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class ln extends Jt{constructor(e,t,n,l){super(e,t),this.urlAfterRedirects=n,this.state=l}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class rn extends Jt{constructor(e,t,n,l){super(e,t),this.urlAfterRedirects=n,this.state=l}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class on extends Jt{constructor(e,t,n,l,r){super(e,t),this.urlAfterRedirects=n,this.state=l,this.shouldActivate=r}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class sn extends Jt{constructor(e,t,n,l){super(e,t),this.urlAfterRedirects=n,this.state=l}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class an extends Jt{constructor(e,t,n,l){super(e,t),this.urlAfterRedirects=n,this.state=l}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class un{constructor(e){this.route=e}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class cn{constructor(e){this.route=e}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class dn{constructor(e){this.snapshot=e}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class hn{constructor(e){this.snapshot=e}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class pn{constructor(e){this.snapshot=e}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class fn{constructor(e){this.snapshot=e}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class gn{constructor(e,t,n){this.routerEvent=e,this.position=t,this.anchor=n}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const mn=(()=>(class{}))(),vn="primary";class yn{constructor(e){this.params=e||{}}has(e){return this.params.hasOwnProperty(e)}get(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t[0]:t}return null}getAll(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}}function bn(e){return new yn(e)}const Cn="ngNavigationCancelingError";function wn(e){const t=Error("NavigationCancelingError: "+e);return t[Cn]=!0,t}function Sn(e,t,n){const l=n.path.split("/");if(l.length>e.length)return null;if("full"===n.pathMatch&&(t.hasChildren()||l.length<e.length))return null;const r={};for(let i=0;i<l.length;i++){const t=l[i],n=e[i];if(t.startsWith(":"))r[t.substring(1)]=n;else if(t!==n.path)return null}return{consumed:e.slice(0,l.length),posParams:r}}class _n{constructor(e,t){this.routes=e,this.module=t}}function In(e,t=""){for(let n=0;n<e.length;n++){const l=e[n];En(l,Dn(t,l))}}function En(e,t){if(!e)throw new Error(`\n Invalid configuration of route '${t}': Encountered undefined route.\n The reason might be an extra comma.\n\n Example:\n const routes: Routes = [\n { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n { path: 'dashboard', component: DashboardComponent },, << two commas\n { path: 'detail/:id', component: HeroDetailComponent }\n ];\n `);if(Array.isArray(e))throw new Error(`Invalid configuration of route '${t}': Array cannot be specified`);if(!e.component&&!e.children&&!e.loadChildren&&e.outlet&&e.outlet!==vn)throw new Error(`Invalid configuration of route '${t}': a componentless route without children or loadChildren cannot have a named outlet set`);if(e.redirectTo&&e.children)throw new Error(`Invalid configuration of route '${t}': redirectTo and children cannot be used together`);if(e.redirectTo&&e.loadChildren)throw new Error(`Invalid configuration of route '${t}': redirectTo and loadChildren cannot be used together`);if(e.children&&e.loadChildren)throw new Error(`Invalid configuration of route '${t}': children and loadChildren cannot be used together`);if(e.redirectTo&&e.component)throw new Error(`Invalid configuration of route '${t}': redirectTo and component cannot be used together`);if(e.path&&e.matcher)throw new Error(`Invalid configuration of route '${t}': path and matcher cannot be used together`);if(void 0===e.redirectTo&&!e.component&&!e.children&&!e.loadChildren)throw new Error(`Invalid configuration of route '${t}'. One of the following must be provided: component, redirectTo, children or loadChildren`);if(void 0===e.path&&void 0===e.matcher)throw new Error(`Invalid configuration of route '${t}': routes must have either a path or a matcher specified`);if("string"==typeof e.path&&"/"===e.path.charAt(0))throw new Error(`Invalid configuration of route '${t}': path cannot start with a slash`);if(""===e.path&&void 0!==e.redirectTo&&void 0===e.pathMatch)throw new Error(`Invalid configuration of route '{path: "${t}", redirectTo: "${e.redirectTo}"}': please provide 'pathMatch'. The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`);if(void 0!==e.pathMatch&&"full"!==e.pathMatch&&"prefix"!==e.pathMatch)throw new Error(`Invalid configuration of route '${t}': pathMatch can only be set to 'prefix' or 'full'`);e.children&&In(e.children,t)}function Dn(e,t){return t?e||t.path?e&&!t.path?`${e}/`:!e&&t.path?t.path:`${e}/${t.path}`:"":e}function xn(e){const t=e.children&&e.children.map(xn),n=t?Object.assign({},e,{children:t}):Object.assign({},e);return!n.component&&(t||n.loadChildren)&&n.outlet&&n.outlet!==vn&&(n.component=mn),n}function kn(e,t){const n=Object.keys(e),l=Object.keys(t);if(!n||!l||n.length!=l.length)return!1;let r;for(let i=0;i<n.length;i++)if(e[r=n[i]]!==t[r])return!1;return!0}function An(e){return Array.prototype.concat.apply([],e)}function Tn(e){return e.length>0?e[e.length-1]:null}function Rn(e,t){for(const n in e)e.hasOwnProperty(n)&&t(e[n],n)}function On(e){return Object(l["\u0275isObservable"])(e)?e:Object(l["\u0275isPromise"])(e)?Object(J.a)(Promise.resolve(e)):I(e)}function Nn(e,t,n){return n?function(e,t){return kn(e,t)}(e.queryParams,t.queryParams)&&function e(t,n){if(!Fn(t.segments,n.segments))return!1;if(t.numberOfChildren!==n.numberOfChildren)return!1;for(const l in n.children){if(!t.children[l])return!1;if(!e(t.children[l],n.children[l]))return!1}return!0}(e.root,t.root):function(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(n=>t[n]===e[n])}(e.queryParams,t.queryParams)&&function e(t,n){return function t(n,l,r){if(n.segments.length>r.length){return!!Fn(n.segments.slice(0,r.length),r)&&!l.hasChildren()}if(n.segments.length===r.length){if(!Fn(n.segments,r))return!1;for(const t in l.children){if(!n.children[t])return!1;if(!e(n.children[t],l.children[t]))return!1}return!0}{const e=r.slice(0,n.segments.length),i=r.slice(n.segments.length);return!!Fn(n.segments,e)&&!!n.children[vn]&&t(n.children[vn],l,i)}}(t,n,n.segments)}(e.root,t.root)}class Pn{constructor(e,t,n){this.root=e,this.queryParams=t,this.fragment=n}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=bn(this.queryParams)),this._queryParamMap}toString(){return Hn.serialize(this)}}class Mn{constructor(e,t){this.segments=e,this.children=t,this.parent=null,Rn(t,(e,t)=>e.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return Un(this)}}class Ln{constructor(e,t){this.path=e,this.parameters=t}get parameterMap(){return this._parameterMap||(this._parameterMap=bn(this.parameters)),this._parameterMap}toString(){return Kn(this)}}function Fn(e,t){return e.length===t.length&&e.every((e,n)=>e.path===t[n].path)}function Vn(e,t){let n=[];return Rn(e.children,(e,l)=>{l===vn&&(n=n.concat(t(e,l)))}),Rn(e.children,(e,l)=>{l!==vn&&(n=n.concat(t(e,l)))}),n}class Bn{}class jn{parse(e){const t=new Xn(e);return new Pn(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(e){var t;return`${`/${function e(t,n){if(!t.hasChildren())return Un(t);if(n){const n=t.children[vn]?e(t.children[vn],!1):"",l=[];return Rn(t.children,(t,n)=>{n!==vn&&l.push(`${n}:${e(t,!1)}`)}),l.length>0?`${n}(${l.join("//")})`:n}{const n=Vn(t,(n,l)=>l===vn?[e(t.children[vn],!1)]:[`${l}:${e(n,!1)}`]);return`${Un(t)}/(${n.join("//")})`}}(e.root,!0)}`}${function(e){const t=Object.keys(e).map(t=>{const n=e[t];return Array.isArray(n)?n.map(e=>`${$n(t)}=${$n(e)}`).join("&"):`${$n(t)}=${$n(n)}`});return t.length?`?${t.join("&")}`:""}(e.queryParams)}${"string"==typeof e.fragment?`#${t=e.fragment,encodeURI(t)}`:""}`}}const Hn=new jn;function Un(e){return e.segments.map(e=>Kn(e)).join("/")}function zn(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function $n(e){return zn(e).replace(/%3B/gi,";")}function qn(e){return zn(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Wn(e){return decodeURIComponent(e)}function Gn(e){return Wn(e.replace(/\+/g,"%20"))}function Kn(e){return`${qn(e.path)}${t=e.parameters,Object.keys(t).map(e=>`;${qn(e)}=${qn(t[e])}`).join("")}`;var t}const Zn=/^[^\/()?;=#]+/;function Qn(e){const t=e.match(Zn);return t?t[0]:""}const Yn=/^[^=?&#]+/,Jn=/^[^?&#]+/;class Xn{constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Mn([],{}):new Mn([],this.parseChildren())}parseQueryParams(){const e={};if(this.consumeOptional("?"))do{this.parseQueryParam(e)}while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(n[vn]=new Mn(e,t)),n}parseSegment(){const e=Qn(this.remaining);if(""===e&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(e),new Ln(Wn(e),this.parseMatrixParams())}parseMatrixParams(){const e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){const t=Qn(this.remaining);if(!t)return;this.capture(t);let n="";if(this.consumeOptional("=")){const e=Qn(this.remaining);e&&this.capture(n=e)}e[Wn(t)]=Wn(n)}parseQueryParam(e){const t=function(e){const t=e.match(Yn);return t?t[0]:""}(this.remaining);if(!t)return;this.capture(t);let n="";if(this.consumeOptional("=")){const e=function(e){const t=e.match(Jn);return t?t[0]:""}(this.remaining);e&&this.capture(n=e)}const l=Gn(t),r=Gn(n);if(e.hasOwnProperty(l)){let t=e[l];Array.isArray(t)||(e[l]=t=[t]),t.push(r)}else e[l]=r}parseParens(e){const t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=Qn(this.remaining),l=this.remaining[n.length];if("/"!==l&&")"!==l&&";"!==l)throw new Error(`Cannot parse url '${this.url}'`);let r=void 0;n.indexOf(":")>-1?(r=n.substr(0,n.indexOf(":")),this.capture(r),this.capture(":")):e&&(r=vn);const i=this.parseChildren();t[r]=1===Object.keys(i).length?i[vn]:new Mn([],i),this.consumeOptional("//")}return t}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return!!this.peekStartsWith(e)&&(this.remaining=this.remaining.substring(e.length),!0)}capture(e){if(!this.consumeOptional(e))throw new Error(`Expected "${e}".`)}}class el{constructor(e){this._root=e}get root(){return this._root.value}parent(e){const t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null}children(e){const t=tl(e,this._root);return t?t.children.map(e=>e.value):[]}firstChild(e){const t=tl(e,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(e){const t=nl(e,this._root);return t.length<2?[]:t[t.length-2].children.map(e=>e.value).filter(t=>t!==e)}pathFromRoot(e){return nl(e,this._root).map(e=>e.value)}}function tl(e,t){if(e===t.value)return t;for(const n of t.children){const t=tl(e,n);if(t)return t}return null}function nl(e,t){if(e===t.value)return[t];for(const n of t.children){const l=nl(e,n);if(l.length)return l.unshift(t),l}return[]}class ll{constructor(e,t){this.value=e,this.children=t}toString(){return`TreeNode(${this.value})`}}function rl(e){const t={};return e&&e.children.forEach(e=>t[e.value.outlet]=e),t}class il extends el{constructor(e,t){super(e),this.snapshot=t,dl(this,e)}toString(){return this.snapshot.toString()}}function ol(e,t){const n=function(e,t){const n=new ul([],{},{},"",{},vn,t,null,e.root,-1,{});return new cl("",new ll(n,[]))}(e,t),l=new te([new Ln("",{})]),r=new te({}),i=new te({}),o=new te({}),s=new te(""),a=new sl(l,r,o,s,i,vn,t,n.root);return a.snapshot=n.root,new il(new ll(a,[]),n)}class sl{constructor(e,t,n,l,r,i,o,s){this.url=e,this.params=t,this.queryParams=n,this.fragment=l,this.data=r,this.outlet=i,this.component=o,this._futureSnapshot=s}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(Object(ae.a)(e=>bn(e)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Object(ae.a)(e=>bn(e)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function al(e,t="emptyOnly"){const n=e.pathFromRoot;let l=0;if("always"!==t)for(l=n.length-1;l>=1;){const e=n[l],t=n[l-1];if(e.routeConfig&&""===e.routeConfig.path)l--;else{if(t.component)break;l--}}return function(e){return e.reduce((e,t)=>({params:Object.assign({},e.params,t.params),data:Object.assign({},e.data,t.data),resolve:Object.assign({},e.resolve,t._resolvedData)}),{params:{},data:{},resolve:{}})}(n.slice(l))}class ul{constructor(e,t,n,l,r,i,o,s,a,u,c){this.url=e,this.params=t,this.queryParams=n,this.fragment=l,this.data=r,this.outlet=i,this.component=o,this.routeConfig=s,this._urlSegment=a,this._lastPathIndex=u,this._resolve=c}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=bn(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=bn(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(e=>e.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class cl extends el{constructor(e,t){super(t),this.url=e,dl(this,t)}toString(){return hl(this._root)}}function dl(e,t){t.value._routerState=e,t.children.forEach(t=>dl(e,t))}function hl(e){const t=e.children.length>0?` { ${e.children.map(hl).join(", ")} } `:"";return`${e.value}${t}`}function pl(e){if(e.snapshot){const t=e.snapshot,n=e._futureSnapshot;e.snapshot=n,kn(t.queryParams,n.queryParams)||e.queryParams.next(n.queryParams),t.fragment!==n.fragment&&e.fragment.next(n.fragment),kn(t.params,n.params)||e.params.next(n.params),function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!kn(e[n],t[n]))return!1;return!0}(t.url,n.url)||e.url.next(n.url),kn(t.data,n.data)||e.data.next(n.data)}else e.snapshot=e._futureSnapshot,e.data.next(e._futureSnapshot.data)}function fl(e,t){var n,l;return kn(e.params,t.params)&&Fn(n=e.url,l=t.url)&&n.every((e,t)=>kn(e.parameters,l[t].parameters))&&!(!e.parent!=!t.parent)&&(!e.parent||fl(e.parent,t.parent))}function gl(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function ml(e,t,n,l,r){let i={};return l&&Rn(l,(e,t)=>{i[t]=Array.isArray(e)?e.map(e=>`${e}`):`${e}`}),new Pn(n.root===e?t:function e(t,n,l){const r={};return Rn(t.children,(t,i)=>{r[i]=t===n?l:e(t,n,l)}),new Mn(t.segments,r)}(n.root,e,t),i,r)}class vl{constructor(e,t,n){if(this.isAbsolute=e,this.numberOfDoubleDots=t,this.commands=n,e&&n.length>0&&gl(n[0]))throw new Error("Root segment cannot have matrix parameters");const l=n.find(e=>"object"==typeof e&&null!=e&&e.outlets);if(l&&l!==Tn(n))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class yl{constructor(e,t,n){this.segmentGroup=e,this.processChildren=t,this.index=n}}function bl(e){return"object"==typeof e&&null!=e&&e.outlets?e.outlets[vn]:`${e}`}function Cl(e,t,n){if(e||(e=new Mn([],{})),0===e.segments.length&&e.hasChildren())return wl(e,t,n);const l=function(e,t,n){let l=0,r=t;const i={match:!1,pathIndex:0,commandIndex:0};for(;r<e.segments.length;){if(l>=n.length)return i;const t=e.segments[r],o=bl(n[l]),s=l<n.length-1?n[l+1]:null;if(r>0&&void 0===o)break;if(o&&s&&"object"==typeof s&&void 0===s.outlets){if(!El(o,s,t))return i;l+=2}else{if(!El(o,{},t))return i;l++}r++}return{match:!0,pathIndex:r,commandIndex:l}}(e,t,n),r=n.slice(l.commandIndex);if(l.match&&l.pathIndex<e.segments.length){const t=new Mn(e.segments.slice(0,l.pathIndex),{});return t.children[vn]=new Mn(e.segments.slice(l.pathIndex),e.children),wl(t,0,r)}return l.match&&0===r.length?new Mn(e.segments,{}):l.match&&!e.hasChildren()?Sl(e,t,n):l.match?wl(e,0,r):Sl(e,t,n)}function wl(e,t,n){if(0===n.length)return new Mn(e.segments,{});{const l=function(e){return"object"!=typeof e[0]?{[vn]:e}:void 0===e[0].outlets?{[vn]:e}:e[0].outlets}(n),r={};return Rn(l,(n,l)=>{null!==n&&(r[l]=Cl(e.children[l],t,n))}),Rn(e.children,(e,t)=>{void 0===l[t]&&(r[t]=e)}),new Mn(e.segments,r)}}function Sl(e,t,n){const l=e.segments.slice(0,t);let r=0;for(;r<n.length;){if("object"==typeof n[r]&&void 0!==n[r].outlets){const e=_l(n[r].outlets);return new Mn(l,e)}if(0===r&&gl(n[0])){l.push(new Ln(e.segments[t].path,n[0])),r++;continue}const i=bl(n[r]),o=r<n.length-1?n[r+1]:null;i&&o&&gl(o)?(l.push(new Ln(i,Il(o))),r+=2):(l.push(new Ln(i,{})),r++)}return new Mn(l,{})}function _l(e){const t={};return Rn(e,(e,n)=>{null!==e&&(t[n]=Sl(new Mn([],{}),0,e))}),t}function Il(e){const t={};return Rn(e,(e,n)=>t[n]=`${e}`),t}function El(e,t,n){return e==n.path&&kn(t,n.parameters)}const Dl=(e,t,n)=>Object(ae.a)(l=>(new xl(t,l.targetRouterState,l.currentRouterState,n).activate(e),l));class xl{constructor(e,t,n,l){this.routeReuseStrategy=e,this.futureState=t,this.currState=n,this.forwardEvent=l}activate(e){const t=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,n,e),pl(this.futureState.root),this.activateChildRoutes(t,n,e)}deactivateChildRoutes(e,t,n){const l=rl(t);e.children.forEach(e=>{const t=e.value.outlet;this.deactivateRoutes(e,l[t],n),delete l[t]}),Rn(l,(e,t)=>{this.deactivateRouteAndItsChildren(e,n)})}deactivateRoutes(e,t,n){const l=e.value,r=t?t.value:null;if(l===r)if(l.component){const r=n.getContext(l.outlet);r&&this.deactivateChildRoutes(e,t,r.children)}else this.deactivateChildRoutes(e,t,n);else r&&this.deactivateRouteAndItsChildren(t,n)}deactivateRouteAndItsChildren(e,t){this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,t):this.deactivateRouteAndOutlet(e,t)}detachAndStoreRouteSubtree(e,t){const n=t.getContext(e.value.outlet);if(n&&n.outlet){const t=n.outlet.detach(),l=n.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:t,route:e,contexts:l})}}deactivateRouteAndOutlet(e,t){const n=t.getContext(e.value.outlet);if(n){const l=rl(e),r=e.value.component?n.children:t;Rn(l,(e,t)=>this.deactivateRouteAndItsChildren(e,r)),n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated())}}activateChildRoutes(e,t,n){const l=rl(t);e.children.forEach(e=>{this.activateRoutes(e,l[e.value.outlet],n),this.forwardEvent(new fn(e.value.snapshot))}),e.children.length&&this.forwardEvent(new hn(e.value.snapshot))}activateRoutes(e,t,n){const l=e.value,r=t?t.value:null;if(pl(l),l===r)if(l.component){const r=n.getOrCreateContext(l.outlet);this.activateChildRoutes(e,t,r.children)}else this.activateChildRoutes(e,t,n);else if(l.component){const t=n.getOrCreateContext(l.outlet);if(this.routeReuseStrategy.shouldAttach(l.snapshot)){const e=this.routeReuseStrategy.retrieve(l.snapshot);this.routeReuseStrategy.store(l.snapshot,null),t.children.onOutletReAttached(e.contexts),t.attachRef=e.componentRef,t.route=e.route.value,t.outlet&&t.outlet.attach(e.componentRef,e.route.value),kl(e.route)}else{const n=function(e){for(let t=l.snapshot.parent;t;t=t.parent){const e=t.routeConfig;if(e&&e._loadedConfig)return e._loadedConfig;if(e&&e.component)return null}return null}(),r=n?n.module.componentFactoryResolver:null;t.attachRef=null,t.route=l,t.resolver=r,t.outlet&&t.outlet.activateWith(l,r),this.activateChildRoutes(e,null,t.children)}}else this.activateChildRoutes(e,null,n)}}function kl(e){pl(e.value),e.children.forEach(kl)}function Al(e){return"function"==typeof e}function Tl(e){return e instanceof Pn}class Rl{constructor(e){this.segmentGroup=e||null}}class Ol{constructor(e){this.urlTree=e}}function Nl(e){return new h.a(t=>t.error(new Rl(e)))}function Pl(e){return new h.a(t=>t.error(new Ol(e)))}function Ml(e){return new h.a(t=>t.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${e}'`)))}class Ll{constructor(e,t,n,r,i){this.configLoader=t,this.urlSerializer=n,this.urlTree=r,this.config=i,this.allowRedirects=!0,this.ngModule=e.get(l.NgModuleRef)}apply(){return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,vn).pipe(Object(ae.a)(e=>this.createUrlTree(e,this.urlTree.queryParams,this.urlTree.fragment))).pipe(fe(e=>{if(e instanceof Ol)return this.allowRedirects=!1,this.match(e.urlTree);if(e instanceof Rl)throw this.noMatchError(e);throw e}))}match(e){return this.expandSegmentGroup(this.ngModule,this.config,e.root,vn).pipe(Object(ae.a)(t=>this.createUrlTree(t,e.queryParams,e.fragment))).pipe(fe(e=>{if(e instanceof Rl)throw this.noMatchError(e);throw e}))}noMatchError(e){return new Error(`Cannot match any routes. URL Segment: '${e.segmentGroup}'`)}createUrlTree(e,t,n){const l=e.segments.length>0?new Mn([],{[vn]:e}):e;return new Pn(l,t,n)}expandSegmentGroup(e,t,n,l){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(e,t,n).pipe(Object(ae.a)(e=>new Mn([],e))):this.expandSegment(e,n,t,n.segments,l,!0)}expandChildren(e,t,n){return function(e,t){if(0===Object.keys(e).length)return I({});const n=[],l=[],r={};return Rn(e,(e,i)=>{const o=t(i,e).pipe(Object(ae.a)(e=>r[i]=e));i===vn?n.push(o):l.push(o)}),I.apply(null,n.concat(l)).pipe(D(),he(),Object(ae.a)(()=>r))}(n.children,(n,l)=>this.expandSegmentGroup(e,t,l,n))}expandSegment(e,t,n,l,r,i){return I(...n).pipe(Object(ae.a)(o=>this.expandSegmentAgainstRoute(e,t,n,o,l,r,i).pipe(fe(e=>{if(e instanceof Rl)return I(null);throw e}))),D(),K(e=>!!e),fe((e,n)=>{if(e instanceof A||"EmptyError"===e.name){if(this.noLeftoversInUrl(t,l,r))return I(new Mn([],{}));throw new Rl(t)}throw e}))}noLeftoversInUrl(e,t,n){return 0===t.length&&!e.children[n]}expandSegmentAgainstRoute(e,t,n,l,r,i,o){return jl(l)!==i?Nl(t):void 0===l.redirectTo?this.matchSegmentAgainstRoute(e,t,l,r):o&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(e,t,n,l,r,i):Nl(t)}expandSegmentAgainstRouteUsingRedirect(e,t,n,l,r,i){return"**"===l.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(e,n,l,i):this.expandRegularSegmentAgainstRouteUsingRedirect(e,t,n,l,r,i)}expandWildCardWithParamsAgainstRouteUsingRedirect(e,t,n,l){const r=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?Pl(r):this.lineralizeSegments(n,r).pipe(Object(ve.a)(n=>{const r=new Mn(n,{});return this.expandSegment(e,r,t,n,l,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(e,t,n,l,r,i){const{matched:o,consumedSegments:s,lastChild:a,positionalParamSegments:u}=Fl(t,l,r);if(!o)return Nl(t);const c=this.applyRedirectCommands(s,l.redirectTo,u);return l.redirectTo.startsWith("/")?Pl(c):this.lineralizeSegments(l,c).pipe(Object(ve.a)(l=>this.expandSegment(e,t,n,l.concat(r.slice(a)),i,!1)))}matchSegmentAgainstRoute(e,t,n,l){if("**"===n.path)return n.loadChildren?this.configLoader.load(e.injector,n).pipe(Object(ae.a)(e=>(n._loadedConfig=e,new Mn(l,{})))):I(new Mn(l,{}));const{matched:r,consumedSegments:i,lastChild:o}=Fl(t,n,l);if(!r)return Nl(t);const s=l.slice(o);return this.getChildConfig(e,n,l).pipe(Object(ve.a)(e=>{const n=e.module,l=e.routes,{segmentGroup:r,slicedSegments:o}=function(e,t,n,l){return n.length>0&&function(e,t,n){return l.some(n=>Bl(e,t,n)&&jl(n)!==vn)}(e,n)?{segmentGroup:Vl(new Mn(t,function(e,t){const n={};n[vn]=t;for(const l of e)""===l.path&&jl(l)!==vn&&(n[jl(l)]=new Mn([],{}));return n}(l,new Mn(n,e.children)))),slicedSegments:[]}:0===n.length&&function(e,t,n){return l.some(n=>Bl(e,t,n))}(e,n)?{segmentGroup:Vl(new Mn(e.segments,function(e,t,n,l){const r={};for(const i of n)Bl(e,t,i)&&!l[jl(i)]&&(r[jl(i)]=new Mn([],{}));return Object.assign({},l,r)}(e,n,l,e.children))),slicedSegments:n}:{segmentGroup:e,slicedSegments:n}}(t,i,s,l);return 0===o.length&&r.hasChildren()?this.expandChildren(n,l,r).pipe(Object(ae.a)(e=>new Mn(i,e))):0===l.length&&0===o.length?I(new Mn(i,{})):this.expandSegment(n,r,l,o,vn,!0).pipe(Object(ae.a)(e=>new Mn(i.concat(e.segments),e.children)))}))}getChildConfig(e,t,n){return t.children?I(new _n(t.children,e)):t.loadChildren?void 0!==t._loadedConfig?I(t._loadedConfig):function(e,t,n){const l=t.canLoad;return l&&0!==l.length?Object(J.a)(l).pipe(Object(ae.a)(l=>{const r=e.get(l);let i;if(function(e){return e&&Al(e.canLoad)}(r))i=r.canLoad(t,n);else{if(!Al(r))throw new Error("Invalid CanLoad guard");i=r(t,n)}return On(i)})).pipe(D(),(r=(e=>!0===e),e=>e.lift(new ye(r,void 0,e)))):I(!0);var r}(e.injector,t,n).pipe(Object(ve.a)(n=>n?this.configLoader.load(e.injector,t).pipe(Object(ae.a)(e=>(t._loadedConfig=e,e))):function(e){return new h.a(t=>t.error(wn(`Cannot load children because the guard of the route "path: '${e.path}'" returned false`)))}(t))):I(new _n([],e))}lineralizeSegments(e,t){let n=[],l=t.root;for(;;){if(n=n.concat(l.segments),0===l.numberOfChildren)return I(n);if(l.numberOfChildren>1||!l.children[vn])return Ml(e.redirectTo);l=l.children[vn]}}applyRedirectCommands(e,t,n){return this.applyRedirectCreatreUrlTree(t,this.urlSerializer.parse(t),e,n)}applyRedirectCreatreUrlTree(e,t,n,l){const r=this.createSegmentGroup(e,t.root,n,l);return new Pn(r,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(e,t){const n={};return Rn(e,(e,l)=>{if("string"==typeof e&&e.startsWith(":")){const r=e.substring(1);n[l]=t[r]}else n[l]=e}),n}createSegmentGroup(e,t,n,l){const r=this.createSegments(e,t.segments,n,l);let i={};return Rn(t.children,(t,r)=>{i[r]=this.createSegmentGroup(e,t,n,l)}),new Mn(r,i)}createSegments(e,t,n,l){return t.map(t=>t.path.startsWith(":")?this.findPosParam(e,t,l):this.findOrReturn(t,n))}findPosParam(e,t,n){const l=n[t.path.substring(1)];if(!l)throw new Error(`Cannot redirect to '${e}'. Cannot find '${t.path}'.`);return l}findOrReturn(e,t){let n=0;for(const l of t){if(l.path===e.path)return t.splice(n),l;n++}return e}}function Fl(e,t,n){if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||n.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};const l=(t.matcher||Sn)(n,e,t);return l?{matched:!0,consumedSegments:l.consumed,lastChild:l.consumed.length,positionalParamSegments:l.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function Vl(e){if(1===e.numberOfChildren&&e.children[vn]){const t=e.children[vn];return new Mn(e.segments.concat(t.segments),t.children)}return e}function Bl(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}function jl(e){return e.outlet||vn}class Hl{constructor(e){this.path=e,this.route=this.path[this.path.length-1]}}class Ul{constructor(e,t){this.component=e,this.route=t}}function zl(e,t,n){const l=e._root;return function e(t,n,l,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=rl(n);return t.children.forEach(t=>{!function(t,n,l,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=t.value,s=n?n.value:null,a=l?l.getContext(t.value.outlet):null;if(s&&o.routeConfig===s.routeConfig){const u=function(e,t,n){if("function"==typeof n)return n(e,t);switch(n){case"pathParamsChange":return!Fn(e.url,t.url);case"pathParamsOrQueryParamsChange":return!Fn(e.url,t.url)||!kn(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!fl(e,t)||!kn(e.queryParams,t.queryParams);case"paramsChange":default:return!fl(e,t)}}(s,o,o.routeConfig.runGuardsAndResolvers);if(u?i.canActivateChecks.push(new Hl(r)):(o.data=s.data,o._resolvedData=s._resolvedData),e(t,n,o.component?a?a.children:null:l,r,i),u){i.canDeactivateChecks.push(new Ul(a&&a.outlet&&a.outlet.component||null,s))}}else s&&ql(n,a,i),i.canActivateChecks.push(new Hl(r)),e(t,null,o.component?a?a.children:null:l,r,i)}(t,o[t.value.outlet],l,r.concat([t.value]),i),delete o[t.value.outlet]}),Rn(o,(e,t)=>ql(e,l.getContext(t),i)),i}(l,t?t._root:null,n,[l.value])}function $l(e,t,n){const l=function(e){if(!e)return null;for(let t=e.parent;t;t=t.parent){const e=t.routeConfig;if(e&&e._loadedConfig)return e._loadedConfig}return null}(t);return(l?l.module.injector:n).get(e)}function ql(e,t,n){const l=rl(e),r=e.value;Rn(l,(e,l)=>{ql(e,r.component?t?t.children.getContext(l):null:t,n)}),n.canDeactivateChecks.push(new Ul(r.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,r))}const Wl=Symbol("INITIAL_VALUE");function Gl(){return Ce(e=>(function(...e){let t=null,n=null;return Object(w.a)(e[e.length-1])&&(n=e.pop()),"function"==typeof e[e.length-1]&&(t=e.pop()),1===e.length&&Object(b.a)(e[0])&&(e=e[0]),Object(S.a)(e,n).lift(new ie(t))})(...e.map(e=>e.pipe(V(1),function(...e){const t=e[e.length-1];return Object(w.a)(t)?(e.pop(),n=>x(e,n,t)):t=>x(e,t)}(Wl)))).pipe(_e((e,t)=>{let n=!1;return t.reduce((e,l,r)=>{if(e!==Wl)return e;if(l===Wl&&(n=!0),!n){if(!1===l)return l;if(r===t.length-1||Tl(l))return l}return e},e)},Wl),R(e=>e!==Wl),Object(ae.a)(e=>Tl(e)?e:!0===e),V(1)))}function Kl(e,t){return null!==e&&t&&t(new pn(e)),I(!0)}function Zl(e,t){return null!==e&&t&&t(new dn(e)),I(!0)}function Ql(e,t,n){const l=t.routeConfig?t.routeConfig.canActivate:null;return l&&0!==l.length?I(l.map(l=>se(()=>{const r=$l(l,t,n);let i;if(function(e){return e&&Al(e.canActivate)}(r))i=On(r.canActivate(t,e));else{if(!Al(r))throw new Error("Invalid CanActivate guard");i=On(r(t,e))}return i.pipe(K())}))).pipe(Gl()):I(!0)}function Yl(e,t,n){const l=t[t.length-1],r=t.slice(0,t.length-1).reverse().map(e=>(function(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null})(e)).filter(e=>null!==e).map(t=>se(()=>I(t.guards.map(r=>{const i=$l(r,t.node,n);let o;if(function(e){return e&&Al(e.canActivateChild)}(i))o=On(i.canActivateChild(l,e));else{if(!Al(i))throw new Error("Invalid CanActivateChild guard");o=On(i(l,e))}return o.pipe(K())})).pipe(Gl())));return I(r).pipe(Gl())}class Jl{}class Xl{constructor(e,t,n,l,r,i){this.rootComponentType=e,this.config=t,this.urlTree=n,this.url=l,this.paramsInheritanceStrategy=r,this.relativeLinkResolution=i}recognize(){try{const t=nr(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,n=this.processSegmentGroup(this.config,t,vn),l=new ul([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},vn,this.rootComponentType,null,this.urlTree.root,-1,{}),r=new ll(l,n),i=new cl(this.url,r);return this.inheritParamsAndData(i._root),I(i)}catch(e){return new h.a(t=>t.error(e))}}inheritParamsAndData(e){const t=e.value,n=al(t,this.paramsInheritanceStrategy);t.params=Object.freeze(n.params),t.data=Object.freeze(n.data),e.children.forEach(e=>this.inheritParamsAndData(e))}processSegmentGroup(e,t,n){return 0===t.segments.length&&t.hasChildren()?this.processChildren(e,t):this.processSegment(e,t,t.segments,n)}processChildren(e,t){const n=Vn(t,(t,n)=>this.processSegmentGroup(e,t,n));return function(e){const t={};n.forEach(e=>{const n=t[e.value.outlet];if(n){const t=n.url.map(e=>e.toString()).join("/"),l=e.value.url.map(e=>e.toString()).join("/");throw new Error(`Two segments cannot have the same outlet name: '${t}' and '${l}'.`)}t[e.value.outlet]=e.value})}(),n.sort((e,t)=>e.value.outlet===vn?-1:t.value.outlet===vn?1:e.value.outlet.localeCompare(t.value.outlet)),n}processSegment(e,t,n,l){for(const i of e)try{return this.processSegmentAgainstRoute(i,t,n,l)}catch(r){if(!(r instanceof Jl))throw r}if(this.noLeftoversInUrl(t,n,l))return[];throw new Jl}noLeftoversInUrl(e,t,n){return 0===t.length&&!e.children[n]}processSegmentAgainstRoute(e,t,n,l){if(e.redirectTo)throw new Jl;if((e.outlet||vn)!==l)throw new Jl;let r,i=[],o=[];if("**"===e.path){const i=n.length>0?Tn(n).parameters:{};r=new ul(n,i,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,ir(e),l,e.component,e,er(t),tr(t)+n.length,or(e))}else{const s=function(e,t,n){if(""===t.path){if("full"===t.pathMatch&&(e.hasChildren()||n.length>0))throw new Jl;return{consumedSegments:[],lastChild:0,parameters:{}}}const l=(t.matcher||Sn)(n,e,t);if(!l)throw new Jl;const r={};Rn(l.posParams,(e,t)=>{r[t]=e.path});const i=l.consumed.length>0?Object.assign({},r,l.consumed[l.consumed.length-1].parameters):r;return{consumedSegments:l.consumed,lastChild:l.consumed.length,parameters:i}}(t,e,n);i=s.consumedSegments,o=n.slice(s.lastChild),r=new ul(i,s.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,ir(e),l,e.component,e,er(t),tr(t)+i.length,or(e))}const s=function(e){return e.children?e.children:e.loadChildren?e._loadedConfig.routes:[]}(e),{segmentGroup:a,slicedSegments:u}=nr(t,i,o,s,this.relativeLinkResolution);if(0===u.length&&a.hasChildren()){const e=this.processChildren(s,a);return[new ll(r,e)]}if(0===s.length&&0===u.length)return[new ll(r,[])];const c=this.processSegment(s,a,u,vn);return[new ll(r,c)]}}function er(e){let t=e;for(;t._sourceSegment;)t=t._sourceSegment;return t}function tr(e){let t=e,n=t._segmentIndexShift?t._segmentIndexShift:0;for(;t._sourceSegment;)n+=(t=t._sourceSegment)._segmentIndexShift?t._segmentIndexShift:0;return n-1}function nr(e,t,n,l,r){if(n.length>0&&function(e,t,n){return l.some(n=>lr(e,t,n)&&rr(n)!==vn)}(e,n)){const r=new Mn(t,function(e,t,n,l){const r={};r[vn]=l,l._sourceSegment=e,l._segmentIndexShift=t.length;for(const i of n)if(""===i.path&&rr(i)!==vn){const n=new Mn([],{});n._sourceSegment=e,n._segmentIndexShift=t.length,r[rr(i)]=n}return r}(e,t,l,new Mn(n,e.children)));return r._sourceSegment=e,r._segmentIndexShift=t.length,{segmentGroup:r,slicedSegments:[]}}if(0===n.length&&function(e,t,n){return l.some(n=>lr(e,t,n))}(e,n)){const i=new Mn(e.segments,function(e,t,n,l,r,i){const o={};for(const s of l)if(lr(e,n,s)&&!r[rr(s)]){const n=new Mn([],{});n._sourceSegment=e,n._segmentIndexShift="legacy"===i?e.segments.length:t.length,o[rr(s)]=n}return Object.assign({},r,o)}(e,t,n,l,e.children,r));return i._sourceSegment=e,i._segmentIndexShift=t.length,{segmentGroup:i,slicedSegments:n}}const i=new Mn(e.segments,e.children);return i._sourceSegment=e,i._segmentIndexShift=t.length,{segmentGroup:i,slicedSegments:n}}function lr(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function rr(e){return e.outlet||vn}function ir(e){return e.data||{}}function or(e){return e.resolve||{}}function sr(e,t,n,l){const r=$l(e,t,l);return On(r.resolve?r.resolve(t,n):r(t,n))}function ar(e){return function(t){return t.pipe(Ce(t=>{const n=e(t);return n?Object(J.a)(n).pipe(Object(ae.a)(()=>t)):Object(J.a)([t])}))}}class ur{}class cr{shouldDetach(e){return!1}store(e,t){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,t){return e.routeConfig===t.routeConfig}}const dr=new l.InjectionToken("ROUTES");class hr{constructor(e,t,n,l){this.loader=e,this.compiler=t,this.onLoadStartListener=n,this.onLoadEndListener=l}load(e,t){return this.onLoadStartListener&&this.onLoadStartListener(t),this.loadModuleFactory(t.loadChildren).pipe(Object(ae.a)(n=>{this.onLoadEndListener&&this.onLoadEndListener(t);const l=n.create(e);return new _n(An(l.injector.get(dr)).map(xn),l)}))}loadModuleFactory(e){return"string"==typeof e?Object(J.a)(this.loader.load(e)):On(e()).pipe(Object(ve.a)(e=>e instanceof l.NgModuleFactory?I(e):Object(J.a)(this.compiler.compileModuleAsync(e))))}}class pr{}class fr{shouldProcessUrl(e){return!0}extract(e){return e}merge(e,t){return e}}function gr(e){throw e}function mr(e,t,n){return t.parse("/")}function vr(e,t){return I(null)}class yr{constructor(e,t,n,r,i,o,s,a){this.rootComponentType=e,this.urlSerializer=t,this.rootContexts=n,this.location=r,this.config=a,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new X.a,this.errorHandler=gr,this.malformedUriErrorHandler=mr,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:vr,afterPreactivation:vr},this.urlHandlingStrategy=new fr,this.routeReuseStrategy=new cr,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="legacy",this.ngModule=i.get(l.NgModuleRef),this.console=i.get(l["\u0275Console"]);const u=i.get(l.NgZone);this.isNgZoneEnabled=u instanceof l.NgZone,this.resetConfig(a),this.currentUrlTree=new Pn(new Mn([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new hr(o,s,e=>this.triggerEvent(new un(e)),e=>this.triggerEvent(new cn(e))),this.routerState=ol(this.currentUrlTree,this.rootComponentType),this.transitions=new te({id:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}setupNavigations(e){const t=this.events;return e.pipe(R(e=>0!==e.id),Object(ae.a)(e=>Object.assign({},e,{extractedUrl:this.urlHandlingStrategy.extract(e.rawUrl)})),Ce(e=>{let n=!1,l=!1;return I(e).pipe(Te(e=>{this.currentNavigation={id:e.id,initialUrl:e.currentRawUrl,extractedUrl:e.extractedUrl,trigger:e.source,extras:e.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign({},this.lastSuccessfulNavigation,{previousNavigation:null}):null}}),Ce(e=>{const n=!this.navigated||e.extractedUrl.toString()!==this.browserUrlTree.toString();if(("reload"===this.onSameUrlNavigation||n)&&this.urlHandlingStrategy.shouldProcessUrl(e.rawUrl))return I(e).pipe(Ce(e=>{const n=this.transitions.getValue();return t.next(new Xt(e.id,this.serializeUrl(e.extractedUrl),e.source,e.restoredState)),n!==this.transitions.getValue()?L:[e]}),Ce(e=>Promise.resolve(e)),function(e,t,n,l){return function(r){return r.pipe(Ce(r=>(function(e,t,n,l,i){return new Ll(e,t,n,r.extractedUrl,i).apply()})(e,t,n,0,l).pipe(Object(ae.a)(e=>Object.assign({},r,{urlAfterRedirects:e})))))}}(this.ngModule.injector,this.configLoader,this.urlSerializer,this.config),Te(e=>{this.currentNavigation=Object.assign({},this.currentNavigation,{finalUrl:e.urlAfterRedirects})}),function(e,t,n,l,r){return function(i){return i.pipe(Object(ve.a)(i=>(function(e,t,n,l,r="emptyOnly",i="legacy"){return new Xl(e,t,n,l,r,i).recognize()})(e,t,i.urlAfterRedirects,n(i.urlAfterRedirects),l,r).pipe(Object(ae.a)(e=>Object.assign({},i,{targetSnapshot:e})))))}}(this.rootComponentType,this.config,e=>this.serializeUrl(e),this.paramsInheritanceStrategy,this.relativeLinkResolution),Te(e=>{"eager"===this.urlUpdateStrategy&&(e.extras.skipLocationChange||this.setBrowserUrl(e.urlAfterRedirects,!!e.extras.replaceUrl,e.id,e.extras.state),this.browserUrlTree=e.urlAfterRedirects)}),Te(e=>{const n=new ln(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);t.next(n)}));if(n&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:n,extractedUrl:l,source:r,restoredState:i,extras:o}=e,s=new Xt(n,this.serializeUrl(l),r,i);t.next(s);const a=ol(l,this.rootComponentType).snapshot;return I(Object.assign({},e,{targetSnapshot:a,urlAfterRedirects:l,extras:Object.assign({},o,{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=e.rawUrl,this.browserUrlTree=e.urlAfterRedirects,e.resolve(null),L}),ar(e=>{const{targetSnapshot:t,id:n,extractedUrl:l,rawUrl:r,extras:{skipLocationChange:i,replaceUrl:o}}=e;return this.hooks.beforePreactivation(t,{navigationId:n,appliedUrlTree:l,rawUrlTree:r,skipLocationChange:!!i,replaceUrl:!!o})}),Te(e=>{const t=new rn(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);this.triggerEvent(t)}),Object(ae.a)(e=>Object.assign({},e,{guards:zl(e.targetSnapshot,e.currentSnapshot,this.rootContexts)})),function(e,t){return function(n){return n.pipe(Object(ve.a)(n=>{const{targetSnapshot:l,currentSnapshot:r,guards:{canActivateChecks:i,canDeactivateChecks:o}}=n;return 0===o.length&&0===i.length?I(Object.assign({},n,{guardsResult:!0})):function(e,t,n,l){return Object(J.a)(e).pipe(Object(ve.a)(e=>(function(e,t,n,l,r){const i=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return i&&0!==i.length?I(i.map(i=>{const o=$l(i,t,r);let s;if(function(e){return e&&Al(e.canDeactivate)}(o))s=On(o.canDeactivate(e,t,n,l));else{if(!Al(o))throw new Error("Invalid CanDeactivate guard");s=On(o(e,t,n,l))}return s.pipe(K())})).pipe(Gl()):I(!0)})(e.component,e.route,n,t,l)),K(e=>!0!==e,!0))}(o,l,r,e).pipe(Object(ve.a)(n=>n&&function(e){return"boolean"==typeof n}()?function(e,t,n,l){return Object(J.a)(t).pipe(De(t=>Object(J.a)([Zl(t.route.parent,l),Kl(t.route,l),Yl(e,t.path,n),Ql(e,t.route,n)]).pipe(D(),K(e=>!0!==e,!0))),K(e=>!0!==e,!0))}(l,i,e,t):I(n)),Object(ae.a)(e=>Object.assign({},n,{guardsResult:e})))}))}}(this.ngModule.injector,e=>this.triggerEvent(e)),Te(e=>{if(Tl(e.guardsResult)){const t=wn(`Redirecting to "${this.serializeUrl(e.guardsResult)}"`);throw t.url=e.guardsResult,t}}),Te(e=>{const t=new on(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot,!!e.guardsResult);this.triggerEvent(t)}),R(e=>{if(!e.guardsResult){this.resetUrlToCurrentUrlTree();const n=new tn(e.id,this.serializeUrl(e.extractedUrl),"");return t.next(n),e.resolve(!1),!1}return!0}),ar(e=>{if(e.guards.canActivateChecks.length)return I(e).pipe(Te(e=>{const t=new sn(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);this.triggerEvent(t)}),function(e,t){return function(n){return n.pipe(Object(ve.a)(n=>{const{targetSnapshot:l,guards:{canActivateChecks:r}}=n;return r.length?Object(J.a)(r).pipe(De(n=>(function(e,t,n,r){return function(e,t,n,l){const r=Object.keys(e);if(0===r.length)return I({});if(1===r.length){const i=r[0];return sr(e[i],t,n,l).pipe(Object(ae.a)(e=>({[i]:e})))}const i={};return Object(J.a)(r).pipe(Object(ve.a)(r=>sr(e[r],t,n,l).pipe(Object(ae.a)(e=>(i[r]=e,e))))).pipe(he(),Object(ae.a)(()=>i))}(e._resolve,e,l,r).pipe(Object(ae.a)(t=>(e._resolvedData=t,e.data=Object.assign({},e.data,al(e,n).resolve),null)))})(n.route,0,e,t)),function(e,t){return arguments.length>=2?function(t){return Object(xe.a)(_e(e,void 0),ue(1),H(void 0))(t)}:function(t){return Object(xe.a)(_e((t,n,l)=>e(t)),ue(1))(t)}}((e,t)=>e),Object(ae.a)(e=>n)):I(n)}))}}(this.paramsInheritanceStrategy,this.ngModule.injector),Te(e=>{const t=new an(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(e.urlAfterRedirects),e.targetSnapshot);this.triggerEvent(t)}))}),ar(e=>{const{targetSnapshot:t,id:n,extractedUrl:l,rawUrl:r,extras:{skipLocationChange:i,replaceUrl:o}}=e;return this.hooks.afterPreactivation(t,{navigationId:n,appliedUrlTree:l,rawUrlTree:r,skipLocationChange:!!i,replaceUrl:!!o})}),Object(ae.a)(e=>{const t=function(e,t,n){const l=function e(t,n,l){if(l&&t.shouldReuseRoute(n.value,l.value.snapshot)){const r=l.value;r._futureSnapshot=n.value;const i=function(t,n,l){return n.children.map(n=>{for(const r of l.children)if(t.shouldReuseRoute(r.value.snapshot,n.value))return e(t,n,r);return e(t,n)})}(t,n,l);return new ll(r,i)}{const l=t.retrieve(n.value);if(l){const e=l.route;return function e(t,n){if(t.value.routeConfig!==n.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(t.children.length!==n.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");n.value._futureSnapshot=t.value;for(let l=0;l<t.children.length;++l)e(t.children[l],n.children[l])}(n,e),e}{const l=new sl(new te((r=n.value).url),new te(r.params),new te(r.queryParams),new te(r.fragment),new te(r.data),r.outlet,r.component,r),i=n.children.map(n=>e(t,n));return new ll(l,i)}}var r}(e,t._root,n?n._root:void 0);return new il(l,t)}(this.routeReuseStrategy,e.targetSnapshot,e.currentRouterState);return Object.assign({},e,{targetRouterState:t})}),Te(e=>{this.currentUrlTree=e.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,e.rawUrl),this.routerState=e.targetRouterState,"deferred"===this.urlUpdateStrategy&&(e.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,!!e.extras.replaceUrl,e.id,e.extras.state),this.browserUrlTree=e.urlAfterRedirects)}),Dl(this.rootContexts,this.routeReuseStrategy,e=>this.triggerEvent(e)),Te({next(){n=!0},complete(){n=!0}}),function(e){return t=>t.lift(new Ne(e))}(()=>{if(!n&&!l){this.resetUrlToCurrentUrlTree();const n=new tn(e.id,this.serializeUrl(e.extractedUrl),`Navigation ID ${e.id} is not equal to the current navigation id ${this.navigationId}`);t.next(n),e.resolve(!1)}this.currentNavigation=null}),fe(n=>{if(l=!0,function(e){return n&&n[Cn]}()){const l=Tl(n.url);l||(this.navigated=!0,this.resetStateAndUrl(e.currentRouterState,e.currentUrlTree,e.rawUrl));const r=new tn(e.id,this.serializeUrl(e.extractedUrl),n.message);t.next(r),e.resolve(!1),l&&this.navigateByUrl(n.url)}else{this.resetStateAndUrl(e.currentRouterState,e.currentUrlTree,e.rawUrl);const l=new nn(e.id,this.serializeUrl(e.extractedUrl),n);t.next(l);try{e.resolve(this.errorHandler(n))}catch(r){e.reject(r)}}return L}))}))}resetRootComponentType(e){this.rootComponentType=e,this.routerState.root.component=this.rootComponentType}getTransition(){const e=this.transitions.value;return e.urlAfterRedirects=this.browserUrlTree,e}setTransition(e){this.transitions.next(Object.assign({},this.getTransition(),e))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(e=>{let t=this.parseUrl(e.url);const n="popstate"===e.type?"popstate":"hashchange",l=e.state&&e.state.navigationId?e.state:null;setTimeout(()=>{this.scheduleNavigation(t,n,l,{replaceUrl:!0})},0)}))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(e){this.events.next(e)}resetConfig(e){In(e),this.config=e.map(xn),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)}createUrlTree(e,t={}){const{relativeTo:n,queryParams:r,fragment:i,preserveQueryParams:o,queryParamsHandling:s,preserveFragment:a}=t;Object(l.isDevMode)()&&o&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");const u=n||this.routerState.root,c=a?this.currentUrlTree.fragment:i;let d=null;if(s)switch(s){case"merge":d=Object.assign({},this.currentUrlTree.queryParams,r);break;case"preserve":d=this.currentUrlTree.queryParams;break;default:d=r||null}else d=o?this.currentUrlTree.queryParams:r||null;return null!==d&&(d=this.removeEmptyProps(d)),function(e,t,n,l,r){if(0===n.length)return ml(t.root,t.root,t,l,r);const i=function(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new vl(!0,0,e);let t=0,n=!1;const l=e.reduce((e,l,r)=>{if("object"==typeof l&&null!=l){if(l.outlets){const t={};return Rn(l.outlets,(e,n)=>{t[n]="string"==typeof e?e.split("/"):e}),[...e,{outlets:t}]}if(l.segmentPath)return[...e,l.segmentPath]}return"string"!=typeof l?[...e,l]:0===r?(l.split("/").forEach((l,r)=>{0==r&&"."===l||(0==r&&""===l?n=!0:".."===l?t++:""!=l&&e.push(l))}),e):[...e,l]},[]);return new vl(n,t,l)}(n);if(i.toRoot())return ml(t.root,new Mn([],{}),t,l,r);const o=function(e,n,l){if(e.isAbsolute)return new yl(t.root,!0,0);if(-1===l.snapshot._lastPathIndex)return new yl(l.snapshot._urlSegment,!0,0);const r=gl(e.commands[0])?0:1;return function(t,n,i){let o=l.snapshot._urlSegment,s=l.snapshot._lastPathIndex+r,a=e.numberOfDoubleDots;for(;a>s;){if(a-=s,!(o=o.parent))throw new Error("Invalid number of '../'");s=o.segments.length}return new yl(o,!1,s-a)}()}(i,0,e),s=o.processChildren?wl(o.segmentGroup,o.index,i.commands):Cl(o.segmentGroup,o.index,i.commands);return ml(o.segmentGroup,s,t,l,r)}(u,this.currentUrlTree,e,d,c)}navigateByUrl(e,t={skipLocationChange:!1}){Object(l.isDevMode)()&&this.isNgZoneEnabled&&!l.NgZone.isInAngularZone()&&this.console.warn("Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?");const n=Tl(e)?e:this.parseUrl(e),r=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(r,"imperative",null,t)}navigate(e,t={skipLocationChange:!1}){return function(e){for(let t=0;t<e.length;t++){const n=e[t];if(null==n)throw new Error(`The requested path contains ${n} segment at index ${t}`)}}(e),this.navigateByUrl(this.createUrlTree(e,t),t)}serializeUrl(e){return this.urlSerializer.serialize(e)}parseUrl(e){let t;try{t=this.urlSerializer.parse(e)}catch(n){t=this.malformedUriErrorHandler(n,this.urlSerializer,e)}return t}isActive(e,t){if(Tl(e))return Nn(this.currentUrlTree,e,t);const n=this.parseUrl(e);return Nn(this.currentUrlTree,n,t)}removeEmptyProps(e){return Object.keys(e).reduce((t,n)=>{const l=e[n];return null!=l&&(t[n]=l),t},{})}processNavigations(){this.navigations.subscribe(e=>{this.navigated=!0,this.lastSuccessfulId=e.id,this.events.next(new en(e.id,this.serializeUrl(e.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.currentNavigation=null,e.resolve(!0)},e=>{this.console.warn("Unhandled Navigation Error: ")})}scheduleNavigation(e,t,n,l){const r=this.getTransition();if(r&&"imperative"!==t&&"imperative"===r.source&&r.rawUrl.toString()===e.toString())return Promise.resolve(!0);if(r&&"hashchange"==t&&"popstate"===r.source&&r.rawUrl.toString()===e.toString())return Promise.resolve(!0);if(r&&"popstate"==t&&"hashchange"===r.source&&r.rawUrl.toString()===e.toString())return Promise.resolve(!0);let i=null,o=null;const s=new Promise((e,t)=>{i=e,o=t}),a=++this.navigationId;return this.setTransition({id:a,source:t,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:e,extras:l,resolve:i,reject:o,promise:s,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),s.catch(e=>Promise.reject(e))}setBrowserUrl(e,t,n,l){const r=this.urlSerializer.serialize(e);l=l||{},this.location.isCurrentPathEqualTo(r)||t?this.location.replaceState(r,"",Object.assign({},l,{navigationId:n})):this.location.go(r,"",Object.assign({},l,{navigationId:n}))}resetStateAndUrl(e,t,n){this.routerState=e,this.currentUrlTree=t,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})}}const br=(()=>(class{constructor(e,t,n,l,r){this.router=e,this.route=t,this.commands=[],null==n&&l.setAttribute(r.nativeElement,"tabindex","0")}set routerLink(e){this.commands=null!=e?Array.isArray(e)?e:[e]:[]}set preserveQueryParams(e){Object(l.isDevMode)()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated!, use queryParamsHandling instead."),this.preserve=e}onClick(){const e={skipLocationChange:wr(this.skipLocationChange),replaceUrl:wr(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,e),!0}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:wr(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:wr(this.preserveFragment)})}}))(),Cr=(()=>(class{constructor(e,t,n){this.router=e,this.route=t,this.locationStrategy=n,this.commands=[],this.subscription=e.events.subscribe(e=>{e instanceof en&&this.updateTargetUrlAndHref()})}set routerLink(e){this.commands=null!=e?Array.isArray(e)?e:[e]:[]}set preserveQueryParams(e){Object(l.isDevMode)()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead."),this.preserve=e}ngOnChanges(e){this.updateTargetUrlAndHref()}ngOnDestroy(){this.subscription.unsubscribe()}onClick(e,t,n,l){if(0!==e||t||n||l)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;const r={skipLocationChange:wr(this.skipLocationChange),replaceUrl:wr(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,r),!1}updateTargetUrlAndHref(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:wr(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:wr(this.preserveFragment)})}}))();function wr(e){return""===e||!!e}const Sr=(()=>(class{constructor(e,t,n,l,r){this.router=e,this.element=t,this.renderer=n,this.link=l,this.linkWithHref=r,this.classes=[],this.isActive=!1,this.routerLinkActiveOptions={exact:!1},this.subscription=e.events.subscribe(e=>{e instanceof en&&this.update()})}ngAfterContentInit(){this.links.changes.subscribe(e=>this.update()),this.linksWithHrefs.changes.subscribe(e=>this.update()),this.update()}set routerLinkActive(e){const t=Array.isArray(e)?e:e.split(" ");this.classes=t.filter(e=>!!e)}ngOnChanges(e){this.update()}ngOnDestroy(){this.subscription.unsubscribe()}update(){this.links&&this.linksWithHrefs&&this.router.navigated&&Promise.resolve().then(()=>{const e=this.hasActiveLinks();this.isActive!==e&&(this.isActive=e,this.classes.forEach(t=>{e?this.renderer.addClass(this.element.nativeElement,t):this.renderer.removeClass(this.element.nativeElement,t)}))})}isLinkActive(e){return t=>e.isActive(t.urlTree,this.routerLinkActiveOptions.exact)}hasActiveLinks(){const e=this.isLinkActive(this.router);return this.link&&e(this.link)||this.linkWithHref&&e(this.linkWithHref)||this.links.some(e)||this.linksWithHrefs.some(e)}}))();class _r{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new Ir,this.attachRef=null}}class Ir{constructor(){this.contexts=new Map}onChildOutletCreated(e,t){const n=this.getOrCreateContext(e);n.outlet=t,this.contexts.set(e,n)}onChildOutletDestroyed(e){const t=this.getContext(e);t&&(t.outlet=null)}onOutletDeactivated(){const e=this.contexts;return this.contexts=new Map,e}onOutletReAttached(e){this.contexts=e}getOrCreateContext(e){let t=this.getContext(e);return t||(t=new _r,this.contexts.set(e,t)),t}getContext(e){return this.contexts.get(e)||null}}const Er=(()=>(class{constructor(e,t,n,r,i){this.parentContexts=e,this.location=t,this.resolver=n,this.changeDetector=i,this.activated=null,this._activatedRoute=null,this.activateEvents=new l.EventEmitter,this.deactivateEvents=new l.EventEmitter,this.name=r||vn,e.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const e=this.parentContexts.getContext(this.name);e&&e.route&&(e.attachRef?this.attach(e.attachRef,e.route):this.activateWith(e.route,e.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const e=this.activated;return this.activated=null,this._activatedRoute=null,e}attach(e,t){this.activated=e,this._activatedRoute=t,this.location.insert(e.hostView)}deactivate(){if(this.activated){const e=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(e)}}activateWith(e,t){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=e;const n=(t=t||this.resolver).resolveComponentFactory(e._futureSnapshot.routeConfig.component),l=this.parentContexts.getOrCreateContext(this.name).children,r=new Dr(e,l,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,r),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}))();class Dr{constructor(e,t,n){this.route=e,this.childContexts=t,this.parent=n}get(e,t){return e===sl?this.route:e===Ir?this.childContexts:this.parent.get(e,t)}}class xr{}class kr{preload(e,t){return t().pipe(fe(()=>I(null)))}}class Ar{preload(e,t){return I(null)}}const Tr=(()=>(class{constructor(e,t,n,l,r){this.router=e,this.injector=l,this.preloadingStrategy=r,this.loader=new hr(t,n,t=>e.triggerEvent(new un(t)),t=>e.triggerEvent(new cn(t)))}setUpPreloading(){this.subscription=this.router.events.pipe(R(e=>e instanceof en),De(()=>this.preload())).subscribe(()=>{})}preload(){const e=this.injector.get(l.NgModuleRef);return this.processRoutes(e,this.router.config)}ngOnDestroy(){this.subscription.unsubscribe()}processRoutes(e,t){const n=[];for(const l of t)if(l.loadChildren&&!l.canLoad&&l._loadedConfig){const e=l._loadedConfig;n.push(this.processRoutes(e.module,e.routes))}else l.loadChildren&&!l.canLoad?n.push(this.preloadConfig(e,l)):l.children&&n.push(this.processRoutes(e,l.children));return Object(J.a)(n).pipe(Object(E.a)(),Object(ae.a)(e=>void 0))}preloadConfig(e,t){return this.preloadingStrategy.preload(t,()=>this.loader.load(e.injector,t).pipe(Object(ve.a)(e=>(t._loadedConfig=e,this.processRoutes(e.module,e.routes)))))}}))();class Rr{constructor(e,t,n={}){this.router=e,this.viewportScroller=t,this.options=n,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},n.scrollPositionRestoration=n.scrollPositionRestoration||"disabled",n.anchorScrolling=n.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(e=>{e instanceof Xt?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=e.navigationTrigger,this.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof en&&(this.lastId=e.id,this.scheduleScrollEvent(e,this.router.parseUrl(e.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(e=>{e instanceof gn&&(e.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(e.position):e.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(e.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(e,t){this.router.triggerEvent(new gn(e,"popstate"===this.lastSource?this.store[this.restoredId]:null,t))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}const Or=new l.InjectionToken("ROUTER_CONFIGURATION"),Nr=new l.InjectionToken("ROUTER_FORROOT_GUARD"),Pr=[Y.Location,{provide:Bn,useClass:jn},{provide:yr,useFactory:Hr,deps:[l.ApplicationRef,Bn,Ir,Y.Location,l.Injector,l.NgModuleFactoryLoader,l.Compiler,dr,Or,[pr,new l.Optional],[ur,new l.Optional]]},Ir,{provide:sl,useFactory:Ur,deps:[yr]},{provide:l.NgModuleFactoryLoader,useClass:l.SystemJsNgModuleLoader},Tr,Ar,kr,{provide:Or,useValue:{enableTracing:!1}}];function Mr(){return new l.NgProbeToken("Router",yr)}const Lr=(()=>{class e{constructor(e,t){}static forRoot(t,n){return{ngModule:e,providers:[Pr,jr(t),{provide:Nr,useFactory:Br,deps:[[yr,new l.Optional,new l.SkipSelf]]},{provide:Or,useValue:n||{}},{provide:Y.LocationStrategy,useFactory:Vr,deps:[Y.PlatformLocation,[new l.Inject(Y.APP_BASE_HREF),new l.Optional],Or]},{provide:Rr,useFactory:Fr,deps:[yr,Y.ViewportScroller,Or]},{provide:xr,useExisting:n&&n.preloadingStrategy?n.preloadingStrategy:Ar},{provide:l.NgProbeToken,multi:!0,useFactory:Mr},[zr,{provide:l.APP_INITIALIZER,multi:!0,useFactory:$r,deps:[zr]},{provide:Wr,useFactory:qr,deps:[zr]},{provide:l.APP_BOOTSTRAP_LISTENER,multi:!0,useExisting:Wr}]]}}static forChild(t){return{ngModule:e,providers:[jr(t)]}}}return e})();function Fr(e,t,n){return n.scrollOffset&&t.setOffset(n.scrollOffset),new Rr(e,t,n)}function Vr(e,t,n={}){return n.useHash?new Y.HashLocationStrategy(e,t):new Y.PathLocationStrategy(e,t)}function Br(e){if(e)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function jr(e){return[{provide:l.ANALYZE_FOR_ENTRY_COMPONENTS,multi:!0,useValue:e},{provide:dr,multi:!0,useValue:e}]}function Hr(e,t,n,l,r,i,o,s,a={},u,c){const d=new yr(null,t,n,l,r,i,o,An(s));if(u&&(d.urlHandlingStrategy=u),c&&(d.routeReuseStrategy=c),a.errorHandler&&(d.errorHandler=a.errorHandler),a.malformedUriErrorHandler&&(d.malformedUriErrorHandler=a.malformedUriErrorHandler),a.enableTracing){const e=Le();d.events.subscribe(t=>{e.logGroup(`Router Event: ${t.constructor.name}`),e.log(t.toString()),e.log(t),e.logGroupEnd()})}return a.onSameUrlNavigation&&(d.onSameUrlNavigation=a.onSameUrlNavigation),a.paramsInheritanceStrategy&&(d.paramsInheritanceStrategy=a.paramsInheritanceStrategy),a.urlUpdateStrategy&&(d.urlUpdateStrategy=a.urlUpdateStrategy),a.relativeLinkResolution&&(d.relativeLinkResolution=a.relativeLinkResolution),d}function Ur(e){return e.routerState.root}const zr=(()=>(class{constructor(e){this.injector=e,this.initNavigation=!1,this.resultOfPreactivationDone=new X.a}appInitializer(){return this.injector.get(Y.LOCATION_INITIALIZED,Promise.resolve(null)).then(()=>{let e=null;const t=new Promise(t=>e=t),n=this.injector.get(yr),l=this.injector.get(Or);if(this.isLegacyDisabled(l)||this.isLegacyEnabled(l))e(!0);else if("disabled"===l.initialNavigation)n.setUpLocationChangeListener(),e(!0);else{if("enabled"!==l.initialNavigation)throw new Error(`Invalid initialNavigation options: '${l.initialNavigation}'`);n.hooks.afterPreactivation=(()=>this.initNavigation?I(null):(this.initNavigation=!0,e(!0),this.resultOfPreactivationDone)),n.initialNavigation()}return t})}bootstrapListener(e){const t=this.injector.get(Or),n=this.injector.get(Tr),r=this.injector.get(Rr),i=this.injector.get(yr),o=this.injector.get(l.ApplicationRef);e===o.components[0]&&(this.isLegacyEnabled(t)?i.initialNavigation():this.isLegacyDisabled(t)&&i.setUpLocationChangeListener(),n.setUpPreloading(),r.init(),i.resetRootComponentType(o.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}isLegacyEnabled(e){return"legacy_enabled"===e.initialNavigation||!0===e.initialNavigation||void 0===e.initialNavigation}isLegacyDisabled(e){return"legacy_disabled"===e.initialNavigation||!1===e.initialNavigation}}))();function $r(e){return e.appInitializer.bind(e)}function qr(e){return e.bootstrapListener.bind(e)}const Wr=new l.InjectionToken("Router Initializer");var Gr=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Kr(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),l["\u0275did"](1,212992,null,0,Er,[Ir,l.ViewContainerRef,l.ComponentFactoryResolver,[8,null],l.ChangeDetectorRef],null,null)],function(e,t){e(t,1,0)},null)}function Zr(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Kr,Gr)),l["\u0275did"](1,49152,null,0,mn,[],null,null)],null,null)}var Qr=l["\u0275ccf"]("ng-component",mn,Zr,{},{},[]),Yr=n("pODc"),Jr=n("7LN8"),Xr=n("g4HV"),ei=n("sdDj"),ti=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function ni(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"span",[["class","ui-tabview-left-icon"]],null,null,null,null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null)],function(e,t){e(t,2,0,"ui-tabview-left-icon",t.parent.parent.parent.context.$implicit.leftIcon)},null)}function li(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"span",[["class","ui-tabview-right-icon"]],null,null,null,null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null)],function(e,t){e(t,2,0,"ui-tabview-right-icon",t.parent.parent.parent.context.$implicit.rightIcon)},null)}function ri(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,6,null,null,null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,ni)),l["\u0275did"](2,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](3,0,null,null,1,"span",[["class","ui-tabview-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](4,null,["",""])),(e()(),l["\u0275and"](16777216,null,null,1,null,li)),l["\u0275did"](6,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](0,null,null,0))],function(e,t){e(t,2,0,t.parent.parent.context.$implicit.leftIcon),e(t,6,0,t.parent.parent.context.$implicit.rightIcon)},function(e,t){e(t,4,0,t.parent.parent.context.$implicit.header)})}function ii(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,null,null,null,null,null,null,null))],null,null)}function oi(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,null,null,null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,ii)),l["\u0275did"](2,540672,null,0,Y.NgTemplateOutlet,[l.ViewContainerRef],{ngTemplateOutlet:[0,"ngTemplateOutlet"]},null),(e()(),l["\u0275and"](0,null,null,0))],function(e,t){e(t,2,0,t.parent.parent.context.$implicit.headerTemplate)},null)}function si(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"span",[["class","ui-tabview-close pi pi-times"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.clickClose(n,e.parent.parent.context.$implicit)&&l),l},null,null))],null,null)}function ai(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,14,"li",[["role","presentation"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.clickTab(n,e.parent.context.$implicit)&&l),l},null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](3,{"ui-tabview-selected ui-state-active":0,"ui-state-disabled":1}),l["\u0275prd"](512,null,Y["\u0275NgStyleImpl"],Y["\u0275NgStyleR2Impl"],[l.ElementRef,l.KeyValueDiffers,l.Renderer2]),l["\u0275did"](5,278528,null,0,Y.NgStyle,[Y["\u0275NgStyleImpl"]],{ngStyle:[0,"ngStyle"]},null),(e()(),l["\u0275eld"](6,0,null,null,6,"a",[["href","#"],["role","tab"]],[[1,"id",0],[1,"aria-selected",0],[1,"aria-controls",0]],null,null,null,null)),l["\u0275prd"](512,null,ei.DomHandler,ei.DomHandler,[]),l["\u0275did"](8,4341760,null,0,Xr.Tooltip,[l.ElementRef,ei.DomHandler,l.NgZone],{tooltipPosition:[0,"tooltipPosition"],text:[1,"text"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,ri)),l["\u0275did"](10,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,oi)),l["\u0275did"](12,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,si)),l["\u0275did"](14,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component,l=n.getDefaultHeaderClass(t.parent.context.$implicit),r=e(t,3,0,t.parent.context.$implicit.selected,t.parent.context.$implicit.disabled);e(t,2,0,l,r),e(t,5,0,t.parent.context.$implicit.headerStyle),e(t,8,0,n.orientation,t.parent.context.$implicit.tooltip),e(t,10,0,!t.parent.context.$implicit.headerTemplate),e(t,12,0,t.parent.context.$implicit.headerTemplate),e(t,14,0,t.parent.context.$implicit.closable)},function(e,t){e(t,6,0,t.parent.context.$implicit.id+"-label",t.parent.context.$implicit.selected,t.parent.context.$implicit.id)})}function ui(e){return l["\u0275vid"](0,[(e()(),l["\u0275and"](16777216,null,null,1,null,ai)),l["\u0275did"](1,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](0,null,null,0))],function(e,t){e(t,1,0,!t.context.$implicit.closed)},null)}function ci(e){return l["\u0275vid"](0,[(e()(),l["\u0275and"](16777216,null,null,1,null,ui)),l["\u0275did"](1,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,1,0,t.component.tabs)},null)}var di=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function hi(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,null,null,null,null,null,null,null))],null,null)}function pi(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,null,null,null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,hi)),l["\u0275did"](2,540672,null,0,Y.NgTemplateOutlet,[l.ViewContainerRef],{ngTemplateOutlet:[0,"ngTemplateOutlet"]},null),(e()(),l["\u0275and"](0,null,null,0))],function(e,t){e(t,2,0,t.component.contentTemplate)},null)}function fi(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,6,"div",[["class","ui-tabview-panel ui-widget-content"],["role","tabpanel"]],[[1,"id",0],[1,"aria-hidden",0],[1,"aria-labelledby",0]],null,null,null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](3,{"ui-helper-hidden":0}),l["\u0275ncd"](null,0),(e()(),l["\u0275and"](16777216,null,null,1,null,pi)),l["\u0275did"](6,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component,l=e(t,3,0,!n.selected);e(t,2,0,"ui-tabview-panel ui-widget-content",l),e(t,6,0,n.contentTemplate&&(n.cache?n.loaded:n.selected))},function(e,t){var n=t.component;e(t,0,0,n.id,!n.selected,n.id+"-label")})}function gi(e){return l["\u0275vid"](0,[(e()(),l["\u0275and"](16777216,null,null,1,null,fi)),l["\u0275did"](1,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){e(t,1,0,!t.component.closed)},null)}var mi=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function vi(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ul",[["p-tabViewNav",""],["role","tablist"]],[[2,"ui-tabview-nav",null],[2,"ui-helper-reset",null],[2,"ui-helper-clearfix",null],[2,"ui-widget-header",null],[2,"ui-corner-all",null]],[[null,"onTabClick"],[null,"onTabCloseClick"]],function(e,t,n){var l=!0,r=e.component;return"onTabClick"===t&&(l=!1!==r.open(n.originalEvent,n.tab)&&l),"onTabCloseClick"===t&&(l=!1!==r.close(n.originalEvent,n.tab)&&l),l},ci,ti)),l["\u0275did"](1,49152,null,0,Yr.TabViewNav,[],{tabs:[0,"tabs"],orientation:[1,"orientation"]},{onTabClick:"onTabClick",onTabCloseClick:"onTabCloseClick"})],function(e,t){var n=t.component;e(t,1,0,n.tabs,n.orientation)},function(e,t){e(t,0,0,!0,!0,!0,!0,!0)})}function yi(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ul",[["p-tabViewNav",""],["role","tablist"]],[[2,"ui-tabview-nav",null],[2,"ui-helper-reset",null],[2,"ui-helper-clearfix",null],[2,"ui-widget-header",null],[2,"ui-corner-all",null]],[[null,"onTabClick"],[null,"onTabCloseClick"]],function(e,t,n){var l=!0,r=e.component;return"onTabClick"===t&&(l=!1!==r.open(n.originalEvent,n.tab)&&l),"onTabCloseClick"===t&&(l=!1!==r.close(n.originalEvent,n.tab)&&l),l},ci,ti)),l["\u0275did"](1,49152,null,0,Yr.TabViewNav,[],{tabs:[0,"tabs"],orientation:[1,"orientation"]},{onTabClick:"onTabClick",onTabCloseClick:"onTabCloseClick"})],function(e,t){var n=t.component;e(t,1,0,n.tabs,n.orientation)},function(e,t){e(t,0,0,!0,!0,!0,!0,!0)})}function bi(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,10,"div",[],null,null,null,null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275prd"](512,null,Y["\u0275NgStyleImpl"],Y["\u0275NgStyleR2Impl"],[l.ElementRef,l.KeyValueDiffers,l.Renderer2]),l["\u0275did"](4,278528,null,0,Y.NgStyle,[Y["\u0275NgStyleImpl"]],{ngStyle:[0,"ngStyle"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,vi)),l["\u0275did"](6,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](7,0,null,null,1,"div",[["class","ui-tabview-panels"]],null,null,null,null,null)),l["\u0275ncd"](null,0),(e()(),l["\u0275and"](16777216,null,null,1,null,yi)),l["\u0275did"](10,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,2,0,n.styleClass,"ui-tabview ui-widget ui-widget-content ui-corner-all ui-tabview-"+n.orientation),e(t,4,0,n.style),e(t,6,0,"bottom"!=n.orientation),e(t,10,0,"bottom"==n.orientation)},null)}class Ci{constructor(){}ngAfterViewInit(){this.iframe.nativeElement.id="gist-"+this.gistId;let e=this.iframe.nativeElement.contentDocument||this.iframe.nativeElement.contentElement.contentWindow,t=`\n <html>\n <head>\n <base target="_parent">\n </head>\n <body onload="parent.document.getElementById('${this.iframe.nativeElement.id}')\n .style.height=document.body.scrollHeight + 'px'">\n <script type="text/javascript" src="https://gist.github.com/${this.gistId}.js"><\/script>\n </body>\n </html>\n `;e.open(),e.write(t),e.close()}}var wi=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Si(e){return l["\u0275vid"](0,[l["\u0275qud"](402653184,1,{iframe:0}),(e()(),l["\u0275eld"](1,0,[[1,0],["iframe",1]],null,0,"iframe",[["frameborder","0"],["type","text/javascript"],["width","100%"]],null,null,null,null,null))],null,null)}var _i=n("XoHu");function Ii(e,t){return new h.a(n=>{const l=e.length;if(0===l)return void n.complete();const r=new Array(l);let i=0,o=0;for(let s=0;s<l;s++){const a=Object(J.a)(e[s]);let u=!1;n.add(a.subscribe({next:e=>{u||(u=!0,o++),r[s]=e},error:e=>n.error(e),complete:()=>{++i!==l&&u||(o===l&&n.next(t?t.reduce((e,t,n)=>(e[t]=r[n],e),{}):r),n.complete())}}))}})}const Ei=new l.InjectionToken("NgValueAccessor"),Di=(()=>(class{constructor(e,t){this._renderer=e,this._elementRef=t,this.onChange=(e=>{}),this.onTouched=(()=>{})}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"checked",e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}}))(),xi=new l.InjectionToken("CompositionEventMode"),ki=(()=>(class{constructor(e,t,n){this._renderer=e,this._elementRef=t,this._compositionMode=n,this.onChange=(e=>{}),this.onTouched=(()=>{}),this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const e=Le()?Le().getUserAgent():"";return/android (\d+)/.test(e.toLowerCase())}())}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==e?"":e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}}))();class Ai{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}reset(e){this.control&&this.control.reset(e)}hasError(e,t){return!!this.control&&this.control.hasError(e,t)}getError(e,t){return this.control?this.control.getError(e,t):null}}class Ti extends Ai{get formDirective(){return null}get path(){return null}}function Ri(){throw new Error("unimplemented")}class Oi extends Ai{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null,this._rawValidators=[],this._rawAsyncValidators=[]}get validator(){return Ri()}get asyncValidator(){return Ri()}}class Ni{constructor(e){this._cd=e}get ngClassUntouched(){return!!this._cd.control&&this._cd.control.untouched}get ngClassTouched(){return!!this._cd.control&&this._cd.control.touched}get ngClassPristine(){return!!this._cd.control&&this._cd.control.pristine}get ngClassDirty(){return!!this._cd.control&&this._cd.control.dirty}get ngClassValid(){return!!this._cd.control&&this._cd.control.valid}get ngClassInvalid(){return!!this._cd.control&&this._cd.control.invalid}get ngClassPending(){return!!this._cd.control&&this._cd.control.pending}}const Pi=(()=>(class extends Ni{constructor(e){super(e)}}))(),Mi=(()=>(class extends Ni{constructor(e){super(e)}}))();function Li(e){return null==e||0===e.length}const Fi=new l.InjectionToken("NgValidators"),Vi=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;class Bi{static min(e){return t=>{if(Li(t.value)||Li(e))return null;const n=parseFloat(t.value);return!isNaN(n)&&n<e?{min:{min:e,actual:t.value}}:null}}static max(e){return t=>{if(Li(t.value)||Li(e))return null;const n=parseFloat(t.value);return!isNaN(n)&&n>e?{max:{max:e,actual:t.value}}:null}}static required(e){return Li(e.value)?{required:!0}:null}static requiredTrue(e){return!0===e.value?null:{required:!0}}static email(e){return Li(e.value)?null:Vi.test(e.value)?null:{email:!0}}static minLength(e){return t=>{if(Li(t.value))return null;const n=t.value?t.value.length:0;return n<e?{minlength:{requiredLength:e,actualLength:n}}:null}}static maxLength(e){return t=>{const n=t.value?t.value.length:0;return n>e?{maxlength:{requiredLength:e,actualLength:n}}:null}}static pattern(e){if(!e)return Bi.nullValidator;let t,n;return"string"==typeof e?(n="","^"!==e.charAt(0)&&(n+="^"),n+=e,"$"!==e.charAt(e.length-1)&&(n+="$"),t=new RegExp(n)):(n=e.toString(),t=e),e=>{if(Li(e.value))return null;const l=e.value;return t.test(l)?null:{pattern:{requiredPattern:n,actualValue:l}}}}static nullValidator(e){return null}static compose(e){if(!e)return null;const t=e.filter(ji);return 0==t.length?null:function(e){return Ui(function(e,n){return t.map(t=>t(e))}(e))}}static composeAsync(e){if(!e)return null;const t=e.filter(ji);return 0==t.length?null:function(e){return function(...e){if(1===e.length){const t=e[0];if(Object(b.a)(t))return Ii(t,null);if(Object(_i.a)(t)&&Object.getPrototypeOf(t)===Object.prototype){const e=Object.keys(t);return Ii(e.map(e=>t[e]),e)}}if("function"==typeof e[e.length-1]){const t=e.pop();return Ii(e=1===e.length&&Object(b.a)(e[0])?e[0]:e,null).pipe(Object(ae.a)(e=>t(...e)))}return Ii(e,null)}(function(e,n){return t.map(t=>t(e))}(e).map(Hi)).pipe(Object(ae.a)(Ui))}}}function ji(e){return null!=e}function Hi(e){const t=Object(l["\u0275isPromise"])(e)?Object(J.a)(e):e;if(!Object(l["\u0275isObservable"])(t))throw new Error("Expected validator to return Promise or Observable.");return t}function Ui(e){const t=e.reduce((e,t)=>null!=t?Object.assign({},e,t):e,{});return 0===Object.keys(t).length?null:t}function zi(e){return e.validate?t=>e.validate(t):e}function $i(e){return e.validate?t=>e.validate(t):e}const qi=(()=>(class{constructor(e,t){this._renderer=e,this._elementRef=t,this.onChange=(e=>{}),this.onTouched=(()=>{})}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==e?"":e)}registerOnChange(e){this.onChange=(t=>{e(""==t?null:parseFloat(t))})}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}}))(),Wi=(()=>(class{constructor(){this._accessors=[]}add(e,t){this._accessors.push([e,t])}remove(e){for(let t=this._accessors.length-1;t>=0;--t)if(this._accessors[t][1]===e)return void this._accessors.splice(t,1)}select(e){this._accessors.forEach(t=>{this._isSameGroup(t,e)&&t[1]!==e&&t[1].fireUncheck(e.value)})}_isSameGroup(e,t){return!!e[0].control&&e[0]._parent===t._control._parent&&e[1].name===t.name}}))(),Gi=(()=>(class{constructor(e,t,n,l){this._renderer=e,this._elementRef=t,this._registry=n,this._injector=l,this.onChange=(()=>{}),this.onTouched=(()=>{})}ngOnInit(){this._control=this._injector.get(Oi),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(e){this._state=e===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)}registerOnChange(e){this._fn=e,this.onChange=(()=>{e(this.value),this._registry.select(this)})}fireUncheck(e){this.writeValue(e)}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_checkName(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)}_throwNameError(){throw new Error('\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: <input type="radio" formControlName="food" name="food">\n ')}}))(),Ki={formControlName:'\n <div [formGroup]="myGroup">\n <input formControlName="firstName">\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });',formGroupName:'\n <div [formGroup]="myGroup">\n <div formGroupName="person">\n <input formControlName="firstName">\n </div>\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });',formArrayName:'\n <div [formGroup]="myGroup">\n <div formArrayName="cities">\n <div *ngFor="let city of cityArray.controls; index as i">\n <input [formControlName]="i">\n </div>\n </div>\n </div>\n\n In your class:\n\n this.cityArray = new FormArray([new FormControl(\'SF\')]);\n this.myGroup = new FormGroup({\n cities: this.cityArray\n });',ngModelGroup:'\n <form>\n <div ngModelGroup="person">\n <input [(ngModel)]="person.name" name="firstName">\n </div>\n </form>',ngModelWithFormGroup:'\n <div [formGroup]="myGroup">\n <input formControlName="firstName">\n <input [(ngModel)]="showMoreControls" [ngModelOptions]="{standalone: true}">\n </div>\n '};class Zi{static controlParentException(){throw new Error(`formControlName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n ${Ki.formControlName}`)}static ngModelGroupException(){throw new Error(`formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n that also have a "form" prefix: formGroupName, formArrayName, or formGroup.\n\n Option 1: Update the parent to be formGroupName (reactive form strategy)\n\n ${Ki.formGroupName}\n\n Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n ${Ki.ngModelGroup}`)}static missingFormException(){throw new Error(`formGroup expects a FormGroup instance. Please pass one in.\n\n Example:\n\n ${Ki.formControlName}`)}static groupParentException(){throw new Error(`formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n ${Ki.formGroupName}`)}static arrayParentException(){throw new Error(`formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n ${Ki.formArrayName}`)}static disabledAttrWarning(){console.warn("\n It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n you. We recommend using this approach to avoid 'changed after checked' errors.\n \n Example: \n form = new FormGroup({\n first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n last: new FormControl('Drew', Validators.required)\n });\n ")}static ngModelWarning(e){console.warn(`\n It looks like you're using ngModel on the same form field as ${e}. \n Support for using the ngModel input property and ngModelChange event with \n reactive form directives has been deprecated in Angular v6 and will be removed \n in Angular v7.\n \n For more information on this, see our API docs here:\n https://angular.io/api/forms/${"formControl"===e?"FormControlDirective":"FormControlName"}#use-with-ngmodel\n `)}}function Qi(e,t){return[...t.path,e]}function Yi(e,t){e||to(t,"Cannot find control with"),t.valueAccessor||to(t,"No value accessor for form control with"),e.validator=Bi.compose([e.validator,t.validator]),e.asyncValidator=Bi.composeAsync([e.asyncValidator,t.asyncValidator]),t.valueAccessor.writeValue(e.value),function(e,t){t.valueAccessor.registerOnChange(n=>{e._pendingValue=n,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&Ji(e,t)})}(e,t),function(e,t){e.registerOnChange((e,n)=>{t.valueAccessor.writeValue(e),n&&t.viewToModelUpdate(e)})}(e,t),function(e,t){t.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&Ji(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),t.valueAccessor.setDisabledState&&e.registerOnDisabledChange(e=>{t.valueAccessor.setDisabledState(e)}),t._rawValidators.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(()=>e.updateValueAndValidity())}),t._rawAsyncValidators.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(()=>e.updateValueAndValidity())})}function Ji(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function Xi(e,t){null==e&&to(t,"Cannot find control with"),e.validator=Bi.compose([e.validator,t.validator]),e.asyncValidator=Bi.composeAsync([e.asyncValidator,t.asyncValidator])}function eo(e){return to(e,"There is no FormControl instance attached to form control element with")}function to(e,t){let n;throw n=e.path.length>1?`path: '${e.path.join(" -> ")}'`:e.path[0]?`name: '${e.path}'`:"unspecified name attribute",new Error(`${t} ${n}`)}function no(e){return null!=e?Bi.compose(e.map(zi)):null}function lo(e){return null!=e?Bi.composeAsync(e.map($i)):null}function ro(e,t){if(!e.hasOwnProperty("model"))return!1;const n=e.model;return!!n.isFirstChange()||!Object(l["\u0275looseIdentical"])(t,n.currentValue)}const io=[Di,(()=>(class{constructor(e,t){this._renderer=e,this._elementRef=t,this.onChange=(e=>{}),this.onTouched=(()=>{})}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(e))}registerOnChange(e){this.onChange=(t=>{e(""==t?null:parseFloat(t))})}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}}))(),qi,(()=>(class{constructor(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=(e=>{}),this.onTouched=(()=>{}),this._compareWith=l["\u0275looseIdentical"]}set compareWith(e){if("function"!=typeof e)throw new Error(`compareWith must be a function, but received ${JSON.stringify(e)}`);this._compareWith=e}writeValue(e){this.value=e;const t=this._getOptionId(e);null==t&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);const n=function(e,t){return null==e?`${t}`:(t&&"object"==typeof t&&(t="Object"),`${e}: ${t}`.slice(0,50))}(t,e);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)}registerOnChange(e){this.onChange=(t=>{this.value=this._getOptionValue(t),e(this.value)})}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(const t of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(t),e))return t;return null}_getOptionValue(e){const t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t):e}}))(),(()=>(class{constructor(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=(e=>{}),this.onTouched=(()=>{}),this._compareWith=l["\u0275looseIdentical"]}set compareWith(e){if("function"!=typeof e)throw new Error(`compareWith must be a function, but received ${JSON.stringify(e)}`);this._compareWith=e}writeValue(e){let t;if(this.value=e,Array.isArray(e)){const n=e.map(e=>this._getOptionId(e));t=((e,t)=>{e._setSelected(n.indexOf(t.toString())>-1)})}else t=((e,t)=>{e._setSelected(!1)});this._optionMap.forEach(t)}registerOnChange(e){this.onChange=(t=>{const n=[];if(t.hasOwnProperty("selectedOptions")){const e=t.selectedOptions;for(let t=0;t<e.length;t++){const l=e.item(t),r=this._getOptionValue(l.value);n.push(r)}}else{const e=t.options;for(let t=0;t<e.length;t++){const l=e.item(t);if(l.selected){const e=this._getOptionValue(l.value);n.push(e)}}}this.value=n,e(n)})}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_registerOption(e){const t=(this._idCounter++).toString();return this._optionMap.set(t,e),t}_getOptionId(e){for(const t of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(t)._value,e))return t;return null}_getOptionValue(e){const t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t)._value:e}}))(),Gi];function oo(e,t){e._syncPendingControls(),t.forEach(e=>{const t=e.control;"submit"===t.updateOn&&t._pendingChange&&(e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)})}function so(e,t){if(!t)return null;Array.isArray(t)||to(e,"Value accessor was not provided as an array for form control with");let n=void 0,l=void 0,r=void 0;return t.forEach(t=>{t.constructor===ki?n=t:function(e){return io.some(t=>e.constructor===t)}(t)?(l&&to(e,"More than one built-in value accessor matches form control with"),l=t):(r&&to(e,"More than one custom value accessor matches form control with"),r=t)}),r||l||n||(to(e,"No valid value accessor for form control with"),null)}function ao(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const uo="VALID",co="INVALID",ho="PENDING",po="DISABLED";function fo(e){const t=mo(e)?e.validators:e;return Array.isArray(t)?no(t):t||null}function go(e,t){const n=mo(t)?t.asyncValidators:e;return Array.isArray(n)?lo(n):n||null}function mo(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}class vo{constructor(e,t){this.validator=e,this.asyncValidator=t,this._onCollectionChange=(()=>{}),this.pristine=!0,this.touched=!1,this._onDisabledChange=[]}get parent(){return this._parent}get valid(){return this.status===uo}get invalid(){return this.status===co}get pending(){return this.status==ho}get disabled(){return this.status===po}get enabled(){return this.status!==po}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this.validator=fo(e)}setAsyncValidators(e){this.asyncValidator=go(e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(e=>{e.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(e=>{e.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=ho,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=po,this.errors=null,this._forEachChild(t=>{t.disable(Object.assign({},e,{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign({},e,{skipPristineCheck:t})),this._onDisabledChange.forEach(e=>e(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=uo,this._forEachChild(t=>{t.enable(Object.assign({},e,{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign({},e,{skipPristineCheck:t})),this._onDisabledChange.forEach(e=>e(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),this.status!==uo&&this.status!==ho||this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?po:uo}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=ho;const t=Hi(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(t=>this.setErrors(t,{emitEvent:e}))}}_cancelExistingSubscription(){this._asyncValidationSubscription&&this._asyncValidationSubscription.unsubscribe()}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(e,t,n){return null==t?null:(t instanceof Array||(t=t.split(".")),t instanceof Array&&0===t.length?null:t.reduce((e,t)=>e instanceof bo?e.controls.hasOwnProperty(t)?e.controls[t]:null:e instanceof Co&&e.at(t)||null,e))}(this,e)}getError(e,t){const n=t?this.get(t):this;return n&&n.errors?n.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new l.EventEmitter,this.statusChanges=new l.EventEmitter}_calculateStatus(){return this._allControlsDisabled()?po:this.errors?co:this._anyControlsHaveStatus(ho)?ho:this._anyControlsHaveStatus(co)?co:uo}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){mo(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&this._parent&&this._parent.dirty&&!this._parent._anyControlsDirty()}}class yo extends vo{constructor(e=null,t,n){super(fo(t),go(n,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),this._initObservables()}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(e=>e(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_clearChangeFns(){this._onChange=[],this._onDisabledChange=[],this._onCollectionChange=(()=>{})}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class bo extends vo{constructor(e,t,n){super(fo(t),go(n,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t){this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()}removeControl(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity(),this._onCollectionChange()}setControl(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(e[n],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){Object.keys(e).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(e[n],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}reset(e={},t={}){this._forEachChild((n,l)=>{n.reset(e[l],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,n)=>(e[n]=t instanceof yo?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(e,t)=>!!t._syncPendingControls()||e);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[e])throw new Error(`Cannot find form control with name: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>e(this.controls[t],t))}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){let t=!1;return this._forEachChild((n,l)=>{t=t||this.contains(l)&&e(n)}),t}_reduceValue(){return this._reduceChildren({},(e,t,n)=>((t.enabled||this.disabled)&&(e[n]=t.value),e))}_reduceChildren(e,t){let n=e;return this._forEachChild((e,l)=>{n=t(n,e,l)}),n}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,n)=>{if(void 0===e[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class Co extends vo{constructor(e,t,n){super(fo(t),go(n,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}at(e){return this.controls[e]}push(e){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()}insert(e,t){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity()}removeAt(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity()}setControl(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity(),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((e,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){e.forEach((e,n)=>{this.at(n)&&this.at(n).patchValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}reset(e=[],t={}){this._forEachChild((n,l)=>{n.reset(e[l],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof yo?e.value:e.getRawValue())}clear(){this.controls.length<1||(this._forEachChild(e=>e._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity())}_syncPendingControls(){let e=this.controls.reduce((e,t)=>!!t._syncPendingControls()||e,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error(`Cannot find form control at index ${e}`)}_forEachChild(e){this.controls.forEach((t,n)=>{e(t,n)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,n)=>{if(void 0===e[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const wo=(()=>Promise.resolve(null))(),So=(()=>(class extends Ti{constructor(e,t){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new l.EventEmitter,this.form=new bo({},no(e),lo(t))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){wo.then(()=>{const t=this._findContainer(e.path);e.control=t.registerControl(e.name,e.control),Yi(e.control,e),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){wo.then(()=>{const t=this._findContainer(e.path);t&&t.removeControl(e.name),ao(this._directives,e)})}addFormGroup(e){wo.then(()=>{const t=this._findContainer(e.path),n=new bo({});Xi(n,e),t.registerControl(e.name,n),n.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){wo.then(()=>{const t=this._findContainer(e.path);t&&t.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,t){wo.then(()=>{this.form.get(e.path).setValue(t)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submitted=!0,oo(this.form,this._directives),this.ngSubmit.emit(e),!1}onReset(){this.resetForm()}resetForm(e){this.form.reset(e),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}}))();class _o{static modelParentException(){throw new Error(`\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\n formGroup's partner directive "formControlName" instead. Example:\n\n ${Ki.formControlName}\n\n Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:\n\n Example:\n\n ${Ki.ngModelWithFormGroup}`)}static formGroupNameException(){throw new Error(`\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n ${Ki.formGroupName}\n\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n ${Ki.ngModelGroup}`)}static missingNameException(){throw new Error('If ngModel is used within a form tag, either the name attribute must be set or the form\n control must be defined as \'standalone\' in ngModelOptions.\n\n Example 1: <input [(ngModel)]="person.firstName" name="first">\n Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">')}static modelGroupParentException(){throw new Error(`\n ngModelGroup cannot be used with a parent formGroup directive.\n\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n ${Ki.formGroupName}\n\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n ${Ki.ngModelGroup}`)}static ngFormWarning(){console.warn("\n It looks like you're using 'ngForm'.\n\n Support for using the 'ngForm' element selector has been deprecated in Angular v6 and will be removed\n in Angular v9.\n\n Use 'ng-form' instead.\n\n Before:\n <ngForm #myForm=\"ngForm\">\n\n After:\n <ng-form #myForm=\"ngForm\">\n ")}}const Io=new l.InjectionToken("NgFormSelectorWarning");class Eo extends Ti{ngOnInit(){this._checkParentType(),this.formDirective.addFormGroup(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormGroup(this)}get control(){return this.formDirective.getFormGroup(this)}get path(){return Qi(this.name,this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}get validator(){return no(this._validators)}get asyncValidator(){return lo(this._asyncValidators)}_checkParentType(){}}const Do=(()=>{class e extends Eo{constructor(e,t,n){super(),this._parent=e,this._validators=t,this._asyncValidators=n}_checkParentType(){this._parent instanceof e||this._parent instanceof So||_o.modelGroupParentException()}}return e})(),xo=(()=>Promise.resolve(null))(),ko=(()=>(class extends Oi{constructor(e,t,n,r){super(),this.control=new yo,this._registered=!1,this.update=new l.EventEmitter,this._parent=e,this._rawValidators=t||[],this._rawAsyncValidators=n||[],this.valueAccessor=so(this,r)}ngOnChanges(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),ro(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?Qi(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}get validator(){return no(this._rawValidators)}get asyncValidator(){return lo(this._rawAsyncValidators)}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){Yi(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){!(this._parent instanceof Do)&&this._parent instanceof Eo?_o.formGroupNameException():this._parent instanceof Do||this._parent instanceof So||_o.modelParentException()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()||this.name||_o.missingNameException()}_updateValue(e){xo.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1})})}_updateDisabled(e){const t=e.isDisabled.currentValue,n=""===t||t&&"false"!==t;xo.then(()=>{n&&!this.control.disabled?this.control.disable():!n&&this.control.disabled&&this.control.enable()})}}))(),Ao=(()=>(class{}))(),To=new l.InjectionToken("NgModelWithFormControlWarning"),Ro=(()=>(class extends Ti{constructor(e,t){super(),this._validators=e,this._asyncValidators=t,this.submitted=!1,this.directives=[],this.form=null,this.ngSubmit=new l.EventEmitter}ngOnChanges(e){this._checkFormPresent(),e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations())}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){const t=this.form.get(e.path);return Yi(t,e),t.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),t}getControl(e){return this.form.get(e.path)}removeControl(e){ao(this.directives,e)}addFormGroup(e){const t=this.form.get(e.path);Xi(t,e),t.updateValueAndValidity({emitEvent:!1})}removeFormGroup(e){}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){const t=this.form.get(e.path);Xi(t,e),t.updateValueAndValidity({emitEvent:!1})}removeFormArray(e){}getFormArray(e){return this.form.get(e.path)}updateModel(e,t){this.form.get(e.path).setValue(t)}onSubmit(e){return this.submitted=!0,oo(this.form,this.directives),this.ngSubmit.emit(e),!1}onReset(){this.resetForm()}resetForm(e){this.form.reset(e),this.submitted=!1}_updateDomValue(){this.directives.forEach(e=>{const t=this.form.get(e.path);e.control!==t&&(function(e,t){t.valueAccessor.registerOnChange(()=>eo(t)),t.valueAccessor.registerOnTouched(()=>eo(t)),t._rawValidators.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(null)}),t._rawAsyncValidators.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(null)}),e&&e._clearChangeFns()}(e.control,e),t&&Yi(t,e),e.control=t)}),this.form._updateTreeValidity({emitEvent:!1})}_updateRegistrations(){this.form._registerOnCollectionChange(()=>this._updateDomValue()),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{}),this._oldForm=this.form}_updateValidators(){const e=no(this._validators);this.form.validator=Bi.compose([this.form.validator,e]);const t=lo(this._asyncValidators);this.form.asyncValidator=Bi.composeAsync([this.form.asyncValidator,t])}_checkFormPresent(){this.form||Zi.missingFormException()}}))(),Oo=(()=>(class extends Eo{constructor(e,t,n){super(),this._parent=e,this._validators=t,this._asyncValidators=n}_checkParentType(){Po(this._parent)&&Zi.groupParentException()}}))(),No=(()=>(class extends Ti{constructor(e,t,n){super(),this._parent=e,this._validators=t,this._asyncValidators=n}ngOnInit(){this._checkParentType(),this.formDirective.addFormArray(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormArray(this)}get control(){return this.formDirective.getFormArray(this)}get formDirective(){return this._parent?this._parent.formDirective:null}get path(){return Qi(this.name,this._parent)}get validator(){return no(this._validators)}get asyncValidator(){return lo(this._asyncValidators)}_checkParentType(){Po(this._parent)&&Zi.arrayParentException()}}))();function Po(e){return!(e instanceof Oo||e instanceof Ro||e instanceof No)}const Mo=(()=>{class e extends Oi{constructor(e,t,n,r,i){super(),this._ngModelWarningConfig=i,this._added=!1,this.update=new l.EventEmitter,this._ngModelWarningSent=!1,this._parent=e,this._rawValidators=t||[],this._rawAsyncValidators=n||[],this.valueAccessor=so(this,r)}set isDisabled(e){Zi.disabledAttrWarning()}ngOnChanges(t){var n,r;this._added||this._setUpControl(),ro(t,this.viewModel)&&("formControlName",n=e,this,r=this._ngModelWarningConfig,Object(l.isDevMode)()&&"never"!==r&&((null!==r&&"once"!==r||n._ngModelWarningSentOnce)&&("always"!==r||this._ngModelWarningSent)||(Zi.ngModelWarning("formControlName"),n._ngModelWarningSentOnce=!0,this._ngModelWarningSent=!0)),this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}get path(){return Qi(this.name,this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}get validator(){return no(this._rawValidators)}get asyncValidator(){return lo(this._rawAsyncValidators)}_checkParentType(){!(this._parent instanceof Oo)&&this._parent instanceof Eo?Zi.ngModelGroupException():this._parent instanceof Oo||this._parent instanceof Ro||this._parent instanceof No||Zi.controlParentException()}_setUpControl(){this._checkParentType(),this.control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0}}return e._ngModelWarningSentOnce=!1,e})(),Lo=(()=>(class{get required(){return this._required}set required(e){this._required=null!=e&&!1!==e&&"false"!==`${e}`,this._onChange&&this._onChange()}validate(e){return this.required?Bi.required(e):null}registerOnValidatorChange(e){this._onChange=e}}))(),Fo=(()=>(class{ngOnChanges(e){"pattern"in e&&(this._createValidator(),this._onChange&&this._onChange())}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}_createValidator(){this._validator=Bi.pattern(this.pattern)}}))(),Vo=(()=>(class{}))(),Bo=(()=>(class{group(e,t=null){const n=this._reduceControls(e);let l=null,r=null,i=void 0;return null!=t&&(function(e){return void 0!==e.asyncValidators||void 0!==e.validators||void 0!==e.updateOn}(t)?(l=null!=t.validators?t.validators:null,r=null!=t.asyncValidators?t.asyncValidators:null,i=null!=t.updateOn?t.updateOn:void 0):(l=null!=t.validator?t.validator:null,r=null!=t.asyncValidator?t.asyncValidator:null)),new bo(n,{asyncValidators:r,updateOn:i,validators:l})}control(e,t,n){return new yo(e,t,n)}array(e,t,n){const l=e.map(e=>this._createControl(e));return new Co(l,t,n)}_reduceControls(e){const t={};return Object.keys(e).forEach(n=>{t[n]=this._createControl(e[n])}),t}_createControl(e){return e instanceof yo||e instanceof bo||e instanceof Co?e:Array.isArray(e)?this.control(e[0],e.length>1?e[1]:null,e.length>2?e[2]:null):this.control(e)}}))(),jo=(()=>{class e{static withConfig(t){return{ngModule:e,providers:[{provide:Io,useValue:t.warnOnDeprecatedNgFormSelector}]}}}return e})(),Ho=(()=>{class e{static withConfig(t){return{ngModule:e,providers:[{provide:To,useValue:t.warnOnNgModelWithFormControl}]}}}return e})();class Uo{constructor(e,t){this.status=e,this.body=t}}class zo{constructor(){this.filteredData=[],this.subject=new X.a}setData(e){this.filteredData=e,this.subject.next(e)}getData(){return this.subject.asObservable()}getFilteredData(){return this.filteredData&&this.filteredData.length>0?this.filteredData:[]}}class $o{constructor(e){this.ds=e,this.filteredList=[]}transform(e,t,n){return e&&t?(this.filteredList=e.filter(e=>this.applyFilter(e,t,n)),this.ds.setData(this.filteredList),this.filteredList):(this.ds.setData(e),e)}applyFilter(e,t,n){let l=!1;if(n.length>0)if(e.grpTitle)l=!0;else for(var r=0;r<n.length;r++)t&&e[n[r]]&&""!=e[n[r]]&&e[n[r]].toString().toLowerCase().indexOf(t.toLowerCase())>=0&&(l=!0);else if(e.grpTitle)l=!0;else for(var i in e)t&&e[i]&&e[i].toString().toLowerCase().indexOf(t.toLowerCase())>=0&&(l=!0);return l}}class qo{constructor(){}}class Wo{constructor(){}}class Go{constructor(){}}class Ko{constructor(e){this.viewContainer=e}ngOnInit(){this.view=this.viewContainer.createEmbeddedView(this.data.template,{$implicit:this.data,item:this.item})}ngOnDestroy(){this.view.destroy()}}class Zo{}var Qo=n("aCrv");function Yo(){return{scrollThrottlingTime:0,scrollDebounceTime:0,scrollAnimationTime:750,checkResizeInterval:1e3,resizeBypassRefreshThreshold:5,modifyOverflowStyleOfParentScroll:!0,stripedTable:!1}}class Jo{constructor(e,t,n,r,i,o){this.element=e,this.renderer=t,this.zone=n,this.changeDetectorRef=r,this.window=window,this.executeRefreshOutsideAngularZone=!1,this._enableUnequalChildrenSizes=!1,this.useMarginInsteadOfTranslate=!1,this.ssrViewportWidth=1920,this.ssrViewportHeight=1080,this._bufferAmount=0,this._items=[],this.compareItems=((e,t)=>e===t),this.vsUpdate=new l.EventEmitter,this.vsChange=new l.EventEmitter,this.vsStart=new l.EventEmitter,this.vsEnd=new l.EventEmitter,this.calculatedScrollbarWidth=0,this.calculatedScrollbarHeight=0,this.padding=0,this.previousViewPort={},this.cachedPageSize=0,this.previousScrollNumberElements=0,this.isAngularUniversalSSR=Object(Y.isPlatformServer)(i),this.scrollThrottlingTime=o.scrollThrottlingTime,this.scrollDebounceTime=o.scrollDebounceTime,this.scrollAnimationTime=o.scrollAnimationTime,this.scrollbarWidth=o.scrollbarWidth,this.scrollbarHeight=o.scrollbarHeight,this.checkResizeInterval=o.checkResizeInterval,this.resizeBypassRefreshThreshold=o.resizeBypassRefreshThreshold,this.modifyOverflowStyleOfParentScroll=o.modifyOverflowStyleOfParentScroll,this.stripedTable=o.stripedTable,this.horizontal=!1,this.resetWrapGroupDimensions()}get viewPortInfo(){let e=this.previousViewPort||{};return{startIndex:e.startIndex||0,endIndex:e.endIndex||0,scrollStartPosition:e.scrollStartPosition||0,scrollEndPosition:e.scrollEndPosition||0,maxScrollPosition:e.maxScrollPosition||0,startIndexWithBuffer:e.startIndexWithBuffer||0,endIndexWithBuffer:e.endIndexWithBuffer||0}}get enableUnequalChildrenSizes(){return this._enableUnequalChildrenSizes}set enableUnequalChildrenSizes(e){this._enableUnequalChildrenSizes!==e&&(this._enableUnequalChildrenSizes=e,this.minMeasuredChildWidth=void 0,this.minMeasuredChildHeight=void 0)}get bufferAmount(){return"number"==typeof this._bufferAmount&&this._bufferAmount>=0?this._bufferAmount:this.enableUnequalChildrenSizes?5:0}set bufferAmount(e){this._bufferAmount=e}get scrollThrottlingTime(){return this._scrollThrottlingTime}set scrollThrottlingTime(e){this._scrollThrottlingTime=e,this.updateOnScrollFunction()}get scrollDebounceTime(){return this._scrollDebounceTime}set scrollDebounceTime(e){this._scrollDebounceTime=e,this.updateOnScrollFunction()}updateOnScrollFunction(){this.onScroll=this.scrollDebounceTime?this.debounce(()=>{this.refresh_internal(!1)},this.scrollDebounceTime):this.scrollThrottlingTime?this.throttleTrailing(()=>{this.refresh_internal(!1)},this.scrollThrottlingTime):()=>{this.refresh_internal(!1)}}get checkResizeInterval(){return this._checkResizeInterval}set checkResizeInterval(e){this._checkResizeInterval!==e&&(this._checkResizeInterval=e,this.addScrollEventHandlers())}get items(){return this._items}set items(e){e!==this._items&&(this._items=e||[],this.refresh_internal(!0))}get horizontal(){return this._horizontal}set horizontal(e){this._horizontal=e,this.updateDirection()}revertParentOverscroll(){const e=this.getScrollElement();e&&this.oldParentScrollOverflow&&(e.style["overflow-y"]=this.oldParentScrollOverflow.y,e.style["overflow-x"]=this.oldParentScrollOverflow.x),this.oldParentScrollOverflow=void 0}get parentScroll(){return this._parentScroll}set parentScroll(e){if(this._parentScroll===e)return;this.revertParentOverscroll(),this._parentScroll=e,this.addScrollEventHandlers();const t=this.getScrollElement();this.modifyOverflowStyleOfParentScroll&&t!==this.element.nativeElement&&(this.oldParentScrollOverflow={x:t.style["overflow-x"],y:t.style["overflow-y"]},t.style["overflow-y"]=this.horizontal?"visible":"auto",t.style["overflow-x"]=this.horizontal?"auto":"visible")}ngOnInit(){this.addScrollEventHandlers()}ngOnDestroy(){this.removeScrollEventHandlers(),this.revertParentOverscroll()}ngOnChanges(e){let t=this.cachedItemsLength!==this.items.length;this.cachedItemsLength=this.items.length,this.refresh_internal(t||!e.items||!e.items.previousValue||0===e.items.previousValue.length)}ngDoCheck(){if(this.cachedItemsLength!==this.items.length)return this.cachedItemsLength=this.items.length,void this.refresh_internal(!0);if(this.previousViewPort&&this.viewPortItems&&this.viewPortItems.length>0){let e=!1;for(let t=0;t<this.viewPortItems.length;++t)if(!this.compareItems(this.items[this.previousViewPort.startIndexWithBuffer+t],this.viewPortItems[t])){e=!0;break}e&&this.refresh_internal(!0)}}refresh(){this.refresh_internal(!0)}invalidateAllCachedMeasurements(){this.wrapGroupDimensions={maxChildSizePerWrapGroup:[],numberOfKnownWrapGroupChildSizes:0,sumOfKnownWrapGroupChildWidths:0,sumOfKnownWrapGroupChildHeights:0},this.minMeasuredChildWidth=void 0,this.minMeasuredChildHeight=void 0,this.refresh_internal(!1)}invalidateCachedMeasurementForItem(e){if(this.enableUnequalChildrenSizes){let t=this.items&&this.items.indexOf(e);t>=0&&this.invalidateCachedMeasurementAtIndex(t)}else this.minMeasuredChildWidth=void 0,this.minMeasuredChildHeight=void 0;this.refresh_internal(!1)}invalidateCachedMeasurementAtIndex(e){if(this.enableUnequalChildrenSizes){let t=this.wrapGroupDimensions.maxChildSizePerWrapGroup[e];t&&(this.wrapGroupDimensions.maxChildSizePerWrapGroup[e]=void 0,--this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes,this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths-=t.childWidth||0,this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights-=t.childHeight||0)}else this.minMeasuredChildWidth=void 0,this.minMeasuredChildHeight=void 0;this.refresh_internal(!1)}scrollInto(e,t=!0,n=0,l,r){let i=this.items.indexOf(e);-1!==i&&this.scrollToIndex(i,t,n,l,r)}scrollToIndex(e,t=!0,n=0,l,r){let i=5,o=()=>{if(--i<=0)return void(r&&r());let l=this.calculateDimensions(),s=Math.min(Math.max(e,0),l.itemCount-1);this.previousViewPort.startIndex!==s?this.scrollToIndex_internal(e,t,n,0,o):r&&r()};this.scrollToIndex_internal(e,t,n,l,o)}scrollToIndex_internal(e,t=!0,n=0,l,r){l=void 0===l?this.scrollAnimationTime:l;let i=this.calculateDimensions(),o=this.calculatePadding(e,i)+n;t||(o-=i.wrapGroupsPerPage*i[this._childScrollDim]),this.scrollToPosition(o,l,r)}scrollToPosition(e,t,n){e+=this.getElementsOffset(),t=void 0===t?this.scrollAnimationTime:t;let l,r=this.getScrollElement();if(this.currentTween&&(this.currentTween.stop(),this.currentTween=void 0),!t)return this.renderer.setProperty(r,this._scrollType,e),void this.refresh_internal(!1,n);const i={scrollPosition:r[this._scrollType]};let o=new Qo.Tween(i).to({scrollPosition:e},t).easing(Qo.Easing.Quadratic.Out).onUpdate(e=>{isNaN(e.scrollPosition)||(this.renderer.setProperty(r,this._scrollType,e.scrollPosition),this.refresh_internal(!1))}).onStop(()=>{cancelAnimationFrame(l)}).start();const s=t=>{o.isPlaying()&&(o.update(t),i.scrollPosition!==e?this.zone.runOutsideAngular(()=>{l=requestAnimationFrame(s)}):this.refresh_internal(!1,n))};s(),this.currentTween=o}getElementSize(e){let t=e.getBoundingClientRect(),n=getComputedStyle(e),l=parseInt(n["margin-top"],10)||0,r=parseInt(n["margin-bottom"],10)||0,i=parseInt(n["margin-left"],10)||0,o=parseInt(n["margin-right"],10)||0;return{top:t.top+l,bottom:t.bottom+r,left:t.left+i,right:t.right+o,width:t.width+i+o,height:t.height+l+r}}checkScrollElementResized(){let e,t=this.getElementSize(this.getScrollElement());if(this.previousScrollBoundingRect){let n=Math.abs(t.width-this.previousScrollBoundingRect.width),l=Math.abs(t.height-this.previousScrollBoundingRect.height);e=n>this.resizeBypassRefreshThreshold||l>this.resizeBypassRefreshThreshold}else e=!0;e&&(this.previousScrollBoundingRect=t,t.width>0&&t.height>0&&this.refresh_internal(!1))}updateDirection(){this.horizontal?(this._invisiblePaddingProperty="width",this._offsetType="offsetLeft",this._pageOffsetType="pageXOffset",this._childScrollDim="childWidth",this._marginDir="margin-left",this._translateDir="translateX",this._scrollType="scrollLeft"):(this._invisiblePaddingProperty="height",this._offsetType="offsetTop",this._pageOffsetType="pageYOffset",this._childScrollDim="childHeight",this._marginDir="margin-top",this._translateDir="translateY",this._scrollType="scrollTop")}debounce(e,t){const n=this.throttleTrailing(e,t),l=function(){n.cancel(),n.apply(this,arguments)};return l.cancel=function(){n.cancel()},l}throttleTrailing(e,t){let n=void 0,l=arguments;const r=function(){const r=this;l=arguments,n||(t<=0?e.apply(r,l):n=setTimeout(function(){n=void 0,e.apply(r,l)},t))};return r.cancel=function(){n&&(clearTimeout(n),n=void 0)},r}refresh_internal(e,t,n=2){if(e&&this.previousViewPort&&this.previousViewPort.scrollStartPosition>0){let e=this.previousViewPort,n=this.viewPortItems,l=t;t=(()=>{let t=this.previousViewPort.scrollLength-e.scrollLength;if(t>0&&this.viewPortItems){let e=n[0],r=this.items.findIndex(t=>this.compareItems(e,t));if(r>this.previousViewPort.startIndexWithBuffer){let e=!1;for(let t=1;t<this.viewPortItems.length;++t)if(!this.compareItems(this.items[r+t],n[t])){e=!0;break}if(!e)return void this.scrollToPosition(this.previousViewPort.scrollStartPosition+t,0,l)}}l&&l()})}this.zone.runOutsideAngular(()=>{requestAnimationFrame(()=>{e&&this.resetWrapGroupDimensions();let l=this.calculateViewport(),r=e||l.startIndex!==this.previousViewPort.startIndex,i=e||l.endIndex!==this.previousViewPort.endIndex,o=l.scrollLength!==this.previousViewPort.scrollLength,s=l.padding!==this.previousViewPort.padding,a=l.scrollStartPosition!==this.previousViewPort.scrollStartPosition||l.scrollEndPosition!==this.previousViewPort.scrollEndPosition||l.maxScrollPosition!==this.previousViewPort.maxScrollPosition;if(this.previousViewPort=l,o&&this.renderer.setStyle(this.invisiblePaddingElementRef.nativeElement,this._invisiblePaddingProperty,`${l.scrollLength}px`),s&&(this.useMarginInsteadOfTranslate?this.renderer.setStyle(this.contentElementRef.nativeElement,this._marginDir,`${l.padding}px`):(this.renderer.setStyle(this.contentElementRef.nativeElement,"transform",`${this._translateDir}(${l.padding}px)`),this.renderer.setStyle(this.contentElementRef.nativeElement,"webkitTransform",`${this._translateDir}(${l.padding}px)`))),this.headerElementRef){let e=this.getScrollElement()[this._scrollType],t=this.getElementsOffset(),n=Math.max(e-l.padding-t+this.headerElementRef.nativeElement.clientHeight,0);this.renderer.setStyle(this.headerElementRef.nativeElement,"transform",`${this._translateDir}(${n}px)`),this.renderer.setStyle(this.headerElementRef.nativeElement,"webkitTransform",`${this._translateDir}(${n}px)`)}const u=r||i?{startIndex:l.startIndex,endIndex:l.endIndex,scrollStartPosition:l.scrollStartPosition,scrollEndPosition:l.scrollEndPosition,startIndexWithBuffer:l.startIndexWithBuffer,endIndexWithBuffer:l.endIndexWithBuffer,maxScrollPosition:l.maxScrollPosition}:void 0;if(r||i||a){const e=()=>{this.viewPortItems=l.startIndexWithBuffer>=0&&l.endIndexWithBuffer>=0?this.items.slice(l.startIndexWithBuffer,l.endIndexWithBuffer+1):[],this.vsUpdate.emit(this.viewPortItems),r&&this.vsStart.emit(u),i&&this.vsEnd.emit(u),(r||i)&&(this.changeDetectorRef.markForCheck(),this.vsChange.emit(u)),n>0?this.refresh_internal(!1,t,n-1):t&&t()};this.executeRefreshOutsideAngularZone?e():this.zone.run(e)}else{if(n>0&&(o||s))return void this.refresh_internal(!1,t,n-1);t&&t()}})})}getScrollElement(){return this.parentScroll instanceof Window?document.scrollingElement||document.documentElement||document.body:this.parentScroll||this.element.nativeElement}addScrollEventHandlers(){if(this.isAngularUniversalSSR)return;let e=this.getScrollElement();this.removeScrollEventHandlers(),this.zone.runOutsideAngular(()=>{this.parentScroll instanceof Window?(this.disposeScrollHandler=this.renderer.listen("window","scroll",this.onScroll),this.disposeResizeHandler=this.renderer.listen("window","resize",this.onScroll)):(this.disposeScrollHandler=this.renderer.listen(e,"scroll",this.onScroll),this._checkResizeInterval>0&&(this.checkScrollElementResizedTimer=setInterval(()=>{this.checkScrollElementResized()},this._checkResizeInterval)))})}removeScrollEventHandlers(){this.checkScrollElementResizedTimer&&clearInterval(this.checkScrollElementResizedTimer),this.disposeScrollHandler&&(this.disposeScrollHandler(),this.disposeScrollHandler=void 0),this.disposeResizeHandler&&(this.disposeResizeHandler(),this.disposeResizeHandler=void 0)}getElementsOffset(){if(this.isAngularUniversalSSR)return 0;let e=0;if(this.containerElementRef&&this.containerElementRef.nativeElement&&(e+=this.containerElementRef.nativeElement[this._offsetType]),this.parentScroll){let t=this.getScrollElement(),n=this.getElementSize(this.element.nativeElement),l=this.getElementSize(t);e+=this.horizontal?n.left-l.left:n.top-l.top,this.parentScroll instanceof Window||(e+=t[this._scrollType])}return e}countItemsPerWrapGroup(){if(this.isAngularUniversalSSR)return Math.round(this.horizontal?this.ssrViewportHeight/this.ssrChildHeight:this.ssrViewportWidth/this.ssrChildWidth);let e=this.horizontal?"offsetLeft":"offsetTop",t=(this.containerElementRef&&this.containerElementRef.nativeElement||this.contentElementRef.nativeElement).children,n=t?t.length:0;if(0===n)return 1;let l=t[0][e],r=1;for(;r<n&&l===t[r][e];)++r;return r}getScrollStartPosition(){let e=void 0;return this.parentScroll instanceof Window&&(e=window[this._pageOffsetType]),e||this.getScrollElement()[this._scrollType]||0}resetWrapGroupDimensions(){const e=this.wrapGroupDimensions;if(this.invalidateAllCachedMeasurements(),!this.enableUnequalChildrenSizes||!e||0===e.numberOfKnownWrapGroupChildSizes)return;const t=this.countItemsPerWrapGroup();for(let n=0;n<e.maxChildSizePerWrapGroup.length;++n){const l=e.maxChildSizePerWrapGroup[n];if(!l||!l.items||!l.items.length)continue;if(l.items.length!==t)return;let r=!1,i=t*n;for(let e=0;e<t;++e)if(!this.compareItems(l.items[e],this.items[i+e])){r=!0;break}r||(++this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes,this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths+=l.childWidth||0,this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights+=l.childHeight||0,this.wrapGroupDimensions.maxChildSizePerWrapGroup[n]=l)}}calculateDimensions(){let e=this.getScrollElement();this.calculatedScrollbarHeight=Math.max(Math.min(e.offsetHeight-e.clientHeight,25),this.calculatedScrollbarHeight),this.calculatedScrollbarWidth=Math.max(Math.min(e.offsetWidth-e.clientWidth,25),this.calculatedScrollbarWidth);let t,n,l,r=e.offsetWidth-(this.scrollbarWidth||this.calculatedScrollbarWidth||(this.horizontal?0:25)),i=e.offsetHeight-(this.scrollbarHeight||this.calculatedScrollbarHeight||(this.horizontal?25:0)),o=this.containerElementRef&&this.containerElementRef.nativeElement||this.contentElementRef.nativeElement,s=this.countItemsPerWrapGroup();if(this.isAngularUniversalSSR){r=this.ssrViewportWidth,i=this.ssrViewportHeight,n=this.ssrChildWidth,l=this.ssrChildHeight;let e=Math.max(Math.ceil(r/n),1),o=Math.max(Math.ceil(i/l),1);t=this.horizontal?e:o}else if(this.enableUnequalChildrenSizes){let a=e[this._scrollType]-(this.previousViewPort?this.previousViewPort.padding:0),u=this.previousViewPort.startIndexWithBuffer||0,c=Math.ceil(u/s),d=0,h=0,p=0,f=0;t=0;for(let e=0;e<o.children.length;++e){++u;let n=this.getElementSize(o.children[e]);if(d=Math.max(d,n.width),h=Math.max(h,n.height),u%s==0){let e=this.wrapGroupDimensions.maxChildSizePerWrapGroup[c];e&&(--this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes,this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths-=e.childWidth||0,this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights-=e.childHeight||0),++this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes;const n=this.items.slice(u-s,u);if(this.wrapGroupDimensions.maxChildSizePerWrapGroup[c]={childWidth:d,childHeight:h,items:n},this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths+=d,this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights+=h,this.horizontal){let e=Math.min(d,Math.max(r-p,0));if(a>0){let t=Math.min(a,e);e-=t,a-=t}p+=e,e>0&&r>=p&&++t}else{let e=Math.min(h,Math.max(i-f,0));if(a>0){let t=Math.min(a,e);e-=t,a-=t}f+=e,e>0&&i>=f&&++t}++c,d=0,h=0}}let g=this.wrapGroupDimensions.sumOfKnownWrapGroupChildWidths/this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes,m=this.wrapGroupDimensions.sumOfKnownWrapGroupChildHeights/this.wrapGroupDimensions.numberOfKnownWrapGroupChildSizes;n=this.childWidth||g||r,l=this.childHeight||m||i,this.horizontal?r>p&&(t+=Math.ceil((r-p)/n)):i>f&&(t+=Math.ceil((i-f)/l))}else{if(o.children.length>0){this.childWidth&&this.childHeight||(!this.minMeasuredChildWidth&&r>0&&(this.minMeasuredChildWidth=r),!this.minMeasuredChildHeight&&i>0&&(this.minMeasuredChildHeight=i));let e=this.getElementSize(o.children[0]);this.minMeasuredChildWidth=Math.min(this.minMeasuredChildWidth,e.width),this.minMeasuredChildHeight=Math.min(this.minMeasuredChildHeight,e.height)}n=this.childWidth||this.minMeasuredChildWidth||r,l=this.childHeight||this.minMeasuredChildHeight||i;let e=Math.max(Math.ceil(r/n),1),s=Math.max(Math.ceil(i/l),1);t=this.horizontal?e:s}let a=this.items.length,u=s*t,c=a/u,d=Math.ceil(a/s),h=0,p=this.horizontal?n:l;if(this.enableUnequalChildrenSizes){let e=0;for(let t=0;t<d;++t){let n=this.wrapGroupDimensions.maxChildSizePerWrapGroup[t]&&this.wrapGroupDimensions.maxChildSizePerWrapGroup[t][this._childScrollDim];n?h+=n:++e}h+=Math.round(e*p)}else h=d*p;this.headerElementRef&&(h+=this.headerElementRef.nativeElement.clientHeight);let f=this.horizontal?r:i;return{itemCount:a,itemsPerWrapGroup:s,wrapGroupsPerPage:t,itemsPerPage:u,pageCount_fractional:c,childWidth:n,childHeight:l,scrollLength:h,viewportLength:f,maxScrollPosition:Math.max(h-f,0)}}calculatePadding(e,t){if(0===t.itemCount)return 0;let n=t[this._childScrollDim],l=Math.floor(e/t.itemsPerWrapGroup)||0;if(!this.enableUnequalChildrenSizes)return n*l;let r=0,i=0;for(let o=0;o<l;++o){let e=this.wrapGroupDimensions.maxChildSizePerWrapGroup[o]&&this.wrapGroupDimensions.maxChildSizePerWrapGroup[o][this._childScrollDim];e?i+=e:++r}return i+Math.round(r*n)}calculatePageInfo(e,t){let n=0;if(this.enableUnequalChildrenSizes){const l=Math.ceil(t.itemCount/t.itemsPerWrapGroup);let r=0,i=t[this._childScrollDim];for(let t=0;t<l;++t)if(e<(r+=this.wrapGroupDimensions.maxChildSizePerWrapGroup[t]&&this.wrapGroupDimensions.maxChildSizePerWrapGroup[t][this._childScrollDim]||i)){n=t/l;break}}else n=e/t.scrollLength;let l=Math.min(Math.max(n*t.pageCount_fractional,0),t.pageCount_fractional)*t.itemsPerPage,r=t.itemCount-t.itemsPerPage-1,i=Math.min(Math.floor(l),r);if(i-=i%t.itemsPerWrapGroup,this.stripedTable){let e=2*t.itemsPerWrapGroup;i%e!=0&&(i=Math.max(i-i%e,0))}let o=Math.ceil(l)+t.itemsPerPage-1,s=(o+1)%t.itemsPerWrapGroup;s>0&&(o+=t.itemsPerWrapGroup-s),isNaN(i)&&(i=0),isNaN(o)&&(o=0),i=Math.min(Math.max(i,0),t.itemCount-1),o=Math.min(Math.max(o,0),t.itemCount-1);let a=this.bufferAmount*t.itemsPerWrapGroup;return{startIndex:i,endIndex:o,startIndexWithBuffer:Math.min(Math.max(i-a,0),t.itemCount-1),endIndexWithBuffer:Math.min(Math.max(o+a,0),t.itemCount-1),scrollStartPosition:e,scrollEndPosition:e+t.viewportLength,maxScrollPosition:t.maxScrollPosition}}calculateViewport(){let e=this.calculateDimensions(),t=this.getElementsOffset(),n=this.getScrollStartPosition();n>e.scrollLength+t&&!(this.parentScroll instanceof Window)?n=e.scrollLength:n-=t,n=Math.max(0,n);let l=this.calculatePageInfo(n,e),r=this.calculatePadding(l.startIndexWithBuffer,e),i=e.scrollLength;return{startIndex:l.startIndex,endIndex:l.endIndex,startIndexWithBuffer:l.startIndexWithBuffer,endIndexWithBuffer:l.endIndexWithBuffer,padding:Math.round(r),scrollLength:Math.round(i),scrollStartPosition:l.scrollStartPosition,scrollEndPosition:l.scrollEndPosition,maxScrollPosition:l.maxScrollPosition}}}class Xo{}class es{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new ts(e,this.dueTime,this.scheduler))}}class ts extends T.a{constructor(e,t,n){super(e),this.dueTime=t,this.scheduler=n,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(ns,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function ns(e){e.debouncedNext()}class ls{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new rs(e,this.compare,this.keySelector))}}class rs extends T.a{constructor(e,t,n){super(e),this.keySelector=n,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:n}=this;t=n?n(e):e}catch(l){return this.destination.error(l)}let n=!1;if(this.hasKey)try{const{compare:e}=this;n=e(this.key,t)}catch(l){return this.destination.error(l)}else this.hasKey=!0;n||(this.key=t,this.destination.next(e))}}Object(l.forwardRef)(()=>os),Object(l.forwardRef)(()=>os);const is=()=>{};class os{constructor(e,t,n){this._elementRef=e,this.cdr=t,this.ds=n,this.onSelect=new l.EventEmitter,this.onDeSelect=new l.EventEmitter,this.onSelectAll=new l.EventEmitter,this.onDeSelectAll=new l.EventEmitter,this.onOpen=new l.EventEmitter,this.onClose=new l.EventEmitter,this.onScrollToEnd=new l.EventEmitter,this.onFilterSelectAll=new l.EventEmitter,this.onFilterDeSelectAll=new l.EventEmitter,this.onAddFilterNewItem=new l.EventEmitter,this.onGroupSelect=new l.EventEmitter,this.onGroupDeSelect=new l.EventEmitter,this.virtualdata=[],this.searchTerm$=new X.a,this.isActive=!1,this.isSelectAll=!1,this.isFilterSelectAll=!1,this.isInfiniteFilterSelectAll=!1,this.chunkIndex=[],this.cachedItems=[],this.groupCachedItems=[],this.itemHeight=41.6,this.filterLength=0,this.infiniteFilterLength=0,this.dropdownListYOffset=0,this.defaultSettings={singleSelection:!1,text:"Select",enableCheckAll:!0,selectAllText:"Select All",unSelectAllText:"UnSelect All",filterSelectAllText:"Select all filtered results",filterUnSelectAllText:"UnSelect all filtered results",enableSearchFilter:!1,searchBy:[],maxHeight:300,badgeShowLimit:999999999999,classes:"",disabled:!1,searchPlaceholderText:"Search",showCheckbox:!0,noDataLabel:"No Data Available",searchAutofocus:!0,lazyLoading:!1,labelKey:"itemName",primaryKey:"id",position:"bottom",autoPosition:!0,enableFilterSelectAll:!0,selectGroup:!1,addNewItemOnFilter:!1,addNewButtonText:"Add",escapeToClose:!0,clearAll:!0},this.randomSize=!0,this.filteredList=[],this.virtualScroollInit=!1,this.onTouchedCallback=is,this.onChangeCallback=is,this.searchTerm$.asObservable().pipe(function(e,t=y){return e=>e.lift(new es(1e3,t))}(),e=>e.lift(new ls(void 0,void 0)),Te(e=>e)).subscribe(e=>{this.filterInfiniteList(e)})}onEscapeDown(e){this.settings.escapeToClose&&this.closeDropdown()}ngOnInit(){this.settings=Object.assign(this.defaultSettings,this.settings),this.cachedItems=this.cloneArray(this.data),"top"==this.settings.position&&setTimeout(()=>{this.selectedListHeight={val:0},this.selectedListHeight.val=this.selectedListElem.nativeElement.clientHeight}),this.subscription=this.ds.getData().subscribe(e=>{if(e){let t=0;e.forEach((e,n)=>{e.hasOwnProperty("grpTitle")||t++}),this.filterLength=t,this.onFilterChange(e)}}),setTimeout(()=>{this.calculateDropdownDirection()}),this.virtualScroollInit=!1}ngOnChanges(e){e.data&&!e.data.firstChange&&(this.settings.groupBy&&(this.groupedData=this.transformData(this.data,this.settings.groupBy),0==this.data.length&&(this.selectedItems=[]),this.groupCachedItems=this.cloneArray(this.groupedData)),this.cachedItems=this.cloneArray(this.data)),e.settings&&!e.settings.firstChange&&(this.settings=Object.assign(this.defaultSettings,this.settings)),this.settings.lazyLoading&&this.virtualScroollInit&&e.data&&(this.virtualdata=e.data.currentValue)}ngDoCheck(){this.selectedItems&&(0==this.selectedItems.length||0==this.data.length||this.selectedItems.length<this.data.length)&&(this.isSelectAll=!1)}ngAfterViewInit(){}ngAfterViewChecked(){this.selectedListElem.nativeElement.clientHeight&&"top"==this.settings.position&&this.selectedListHeight&&(this.selectedListHeight.val=this.selectedListElem.nativeElement.clientHeight,this.cdr.detectChanges())}onItemClick(e,t,n){if(this.settings.disabled)return!1;let l=this.isSelected(e),r=this.selectedItems.length<this.settings.limitSelection;l?(this.removeSelected(e),this.onDeSelect.emit(e)):this.settings.limitSelection?r&&(this.addSelected(e),this.onSelect.emit(e)):(this.addSelected(e),this.onSelect.emit(e)),(this.isSelectAll||this.data.length>this.selectedItems.length)&&(this.isSelectAll=!1),this.data.length==this.selectedItems.length&&(this.isSelectAll=!0),this.settings.groupBy&&this.updateGroupInfo(e)}validate(e){return null}writeValue(e){if(null!=e&&""!==e)if(this.settings.singleSelection)if(this.settings.groupBy)this.groupedData=this.transformData(this.data,this.settings.groupBy),this.groupCachedItems=this.cloneArray(this.groupedData),this.selectedItems=[e[0]];else try{if(e.length>1)throw this.selectedItems=[e[0]],new Uo(404,{msg:"Single Selection Mode, Selected Items cannot have more than one item."});this.selectedItems=e}catch(t){console.error(t.body.msg)}else this.selectedItems=this.settings.limitSelection?e.slice(0,this.settings.limitSelection):e,this.selectedItems.length===this.data.length&&this.data.length>0&&(this.isSelectAll=!0),this.settings.groupBy&&(this.groupedData=this.transformData(this.data,this.settings.groupBy),this.groupCachedItems=this.cloneArray(this.groupedData));else this.selectedItems=[]}registerOnChange(e){this.onChangeCallback=e}registerOnTouched(e){this.onTouchedCallback=e}trackByFn(e,t){return t[this.settings.primaryKey]}isSelected(e){let t=!1;return this.selectedItems&&this.selectedItems.forEach(n=>{e[this.settings.primaryKey]===n[this.settings.primaryKey]&&(t=!0)}),t}addSelected(e){this.settings.singleSelection?(this.selectedItems=[],this.selectedItems.push(e),this.closeDropdown()):this.selectedItems.push(e),this.onChangeCallback(this.selectedItems),this.onTouchedCallback(this.selectedItems)}removeSelected(e){this.selectedItems&&this.selectedItems.forEach(t=>{e[this.settings.primaryKey]===t[this.settings.primaryKey]&&this.selectedItems.splice(this.selectedItems.indexOf(t),1)}),this.onChangeCallback(this.selectedItems),this.onTouchedCallback(this.selectedItems)}toggleDropdown(e){if(this.settings.disabled)return!1;this.isActive=!this.isActive,this.isActive?(this.settings.searchAutofocus&&this.searchInput&&this.settings.enableSearchFilter&&!this.searchTempl&&setTimeout(()=>{this.searchInput.nativeElement.focus()},0),this.onOpen.emit(!0)):this.onClose.emit(!1),setTimeout(()=>{this.calculateDropdownDirection()},0),this.settings.lazyLoading&&(this.virtualdata=this.data,this.virtualScroollInit=!0),e.preventDefault()}openDropdown(){if(this.settings.disabled)return!1;this.isActive=!0,this.settings.searchAutofocus&&this.searchInput&&this.settings.enableSearchFilter&&!this.searchTempl&&setTimeout(()=>{this.searchInput.nativeElement.focus()},0),this.onOpen.emit(!0)}closeDropdown(){this.searchInput&&this.settings.lazyLoading&&(this.searchInput.nativeElement.value=""),this.searchInput&&(this.searchInput.nativeElement.value=""),this.filter="",this.isActive=!1,this.onClose.emit(!1)}closeDropdownOnClickOut(){this.isActive&&(this.searchInput&&this.settings.lazyLoading&&(this.searchInput.nativeElement.value=""),this.searchInput&&(this.searchInput.nativeElement.value=""),this.filter="",this.isActive=!1,this.clearSearch(),this.onClose.emit(!1))}toggleSelectAll(){this.isSelectAll?(this.settings.groupBy&&(this.groupedData.forEach(e=>{e.selected=!1}),this.groupCachedItems.forEach(e=>{e.selected=!1})),this.selectedItems=[],this.isSelectAll=!1,this.onChangeCallback(this.selectedItems),this.onTouchedCallback(this.selectedItems),this.onDeSelectAll.emit(this.selectedItems)):(this.selectedItems=[],this.settings.groupBy&&(this.groupedData.forEach(e=>{e.selected=!0}),this.groupCachedItems.forEach(e=>{e.selected=!0})),this.selectedItems=this.data.slice(),this.isSelectAll=!0,this.onChangeCallback(this.selectedItems),this.onTouchedCallback(this.selectedItems),this.onSelectAll.emit(this.selectedItems))}filterGroupedList(){""!=this.filter&&null!=this.filter?(this.groupedData=this.cloneArray(this.groupCachedItems),this.groupedData=this.groupedData.filter(e=>{let t=[];return t=e[this.settings.labelKey].toLowerCase().indexOf(this.filter.toLowerCase())>-1?e.list:e.list.filter(e=>e[this.settings.labelKey].toLowerCase().indexOf(this.filter.toLowerCase())>-1),e.list=t,e[this.settings.labelKey].toLowerCase().indexOf(this.filter.toLowerCase())>-1?t:t.some(e=>e[this.settings.labelKey].toLowerCase().indexOf(this.filter.toLowerCase())>-1)})):this.clearSearch()}toggleFilterSelectAll(){if(this.isFilterSelectAll){let e=[];this.settings.groupBy?this.ds.getFilteredData().forEach(t=>{this.isSelected(t)&&(this.removeSelected(t),e.push(t))}):this.ds.getFilteredData().forEach(t=>{this.isSelected(t)&&(this.removeSelected(t),e.push(t))}),this.isFilterSelectAll=!1,this.onFilterDeSelectAll.emit(e)}else{let e=[];this.settings.groupBy?this.ds.getFilteredData().forEach(t=>{this.isSelected(t)||t.hasOwnProperty("grpTitle")||(this.addSelected(t),e.push(t))}):this.ds.getFilteredData().forEach(t=>{this.isSelected(t)||(this.addSelected(t),e.push(t))}),this.isFilterSelectAll=!0,this.onFilterSelectAll.emit(e)}}toggleInfiniteFilterSelectAll(){this.isInfiniteFilterSelectAll?(this.virtualdata.forEach(e=>{this.isSelected(e)&&this.removeSelected(e)}),this.isInfiniteFilterSelectAll=!1):(this.virtualdata.forEach(e=>{this.isSelected(e)||this.addSelected(e)}),this.isInfiniteFilterSelectAll=!0)}clearSearch(){this.settings.groupBy&&(this.groupedData=[],this.groupedData=this.cloneArray(this.groupCachedItems)),this.filter="",this.isFilterSelectAll=!1}onFilterChange(e){(this.filter&&""==this.filter||0==e.length)&&(this.isFilterSelectAll=!1);let t=0;e.forEach(e=>{!e.hasOwnProperty("grpTitle")&&this.isSelected(e)&&t++}),t>0&&this.filterLength==t?this.isFilterSelectAll=!0:t>0&&this.filterLength!=t&&(this.isFilterSelectAll=!1),this.cdr.detectChanges()}cloneArray(e){if(Array.isArray(e))return JSON.parse(JSON.stringify(e));if("object"==typeof e)throw"Cannot clone array containing an object!";return e}updateGroupInfo(e){let t=this.settings.groupBy;this.groupedData.forEach(n=>{let l=0;n.grpTitle&&e[t]==n[t]&&n.list&&n.list.forEach(e=>{this.isSelected(e)&&l++}),n.list&&l===n.list.length&&e[t]==n[t]?n.selected=!0:n.list&&l!=n.list.length&&e[t]==n[t]&&(n.selected=!1)}),this.groupCachedItems.forEach(n=>{let l=0;n.grpTitle&&e[t]==n[t]&&n.list&&n.list.forEach(e=>{this.isSelected(e)&&l++}),n.list&&l===n.list.length&&e[t]==n[t]?n.selected=!0:n.list&&l!=n.list.length&&e[t]==n[t]&&(n.selected=!1)})}transformData(e,t){const n=e.reduce((e,n)=>(e[n[t]]?e[n[t]].push(n):e[n[t]]=[n],e),{}),l=[];return Object.keys(n).map(e=>{let t={grpTitle:!0};t[this.settings.labelKey]=e,t[this.settings.groupBy]=e,t.selected=!1,t.list=[];let r=0;n[e].forEach(e=>{e.list=[],t.list.push(e),this.isSelected(e)&&r++}),t.selected=r==t.list.length,l.push(t)}),l}filterInfiniteList(e){let t=[];if(this.settings.groupBy?this.groupedData=this.groupCachedItems.slice():(this.data=this.cachedItems.slice(),this.virtualdata=this.cachedItems.slice()),(null!=e||""!=e)&&!this.settings.groupBy){if(this.settings.searchBy.length>0)for(let n=0;n<this.settings.searchBy.length;n++)this.virtualdata.filter(l=>{l[this.settings.searchBy[n].toString()].toString().toLowerCase().indexOf(e.toString().toLowerCase())>=0&&t.push(l)});else this.virtualdata.filter(function(n){for(let l in n)if(n[l].toString().toLowerCase().indexOf(e.toString().toLowerCase())>=0){t.push(n);break}});this.virtualdata=[],this.virtualdata=t,this.infiniteFilterLength=this.virtualdata.length}""!=e.toString()&&this.settings.groupBy?(this.groupedData.filter(function(n){if(n.hasOwnProperty("grpTitle"))t.push(n);else for(let l in n)if(n[l].toString().toLowerCase().indexOf(e.toString().toLowerCase())>=0){t.push(n);break}}),this.groupedData=[],this.groupedData=t,this.infiniteFilterLength=this.groupedData.length):""==e.toString()&&this.cachedItems.length>0&&(this.virtualdata=[],this.virtualdata=this.cachedItems,this.infiniteFilterLength=0),this.virtualScroller.refresh()}resetInfiniteSearch(){this.filter="",this.isInfiniteFilterSelectAll=!1,this.virtualdata=[],this.virtualdata=this.cachedItems,this.groupedData=this.groupCachedItems,this.infiniteFilterLength=0}onScrollEnd(e){this.onScrollToEnd.emit(e)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}selectGroup(e){e.selected?(e.selected=!1,e.list.forEach(e=>{this.removeSelected(e)}),this.updateGroupInfo(e),this.onGroupSelect.emit(e)):(e.selected=!0,e.list.forEach(e=>{this.isSelected(e)||this.addSelected(e)}),this.updateGroupInfo(e),this.onGroupDeSelect.emit(e))}addFilterNewItem(){this.onAddFilterNewItem.emit(this.filter),this.filterPipe=new $o(this.ds),this.filterPipe.transform(this.data,this.filter,this.settings.searchBy)}calculateDropdownDirection(){if(this.settings.autoPosition){const e=this.dropdownListElem.nativeElement.clientHeight,t=document.documentElement.clientHeight,n=this.selectedListElem.nativeElement.getBoundingClientRect(),l=n.top;this.openTowardsTop(t-n.top<l&&e<l)}}openTowardsTop(e){this.dropdownListYOffset=e&&this.selectedListElem.nativeElement.clientHeight?15+this.selectedListElem.nativeElement.clientHeight:0}clearSelection(e){this.settings.groupBy&&this.groupCachedItems.forEach(e=>{e.selected=!1}),this.clearSearch(),this.selectedItems=[],this.onDeSelectAll.emit(this.selectedItems)}}class ss{}var as=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function us(e){return l["\u0275vid"](0,[],null,null)}var cs=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function ds(e){return l["\u0275vid"](0,[],null,null)}var hs=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function ps(e){return l["\u0275vid"](0,[],null,null)}var fs=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function gs(e){return l["\u0275vid"](0,[],null,null)}var ms=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function vs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,":svg:svg",[[":xml:space","preserve"],[":xmlns:xlink","http://www.w3.org/1999/xlink"],["height","100%"],["id","Capa_1"],["style","enable-background:new 0 0 47.971 47.971;"],["version","1.1"],["viewBox","0 0 47.971 47.971"],["width","100%"],["x","0px"],["xmlns","http://www.w3.org/2000/svg"],["y","0px"]],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,1,":svg:g",[],null,null,null,null,null)),(e()(),l["\u0275eld"](2,0,null,null,0,":svg:path",[["d","M28.228,23.986L47.092,5.122c1.172-1.171,1.172-3.071,0-4.242c-1.172-1.172-3.07-1.172-4.242,0L23.986,19.744L5.121,0.88\n c-1.172-1.172-3.07-1.172-4.242,0c-1.172,1.171-1.172,3.071,0,4.242l18.865,18.864L0.879,42.85c-1.172,1.171-1.172,3.071,0,4.242\n C1.465,47.677,2.233,47.97,3,47.97s1.535-0.293,2.121-0.879l18.865-18.864L42.85,47.091c0.586,0.586,1.354,0.879,2.121,0.879\n s1.535-0.293,2.121-0.879c1.172-1.171,1.172-3.071,0-4.242L28.228,23.986z"]],null,null,null,null,null))],null,null)}function ys(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,4,":svg:svg",[[":xml:space","preserve"],[":xmlns:xlink","http://www.w3.org/1999/xlink"],["height","100%"],["id","Capa_1"],["style","enable-background:new 0 0 612 612;"],["version","1.1"],["viewBox","0 0 612 612"],["width","100%"],["x","0px"],["xmlns","http://www.w3.org/2000/svg"],["y","0px"]],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,3,":svg:g",[],null,null,null,null,null)),(e()(),l["\u0275eld"](2,0,null,null,2,":svg:g",[["id","_x31_0_34_"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,1,":svg:g",[],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,0,":svg:path",[["d","M604.501,134.782c-9.999-10.05-26.222-10.05-36.221,0L306.014,422.558L43.721,134.782\n\t\t\t\tc-9.999-10.05-26.223-10.05-36.222,0s-9.999,26.35,0,36.399l279.103,306.241c5.331,5.357,12.422,7.652,19.386,7.296\n\t\t\t\tc6.988,0.356,14.055-1.939,19.386-7.296l279.128-306.268C614.5,161.106,614.5,144.832,604.501,134.782z"]],null,null,null,null,null))],null,null)}function bs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,4,":svg:svg",[[":xml:space","preserve"],[":xmlns:xlink","http://www.w3.org/1999/xlink"],["height","100%"],["id","Capa_1"],["style","enable-background:new 0 0 612 612;"],["version","1.1"],["viewBox","0 0 612 612"],["width","100%"],["x","0px"],["xmlns","http://www.w3.org/2000/svg"],["y","0px"]],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,3,":svg:g",[],null,null,null,null,null)),(e()(),l["\u0275eld"](2,0,null,null,2,":svg:g",[["id","_x39__30_"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,1,":svg:g",[],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,0,":svg:path",[["d","M604.501,440.509L325.398,134.956c-5.331-5.357-12.423-7.627-19.386-7.27c-6.989-0.357-14.056,1.913-19.387,7.27\n\t\t\t\tL7.499,440.509c-9.999,10.024-9.999,26.298,0,36.323s26.223,10.024,36.222,0l262.293-287.164L568.28,476.832\n\t\t\t\tc9.999,10.024,26.222,10.024,36.221,0C614.5,466.809,614.5,450.534,604.501,440.509z"]],null,null,null,null,null))],null,null)}function Cs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,":svg:svg",[[":xml:space","preserve"],[":xmlns:xlink","http://www.w3.org/1999/xlink"],["height","100%"],["id","Capa_1"],["style","enable-background:new 0 0 615.52 615.52;"],["version","1.1"],["viewBox","0 0 615.52 615.52"],["width","100%"],["x","0px"],["xmlns","http://www.w3.org/2000/svg"],["y","0px"]],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,4,":svg:g",[],null,null,null,null,null)),(e()(),l["\u0275eld"](2,0,null,null,3,":svg:g",[],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,2,":svg:g",[["id","Search__x28_and_thou_shall_find_x29_"]],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,1,":svg:g",[],null,null,null,null,null)),(e()(),l["\u0275eld"](5,0,null,null,0,":svg:path",[["d","M602.531,549.736l-184.31-185.368c26.679-37.72,42.528-83.729,42.528-133.548C460.75,103.35,357.997,0,231.258,0\n\t\t\t\t\tC104.518,0,1.765,103.35,1.765,230.82c0,127.47,102.753,230.82,229.493,230.82c49.53,0,95.271-15.944,132.78-42.777\n\t\t\t\t\tl184.31,185.366c7.482,7.521,17.292,11.291,27.102,11.291c9.812,0,19.62-3.77,27.083-11.291\n\t\t\t\t\tC617.496,589.188,617.496,564.777,602.531,549.736z M355.9,319.763l-15.042,21.273L319.7,356.174\n\t\t\t\t\tc-26.083,18.658-56.667,28.526-88.442,28.526c-84.365,0-152.995-69.035-152.995-153.88c0-84.846,68.63-153.88,152.995-153.88\n\t\t\t\t\ts152.996,69.034,152.996,153.88C384.271,262.769,374.462,293.526,355.9,319.763z"]],null,null,null,null,null))],null,null)}function ws(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,":svg:svg",[[":xml:space","preserve"],[":xmlns:xlink","http://www.w3.org/1999/xlink"],["id","Capa_1"],["style","enable-background:new 0 0 51.976 51.976;"],["version","1.1"],["viewBox","0 0 51.976 51.976"],["x","0px"],["xmlns","http://www.w3.org/2000/svg"],["y","0px"]],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,1,":svg:g",[],null,null,null,null,null)),(e()(),l["\u0275eld"](2,0,null,null,0,":svg:path",[["d","M44.373,7.603c-10.137-10.137-26.632-10.138-36.77,0c-10.138,10.138-10.137,26.632,0,36.77s26.632,10.138,36.77,0\n\t\tC54.51,34.235,54.51,17.74,44.373,7.603z M36.241,36.241c-0.781,0.781-2.047,0.781-2.828,0l-7.425-7.425l-7.778,7.778\n\t\tc-0.781,0.781-2.047,0.781-2.828,0c-0.781-0.781-0.781-2.047,0-2.828l7.778-7.778l-7.425-7.425c-0.781-0.781-0.781-2.048,0-2.828\n\t\tc0.781-0.781,2.047-0.781,2.828,0l7.425,7.425l7.071-7.071c0.781-0.781,2.047-0.781,2.828,0c0.781,0.781,0.781,2.047,0,2.828\n\t\tl-7.071,7.071l7.425,7.425C37.022,34.194,37.022,35.46,36.241,36.241z"]],null,null,null,null,null))],null,null)}function Ss(e){return l["\u0275vid"](0,[(e()(),l["\u0275and"](16777216,null,null,1,null,vs)),l["\u0275did"](1,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,ys)),l["\u0275did"](3,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,bs)),l["\u0275did"](5,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Cs)),l["\u0275did"](7,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,ws)),l["\u0275did"](9,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,1,0,"remove"==n.name),e(t,3,0,"angle-down"==n.name),e(t,5,0,"angle-up"==n.name),e(t,7,0,"search"==n.name),e(t,9,0,"clear"==n.name)},null)}var _s=l["\u0275crt"]({encapsulation:0,styles:["[_nghost-%COMP%] {\n position: relative;\n\t display: block;\n -webkit-overflow-scrolling: touch;\n }\n\t\n\t.horizontal.selfScroll[_nghost-%COMP%] {\n overflow-y: visible;\n overflow-x: auto;\n\t}\n\t.vertical.selfScroll[_nghost-%COMP%] {\n overflow-y: auto;\n overflow-x: visible;\n\t}\n\t\n .scrollable-content[_ngcontent-%COMP%] {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n max-width: 100vw;\n max-height: 100vh;\n position: absolute;\n }\n\n\t.scrollable-content[_ngcontent-%COMP%] > * {\n\t\tbox-sizing: border-box;\n\t}\n\t\n\t.horizontal[_nghost-%COMP%] {\n\t\twhite-space: nowrap;\n\t}\n\t\n\t.horizontal[_nghost-%COMP%] .scrollable-content[_ngcontent-%COMP%] {\n\t\tdisplay: flex;\n\t}\n\t\n\t.horizontal[_nghost-%COMP%] .scrollable-content[_ngcontent-%COMP%] > * {\n\t\tflex-shrink: 0;\n\t\tflex-grow: 0;\n\t\twhite-space: initial;\n\t}\n\t\n .total-padding[_ngcontent-%COMP%] {\n width: 1px;\n opacity: 0;\n }\n \n .horizontal[_nghost-%COMP%] .total-padding[_ngcontent-%COMP%] {\n height: 100%;\n }"],data:{}});function Is(e){return l["\u0275vid"](0,[l["\u0275qud"](671088640,1,{contentElementRef:0}),l["\u0275qud"](671088640,2,{invisiblePaddingElementRef:0}),(e()(),l["\u0275eld"](2,0,[[2,0],["invisiblePadding",1]],null,0,"div",[["class","total-padding"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,[[1,0],["content",1]],null,1,"div",[["class","scrollable-content"]],null,null,null,null,null)),l["\u0275ncd"](null,0)],null,null)}class Es{constructor(e){this._elementRef=e,this.clickOutside=new l.EventEmitter}onClick(e,t){t&&(this._elementRef.nativeElement.contains(t)||this.clickOutside.emit(e))}}var Ds=l["\u0275crt"]({encapsulation:2,styles:[["virtual-scroll{display:block;width:100%}.cuppa-dropdown{position:relative}.c-btn{display:inline-block;border-width:1px;line-height:1.25;border-radius:3px;font-size:.85rem;padding:5px 10px;cursor:pointer;align-items:center;min-height:38px}.c-btn.disabled{background:#ccc}.selected-list .c-list{float:left;padding:0;margin:0;width:calc(100% - 20px)}.selected-list .c-list .c-token{list-style:none;padding:4px 22px 4px 8px;border-radius:2px;margin-right:4px;margin-top:2px;float:left;position:relative}.selected-list .c-list .c-token .c-label{display:block;float:left}.selected-list .c-list .c-token .c-remove{position:absolute;right:8px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);width:8px}.selected-list .c-list .c-token .c-remove svg{fill:#fff}.selected-list .fa-angle-down,.selected-list .fa-angle-up{font-size:15pt;position:absolute;right:10px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.selected-list .c-angle-down,.selected-list .c-angle-up{width:12px;height:12px;position:absolute;right:10px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);pointer-events:none}.selected-list .c-angle-down svg,.selected-list .c-angle-up svg{fill:#333}.selected-list .countplaceholder{position:absolute;right:45px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.selected-list .c-btn{width:100%;padding:5px 10px;cursor:pointer;display:flex;position:relative}.selected-list .c-btn .c-icon{position:absolute;right:5px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.dropdown-list{position:absolute;padding-top:14px;width:100%;z-index:99999}.dropdown-list ul{padding:0;list-style:none;overflow:auto;margin:0}.dropdown-list ul li{padding:10px;cursor:pointer;text-align:left}.dropdown-list ul li:first-child{padding-top:10px}.dropdown-list ul li:last-child{padding-bottom:10px}.dropdown-list ::-webkit-scrollbar{width:8px}.dropdown-list ::-webkit-scrollbar-thumb{background:#ccc;border-radius:5px}.dropdown-list ::-webkit-scrollbar-track{background:#f2f2f2}.arrow-down,.arrow-up{width:0;height:0;border-left:13px solid transparent;border-right:13px solid transparent;border-bottom:15px solid #fff;margin-left:15px;position:absolute;top:0}.arrow-down{bottom:-14px;top:unset;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.arrow-2{border-bottom:15px solid #ccc;top:-1px}.arrow-down.arrow-2{top:unset;bottom:-16px}.list-area{border:1px solid #ccc;border-radius:3px;background:#fff;margin:0}.select-all{padding:10px;border-bottom:1px solid #ccc;text-align:left}.list-filter{border-bottom:1px solid #ccc;position:relative;padding-left:35px;height:35px}.list-filter input{border:0;width:100%;height:100%;padding:0}.list-filter input:focus{outline:0}.list-filter .c-search{position:absolute;top:9px;left:10px;width:15px;height:15px}.list-filter .c-search svg{fill:#888}.list-filter .c-clear{position:absolute;top:10px;right:10px;width:15px;height:15px}.list-filter .c-clear svg{fill:#888}.pure-checkbox input[type=checkbox]{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.pure-checkbox input[type=checkbox]:focus+label:before,.pure-checkbox input[type=checkbox]:hover+label:before{background-color:#f2f2f2}.pure-checkbox input[type=checkbox]:active+label:before{transition-duration:0s}.pure-checkbox input[type=checkbox]+label{position:relative;padding-left:2em;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;margin:0;font-weight:300}.pure-checkbox input[type=checkbox]+label:before{box-sizing:content-box;content:'';position:absolute;top:50%;left:0;width:15px;height:15px;margin-top:-9px;text-align:center;transition:all .4s ease;border-radius:3px}.pure-checkbox input[type=checkbox]+label:after{box-sizing:content-box;content:'';position:absolute;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:50%;transform-origin:50%;transition:-webkit-transform .2s ease-out;transition:transform .2s ease-out;transition:transform .2s ease-out,-webkit-transform .2s ease-out;background-color:transparent;top:50%;left:3px;width:9px;height:4px;margin-top:-5px;border-style:solid;border-width:0 0 2px 2px;-o-border-image:none;border-image:none;-webkit-transform:rotate(-45deg) scale(0);transform:rotate(-45deg) scale(0)}.pure-checkbox input[type=checkbox]:disabled+label:before{border-color:#ccc}.pure-checkbox input[type=checkbox]:disabled:focus+label:before .pure-checkbox input[type=checkbox]:disabled:hover+label:before{background-color:inherit}.pure-checkbox input[type=checkbox]:disabled:checked+label:before{background-color:#ccc}.pure-checkbox input[type=radio]:checked+label:before{background-color:#fff}.pure-checkbox input[type=radio]:checked+label:after{-webkit-transform:scale(1);transform:scale(1)}.pure-checkbox input[type=radio]+label:before{border-radius:50%}.pure-checkbox input[type=checkbox]:checked+label:after{content:'';transition:-webkit-transform .2s ease-out;transition:transform .2s ease-out;transition:transform .2s ease-out,-webkit-transform .2s ease-out;-webkit-transform:rotate(-45deg) scale(1);transform:rotate(-45deg) scale(1)}.list-message{text-align:center;margin:0;padding:15px 0;font-size:initial}.list-grp{padding:0 15px!important}.list-grp h4{text-transform:capitalize;margin:15px 0 0;font-size:14px;font-weight:700}.list-grp>li{padding-left:15px!important}.grp-item{padding-left:30px!important}.grp-title{padding-bottom:0!important}.grp-title label{margin-bottom:0!important;font-weight:800;text-transform:capitalize}.grp-title:hover{background:0 0!important}.loading-icon{width:20px;position:absolute;right:10px;top:23px;z-index:1}.nodata-label{width:100%;text-align:center;padding:10px 0 0}.btn-container{text-align:center;padding:0 5px 10px}.clear-all{width:8px;position:absolute;top:50%;right:30px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}"]],data:{}});function xs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""]))],null,function(e,t){e(t,1,0,t.component.settings.text)})}function ks(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,[" "," "]))],null,function(e,t){e(t,1,0,t.context.$implicit[t.component.settings.labelKey])})}function As(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"span",[],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,ks)),l["\u0275did"](2,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"],ngForTrackBy:[1,"ngForTrackBy"]},null)],function(e,t){var n=t.component;e(t,2,0,n.selectedItems,n.trackByFn.bind(n))},null)}function Ts(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"span",[["class","c-label"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""]))],null,function(e,t){e(t,1,0,t.parent.context.$implicit[t.component.settings.labelKey])})}function Rs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"span",[["class","c-label"]],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,1,"c-templateRenderer",[],null,null,null,gs,fs)),l["\u0275did"](2,245760,null,0,Ko,[l.ViewContainerRef],{data:[0,"data"],item:[1,"item"]},null)],function(e,t){e(t,2,0,t.component.badgeTempl,t.parent.context.$implicit)},null)}function Os(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,7,"div",[["class","c-token"]],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,Ts)),l["\u0275did"](2,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Rs)),l["\u0275did"](4,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](5,0,null,null,2,"span",[["class","c-remove"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(e.component.onItemClick(e.context.$implicit,e.context.index,n),l=!1!==n.stopPropagation()&&l),l},null,null)),(e()(),l["\u0275eld"](6,0,null,null,1,"c-icon",[],null,null,null,Ss,ms)),l["\u0275did"](7,49152,null,0,Zo,[],{name:[0,"name"]},null)],function(e,t){var n=t.component;e(t,2,0,!n.badgeTempl),e(t,4,0,n.badgeTempl),e(t,7,0,"remove")},null)}function Ns(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"span",[["class","c-list"]],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,Os)),l["\u0275did"](2,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"],ngForTrackBy:[1,"ngForTrackBy"]},null)],function(e,t){var n=t.component;e(t,2,0,n.selectedItems,n.trackByFn.bind(n))},null)}function Ps(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"span",[["class","c-label"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""]))],null,function(e,t){e(t,1,0,t.parent.context.$implicit[t.component.settings.labelKey])})}function Ms(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"span",[["class","c-label"]],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,1,"c-templateRenderer",[],null,null,null,gs,fs)),l["\u0275did"](2,245760,null,0,Ko,[l.ViewContainerRef],{data:[0,"data"],item:[1,"item"]},null)],function(e,t){e(t,2,0,t.component.badgeTempl,t.parent.context.$implicit)},null)}function Ls(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,7,"div",[["class","c-token"]],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,Ps)),l["\u0275did"](2,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Ms)),l["\u0275did"](4,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](5,0,null,null,2,"span",[["class","c-remove"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(e.component.onItemClick(e.context.$implicit,e.context.index,n),l=!1!==n.stopPropagation()&&l),l},null,null)),(e()(),l["\u0275eld"](6,0,null,null,1,"c-icon",[],null,null,null,Ss,ms)),l["\u0275did"](7,49152,null,0,Zo,[],{name:[0,"name"]},null)],function(e,t){var n=t.component;e(t,2,0,!n.badgeTempl),e(t,4,0,n.badgeTempl),e(t,7,0,"remove")},function(e,t){e(t,0,0,t.context.index>t.component.settings.badgeShowLimit-1)})}function Fs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"div",[["class","c-list"]],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,Ls)),l["\u0275did"](2,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"],ngForTrackBy:[1,"ngForTrackBy"]},null)],function(e,t){var n=t.component;e(t,2,0,n.selectedItems,n.trackByFn.bind(n))},null)}function Vs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"span",[["class","countplaceholder"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["+",""]))],null,function(e,t){var n=t.component;e(t,1,0,(null==n.selectedItems?null:n.selectedItems.length)-n.settings.badgeShowLimit)})}function Bs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"span",[["class","c-remove clear-all"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(e.component.clearSelection(n),l=!1!==n.stopPropagation()&&l),l},null,null)),(e()(),l["\u0275eld"](1,0,null,null,1,"c-icon",[],null,null,null,Ss,ms)),l["\u0275did"](2,49152,null,0,Zo,[],{name:[0,"name"]},null)],function(e,t){e(t,2,0,"remove")},null)}function js(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"span",[["class","c-angle-down"]],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,1,"c-icon",[],null,null,null,Ss,ms)),l["\u0275did"](2,49152,null,0,Zo,[],{name:[0,"name"]},null)],function(e,t){e(t,2,0,"angle-down")},null)}function Hs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"span",[["class","c-angle-up"]],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,1,"c-icon",[],null,null,null,Ss,ms)),l["\u0275did"](2,49152,null,0,Zo,[],{name:[0,"name"]},null)],function(e,t){e(t,2,0,"angle-up")},null)}function Us(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.isSelectAll,n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length))})}function zs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,7,"div",[["class","pure-checkbox select-all"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.toggleSelectAll()&&l),l},null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,Us)),l["\u0275did"](2,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](3,0,null,null,4,"label",[],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,1,"span",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](5,null,["",""])),(e()(),l["\u0275eld"](6,0,null,null,1,"span",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](7,null,["",""]))],function(e,t){e(t,2,0,t.component.settings.showCheckbox)},function(e,t){var n=t.component;e(t,4,0,n.isSelectAll),e(t,5,0,n.settings.selectAllText),e(t,6,0,!n.isSelectAll),e(t,7,0,n.settings.unSelectAllText)})}function $s(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"img",[["class","loading-icon"],["src","assets/img/loading.gif"]],null,null,null,null,null))],null,null)}function qs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"span",[["class","c-clear"]],[[8,"hidden",0]],[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.clearSearch()&&l),l},null,null)),(e()(),l["\u0275eld"](1,0,null,null,1,"c-icon",[],null,null,null,Ss,ms)),l["\u0275did"](2,49152,null,0,Zo,[],{name:[0,"name"]},null)],function(e,t){e(t,2,0,"clear")},function(e,t){var n=t.component;e(t,0,0,null==n.filter||0==(null==n.filter?null:n.filter.length))})}function Ws(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"span",[["class","c-clear"]],[[8,"hidden",0]],[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.resetInfiniteSearch()&&l),l},null,null)),(e()(),l["\u0275eld"](1,0,null,null,1,"c-icon",[],null,null,null,Ss,ms)),l["\u0275did"](2,49152,null,0,Zo,[],{name:[0,"name"]},null)],function(e,t){e(t,2,0,"clear")},function(e,t){var n=t.component;e(t,0,0,null==n.filter||0==(null==n.filter?null:n.filter.length))})}function Gs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,[[1,0],["searchInput",1]],null,5,"input",[["class","c-input"],["type","text"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"keyup"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==l["\u0275nov"](e,1)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,1).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,1)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,1)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.filter=n)&&r),"keyup"===t&&(r=!1!==i.filterGroupedList()&&r),r},null,null)),l["\u0275did"](1,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](3,671744,null,0,ko,[[8,null],[8,null],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](5,16384,null,0,Pi,[[4,Oi]],null,null)],function(e,t){e(t,3,0,t.component.filter)},function(e,t){e(t,0,0,t.component.settings.searchPlaceholderText,l["\u0275nov"](t,5).ngClassUntouched,l["\u0275nov"](t,5).ngClassTouched,l["\u0275nov"](t,5).ngClassPristine,l["\u0275nov"](t,5).ngClassDirty,l["\u0275nov"](t,5).ngClassValid,l["\u0275nov"](t,5).ngClassInvalid,l["\u0275nov"](t,5).ngClassPending)})}function Ks(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,[[1,0],["searchInput",1]],null,5,"input",[["class","c-input"],["type","text"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==l["\u0275nov"](e,1)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,1).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,1)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,1)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.filter=n)&&r),r},null,null)),l["\u0275did"](1,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](3,671744,null,0,ko,[[8,null],[8,null],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](5,16384,null,0,Pi,[[4,Oi]],null,null)],function(e,t){e(t,3,0,t.component.filter)},function(e,t){e(t,0,0,t.component.settings.searchPlaceholderText,l["\u0275nov"](t,5).ngClassUntouched,l["\u0275nov"](t,5).ngClassTouched,l["\u0275nov"](t,5).ngClassPristine,l["\u0275nov"](t,5).ngClassDirty,l["\u0275nov"](t,5).ngClassValid,l["\u0275nov"](t,5).ngClassInvalid,l["\u0275nov"](t,5).ngClassPending)})}function Zs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,[[1,0],["searchInput",1]],null,5,"input",[["class","c-input"],["type","text"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"keyup"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==l["\u0275nov"](e,1)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,1).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,1)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,1)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.filter=n)&&r),"keyup"===t&&(r=!1!==i.searchTerm$.next(n.target.value)&&r),r},null,null)),l["\u0275did"](1,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](3,671744,null,0,ko,[[8,null],[8,null],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](5,16384,null,0,Pi,[[4,Oi]],null,null)],function(e,t){e(t,3,0,t.component.filter)},function(e,t){e(t,0,0,t.component.settings.searchPlaceholderText,l["\u0275nov"](t,5).ngClassUntouched,l["\u0275nov"](t,5).ngClassTouched,l["\u0275nov"](t,5).ngClassPristine,l["\u0275nov"](t,5).ngClassDirty,l["\u0275nov"](t,5).ngClassValid,l["\u0275nov"](t,5).ngClassInvalid,l["\u0275nov"](t,5).ngClassPending)})}function Qs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,16777216,null,null,1,"c-templateRenderer",[],null,null,null,gs,fs)),l["\u0275did"](1,245760,null,0,Ko,[l.ViewContainerRef],{data:[0,"data"],item:[1,"item"]},null),(e()(),l["\u0275and"](0,null,null,0))],function(e,t){var n=t.component;e(t,1,0,n.searchTempl,n.item)},null)}function Ys(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,15,"div",[["class","list-filter"]],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,2,"span",[["class","c-search"]],null,null,null,null,null)),(e()(),l["\u0275eld"](2,0,null,null,1,"c-icon",[],null,null,null,Ss,ms)),l["\u0275did"](3,49152,null,0,Zo,[],{name:[0,"name"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,qs)),l["\u0275did"](5,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Ws)),l["\u0275did"](7,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Gs)),l["\u0275did"](9,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Ks)),l["\u0275did"](11,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Zs)),l["\u0275did"](13,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Qs)),l["\u0275did"](15,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,3,0,"search"),e(t,5,0,!n.settings.lazyLoading),e(t,7,0,n.settings.lazyLoading),e(t,9,0,n.settings.groupBy&&!n.settings.lazyLoading&&!n.searchTempl),e(t,11,0,!n.settings.groupBy&&!n.settings.lazyLoading&&!n.searchTempl),e(t,13,0,n.settings.lazyLoading&&!n.searchTempl),e(t,15,0,n.searchTempl)},null)}function Js(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,6,"div",[["class","pure-checkbox select-all"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.toggleFilterSelectAll()&&l),l},null,null)),(e()(),l["\u0275eld"](1,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null)),(e()(),l["\u0275eld"](2,0,null,null,4,"label",[],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,1,"span",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](4,null,["",""])),(e()(),l["\u0275eld"](5,0,null,null,1,"span",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](6,null,["",""]))],null,function(e,t){var n=t.component;e(t,1,0,n.isFilterSelectAll,n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)),e(t,3,0,n.isFilterSelectAll),e(t,4,0,n.settings.filterSelectAllText),e(t,5,0,!n.isFilterSelectAll),e(t,6,0,n.settings.filterUnSelectAllText)})}function Xs(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,6,"div",[["class","pure-checkbox select-all"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.toggleFilterSelectAll()&&l),l},null,null)),(e()(),l["\u0275eld"](1,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null)),(e()(),l["\u0275eld"](2,0,null,null,4,"label",[],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,1,"span",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](4,null,["",""])),(e()(),l["\u0275eld"](5,0,null,null,1,"span",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](6,null,["",""]))],null,function(e,t){var n=t.component;e(t,1,0,n.isFilterSelectAll&&(null==n.filter?null:n.filter.length)>0,n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)),e(t,3,0,n.isFilterSelectAll),e(t,4,0,n.settings.filterSelectAllText),e(t,5,0,!n.isFilterSelectAll),e(t,6,0,n.settings.filterUnSelectAllText)})}function ea(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"label",[["class","nodata-label"]],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""]))],null,function(e,t){var n=t.component;e(t,0,0,null==n.filter||0==(null==n.filter?null:n.filter.length)),e(t,1,0,n.settings.noDataLabel)})}function ta(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"label",[["class","nodata-label"]],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""]))],null,function(e,t){var n=t.component;e(t,0,0,null==n.filter||0==(null==n.filter?null:n.filter.length)),e(t,1,0,n.settings.noDataLabel)})}function na(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"div",[["class","btn-container"]],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,1,"button",[["class","c-btn btn-iceblue"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.addFilterNewItem()&&l),l},null,null)),(e()(),l["\u0275ted"](2,null,["",""]))],null,function(e,t){var n=t.component;e(t,0,0,null==n.filter||0==(null==n.filter?null:n.filter.length)),e(t,2,0,n.settings.addNewButtonText)})}function la(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,10,"div",[["class","filter-select-all"]],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,Js)),l["\u0275did"](2,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Xs)),l["\u0275did"](4,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,ea)),l["\u0275did"](6,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,ta)),l["\u0275did"](8,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,na)),l["\u0275did"](10,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,2,0,!n.settings.groupBy&&(null==n.filter?null:n.filter.length)>0&&n.filterLength>0),e(t,4,0,n.settings.groupBy&&(null==n.filter?null:n.filter.length)>0&&(null==n.groupedData?null:n.groupedData.length)>0),e(t,6,0,!n.settings.groupBy&&0==n.filterLength),e(t,8,0,n.settings.groupBy&&0==(null==n.groupedData?null:n.groupedData.length)),e(t,10,0,n.settings.addNewItemOnFilter&&0==n.filterLength)},null)}function ra(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,6,"div",[["class","pure-checkbox select-all"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.toggleInfiniteFilterSelectAll()&&l),l},null,null)),(e()(),l["\u0275eld"](1,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null)),(e()(),l["\u0275eld"](2,0,null,null,4,"label",[],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,1,"span",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](4,null,["",""])),(e()(),l["\u0275eld"](5,0,null,null,1,"span",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](6,null,["",""]))],null,function(e,t){var n=t.component;e(t,1,0,n.isInfiniteFilterSelectAll,n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)),e(t,3,0,n.isInfiniteFilterSelectAll),e(t,4,0,n.settings.filterSelectAllText),e(t,5,0,!n.isInfiniteFilterSelectAll),e(t,6,0,n.settings.filterUnSelectAllText)})}function ia(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,2,"div",[["class","filter-select-all"]],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,ra)),l["\u0275did"](2,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,2,0,(null==n.filter?null:n.filter.length)>0&&n.infiniteFilterLength>0)},null)}function oa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.isSelected(t.parent.context.$implicit),n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)&&!n.isSelected(t.parent.context.$implicit))})}function sa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,7,"li",[["class","pure-checkbox"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.onItemClick(e.context.$implicit,e.context.index,n)&&l),l},null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](3,{"selected-item":0}),(e()(),l["\u0275and"](16777216,null,null,1,null,oa)),l["\u0275did"](5,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](6,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](7,null,["",""]))],function(e,t){var n=t.component,l=e(t,3,0,1==n.isSelected(t.context.$implicit));e(t,2,0,"pure-checkbox",l),e(t,5,0,n.settings.showCheckbox)},function(e,t){e(t,7,0,t.context.$implicit[t.component.settings.labelKey])})}function aa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,4,"div",[["style","overflow: auto;"]],[[4,"maxHeight",null]],null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,3,"ul",[["class","lazyContainer"]],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,2,null,sa)),l["\u0275did"](3,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),l["\u0275ppd"](4,3)],function(e,t){var n=t.component,r=l["\u0275unv"](t,3,0,e(t,4,0,l["\u0275nov"](t.parent,0),n.data,n.filter,n.settings.searchBy));e(t,3,0,r)},function(e,t){e(t,0,0,t.component.settings.maxHeight+"px")})}function ua(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.isSelected(t.parent.context.$implicit),n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)&&!n.isSelected(t.parent.context.$implicit))})}function ca(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,7,"li",[["class","pure-checkbox"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.onItemClick(e.context.$implicit,e.context.index,n)&&l),l},null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](3,{"selected-item":0}),(e()(),l["\u0275and"](16777216,null,null,1,null,ua)),l["\u0275did"](5,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](6,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](7,null,["",""]))],function(e,t){var n=t.component,l=e(t,3,0,1==n.isSelected(t.context.$implicit));e(t,2,0,"pure-checkbox",l),e(t,5,0,n.settings.showCheckbox)},function(e,t){e(t,7,0,t.context.$implicit[t.component.settings.labelKey])})}function da(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,9,"div",[["style","overflow: auto;"]],[[4,"maxHeight",null]],null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,8,"ul",[["class","lazyContainer"],["virtualScroller",""]],[[2,"horizontal",null],[2,"vertical",null],[2,"selfScroll",null]],[[null,"vsStart"],[null,"vsEnd"]],function(e,t,n){var l=!0,r=e.component;return"vsStart"===t&&(l=!1!==r.onScrollEnd(n)&&l),"vsEnd"===t&&(l=!1!==r.onScrollEnd(n)&&l),l},Is,_s)),l["\u0275prd"](512,null,Y["\u0275NgStyleImpl"],Y["\u0275NgStyleR2Impl"],[l.ElementRef,l.KeyValueDiffers,l.Renderer2]),l["\u0275did"](3,278528,null,0,Y.NgStyle,[Y["\u0275NgStyleImpl"]],{ngStyle:[0,"ngStyle"]},null),l["\u0275pod"](4,{height:0}),l["\u0275did"](5,1032192,[[4,4],["scroll",4]],2,Jo,[l.ElementRef,l.Renderer2,l.NgZone,l.ChangeDetectorRef,l.PLATFORM_ID,[2,"virtual-scroller-default-options"]],{enableUnequalChildrenSizes:[0,"enableUnequalChildrenSizes"],items:[1,"items"]},{vsStart:"vsStart",vsEnd:"vsEnd"}),l["\u0275qud"](603979776,5,{headerElementRef:0}),l["\u0275qud"](603979776,6,{containerElementRef:0}),(e()(),l["\u0275and"](16777216,null,0,1,null,ca)),l["\u0275did"](9,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null)],function(e,t){var n=t.component,r=e(t,4,0,n.settings.maxHeight+"px");e(t,3,0,r),e(t,5,0,n.randomSize,n.virtualdata),e(t,9,0,l["\u0275nov"](t,5).viewPortItems)},function(e,t){e(t,0,0,t.component.settings.maxHeight+"px"),e(t,1,0,l["\u0275nov"](t,5).horizontal,!l["\u0275nov"](t,5).horizontal,!l["\u0275nov"](t,5).parentScroll)})}function ha(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.isSelected(t.parent.context.$implicit),n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)&&!n.isSelected(t.parent.context.$implicit))})}function pa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,8,"li",[["class","pure-checkbox"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.onItemClick(e.context.$implicit,e.context.index,n)&&l),l},null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](3,{"selected-item":0}),(e()(),l["\u0275and"](16777216,null,null,1,null,ha)),l["\u0275did"](5,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](6,0,null,null,0,"label",[],null,null,null,null,null)),(e()(),l["\u0275eld"](7,16777216,null,null,1,"c-templateRenderer",[],null,null,null,gs,fs)),l["\u0275did"](8,245760,null,0,Ko,[l.ViewContainerRef],{data:[0,"data"],item:[1,"item"]},null)],function(e,t){var n=t.component,l=e(t,3,0,1==n.isSelected(t.context.$implicit));e(t,2,0,"pure-checkbox",l),e(t,5,0,n.settings.showCheckbox),e(t,8,0,n.itemTempl,t.context.$implicit)},null)}function fa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,4,"div",[["style","overflow: auto;"]],[[4,"maxHeight",null]],null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,3,"ul",[["class","lazyContainer"]],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,2,null,pa)),l["\u0275did"](3,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),l["\u0275ppd"](4,3)],function(e,t){var n=t.component,r=l["\u0275unv"](t,3,0,e(t,4,0,l["\u0275nov"](t.parent,0),n.data,n.filter,n.settings.searchBy));e(t,3,0,r)},function(e,t){e(t,0,0,t.component.settings.maxHeight+"px")})}function ga(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.isSelected(t.parent.context.$implicit),n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)&&!n.isSelected(t.parent.context.$implicit))})}function ma(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,8,"li",[["class","pure-checkbox"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.onItemClick(e.context.$implicit,e.context.index,n)&&l),l},null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](3,{"selected-item":0}),(e()(),l["\u0275and"](16777216,null,null,1,null,ga)),l["\u0275did"](5,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](6,0,null,null,0,"label",[],null,null,null,null,null)),(e()(),l["\u0275eld"](7,16777216,null,null,1,"c-templateRenderer",[],null,null,null,gs,fs)),l["\u0275did"](8,245760,null,0,Ko,[l.ViewContainerRef],{data:[0,"data"],item:[1,"item"]},null)],function(e,t){var n=t.component,l=e(t,3,0,1==n.isSelected(t.context.$implicit));e(t,2,0,"pure-checkbox",l),e(t,5,0,n.settings.showCheckbox),e(t,8,0,n.itemTempl,t.context.$implicit)},null)}function va(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,9,"div",[["style","overflow: auto;"]],[[4,"maxHeight",null]],null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,8,"ul",[["class","lazyContainer"],["virtualScroller",""]],[[2,"horizontal",null],[2,"vertical",null],[2,"selfScroll",null]],[[null,"vsStart"],[null,"vsEnd"]],function(e,t,n){var l=!0,r=e.component;return"vsStart"===t&&(l=!1!==r.onScrollEnd(n)&&l),"vsEnd"===t&&(l=!1!==r.onScrollEnd(n)&&l),l},Is,_s)),l["\u0275prd"](512,null,Y["\u0275NgStyleImpl"],Y["\u0275NgStyleR2Impl"],[l.ElementRef,l.KeyValueDiffers,l.Renderer2]),l["\u0275did"](3,278528,null,0,Y.NgStyle,[Y["\u0275NgStyleImpl"]],{ngStyle:[0,"ngStyle"]},null),l["\u0275pod"](4,{height:0}),l["\u0275did"](5,1032192,[[4,4],["scroll2",4]],2,Jo,[l.ElementRef,l.Renderer2,l.NgZone,l.ChangeDetectorRef,l.PLATFORM_ID,[2,"virtual-scroller-default-options"]],{enableUnequalChildrenSizes:[0,"enableUnequalChildrenSizes"],items:[1,"items"]},{vsStart:"vsStart",vsEnd:"vsEnd"}),l["\u0275qud"](603979776,7,{headerElementRef:0}),l["\u0275qud"](603979776,8,{containerElementRef:0}),(e()(),l["\u0275and"](16777216,null,0,1,null,ma)),l["\u0275did"](9,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null)],function(e,t){var n=t.component,r=e(t,4,0,n.settings.maxHeight+"px");e(t,3,0,r),e(t,5,0,n.randomSize,n.virtualdata),e(t,9,0,l["\u0275nov"](t,5).viewPortItems)},function(e,t){e(t,0,0,t.component.settings.maxHeight+"px"),e(t,1,0,l["\u0275nov"](t,5).horizontal,!l["\u0275nov"](t,5).horizontal,!l["\u0275nov"](t,5).parentScroll)})}function ya(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.isSelected(t.parent.parent.context.$implicit),n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)&&!n.isSelected(t.parent.parent.context.$implicit))})}function ba(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,8,"li",[["class","pure-checkbox"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.onItemClick(e.parent.context.$implicit,e.parent.context.index,n)&&l),l},null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](3,{"grp-title":0,"grp-item":1}),(e()(),l["\u0275and"](16777216,null,null,1,null,ya)),l["\u0275did"](5,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](6,0,null,null,0,"label",[],null,null,null,null,null)),(e()(),l["\u0275eld"](7,16777216,null,null,1,"c-templateRenderer",[],null,null,null,gs,fs)),l["\u0275did"](8,245760,null,0,Ko,[l.ViewContainerRef],{data:[0,"data"],item:[1,"item"]},null)],function(e,t){var n=t.component,l=e(t,3,0,t.parent.context.$implicit.grpTitle,!t.parent.context.$implicit.grpTitle&&!n.settings.singleSelection);e(t,2,0,"pure-checkbox",l),e(t,5,0,n.settings.showCheckbox&&!n.settings.singleSelection),e(t,8,0,n.itemTempl,t.parent.context.$implicit)},null)}function Ca(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.isSelected(t.parent.parent.context.$implicit),n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)&&!n.isSelected(t.parent.parent.context.$implicit))})}function wa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,8,"li",[["class","pure-checkbox"]],null,null,null,null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](3,{"grp-title":0,"grp-item":1}),(e()(),l["\u0275and"](16777216,null,null,1,null,Ca)),l["\u0275did"](5,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](6,0,null,null,0,"label",[],null,null,null,null,null)),(e()(),l["\u0275eld"](7,16777216,null,null,1,"c-templateRenderer",[],null,null,null,gs,fs)),l["\u0275did"](8,245760,null,0,Ko,[l.ViewContainerRef],{data:[0,"data"],item:[1,"item"]},null)],function(e,t){var n=t.component,l=e(t,3,0,t.parent.context.$implicit.grpTitle,!t.parent.context.$implicit.grpTitle&&!n.settings.singleSelection);e(t,2,0,"pure-checkbox",l),e(t,5,0,n.settings.showCheckbox),e(t,8,0,n.itemTempl,t.parent.context.$implicit)},null)}function Sa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,4,"span",[],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,ba)),l["\u0275did"](2,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,wa)),l["\u0275did"](4,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){e(t,2,0,!t.context.$implicit.grpTitle),e(t,4,0,t.context.$implicit.grpTitle)},null)}function _a(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,9,"div",[["style","overflow: auto;"]],[[4,"maxHeight",null]],null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,8,"ul",[["class","lazyContainer"],["virtualScroller",""]],[[2,"horizontal",null],[2,"vertical",null],[2,"selfScroll",null]],[[null,"vsStart"],[null,"vsEnd"]],function(e,t,n){var l=!0,r=e.component;return"vsStart"===t&&(l=!1!==r.onScrollEnd(n)&&l),"vsEnd"===t&&(l=!1!==r.onScrollEnd(n)&&l),l},Is,_s)),l["\u0275prd"](512,null,Y["\u0275NgStyleImpl"],Y["\u0275NgStyleR2Impl"],[l.ElementRef,l.KeyValueDiffers,l.Renderer2]),l["\u0275did"](3,278528,null,0,Y.NgStyle,[Y["\u0275NgStyleImpl"]],{ngStyle:[0,"ngStyle"]},null),l["\u0275pod"](4,{height:0}),l["\u0275did"](5,1032192,[[4,4],["scroll3",4]],2,Jo,[l.ElementRef,l.Renderer2,l.NgZone,l.ChangeDetectorRef,l.PLATFORM_ID,[2,"virtual-scroller-default-options"]],{enableUnequalChildrenSizes:[0,"enableUnequalChildrenSizes"],items:[1,"items"]},{vsStart:"vsStart",vsEnd:"vsEnd"}),l["\u0275qud"](603979776,9,{headerElementRef:0}),l["\u0275qud"](603979776,10,{containerElementRef:0}),(e()(),l["\u0275and"](16777216,null,0,1,null,Sa)),l["\u0275did"](9,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null)],function(e,t){var n=t.component,r=e(t,4,0,n.settings.maxHeight+"px");e(t,3,0,r),e(t,5,0,n.randomSize,n.virtualdata),e(t,9,0,l["\u0275nov"](t,5).viewPortItems)},function(e,t){e(t,0,0,t.component.settings.maxHeight+"px"),e(t,1,0,l["\u0275nov"](t,5).horizontal,!l["\u0275nov"](t,5).horizontal,!l["\u0275nov"](t,5).parentScroll)})}function Ia(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,t.parent.context.$implicit.selected,n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)&&!n.isSelected(t.parent.context.$implicit))})}function Ea(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.isSelected(t.parent.context.$implicit),n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)&&!n.isSelected(t.parent.context.$implicit))})}function Da(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,9,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,8,"li",[["class","pure-checkbox"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(e.component.onItemClick(e.context.$implicit,e.context.index,n),l=!1!==n.stopPropagation()&&l),l},null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](3,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](4,{"grp-title":0,"grp-item":1}),(e()(),l["\u0275and"](16777216,null,null,1,null,Ea)),l["\u0275did"](6,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](7,0,null,null,0,"label",[],null,null,null,null,null)),(e()(),l["\u0275eld"](8,16777216,null,null,1,"c-templateRenderer",[],null,null,null,gs,fs)),l["\u0275did"](9,245760,null,0,Ko,[l.ViewContainerRef],{data:[0,"data"],item:[1,"item"]},null)],function(e,t){var n=t.component,l=e(t,4,0,t.context.$implicit.grpTitle,!t.context.$implicit.grpTitle&&!n.settings.singleSelection);e(t,3,0,"pure-checkbox",l),e(t,6,0,n.settings.showCheckbox),e(t,9,0,n.itemTempl,t.context.$implicit)},null)}function xa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,11,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,10,"li",[["class","pure-checkbox"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.selectGroup(e.context.$implicit)&&l),l},null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](3,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](4,{"grp-title":0,"grp-item":1}),(e()(),l["\u0275and"](16777216,null,null,1,null,Ia)),l["\u0275did"](6,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](7,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](8,null,["",""])),(e()(),l["\u0275eld"](9,0,null,null,2,"ul",[["class","lazyContainer"]],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,Da)),l["\u0275did"](11,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null)],function(e,t){var n=t.component,l=e(t,4,0,t.context.$implicit.grpTitle,!t.context.$implicit.grpTitle&&!n.settings.singleSelection);e(t,3,0,"pure-checkbox",l),e(t,6,0,n.settings.showCheckbox&&!n.settings.singleSelection),e(t,11,0,t.context.$implicit.list)},function(e,t){e(t,8,0,t.context.$implicit[t.component.settings.labelKey])})}function ka(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,3,"div",[["style","overflow: auto;"]],[[4,"maxHeight",null]],null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,2,"ul",[["class","lazyContainer"]],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,xa)),l["\u0275did"](3,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,3,0,t.component.groupedData)},function(e,t){e(t,0,0,t.component.settings.maxHeight+"px")})}function Aa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.isSelected(t.parent.parent.context.$implicit),n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)&&!n.isSelected(t.parent.parent.context.$implicit))})}function Ta(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,7,"li",[["class","pure-checkbox"]],null,null,null,null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](3,{"grp-title":0,"grp-item":1,"selected-item":2}),(e()(),l["\u0275and"](16777216,null,null,1,null,Aa)),l["\u0275did"](5,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](6,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](7,null,["",""]))],function(e,t){var n=t.component,l=e(t,3,0,t.parent.context.$implicit.grpTitle,!t.parent.context.$implicit.grpTitle&&!n.settings.singleSelection,1==n.isSelected(t.parent.context.$implicit));e(t,2,0,"pure-checkbox",l),e(t,5,0,n.settings.showCheckbox&&!t.parent.context.$implicit.grpTitle&&!n.settings.singleSelection)},function(e,t){e(t,7,0,t.parent.context.$implicit[t.component.settings.labelKey])})}function Ra(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.isSelected(t.parent.parent.context.$implicit),n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)&&!n.isSelected(t.parent.parent.context.$implicit))})}function Oa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,7,"li",[["class","pure-checkbox"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.onItemClick(e.parent.context.$implicit,e.parent.context.index,n)&&l),l},null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](2,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](3,{"grp-title":0,"grp-item":1,"selected-item":2}),(e()(),l["\u0275and"](16777216,null,null,1,null,Ra)),l["\u0275did"](5,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](6,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](7,null,["",""]))],function(e,t){var n=t.component,l=e(t,3,0,t.parent.context.$implicit.grpTitle,!t.parent.context.$implicit.grpTitle&&!n.settings.singleSelection,1==n.isSelected(t.parent.context.$implicit));e(t,2,0,"pure-checkbox",l),e(t,5,0,n.settings.showCheckbox&&!t.parent.context.$implicit.grpTitle)},function(e,t){e(t,7,0,t.parent.context.$implicit[t.component.settings.labelKey])})}function Na(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,4,"span",[],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,Ta)),l["\u0275did"](2,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Oa)),l["\u0275did"](4,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){e(t,2,0,t.context.$implicit.grpTitle),e(t,4,0,!t.context.$implicit.grpTitle)},null)}function Pa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,16,"div",[["style","overflow: auto;"]],[[4,"maxHeight",null]],null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,15,"virtual-scroller",[],[[2,"horizontal",null],[2,"vertical",null],[2,"selfScroll",null]],[[null,"vsUpdate"],[null,"vsEnd"]],function(e,t,n){var l=!0,r=e.component;return"vsUpdate"===t&&(l=!1!==(r.viewPortItems=n)&&l),"vsEnd"===t&&(l=!1!==r.onScrollEnd(n)&&l),l},Is,_s)),l["\u0275prd"](512,null,Y["\u0275NgStyleImpl"],Y["\u0275NgStyleR2Impl"],[l.ElementRef,l.KeyValueDiffers,l.Renderer2]),l["\u0275did"](3,278528,null,0,Y.NgStyle,[Y["\u0275NgStyleImpl"]],{ngStyle:[0,"ngStyle"]},null),l["\u0275pod"](4,{height:0}),l["\u0275did"](5,1032192,[[4,4]],2,Jo,[l.ElementRef,l.Renderer2,l.NgZone,l.ChangeDetectorRef,l.PLATFORM_ID,[2,"virtual-scroller-default-options"]],{items:[0,"items"]},{vsUpdate:"vsUpdate",vsEnd:"vsEnd"}),l["\u0275qud"](603979776,11,{headerElementRef:0}),l["\u0275qud"](603979776,12,{containerElementRef:0}),(e()(),l["\u0275eld"](8,0,null,0,8,"ul",[["class","lazyContainer"],["virtualScroller",""]],[[2,"horizontal",null],[2,"vertical",null],[2,"selfScroll",null]],[[null,"vsStart"],[null,"vsEnd"]],function(e,t,n){var l=!0,r=e.component;return"vsStart"===t&&(l=!1!==r.onScrollEnd(n)&&l),"vsEnd"===t&&(l=!1!==r.onScrollEnd(n)&&l),l},Is,_s)),l["\u0275prd"](512,null,Y["\u0275NgStyleImpl"],Y["\u0275NgStyleR2Impl"],[l.ElementRef,l.KeyValueDiffers,l.Renderer2]),l["\u0275did"](10,278528,null,0,Y.NgStyle,[Y["\u0275NgStyleImpl"]],{ngStyle:[0,"ngStyle"]},null),l["\u0275pod"](11,{height:0}),l["\u0275did"](12,1032192,[[4,4],["scroll4",4]],2,Jo,[l.ElementRef,l.Renderer2,l.NgZone,l.ChangeDetectorRef,l.PLATFORM_ID,[2,"virtual-scroller-default-options"]],{enableUnequalChildrenSizes:[0,"enableUnequalChildrenSizes"],items:[1,"items"]},{vsStart:"vsStart",vsEnd:"vsEnd"}),l["\u0275qud"](603979776,13,{headerElementRef:0}),l["\u0275qud"](603979776,14,{containerElementRef:0}),(e()(),l["\u0275and"](16777216,null,0,1,null,Na)),l["\u0275did"](16,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null)],function(e,t){var n=t.component,r=e(t,4,0,n.settings.maxHeight+"px");e(t,3,0,r),e(t,5,0,n.groupedData);var i=e(t,11,0,n.settings.maxHeight+"px");e(t,10,0,i),e(t,12,0,n.randomSize,n.virtualdata),e(t,16,0,l["\u0275nov"](t,12).viewPortItems)},function(e,t){e(t,0,0,t.component.settings.maxHeight+"px"),e(t,1,0,l["\u0275nov"](t,5).horizontal,!l["\u0275nov"](t,5).horizontal,!l["\u0275nov"](t,5).parentScroll),e(t,8,0,l["\u0275nov"](t,12).horizontal,!l["\u0275nov"](t,12).horizontal,!l["\u0275nov"](t,12).parentScroll)})}function Ma(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,t.parent.context.$implicit.selected,n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)&&!n.isSelected(t.parent.context.$implicit))})}function La(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["type","checkbox"]],[[8,"checked",0],[8,"disabled",0]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.isSelected(t.parent.context.$implicit),n.settings.limitSelection==(null==n.selectedItems?null:n.selectedItems.length)&&!n.isSelected(t.parent.context.$implicit))})}function Fa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,8,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,7,"li",[["class","pure-checkbox"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(e.component.onItemClick(e.context.$implicit,e.context.index,n),l=!1!==n.stopPropagation()&&l),l},null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](3,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](4,{"selected-item":0,"grp-title":1,"grp-item":2}),(e()(),l["\u0275and"](16777216,null,null,1,null,La)),l["\u0275did"](6,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](7,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](8,null,["",""]))],function(e,t){var n=t.component,l=e(t,4,0,1==n.isSelected(t.context.$implicit),t.context.$implicit.grpTitle,!t.context.$implicit.grpTitle&&!n.settings.singleSelection);e(t,3,0,"pure-checkbox",l),e(t,6,0,n.settings.showCheckbox)},function(e,t){e(t,8,0,t.context.$implicit[t.component.settings.labelKey])})}function Va(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,11,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,10,"li",[["class","pure-checkbox"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.selectGroup(e.context.$implicit)&&l),l},null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](3,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](4,{"grp-title":0,"grp-item":1}),(e()(),l["\u0275and"](16777216,null,null,1,null,Ma)),l["\u0275did"](6,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](7,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](8,null,["",""])),(e()(),l["\u0275eld"](9,0,null,null,2,"ul",[["class","lazyContainer"]],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,Fa)),l["\u0275did"](11,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null)],function(e,t){var n=t.component,l=e(t,4,0,t.context.$implicit.grpTitle,!t.context.$implicit.grpTitle&&!n.settings.singleSelection);e(t,3,0,"pure-checkbox",l),e(t,6,0,n.settings.showCheckbox&&!n.settings.singleSelection),e(t,11,0,t.context.$implicit.list)},function(e,t){e(t,8,0,t.context.$implicit[t.component.settings.labelKey])})}function Ba(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,3,"div",[["style","overflow: auto;"]],[[4,"maxHeight",null]],null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,2,"ul",[["class","lazyContainer"]],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,Va)),l["\u0275did"](3,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,3,0,t.component.groupedData)},function(e,t){e(t,0,0,t.component.settings.maxHeight+"px")})}function ja(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h5",[["class","list-message"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""]))],null,function(e,t){e(t,1,0,t.component.settings.noDataLabel)})}function Ha(e){return l["\u0275vid"](0,[l["\u0275pid"](0,$o,[zo]),l["\u0275qud"](671088640,1,{searchInput:0}),l["\u0275qud"](671088640,2,{selectedListElem:0}),l["\u0275qud"](671088640,3,{dropdownListElem:0}),l["\u0275qud"](671088640,4,{virtualScroller:0}),(e()(),l["\u0275eld"](5,0,null,null,66,"div",[["class","cuppa-dropdown"]],null,[[null,"clickOutside"],["document","click"],["document","touchstart"]],function(e,t,n){var r=!0,i=e.component;return"document:click"===t&&(r=!1!==l["\u0275nov"](e,6).onClick(n,n.target)&&r),"document:touchstart"===t&&(r=!1!==l["\u0275nov"](e,6).onClick(n,n.target)&&r),"clickOutside"===t&&(r=!1!==i.closeDropdownOnClickOut()&&r),r},null,null)),l["\u0275did"](6,16384,null,0,Es,[l.ElementRef],null,{clickOutside:"clickOutside"}),(e()(),l["\u0275eld"](7,0,[[2,0],["selectedList",1]],null,20,"div",[["class","selected-list"]],null,null,null,null,null)),(e()(),l["\u0275eld"](8,0,null,null,19,"div",[["class","c-btn"]],[[1,"tabindex",0]],[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.toggleDropdown(n)&&l),l},null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](10,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](11,{disabled:0}),(e()(),l["\u0275and"](16777216,null,null,1,null,xs)),l["\u0275did"](13,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,As)),l["\u0275did"](15,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Ns)),l["\u0275did"](17,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Fs)),l["\u0275did"](19,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Vs)),l["\u0275did"](21,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Bs)),l["\u0275did"](23,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,js)),l["\u0275did"](25,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Hs)),l["\u0275did"](27,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275eld"](28,0,[[3,0],["dropdownList",1]],null,43,"div",[["class","dropdown-list animated fadeIn"]],[[4,"bottom","px"],[8,"hidden",0]],null,null,null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](30,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](31,{"dropdown-list-top":0}),(e()(),l["\u0275eld"](32,0,null,null,3,"div",[["class","arrow-2"]],null,null,null,null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](34,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](35,{"arrow-up":0,"arrow-down":1}),(e()(),l["\u0275eld"](36,0,null,null,3,"div",[],null,null,null,null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](38,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{ngClass:[0,"ngClass"]},null),l["\u0275pod"](39,{"arrow-up":0,"arrow-down":1}),(e()(),l["\u0275eld"](40,0,null,null,31,"div",[["class","list-area"]],null,null,null,null,null)),l["\u0275prd"](512,null,Y["\u0275NgClassImpl"],Y["\u0275NgClassR2Impl"],[l.IterableDiffers,l.KeyValueDiffers,l.ElementRef,l.Renderer2]),l["\u0275did"](42,278528,null,0,Y.NgClass,[Y["\u0275NgClassImpl"]],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),l["\u0275pod"](43,{"single-select-mode":0}),(e()(),l["\u0275and"](16777216,null,null,1,null,zs)),l["\u0275did"](45,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,$s)),l["\u0275did"](47,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Ys)),l["\u0275did"](49,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,la)),l["\u0275did"](51,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,ia)),l["\u0275did"](53,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,aa)),l["\u0275did"](55,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,da)),l["\u0275did"](57,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,fa)),l["\u0275did"](59,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,va)),l["\u0275did"](61,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,_a)),l["\u0275did"](63,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,ka)),l["\u0275did"](65,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Pa)),l["\u0275did"](67,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,Ba)),l["\u0275did"](69,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,null,1,null,ja)),l["\u0275did"](71,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component,l=e(t,11,0,n.settings.disabled);e(t,10,0,"c-btn",l),e(t,13,0,0==(null==n.selectedItems?null:n.selectedItems.length)),e(t,15,0,n.settings.singleSelection&&!n.badgeTempl),e(t,17,0,(null==n.selectedItems?null:n.selectedItems.length)>0&&n.settings.singleSelection&&n.badgeTempl),e(t,19,0,(null==n.selectedItems?null:n.selectedItems.length)>0&&!n.settings.singleSelection),e(t,21,0,(null==n.selectedItems?null:n.selectedItems.length)>n.settings.badgeShowLimit),e(t,23,0,n.settings.clearAll&&(null==n.selectedItems?null:n.selectedItems.length)>0&&!n.settings.disabled),e(t,25,0,!n.isActive),e(t,27,0,n.isActive);var r=e(t,31,0,n.dropdownListYOffset);e(t,30,0,"dropdown-list animated fadeIn",r);var i=e(t,35,0,!n.dropdownListYOffset,n.dropdownListYOffset);e(t,34,0,"arrow-2",i);var o=e(t,39,0,!n.dropdownListYOffset,n.dropdownListYOffset);e(t,38,0,o);var s=e(t,43,0,n.settings.singleSelection);e(t,42,0,"list-area",s),e(t,45,0,n.settings.enableCheckAll&&!n.settings.singleSelection&&!n.settings.limitSelection&&(null==n.data?null:n.data.length)>0),e(t,47,0,n.loading),e(t,49,0,n.settings.enableSearchFilter),e(t,51,0,!n.settings.lazyLoading&&n.settings.enableFilterSelectAll),e(t,53,0,n.settings.lazyLoading&&n.settings.enableFilterSelectAll),e(t,55,0,!n.settings.groupBy&&!n.settings.lazyLoading&&null==n.itemTempl),e(t,57,0,!n.settings.groupBy&&n.settings.lazyLoading&&null==n.itemTempl),e(t,59,0,!n.settings.groupBy&&!n.settings.lazyLoading&&null!=n.itemTempl),e(t,61,0,!n.settings.groupBy&&n.settings.lazyLoading&&null!=n.itemTempl),e(t,63,0,n.settings.groupBy&&n.settings.lazyLoading&&null!=n.itemTempl),e(t,65,0,n.settings.groupBy&&!n.settings.lazyLoading&&null!=n.itemTempl),e(t,67,0,n.settings.groupBy&&n.settings.lazyLoading&&null==n.itemTempl),e(t,69,0,n.settings.groupBy&&!n.settings.lazyLoading&&null==n.itemTempl),e(t,71,0,0==(null==n.data?null:n.data.length))},function(e,t){var n=t.component;e(t,8,0,0),e(t,28,0,n.dropdownListYOffset?n.dropdownListYOffset:null,!n.isActive)})}class Ua{constructor(e,t){this.seotitle=e,this.meta=t,this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Basic example",this.tsgist="CuppaLabs/ee72fbc7b21dad7e4e7664c5b1553235",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.tstitle="basic.ts",this.htmltitle="basic.html",this.seotitle.setTitle("Basic example"),this.meta.addTags([{name:"description",content:"Basic example of angular multiselect drodown."}])}ngOnInit(){this.itemList=[{countryId:1,itemName:"India"},{countryId:2,itemName:"Singapore"},{countryId:3,itemName:"Australia"},{countryId:4,itemName:"Canada"},{countryId:5,itemName:"South Korea"},{countryId:6,itemName:"Brazil"}],this.selectedItems=[{countryId:1,itemName:"India"},{countryId:2,itemName:"Singapore"},{countryId:3,itemName:"Australia"},{countryId:4,itemName:"Canada"},{countryId:5,itemName:"South Korea"}],this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class",primaryKey:"countryId",enableSearchFilter:!0}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}}var za=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function $a(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function qa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](15,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](16,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](18,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](19,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](21,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](22,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](23,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](24,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](26,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](27,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,$a)),l["\u0275did"](29,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,19,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,22,0,n.tsgist),e(t,24,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,27,0,n.htmlgist),e(t,29,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function Wa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,qa,za)),l["\u0275did"](1,114688,null,0,Ua,[Yt,Zt],null,null)],function(e,t){e(t,1,0)},null)}var Ga=l["\u0275ccf"]("ng-component",Ua,Wa,{},{},[]);class Ka{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Single Selection",this.tsgist="CuppaLabs/6ef578ce507dfd548eec39e008b4de14",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.tstitle="singleSelection.ts",this.htmltitle="singleSelection.html"}ngOnInit(){this.itemList=[{id:1,itemName:"India",name:"IN"},{id:2,itemName:"Singapore",name:"SN"},{id:3,itemName:"Australia",name:"AU"},{id:4,itemName:"Canada",name:"CA"},{id:5,itemName:"South Korea",name:"SK"},{id:6,itemName:"Brazil",name:"BR"}],this.selectedItems=[{id:1,itemName:"India",name:"IN"}],this.settings={singleSelection:!0,text:"Select Country",clearAll:!1}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}}var Za=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Qa(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function Ya(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](15,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](16,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](18,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](19,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](21,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](22,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](23,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](24,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](26,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](27,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,Qa)),l["\u0275did"](29,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,19,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,22,0,n.tsgist),e(t,24,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,27,0,n.htmlgist),e(t,29,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function Ja(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Ya,Za)),l["\u0275did"](1,114688,null,0,Ka,[],null,null)],function(e,t){e(t,1,0)},null)}var Xa=l["\u0275ccf"]("ng-component",Ka,Ja,{},{},[]);class eu{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Search filter",this.tsgist="CuppaLabs/447bd5fce6dfc2832f5f4a8c36726a9b",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.tstitle="searchFilter.ts",this.htmltitle="searchFilter.html"}ngOnInit(){this.itemList=[{id:1,itemName:"India",name:"IN"},{id:2,itemName:"Singapore",name:"SN"},{id:3,itemName:"Australia",name:"AU"},{id:4,itemName:"Canada",name:"CA"},{id:5,itemName:"South Korea",name:"SK"},{id:6,itemName:"Brazil",name:"BR"}],this.selectedItems=[{id:1,itemName:"India",name:"IN"},{id:2,itemName:"Singapore",name:"SN"},{id:3,itemName:"Australia",name:"AU"},{id:4,itemName:"Canada",name:"CA"}],this.settings={singleSelection:!1,text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,badgeShowLimit:3,addNewItemOnFilter:!0}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}}var tu=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function nu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function lu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](15,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](16,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](18,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](19,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](21,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](22,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](23,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](24,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](26,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](27,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,nu)),l["\u0275did"](29,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,19,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,22,0,n.tsgist),e(t,24,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,27,0,n.htmlgist),e(t,29,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function ru(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,lu,tu)),l["\u0275did"](1,114688,null,0,eu,[],null,null)],function(e,t){e(t,1,0)},null)}var iu=l["\u0275ccf"]("ng-component",eu,ru,{},{},[]);class ou{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Group By",this.tsgist="CuppaLabs/f6c1328ade3201042a4b4d268a30ad8c",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.tstitle="groupBy.ts",this.htmltitle="groupBy.html"}ngOnInit(){this.itemList=[{id:1,itemName:"India",category:"asia"},{id:2,itemName:"Singapore",category:"asia pacific"},{id:3,itemName:"Germany",category:"Europe"},{id:4,itemName:"France",category:"Europe"},{id:5,itemName:"South Korea",category:"asia"},{id:6,itemName:"Sweden",category:"Europe"}],this.selectedItems=[{id:1,itemName:"India",category:"asia"},{id:5,itemName:"South Korea",category:"asia"}],this.settings={singleSelection:!1,text:"Select Fields",selectAllText:"Select All",unSelectAllText:"UnSelect All",searchPlaceholderText:"Search Fields",enableSearchFilter:!0,groupBy:"category",selectGroup:!0,searchBy:["itemName"]}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}onGroupSelect(e){console.log(e)}onGroupDeSelect(e){console.log(e)}onChange(e){console.log(e)}loadDataSet1(){this.selectedItems=[],this.itemList=[{id:1,itemName:"Apple",category:"fruits"},{id:2,itemName:"Banana",category:"fruits"},{id:5,itemName:"Tomatoe",category:"vegetables"},{id:6,itemName:"Potatoe",category:"vegetables"}]}loadDataSet2(){this.selectedItems=[],this.itemList=[{id:1,itemName:"India",category:"asia"},{id:2,itemName:"Singapore",category:"asia pacific"},{id:3,itemName:"Germany",category:"Europe"},{id:4,itemName:"France",category:"Europe"},{id:5,itemName:"South Korea",category:"asia"},{id:6,itemName:"Sweden",category:"Europe"}]}}var su=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function au(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function uu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],[null,"onGroupSelect"],[null,"onGroupDeSelect"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),"ngModelChange"===t&&(r=!1!==i.onChange(n)&&r),"onGroupSelect"===t&&(r=!1!==i.onGroupSelect(n)&&r),"onGroupDeSelect"===t&&(r=!1!==i.onGroupDeSelect(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll",onGroupSelect:"onGroupSelect",onGroupDeSelect:"onGroupDeSelect"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,1,"button",[["class","btn btn-success"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.loadDataSet1()&&l),l},null,null)),(e()(),l["\u0275ted"](-1,null,["Load/change dataset 1"])),(e()(),l["\u0275eld"](15,0,null,null,1,"button",[["class","btn btn-success"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.loadDataSet2()&&l),l},null,null)),(e()(),l["\u0275ted"](-1,null,["Load/change dataset 2"])),(e()(),l["\u0275eld"](17,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](19,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](20,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](22,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](23,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](25,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](26,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](27,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](28,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](30,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](31,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,au)),l["\u0275did"](33,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,23,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,26,0,n.tsgist),e(t,28,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,31,0,n.htmlgist),e(t,33,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function cu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,uu,su)),l["\u0275did"](1,114688,null,0,ou,[],null,null)],function(e,t){e(t,1,0)},null)}var du=l["\u0275ccf"]("ng-component",ou,cu,{},{},[]);class hu{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Templating menu option",this.tsgist="CuppaLabs/cc0ac5976bf26b89119180ff82115fe4",this.htmlgist="CuppaLabs/6399258d93fd5580be1736aba2539519",this.tstitle="templating.ts",this.htmltitle="templating.html"}ngOnInit(){this.itemList=[{category:"asia",id:1,itemName:"India",capital:"Delhi",image:"http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg"},{category:"asia",id:2,itemName:"Singapore",capital:"Singapore",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg"},{category:"europe",id:3,itemName:"United Kingdom",capital:"London",image:"http://www.sciencekids.co.nz/images/pictures/flags96/United_Kingdom.jpg"},{category:"northamerica",id:4,itemName:"Canada",capital:"Ottawa",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Canada.jpg"},{category:"asia",id:5,itemName:"South Korea",capital:"Seoul",image:"http://www.sciencekids.co.nz/images/pictures/flags96/South_Korea.jpg"},{category:"latinamerica",id:6,itemName:"Brazil",capital:"Brasilia",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Brazil.jpg"}],this.selectedItems=[{category:"asia",id:1,itemName:"India",capital:"Delhi",image:"http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg"},{category:"asia",id:2,itemName:"Singapore",capital:"Singapore",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg"},{category:"europe",id:3,itemName:"United Kingdom",capital:"London",image:"http://www.sciencekids.co.nz/images/pictures/flags96/United_Kingdom.jpg"},{category:"northamerica",id:4,itemName:"Canada",capital:"Ottawa",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Canada.jpg"}],this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,classes:"myclass custom-class",showCheckbox:!0,groupBy:"category"}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}onGroupSelect(e){console.log(e)}onGroupDeSelect(e){console.log(e)}}var pu=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function fu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"label",[["style","margin: 0px;"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,0,"img",[["style","width: 16px; margin: 0 0 0 4px;"]],[[8,"src",4]],null,null,null,null))],null,function(e,t){e(t,1,0,t.context.item.itemName),e(t,2,0,t.context.item.image)})}function gu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"img",[["style","width: 30px; border: 1px solid #efefef;margin-right: 20px;"]],[[8,"src",4]],null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,1,"label",[["style","color: #333;margin-right: 20px;"]],null,null,null,null,null)),(e()(),l["\u0275ted"](2,null,["",""])),(e()(),l["\u0275eld"](3,0,null,null,2,"label",[],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,1,"small",[],null,null,null,null,null)),(e()(),l["\u0275ted"](5,null,["Capital - ",""]))],null,function(e,t){e(t,0,0,t.context.item.image),e(t,2,0,t.context.item.itemName),e(t,5,0,t.context.item.capital)})}function mu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,18,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,17,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],[null,"onGroupSelect"],[null,"onGroupDeSelect"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),"onGroupSelect"===t&&(r=!1!==i.onGroupSelect(n)&&r),"onGroupDeSelect"===t&&(r=!1!==i.onGroupDeSelect(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll",onGroupSelect:"onGroupSelect",onGroupDeSelect:"onGroupDeSelect"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,3,"c-badge",[],null,null,null,ds,cs)),l["\u0275did"](14,49152,[[2,4]],1,Wo,[],null,null),l["\u0275qud"](335544320,4,{template:0}),(e()(),l["\u0275and"](0,[[4,2]],null,0,null,fu)),(e()(),l["\u0275eld"](17,0,null,null,3,"c-item",[],null,null,null,us,as)),l["\u0275did"](18,49152,[[1,4]],1,qo,[],null,null),l["\u0275qud"](335544320,5,{template:0}),(e()(),l["\u0275and"](0,[[5,2]],null,0,null,gu)),(e()(),l["\u0275eld"](21,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](23,0,null,null,12,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](24,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,6,{tabPanels:1}),(e()(),l["\u0275eld"](26,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](27,1228800,[[6,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](29,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](30,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](31,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](32,1228800,[[6,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,8,{templates:1}),(e()(),l["\u0275eld"](34,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](35,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,27,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,30,0,n.tsgist),e(t,32,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,35,0,n.htmlgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function vu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,mu,pu)),l["\u0275did"](1,114688,null,0,hu,[],null,null)],function(e,t){e(t,1,0)},null)}var yu=l["\u0275ccf"]("ng-component",hu,vu,{},{},[]);class bu{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Methods - Reset, Open, Close dropdown",this.tsgist="CuppaLabs/96d3ca7681f1a7a38b8c76b2f1552458",this.htmlgist="CuppaLabs/bbd73b9f9864effb69f361c9fc65a6e5",this.tstitle="resetDropdown.ts",this.htmltitle="resetDropdown.html"}ngOnInit(){this.itemList=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"},{id:5,itemName:"South Korea"},{id:6,itemName:"Brazil"}],this.selectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"}],this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class"}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}showModel(){console.log(this.selectedItems)}changeData(){this.selectedItems=[]}open(e){this.dropdownElem.openDropdown(),e.stopPropagation()}close(e){this.dropdownElem.closeDropdown()}}var Cu=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function wu(e){return l["\u0275vid"](0,[l["\u0275qud"](402653184,1,{dropdownElem:0}),(e()(),l["\u0275eld"](1,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](2,null,["",""])),(e()(),l["\u0275eld"](3,0,null,null,23,"div",[["class","col-md-12 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,22,"div",[["class","row"]],null,null,null,null,null)),(e()(),l["\u0275eld"](5,0,null,null,10,"div",[["class","col-md-4"]],null,null,null,null,null)),(e()(),l["\u0275eld"](6,0,null,null,1,"button",[["class","btn btn-danger"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.changeData()&&l),l},null,null)),(e()(),l["\u0275ted"](-1,null,["Reset"])),(e()(),l["\u0275eld"](8,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),l["\u0275eld"](9,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),l["\u0275eld"](10,0,null,null,1,"button",[["class","btn btn-success"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.open(n)&&l),l},null,null)),(e()(),l["\u0275ted"](-1,null,["Open"])),(e()(),l["\u0275eld"](12,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),l["\u0275eld"](13,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),l["\u0275eld"](14,0,null,null,1,"button",[["class","btn btn-primary"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.close(n)&&l),l},null,null)),(e()(),l["\u0275ted"](-1,null,["Close"])),(e()(),l["\u0275eld"](16,0,null,null,10,"div",[["class","col-md-8"]],null,null,null,null,null)),(e()(),l["\u0275eld"](17,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,18).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](18,13615104,[[1,4],["dropdownElem",4]],3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,2,{itemTempl:0}),l["\u0275qud"](603979776,3,{badgeTempl:0}),l["\u0275qud"](603979776,4,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](24,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](26,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](27,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](29,0,null,null,12,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](30,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,5,{tabPanels:1}),(e()(),l["\u0275eld"](32,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](33,1228800,[[5,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](35,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](36,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](37,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](38,1228800,[[5,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](40,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](41,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,18,0,n.itemList,n.settings),e(t,24,0,n.selectedItems),e(t,33,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,36,0,n.tsgist),e(t,38,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,41,0,n.htmlgist)},function(e,t){e(t,2,0,t.component.title),e(t,17,0,l["\u0275nov"](t,18).defaultSettings.classes,l["\u0275nov"](t,26).ngClassUntouched,l["\u0275nov"](t,26).ngClassTouched,l["\u0275nov"](t,26).ngClassPristine,l["\u0275nov"](t,26).ngClassDirty,l["\u0275nov"](t,26).ngClassValid,l["\u0275nov"](t,26).ngClassInvalid,l["\u0275nov"](t,26).ngClassPending)})}function Su(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,wu,Cu)),l["\u0275did"](1,114688,null,0,bu,[],null,null)],function(e,t){e(t,1,0)},null)}var _u=l["\u0275ccf"]("ng-component",bu,Su,{},{},[]);class Iu{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Disable mode",this.tsgist="CuppaLabs/96f799302bdfa08e11b4420c86c1d720",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.tstitle="disableMode.ts",this.htmltitle="disableMode.html"}ngOnInit(){this.itemList=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"},{id:5,itemName:"South Korea"},{id:6,itemName:"Brazil"}],this.selectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"}],this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!1,classes:"myclass custom-class",disabled:!0}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}showModel(){console.log(this.selectedItems)}changeData(){this.selectedItems=[]}disable(){this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!1,classes:"myclass custom-class",disabled:!0}}enable(){this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!1,classes:"myclass custom-class",disabled:!1}}toggleDisable(){console.log(this.settings),this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!1,classes:"myclass custom-class",limitSelection:2,disabled:!1}}}var Eu=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Du(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function xu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,6,"div",[["class","row"]],null,null,null,null,null)),(e()(),l["\u0275eld"](14,0,null,null,2,"div",[],null,null,null,null,null)),(e()(),l["\u0275eld"](15,0,null,null,1,"button",[["class","btn btn-danger"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.disable()&&l),l},null,null)),(e()(),l["\u0275ted"](-1,null,["Disable"])),(e()(),l["\u0275eld"](17,0,null,null,2,"div",[],null,null,null,null,null)),(e()(),l["\u0275eld"](18,0,null,null,1,"button",[["class","btn btn-success"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.enable()&&l),l},null,null)),(e()(),l["\u0275ted"](-1,null,["Enable"])),(e()(),l["\u0275eld"](20,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](22,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](23,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](25,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](26,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](28,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](29,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](30,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](31,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](33,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](34,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,Du)),l["\u0275did"](36,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,26,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,29,0,n.tsgist),e(t,31,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,34,0,n.htmlgist),e(t,36,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function ku(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,xu,Eu)),l["\u0275did"](1,114688,null,0,Iu,[],null,null)],function(e,t){e(t,1,0)},null)}var Au=l["\u0275ccf"]("ng-component",Iu,ku,{},{},[]);class Tu{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Limit Selection",this.tsgist="CuppaLabs/70667b7d4dd4270bb290685e036a379a",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.tstitle="limitSelection.ts",this.htmltitle="limitSelection.html"}ngOnInit(){this.itemList=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"},{id:5,itemName:"South Korea"},{id:6,itemName:"Brazil"}],this.selectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"}],this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,classes:"myclass custom-class",limitSelection:2}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}}var Ru=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Ou(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function Nu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](15,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](16,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](18,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](19,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](21,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](22,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](23,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](24,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](26,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](27,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,Ou)),l["\u0275did"](29,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,19,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,22,0,n.tsgist),e(t,24,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,27,0,n.htmlgist),e(t,29,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function Pu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Nu,Ru)),l["\u0275did"](1,114688,null,0,Tu,[],null,null)],function(e,t){e(t,1,0)},null)}var Mu=l["\u0275ccf"]("ng-component",Tu,Pu,{},{},[]);class Lu{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Limit badges length",this.tsgist="CuppaLabs/00a25e7f8f70199f6571ac9fccbb94c2",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.tstitle="limitBadges.ts",this.htmltitle="limitBadges.html"}ngOnInit(){this.itemList=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"},{id:5,itemName:"South Korea"},{id:6,itemName:"Brazil"}],this.selectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"}],this.settings={singleSelection:!1,text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,badgeShowLimit:3}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}}var Fu=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Vu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function Bu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](15,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](16,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](18,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](19,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](21,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](22,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](23,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](24,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](26,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](27,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,Vu)),l["\u0275did"](29,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,19,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,22,0,n.tsgist),e(t,24,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,27,0,n.htmlgist),e(t,29,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function ju(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Bu,Fu)),l["\u0275did"](1,114688,null,0,Lu,[],null,null)],function(e,t){e(t,1,0)},null)}var Hu=l["\u0275ccf"]("ng-component",Lu,ju,{},{},[]);class Uu{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Custom search placeholder",this.tsgist="CuppaLabs/48c087b6c0b4381d5bae1c689cc0ee3e",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.tstitle="customPlaceholder.ts",this.htmltitle="customPlaceholder.html"}ngOnInit(){this.itemList=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"},{id:5,itemName:"South Korea"},{id:6,itemName:"Brazil"}],this.selectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"}],this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,classes:"myclass custom-class",searchPlaceholderText:"Custom Placeholder text"}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}}var zu=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function $u(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function qu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](15,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](16,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](18,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](19,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](21,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](22,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](23,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](24,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](26,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](27,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,$u)),l["\u0275did"](29,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,19,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,22,0,n.tsgist),e(t,24,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,27,0,n.htmlgist),e(t,29,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function Wu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,qu,zu)),l["\u0275did"](1,114688,null,0,Uu,[],null,null)],function(e,t){e(t,1,0)},null)}var Gu=l["\u0275ccf"]("ng-component",Uu,Wu,{},{},[]);class Ku{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.title="Custom styling",this.tsgist="CuppaLabs/67fb11cbb67a62888ca0a3adb44ee440",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.cssgist="CuppaLabs/e6efeedade8f737df03107625df165e7",this.tstitle="customStyling.ts",this.htmltitle="customStyling.html",this.csstitle="app.css"}ngOnInit(){this.itemList=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"},{id:5,itemName:"South Korea"},{id:6,itemName:"Brazil"}],this.selectedItems=[{id:1,itemName:"India"},{id:2,itemName:"Singapore"},{id:3,itemName:"Australia"},{id:4,itemName:"Canada"}],this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class-example"}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}}var Zu=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Qu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function Yu(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](15,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](16,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](18,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](19,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](21,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](22,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](23,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](24,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](26,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](27,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,Qu)),l["\u0275did"](29,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,19,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,22,0,n.tsgist),e(t,24,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,27,0,n.htmlgist),e(t,29,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function Ju(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Yu,Zu)),l["\u0275did"](1,114688,null,0,Ku,[],null,null)],function(e,t){e(t,1,0)},null)}var Xu=l["\u0275ccf"]("ng-component",Ku,Ju,{},{},[]);class ec{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.formModel={name:"",email:"[email protected]",skills:[{id:1,itemName:"Angular"}]},this.submitted=!1,this.cssgist=!1,this.title="Using with Template driven Forms",this.tsgist="CuppaLabs/6cd9396b8f5589b792b27dd10efe9140",this.htmlgist="CuppaLabs/8148509a46a59e3aba513808daa40ca1",this.tstitle="using-in-forms.ts",this.htmltitle="using-with-forms.html"}onSubmit(){this.submitted=!0}ngOnInit(){this.itemList=[{id:1,itemName:"Angular"},{id:2,itemName:"JavaScript"},{id:3,itemName:"HTML"},{id:4,itemName:"CSS"},{id:5,itemName:"ReactJS"},{id:6,itemName:"HTML5"}],this.settings={text:"Select Skills",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class"}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}}var tc=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function nc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h6",[],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""]))],null,function(e,t){e(t,1,0,t.context.$implicit.itemName)})}function lc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function rc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,92,"div",[["class","row"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,64,"div",[["class","col-md-8 ml-auto mr-auto"]],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,63,"form",[["novalidate",""],["style","border: 1px solid #ccc; padding: 10px;"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(e,t,n){var r=!0,i=e.component;return"submit"===t&&(r=!1!==l["\u0275nov"](e,6).onSubmit(n)&&r),"reset"===t&&(r=!1!==l["\u0275nov"](e,6).onReset()&&r),"ngSubmit"===t&&(r=!1!==i.onSubmit()&&r),r},null,null)),l["\u0275did"](5,16384,null,0,Ao,[],null,null),l["\u0275did"](6,4210688,[["loginForm",4]],0,So,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),l["\u0275prd"](2048,null,Ti,null,[So]),l["\u0275did"](8,16384,null,0,Mi,[[4,Ti]],null,null),(e()(),l["\u0275eld"](9,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(e()(),l["\u0275eld"](10,0,null,null,1,"label",[["for","name"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Name"])),(e()(),l["\u0275eld"](12,0,null,null,7,"input",[["class","form-control"],["id","name"],["name","name"],["pattern","[a-zA-Z][a-zA-Z ]+"],["type","text"]],[[1,"pattern",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==l["\u0275nov"](e,13)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,13).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,13)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,13)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.formModel.name=n)&&r),r},null,null)),l["\u0275did"](13,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275did"](14,540672,null,0,Fo,[],{pattern:[0,"pattern"]},null),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[Fo]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](17,671744,[["name",4]],0,ko,[[2,Ti],[6,Fi],[8,null],[6,Ei]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](19,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](20,0,null,null,4,"div",[["class","alert alert-danger"]],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275eld"](21,0,null,null,1,"div",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Name is required"])),(e()(),l["\u0275eld"](23,0,null,null,1,"div",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Only alphabetsallowed"])),(e()(),l["\u0275eld"](25,0,null,null,21,"div",[["class","form-group"]],null,null,null,null,null)),(e()(),l["\u0275eld"](26,0,null,null,1,"label",[["for","name"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Email Address"])),(e()(),l["\u0275eld"](28,0,null,null,1,"span",[["style","color: red;float: right;"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["* required"])),(e()(),l["\u0275eld"](30,0,null,null,8,"input",[["class","form-control"],["id","emailaddress"],["name","email"],["pattern","^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$"],["required",""],["type","text"]],[[1,"required",0],[1,"pattern",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==l["\u0275nov"](e,31)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,31).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,31)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,31)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.formModel.email=n)&&r),r},null,null)),l["\u0275did"](31,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275did"](32,16384,null,0,Lo,[],{required:[0,"required"]},null),l["\u0275did"](33,540672,null,0,Fo,[],{pattern:[0,"pattern"]},null),l["\u0275prd"](1024,null,Fi,function(e,t){return[e,t]},[Lo,Fo]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](36,671744,[["email",4]],0,ko,[[2,Ti],[6,Fi],[8,null],[6,Ei]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](38,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](39,0,null,null,7,"div",[["class","alert alert-danger"]],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275eld"](40,0,null,null,1,"div",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Email is required"])),(e()(),l["\u0275eld"](42,0,null,null,4,"div",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Email format should be "])),(e()(),l["\u0275eld"](44,0,null,null,2,"small",[],null,null,null,null,null)),(e()(),l["\u0275eld"](45,0,null,null,1,"b",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["[email protected]"])),(e()(),l["\u0275eld"](47,0,null,null,18,"div",[["class","form-group"]],null,null,null,null,null)),(e()(),l["\u0275eld"](48,0,null,null,1,"label",[["for","name"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Skills "])),(e()(),l["\u0275eld"](50,0,null,null,1,"span",[["style","color: red;float: right;"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["* required"])),(e()(),l["\u0275eld"](52,0,null,null,10,"angular2-multiselect",[["name","skills"],["required",""]],[[8,"className",0],[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,53).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.formModel.skills=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](53,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275did"](57,16384,null,0,Lo,[],{required:[0,"required"]},null),l["\u0275prd"](1024,null,Fi,function(e,t){return[e,t]},[os,Lo]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](60,671744,[["skills",4]],0,ko,[[2,Ti],[6,Fi],[8,null],[6,Ei]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](62,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](63,0,null,null,2,"div",[["class","alert alert-danger"]],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275eld"](64,0,null,null,1,"div",[],[[8,"hidden",0]],null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Atleast one Skill is required"])),(e()(),l["\u0275eld"](66,0,null,null,1,"button",[["class","btn btn-success btn-block"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Submit"])),(e()(),l["\u0275eld"](68,0,null,null,26,"div",[["class","col-md-6"]],null,null,null,null,null)),(e()(),l["\u0275eld"](69,0,null,null,19,"table",[["class","table"]],null,null,null,null,null)),(e()(),l["\u0275eld"](70,0,null,null,5,"tr",[],null,null,null,null,null)),(e()(),l["\u0275eld"](71,0,null,null,2,"td",[],null,null,null,null,null)),(e()(),l["\u0275eld"](72,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Name"])),(e()(),l["\u0275eld"](74,0,null,null,1,"td",[],null,null,null,null,null)),(e()(),l["\u0275ted"](75,null,["",""])),(e()(),l["\u0275eld"](76,0,null,null,5,"tr",[],null,null,null,null,null)),(e()(),l["\u0275eld"](77,0,null,null,2,"td",[],null,null,null,null,null)),(e()(),l["\u0275eld"](78,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Email"])),(e()(),l["\u0275eld"](80,0,null,null,1,"td",[],null,null,null,null,null)),(e()(),l["\u0275ted"](81,null,["",""])),(e()(),l["\u0275eld"](82,0,null,null,6,"tr",[],null,null,null,null,null)),(e()(),l["\u0275eld"](83,0,null,null,2,"td",[],null,null,null,null,null)),(e()(),l["\u0275eld"](84,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Skills"])),(e()(),l["\u0275eld"](86,0,null,null,2,"td",[],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,nc)),l["\u0275did"](88,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(e()(),l["\u0275eld"](89,0,null,null,2,"span",[],null,null,null,null,null)),(e()(),l["\u0275ted"](90,null,["",""])),l["\u0275pid"](0,Y.JsonPipe,[]),(e()(),l["\u0275eld"](92,0,null,null,2,"p",[],null,null,null,null,null)),(e()(),l["\u0275ted"](93,null,["Form status: ",""])),l["\u0275pid"](0,Y.JsonPipe,[]),(e()(),l["\u0275eld"](95,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](97,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](98,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](100,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](101,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](103,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](104,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](105,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](106,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](108,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](109,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,lc)),l["\u0275did"](111,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,14,0,"[a-zA-Z][a-zA-Z ]+"),e(t,17,0,"name",n.formModel.name),e(t,32,0,""),e(t,33,0,"^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$"),e(t,36,0,"email",n.formModel.email),e(t,53,0,n.itemList,n.settings),e(t,57,0,""),e(t,60,0,"skills",n.formModel.skills),e(t,88,0,n.formModel.skills),e(t,101,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,104,0,n.tsgist),e(t,106,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,109,0,n.htmlgist),e(t,111,0,n.cssgist)},function(e,t){var n=t.component;e(t,1,0,n.title),e(t,4,0,l["\u0275nov"](t,8).ngClassUntouched,l["\u0275nov"](t,8).ngClassTouched,l["\u0275nov"](t,8).ngClassPristine,l["\u0275nov"](t,8).ngClassDirty,l["\u0275nov"](t,8).ngClassValid,l["\u0275nov"](t,8).ngClassInvalid,l["\u0275nov"](t,8).ngClassPending),e(t,12,0,l["\u0275nov"](t,14).pattern?l["\u0275nov"](t,14).pattern:null,l["\u0275nov"](t,19).ngClassUntouched,l["\u0275nov"](t,19).ngClassTouched,l["\u0275nov"](t,19).ngClassPristine,l["\u0275nov"](t,19).ngClassDirty,l["\u0275nov"](t,19).ngClassValid,l["\u0275nov"](t,19).ngClassInvalid,l["\u0275nov"](t,19).ngClassPending),e(t,20,0,l["\u0275nov"](t,17).valid||l["\u0275nov"](t,17).pristine),e(t,21,0,!l["\u0275nov"](t,17).hasError("required")),e(t,23,0,!l["\u0275nov"](t,17).hasError("pattern")),e(t,30,0,l["\u0275nov"](t,32).required?"":null,l["\u0275nov"](t,33).pattern?l["\u0275nov"](t,33).pattern:null,l["\u0275nov"](t,38).ngClassUntouched,l["\u0275nov"](t,38).ngClassTouched,l["\u0275nov"](t,38).ngClassPristine,l["\u0275nov"](t,38).ngClassDirty,l["\u0275nov"](t,38).ngClassValid,l["\u0275nov"](t,38).ngClassInvalid,l["\u0275nov"](t,38).ngClassPending),e(t,39,0,l["\u0275nov"](t,36).valid||l["\u0275nov"](t,36).pristine),e(t,40,0,!l["\u0275nov"](t,36).hasError("required")),e(t,42,0,!l["\u0275nov"](t,36).hasError("pattern")),e(t,52,0,l["\u0275nov"](t,53).defaultSettings.classes,l["\u0275nov"](t,57).required?"":null,l["\u0275nov"](t,62).ngClassUntouched,l["\u0275nov"](t,62).ngClassTouched,l["\u0275nov"](t,62).ngClassPristine,l["\u0275nov"](t,62).ngClassDirty,l["\u0275nov"](t,62).ngClassValid,l["\u0275nov"](t,62).ngClassInvalid,l["\u0275nov"](t,62).ngClassPending),e(t,63,0,l["\u0275nov"](t,60).valid),e(t,64,0,!l["\u0275nov"](t,60).hasError("required")),e(t,66,0,!l["\u0275nov"](t,6).form.valid),e(t,75,0,n.formModel.name),e(t,81,0,n.formModel.email),e(t,90,0,l["\u0275unv"](t,90,0,l["\u0275nov"](t,91).transform(n.formModel))),e(t,93,0,l["\u0275unv"](t,93,0,l["\u0275nov"](t,94).transform(l["\u0275nov"](t,6).form.status)))})}function ic(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,rc,tc)),l["\u0275did"](1,114688,null,0,ec,[],null,null)],function(e,t){e(t,1,0)},null)}var oc=l["\u0275ccf"]("ng-component",ec,ic,{},{},[]);class sc{constructor(e){this.fb=e,this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Using with Reactive Forms",this.tsgist="CuppaLabs/f0dfe353c6378cee7f55547395a80fc4",this.htmlgist="CuppaLabs/0a32c3d76110468b84bac01fd64488bc",this.tstitle="using-in-reactive-forms.ts",this.htmltitle="using-with-reactive-forms.html",this.createForm()}createForm(){this.userForm=this.fb.group({name:"xbvxncvx",email:["[email protected]",Bi.required],skills:[[],Bi.required]})}submitForm(){console.log(this.userForm)}ngOnInit(){this.itemList=[{id:1,itemName:"Angular"},{id:2,itemName:"JavaScript"},{id:3,itemName:"HTML"},{id:4,itemName:"CSS"},{id:5,itemName:"ReactJS"},{id:6,itemName:"HTML5"}],this.selectedItems=[],this.settings={text:"Select Skills",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class"}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}}var ac=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function uc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h6",[],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""]))],null,function(e,t){e(t,1,0,t.context.$implicit.itemName)})}function cc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function dc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,70,"div",[["class","row"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,42,"div",[["class","col-md-8 ml-auto mr-auto"]],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,41,"form",[["novalidate",""],["style","border: 1px solid #ccc; padding: 10px;"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"submit"],[null,"reset"]],function(e,t,n){var r=!0;return"submit"===t&&(r=!1!==l["\u0275nov"](e,6).onSubmit(n)&&r),"reset"===t&&(r=!1!==l["\u0275nov"](e,6).onReset()&&r),r},null,null)),l["\u0275did"](5,16384,null,0,Ao,[],null,null),l["\u0275did"](6,540672,null,0,Ro,[[8,null],[8,null]],{form:[0,"form"]},null),l["\u0275prd"](2048,null,Ti,null,[Ro]),l["\u0275did"](8,16384,null,0,Mi,[[4,Ti]],null,null),(e()(),l["\u0275eld"](9,0,null,null,14,"div",[["class","form-group"]],null,null,null,null,null)),(e()(),l["\u0275eld"](10,0,null,null,1,"label",[["for","name"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Skills"])),(e()(),l["\u0275eld"](12,0,null,null,1,"span",[["style","color: red;float: right;"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["* required"])),(e()(),l["\u0275eld"](14,0,null,null,9,"angular2-multiselect",[["formControlName","skills"]],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,15).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](15,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](21,671744,null,0,Mo,[[3,Ti],[6,Fi],[8,null],[6,Ei],[2,To]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[Mo]),l["\u0275did"](23,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](24,0,null,null,8,"div",[["class","form-group"]],null,null,null,null,null)),(e()(),l["\u0275eld"](25,0,null,null,1,"label",[["for","name"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Name"])),(e()(),l["\u0275eld"](27,0,null,null,5,"input",[["class","form-control"],["formControlName","name"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0;return"input"===t&&(r=!1!==l["\u0275nov"](e,28)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,28).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,28)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,28)._compositionEnd(n.target.value)&&r),r},null,null)),l["\u0275did"](28,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](30,671744,null,0,Mo,[[3,Ti],[8,null],[8,null],[6,Ei],[2,To]],{name:[0,"name"]},null),l["\u0275prd"](2048,null,Oi,null,[Mo]),l["\u0275did"](32,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](33,0,null,null,10,"div",[["class","form-group"]],null,null,null,null,null)),(e()(),l["\u0275eld"](34,0,null,null,1,"label",[["for","name"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Email Address"])),(e()(),l["\u0275eld"](36,0,null,null,1,"span",[["style","color: red;float: right;"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["* required"])),(e()(),l["\u0275eld"](38,0,null,null,5,"input",[["class","form-control"],["formControlName","email"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0;return"input"===t&&(r=!1!==l["\u0275nov"](e,39)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,39).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,39)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,39)._compositionEnd(n.target.value)&&r),r},null,null)),l["\u0275did"](39,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](41,671744,null,0,Mo,[[3,Ti],[8,null],[8,null],[6,Ei],[2,To]],{name:[0,"name"]},null),l["\u0275prd"](2048,null,Oi,null,[Mo]),l["\u0275did"](43,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](44,0,null,null,1,"button",[["class","btn btn-success btn-block"]],[[8,"disabled",0]],[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.submitForm()&&l),l},null,null)),(e()(),l["\u0275ted"](-1,null,["Submit"])),(e()(),l["\u0275eld"](46,0,null,null,26,"div",[["class","col-md-6"]],null,null,null,null,null)),(e()(),l["\u0275eld"](47,0,null,null,19,"table",[["class","table"]],null,null,null,null,null)),(e()(),l["\u0275eld"](48,0,null,null,5,"tr",[],null,null,null,null,null)),(e()(),l["\u0275eld"](49,0,null,null,2,"td",[],null,null,null,null,null)),(e()(),l["\u0275eld"](50,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Name"])),(e()(),l["\u0275eld"](52,0,null,null,1,"td",[],null,null,null,null,null)),(e()(),l["\u0275ted"](53,null,["",""])),(e()(),l["\u0275eld"](54,0,null,null,5,"tr",[],null,null,null,null,null)),(e()(),l["\u0275eld"](55,0,null,null,2,"td",[],null,null,null,null,null)),(e()(),l["\u0275eld"](56,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Email"])),(e()(),l["\u0275eld"](58,0,null,null,1,"td",[],null,null,null,null,null)),(e()(),l["\u0275ted"](59,null,["",""])),(e()(),l["\u0275eld"](60,0,null,null,6,"tr",[],null,null,null,null,null)),(e()(),l["\u0275eld"](61,0,null,null,2,"td",[],null,null,null,null,null)),(e()(),l["\u0275eld"](62,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Skills"])),(e()(),l["\u0275eld"](64,0,null,null,2,"td",[],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,uc)),l["\u0275did"](66,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(e()(),l["\u0275eld"](67,0,null,null,2,"span",[],null,null,null,null,null)),(e()(),l["\u0275ted"](68,null,["",""])),l["\u0275pid"](0,Y.JsonPipe,[]),(e()(),l["\u0275eld"](70,0,null,null,2,"p",[],null,null,null,null,null)),(e()(),l["\u0275ted"](71,null,["Form status: ",""])),l["\u0275pid"](0,Y.JsonPipe,[]),(e()(),l["\u0275eld"](73,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](75,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](76,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](78,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](79,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](81,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](82,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](83,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](84,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](86,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](87,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,cc)),l["\u0275did"](89,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,6,0,n.userForm),e(t,15,0,n.itemList,n.settings),e(t,21,0,"skills",n.selectedItems),e(t,30,0,"name"),e(t,41,0,"email"),e(t,66,0,n.userForm.value.skills),e(t,79,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,82,0,n.tsgist),e(t,84,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,87,0,n.htmlgist),e(t,89,0,n.cssgist)},function(e,t){var n=t.component;e(t,1,0,n.title),e(t,4,0,l["\u0275nov"](t,8).ngClassUntouched,l["\u0275nov"](t,8).ngClassTouched,l["\u0275nov"](t,8).ngClassPristine,l["\u0275nov"](t,8).ngClassDirty,l["\u0275nov"](t,8).ngClassValid,l["\u0275nov"](t,8).ngClassInvalid,l["\u0275nov"](t,8).ngClassPending),e(t,14,0,l["\u0275nov"](t,15).defaultSettings.classes,l["\u0275nov"](t,23).ngClassUntouched,l["\u0275nov"](t,23).ngClassTouched,l["\u0275nov"](t,23).ngClassPristine,l["\u0275nov"](t,23).ngClassDirty,l["\u0275nov"](t,23).ngClassValid,l["\u0275nov"](t,23).ngClassInvalid,l["\u0275nov"](t,23).ngClassPending),e(t,27,0,l["\u0275nov"](t,32).ngClassUntouched,l["\u0275nov"](t,32).ngClassTouched,l["\u0275nov"](t,32).ngClassPristine,l["\u0275nov"](t,32).ngClassDirty,l["\u0275nov"](t,32).ngClassValid,l["\u0275nov"](t,32).ngClassInvalid,l["\u0275nov"](t,32).ngClassPending),e(t,38,0,l["\u0275nov"](t,43).ngClassUntouched,l["\u0275nov"](t,43).ngClassTouched,l["\u0275nov"](t,43).ngClassPristine,l["\u0275nov"](t,43).ngClassDirty,l["\u0275nov"](t,43).ngClassValid,l["\u0275nov"](t,43).ngClassInvalid,l["\u0275nov"](t,43).ngClassPending),e(t,44,0,!n.userForm.valid),e(t,53,0,n.userForm.value.name),e(t,59,0,n.userForm.value.email),e(t,68,0,l["\u0275unv"](t,68,0,l["\u0275nov"](t,69).transform(n.userForm.value))),e(t,71,0,l["\u0275unv"](t,71,0,l["\u0275nov"](t,72).transform(n.userForm.status)))})}function hc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,dc,ac)),l["\u0275did"](1,114688,null,0,sc,[Bo],null,null)],function(e,t){e(t,1,0)},null)}var pc=l["\u0275ccf"]("ng-component",sc,hc,{},{},[]);class fc{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.categories=["Indian","American","Canadian","Chinese"],this.namesList=["Smith","Johnson","Williams","Brown","Jones","Miller","Davis","Garcia","Rodriguez","Wilson","Martinez","Anderson","Taylor","Thomas","Hernandez","Moore","Martin","Jackson","Thompson","White","Lopez","Lee","Gonzalez","Harris","Clark","Lewis","Robinson","Walker","Perez","Hall","Young","Allen","Sanchez","Wright","King","Scott","Green","Baker","Adams","Nelson","Hill","Ramirez","Campbell","Mitchell","Roberts","Carter","Phillips","Evans","Turner","Torres","Parker","Collins","Edwards","Stewart","Flores","Morris","Nguyen","Murphy","Rivera","Cook","Rogers","Morgan","Peterson","Cooper","Reed","Bailey","Bell","Gomez","Kelly","Howard","Ward","Cox","Diaz","Richardson","Wood","Watson","Brooks","Bennett","Gray","James","Reyes","Cruz","Hughes","Price","Myers","Long","Foster","Sanders","Ross","Morales","Powell","Sullivan","Russell","Ortiz","Jenkins","Gutierrez","Perry","Butler","Barnes","Fisher","Henderson","Coleman","Simmons","Patterson","Jordan","Reynolds","Hamilton","Graham","Kim","Gonzales","Alexander","Ramos","Wallace","Griffin","West","Cole","Hayes","Chavez","Gibson","Bryant","Ellis","Stevens","Murray","Ford","Marshall","Owens","Mcdonald","Harrison","Ruiz","Kennedy","Wells","Alvarez","Woods","Mendoza","Castillo","Olson","Webb","Washington","Tucker","Freeman","Burns","Henry","Vasquez","Snyder","Simpson","Crawford","Jimenez","Porter","Mason","Shaw","Gordon","Wagner","Hunter","Romero","Hicks","Dixon","Hunt","Palmer","Robertson","Black","Holmes","Stone","Meyer","Boyd","Mills","Warren","Fox","Rose","Rice","Moreno","Schmidt","Patel","Ferguson","Nichols","Herrera","Medina","Ryan","Fernandez","Weaver","Daniels","Stephens","Gardner","Payne","Kelley","Dunn","Pierce","Arnold","Tran","Spencer","Peters","Hawkins","Grant","Hansen","Castro","Hoffman","Hart","Elliott","Cunningham","Knight","Bradley","Carroll","Hudson","Duncan","Armstrong","Berry","Andrews","Johnston","Ray","Lane","Riley","Carpenter","Perkins","Aguilar","Silva","Richards","Willis","Matthews","Chapman","Lawrence","Garza","Vargas","Watkins","Wheeler","Larson","Carlson","Harper","George","Greene","Burke","Guzman","Morrison","Munoz","Jacobs","Obrien","Lawson","Franklin","Lynch","Bishop","Carr","Salazar","Austin","Mendez","Gilbert","Jensen","Williamson","Montgomery","Harvey","Oliver","Howell","Dean","Hanson","Weber","Garrett","Sims","Burton","Fuller","Soto","Mccoy","Welch","Chen","Schultz","Walters","Reid","Fields","Walsh","Little","Fowler","Bowman","Davidson","May","Day","Schneider","Newman","Brewer","Lucas","Holland","Wong","Banks","Santos","Curtis","Pearson","Delgado","Valdez","Pena","Rios","Douglas","Sandoval","Barrett","Hopkins","Keller","Guerrero","Stanley","Bates","Alvarado","Beck","Ortega","Wade","Estrada","Contreras","Barnett","Caldwell","Santiago","Lambert","Powers","Chambers","Nunez","Craig","Leonard","Lowe","Rhodes","Byrd","Gregory","Shelton","Frazier","Becker","Maldonado","Fleming","Vega","Sutton","Cohen","Jennings","Parks","Mcdaniel","Watts","Barker","Norris","Vaughn","Vazquez","Holt","Schwartz","Steele","Benson","Neal","Dominguez","Horton","Terry","Wolfe","Hale","Lyons","Graves","Haynes","Miles","Park","Warner","Padilla","Bush","Thornton","Mccarthy","Mann","Zimmerman","Erickson","Fletcher","Mckinney","Page","Dawson","Joseph","Marquez","Reeves","Klein","Espinoza","Baldwin","Moran","Love","Robbins","Higgins","Ball","Cortez","Le","Griffith","Bowen","Sharp","Cummings","Ramsey","Hardy","Swanson","Barber","Acosta","Luna","Chandler","Blair","Daniel","Cross","Simon","Dennis","Oconnor","Quinn","Gross","Navarro","Moss","Fitzgerald","Doyle","Mclaughlin","Rojas","Rodgers","Stevenson","Singh","Yang","Figueroa","Harmon","Newton","Paul","Manning","Garner","Mcgee","Reese","Francis","Burgess","Adkins","Goodman","Curry","Brady","Christensen","Potter","Walton","Goodwin","Mullins","Molina","Webster","Fischer","Campos","Avila","Sherman","Todd","Chang","Blake","Malone","Wolf","Hodges","Juarez","Gill","Farmer","Hines","Gallagher","Duran","Hubbard","Cannon","Miranda","Wang","Saunders","Tate","Mack","Hammond","Carrillo","Townsend","Wise","Ingram","Barton","Mejia","Ayala","Schroeder","Hampton","Rowe","Parsons","Frank","Waters","Strickland","Osborne","Maxwell","Chan","Deleon","Norman","Harrington","Casey","Patton","Logan","Bowers","Mueller","Glover","Floyd","Hartman","Buchanan","Cobb","French","Kramer","Mccormick","Clarke","Tyler","Gibbs","Moody","Conner","Sparks","Mcguire","Leon","Bauer","Norton","Pope","Flynn","Hogan","Robles","Salinas","Yates","Lindsey","Lloyd","Marsh","Mcbride","Owen","Solis","Pham","Lang","Pratt","Lara","Brock","Ballard","Trujillo","Shaffer","Drake","Roman","Aguirre","Morton","Stokes","Lamb","Pacheco","Patrick","Cochran","Shepherd","Cain","Burnett","Hess","Li","Cervantes","Olsen","Briggs","Ochoa","Cabrera","Velasquez","Montoya","Roth","Meyers","Cardenas","Fuentes","Weiss","Hoover","Wilkins","Nicholson","Underwood","Short","Carson","Morrow","Colon","Holloway","Summers","Bryan","Petersen","Mckenzie","Serrano","Wilcox","Carey","Clayton","Poole","Calderon","Gallegos","Greer","Rivas","Guerra","Decker","Collier","Wall","Whitaker","Bass","Flowers","Davenport","Conley","Houston","Huff","Copeland","Hood","Monroe","Massey","Roberson","Combs","Franco","Larsen","Pittman","Randall","Skinner","Wilkinson","Kirby","Cameron","Bridges","Anthony","Richard","Kirk","Bruce","Singleton","Mathis","Bradford","Boone","Abbott","Charles","Allison","Sweeney","Atkinson","Horn","Jefferson","Rosales","York","Christian","Phelps","Farrell","Castaneda","Nash","Dickerson","Bond","Wyatt","Foley","Chase","Gates","Vincent","Mathews","Hodge","Garrison","Trevino","Villarreal","Heath","Dalton","Valencia","Callahan","Hensley","Atkins","Huffman","Roy","Boyer","Shields","Lin","Hancock","Grimes","Glenn","Cline","Delacruz","Camacho","Dillon","Parrish","Oneill","Melton","Booth","Kane","Berg","Harrell","Pitts","Savage","Wiggins","Brennan","Salas","Marks","Russo","Sawyer","Baxter","Golden","Hutchinson","Liu","Walter","Mcdowell","Wiley","Rich","Humphrey","Johns","Koch","Suarez","Hobbs","Beard","Gilmore","Ibarra","Keith","Macias","Khan","Andrade","Ware","Stephenson","Henson","Wilkerson","Dyer","Mcclure","Blackwell","Mercado","Tanner","Eaton","Clay","Barron","Beasley","Oneal","Preston","Small","Wu","Zamora","Macdonald","Vance","Snow","Mcclain","Stafford","Orozco","Barry","English","Shannon","Kline","Jacobson","Woodard","Huang","Kemp","Mosley","Prince","Merritt","Hurst","Villanueva","Roach","Nolan","Lam","Yoder","Mccullough","Lester","Santana","Valenzuela","Winters","Barrera","Leach","Orr","Berger","Mckee","Strong","Conway","Stein","Whitehead","Bullock","Escobar","Knox","Meadows","Solomon","Velez","Odonnell","Kerr","Stout","Blankenship","Browning","Kent","Lozano","Bartlett","Pruitt","Buck","Barr","Gaines","Durham","Gentry","Mcintyre","Sloan","Melendez","Rocha","Herman","Sexton","Moon","Hendricks","Rangel","Stark","Lowery","Hardin","Hull","Sellers","Ellison","Calhoun","Gillespie","Mora","Knapp","Mccall","Morse","Dorsey","Weeks","Nielsen","Livingston","Leblanc","Mclean","Bradshaw","Glass","Middleton","Buckley","Schaefer","Frost","Howe","House","Mcintosh","Ho","Pennington","Reilly","Hebert","Mcfarland","Hickman","Noble","Spears","Conrad","Arias","Galvan","Velazquez","Huynh","Frederick","Randolph","Cantu","Fitzpatrick","Mahoney","Peck","Villa","Michael","Donovan","Mcconnell","Walls","Boyle","Mayer","Zuniga","Giles","Pineda","Pace","Hurley","Mays","Mcmillan","Crosby","Ayers","Case","Bentley","Shepard","Everett","Pugh","David","Mcmahon","Dunlap","Bender","Hahn","Harding","Acevedo","Raymond","Blackburn","Duffy","Landry","Dougherty","Bautista","Shah","Potts","Arroyo","Valentine","Meza","Gould","Vaughan","Fry","Rush","Avery","Herring","Dodson","Clements","Sampson","Tapia","Bean","Lynn","Crane","Farley","Cisneros","Benton","Ashley","Mckay","Finley","Best","Blevins","Friedman","Moses","Sosa","Blanchard","Huber","Frye","Krueger","Bernard","Rosario","Rubio","Mullen","Benjamin","Haley","Chung","Moyer","Choi","Horne","Yu","Woodward","Ali","Nixon","Hayden","Rivers","Estes","Mccarty","Richmond","Stuart","Maynard","Brandt","Oconnell","Hanna","Sanford","Sheppard","Church","Burch","Levy","Rasmussen","Coffey","Ponce","Faulkner","Donaldson","Schmitt","Novak","Costa","Montes","Booker","Cordova","Waller","Arellano","Maddox","Mata","Bonilla","Stanton","Compton","Kaufman","Dudley","Mcpherson","Beltran","Dickson","Mccann","Villegas","Proctor","Hester","Cantrell","Daugherty","Cherry","Bray","Davila","Rowland","Levine","Madden","Spence","Good","Irwin","Werner","Krause","Petty","Whitney","Baird","Hooper","Pollard","Zavala","Jarvis","Holden","Haas","Hendrix","Mcgrath","Bird","Lucero","Terrell","Riggs","Joyce","Mercer","Rollins","Galloway","Duke","Odom","Andersen","Downs","Hatfield","Benitez","Archer","Huerta","Travis","Mcneil","Hinton","Zhang","Hays","Mayo","Fritz","Branch","Mooney","Ewing","Ritter","Esparza","Frey","Braun","Gay","Riddle","Haney","Kaiser","Holder","Chaney","Mcknight","Gamble","Vang","Cooley","Carney","Cowan","Forbes","Ferrell","Davies","Barajas","Shea","Osborn","Bright","Cuevas","Bolton","Murillo","Lutz","Duarte","Kidd","Key","Cooke"],this.cssgist=!1,this.title="Virtual scrolling - Lazy load large data sets",this.tsgist="CuppaLabs/aab6c8b30a6901af01249c474f3f0cbd",this.htmlgist="CuppaLabs/c77fea947ef053aa22973fcd9c7c612a",this.tstitle="lazyLoading.ts",this.htmltitle="lazyLoading.html"}ngOnInit(){this.itemList=[];for(var e=1;e<=1e3;e++){var t={id:0,itemName:"",category:""};t.id=e,t.itemName=this.namesList[Math.floor(Math.random()*this.namesList.length)],t.category=this.categories[Math.floor(Math.random()*this.categories.length)],this.itemList.push(t)}this.selectedItems=[],this.settings={text:"Select Items",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class",enableSearchFilter:!0,lazyLoading:!0,badgeShowLimit:4}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}onScroll(e){console.log(e)}onScrollToEnd(e){console.log(e)}changeData(){this.selectedItems=[]}}var gc=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function mc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function vc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,17,"div",[["class","row"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,13,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,5).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](5,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](11,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](13,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](14,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),l["\u0275eld"](15,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),l["\u0275ted"](16,null,["Total Records : ",""])),(e()(),l["\u0275eld"](17,0,null,null,2,"div",[["class","col-md-4 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](18,0,null,null,1,"button",[["class","btn btn-danger"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.changeData()&&l),l},null,null)),(e()(),l["\u0275ted"](-1,null,["Reset"])),(e()(),l["\u0275eld"](20,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](22,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](23,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](25,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](26,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](28,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](29,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](30,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](31,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](33,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](34,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,mc)),l["\u0275did"](36,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,5,0,n.itemList,n.settings),e(t,11,0,n.selectedItems),e(t,26,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,29,0,n.tsgist),e(t,31,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,34,0,n.htmlgist),e(t,36,0,n.cssgist)},function(e,t){var n=t.component;e(t,1,0,n.title),e(t,4,0,l["\u0275nov"](t,5).defaultSettings.classes,l["\u0275nov"](t,13).ngClassUntouched,l["\u0275nov"](t,13).ngClassTouched,l["\u0275nov"](t,13).ngClassPristine,l["\u0275nov"](t,13).ngClassDirty,l["\u0275nov"](t,13).ngClassValid,l["\u0275nov"](t,13).ngClassInvalid,l["\u0275nov"](t,13).ngClassPending),e(t,16,0,n.itemList.length)})}function yc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,vc,gc)),l["\u0275did"](1,114688,null,0,fc,[],null,null)],function(e,t){e(t,1,0)},null)}var bc=l["\u0275ccf"]("ng-component",fc,yc,{},{},[]);class Cc{constructor(){this.itemList=[],this.DATA=[{id:"PBMMedAdhr",name:"PBM Medication Adherence"},{id:"GapsInCare",name:"Gaps In Care"},{id:"UCTest1",name:"Use Case Test1"},{id:"BASICSAVE",name:"A generic alternative or 30-90 day dispense opport"},{id:"ADVSAVE",name:"An advnaced generic alternative or 30-90 day dispe"},{id:"AttAlert",name:"Attachment Alert"},{id:"PatSave",name:"Patient savings"},{id:"UCTest2",name:"Use Case Test 2"},{id:"UCTest3",name:"Use Case Test 3"},{id:"UCTest4",name:"Use Case Test 4"},{id:"UCTest5",name:"Use Case Test 5"},{id:"UCTest6",name:"Use Case Test 6"},{id:"UCTest7",name:"Use Case Test 7"},{id:"UCTest9",name:"Use Case Test 9"},{id:"UCTest#Ten",name:"Use Case Test 10"},{id:"UCTest8",name:"Use Case Test 8"},{id:"UCTest11",name:"Test Use Case 11"},{id:"UCTest12",name:"Test Use Case 12"},{id:"UCTest13",name:"Test Use Case 13"},{id:"PNLIMMUN",name:"PNL Immunization"},{id:"TrustBrkr",name:"Identity Services"},{id:"RTBC",name:"real time benefit check for 90 day at retail"}],this.categories=["Indian","American","Canadian","Chinese"],this.namesList=["Smith","Johnson","Williams","Brown","Jones","Miller","Davis","Garcia","Rodriguez","Wilson","Martinez","Anderson","Taylor","Thomas","Hernandez","Moore","Martin","Jackson","Thompson","White","Lopez","Lee","Gonzalez","Harris","Clark","Lewis","Robinson","Walker","Perez","Hall","Young","Allen","Sanchez","Wright","King","Scott","Green","Baker","Adams","Nelson","Hill","Ramirez","Campbell","Mitchell","Roberts","Carter","Phillips","Evans","Turner","Torres","Parker","Collins","Edwards","Stewart","Flores","Morris","Nguyen","Murphy","Rivera","Cook","Rogers","Morgan","Peterson","Cooper","Reed","Bailey","Bell","Gomez","Kelly","Howard","Ward","Cox","Diaz","Richardson","Wood","Watson","Brooks","Bennett","Gray","James","Reyes","Cruz","Hughes","Price","Myers","Long","Foster","Sanders","Ross","Morales","Powell","Sullivan","Russell","Ortiz","Jenkins","Gutierrez","Perry","Butler","Barnes","Fisher","Henderson","Coleman","Simmons","Patterson","Jordan","Reynolds","Hamilton","Graham","Kim","Gonzales","Alexander","Ramos","Wallace","Griffin","West","Cole","Hayes","Chavez","Gibson","Bryant","Ellis","Stevens","Murray","Ford","Marshall","Owens","Mcdonald","Harrison","Ruiz","Kennedy","Wells","Alvarez","Woods","Mendoza","Castillo","Olson","Webb","Washington","Tucker","Freeman","Burns","Henry","Vasquez","Snyder","Simpson","Crawford","Jimenez","Porter","Mason","Shaw","Gordon","Wagner","Hunter","Romero","Hicks","Dixon","Hunt","Palmer","Robertson","Black","Holmes","Stone","Meyer","Boyd","Mills","Warren","Fox","Rose","Rice","Moreno","Schmidt","Patel","Ferguson","Nichols","Herrera","Medina","Ryan","Fernandez","Weaver","Daniels","Stephens","Gardner","Payne","Kelley","Dunn","Pierce","Arnold","Tran","Spencer","Peters","Hawkins","Grant","Hansen","Castro","Hoffman","Hart","Elliott","Cunningham","Knight","Bradley","Carroll","Hudson","Duncan","Armstrong","Berry","Andrews","Johnston","Ray","Lane","Riley","Carpenter","Perkins","Aguilar","Silva","Richards","Willis","Matthews","Chapman","Lawrence","Garza","Vargas","Watkins","Wheeler","Larson","Carlson","Harper","George","Greene","Burke","Guzman","Morrison","Munoz","Jacobs","Obrien","Lawson","Franklin","Lynch","Bishop","Carr","Salazar","Austin","Mendez","Gilbert","Jensen","Williamson","Montgomery","Harvey","Oliver","Howell","Dean","Hanson","Weber","Garrett","Sims","Burton","Fuller","Soto","Mccoy","Welch","Chen","Schultz","Walters","Reid","Fields","Walsh","Little","Fowler","Bowman","Davidson","May","Day","Schneider","Newman","Brewer","Lucas","Holland","Wong","Banks","Santos","Curtis","Pearson","Delgado","Valdez","Pena","Rios","Douglas","Sandoval","Barrett","Hopkins","Keller","Guerrero","Stanley","Bates","Alvarado","Beck","Ortega","Wade","Estrada","Contreras","Barnett","Caldwell","Santiago","Lambert","Powers","Chambers","Nunez","Craig","Leonard","Lowe","Rhodes","Byrd","Gregory","Shelton","Frazier","Becker","Maldonado","Fleming","Vega","Sutton","Cohen","Jennings","Parks","Mcdaniel","Watts","Barker","Norris","Vaughn","Vazquez","Holt","Schwartz","Steele","Benson","Neal","Dominguez","Horton","Terry","Wolfe","Hale","Lyons","Graves","Haynes","Miles","Park","Warner","Padilla","Bush","Thornton","Mccarthy","Mann","Zimmerman","Erickson","Fletcher","Mckinney","Page","Dawson","Joseph","Marquez","Reeves","Klein","Espinoza","Baldwin","Moran","Love","Robbins","Higgins","Ball","Cortez","Le","Griffith","Bowen","Sharp","Cummings","Ramsey","Hardy","Swanson","Barber","Acosta","Luna","Chandler","Blair","Daniel","Cross","Simon","Dennis","Oconnor","Quinn","Gross","Navarro","Moss","Fitzgerald","Doyle","Mclaughlin","Rojas","Rodgers","Stevenson","Singh","Yang","Figueroa","Harmon","Newton","Paul","Manning","Garner","Mcgee","Reese","Francis","Burgess","Adkins","Goodman","Curry","Brady","Christensen","Potter","Walton","Goodwin","Mullins","Molina","Webster","Fischer","Campos","Avila","Sherman","Todd","Chang","Blake","Malone","Wolf","Hodges","Juarez","Gill","Farmer","Hines","Gallagher","Duran","Hubbard","Cannon","Miranda","Wang","Saunders","Tate","Mack","Hammond","Carrillo","Townsend","Wise","Ingram","Barton","Mejia","Ayala","Schroeder","Hampton","Rowe","Parsons","Frank","Waters","Strickland","Osborne","Maxwell","Chan","Deleon","Norman","Harrington","Casey","Patton","Logan","Bowers","Mueller","Glover","Floyd","Hartman","Buchanan","Cobb","French","Kramer","Mccormick","Clarke","Tyler","Gibbs","Moody","Conner","Sparks","Mcguire","Leon","Bauer","Norton","Pope","Flynn","Hogan","Robles","Salinas","Yates","Lindsey","Lloyd","Marsh","Mcbride","Owen","Solis","Pham","Lang","Pratt","Lara","Brock","Ballard","Trujillo","Shaffer","Drake","Roman","Aguirre","Morton","Stokes","Lamb","Pacheco","Patrick","Cochran","Shepherd","Cain","Burnett","Hess","Li","Cervantes","Olsen","Briggs","Ochoa","Cabrera","Velasquez","Montoya","Roth","Meyers","Cardenas","Fuentes","Weiss","Hoover","Wilkins","Nicholson","Underwood","Short","Carson","Morrow","Colon","Holloway","Summers","Bryan","Petersen","Mckenzie","Serrano","Wilcox","Carey","Clayton","Poole","Calderon","Gallegos","Greer","Rivas","Guerra","Decker","Collier","Wall","Whitaker","Bass","Flowers","Davenport","Conley","Houston","Huff","Copeland","Hood","Monroe","Massey","Roberson","Combs","Franco","Larsen","Pittman","Randall","Skinner","Wilkinson","Kirby","Cameron","Bridges","Anthony","Richard","Kirk","Bruce","Singleton","Mathis","Bradford","Boone","Abbott","Charles","Allison","Sweeney","Atkinson","Horn","Jefferson","Rosales","York","Christian","Phelps","Farrell","Castaneda","Nash","Dickerson","Bond","Wyatt","Foley","Chase","Gates","Vincent","Mathews","Hodge","Garrison","Trevino","Villarreal","Heath","Dalton","Valencia","Callahan","Hensley","Atkins","Huffman","Roy","Boyer","Shields","Lin","Hancock","Grimes","Glenn","Cline","Delacruz","Camacho","Dillon","Parrish","Oneill","Melton","Booth","Kane","Berg","Harrell","Pitts","Savage","Wiggins","Brennan","Salas","Marks","Russo","Sawyer","Baxter","Golden","Hutchinson","Liu","Walter","Mcdowell","Wiley","Rich","Humphrey","Johns","Koch","Suarez","Hobbs","Beard","Gilmore","Ibarra","Keith","Macias","Khan","Andrade","Ware","Stephenson","Henson","Wilkerson","Dyer","Mcclure","Blackwell","Mercado","Tanner","Eaton","Clay","Barron","Beasley","Oneal","Preston","Small","Wu","Zamora","Macdonald","Vance","Snow","Mcclain","Stafford","Orozco","Barry","English","Shannon","Kline","Jacobson","Woodard","Huang","Kemp","Mosley","Prince","Merritt","Hurst","Villanueva","Roach","Nolan","Lam","Yoder","Mccullough","Lester","Santana","Valenzuela","Winters","Barrera","Leach","Orr","Berger","Mckee","Strong","Conway","Stein","Whitehead","Bullock","Escobar","Knox","Meadows","Solomon","Velez","Odonnell","Kerr","Stout","Blankenship","Browning","Kent","Lozano","Bartlett","Pruitt","Buck","Barr","Gaines","Durham","Gentry","Mcintyre","Sloan","Melendez","Rocha","Herman","Sexton","Moon","Hendricks","Rangel","Stark","Lowery","Hardin","Hull","Sellers","Ellison","Calhoun","Gillespie","Mora","Knapp","Mccall","Morse","Dorsey","Weeks","Nielsen","Livingston","Leblanc","Mclean","Bradshaw","Glass","Middleton","Buckley","Schaefer","Frost","Howe","House","Mcintosh","Ho","Pennington","Reilly","Hebert","Mcfarland","Hickman","Noble","Spears","Conrad","Arias","Galvan","Velazquez","Huynh","Frederick","Randolph","Cantu","Fitzpatrick","Mahoney","Peck","Villa","Michael","Donovan","Mcconnell","Walls","Boyle","Mayer","Zuniga","Giles","Pineda","Pace","Hurley","Mays","Mcmillan","Crosby","Ayers","Case","Bentley","Shepard","Everett","Pugh","David","Mcmahon","Dunlap","Bender","Hahn","Harding","Acevedo","Raymond","Blackburn","Duffy","Landry","Dougherty","Bautista","Shah","Potts","Arroyo","Valentine","Meza","Gould","Vaughan","Fry","Rush","Avery","Herring","Dodson","Clements","Sampson","Tapia","Bean","Lynn","Crane","Farley","Cisneros","Benton","Ashley","Mckay","Finley","Best","Blevins","Friedman","Moses","Sosa","Blanchard","Huber","Frye","Krueger","Bernard","Rosario","Rubio","Mullen","Benjamin","Haley","Chung","Moyer","Choi","Horne","Yu","Woodward","Ali","Nixon","Hayden","Rivers","Estes","Mccarty","Richmond","Stuart","Maynard","Brandt","Oconnell","Hanna","Sanford","Sheppard","Church","Burch","Levy","Rasmussen","Coffey","Ponce","Faulkner","Donaldson","Schmitt","Novak","Costa","Montes","Booker","Cordova","Waller","Arellano","Maddox","Mata","Bonilla","Stanton","Compton","Kaufman","Dudley","Mcpherson","Beltran","Dickson","Mccann","Villegas","Proctor","Hester","Cantrell","Daugherty","Cherry","Bray","Davila","Rowland","Levine","Madden","Spence","Good","Irwin","Werner","Krause","Petty","Whitney","Baird","Hooper","Pollard","Zavala","Jarvis","Holden","Haas","Hendrix","Mcgrath","Bird","Lucero","Terrell","Riggs","Joyce","Mercer","Rollins","Galloway","Duke","Odom","Andersen","Downs","Hatfield","Benitez","Archer","Huerta","Travis","Mcneil","Hinton","Zhang","Hays","Mayo","Fritz","Branch","Mooney","Ewing","Ritter","Esparza","Frey","Braun","Gay","Riddle","Haney","Kaiser","Holder","Chaney","Mcknight","Gamble","Vang","Cooley","Carney","Cowan","Forbes","Ferrell","Davies","Barajas","Shea","Osborn","Bright","Cuevas","Bolton","Murillo","Lutz","Duarte","Kidd","Key","Cooke"];for(var e=1;e<=100;e++){var t={id:0,name:"",category:""};t.id=e,t.name=this.namesList[Math.floor(Math.random()*this.namesList.length)],t.category=this.categories[Math.floor(Math.random()*this.categories.length)],this.itemList.push(t)}}getDirectories(){return h.a.create(e=>new Promise(e=>setTimeout(()=>{console.log("directoriesLoaded"),e(this.DATA)},1e3)).then(t=>{e.next(t),e.complete()}))}getChunkData(e,t){return new Promise((n,l)=>{clearTimeout(this.timer),this.timer=setTimeout(()=>{if(e<this.itemList.length)return n(this.itemList.slice(e,e+t));l()},1e3+1e3*Math.random())})}getUseCases(){return h.a.create(e=>new Promise(e=>setTimeout(()=>{console.log("useCasesLoaded"),e(this.DATA)},500)).then(t=>{e.next(t),e.complete()}))}getData(e){return 0===e.length?this.DATA:(e.splice(Math.floor(Math.random()*e.length),1),e.push(this.DATA[Math.floor(Math.random()*this.DATA.length)]),e)}getFruits(){return[{id:1,itemName:"Apple",category:"fruits"},{id:2,itemName:"Banana",category:"fruits"},{id:5,itemName:"Tomatoe",category:"vegetables"},{id:6,itemName:"Potatoe",category:"vegetables"}]}getCountries(){return[{id:1,itemName:"India",category:"asia"},{id:2,itemName:"Singapore",category:"asia pacific"},{id:3,itemName:"Germany",category:"Europe"},{id:4,itemName:"France",category:"Europe"},{id:5,itemName:"South Korea",category:"asia"},{id:6,itemName:"Sweden",category:"Europe"}]}}class wc{constructor(e){this.mockService=e,this.itemList=[],this.selectedItems=[],this.settings={},this.directorySpecialties=[],this.useCases=[],this.dropdownSettings={},this.dropdownSettings2={},this.providerLocation={directorySpecialties:[{id:"PBMMedAdhr",name:"PBM Medication Adherence"},{id:"GapsInCare",name:"Gaps In Care"}],useCases:[{id:"UCTest3",name:"Use Case Test 3"},{id:"UCTest4",name:"Use Case Test 4"}]},this.directoriesDropdownStatus="closed",this.casesDropdownStatus="closed",this.cssgist=!1,this.title="Multiple Dropdowns in a page",this.tsgist="CuppaLabs/12225540c23c8a171a81f996fc8d9ca6",this.htmlgist="CuppaLabs/3788fb5437925b9d7d8edafec567639c",this.mockgist="CuppaLabs/b3e947ec83710307a3b8680a2ff89693",this.tstitle="multiple-dropdowns.ts",this.htmltitle="multiple-dropdowns.html",this.mocktitle="mock-data.ts"}ngOnInit(){this.dropdownSettings={text:"Select",enableSearchFilter:!0,labelKey:"name"},this.dropdownSettings2={text:"Select",enableSearchFilter:!0,labelKey:"name"},this.mockService.getDirectories().pipe(Object(ae.a)(e=>{this.directorySpecialties=e})).subscribe(),this.mockService.getUseCases().pipe(Object(ae.a)(e=>{this.useCases=e})).subscribe()}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}onDirectoriesOpen(e){this.directoriesDropdownStatus="open"}onDirectoriesClose(e){this.directoriesDropdownStatus="close"}onCasesOpen(e){this.casesDropdownStatus="open"}onCasesClose(e){this.casesDropdownStatus="close"}}var Sc=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function _c(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[7,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,10,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function Ic(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[7,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,11,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.mocktitle,"")),e(t,5,0,n.mockgist)},null)}function Ec(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,[" ",""])),(e()(),l["\u0275eld"](2,0,null,null,34,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,16,"div",[["class","form-group col-md-12"]],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,1,"label",[["for","directorySpecialties"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Directory Specialties"])),(e()(),l["\u0275eld"](6,0,null,null,3,"label",[["class","float-right"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,[" Directory Dropdown status: "])),(e()(),l["\u0275eld"](8,0,null,null,1,"b",[],null,null,null,null,null)),(e()(),l["\u0275ted"](9,null,["",""])),(e()(),l["\u0275eld"](10,0,null,null,9,"angular2-multiselect",[["id","directorySpecialties"],["name","directorySpecialties"]],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onOpen"],[null,"onClose"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,11).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.providerLocation.directorySpecialties=n)&&r),"onOpen"===t&&(r=!1!==i.onDirectoriesOpen(n)&&r),"onClose"===t&&(r=!1!==i.onDirectoriesClose(n)&&r),r},Ha,Ds)),l["\u0275did"](11,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onOpen:"onOpen",onClose:"onClose"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](17,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](19,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](20,0,null,null,16,"div",[["class","form-group col-md-12"]],null,null,null,null,null)),(e()(),l["\u0275eld"](21,0,null,null,1,"label",[["for","useCases"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Use Cases"])),(e()(),l["\u0275eld"](23,0,null,null,3,"label",[["class","float-right"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,[" Cases Dropdown status: "])),(e()(),l["\u0275eld"](25,0,null,null,1,"b",[],null,null,null,null,null)),(e()(),l["\u0275ted"](26,null,["",""])),(e()(),l["\u0275eld"](27,0,null,null,9,"angular2-multiselect",[["id","useCases"],["name","useCases"]],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onOpen"],[null,"onClose"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,28).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.providerLocation.useCases=n)&&r),"onOpen"===t&&(r=!1!==i.onCasesOpen(n)&&r),"onClose"===t&&(r=!1!==i.onCasesClose(n)&&r),r},Ha,Ds)),l["\u0275did"](28,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onOpen:"onOpen",onClose:"onClose"}),l["\u0275qud"](603979776,4,{itemTempl:0}),l["\u0275qud"](603979776,5,{badgeTempl:0}),l["\u0275qud"](603979776,6,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](34,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](36,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](37,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](39,0,null,null,16,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](40,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,7,{tabPanels:1}),(e()(),l["\u0275eld"](42,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](43,1228800,[[7,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,8,{templates:1}),(e()(),l["\u0275eld"](45,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](46,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](47,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](48,1228800,[[7,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,9,{templates:1}),(e()(),l["\u0275eld"](50,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](51,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,_c)),l["\u0275did"](53,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,Ic)),l["\u0275did"](55,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,11,0,n.directorySpecialties,n.dropdownSettings),e(t,17,0,"directorySpecialties",n.providerLocation.directorySpecialties),e(t,28,0,n.useCases,n.dropdownSettings2),e(t,34,0,"useCases",n.providerLocation.useCases),e(t,43,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,46,0,n.tsgist),e(t,48,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,51,0,n.htmlgist),e(t,53,0,n.cssgist),e(t,55,0,n.mockgist)},function(e,t){var n=t.component;e(t,1,0,n.title),e(t,9,0,n.directoriesDropdownStatus),e(t,10,0,l["\u0275nov"](t,11).defaultSettings.classes,l["\u0275nov"](t,19).ngClassUntouched,l["\u0275nov"](t,19).ngClassTouched,l["\u0275nov"](t,19).ngClassPristine,l["\u0275nov"](t,19).ngClassDirty,l["\u0275nov"](t,19).ngClassValid,l["\u0275nov"](t,19).ngClassInvalid,l["\u0275nov"](t,19).ngClassPending),e(t,26,0,n.casesDropdownStatus),e(t,27,0,l["\u0275nov"](t,28).defaultSettings.classes,l["\u0275nov"](t,36).ngClassUntouched,l["\u0275nov"](t,36).ngClassTouched,l["\u0275nov"](t,36).ngClassPristine,l["\u0275nov"](t,36).ngClassDirty,l["\u0275nov"](t,36).ngClassValid,l["\u0275nov"](t,36).ngClassInvalid,l["\u0275nov"](t,36).ngClassPending)})}function Dc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Ec,Sc)),l["\u0275did"](1,114688,null,0,wc,[Cc],null,null)],function(e,t){e(t,1,0)},null)}var xc=l["\u0275ccf"]("ng-component",wc,Dc,{},{},[]);class kc{constructor(e){this.mockService=e,this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Dynamic datasets loading",this.tsgist="CuppaLabs/302d580f91bc40611b2474558d98fbf2",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.mockgist="CuppaLabs/b3e947ec83710307a3b8680a2ff89693",this.tstitle="dynamicData.ts",this.htmltitle="dynamicData.html",this.mocktitle="mock-data.ts"}ngOnInit(){this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class"},this.loadDataSet2()}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}loadDataSet1(){this.settings={text:"Select Fruits",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class"},this.selectedItems=[],this.itemList=[];const e=this.mockService.getFruits();for(let t=0;t<e.length;++t)this.itemList.push(e[t])}loadDataSet2(){this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class"},this.selectedItems=[],this.itemList=[];const e=this.mockService.getCountries();for(let t=0;t<e.length;++t)this.itemList.push(e[t])}}var Ac=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Tc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function Rc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,8,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.mocktitle,"")),e(t,5,0,n.mockgist)},null)}function Oc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,1,"button",[["class","btn btn-success"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.loadDataSet1()&&l),l},null,null)),(e()(),l["\u0275ted"](-1,null,["Load dataset 1"])),(e()(),l["\u0275eld"](15,0,null,null,1,"button",[["class","btn btn-success"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.loadDataSet2()&&l),l},null,null)),(e()(),l["\u0275ted"](-1,null,["Load dataset 2"])),(e()(),l["\u0275eld"](17,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](19,0,null,null,16,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](20,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](22,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](23,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](25,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](26,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](27,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](28,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](30,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](31,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,Tc)),l["\u0275did"](33,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,Rc)),l["\u0275did"](35,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,23,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,26,0,n.tsgist),e(t,28,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,31,0,n.htmlgist),e(t,33,0,n.cssgist),e(t,35,0,n.mockgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function Nc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Oc,Ac)),l["\u0275did"](1,114688,null,0,kc,[Cc],null,null)],function(e,t){e(t,1,0)},null)}var Pc=l["\u0275ccf"]("ng-component",kc,Nc,{},{},[]);class Mc{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Basic example",this.tsgist="CuppaLabs/ee72fbc7b21dad7e4e7664c5b1553235",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.tstitle="basic.ts",this.htmltitle="basic.html"}ngOnInit(){this.itemList=[{countryId:1,itemName:"India"},{countryId:2,itemName:"Singapore"},{countryId:3,itemName:"Australia"},{countryId:4,itemName:"Canada"},{countryId:5,itemName:"South Korea"},{countryId:6,itemName:"Brazil"}],this.selectedItems=[{countryId:1,itemName:"India"},{countryId:2,itemName:"Singapore"},{countryId:3,itemName:"Australia"},{countryId:4,itemName:"Canada"}],this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class",primaryKey:"countryId"}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}}var Lc=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Fc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"]))],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function Vc(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Fc,Lc)),l["\u0275did"](1,114688,null,0,Mc,[],null,null)],function(e,t){e(t,1,0)},null)}var Bc=l["\u0275ccf"]("ng-component",Mc,Vc,{},{},[]);class jc{constructor(e){this.http=e,this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Data from remote API example",this.tsgist="CuppaLabs/ffb168ae28c36a9130ad5ce74b720c5d",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.tstitle="remoteData.ts",this.htmltitle="remoteData.html"}ngOnInit(){this.http.get("https://restcountries.eu/rest/v2/all").subscribe(e=>{console.log(e),this.itemList=e},e=>{}),this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class",primaryKey:"alpha3Code",labelKey:"name",groupBy:"region",enableSearchFilter:!0,searchBy:["name","capital"]}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}onSearch(e){console.log(e.target.value)}}class Hc{}class Uc{}class zc{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(e=>{const t=e.indexOf(":");if(t>0){const n=e.slice(0,t),l=n.toLowerCase(),r=e.slice(t+1).trim();this.maybeSetNormalizedName(n,l),this.headers.has(l)?this.headers.get(l).push(r):this.headers.set(l,[r])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let n=e[t];const l=t.toLowerCase();"string"==typeof n&&(n=[n]),n.length>0&&(this.headers.set(l,n),this.maybeSetNormalizedName(t,l))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof zc?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new zc;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof zc?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let n=e.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(e.name,t);const l=("a"===e.op?this.headers.get(t):void 0)||[];l.push(...n),this.headers.set(t,l);break;case"d":const r=e.value;if(r){let e=this.headers.get(t);if(!e)return;0===(e=e.filter(e=>-1===r.indexOf(e))).length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,e)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class $c{encodeKey(e){return qc(e)}encodeValue(e){return qc(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}function qc(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}class Wc{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new $c,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(e,t){const n=new Map;return e.length>0&&e.split("&").forEach(e=>{const l=e.indexOf("="),[r,i]=-1==l?[t.decodeKey(e),""]:[t.decodeKey(e.slice(0,l)),t.decodeValue(e.slice(l+1))],o=n.get(r)||[];o.push(i),n.set(r,o)}),n}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const n=e.fromObject[t];this.map.set(t,Array.isArray(n)?n:[n])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(e=>t+"="+this.encoder.encodeValue(e)).join("&")}).join("&")}clone(e){const t=new Wc({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat([e]),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(e.value),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let t=this.map.get(e.param)||[];const n=t.indexOf(e.value);-1!==n&&t.splice(n,1),t.length>0?this.map.set(e.param,t):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}function Gc(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer}function Kc(e){return"undefined"!=typeof Blob&&e instanceof Blob}function Zc(e){return"undefined"!=typeof FormData&&e instanceof FormData}class Qc{constructor(e,t,n,l){let r;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||l?(this.body=void 0!==n?n:null,r=l):r=n,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.params&&(this.params=r.params)),this.headers||(this.headers=new zc),this.params){const e=this.params.toString();if(0===e.length)this.urlWithParams=t;else{const n=t.indexOf("?");this.urlWithParams=t+(-1===n?"?":n<t.length-1?"&":"")+e}}else this.params=new Wc,this.urlWithParams=t}serializeBody(){return null===this.body?null:Gc(this.body)||Kc(this.body)||Zc(this.body)||"string"==typeof this.body?this.body:this.body instanceof Wc?this.body.toString():"object"==typeof this.body||"boolean"==typeof this.body||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return null===this.body?null:Zc(this.body)?null:Kc(this.body)?this.body.type||null:Gc(this.body)?null:"string"==typeof this.body?"text/plain":this.body instanceof Wc?"application/x-www-form-urlencoded;charset=UTF-8":"object"==typeof this.body||"number"==typeof this.body||Array.isArray(this.body)?"application/json":null}clone(e={}){const t=e.method||this.method,n=e.url||this.url,l=e.responseType||this.responseType,r=void 0!==e.body?e.body:this.body,i=void 0!==e.withCredentials?e.withCredentials:this.withCredentials,o=void 0!==e.reportProgress?e.reportProgress:this.reportProgress;let s=e.headers||this.headers,a=e.params||this.params;return void 0!==e.setHeaders&&(s=Object.keys(e.setHeaders).reduce((t,n)=>t.set(n,e.setHeaders[n]),s)),e.setParams&&(a=Object.keys(e.setParams).reduce((t,n)=>t.set(n,e.setParams[n]),a)),new Qc(t,n,r,{params:a,headers:s,reportProgress:o,responseType:l,withCredentials:i})}}const Yc=function(){var e={Sent:0,UploadProgress:1,ResponseHeader:2,DownloadProgress:3,Response:4,User:5};return e[e.Sent]="Sent",e[e.UploadProgress]="UploadProgress",e[e.ResponseHeader]="ResponseHeader",e[e.DownloadProgress]="DownloadProgress",e[e.Response]="Response",e[e.User]="User",e}();class Jc{constructor(e,t=200,n="OK"){this.headers=e.headers||new zc,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||n,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class Xc extends Jc{constructor(e={}){super(e),this.type=Yc.ResponseHeader}clone(e={}){return new Xc({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class ed extends Jc{constructor(e={}){super(e),this.type=Yc.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new ed({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class td extends Jc{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function nd(e,t){return{body:t,headers:e.headers,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}const ld=(()=>(class{constructor(e){this.handler=e}request(e,t,n={}){let l;if(e instanceof Qc)l=e;else{let r=void 0;r=n.headers instanceof zc?n.headers:new zc(n.headers);let i=void 0;n.params&&(i=n.params instanceof Wc?n.params:new Wc({fromObject:n.params})),l=new Qc(e,t,void 0!==n.body?n.body:null,{headers:r,params:i,reportProgress:n.reportProgress,responseType:n.responseType||"json",withCredentials:n.withCredentials})}const r=I(l).pipe(De(e=>this.handler.handle(e)));if(e instanceof Qc||"events"===n.observe)return r;const i=r.pipe(R(e=>e instanceof ed));switch(n.observe||"body"){case"body":switch(l.responseType){case"arraybuffer":return i.pipe(Object(ae.a)(e=>{if(null!==e.body&&!(e.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return e.body}));case"blob":return i.pipe(Object(ae.a)(e=>{if(null!==e.body&&!(e.body instanceof Blob))throw new Error("Response is not a Blob.");return e.body}));case"text":return i.pipe(Object(ae.a)(e=>{if(null!==e.body&&"string"!=typeof e.body)throw new Error("Response is not a string.");return e.body}));case"json":default:return i.pipe(Object(ae.a)(e=>e.body))}case"response":return i;default:throw new Error(`Unreachable: unhandled observe type ${n.observe}}`)}}delete(e,t={}){return this.request("DELETE",e,t)}get(e,t={}){return this.request("GET",e,t)}head(e,t={}){return this.request("HEAD",e,t)}jsonp(e,t){return this.request("JSONP",e,{params:(new Wc).append(t,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,t={}){return this.request("OPTIONS",e,t)}patch(e,t,n={}){return this.request("PATCH",e,nd(n,t))}post(e,t,n={}){return this.request("POST",e,nd(n,t))}put(e,t,n={}){return this.request("PUT",e,nd(n,t))}}))();class rd{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const id=new l.InjectionToken("HTTP_INTERCEPTORS"),od=(()=>(class{intercept(e,t){return t.handle(e)}}))(),sd=/^\)\]\}',?\n/;class ad{}const ud=(()=>(class{constructor(){}build(){return new XMLHttpRequest}}))(),cd=(()=>(class{constructor(e){this.xhrFactory=e}handle(e){if("JSONP"===e.method)throw new Error("Attempted to construct Jsonp request without JsonpClientModule installed.");return new h.a(t=>{const n=this.xhrFactory.build();if(n.open(e.method,e.urlWithParams),e.withCredentials&&(n.withCredentials=!0),e.headers.forEach((e,t)=>n.setRequestHeader(e,t.join(","))),e.headers.has("Accept")||n.setRequestHeader("Accept","application/json, text/plain, */*"),!e.headers.has("Content-Type")){const t=e.detectContentTypeHeader();null!==t&&n.setRequestHeader("Content-Type",t)}if(e.responseType){const t=e.responseType.toLowerCase();n.responseType="json"!==t?t:"text"}const l=e.serializeBody();let r=null;const i=()=>{if(null!==r)return r;const t=1223===n.status?204:n.status,l=n.statusText||"OK",i=new zc(n.getAllResponseHeaders()),o=function(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(n)||e.url;return r=new Xc({headers:i,status:t,statusText:l,url:o})},o=()=>{let{headers:l,status:r,statusText:o,url:s}=i(),a=null;204!==r&&(a=void 0===n.response?n.responseText:n.response),0===r&&(r=a?200:0);let u=r>=200&&r<300;if("json"===e.responseType&&"string"==typeof a){const e=a;a=a.replace(sd,"");try{a=""!==a?JSON.parse(a):null}catch(c){a=e,u&&(u=!1,a={error:c,text:a})}}u?(t.next(new ed({body:a,headers:l,status:r,statusText:o,url:s||void 0})),t.complete()):t.error(new td({error:a,headers:l,status:r,statusText:o,url:s||void 0}))},s=e=>{const{url:l}=i(),r=new td({error:e,status:n.status||0,statusText:n.statusText||"Unknown Error",url:l||void 0});t.error(r)};let a=!1;const u=l=>{a||(t.next(i()),a=!0);let r={type:Yc.DownloadProgress,loaded:l.loaded};l.lengthComputable&&(r.total=l.total),"text"===e.responseType&&n.responseText&&(r.partialText=n.responseText),t.next(r)},c=e=>{let n={type:Yc.UploadProgress,loaded:e.loaded};e.lengthComputable&&(n.total=e.total),t.next(n)};return n.addEventListener("load",o),n.addEventListener("error",s),e.reportProgress&&(n.addEventListener("progress",u),null!==l&&n.upload&&n.upload.addEventListener("progress",c)),n.send(l),t.next({type:Yc.Sent}),()=>{n.removeEventListener("error",s),n.removeEventListener("load",o),e.reportProgress&&(n.removeEventListener("progress",u),null!==l&&n.upload&&n.upload.removeEventListener("progress",c)),n.abort()}})}}))(),dd=new l.InjectionToken("XSRF_COOKIE_NAME"),hd=new l.InjectionToken("XSRF_HEADER_NAME");class pd{}const fd=(()=>(class{constructor(e,t,n){this.doc=e,this.platform=t,this.cookieName=n,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=Object(Y["\u0275parseCookieValue"])(e,this.cookieName),this.lastCookieString=e),this.lastToken}}))(),gd=(()=>(class{constructor(e,t){this.tokenService=e,this.headerName=t}intercept(e,t){const n=e.url.toLowerCase();if("GET"===e.method||"HEAD"===e.method||n.startsWith("http://")||n.startsWith("https://"))return t.handle(e);const l=this.tokenService.getToken();return null===l||e.headers.has(this.headerName)||(e=e.clone({headers:e.headers.set(this.headerName,l)})),t.handle(e)}}))(),md=(()=>(class{constructor(e,t){this.backend=e,this.injector=t,this.chain=null}handle(e){if(null===this.chain){const e=this.injector.get(id,[]);this.chain=e.reduceRight((e,t)=>new rd(e,t),this.backend)}return this.chain.handle(e)}}))(),vd=(()=>{class e{static disable(){return{ngModule:e,providers:[{provide:gd,useClass:od}]}}static withOptions(t={}){return{ngModule:e,providers:[t.cookieName?{provide:dd,useValue:t.cookieName}:[],t.headerName?{provide:hd,useValue:t.headerName}:[]]}}}return e})(),yd=(()=>(class{}))();var bd=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Cd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"label",[["style","color: #333;width: 150px;"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,0,"img",[["style","width: 30px; border: 1px solid #efefef;margin-right: 0px;"]],[[8,"src",4]],null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](4,null,["",""]))],null,function(e,t){e(t,1,0,t.context.item.name),e(t,2,0,t.context.item.flag),e(t,4,0,t.context.item.capital)})}function wd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[5,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,8,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function Sd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,[" ",""])),(e()(),l["\u0275eld"](2,0,null,null,14,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,13,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,3,"c-item",[],null,null,null,us,as)),l["\u0275did"](14,49152,[[1,4]],1,qo,[],null,null),l["\u0275qud"](335544320,4,{template:0}),(e()(),l["\u0275and"](0,[[4,2]],null,0,null,Cd)),(e()(),l["\u0275eld"](17,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](19,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](20,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,5,{tabPanels:1}),(e()(),l["\u0275eld"](22,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](23,1228800,[[5,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](25,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](26,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](27,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](28,1228800,[[5,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](30,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](31,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,wd)),l["\u0275did"](33,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,23,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,26,0,n.tsgist),e(t,28,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,31,0,n.htmlgist),e(t,33,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function _d(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Sd,bd)),l["\u0275did"](1,114688,null,0,jc,[ld],null,null)],function(e,t){e(t,1,0)},null)}var Id=l["\u0275ccf"]("ng-component",jc,_d,{},{},[]);class Ed{constructor(e){this.http=e,this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Custom Search / Search from API",this.tsgist="CuppaLabs/1bab5ecbbb22727eb0afe49848a454f0",this.htmlgist="CuppaLabs/7f0d8ea9f9cfe9eec2cc1699affd2c14",this.tstitle="customSearch.ts",this.htmltitle="customSearch.html"}ngOnInit(){this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class",primaryKey:"alpha3Code",labelKey:"name",noDataLabel:"Search Countries...",enableSearchFilter:!0,searchBy:["name","capital"]}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}onSearch(e){console.log(e.target.value),this.itemList=[],this.http.get("https://restcountries.eu/rest/v2/name/"+e.target.value+"?fulltext=true").subscribe(e=>{console.log(e),this.itemList=e},e=>{})}}var Dd=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function xd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,0,"input",[["placeholder","Search countries"],["style","border: none;width: 100%; height: 100%;outline: none;"],["type","text"]],null,[[null,"keyup"]],function(e,t,n){var l=!0;return"keyup"===t&&(l=!1!==e.component.onSearch(n)&&l),l},null,null))],null,null)}function kd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"label",[["style","color: #333;width: 150px;"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,0,"img",[["style","width: 30px; border: 1px solid #efefef;margin-right: 0px;"]],[[8,"src",4]],null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,1,"label",[],null,null,null,null,null)),(e()(),l["\u0275ted"](4,null,["",""]))],null,function(e,t){e(t,1,0,t.context.item.name),e(t,2,0,t.context.item.flag),e(t,4,0,t.context.item.capital)})}function Ad(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[6,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,9,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function Td(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,[" ",""])),(e()(),l["\u0275eld"](2,0,null,null,18,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,17,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,3,"c-search",[],null,null,null,ps,hs)),l["\u0275did"](14,49152,[[3,4]],1,Go,[],null,null),l["\u0275qud"](335544320,4,{template:0}),(e()(),l["\u0275and"](0,[[4,2]],null,0,null,xd)),(e()(),l["\u0275eld"](17,0,null,null,3,"c-item",[],null,null,null,us,as)),l["\u0275did"](18,49152,[[1,4]],1,qo,[],null,null),l["\u0275qud"](335544320,5,{template:0}),(e()(),l["\u0275and"](0,[[5,2]],null,0,null,kd)),(e()(),l["\u0275eld"](21,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](23,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](24,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,6,{tabPanels:1}),(e()(),l["\u0275eld"](26,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](27,1228800,[[6,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](29,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](30,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](31,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](32,1228800,[[6,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,8,{templates:1}),(e()(),l["\u0275eld"](34,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](35,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,Ad)),l["\u0275did"](37,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,27,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,30,0,n.tsgist),e(t,32,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,35,0,n.htmlgist),e(t,37,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function Rd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Td,Dd)),l["\u0275did"](1,114688,null,0,Ed,[ld],null,null)],function(e,t){e(t,1,0)},null)}var Od=l["\u0275ccf"]("ng-component",Ed,Rd,{},{},[]);class Nd{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.cssgist=!1,this.title="Search filter by one property / key",this.tsgist="CuppaLabs/f6acd1eb94c95df32f689260b1f38b4c",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.tstitle="searchFilterByProperty.ts",this.htmltitle="searchFilterByProperty.html"}ngOnInit(){this.itemList=[{id:1,itemName:"India",name:"IN"},{id:2,itemName:"Singapore",name:"SN"},{id:3,itemName:"Australia",name:"AU"},{id:4,itemName:"Canada",name:"CA"},{id:5,itemName:"South Korea",name:"SK"},{id:6,itemName:"Brazil",name:"BR"}],this.selectedItems=[{id:1,itemName:"India",name:"IN"},{id:2,itemName:"Singapore",name:"SN"},{id:3,itemName:"Australia",name:"AU"},{id:4,itemName:"Canada",name:"CA"}],this.settings={singleSelection:!1,text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,badgeShowLimit:3,searchBy:["itemName"],searchPlaceholderText:"Search by name"}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}}var Pd=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Md(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function Ld(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](15,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](16,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](18,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](19,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](21,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](22,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](23,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](24,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](26,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](27,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,Md)),l["\u0275did"](29,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,19,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,22,0,n.tsgist),e(t,24,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,27,0,n.htmlgist),e(t,29,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function Fd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Ld,Pd)),l["\u0275did"](1,114688,null,0,Nd,[],null,null)],function(e,t){e(t,1,0)},null)}var Vd=l["\u0275ccf"]("ng-component",Nd,Fd,{},{},[]);class Bd{constructor(e){this.appService=e,this.itemList=[],this.selectedItems=[],this.settings={},this.loading=!1,this.bufferSize=10,this.cssgist=!1,this.title="Lazy loading - Remote Data API",this.tsgist="CuppaLabs/3833720c12e23f6c8ee5fd870e38ad5b",this.htmlgist="CuppaLabs/72ebd8cfa40a23a74ccbeda6de98a1e8",this.tstitle="lazyLoadingRemoteData.ts",this.htmltitle="lazyLoadingRemoteData.html"}ngOnInit(){this.itemList=[],this.selectedItems=[],this.settings={text:"Select Items",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class",enableSearchFilter:!0,lazyLoading:!0,labelKey:"name",limitSelection:3}}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}onScroll(e){console.log(e)}onOpen(e){console.log(this.itemList)}fetchMore(e){e.endIndex===this.itemList.length-1&&(this.loading=!0,this.appService.getChunkData(this.itemList.length,this.bufferSize).then(e=>{this.itemList=this.itemList.concat(e),this.loading=!1},()=>this.loading=!1))}changeData(){this.selectedItems=[]}}var jd=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Hd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function Ud(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,17,"div",[["class","row"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,13,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],[null,"onOpen"],[null,"onScrollToEnd"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,5).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),"onOpen"===t&&(r=!1!==i.onOpen(n)&&r),"onScrollToEnd"===t&&(r=!1!==i.fetchMore(n)&&r),r},Ha,Ds)),l["\u0275did"](5,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"],loading:[2,"loading"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll",onOpen:"onOpen",onScrollToEnd:"onScrollToEnd"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](11,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](13,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](14,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),l["\u0275eld"](15,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),l["\u0275ted"](16,null,["Total Records : ",""])),(e()(),l["\u0275eld"](17,0,null,null,2,"div",[["class","col-md-4 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](18,0,null,null,1,"button",[["class","btn btn-danger"]],null,[[null,"click"]],function(e,t,n){var l=!0;return"click"===t&&(l=!1!==e.component.changeData()&&l),l},null,null)),(e()(),l["\u0275ted"](-1,null,["Reset"])),(e()(),l["\u0275eld"](20,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](22,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](23,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](25,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](26,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](28,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](29,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](30,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](31,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](33,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](34,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,Hd)),l["\u0275did"](36,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,5,0,n.itemList,n.settings,n.loading),e(t,11,0,n.selectedItems),e(t,26,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,29,0,n.tsgist),e(t,31,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,34,0,n.htmlgist),e(t,36,0,n.cssgist)},function(e,t){var n=t.component;e(t,1,0,n.title),e(t,4,0,l["\u0275nov"](t,5).defaultSettings.classes,l["\u0275nov"](t,13).ngClassUntouched,l["\u0275nov"](t,13).ngClassTouched,l["\u0275nov"](t,13).ngClassPristine,l["\u0275nov"](t,13).ngClassDirty,l["\u0275nov"](t,13).ngClassValid,l["\u0275nov"](t,13).ngClassInvalid,l["\u0275nov"](t,13).ngClassPending),e(t,16,0,n.itemList.length)})}function zd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Ud,jd)),l["\u0275did"](1,114688,null,0,Bd,[Cc],null,null)],function(e,t){e(t,1,0)},null)}var $d=l["\u0275ccf"]("ng-component",Bd,zd,{},{},[]);class qd{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.count=6,this.cssgist=!1,this.title="Search and Add New Item, if not found",this.tsgist="CuppaLabs/c1e00c870c3e3b9213e69e0a93518cc6",this.htmlgist="CuppaLabs/0583ba4be8b7c192d14f04375f96c074",this.tstitle="searchFilterAddNewItem.ts",this.htmltitle="searchFilter.html"}ngOnInit(){this.itemList=[{id:1,itemName:"India",name:"IN"},{id:2,itemName:"Singapore",name:"SN"},{id:3,itemName:"Australia",name:"AU"},{id:4,itemName:"Canada",name:"CA"},{id:5,itemName:"South Korea",name:"SK"},{id:6,itemName:"Brazil",name:"BR"}],this.selectedItems=[{id:1,itemName:"India",name:"IN"},{id:2,itemName:"Singapore",name:"SN"},{id:3,itemName:"Australia",name:"AU"},{id:4,itemName:"Canada",name:"CA"}],this.settings={singleSelection:!1,text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,addNewItemOnFilter:!0}}onAddItem(e){this.count++,this.itemList.push({id:this.count,itemName:e,name:e}),this.selectedItems.push({id:this.count,itemName:e,name:e})}onItemSelect(e){console.log(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}}var Wd=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Gd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function Kd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,10,"div",[["class","col-md-8 mr-auto ml-auto dropdown-container"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],[null,"onAddFilterNewItem"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,4).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),"onAddFilterNewItem"===t&&(r=!1!==i.onAddItem(n)&&r),r},Ha,Ds)),l["\u0275did"](4,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll",onAddFilterNewItem:"onAddFilterNewItem"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](10,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](12,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](13,0,null,null,4,"div",[["class","alert alert-warning"],["role","alert"]],null,null,null,null,null)),(e()(),l["\u0275eld"](14,0,null,null,1,"b",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["How this example works !! "])),(e()(),l["\u0275eld"](16,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,[" When you try to filter the list items, if no search results are available, you would see an 'Add' button. On clicking the add button, it would emit the text that you enter in the input field to your controlle in the callback method, as show in the below code. You can add this item to the data list. If you wish, that this item be selected, add it to selected items list. "])),(e()(),l["\u0275eld"](18,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](20,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](21,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](23,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](24,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](26,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](27,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](28,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](29,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](31,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](32,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,Gd)),l["\u0275did"](34,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.itemList,n.settings),e(t,10,0,n.selectedItems),e(t,24,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,27,0,n.tsgist),e(t,29,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,32,0,n.htmlgist),e(t,34,0,n.cssgist)},function(e,t){e(t,1,0,t.component.title),e(t,3,0,l["\u0275nov"](t,4).defaultSettings.classes,l["\u0275nov"](t,12).ngClassUntouched,l["\u0275nov"](t,12).ngClassTouched,l["\u0275nov"](t,12).ngClassPristine,l["\u0275nov"](t,12).ngClassDirty,l["\u0275nov"](t,12).ngClassValid,l["\u0275nov"](t,12).ngClassInvalid,l["\u0275nov"](t,12).ngClassPending)})}function Zd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Kd,Wd)),l["\u0275did"](1,114688,null,0,qd,[],null,null)],function(e,t){e(t,1,0)},null)}var Qd=l["\u0275ccf"]("ng-component",qd,Zd,{},{},[]);class Yd{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.selectedItemString="",this.unSelectedItemString="",this.openString="",this.closeString="",this.selectAllString="",this.unSelectAllString="",this.cssgist=!1,this.title="Events",this.tsgist="CuppaLabs/ee72fbc7b21dad7e4e7664c5b1553235",this.htmlgist="CuppaLabs/eb78d42ab7971fda6493586e329bfdb8",this.tstitle="basic.ts",this.htmltitle="basic.html"}ngOnInit(){this.itemList=[{countryId:1,itemName:"India"},{countryId:2,itemName:"Singapore"},{countryId:3,itemName:"Australia"},{countryId:4,itemName:"Canada"},{countryId:5,itemName:"South Korea"},{countryId:6,itemName:"Brazil"}],this.selectedItems=[{countryId:1,itemName:"India"},{countryId:2,itemName:"Singapore"},{countryId:3,itemName:"Australia"},{countryId:4,itemName:"Canada"}],this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",classes:"myclass custom-class",primaryKey:"countryId"}}onItemSelect(e){console.log(e),this.selectedItemString=JSON.stringify(e),console.log(this.selectedItems)}OnItemDeSelect(e){console.log(e),this.unSelectedItemString=JSON.stringify(e),console.log(this.selectedItems)}onOpen(e){this.openString="Dropdown opened: "+e}onClose(e){this.closeString="Dropdown opened: "+e}onSelectAll(e){console.log(e),this.selectAllString=JSON.stringify(e),this.unSelectAllString=""}onDeSelectAll(e){console.log(e),this.selectAllString="",this.unSelectAllString="all items un-selected"}}var Jd=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function Xd(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,77,"div",[["class","col-md-12 mr-auto ml-auto dropdown-container"],["style","height: auto;"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,13,"div",[["class","row"]],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,0,"div",[["class","col-md-2"]],null,null,null,null,null)),(e()(),l["\u0275eld"](5,0,null,null,10,"div",[["class","col-md-8"]],null,null,null,null,null)),(e()(),l["\u0275eld"](6,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],[null,"onOpen"],[null,"onClose"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,7).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItems=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),"onOpen"===t&&(r=!1!==i.onOpen(n)&&r),"onClose"===t&&(r=!1!==i.onClose(n)&&r),r},Ha,Ds)),l["\u0275did"](7,13615104,[["dropdownElem",4]],3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll",onOpen:"onOpen",onClose:"onClose"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](13,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](15,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275eld"](16,0,null,null,0,"div",[["class","col-md-2"]],null,null,null,null,null)),(e()(),l["\u0275eld"](17,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),l["\u0275eld"](18,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),l["\u0275eld"](19,0,null,null,60,"div",[["class","row"]],null,null,null,null,null)),(e()(),l["\u0275eld"](20,0,null,null,9,"div",[["class","col-md-4"]],null,null,null,null,null)),(e()(),l["\u0275eld"](21,0,null,null,1,"h5",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["On Select"])),(e()(),l["\u0275eld"](23,0,null,null,6,"textarea",[["class","output-text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==l["\u0275nov"](e,24)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,24).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,24)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,24)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedItemString=n)&&r),r},null,null)),l["\u0275did"](24,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](26,671744,null,0,ko,[[8,null],[8,null],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](28,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275ted"](-1,null,["Event output goes here...\n "])),(e()(),l["\u0275eld"](30,0,null,null,9,"div",[["class","col-md-4"]],null,null,null,null,null)),(e()(),l["\u0275eld"](31,0,null,null,1,"h5",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["On Un-select"])),(e()(),l["\u0275eld"](33,0,null,null,6,"textarea",[["class","output-text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==l["\u0275nov"](e,34)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,34).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,34)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,34)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.unSelectedItemString=n)&&r),r},null,null)),l["\u0275did"](34,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](36,671744,null,0,ko,[[8,null],[8,null],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](38,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275ted"](-1,null,["Event output goes here...\n "])),(e()(),l["\u0275eld"](40,0,null,null,9,"div",[["class","col-md-4"]],null,null,null,null,null)),(e()(),l["\u0275eld"](41,0,null,null,1,"h5",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["On Open"])),(e()(),l["\u0275eld"](43,0,null,null,6,"textarea",[["class","output-text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==l["\u0275nov"](e,44)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,44).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,44)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,44)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.openString=n)&&r),r},null,null)),l["\u0275did"](44,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](46,671744,null,0,ko,[[8,null],[8,null],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](48,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275ted"](-1,null,["Event output goes here...\n "])),(e()(),l["\u0275eld"](50,0,null,null,9,"div",[["class","col-md-4"]],null,null,null,null,null)),(e()(),l["\u0275eld"](51,0,null,null,1,"h5",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["On Close"])),(e()(),l["\u0275eld"](53,0,null,null,6,"textarea",[["class","output-text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==l["\u0275nov"](e,54)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,54).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,54)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,54)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.closeString=n)&&r),r},null,null)),l["\u0275did"](54,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](56,671744,null,0,ko,[[8,null],[8,null],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](58,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275ted"](-1,null,["Event output goes here...\n "])),(e()(),l["\u0275eld"](60,0,null,null,9,"div",[["class","col-md-4"]],null,null,null,null,null)),(e()(),l["\u0275eld"](61,0,null,null,1,"h5",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["On Select All"])),(e()(),l["\u0275eld"](63,0,null,null,6,"textarea",[["class","output-text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==l["\u0275nov"](e,64)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,64).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,64)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,64)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.selectAllString=n)&&r),r},null,null)),l["\u0275did"](64,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](66,671744,null,0,ko,[[8,null],[8,null],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](68,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275ted"](-1,null,["Event output goes here...\n "])),(e()(),l["\u0275eld"](70,0,null,null,9,"div",[["class","col-md-4"]],null,null,null,null,null)),(e()(),l["\u0275eld"](71,0,null,null,1,"h5",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["On Un-Select All"])),(e()(),l["\u0275eld"](73,0,null,null,6,"textarea",[["class","output-text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==l["\u0275nov"](e,74)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==l["\u0275nov"](e,74).onTouched()&&r),"compositionstart"===t&&(r=!1!==l["\u0275nov"](e,74)._compositionStart()&&r),"compositionend"===t&&(r=!1!==l["\u0275nov"](e,74)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.unSelectAllString=n)&&r),r},null,null)),l["\u0275did"](74,16384,null,0,ki,[l.Renderer2,l.ElementRef,[2,xi]],null,null),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[ki]),l["\u0275did"](76,671744,null,0,ko,[[8,null],[8,null],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](78,16384,null,0,Pi,[[4,Oi]],null,null),(e()(),l["\u0275ted"](-1,null,["Event output goes here...\n "])),(e()(),l["\u0275eld"](80,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](82,0,null,null,12,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](83,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](85,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](86,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](88,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](89,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](90,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](91,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](93,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](94,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,7,0,n.itemList,n.settings),e(t,13,0,n.selectedItems),e(t,26,0,n.selectedItemString),e(t,36,0,n.unSelectedItemString),e(t,46,0,n.openString),e(t,56,0,n.closeString),e(t,66,0,n.selectAllString),e(t,76,0,n.unSelectAllString),e(t,86,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,89,0,n.tsgist),e(t,91,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,94,0,n.htmlgist)},function(e,t){e(t,1,0,t.component.title),e(t,6,0,l["\u0275nov"](t,7).defaultSettings.classes,l["\u0275nov"](t,15).ngClassUntouched,l["\u0275nov"](t,15).ngClassTouched,l["\u0275nov"](t,15).ngClassPristine,l["\u0275nov"](t,15).ngClassDirty,l["\u0275nov"](t,15).ngClassValid,l["\u0275nov"](t,15).ngClassInvalid,l["\u0275nov"](t,15).ngClassPending),e(t,23,0,l["\u0275nov"](t,28).ngClassUntouched,l["\u0275nov"](t,28).ngClassTouched,l["\u0275nov"](t,28).ngClassPristine,l["\u0275nov"](t,28).ngClassDirty,l["\u0275nov"](t,28).ngClassValid,l["\u0275nov"](t,28).ngClassInvalid,l["\u0275nov"](t,28).ngClassPending),e(t,33,0,l["\u0275nov"](t,38).ngClassUntouched,l["\u0275nov"](t,38).ngClassTouched,l["\u0275nov"](t,38).ngClassPristine,l["\u0275nov"](t,38).ngClassDirty,l["\u0275nov"](t,38).ngClassValid,l["\u0275nov"](t,38).ngClassInvalid,l["\u0275nov"](t,38).ngClassPending),e(t,43,0,l["\u0275nov"](t,48).ngClassUntouched,l["\u0275nov"](t,48).ngClassTouched,l["\u0275nov"](t,48).ngClassPristine,l["\u0275nov"](t,48).ngClassDirty,l["\u0275nov"](t,48).ngClassValid,l["\u0275nov"](t,48).ngClassInvalid,l["\u0275nov"](t,48).ngClassPending),e(t,53,0,l["\u0275nov"](t,58).ngClassUntouched,l["\u0275nov"](t,58).ngClassTouched,l["\u0275nov"](t,58).ngClassPristine,l["\u0275nov"](t,58).ngClassDirty,l["\u0275nov"](t,58).ngClassValid,l["\u0275nov"](t,58).ngClassInvalid,l["\u0275nov"](t,58).ngClassPending),e(t,63,0,l["\u0275nov"](t,68).ngClassUntouched,l["\u0275nov"](t,68).ngClassTouched,l["\u0275nov"](t,68).ngClassPristine,l["\u0275nov"](t,68).ngClassDirty,l["\u0275nov"](t,68).ngClassValid,l["\u0275nov"](t,68).ngClassInvalid,l["\u0275nov"](t,68).ngClassPending),e(t,73,0,l["\u0275nov"](t,78).ngClassUntouched,l["\u0275nov"](t,78).ngClassTouched,l["\u0275nov"](t,78).ngClassPristine,l["\u0275nov"](t,78).ngClassDirty,l["\u0275nov"](t,78).ngClassValid,l["\u0275nov"](t,78).ngClassInvalid,l["\u0275nov"](t,78).ngClassPending)})}function eh(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,Xd,Jd)),l["\u0275did"](1,114688,null,0,Yd,[],null,null)],function(e,t){e(t,1,0)},null)}var th=l["\u0275ccf"]("ng-component",Yd,eh,{},{},[]);class nh{constructor(){this.itemList=[],this.selectedItems=[],this.settings={},this.customers=[],this.cssgist=!1,this.title="Using in List - Inside `for loop`",this.tsgist="CuppaLabs/0d2dc802967cca16ffc5053d0b873aba",this.htmlgist="CuppaLabs/85fb2b925a56c2e533e321ae09de0e2f",this.tstitle="usingInList.ts",this.htmltitle="usingInList.html"}ngOnInit(){this.customers=[{name:"Toshiba",countries:[{category:"asia",id:1,itemName:"India",capital:"Delhi",image:"http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg"},{category:"asia",id:2,itemName:"Singapore",capital:"Singapore",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg"}]},{name:"Apple",countries:[]},{name:"Samsung",countries:[]},{name:"MI",countries:[{category:"asia",id:1,itemName:"India",capital:"Delhi",image:"http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg"},{category:"asia",id:2,itemName:"Singapore",capital:"Singapore",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg"}]},{name:"Google",countries:[]}],this.itemList=[{category:"asia",id:1,itemName:"India",capital:"Delhi",image:"http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg"},{category:"asia",id:2,itemName:"Singapore",capital:"Singapore",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg"},{category:"europe",id:3,itemName:"United Kingdom",capital:"London",image:"http://www.sciencekids.co.nz/images/pictures/flags96/United_Kingdom.jpg"},{category:"northamerica",id:4,itemName:"Canada",capital:"Ottawa",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Canada.jpg"},{category:"asia",id:5,itemName:"South Korea",capital:"Seoul",image:"http://www.sciencekids.co.nz/images/pictures/flags96/South_Korea.jpg"},{category:"latinamerica",id:6,itemName:"Brazil",capital:"Brasilia",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Brazil.jpg"}],this.selectedItems=[{category:"asia",id:1,itemName:"India",capital:"Delhi",image:"http://www.sciencekids.co.nz/images/pictures/flags96/India.jpg"},{category:"asia",id:2,itemName:"Singapore",capital:"Singapore",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Singapore.jpg"},{category:"europe",id:3,itemName:"United Kingdom",capital:"London",image:"http://www.sciencekids.co.nz/images/pictures/flags96/United_Kingdom.jpg"},{category:"northamerica",id:4,itemName:"Canada",capital:"Ottawa",image:"http://www.sciencekids.co.nz/images/pictures/flags96/Canada.jpg"}],this.settings={text:"Select Countries",selectAllText:"Select All",unSelectAllText:"UnSelect All",enableSearchFilter:!0,classes:"myclass custom-class",showCheckbox:!0}}onItemSelect(e){console.log(this.customers)}OnItemDeSelect(e){console.log(e),console.log(this.selectedItems)}onSelectAll(e){console.log(e)}onDeSelectAll(e){console.log(e)}onGroupSelect(e){console.log(e)}onGroupDeSelect(e){console.log(e)}}var lh=l["\u0275crt"]({encapsulation:2,styles:[],data:{}});function rh(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,13,"tr",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,1,"td",[],null,null,null,null,null)),(e()(),l["\u0275ted"](2,null,[" "," "])),(e()(),l["\u0275eld"](3,0,null,null,10,"td",[],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,9,"angular2-multiselect",[],[[8,"className",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onSelect"],[null,"onDeSelect"],[null,"onSelectAll"],[null,"onDeSelectAll"],["document","keyup.escape"]],function(e,t,n){var r=!0,i=e.component;return"document:keyup.escape"===t&&(r=!1!==l["\u0275nov"](e,5).onEscapeDown(n)&&r),"ngModelChange"===t&&(r=!1!==(e.context.$implicit.countries=n)&&r),"onSelect"===t&&(r=!1!==i.onItemSelect(n)&&r),"onDeSelect"===t&&(r=!1!==i.OnItemDeSelect(n)&&r),"onSelectAll"===t&&(r=!1!==i.onSelectAll(n)&&r),"onDeSelectAll"===t&&(r=!1!==i.onDeSelectAll(n)&&r),r},Ha,Ds)),l["\u0275did"](5,13615104,null,3,os,[l.ElementRef,l.ChangeDetectorRef,zo],{data:[0,"data"],settings:[1,"settings"]},{onSelect:"onSelect",onDeSelect:"onDeSelect",onSelectAll:"onSelectAll",onDeSelectAll:"onDeSelectAll"}),l["\u0275qud"](603979776,1,{itemTempl:0}),l["\u0275qud"](603979776,2,{badgeTempl:0}),l["\u0275qud"](603979776,3,{searchTempl:0}),l["\u0275prd"](1024,null,Fi,function(e){return[e]},[os]),l["\u0275prd"](1024,null,Ei,function(e){return[e]},[os]),l["\u0275did"](11,671744,null,0,ko,[[8,null],[6,Fi],[8,null],[6,Ei]],{model:[0,"model"]},{update:"ngModelChange"}),l["\u0275prd"](2048,null,Oi,null,[ko]),l["\u0275did"](13,16384,null,0,Pi,[[4,Oi]],null,null)],function(e,t){var n=t.component;e(t,5,0,n.itemList,n.settings),e(t,11,0,t.context.$implicit.countries)},function(e,t){e(t,2,0,t.context.$implicit.name),e(t,4,0,l["\u0275nov"](t,5).defaultSettings.classes,l["\u0275nov"](t,13).ngClassUntouched,l["\u0275nov"](t,13).ngClassTouched,l["\u0275nov"](t,13).ngClassPristine,l["\u0275nov"](t,13).ngClassDirty,l["\u0275nov"](t,13).ngClassValid,l["\u0275nov"](t,13).ngClassInvalid,l["\u0275nov"](t,13).ngClassPending)})}function ih(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,5,"span",[],null,null,null,null,null)),(e()(),l["\u0275eld"](1,16777216,null,null,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](2,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,7,{templates:1}),(e()(),l["\u0275eld"](4,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](5,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null)],function(e,t){var n=t.component;e(t,2,0,l["\u0275inlineInterpolate"](1,"",n.csstitle,"")),e(t,5,0,n.cssgist)},null)}function oh(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"h2",[["class","example-title"],["style","margin-bottom: 10px;"]],null,null,null,null,null)),(e()(),l["\u0275ted"](1,null,["",""])),(e()(),l["\u0275eld"](2,0,null,null,12,"div",[["class","col-md-12 pl-0 pr-0 dropdown-container"],["style","height: auto;"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,9,"table",[["class","table table-bordered"]],null,null,null,null,null)),(e()(),l["\u0275eld"](4,0,null,null,5,"thead",[["class","thead-dark"]],null,null,null,null,null)),(e()(),l["\u0275eld"](5,0,null,null,4,"tr",[],null,null,null,null,null)),(e()(),l["\u0275eld"](6,0,null,null,1,"th",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,[" Customer "])),(e()(),l["\u0275eld"](8,0,null,null,1,"th",[],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,[" Countries "])),(e()(),l["\u0275eld"](10,0,null,null,2,"tbody",[],null,null,null,null,null)),(e()(),l["\u0275and"](16777216,null,null,1,null,rh)),l["\u0275did"](12,278528,null,0,Y.NgForOf,[l.ViewContainerRef,l.TemplateRef,l.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(e()(),l["\u0275ted"](13,null,[" ","\n"])),l["\u0275pid"](0,Y.JsonPipe,[]),(e()(),l["\u0275eld"](15,0,null,null,1,"h4",[["class","example-title code-section"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Code"])),(e()(),l["\u0275eld"](17,0,null,null,14,"p-tabView",[],null,null,null,bi,mi)),l["\u0275did"](18,1097728,null,1,Yr.TabView,[l.ElementRef],null,null),l["\u0275qud"](603979776,4,{tabPanels:1}),(e()(),l["\u0275eld"](20,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](21,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,5,{templates:1}),(e()(),l["\u0275eld"](23,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](24,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275eld"](25,16777216,null,0,4,"p-tabPanel",[],null,null,null,gi,di)),l["\u0275did"](26,1228800,[[4,4]],1,Yr.TabPanel,[l.ViewContainerRef],{header:[0,"header"]},null),l["\u0275qud"](603979776,6,{templates:1}),(e()(),l["\u0275eld"](28,0,null,0,1,"ng2-gist",[],null,null,null,Si,wi)),l["\u0275did"](29,4243456,null,0,Ci,[],{gistId:[0,"gistId"]},null),(e()(),l["\u0275and"](16777216,null,0,1,null,ih)),l["\u0275did"](31,16384,null,0,Y.NgIf,[l.ViewContainerRef,l.TemplateRef],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,12,0,n.customers),e(t,21,0,l["\u0275inlineInterpolate"](1,"",n.tstitle,"")),e(t,24,0,n.tsgist),e(t,26,0,l["\u0275inlineInterpolate"](1,"",n.htmltitle,"")),e(t,29,0,n.htmlgist),e(t,31,0,n.cssgist)},function(e,t){var n=t.component;e(t,1,0,n.title),e(t,13,0,l["\u0275unv"](t,13,0,l["\u0275nov"](t,14).transform(n.customers)))})}function sh(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"ng-component",[],null,null,null,oh,lh)),l["\u0275did"](1,114688,null,0,nh,[],null,null)],function(e,t){e(t,1,0)},null)}var ah=l["\u0275ccf"]("ng-component",nh,sh,{},{},[]);function uh(e,t){return new h.a(t?n=>t.schedule(ch,0,{error:e,subscriber:n}):t=>t.error(e))}function ch({error:e,subscriber:t}){t.error(e)}function dh(e,t,n,l){return Object(Ae.a)(n)&&(l=n,n=void 0),l?dh(e,t,n).pipe(Object(ae.a)(e=>Object(b.a)(e)?l(...e):l(e))):new h.a(l=>{!function e(t,n,l,r,i){let o;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(t)){const e=t;t.addEventListener(n,l,i),o=(()=>e.removeEventListener(n,l,i))}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(t)){const e=t;t.on(n,l),o=(()=>e.off(n,l))}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(t)){const e=t;t.addListener(n,l),o=(()=>e.removeListener(n,l))}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(let o=0,s=t.length;o<s;o++)e(t[o],n,l,r,i)}r.add(o)}(e,t,function(e){l.next(arguments.length>1?Array.prototype.slice.call(arguments):e)},l,n)})}const hh=new h.a(ke.a);var ph=n("VRyK"),fh=n("oB13");const gh=(()=>{class e{constructor(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}}accept(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)}toObservable(){switch(this.kind){case"N":return I(this.value);case"E":return uh(this.error);case"C":return F()}throw new Error("unexpected notification kind value")}static createNext(t){return void 0!==t?new e("N",t):e.undefinedValueNotification}static createError(t){return new e("E",void 0,t)}static createComplete(){return e.completeNotification}}return e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e})();class mh{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new vh(e,this.delay,this.scheduler))}}class vh extends T.a{constructor(e,t,n){super(e),this.delay=t,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,n=t.queue,l=e.scheduler,r=e.destination;for(;n.length>0&&n[0].time-l.now()<=0;)n.shift().notification.observe(r);if(n.length>0){const t=Math.max(0,n[0].time-l.now());this.schedule(e,t)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(vh.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,n=new yh(t.now()+this.delay,e);this.queue.push(n),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(gh.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(gh.createComplete()),this.unsubscribe()}}class yh{constructor(e,t){this.time=e,this.notification=t}}const bh="Service workers are disabled or not supported by this browser";class Ch{constructor(e){if(this.serviceWorker=e,e){const t=dh(e,"controllerchange").pipe(Object(ae.a)(()=>e.controller)),n=x(se(()=>I(e.controller)),t);this.worker=n.pipe(R(e=>!!e)),this.registration=this.worker.pipe(Ce(()=>e.getRegistration()));const l=dh(e,"message").pipe(Object(ae.a)(e=>e.data)).pipe(R(e=>e&&e.type)).pipe(Object(fh.a)(new X.a));l.connect(),this.events=l}else this.worker=this.events=this.registration=(t=bh,se(()=>uh(new Error(t))));var t}postMessage(e,t){return this.worker.pipe(V(1),Te(n=>{n.postMessage(Object.assign({action:e},t))})).toPromise().then(()=>void 0)}postMessageWithStatus(e,t,n){const l=this.waitForStatus(n),r=this.postMessage(e,t);return Promise.all([l,r]).then(()=>void 0)}generateNonce(){return Math.round(1e7*Math.random())}eventsOfType(e){return this.events.pipe(R(t=>t.type===e))}nextEventOfType(e){return this.eventsOfType(e).pipe(V(1))}waitForStatus(e){return this.eventsOfType("STATUS").pipe(R(t=>t.nonce===e),V(1),Object(ae.a)(e=>{if(!e.status)throw new Error(e.error)})).toPromise()}get isEnabled(){return!!this.serviceWorker}}const wh=(()=>(class{constructor(e){if(this.sw=e,this.subscriptionChanges=new X.a,!e.isEnabled)return this.messages=hh,this.notificationClicks=hh,void(this.subscription=hh);this.messages=this.sw.eventsOfType("PUSH").pipe(Object(ae.a)(e=>e.data)),this.notificationClicks=this.sw.eventsOfType("NOTIFICATION_CLICK").pipe(Object(ae.a)(e=>e.data)),this.pushManager=this.sw.registration.pipe(Object(ae.a)(e=>e.pushManager));const t=this.pushManager.pipe(Ce(e=>e.getSubscription()));this.subscription=Object(ph.a)(t,this.subscriptionChanges)}get isEnabled(){return this.sw.isEnabled}requestSubscription(e){if(!this.sw.isEnabled)return Promise.reject(new Error(bh));const t={userVisibleOnly:!0};let n=this.decodeBase64(e.serverPublicKey.replace(/_/g,"/").replace(/-/g,"+")),l=new Uint8Array(new ArrayBuffer(n.length));for(let r=0;r<n.length;r++)l[r]=n.charCodeAt(r);return t.applicationServerKey=l,this.pushManager.pipe(Ce(e=>e.subscribe(t)),V(1)).toPromise().then(e=>(this.subscriptionChanges.next(e),e))}unsubscribe(){return this.sw.isEnabled?this.subscription.pipe(V(1),Ce(e=>{if(null===e)throw new Error("Not subscribed to push notifications.");return e.unsubscribe().then(e=>{if(!e)throw new Error("Unsubscribe failed!");this.subscriptionChanges.next(null)})})).toPromise():Promise.reject(new Error(bh))}decodeBase64(e){return atob(e)}}))(),Sh=(()=>(class{constructor(e){if(this.sw=e,!e.isEnabled)return this.available=hh,void(this.activated=hh);this.available=this.sw.eventsOfType("UPDATE_AVAILABLE"),this.activated=this.sw.eventsOfType("UPDATE_ACTIVATED")}get isEnabled(){return this.sw.isEnabled}checkForUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(bh));const e=this.sw.generateNonce();return this.sw.postMessageWithStatus("CHECK_FOR_UPDATES",{statusNonce:e},e)}activateUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(bh));const e=this.sw.generateNonce();return this.sw.postMessageWithStatus("ACTIVATE_UPDATE",{statusNonce:e},e)}}))();class _h{}const Ih=new l.InjectionToken("NGSW_REGISTER_SCRIPT");function Eh(e,t,n,r){return()=>{if(!(Object(Y.isPlatformBrowser)(r)&&"serviceWorker"in navigator&&!1!==n.enabled))return;let i;if(navigator.serviceWorker.addEventListener("controllerchange",()=>{null!==navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({action:"INITIALIZE"})}),"function"==typeof n.registrationStrategy)i=n.registrationStrategy();else{const[t,...r]=(n.registrationStrategy||"registerWhenStable").split(":");switch(t){case"registerImmediately":i=I(null);break;case"registerWithDelay":i=I(null).pipe(function(e,t=y){var n;const l=(n=e)instanceof Date&&!isNaN(+n)?+e-t.now():Math.abs(e);return e=>e.lift(new mh(l,t))}(+r[0]||0));break;case"registerWhenStable":i=e.get(l.ApplicationRef).isStable.pipe(R(e=>e));break;default:throw new Error(`Unknown ServiceWorker registration strategy: ${n.registrationStrategy}`)}}i.pipe(V(1)).subscribe(()=>navigator.serviceWorker.register(t,{scope:n.scope}).catch(e=>console.error("Service worker registration failed with:",e)))}}function Dh(e,t){return new Ch(Object(Y.isPlatformBrowser)(t)&&!1!==e.enabled?navigator.serviceWorker:void 0)}const xh=(()=>{class e{static register(t,n={}){return{ngModule:e,providers:[{provide:Ih,useValue:t},{provide:_h,useValue:n},{provide:Ch,useFactory:Dh,deps:[_h,l.PLATFORM_ID]},{provide:l.APP_INITIALIZER,useFactory:Eh,deps:[l.Injector,Ih,_h,l.PLATFORM_ID],multi:!0}]}}}return e})();var kh=l["\u0275crt"]({encapsulation:0,styles:[[".left-sidebar[_ngcontent-%COMP%]{position:fixed;top:65px;height:calc(100vh - 75px);padding-right:0;overflow:hidden}.left-sidebar[_ngcontent-%COMP%], .right-sidebar[_ngcontent-%COMP%]{width:260px}.left-sidebar[_ngcontent-%COMP%]:hover{overflow:auto}.outer-wrapper[_ngcontent-%COMP%]{padding:30px}.center-content[_ngcontent-%COMP%]{background:#fff;border:1px solid rgba(0,0,0,.125);border-radius:3px;padding:15px;margin-left:0;margin-top:0}@media (min-width:768px){.center-content[_ngcontent-%COMP%]{margin-left:265px}}.nav-sub[_ngcontent-%COMP%]{width:100%;box-shadow:none;margin-bottom:6px;padding:0;margin-top:50px}.nav-wrapper[_ngcontent-%COMP%]{padding:0 10px}.list-group-item[_ngcontent-%COMP%]{padding-top:.5rem;padding-bottom:.5rem}"]],data:{}});function Ah(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,295,"div",[["class","row"]],null,null,null,null,null)),(e()(),l["\u0275eld"](1,0,null,null,126,"nav",[["class","navbar navbar-expand-lg nav-sub navbar-light d-md-none d-lg-none"]],null,null,null,null,null)),(e()(),l["\u0275eld"](2,0,null,null,4,"div",[["class","nav-wrapper"]],null,null,null,null,null)),(e()(),l["\u0275eld"](3,0,null,null,1,"a",[["class","navbar-brand"],["href","#"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,["Examples"])),(e()(),l["\u0275eld"](5,0,null,null,1,"button",[["aria-controls","navbarSupportedContent"],["aria-expanded","false"],["aria-label","Toggle navigation"],["class","navbar-toggler"],["data-target","#navbarSupportedContent"],["data-toggle","collapse"],["type","button"]],null,null,null,null,null)),(e()(),l["\u0275eld"](6,0,null,null,0,"span",[["class","fas fa-angle-down"]],null,null,null,null,null)),(e()(),l["\u0275eld"](7,0,null,null,120,"div",[["class","collapse navbar-collapse"],["id","navbarSupportedContent"]],null,null,null,null,null)),(e()(),l["\u0275eld"](8,0,null,null,119,"div",[["class","list-group"]],null,null,null,null,null)),(e()(),l["\u0275eld"](9,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,10).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](10,671744,[[2,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](11,1),l["\u0275did"](12,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,1,{links:1}),l["\u0275qud"](603979776,2,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Multiselect basic example"])),(e()(),l["\u0275eld"](16,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,17).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](17,671744,[[4,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](18,1),l["\u0275did"](19,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,3,{links:1}),l["\u0275qud"](603979776,4,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Single selection"])),(e()(),l["\u0275eld"](23,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,24).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](24,671744,[[6,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](25,1),l["\u0275did"](26,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,5,{links:1}),l["\u0275qud"](603979776,6,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Search filter"])),(e()(),l["\u0275eld"](30,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,31).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](31,671744,[[8,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](32,1),l["\u0275did"](33,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,7,{links:1}),l["\u0275qud"](603979776,8,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Group By"])),(e()(),l["\u0275eld"](37,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,38).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](38,671744,[[10,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](39,1),l["\u0275did"](40,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,9,{links:1}),l["\u0275qud"](603979776,10,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Templating"])),(e()(),l["\u0275eld"](44,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,45).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](45,671744,[[12,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](46,1),l["\u0275did"](47,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,11,{links:1}),l["\u0275qud"](603979776,12,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Using in Template Driven Forms"])),(e()(),l["\u0275eld"](51,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,52).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](52,671744,[[14,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](53,1),l["\u0275did"](54,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,13,{links:1}),l["\u0275qud"](603979776,14,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Using in Reactive Forms"])),(e()(),l["\u0275eld"](58,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,59).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](59,671744,[[16,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](60,1),l["\u0275did"](61,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,15,{links:1}),l["\u0275qud"](603979776,16,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Lazy Loading"])),(e()(),l["\u0275eld"](65,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,66).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](66,671744,[[18,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](67,1),l["\u0275did"](68,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,17,{links:1}),l["\u0275qud"](603979776,18,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Lazy Loading Data from API"])),(e()(),l["\u0275eld"](72,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,73).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](73,671744,[[20,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](74,1),l["\u0275did"](75,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,19,{links:1}),l["\u0275qud"](603979776,20,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Using in List for loop"])),(e()(),l["\u0275eld"](79,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,80).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](80,671744,[[22,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](81,1),l["\u0275did"](82,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,21,{links:1}),l["\u0275qud"](603979776,22,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Reset dropdown"])),(e()(),l["\u0275eld"](86,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,87).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](87,671744,[[24,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](88,1),l["\u0275did"](89,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,23,{links:1}),l["\u0275qud"](603979776,24,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Disable dropdown"])),(e()(),l["\u0275eld"](93,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,94).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](94,671744,[[26,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](95,1),l["\u0275did"](96,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,25,{links:1}),l["\u0275qud"](603979776,26,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Limit selection"])),(e()(),l["\u0275eld"](100,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,101).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](101,671744,[[28,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](102,1),l["\u0275did"](103,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,27,{links:1}),l["\u0275qud"](603979776,28,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Limit Badges"])),(e()(),l["\u0275eld"](107,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,108).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](108,671744,[[30,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](109,1),l["\u0275did"](110,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,29,{links:1}),l["\u0275qud"](603979776,30,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Custom placeholder"])),(e()(),l["\u0275eld"](114,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,115).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](115,671744,[[32,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](116,1),l["\u0275did"](117,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,31,{links:1}),l["\u0275qud"](603979776,32,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["CSS Styling"])),(e()(),l["\u0275eld"](121,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,122).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](122,671744,[[34,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](123,1),l["\u0275did"](124,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,33,{links:1}),l["\u0275qud"](603979776,34,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Theming"])),(e()(),l["\u0275eld"](128,0,null,null,164,"div",[["class","col-md-3 pl-0 pr-0 left-sidebar d-none d-md-block d-lg-block"]],null,null,null,null,null)),(e()(),l["\u0275eld"](129,0,null,null,163,"div",[["class","list-group"]],null,null,null,null,null)),(e()(),l["\u0275eld"](130,0,null,null,1,"a",[["class","list-group-item list-group-item-action disabled"],["href","#"]],null,null,null,null,null)),(e()(),l["\u0275ted"](-1,null,[" Examples "])),(e()(),l["\u0275eld"](132,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,133).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](133,671744,[[36,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](134,1),l["\u0275did"](135,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,35,{links:1}),l["\u0275qud"](603979776,36,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Multiselect basic example"])),(e()(),l["\u0275eld"](139,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,140).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](140,671744,[[38,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](141,1),l["\u0275did"](142,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,37,{links:1}),l["\u0275qud"](603979776,38,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Single selection"])),(e()(),l["\u0275eld"](146,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,147).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](147,671744,[[40,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](148,1),l["\u0275did"](149,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,39,{links:1}),l["\u0275qud"](603979776,40,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Search filter"])),(e()(),l["\u0275eld"](153,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,154).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](154,671744,[[42,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](155,1),l["\u0275did"](156,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,41,{links:1}),l["\u0275qud"](603979776,42,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Custom Search / Search API"])),(e()(),l["\u0275eld"](160,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,161).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](161,671744,[[44,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](162,1),l["\u0275did"](163,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,43,{links:1}),l["\u0275qud"](603979776,44,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Search Filter By one Property/key"])),(e()(),l["\u0275eld"](167,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,168).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](168,671744,[[46,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](169,1),l["\u0275did"](170,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,45,{links:1}),l["\u0275qud"](603979776,46,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Search and Add New Item"])),(e()(),l["\u0275eld"](174,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,175).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](175,671744,[[48,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](176,1),l["\u0275did"](177,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,47,{links:1}),l["\u0275qud"](603979776,48,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Group By"])),(e()(),l["\u0275eld"](181,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,182).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](182,671744,[[50,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](183,1),l["\u0275did"](184,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,49,{links:1}),l["\u0275qud"](603979776,50,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Templating"])),(e()(),l["\u0275eld"](188,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,189).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](189,671744,[[52,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](190,1),l["\u0275did"](191,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,51,{links:1}),l["\u0275qud"](603979776,52,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Using in Template Driven Forms"])),(e()(),l["\u0275eld"](195,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,196).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](196,671744,[[54,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](197,1),l["\u0275did"](198,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,53,{links:1}),l["\u0275qud"](603979776,54,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Using in Reactive Forms"])),(e()(),l["\u0275eld"](202,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,203).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](203,671744,[[56,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](204,1),l["\u0275did"](205,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,55,{links:1}),l["\u0275qud"](603979776,56,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Virtual Scrolling"])),(e()(),l["\u0275eld"](209,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,210).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](210,671744,[[58,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](211,1),l["\u0275did"](212,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,57,{links:1}),l["\u0275qud"](603979776,58,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Lazy Loading Data from API"])),(e()(),l["\u0275eld"](216,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,217).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](217,671744,[[60,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](218,1),l["\u0275did"](219,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,59,{links:1}),l["\u0275qud"](603979776,60,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Data from remote API"])),(e()(),l["\u0275eld"](223,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,224).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](224,671744,[[62,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](225,1),l["\u0275did"](226,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,61,{links:1}),l["\u0275qud"](603979776,62,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Using in List for loop"])),(e()(),l["\u0275eld"](230,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,231).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](231,671744,[[64,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](232,1),l["\u0275did"](233,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,63,{links:1}),l["\u0275qud"](603979776,64,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Multiple dropdowns in a page"])),(e()(),l["\u0275eld"](237,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,238).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](238,671744,[[66,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](239,1),l["\u0275did"](240,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,65,{links:1}),l["\u0275qud"](603979776,66,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Dynamic Data Sets loading"])),(e()(),l["\u0275eld"](244,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,245).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](245,671744,[[68,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](246,1),l["\u0275did"](247,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,67,{links:1}),l["\u0275qud"](603979776,68,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Methods - Open, close, Reset"])),(e()(),l["\u0275eld"](251,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,252).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](252,671744,[[70,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](253,1),l["\u0275did"](254,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,69,{links:1}),l["\u0275qud"](603979776,70,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Events"])),(e()(),l["\u0275eld"](258,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,259).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](259,671744,[[72,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](260,1),l["\u0275did"](261,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,71,{links:1}),l["\u0275qud"](603979776,72,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Disable dropdown"])),(e()(),l["\u0275eld"](265,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,266).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](266,671744,[[74,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](267,1),l["\u0275did"](268,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,73,{links:1}),l["\u0275qud"](603979776,74,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Limit selection"])),(e()(),l["\u0275eld"](272,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,273).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](273,671744,[[76,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](274,1),l["\u0275did"](275,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,75,{links:1}),l["\u0275qud"](603979776,76,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Limit Badges"])),(e()(),l["\u0275eld"](279,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,280).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](280,671744,[[78,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](281,1),l["\u0275did"](282,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,77,{links:1}),l["\u0275qud"](603979776,78,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["Custom placeholder"])),(e()(),l["\u0275eld"](286,0,null,null,6,"a",[["class","list-group-item list-group-item-action"],["href","#"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==l["\u0275nov"](e,287).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),l["\u0275did"](287,671744,[[80,4]],0,Cr,[yr,sl,Y.LocationStrategy],{routerLink:[0,"routerLink"]},null),l["\u0275pad"](288,1),l["\u0275did"](289,1720320,null,2,Sr,[yr,l.ElementRef,l.Renderer2,[2,br],[2,Cr]],{routerLinkActive:[0,"routerLinkActive"]},null),l["\u0275qud"](603979776,79,{links:1}),l["\u0275qud"](603979776,80,{linksWithHrefs:1}),(e()(),l["\u0275ted"](-1,null,["CSS Styling"])),(e()(),l["\u0275eld"](293,0,null,null,2,"div",[["class","col center-content"]],null,null,null,null,null)),(e()(),l["\u0275eld"](294,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),l["\u0275did"](295,212992,null,0,Er,[Ir,l.ViewContainerRef,l.ComponentFactoryResolver,[8,null],l.ChangeDetectorRef],null,null)],function(e,t){var n=e(t,11,0,"basic");e(t,10,0,n),e(t,12,0,"active");var l=e(t,18,0,"singleselection");e(t,17,0,l),e(t,19,0,"active");var r=e(t,25,0,"searchfilter");e(t,24,0,r),e(t,26,0,"active");var i=e(t,32,0,"groupby");e(t,31,0,i),e(t,33,0,"active");var o=e(t,39,0,"templating");e(t,38,0,o),e(t,40,0,"active");var s=e(t,46,0,"usinginform");e(t,45,0,s),e(t,47,0,"active");var a=e(t,53,0,"usinginreactiveform");e(t,52,0,a),e(t,54,0,"active");var u=e(t,60,0,"lazyloading");e(t,59,0,u),e(t,61,0,"active");var c=e(t,67,0,"lazyloadingRemoteData");e(t,66,0,c),e(t,68,0,"active");var d=e(t,74,0,"usingInList");e(t,73,0,d),e(t,75,0,"active");var h=e(t,81,0,"resetdropdown");e(t,80,0,h),e(t,82,0,"active");var p=e(t,88,0,"disablemode");e(t,87,0,p),e(t,89,0,"active");var f=e(t,95,0,"limitselection");e(t,94,0,f),e(t,96,0,"active");var g=e(t,102,0,"limitbadges");e(t,101,0,g),e(t,103,0,"active");var m=e(t,109,0,"customplaceholder");e(t,108,0,m),e(t,110,0,"active");var v=e(t,116,0,"styling");e(t,115,0,v),e(t,117,0,"active");var y=e(t,123,0,"theming");e(t,122,0,y),e(t,124,0,"active");var b=e(t,134,0,"basic");e(t,133,0,b),e(t,135,0,"active");var C=e(t,141,0,"singleselection");e(t,140,0,C),e(t,142,0,"active");var w=e(t,148,0,"searchfilter");e(t,147,0,w),e(t,149,0,"active");var S=e(t,155,0,"customSearchAPI");e(t,154,0,S),e(t,156,0,"active");var _=e(t,162,0,"searchFilterByOneProperty");e(t,161,0,_),e(t,163,0,"active");var I=e(t,169,0,"searchfilterAddNewItem");e(t,168,0,I),e(t,170,0,"active");var E=e(t,176,0,"groupby");e(t,175,0,E),e(t,177,0,"active");var D=e(t,183,0,"templating");e(t,182,0,D),e(t,184,0,"active");var x=e(t,190,0,"usinginform");e(t,189,0,x),e(t,191,0,"active");var k=e(t,197,0,"usinginreactiveform");e(t,196,0,k),e(t,198,0,"active");var A=e(t,204,0,"lazyloading");e(t,203,0,A),e(t,205,0,"active");var T=e(t,211,0,"lazyloadingRemoteData");e(t,210,0,T),e(t,212,0,"active");var R=e(t,218,0,"remoteData");e(t,217,0,R),e(t,219,0,"active");var O=e(t,225,0,"usingInList");e(t,224,0,O),e(t,226,0,"active");var N=e(t,232,0,"multipledropdowns");e(t,231,0,N),e(t,233,0,"active");var P=e(t,239,0,"dynamicdatasets");e(t,238,0,P),e(t,240,0,"active");var M=e(t,246,0,"dropdownMethods");e(t,245,0,M),e(t,247,0,"active");var L=e(t,253,0,"events");e(t,252,0,L),e(t,254,0,"active");var F=e(t,260,0,"disablemode");e(t,259,0,F),e(t,261,0,"active");var V=e(t,267,0,"limitselection");e(t,266,0,V),e(t,268,0,"active");var B=e(t,274,0,"limitbadges");e(t,273,0,B),e(t,275,0,"active");var j=e(t,281,0,"customplaceholder");e(t,280,0,j),e(t,282,0,"active");var H=e(t,288,0,"styling");e(t,287,0,H),e(t,289,0,"active"),e(t,295,0)},function(e,t){e(t,9,0,l["\u0275nov"](t,10).target,l["\u0275nov"](t,10).href),e(t,16,0,l["\u0275nov"](t,17).target,l["\u0275nov"](t,17).href),e(t,23,0,l["\u0275nov"](t,24).target,l["\u0275nov"](t,24).href),e(t,30,0,l["\u0275nov"](t,31).target,l["\u0275nov"](t,31).href),e(t,37,0,l["\u0275nov"](t,38).target,l["\u0275nov"](t,38).href),e(t,44,0,l["\u0275nov"](t,45).target,l["\u0275nov"](t,45).href),e(t,51,0,l["\u0275nov"](t,52).target,l["\u0275nov"](t,52).href),e(t,58,0,l["\u0275nov"](t,59).target,l["\u0275nov"](t,59).href),e(t,65,0,l["\u0275nov"](t,66).target,l["\u0275nov"](t,66).href),e(t,72,0,l["\u0275nov"](t,73).target,l["\u0275nov"](t,73).href),e(t,79,0,l["\u0275nov"](t,80).target,l["\u0275nov"](t,80).href),e(t,86,0,l["\u0275nov"](t,87).target,l["\u0275nov"](t,87).href),e(t,93,0,l["\u0275nov"](t,94).target,l["\u0275nov"](t,94).href),e(t,100,0,l["\u0275nov"](t,101).target,l["\u0275nov"](t,101).href),e(t,107,0,l["\u0275nov"](t,108).target,l["\u0275nov"](t,108).href),e(t,114,0,l["\u0275nov"](t,115).target,l["\u0275nov"](t,115).href),e(t,121,0,l["\u0275nov"](t,122).target,l["\u0275nov"](t,122).href),e(t,132,0,l["\u0275nov"](t,133).target,l["\u0275nov"](t,133).href),e(t,139,0,l["\u0275nov"](t,140).target,l["\u0275nov"](t,140).href),e(t,146,0,l["\u0275nov"](t,147).target,l["\u0275nov"](t,147).href),e(t,153,0,l["\u0275nov"](t,154).target,l["\u0275nov"](t,154).href),e(t,160,0,l["\u0275nov"](t,161).target,l["\u0275nov"](t,161).href),e(t,167,0,l["\u0275nov"](t,168).target,l["\u0275nov"](t,168).href),e(t,174,0,l["\u0275nov"](t,175).target,l["\u0275nov"](t,175).href),e(t,181,0,l["\u0275nov"](t,182).target,l["\u0275nov"](t,182).href),e(t,188,0,l["\u0275nov"](t,189).target,l["\u0275nov"](t,189).href),e(t,195,0,l["\u0275nov"](t,196).target,l["\u0275nov"](t,196).href),e(t,202,0,l["\u0275nov"](t,203).target,l["\u0275nov"](t,203).href),e(t,209,0,l["\u0275nov"](t,210).target,l["\u0275nov"](t,210).href),e(t,216,0,l["\u0275nov"](t,217).target,l["\u0275nov"](t,217).href),e(t,223,0,l["\u0275nov"](t,224).target,l["\u0275nov"](t,224).href),e(t,230,0,l["\u0275nov"](t,231).target,l["\u0275nov"](t,231).href),e(t,237,0,l["\u0275nov"](t,238).target,l["\u0275nov"](t,238).href),e(t,244,0,l["\u0275nov"](t,245).target,l["\u0275nov"](t,245).href),e(t,251,0,l["\u0275nov"](t,252).target,l["\u0275nov"](t,252).href),e(t,258,0,l["\u0275nov"](t,259).target,l["\u0275nov"](t,259).href),e(t,265,0,l["\u0275nov"](t,266).target,l["\u0275nov"](t,266).href),e(t,272,0,l["\u0275nov"](t,273).target,l["\u0275nov"](t,273).href),e(t,279,0,l["\u0275nov"](t,280).target,l["\u0275nov"](t,280).href),e(t,286,0,l["\u0275nov"](t,287).target,l["\u0275nov"](t,287).href)})}function Th(e){return l["\u0275vid"](0,[(e()(),l["\u0275eld"](0,0,null,null,1,"app-root",[],null,null,null,Ah,kh)),l["\u0275did"](1,114688,null,0,Q,[Sh,Z],null,null)],function(e,t){e(t,1,0)},null)}var Rh=l["\u0275ccf"]("app-root",Q,Th,{},{},[]);class Oh{}n("pw5m");const Nh=new l.InjectionToken("HIGHLIGHT_OPTIONS"),Ph=(()=>{class e{static forRoot(t){return{ngModule:e,providers:[{provide:Nh,useValue:t}]}}}return e})();var Mh=l["\u0275cmf"](d,[Q],function(e){return l["\u0275mod"]([l["\u0275mpd"](512,l.ComponentFactoryResolver,l["\u0275CodegenComponentFactoryResolver"],[[8,[Qr,Ga,Xa,iu,du,yu,_u,Au,Mu,Hu,Gu,Xu,oc,pc,bc,xc,Pc,Bc,Id,Od,Vd,$d,Qd,th,ah,Rh]],[3,l.ComponentFactoryResolver],l.NgModuleRef]),l["\u0275mpd"](5120,l.LOCALE_ID,l["\u0275angular_packages_core_core_q"],[[3,l.LOCALE_ID]]),l["\u0275mpd"](4608,Y.NgLocalization,Y.NgLocaleLocalization,[l.LOCALE_ID,[2,Y["\u0275angular_packages_common_common_a"]]]),l["\u0275mpd"](5120,l["\u0275angular_packages_core_core_bb"],l["\u0275angular_packages_core_core_s"],[l.NgZone]),l["\u0275mpd"](5120,l.IterableDiffers,l["\u0275angular_packages_core_core_o"],[]),l["\u0275mpd"](5120,l.KeyValueDiffers,l["\u0275angular_packages_core_core_p"],[]),l["\u0275mpd"](4608,Lt,Ft,[Y.DOCUMENT]),l["\u0275mpd"](6144,l.Sanitizer,null,[Lt]),l["\u0275mpd"](4608,At,Rt,[]),l["\u0275mpd"](5120,nt,function(e,t,n,l,r,i,o,s){return[new xt(e,t,n),new Mt(l),new Ot(r,i,o,s)]},[Y.DOCUMENT,l.NgZone,l.PLATFORM_ID,Y.DOCUMENT,Y.DOCUMENT,At,l["\u0275Console"],[2,Tt]]),l["\u0275mpd"](4608,lt,lt,[nt,l.NgZone]),l["\u0275mpd"](135680,ot,ot,[Y.DOCUMENT]),l["\u0275mpd"](4608,pt,pt,[lt,ot,l.APP_ID]),l["\u0275mpd"](6144,l.RendererFactory2,null,[pt]),l["\u0275mpd"](6144,it,null,[ot]),l["\u0275mpd"](4608,l.Testability,l.Testability,[l.NgZone]),l["\u0275mpd"](4608,Bo,Bo,[]),l["\u0275mpd"](4608,Wi,Wi,[]),l["\u0275mpd"](5120,sl,Ur,[yr]),l["\u0275mpd"](4608,Ar,Ar,[]),l["\u0275mpd"](6144,xr,null,[Ar]),l["\u0275mpd"](135680,Tr,Tr,[yr,l.NgModuleFactoryLoader,l.Compiler,l.Injector,xr]),l["\u0275mpd"](4608,kr,kr,[]),l["\u0275mpd"](5120,Rr,Fr,[yr,Y.ViewportScroller,Or]),l["\u0275mpd"](5120,Wr,qr,[zr]),l["\u0275mpd"](5120,l.APP_BOOTSTRAP_LISTENER,function(e){return[e]},[Wr]),l["\u0275mpd"](5120,"virtual-scroller-default-options",Yo,[]),l["\u0275mpd"](4608,zo,zo,[]),l["\u0275mpd"](4608,pd,fd,[Y.DOCUMENT,l.PLATFORM_ID,dd]),l["\u0275mpd"](4608,gd,gd,[pd,hd]),l["\u0275mpd"](5120,id,function(e){return[e]},[gd]),l["\u0275mpd"](4608,ud,ud,[]),l["\u0275mpd"](6144,ad,null,[ud]),l["\u0275mpd"](4608,cd,cd,[ad]),l["\u0275mpd"](6144,Uc,null,[cd]),l["\u0275mpd"](4608,Hc,md,[Uc,l.Injector]),l["\u0275mpd"](4608,ld,ld,[Hc]),l["\u0275mpd"](5120,Ch,Dh,[_h,l.PLATFORM_ID]),l["\u0275mpd"](4608,wh,wh,[Ch]),l["\u0275mpd"](4608,Sh,Sh,[Ch]),l["\u0275mpd"](4608,Cc,Cc,[]),l["\u0275mpd"](4608,Z,Z,[l.ApplicationRef,Sh]),l["\u0275mpd"](1073742336,Y.CommonModule,Y.CommonModule,[]),l["\u0275mpd"](1024,l.ErrorHandler,Wt,[]),l["\u0275mpd"](1024,l.NgProbeToken,function(){return[Mr()]},[]),l["\u0275mpd"](512,zr,zr,[l.Injector]),l["\u0275mpd"](256,l.APP_ID,"serverApp",[]),l["\u0275mpd"](2048,Ze,null,[l.APP_ID]),l["\u0275mpd"](256,Ih,"ngsw-worker.js",[]),l["\u0275mpd"](256,_h,{enabled:!0},[]),l["\u0275mpd"](1024,l.APP_INITIALIZER,function(e,t,n,l,r,i,o,s,a){return[(u=e,Xe("probe",tt),Xe("coreTokens",Object.assign({},et,(u||[]).reduce((e,t)=>(e[t.name]=t.token,e),{}))),()=>tt),$r(t),Qe(n,l,r),Eh(i,o,s,a)];var u},[[2,l.NgProbeToken],zr,Ze,Y.DOCUMENT,l.Injector,l.Injector,Ih,_h,l.PLATFORM_ID]),l["\u0275mpd"](512,l.ApplicationInitStatus,l.ApplicationInitStatus,[[2,l.APP_INITIALIZER]]),l["\u0275mpd"](131584,l.ApplicationRef,l.ApplicationRef,[l.NgZone,l["\u0275Console"],l.Injector,l.ErrorHandler,l.ComponentFactoryResolver,l.ApplicationInitStatus]),l["\u0275mpd"](1073742336,l.ApplicationModule,l.ApplicationModule,[l.ApplicationRef]),l["\u0275mpd"](1073742336,Gt,Gt,[[3,Gt]]),l["\u0275mpd"](1073742336,Vo,Vo,[]),l["\u0275mpd"](1073742336,Ho,Ho,[]),l["\u0275mpd"](1073742336,jo,jo,[]),l["\u0275mpd"](1024,Nr,Br,[[3,yr]]),l["\u0275mpd"](512,Bn,jn,[]),l["\u0275mpd"](512,Ir,Ir,[]),l["\u0275mpd"](256,Or,{useHash:!0},[]),l["\u0275mpd"](1024,Y.LocationStrategy,Vr,[Y.PlatformLocation,[2,Y.APP_BASE_HREF],Or]),l["\u0275mpd"](512,Y.Location,Y.Location,[Y.LocationStrategy,Y.PlatformLocation]),l["\u0275mpd"](512,l.Compiler,l.Compiler,[]),l["\u0275mpd"](512,l.NgModuleFactoryLoader,l.SystemJsNgModuleLoader,[l.Compiler,[2,l.SystemJsNgModuleLoaderConfig]]),l["\u0275mpd"](1024,dr,function(){return[[{path:"",redirectTo:"/basic",pathMatch:"full"},{path:"basic",component:Ua},{path:"singleselection",component:Ka},{path:"searchfilter",component:eu},{path:"groupby",component:ou},{path:"templating",component:hu},{path:"dropdownMethods",component:bu},{path:"disablemode",component:Iu},{path:"limitselection",component:Tu},{path:"limitbadges",component:Lu},{path:"customplaceholder",component:Uu},{path:"styling",component:Ku},{path:"usinginform",component:ec},{path:"usinginreactiveform",component:sc},{path:"lazyloading",component:fc},{path:"multipledropdowns",component:wc},{path:"dynamicdatasets",component:kc},{path:"theming",component:Mc},{path:"remoteData",component:jc},{path:"customSearchAPI",component:Ed},{path:"searchFilterByOneProperty",component:Nd},{path:"lazyloadingRemoteData",component:Bd},{path:"searchfilterAddNewItem",component:qd},{path:"events",component:Yd},{path:"usingInList",component:nh}]]},[]),l["\u0275mpd"](1024,yr,Hr,[l.ApplicationRef,Bn,Ir,Y.Location,l.Injector,l.NgModuleFactoryLoader,l.Compiler,dr,Or,[2,pr],[2,ur]]),l["\u0275mpd"](1073742336,Lr,Lr,[[2,Nr],[2,yr]]),l["\u0275mpd"](1073742336,Oh,Oh,[]),l["\u0275mpd"](1073742336,Xo,Xo,[]),l["\u0275mpd"](1073742336,ss,ss,[]),l["\u0275mpd"](1073742336,Jr.SharedModule,Jr.SharedModule,[]),l["\u0275mpd"](1073742336,Xr.TooltipModule,Xr.TooltipModule,[]),l["\u0275mpd"](1073742336,Yr.TabViewModule,Yr.TabViewModule,[]),l["\u0275mpd"](1073742336,vd,vd,[]),l["\u0275mpd"](1073742336,yd,yd,[]),l["\u0275mpd"](1073742336,Ph,Ph,[]),l["\u0275mpd"](1073742336,xh,xh,[]),l["\u0275mpd"](1073742336,d,d,[]),l["\u0275mpd"](256,l["\u0275APP_ROOT"],!0,[]),l["\u0275mpd"](256,dd,"XSRF-TOKEN",[]),l["\u0275mpd"](256,hd,"X-XSRF-TOKEN",[]),l["\u0275mpd"](256,Nh,{languages:c},[])])});Object(l.enableProdMode)(),document.addEventListener("DOMContentLoaded",()=>{qt().bootstrapModuleFactory(Mh).catch(e=>console.error(e))})}},[[0,0]]]);
alarm_control_panel.py
"""Support for alarm control panels that can be controlled through IFTTT.""" import logging import re import voluptuous as vol import homeassistant.components.alarm_control_panel as alarm from homeassistant.components.alarm_control_panel import DOMAIN, PLATFORM_SCHEMA from homeassistant.components.alarm_control_panel.const import ( SUPPORT_ALARM_ARM_AWAY, SUPPORT_ALARM_ARM_HOME, SUPPORT_ALARM_ARM_NIGHT, ) from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_STATE, CONF_CODE, CONF_NAME, CONF_OPTIMISTIC, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT, STATE_ALARM_DISARMED, ) import homeassistant.helpers.config_validation as cv from . import ATTR_EVENT, DOMAIN as IFTTT_DOMAIN, SERVICE_TRIGGER _LOGGER = logging.getLogger(__name__) ALLOWED_STATES = [ STATE_ALARM_DISARMED, STATE_ALARM_ARMED_NIGHT, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, ] DATA_IFTTT_ALARM = "ifttt_alarm" DEFAULT_NAME = "Home" CONF_EVENT_AWAY = "event_arm_away" CONF_EVENT_HOME = "event_arm_home" CONF_EVENT_NIGHT = "event_arm_night" CONF_EVENT_DISARM = "event_disarm" DEFAULT_EVENT_AWAY = "alarm_arm_away" DEFAULT_EVENT_HOME = "alarm_arm_home" DEFAULT_EVENT_NIGHT = "alarm_arm_night" DEFAULT_EVENT_DISARM = "alarm_disarm" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional(CONF_CODE): cv.string, vol.Optional(CONF_EVENT_AWAY, default=DEFAULT_EVENT_AWAY): cv.string, vol.Optional(CONF_EVENT_HOME, default=DEFAULT_EVENT_HOME): cv.string, vol.Optional(CONF_EVENT_NIGHT, default=DEFAULT_EVENT_NIGHT): cv.string, vol.Optional(CONF_EVENT_DISARM, default=DEFAULT_EVENT_DISARM): cv.string, vol.Optional(CONF_OPTIMISTIC, default=False): cv.boolean, } ) SERVICE_PUSH_ALARM_STATE = "ifttt_push_alarm_state" PUSH_ALARM_STATE_SERVICE_SCHEMA = vol.Schema( {vol.Required(ATTR_ENTITY_ID): cv.entity_ids, vol.Required(ATTR_STATE): cv.string} ) def setup_platform(hass, config, add_entities, discovery_info=None): """Set up a control panel managed through IFTTT.""" if DATA_IFTTT_ALARM not in hass.data: hass.data[DATA_IFTTT_ALARM] = [] name = config.get(CONF_NAME) code = config.get(CONF_CODE) event_away = config.get(CONF_EVENT_AWAY) event_home = config.get(CONF_EVENT_HOME) event_night = config.get(CONF_EVENT_NIGHT) event_disarm = config.get(CONF_EVENT_DISARM) optimistic = config.get(CONF_OPTIMISTIC) alarmpanel = IFTTTAlarmPanel( name, code, event_away, event_home, event_night, event_disarm, optimistic ) hass.data[DATA_IFTTT_ALARM].append(alarmpanel) add_entities([alarmpanel]) async def push_state_update(service): """Set the service state as device state attribute.""" entity_ids = service.data.get(ATTR_ENTITY_ID) state = service.data.get(ATTR_STATE) devices = hass.data[DATA_IFTTT_ALARM] if entity_ids: devices = [d for d in devices if d.entity_id in entity_ids] for device in devices: device.push_alarm_state(state) device.async_schedule_update_ha_state() hass.services.register( DOMAIN, SERVICE_PUSH_ALARM_STATE, push_state_update, schema=PUSH_ALARM_STATE_SERVICE_SCHEMA, ) class IFTTTAlarmPanel(alarm.AlarmControlPanel): """Representation of an alarm control panel controlled through IFTTT.""" def __init__( self, name, code, event_away, event_home, event_night, event_disarm, optimistic ): """Initialize the alarm control panel.""" self._name = name self._code = code self._event_away = event_away self._event_home = event_home self._event_night = event_night self._event_disarm = event_disarm self._optimistic = optimistic self._state = None @property def name(self): """Return the name of the device.""" return self._name @property def state(self): """Return the state of the device.""" return self._state @property def supported_features(self) -> int: """Return the list of supported features.""" return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_NIGHT @property def assumed_state(self): """Notify that this platform return an assumed state.""" return True @property def code_format(self): """Return one or more digits/characters.""" if self._code is None: return None if isinstance(self._code, str) and re.search("^\\d+$", self._code): return alarm.FORMAT_NUMBER return alarm.FORMAT_TEXT def alarm_disarm(self, code=None): """Send disarm command.""" if not self._check_code(code): return self.set_alarm_state(self._event_disarm, STATE_ALARM_DISARMED) def alarm_arm_away(self, code=None): """Send arm away command.""" if not self._check_code(code): return self.set_alarm_state(self._event_away, STATE_ALARM_ARMED_AWAY) def alarm_arm_home(self, code=None): """Send arm home command.""" if not self._check_code(code): return self.set_alarm_state(self._event_home, STATE_ALARM_ARMED_HOME) def alarm_arm_night(self, code=None): """Send arm night command.""" if not self._check_code(code): return self.set_alarm_state(self._event_night, STATE_ALARM_ARMED_NIGHT) def set_alarm_state(self, event, state): """Call the IFTTT trigger service to change the alarm state.""" data = {ATTR_EVENT: event} self.hass.services.call(IFTTT_DOMAIN, SERVICE_TRIGGER, data) _LOGGER.debug("Called IFTTT integration to trigger event %s", event) if self._optimistic: self._state = state def push_alarm_state(self, value):
def _check_code(self, code): return self._code is None or self._code == code
"""Push the alarm state to the given value.""" if value in ALLOWED_STATES: _LOGGER.debug("Pushed the alarm state to %s", value) self._state = value
sdkcomponent_test.go
package sdkcomponent import ( "testing" "github.com/stretchr/testify/require" ) func TestSystemImageComponent(t *testing.T) { { component := SystemImage{ Platform: "android-24", Tag: "", ABI: "x86", } require.Equal(t, "system-images;android-24;default;x86", component.GetSDKStylePath()) require.Equal(t, "sys-img-x86-android-24", component.GetLegacySDKStylePath()) require.Equal(t, "system-images/android-24/default/x86", component.InstallPathInAndroidHome()) } { component := SystemImage{ Platform: "android-24", Tag: "default", ABI: "x86", } require.Equal(t, "system-images;android-24;default;x86", component.GetSDKStylePath()) require.Equal(t, "sys-img-x86-android-24", component.GetLegacySDKStylePath()) require.Equal(t, "system-images/android-24/default/x86", component.InstallPathInAndroidHome()) } { component := SystemImage{ Platform: "android-23", Tag: "google_apis", ABI: "armeabi-v7a", } require.Equal(t, "system-images;android-23;google_apis;armeabi-v7a", component.GetSDKStylePath()) require.Equal(t, "sys-img-armeabi-v7a-google_apis-23", component.GetLegacySDKStylePath()) require.Equal(t, "system-images/android-23/google_apis/armeabi-v7a", component.InstallPathInAndroidHome()) } { component := SystemImage{ Platform: "android-23", Tag: "android-tv", ABI: "armeabi-v7a", } require.Equal(t, "system-images;android-23;android-tv;armeabi-v7a", component.GetSDKStylePath()) require.Equal(t, "sys-img-armeabi-v7a-android-tv-23", component.GetLegacySDKStylePath()) require.Equal(t, "system-images/android-23/android-tv/armeabi-v7a", component.InstallPathInAndroidHome()) } } func
(t *testing.T) { component := Platform{ Version: "android-23", } require.Equal(t, "platforms;android-23", component.GetSDKStylePath()) require.Equal(t, "android-23", component.GetLegacySDKStylePath()) require.Equal(t, "platforms/android-23", component.InstallPathInAndroidHome()) } func TestBuildToolComponent(t *testing.T) { component := BuildTool{ Version: "19.1.0", } require.Equal(t, "build-tools;19.1.0", component.GetSDKStylePath()) require.Equal(t, "build-tools-19.1.0", component.GetLegacySDKStylePath()) require.Equal(t, "build-tools/19.1.0", component.InstallPathInAndroidHome()) }
TestPlatformComponent
cluster_query.rs
use { crate::{ cli::{CliCommand, CliCommandInfo, CliConfig, CliError, ProcessResult}, spend_utils::{resolve_spend_tx_and_check_account_balance, SpendAmount}, }, clap::{value_t, value_t_or_exit, App, AppSettings, Arg, ArgMatches, SubCommand}, console::{style, Emoji}, serde::{Deserialize, Serialize}, solana_clap_utils::{ input_parsers::*, input_validators::*, keypair::DefaultSigner, offline::{blockhash_arg, BLOCKHASH_ARG}, }, solana_cli_output::{ display::{ build_balance_message, format_labeled_address, new_spinner_progress_bar, println_name_value, println_transaction, unix_timestamp_to_string, writeln_name_value, }, *, }, solana_client::{ client_error::ClientErrorKind, pubsub_client::PubsubClient, rpc_client::{GetConfirmedSignaturesForAddress2Config, RpcClient}, rpc_config::{ RpcAccountInfoConfig, RpcBlockConfig, RpcGetVoteAccountsConfig, RpcLargestAccountsConfig, RpcLargestAccountsFilter, RpcProgramAccountsConfig, RpcTransactionConfig, RpcTransactionLogsConfig, RpcTransactionLogsFilter, }, rpc_filter, rpc_request::DELINQUENT_VALIDATOR_SLOT_DISTANCE, rpc_response::SlotInfo, }, solana_remote_wallet::remote_wallet::RemoteWalletManager, solana_sdk::{ account::from_account, account_utils::StateMut, clock::{self, Clock, Slot}, commitment_config::CommitmentConfig, epoch_schedule::Epoch, hash::Hash, message::Message, native_token::lamports_to_sol, nonce::State as NonceState, pubkey::{self, Pubkey}, rent::Rent, rpc_port::DEFAULT_RPC_PORT_STR, signature::Signature, slot_history, stake::{self, state::StakeState}, system_instruction, system_program, sysvar::{ self, slot_history::SlotHistory, stake_history::{self}, }, timing, transaction::Transaction, }, solana_transaction_status::UiTransactionEncoding, solana_vote_program::vote_state::VoteState, std::{ collections::{BTreeMap, HashMap, VecDeque}, fmt, str::FromStr, sync::{ atomic::{AtomicBool, Ordering}, Arc, }, thread::sleep, time::{Duration, Instant, SystemTime, UNIX_EPOCH}, }, thiserror::Error, }; static CHECK_MARK: Emoji = Emoji("✅ ", ""); static CROSS_MARK: Emoji = Emoji("❌ ", ""); pub trait ClusterQuerySubCommands { fn cluster_query_subcommands(self) -> Self; } impl ClusterQuerySubCommands for App<'_, '_> { fn cluster_query_subcommands(self) -> Self { self.subcommand( SubCommand::with_name("block") .about("Get a confirmed block") .arg( Arg::with_name("slot") .long("slot") .validator(is_slot) .value_name("SLOT") .takes_value(true) .index(1), ), ) .subcommand( SubCommand::with_name("catchup") .about("Wait for a validator to catch up to the cluster") .arg( pubkey!(Arg::with_name("node_pubkey") .index(1) .value_name("OUR_VALIDATOR_PUBKEY") .required(false), "Identity pubkey of the validator"), ) .arg( Arg::with_name("node_json_rpc_url") .index(2) .value_name("OUR_URL") .takes_value(true) .validator(is_url) .help("JSON RPC URL for validator, which is useful for validators with a private RPC service") ) .arg( Arg::with_name("follow") .long("follow") .takes_value(false) .help("Continue reporting progress even after the validator has caught up"), ) .arg( Arg::with_name("our_localhost") .long("our-localhost") .takes_value(false) .value_name("PORT") .default_value(DEFAULT_RPC_PORT_STR) .validator(is_port) .help("Guess Identity pubkey and validator rpc node assuming local (possibly private) validator"), ) .arg( Arg::with_name("log") .long("log") .takes_value(false) .help("Don't update the progress inplace; instead show updates with its own new lines"), ), ) .subcommand( SubCommand::with_name("cluster-date") .about("Get current cluster date, computed from genesis creation time and network time"), ) .subcommand( SubCommand::with_name("cluster-version") .about("Get the version of the cluster entrypoint"), ) // Deprecated in v1.8.0 .subcommand( SubCommand::with_name("fees") .about("Display current cluster fees (Deprecated in v1.8.0)") .arg( Arg::with_name("blockhash") .long("blockhash") .takes_value(true) .value_name("BLOCKHASH") .validator(is_hash) .help("Query fees for BLOCKHASH instead of the the most recent blockhash") ), ) .subcommand( SubCommand::with_name("first-available-block") .about("Get the first available block in the storage"), ) .subcommand(SubCommand::with_name("block-time") .about("Get estimated production time of a block") .alias("get-block-time") .arg( Arg::with_name("slot") .index(1) .takes_value(true) .value_name("SLOT") .help("Slot number of the block to query") ) ) .subcommand(SubCommand::with_name("leader-schedule") .about("Display leader schedule") .arg( Arg::with_name("epoch") .long("epoch") .takes_value(true) .value_name("EPOCH") .validator(is_epoch) .help("Epoch to show leader schedule for. [default: current]") ) ) .subcommand( SubCommand::with_name("epoch-info") .about("Get information about the current epoch") .alias("get-epoch-info"), ) .subcommand( SubCommand::with_name("genesis-hash") .about("Get the genesis hash") .alias("get-genesis-hash") ) .subcommand( SubCommand::with_name("slot").about("Get current slot") .alias("get-slot"), ) .subcommand( SubCommand::with_name("block-height").about("Get current block height"), ) .subcommand( SubCommand::with_name("epoch").about("Get current epoch"), ) .subcommand( SubCommand::with_name("largest-accounts").about("Get addresses of largest cluster accounts") .arg( Arg::with_name("circulating") .long("circulating") .takes_value(false) .help("Filter address list to only circulating accounts") ) .arg( Arg::with_name("non_circulating") .long("non-circulating") .takes_value(false) .conflicts_with("circulating") .help("Filter address list to only non-circulating accounts") ), ) .subcommand( SubCommand::with_name("supply").about("Get information about the cluster supply of SOL") .arg( Arg::with_name("print_accounts") .long("print-accounts") .takes_value(false) .help("Print list of non-circualting account addresses") ), ) .subcommand( SubCommand::with_name("total-supply").about("Get total number of SOL") .setting(AppSettings::Hidden), ) .subcommand( SubCommand::with_name("transaction-count").about("Get current transaction count") .alias("get-transaction-count"), ) .subcommand( SubCommand::with_name("ping") .about("Submit transactions sequentially") .arg( Arg::with_name("interval") .short("i") .long("interval") .value_name("SECONDS") .takes_value(true) .default_value("2") .help("Wait interval seconds between submitting the next transaction"), ) .arg( Arg::with_name("count") .short("c") .long("count") .value_name("NUMBER") .takes_value(true) .help("Stop after submitting count transactions"), ) .arg( Arg::with_name("print_timestamp") .short("D") .long("print-timestamp") .takes_value(false) .help("Print timestamp (unix time + microseconds as in gettimeofday) before each line"), ) .arg( Arg::with_name("lamports") .long("lamports") .value_name("NUMBER") .takes_value(true) .default_value("1") .validator(is_amount) .help("Number of lamports to transfer for each transaction"), ) .arg( Arg::with_name("timeout") .short("t") .long("timeout") .value_name("SECONDS") .takes_value(true) .default_value("15") .help("Wait up to timeout seconds for transaction confirmation"), ) .arg(blockhash_arg()), ) .subcommand( SubCommand::with_name("live-slots") .about("Show information about the current slot progression"), ) .subcommand( SubCommand::with_name("logs") .about("Stream transaction logs") .arg( pubkey!(Arg::with_name("address") .index(1) .value_name("ADDRESS"), "Account address to monitor \ [default: monitor all transactions except for votes] \ ") ) .arg( Arg::with_name("include_votes") .long("include-votes") .takes_value(false) .conflicts_with("address") .help("Include vote transactions when monitoring all transactions") ), ) .subcommand( SubCommand::with_name("block-production") .about("Show information about block production") .alias("show-block-production") .arg( Arg::with_name("epoch") .long("epoch") .takes_value(true) .help("Epoch to show block production for [default: current epoch]"), ) .arg( Arg::with_name("slot_limit") .long("slot-limit") .takes_value(true) .help("Limit results to this many slots from the end of the epoch [default: full epoch]"), ), ) .subcommand( SubCommand::with_name("gossip") .about("Show the current gossip network nodes") .alias("show-gossip") ) .subcommand( SubCommand::with_name("stakes") .about("Show stake account information") .arg( pubkey!(Arg::with_name("vote_account_pubkeys") .index(1) .value_name("VOTE_ACCOUNT_PUBKEYS") .multiple(true), "Only show stake accounts delegated to the provided vote accounts. "), ) .arg( Arg::with_name("lamports") .long("lamports") .takes_value(false) .help("Display balance in lamports instead of SOL"), ), ) .subcommand( SubCommand::with_name("validators") .about("Show summary information about the current validators") .alias("show-validators") .arg( Arg::with_name("lamports") .long("lamports") .takes_value(false) .help("Display balance in lamports instead of SOL"), ) .arg( Arg::with_name("number") .long("number") .short("n") .takes_value(false) .help("Number the validators"), ) .arg( Arg::with_name("reverse") .long("reverse") .short("r") .takes_value(false) .help("Reverse order while sorting"), ) .arg( Arg::with_name("sort") .long("sort") .takes_value(true) .possible_values(&[ "delinquent", "commission", "credits", "identity", "last-vote", "root", "skip-rate", "stake", "vote-account", ]) .default_value("stake") .help("Sort order (does not affect JSON output)"), ) .arg( Arg::with_name("keep_unstaked_delinquents") .long("keep-unstaked-delinquents") .takes_value(false) .help("Don't discard unstaked, delinquent validators") ) .arg( Arg::with_name("delinquent_slot_distance") .long("delinquent-slot-distance") .takes_value(true) .value_name("SLOT_DISTANCE") .validator(is_slot) .help( concatcp!( "Minimum slot distance from the tip to consider a validator delinquent. [default: ", DELINQUENT_VALIDATOR_SLOT_DISTANCE, "]", )) ), ) .subcommand( SubCommand::with_name("transaction-history") .about("Show historical transactions affecting the given address \ from newest to oldest") .arg( pubkey!(Arg::with_name("address") .index(1) .value_name("ADDRESS") .required(true), "Account address"), ) .arg( Arg::with_name("limit") .long("limit") .takes_value(true) .value_name("LIMIT") .validator(is_slot) .default_value("1000") .help("Maximum number of transaction signatures to return"), ) .arg( Arg::with_name("before") .long("before") .value_name("TRANSACTION_SIGNATURE") .takes_value(true) .help("Start with the first signature older than this one"), ) .arg( Arg::with_name("show_transactions") .long("show-transactions") .takes_value(false) .help("Display the full transactions"), ) ) .subcommand( SubCommand::with_name("wait-for-max-stake") .about("Wait for the max stake of any one node to drop below a percentage of total.") .arg( Arg::with_name("max_percent") .long("max-percent") .value_name("PERCENT") .takes_value(true) .index(1), ), ) .subcommand( SubCommand::with_name("rent") .about("Calculate per-epoch and rent-exempt-minimum values for a given account data field length.") .arg( Arg::with_name("data_length") .index(1) .value_name("DATA_LENGTH_OR_MONIKER") .required(true) .validator(|s| { RentLengthValue::from_str(&s) .map(|_| ()) .map_err(|e| e.to_string()) }) .help("Length of data field in the account to calculate rent for, or moniker: [nonce, stake, system, vote]"), ) .arg( Arg::with_name("lamports") .long("lamports") .takes_value(false) .help("Display rent in lamports instead of SOL"), ), ) } } pub fn parse_catchup( matches: &ArgMatches<'_>, wallet_manager: &mut Option<Arc<RemoteWalletManager>>, ) -> Result<CliCommandInfo, CliError> { let node_pubkey = pubkey_of_signer(matches, "node_pubkey", wallet_manager)?; let mut our_localhost_port = value_t!(matches, "our_localhost", u16).ok(); // if there is no explicitly specified --our-localhost, // disable the guess mode (= our_localhost_port) if matches.occurrences_of("our_localhost") == 0 { our_localhost_port = None } let node_json_rpc_url = value_t!(matches, "node_json_rpc_url", String).ok(); // requirement of node_pubkey is relaxed only if our_localhost_port if our_localhost_port.is_none() && node_pubkey.is_none() { return Err(CliError::BadParameter( "OUR_VALIDATOR_PUBKEY (and possibly OUR_URL) must be specified \ unless --our-localhost is given" .into(), )); } let follow = matches.is_present("follow"); let log = matches.is_present("log"); Ok(CliCommandInfo { command: CliCommand::Catchup { node_pubkey, node_json_rpc_url, follow, our_localhost_port, log, }, signers: vec![], }) } pub fn parse_cluster_ping( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, wallet_manager: &mut Option<Arc<RemoteWalletManager>>, ) -> Result<CliCommandInfo, CliError> { let lamports = value_t_or_exit!(matches, "lamports", u64); let interval = Duration::from_secs(value_t_or_exit!(matches, "interval", u64)); let count = if matches.is_present("count") { Some(value_t_or_exit!(matches, "count", u64)) } else { None }; let timeout = Duration::from_secs(value_t_or_exit!(matches, "timeout", u64)); let blockhash = value_of(matches, BLOCKHASH_ARG.name); let print_timestamp = matches.is_present("print_timestamp"); Ok(CliCommandInfo { command: CliCommand::Ping { lamports, interval, count, timeout, blockhash, print_timestamp, }, signers: vec![default_signer.signer_from_path(matches, wallet_manager)?], }) } pub fn parse_get_block(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { let slot = value_of(matches, "slot"); Ok(CliCommandInfo { command: CliCommand::GetBlock { slot }, signers: vec![], }) } pub fn parse_get_block_time(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { let slot = value_of(matches, "slot"); Ok(CliCommandInfo { command: CliCommand::GetBlockTime { slot }, signers: vec![], }) } pub fn parse_get_epoch(_matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { Ok(CliCommandInfo { command: CliCommand::GetEpoch, signers: vec![], }) } pub fn parse_get_epoch_info(_matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { Ok(CliCommandInfo { command: CliCommand::GetEpochInfo, signers: vec![], }) } pub fn parse_get_slot(_matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { Ok(CliCommandInfo { command: CliCommand::GetSlot, signers: vec![], }) } pub fn parse_get_block_height(_matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { Ok(CliCommandInfo { command: CliCommand::GetBlockHeight, signers: vec![], }) } pub fn parse_largest_accounts(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { let filter = if matches.is_present("circulating") { Some(RpcLargestAccountsFilter::Circulating) } else if matches.is_present("non_circulating") { Some(RpcLargestAccountsFilter::NonCirculating) } else { None }; Ok(CliCommandInfo { command: CliCommand::LargestAccounts { filter }, signers: vec![], }) } pub fn parse_supply(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { let print_accounts = matches.is_present("print_accounts"); Ok(CliCommandInfo { command: CliCommand::Supply { print_accounts }, signers: vec![], }) } pub fn parse_total_supply(_matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { Ok(CliCommandInfo { command: CliCommand::TotalSupply, signers: vec![], }) } pub fn parse_get_transaction_count(_matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { Ok(CliCommandInfo { command: CliCommand::GetTransactionCount, signers: vec![], }) } pub fn parse_show_stakes( matches: &ArgMatches<'_>, wallet_manager: &mut Option<Arc<RemoteWalletManager>>, ) -> Result<CliCommandInfo, CliError> { let use_lamports_unit = matches.is_present("lamports"); let vote_account_pubkeys = pubkeys_of_multiple_signers(matches, "vote_account_pubkeys", wallet_manager)?; Ok(CliCommandInfo { command: CliCommand::ShowStakes { use_lamports_unit, vote_account_pubkeys, }, signers: vec![], }) } pub fn parse_show_validators(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { let use_lamports_unit = matches.is_present("lamports"); let number_validators = matches.is_present("number"); let reverse_sort = matches.is_present("reverse"); let keep_unstaked_delinquents = matches.is_present("keep_unstaked_delinquents"); let delinquent_slot_distance = value_of(matches, "delinquent_slot_distance"); let sort_order = match value_t_or_exit!(matches, "sort", String).as_str() { "delinquent" => CliValidatorsSortOrder::Delinquent, "commission" => CliValidatorsSortOrder::Commission, "credits" => CliValidatorsSortOrder::EpochCredits, "identity" => CliValidatorsSortOrder::Identity, "last-vote" => CliValidatorsSortOrder::LastVote, "root" => CliValidatorsSortOrder::Root, "skip-rate" => CliValidatorsSortOrder::SkipRate, "stake" => CliValidatorsSortOrder::Stake, "vote-account" => CliValidatorsSortOrder::VoteAccount, _ => unreachable!(), }; Ok(CliCommandInfo { command: CliCommand::ShowValidators { use_lamports_unit, sort_order, reverse_sort, number_validators, keep_unstaked_delinquents, delinquent_slot_distance, }, signers: vec![], }) } pub fn parse_transaction_history( matches: &ArgMatches<'_>, wallet_manager: &mut Option<Arc<RemoteWalletManager>>, ) -> Result<CliCommandInfo, CliError> { let address = pubkey_of_signer(matches, "address", wallet_manager)?.unwrap(); let before = match matches.value_of("before") { Some(signature) => Some( signature .parse() .map_err(|err| CliError::BadParameter(format!("Invalid signature: {}", err)))?, ), None => None, }; let until = match matches.value_of("until") { Some(signature) => Some( signature .parse() .map_err(|err| CliError::BadParameter(format!("Invalid signature: {}", err)))?, ), None => None, }; let limit = value_t_or_exit!(matches, "limit", usize); let show_transactions = matches.is_present("show_transactions"); Ok(CliCommandInfo { command: CliCommand::TransactionHistory { address, before, until, limit, show_transactions, }, signers: vec![], }) } pub fn process_catchup( rpc_client: &RpcClient, config: &CliConfig, node_pubkey: Option<Pubkey>, mut node_json_rpc_url: Option<String>, follow: bool, our_localhost_port: Option<u16>, log: bool, ) -> ProcessResult { let sleep_interval = 5; let progress_bar = new_spinner_progress_bar(); progress_bar.set_message("Connecting..."); if let Some(our_localhost_port) = our_localhost_port { let gussed_default = Some(format!("http://localhost:{}", our_localhost_port)); if node_json_rpc_url.is_some() && node_json_rpc_url != gussed_default { // go to new line to leave this message on console println!( "Prefering explicitly given rpc ({}) as us, \ although --our-localhost is given\n", node_json_rpc_url.as_ref().unwrap() ); } else { node_json_rpc_url = gussed_default; } } let (node_client, node_pubkey) = if our_localhost_port.is_some() { let client = RpcClient::new(node_json_rpc_url.unwrap()); let guessed_default = Some(client.get_identity()?); ( client, (if node_pubkey.is_some() && node_pubkey != guessed_default { // go to new line to leave this message on console println!( "Prefering explicitly given node pubkey ({}) as us, \ although --our-localhost is given\n", node_pubkey.unwrap() ); node_pubkey } else { guessed_default }) .unwrap(), ) } else if let Some(node_pubkey) = node_pubkey { if let Some(node_json_rpc_url) = node_json_rpc_url { (RpcClient::new(node_json_rpc_url), node_pubkey) } else { let rpc_addr = loop { let cluster_nodes = rpc_client.get_cluster_nodes()?; if let Some(contact_info) = cluster_nodes .iter() .find(|contact_info| contact_info.pubkey == node_pubkey.to_string()) { if let Some(rpc_addr) = contact_info.rpc { break rpc_addr; } progress_bar.set_message(format!("RPC service not found for {}", node_pubkey)); } else { progress_bar .set_message(format!("Contact information not found for {}", node_pubkey)); } sleep(Duration::from_secs(sleep_interval as u64)); }; (RpcClient::new_socket(rpc_addr), node_pubkey) } } else { unreachable!() }; let reported_node_pubkey = loop { match node_client.get_identity() { Ok(reported_node_pubkey) => break reported_node_pubkey, Err(err) => { if let ClientErrorKind::Reqwest(err) = err.kind() { progress_bar.set_message(format!("Connection failed: {}", err)); sleep(Duration::from_secs(sleep_interval as u64)); continue; } return Err(Box::new(err)); } } }; if reported_node_pubkey != node_pubkey { return Err(format!( "The identity reported by node RPC URL does not match. Expected: {:?}. Reported: {:?}", node_pubkey, reported_node_pubkey ) .into()); } if rpc_client.get_identity()? == node_pubkey { return Err("Both RPC URLs reference the same node, unable to monitor for catchup. Try a different --url".into()); } let mut previous_rpc_slot = std::u64::MAX; let mut previous_slot_distance = 0; let mut retry_count = 0; let max_retry_count = 5; let mut get_slot_while_retrying = |client: &RpcClient| { loop { match client.get_slot_with_commitment(config.commitment) { Ok(r) => { retry_count = 0; return Ok(r); } Err(e) => { if retry_count >= max_retry_count { return Err(e); } retry_count += 1; if log { // go to new line to leave this message on console println!("Retrying({}/{}): {}\n", retry_count, max_retry_count, e); } sleep(Duration::from_secs(1)); } }; } }; let start_node_slot = get_slot_while_retrying(&node_client)?; let start_rpc_slot = get_slot_while_retrying(rpc_client)?; let start_slot_distance = start_rpc_slot as i64 - start_node_slot as i64; let mut total_sleep_interval = 0; loop { // humbly retry; the reference node (rpc_client) could be spotty, // especially if pointing to api.meinnet-beta.solana.com at times let rpc_slot = get_slot_while_retrying(rpc_client)?; let node_slot = get_slot_while_retrying(&node_client)?; if !follow && node_slot > std::cmp::min(previous_rpc_slot, rpc_slot) { progress_bar.finish_and_clear(); return Ok(format!( "{} has caught up (us:{} them:{})", node_pubkey, node_slot, rpc_slot, )); } let slot_distance = rpc_slot as i64 - node_slot as i64; let slots_per_second = (previous_slot_distance - slot_distance) as f64 / f64::from(sleep_interval); let average_time_remaining = if slot_distance == 0 || total_sleep_interval == 0 { "".to_string() } else { let distance_delta = start_slot_distance as i64 - slot_distance as i64; let average_catchup_slots_per_second = distance_delta as f64 / f64::from(total_sleep_interval); let average_time_remaining = (slot_distance as f64 / average_catchup_slots_per_second).round(); if !average_time_remaining.is_normal() { "".to_string() } else if average_time_remaining < 0.0 { format!( " (AVG: {:.1} slots/second (falling))", average_catchup_slots_per_second ) } else { // important not to miss next scheduled lead slots let total_node_slot_delta = node_slot as i64 - start_node_slot as i64; let average_node_slots_per_second = total_node_slot_delta as f64 / f64::from(total_sleep_interval); let expected_finish_slot = (node_slot as f64 + average_time_remaining as f64 * average_node_slots_per_second as f64) .round(); format!( " (AVG: {:.1} slots/second, ETA: slot {} in {})", average_catchup_slots_per_second, expected_finish_slot, humantime::format_duration(Duration::from_secs_f64(average_time_remaining)) ) } }; progress_bar.set_message(format!( "{} slot(s) {} (us:{} them:{}){}", slot_distance.abs(), if slot_distance >= 0 { "behind" } else { "ahead" }, node_slot, rpc_slot, if slot_distance == 0 || previous_rpc_slot == std::u64::MAX { "".to_string() } else { format!( ", {} node is {} at {:.1} slots/second{}", if slot_distance >= 0 { "our" } else { "their" }, if slots_per_second < 0.0 { "falling behind" } else { "gaining" }, slots_per_second, average_time_remaining ) }, )); if log { println!(); } sleep(Duration::from_secs(sleep_interval as u64)); previous_rpc_slot = rpc_slot; previous_slot_distance = slot_distance; total_sleep_interval += sleep_interval; } } pub fn process_cluster_date(rpc_client: &RpcClient, config: &CliConfig) -> ProcessResult { let result = rpc_client.get_account_with_commitment(&sysvar::clock::id(), config.commitment)?; if let Some(clock_account) = result.value { let clock: Clock = from_account(&clock_account).ok_or_else(|| { CliError::RpcRequestError("Failed to deserialize clock sysvar".to_string()) })?; let block_time = CliBlockTime { slot: result.context.slot, timestamp: clock.unix_timestamp, }; Ok(config.output_format.formatted_string(&block_time)) } else { Err(format!("AccountNotFound: pubkey={}", sysvar::clock::id()).into()) } } pub fn process_cluster_version(rpc_client: &RpcClient, config: &CliConfig) -> ProcessResult { let remote_version = rpc_client.get_version()?; if config.verbose { Ok(format!("{:?}", remote_version)) } else { Ok(remote_version.to_string()) } } pub fn process_fees( rpc_client: &RpcClient, config: &CliConfig, blockhash: Option<&Hash>, ) -> ProcessResult { let fees = if let Some(recent_blockhash) = blockhash { #[allow(deprecated)] let result = rpc_client.get_fee_calculator_for_blockhash_with_commitment( recent_blockhash, config.commitment, )?; if let Some(fee_calculator) = result.value { CliFees::some( result.context.slot, *recent_blockhash, fee_calculator.lamports_per_signature, None, None, ) } else { CliFees::none() } } else { #[allow(deprecated)] let result = rpc_client.get_fees_with_commitment(config.commitment)?; CliFees::some( result.context.slot, result.value.blockhash, result.value.fee_calculator.lamports_per_signature, None, Some(result.value.last_valid_block_height), ) }; Ok(config.output_format.formatted_string(&fees)) } pub fn process_first_available_block(rpc_client: &RpcClient) -> ProcessResult { let first_available_block = rpc_client.get_first_available_block()?; Ok(format!("{}", first_available_block)) } pub fn parse_leader_schedule(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { let epoch = value_of(matches, "epoch"); Ok(CliCommandInfo { command: CliCommand::LeaderSchedule { epoch }, signers: vec![], }) } pub fn process_leader_schedule( rpc_client: &RpcClient, config: &CliConfig, epoch: Option<Epoch>, ) -> ProcessResult { let epoch_info = rpc_client.get_epoch_info()?; let epoch = epoch.unwrap_or(epoch_info.epoch); if epoch > epoch_info.epoch { return Err(format!("Epoch {} is in the future", epoch).into()); } let epoch_schedule = rpc_client.get_epoch_schedule()?; let first_slot_in_epoch = epoch_schedule.get_first_slot_in_epoch(epoch); let leader_schedule = rpc_client.get_leader_schedule(Some(first_slot_in_epoch))?; if leader_schedule.is_none() { return Err(format!( "Unable to fetch leader schedule for slot {}", first_slot_in_epoch ) .into()); } let leader_schedule = leader_schedule.unwrap(); let mut leader_per_slot_index = Vec::new(); for (pubkey, leader_slots) in leader_schedule.iter() { for slot_index in leader_slots.iter() { if *slot_index >= leader_per_slot_index.len() { leader_per_slot_index.resize(*slot_index + 1, "?"); } leader_per_slot_index[*slot_index] = pubkey; } } let mut leader_schedule_entries = vec![]; for (slot_index, leader) in leader_per_slot_index.iter().enumerate() { leader_schedule_entries.push(CliLeaderScheduleEntry { slot: first_slot_in_epoch + slot_index as u64, leader: leader.to_string(), }); } Ok(config.output_format.formatted_string(&CliLeaderSchedule { epoch, leader_schedule_entries, })) } pub fn process_get_block( rpc_client: &RpcClient, config: &CliConfig, slot: Option<Slot>, ) -> ProcessResult { let slot = if let Some(slot) = slot { slot } else { rpc_client.get_slot_with_commitment(CommitmentConfig::finalized())? }; let encoded_confirmed_block = rpc_client .get_block_with_config( slot, RpcBlockConfig { encoding: Some(UiTransactionEncoding::Base64), commitment: Some(CommitmentConfig::confirmed()), ..RpcBlockConfig::default() }, )? .into(); let cli_block = CliBlock { encoded_confirmed_block, slot, }; Ok(config.output_format.formatted_string(&cli_block)) } pub fn process_get_block_time( rpc_client: &RpcClient, config: &CliConfig, slot: Option<Slot>, ) -> ProcessResult { let slot = if let Some(slot) = slot { slot } else { rpc_client.get_slot_with_commitment(CommitmentConfig::finalized())? }; let timestamp = rpc_client.get_block_time(slot)?; let block_time = CliBlockTime { slot, timestamp }; Ok(config.output_format.formatted_string(&block_time)) } pub fn process_get_epoch(rpc_client: &RpcClient, _config: &CliConfig) -> ProcessResult { let epoch_info = rpc_client.get_epoch_info()?; Ok(epoch_info.epoch.to_string()) } pub fn process_get_epoch_info(rpc_client: &RpcClient, config: &CliConfig) -> ProcessResult { let epoch_info = rpc_client.get_epoch_info()?; let average_slot_time_ms = rpc_client .get_recent_performance_samples(Some(60)) .ok() .and_then(|samples| { let (slots, secs) = samples.iter().fold((0, 0), |(slots, secs), sample| { (slots + sample.num_slots, secs + sample.sample_period_secs) }); (secs as u64).saturating_mul(1000).checked_div(slots) }) .unwrap_or(clock::DEFAULT_MS_PER_SLOT); let start_block_time = rpc_client .get_block_time(epoch_info.absolute_slot - epoch_info.slot_index) .ok(); let current_block_time = rpc_client.get_block_time(epoch_info.absolute_slot).ok(); let epoch_info = CliEpochInfo { epoch_info, average_slot_time_ms, start_block_time, current_block_time, }; Ok(config.output_format.formatted_string(&epoch_info)) } pub fn process_get_genesis_hash(rpc_client: &RpcClient) -> ProcessResult { let genesis_hash = rpc_client.get_genesis_hash()?; Ok(genesis_hash.to_string()) } pub fn process_get_slot(rpc_client: &RpcClient, _config: &CliConfig) -> ProcessResult { let slot = rpc_client.get_slot()?; Ok(slot.to_string()) } pub fn process_get_block_height(rpc_client: &RpcClient, _config: &CliConfig) -> ProcessResult { let block_height = rpc_client.get_block_height()?; Ok(block_height.to_string()) } pub fn parse_show_block_production(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> { let epoch = value_t!(matches, "epoch", Epoch).ok(); let slot_limit = value_t!(matches, "slot_limit", u64).ok(); Ok(CliCommandInfo { command: CliCommand::ShowBlockProduction { epoch, slot_limit }, signers: vec![], }) } pub fn process_show_block_production( rpc_client: &RpcClient, config: &CliConfig, epoch: Option<Epoch>, slot_limit: Option<u64>, ) -> ProcessResult { let epoch_schedule = rpc_client.get_epoch_schedule()?; let epoch_info = rpc_client.get_epoch_info_with_commitment(CommitmentConfig::finalized())?; let epoch = epoch.unwrap_or(epoch_info.epoch); if epoch > epoch_info.epoch { return Err(format!("Epoch {} is in the future", epoch).into()); } let first_slot_in_epoch = epoch_schedule.get_first_slot_in_epoch(epoch); let end_slot = std::cmp::min( epoch_info.absolute_slot, epoch_schedule.get_last_slot_in_epoch(epoch), ); let mut start_slot = if let Some(slot_limit) = slot_limit { std::cmp::max(end_slot.saturating_sub(slot_limit), first_slot_in_epoch) } else { first_slot_in_epoch }; let progress_bar = new_spinner_progress_bar(); progress_bar.set_message(format!( "Fetching confirmed blocks between slots {} and {}...", start_slot, end_slot )); let slot_history_account = rpc_client .get_account_with_commitment(&sysvar::slot_history::id(), CommitmentConfig::finalized())? .value .unwrap(); let slot_history: SlotHistory = from_account(&slot_history_account).ok_or_else(|| { CliError::RpcRequestError("Failed to deserialize slot history".to_string()) })?; let (confirmed_blocks, start_slot) = if start_slot >= slot_history.oldest() && end_slot <= slot_history.newest() { // Fast, more reliable path using the SlotHistory sysvar let confirmed_blocks: Vec<_> = (start_slot..=end_slot) .filter(|slot| slot_history.check(*slot) == slot_history::Check::Found) .collect(); (confirmed_blocks, start_slot) } else { // Slow, less reliable path using `getBlocks`. // // "less reliable" because if the RPC node has holds in its ledger then the block production data will be // incorrect. This condition currently can't be detected over RPC // let minimum_ledger_slot = rpc_client.minimum_ledger_slot()?; if minimum_ledger_slot > end_slot { return Err(format!( "Ledger data not available for slots {} to {} (minimum ledger slot is {})", start_slot, end_slot, minimum_ledger_slot ) .into()); } if minimum_ledger_slot > start_slot { progress_bar.println(format!( "{}", style(format!( "Note: Requested start slot was {} but minimum ledger slot is {}", start_slot, minimum_ledger_slot )) .italic(), )); start_slot = minimum_ledger_slot; } let confirmed_blocks = rpc_client.get_blocks(start_slot, Some(end_slot))?; (confirmed_blocks, start_slot) }; let start_slot_index = (start_slot - first_slot_in_epoch) as usize; let end_slot_index = (end_slot - first_slot_in_epoch) as usize; let total_slots = end_slot_index - start_slot_index + 1; let total_blocks_produced = confirmed_blocks.len(); assert!(total_blocks_produced <= total_slots); let total_slots_skipped = total_slots - total_blocks_produced; let mut leader_slot_count = HashMap::new(); let mut leader_skipped_slots = HashMap::new(); progress_bar.set_message(format!("Fetching leader schedule for epoch {}...", epoch)); let leader_schedule = rpc_client .get_leader_schedule_with_commitment(Some(start_slot), CommitmentConfig::finalized())?; if leader_schedule.is_none() { return Err(format!("Unable to fetch leader schedule for slot {}", start_slot).into()); } let leader_schedule = leader_schedule.unwrap(); let mut leader_per_slot_index = Vec::new(); leader_per_slot_index.resize(total_slots, "?".to_string()); for (pubkey, leader_slots) in leader_schedule.iter() { let pubkey = format_labeled_address(pubkey, &config.address_labels); for slot_index in leader_slots.iter() { if *slot_index >= start_slot_index && *slot_index <= end_slot_index { leader_per_slot_index[*slot_index - start_slot_index] = pubkey.clone(); } } } progress_bar.set_message(format!( "Processing {} slots containing {} blocks and {} empty slots...", total_slots, total_blocks_produced, total_slots_skipped )); let mut confirmed_blocks_index = 0; let mut individual_slot_status = vec![]; for (slot_index, leader) in leader_per_slot_index.iter().enumerate() { let slot = start_slot + slot_index as u64; let slot_count = leader_slot_count.entry(leader).or_insert(0); *slot_count += 1; let skipped_slots = leader_skipped_slots.entry(leader).or_insert(0); loop { if confirmed_blocks_index < confirmed_blocks.len() { let slot_of_next_confirmed_block = confirmed_blocks[confirmed_blocks_index]; if slot_of_next_confirmed_block < slot { confirmed_blocks_index += 1; continue; } if slot_of_next_confirmed_block == slot { individual_slot_status.push(CliSlotStatus { slot, leader: (*leader).to_string(), skipped: false, }); break; } } *skipped_slots += 1; individual_slot_status.push(CliSlotStatus { slot, leader: (*leader).to_string(), skipped: true, }); break; } } progress_bar.finish_and_clear(); let mut leaders: Vec<CliBlockProductionEntry> = leader_slot_count .iter() .map(|(leader, leader_slots)| { let skipped_slots = leader_skipped_slots.get(leader).unwrap(); let blocks_produced = leader_slots - skipped_slots; CliBlockProductionEntry { identity_pubkey: (**leader).to_string(), leader_slots: *leader_slots, blocks_produced, skipped_slots: *skipped_slots, } }) .collect(); leaders.sort_by(|a, b| a.identity_pubkey.partial_cmp(&b.identity_pubkey).unwrap()); let block_production = CliBlockProduction { epoch, start_slot, end_slot, total_slots, total_blocks_produced, total_slots_skipped, leaders, individual_slot_status, verbose: config.verbose, }; Ok(config.output_format.formatted_string(&block_production)) } pub fn process_largest_accounts( rpc_client: &RpcClient, config: &CliConfig, filter: Option<RpcLargestAccountsFilter>, ) -> ProcessResult { let accounts = rpc_client .get_largest_accounts_with_config(RpcLargestAccountsConfig { commitment: Some(config.commitment), filter, })? .value; let largest_accounts = CliAccountBalances { accounts }; Ok(config.output_format.formatted_string(&largest_accounts)) } pub fn process_supply( rpc_client: &RpcClient, config: &CliConfig, print_accounts: bool, ) -> ProcessResult { let supply_response = rpc_client.supply()?; let mut supply: CliSupply = supply_response.value.into(); supply.print_accounts = print_accounts; Ok(config.output_format.formatted_string(&supply)) } pub fn process_total_supply(rpc_client: &RpcClient, _config: &CliConfig) -> ProcessResult { let supply = rpc_client.supply()?.value; Ok(format!("{} SOL", lamports_to_sol(supply.total))) } pub fn process_get_transaction_count(rpc_client: &RpcClient, _config: &CliConfig) -> ProcessResult { let transaction_count = rpc_client.get_transaction_count()?; Ok(transaction_count.to_string()) } pub fn process_ping( rpc_client: &RpcClient, config: &CliConfig, lamports: u64, interval: &Duration, count: &Option<u64>, timeout: &Duration, fixed_blockhash: &Option<Hash>, print_timestamp: bool, ) -> ProcessResult { println_name_value("Source Account:", &config.signers[0].pubkey().to_string()); println!(); let (signal_sender, signal_receiver) = std::sync::mpsc::channel(); ctrlc::set_handler(move || { let _ = signal_sender.send(()); }) .expect("Error setting Ctrl-C handler"); let mut submit_count = 0; let mut confirmed_count = 0; let mut confirmation_time: VecDeque<u64> = VecDeque::with_capacity(1024); let mut blockhash = rpc_client.get_latest_blockhash()?; let mut blockhash_transaction_count = 0; let mut blockhash_acquired = Instant::now(); if let Some(fixed_blockhash) = fixed_blockhash { let blockhash_origin = if *fixed_blockhash != Hash::default() { blockhash = *fixed_blockhash; "supplied from cli arguments" } else { "fetched from cluster" }; println!( "Fixed blockhash is used: {} ({})", blockhash, blockhash_origin ); } 'mainloop: for seq in 0..count.unwrap_or(std::u64::MAX) { let now = Instant::now(); if fixed_blockhash.is_none() && now.duration_since(blockhash_acquired).as_secs() > 60 { // Fetch a new blockhash every minute let new_blockhash = rpc_client.get_new_latest_blockhash(&blockhash)?; blockhash = new_blockhash; blockhash_transaction_count = 0; blockhash_acquired = Instant::now(); } let seed = &format!("{}{}", blockhash_transaction_count, blockhash)[0..pubkey::MAX_SEED_LEN]; let to = Pubkey::create_with_seed(&config.signers[0].pubkey(), seed, &system_program::id()) .unwrap(); blockhash_transaction_count += 1; let build_message = |lamports| { let ix = system_instruction::transfer(&config.signers[0].pubkey(), &to, lamports); Message::new(&[ix], Some(&config.signers[0].pubkey())) }; let (message, _) = resolve_spend_tx_and_check_account_balance( rpc_client, false, SpendAmount::Some(lamports), &blockhash, &config.signers[0].pubkey(), build_message, config.commitment, )?; let mut tx = Transaction::new_unsigned(message); tx.try_sign(&config.signers, blockhash)?; let timestamp = || { let micros = SystemTime::now() .duration_since(UNIX_EPOCH) .unwrap() .as_micros(); if print_timestamp { format!("[{}.{:06}] ", micros / 1_000_000, micros % 1_000_000) } else { String::new() } }; match rpc_client.send_transaction(&tx) { Ok(signature) => { let transaction_sent = Instant::now(); loop { let signature_status = rpc_client.get_signature_status(&signature)?; let elapsed_time = Instant::now().duration_since(transaction_sent); if let Some(transaction_status) = signature_status { match transaction_status { Ok(()) => { let elapsed_time_millis = elapsed_time.as_millis() as u64; confirmation_time.push_back(elapsed_time_millis); println!( "{}{}{} lamport(s) transferred: seq={:<3} time={:>4}ms signature={}", timestamp(), CHECK_MARK, lamports, seq, elapsed_time_millis, signature ); confirmed_count += 1; } Err(err) => { println!( "{}{}Transaction failed: seq={:<3} error={:?} signature={}", timestamp(), CROSS_MARK, seq, err, signature ); } } break; } if elapsed_time >= *timeout { println!( "{}{}Confirmation timeout: seq={:<3} signature={}", timestamp(), CROSS_MARK, seq, signature ); break; } // Sleep for half a slot if signal_receiver .recv_timeout(Duration::from_millis(clock::DEFAULT_MS_PER_SLOT / 2)) .is_ok() { break 'mainloop; } } } Err(err) => { println!( "{}{}Submit failed: seq={:<3} error={:?}", timestamp(), CROSS_MARK, seq, err ); } } submit_count += 1; if signal_receiver.recv_timeout(*interval).is_ok() { break 'mainloop; } } println!(); println!("--- transaction statistics ---"); println!( "{} transactions submitted, {} transactions confirmed, {:.1}% transaction loss", submit_count, confirmed_count, (100. - f64::from(confirmed_count) / f64::from(submit_count) * 100.) ); if !confirmation_time.is_empty() { let samples: Vec<f64> = confirmation_time.iter().map(|t| *t as f64).collect(); let dist = criterion_stats::Distribution::from(samples.into_boxed_slice()); let mean = dist.mean(); println!( "confirmation min/mean/max/stddev = {:.0}/{:.0}/{:.0}/{:.0} ms", dist.min(), mean, dist.max(), dist.std_dev(Some(mean)) ); } Ok("".to_string()) } pub fn parse_logs( matches: &ArgMatches<'_>, wallet_manager: &mut Option<Arc<RemoteWalletManager>>, ) -> Result<CliCommandInfo, CliError> { let address = pubkey_of_signer(matches, "address", wallet_manager)?; let include_votes = matches.is_present("include_votes"); let filter = match address { None => { if include_votes { RpcTransactionLogsFilter::AllWithVotes } else { RpcTransactionLogsFilter::All } } Some(address) => RpcTransactionLogsFilter::Mentions(vec![address.to_string()]), }; Ok(CliCommandInfo { command: CliCommand::Logs { filter }, signers: vec![], }) } pub fn process_logs(config: &CliConfig, filter: &RpcTransactionLogsFilter) -> ProcessResult { println!( "Streaming transaction logs{}. {:?} commitment", match filter { RpcTransactionLogsFilter::All => "".into(), RpcTransactionLogsFilter::AllWithVotes => " (including votes)".into(), RpcTransactionLogsFilter::Mentions(addresses) => format!(" mentioning {}", addresses.join(",")), }, config.commitment.commitment ); let (_client, receiver) = PubsubClient::logs_subscribe( &config.websocket_url, filter.clone(), RpcTransactionLogsConfig { commitment: Some(config.commitment), }, )?; loop { match receiver.recv() { Ok(logs) => { println!("Transaction executed in slot {}:", logs.context.slot); println!(" Signature: {}", logs.value.signature); println!( " Status: {}", logs.value .err .map(|err| err.to_string()) .unwrap_or_else(|| "Ok".to_string()) ); println!(" Log Messages:"); for log in logs.value.logs { println!(" {}", log); } } Err(err) => { return Ok(format!("Disconnected: {}", err)); } } } } pub fn proc
fig: &CliConfig) -> ProcessResult { let exit = Arc::new(AtomicBool::new(false)); let mut current: Option<SlotInfo> = None; let mut message = "".to_string(); let slot_progress = new_spinner_progress_bar(); slot_progress.set_message("Connecting..."); let (mut client, receiver) = PubsubClient::slot_subscribe(&config.websocket_url)?; slot_progress.set_message("Connected."); let spacer = "|"; slot_progress.println(spacer); let mut last_root = std::u64::MAX; let mut last_root_update = Instant::now(); let mut slots_per_second = std::f64::NAN; loop { if exit.load(Ordering::Relaxed) { eprintln!("{}", message); client.shutdown().unwrap(); break; } match receiver.recv() { Ok(new_info) => { if last_root == std::u64::MAX { last_root = new_info.root; last_root_update = Instant::now(); } if last_root_update.elapsed().as_secs() >= 5 { let root = new_info.root; slots_per_second = (root - last_root) as f64 / last_root_update.elapsed().as_secs() as f64; last_root_update = Instant::now(); last_root = root; } message = if slots_per_second.is_nan() { format!("{:?}", new_info) } else { format!( "{:?} | root slot advancing at {:.2} slots/second", new_info, slots_per_second ) }; slot_progress.set_message(message.clone()); if let Some(previous) = current { let slot_delta: i64 = new_info.slot as i64 - previous.slot as i64; let root_delta: i64 = new_info.root as i64 - previous.root as i64; // // if slot has advanced out of step with the root, we detect // a mismatch and output the slot information // if slot_delta != root_delta { let prev_root = format!( "|<--- {} <- … <- {} <- {} (prev)", previous.root, previous.parent, previous.slot ); slot_progress.println(&prev_root); let new_root = format!( "| '- {} <- … <- {} <- {} (next)", new_info.root, new_info.parent, new_info.slot ); slot_progress.println(prev_root); slot_progress.println(new_root); slot_progress.println(spacer); } } current = Some(new_info); } Err(err) => { eprintln!("disconnected: {}", err); break; } } } Ok("".to_string()) } pub fn process_show_gossip(rpc_client: &RpcClient, config: &CliConfig) -> ProcessResult { let cluster_nodes = rpc_client.get_cluster_nodes()?; let nodes: Vec<_> = cluster_nodes .into_iter() .map(|node| CliGossipNode::new(node, &config.address_labels)) .collect(); Ok(config .output_format .formatted_string(&CliGossipNodes(nodes))) } pub fn process_show_stakes( rpc_client: &RpcClient, config: &CliConfig, use_lamports_unit: bool, vote_account_pubkeys: Option<&[Pubkey]>, ) -> ProcessResult { use crate::stake::build_stake_state; let progress_bar = new_spinner_progress_bar(); progress_bar.set_message("Fetching stake accounts..."); let mut program_accounts_config = RpcProgramAccountsConfig { account_config: RpcAccountInfoConfig { encoding: Some(solana_account_decoder::UiAccountEncoding::Base64), ..RpcAccountInfoConfig::default() }, ..RpcProgramAccountsConfig::default() }; if let Some(vote_account_pubkeys) = vote_account_pubkeys { // Use server-side filtering if only one vote account is provided if vote_account_pubkeys.len() == 1 { program_accounts_config.filters = Some(vec![ // Filter by `StakeState::Stake(_, _)` rpc_filter::RpcFilterType::Memcmp(rpc_filter::Memcmp { offset: 0, bytes: rpc_filter::MemcmpEncodedBytes::Base58( bs58::encode([2, 0, 0, 0]).into_string(), ), encoding: Some(rpc_filter::MemcmpEncoding::Binary), }), // Filter by `Delegation::voter_pubkey`, which begins at byte offset 124 rpc_filter::RpcFilterType::Memcmp(rpc_filter::Memcmp { offset: 124, bytes: rpc_filter::MemcmpEncodedBytes::Base58( vote_account_pubkeys[0].to_string(), ), encoding: Some(rpc_filter::MemcmpEncoding::Binary), }), ]); } } let all_stake_accounts = rpc_client .get_program_accounts_with_config(&stake::program::id(), program_accounts_config)?; let stake_history_account = rpc_client.get_account(&stake_history::id())?; let clock_account = rpc_client.get_account(&sysvar::clock::id())?; let clock: Clock = from_account(&clock_account).ok_or_else(|| { CliError::RpcRequestError("Failed to deserialize clock sysvar".to_string()) })?; progress_bar.finish_and_clear(); let stake_history = from_account(&stake_history_account).ok_or_else(|| { CliError::RpcRequestError("Failed to deserialize stake history".to_string()) })?; let mut stake_accounts: Vec<CliKeyedStakeState> = vec![]; for (stake_pubkey, stake_account) in all_stake_accounts { if let Ok(stake_state) = stake_account.state() { match stake_state { StakeState::Initialized(_) => { if vote_account_pubkeys.is_none() { stake_accounts.push(CliKeyedStakeState { stake_pubkey: stake_pubkey.to_string(), stake_state: build_stake_state( stake_account.lamports, &stake_state, use_lamports_unit, &stake_history, &clock, ), }); } } StakeState::Stake(_, stake) => { if vote_account_pubkeys.is_none() || vote_account_pubkeys .unwrap() .contains(&stake.delegation.voter_pubkey) { stake_accounts.push(CliKeyedStakeState { stake_pubkey: stake_pubkey.to_string(), stake_state: build_stake_state( stake_account.lamports, &stake_state, use_lamports_unit, &stake_history, &clock, ), }); } } _ => {} } } } Ok(config .output_format .formatted_string(&CliStakeVec::new(stake_accounts))) } pub fn process_wait_for_max_stake( rpc_client: &RpcClient, config: &CliConfig, max_stake_percent: f32, ) -> ProcessResult { let now = std::time::Instant::now(); rpc_client.wait_for_max_stake(config.commitment, max_stake_percent)?; Ok(format!("Done waiting, took: {}s", now.elapsed().as_secs())) } pub fn process_show_validators( rpc_client: &RpcClient, config: &CliConfig, use_lamports_unit: bool, validators_sort_order: CliValidatorsSortOrder, validators_reverse_sort: bool, number_validators: bool, keep_unstaked_delinquents: bool, delinquent_slot_distance: Option<Slot>, ) -> ProcessResult { let progress_bar = new_spinner_progress_bar(); progress_bar.set_message("Fetching vote accounts..."); let epoch_info = rpc_client.get_epoch_info()?; let vote_accounts = rpc_client.get_vote_accounts_with_config(RpcGetVoteAccountsConfig { keep_unstaked_delinquents: Some(keep_unstaked_delinquents), delinquent_slot_distance, ..RpcGetVoteAccountsConfig::default() })?; progress_bar.set_message("Fetching block production..."); let skip_rate: HashMap<_, _> = rpc_client .get_block_production() .ok() .map(|result| { result .value .by_identity .into_iter() .map(|(identity, (leader_slots, blocks_produced))| { ( identity, 100. * (leader_slots.saturating_sub(blocks_produced)) as f64 / leader_slots as f64, ) }) .collect() }) .unwrap_or_default(); progress_bar.set_message("Fetching version information..."); let mut node_version = HashMap::new(); let unknown_version = "unknown".to_string(); for contact_info in rpc_client.get_cluster_nodes()? { node_version.insert( contact_info.pubkey, contact_info .version .unwrap_or_else(|| unknown_version.clone()), ); } progress_bar.finish_and_clear(); let total_active_stake = vote_accounts .current .iter() .chain(vote_accounts.delinquent.iter()) .map(|vote_account| vote_account.activated_stake) .sum(); let total_delinquent_stake = vote_accounts .delinquent .iter() .map(|vote_account| vote_account.activated_stake) .sum(); let total_current_stake = total_active_stake - total_delinquent_stake; let current_validators: Vec<CliValidator> = vote_accounts .current .iter() .map(|vote_account| { CliValidator::new( vote_account, epoch_info.epoch, node_version .get(&vote_account.node_pubkey) .unwrap_or(&unknown_version) .clone(), skip_rate.get(&vote_account.node_pubkey).cloned(), &config.address_labels, ) }) .collect(); let delinquent_validators: Vec<CliValidator> = vote_accounts .delinquent .iter() .map(|vote_account| { CliValidator::new_delinquent( vote_account, epoch_info.epoch, node_version .get(&vote_account.node_pubkey) .unwrap_or(&unknown_version) .clone(), skip_rate.get(&vote_account.node_pubkey).cloned(), &config.address_labels, ) }) .collect(); let mut stake_by_version: BTreeMap<_, CliValidatorsStakeByVersion> = BTreeMap::new(); for validator in current_validators.iter() { let mut entry = stake_by_version .entry(validator.version.clone()) .or_default(); entry.current_validators += 1; entry.current_active_stake += validator.activated_stake; } for validator in delinquent_validators.iter() { let mut entry = stake_by_version .entry(validator.version.clone()) .or_default(); entry.delinquent_validators += 1; entry.delinquent_active_stake += validator.activated_stake; } let validators: Vec<_> = current_validators .into_iter() .chain(delinquent_validators.into_iter()) .collect(); let (average_skip_rate, average_stake_weighted_skip_rate) = { let mut skip_rate_len = 0; let mut skip_rate_sum = 0.; let mut skip_rate_weighted_sum = 0.; for validator in validators.iter() { if let Some(skip_rate) = validator.skip_rate { skip_rate_sum += skip_rate; skip_rate_len += 1; skip_rate_weighted_sum += skip_rate * validator.activated_stake as f64; } } if skip_rate_len > 0 && total_active_stake > 0 { ( skip_rate_sum / skip_rate_len as f64, skip_rate_weighted_sum / total_active_stake as f64, ) } else { (100., 100.) // Impossible? } }; let cli_validators = CliValidators { total_active_stake, total_current_stake, total_delinquent_stake, validators, average_skip_rate, average_stake_weighted_skip_rate, validators_sort_order, validators_reverse_sort, number_validators, stake_by_version, use_lamports_unit, }; Ok(config.output_format.formatted_string(&cli_validators)) } pub fn process_transaction_history( rpc_client: &RpcClient, config: &CliConfig, address: &Pubkey, before: Option<Signature>, until: Option<Signature>, limit: usize, show_transactions: bool, ) -> ProcessResult { let results = rpc_client.get_signatures_for_address_with_config( address, GetConfirmedSignaturesForAddress2Config { before, until, limit: Some(limit), commitment: Some(CommitmentConfig::confirmed()), }, )?; let transactions_found = format!("{} transactions found", results.len()); for result in results { if config.verbose { println!( "{} [slot={} {}status={}] {}", result.signature, result.slot, match result.block_time { None => "".to_string(), Some(block_time) => format!("timestamp={} ", unix_timestamp_to_string(block_time)), }, if let Some(err) = result.err { format!("Failed: {:?}", err) } else { match result.confirmation_status { None => "Finalized".to_string(), Some(status) => format!("{:?}", status), } }, result.memo.unwrap_or_else(|| "".to_string()), ); } else { println!("{}", result.signature); } if show_transactions { if let Ok(signature) = result.signature.parse::<Signature>() { match rpc_client.get_transaction_with_config( &signature, RpcTransactionConfig { encoding: Some(UiTransactionEncoding::Base64), commitment: Some(CommitmentConfig::confirmed()), }, ) { Ok(confirmed_transaction) => { println_transaction( &confirmed_transaction .transaction .transaction .decode() .expect("Successful decode"), &confirmed_transaction.transaction.meta, " ", None, None, ); } Err(err) => println!(" Unable to get confirmed transaction details: {}", err), } } println!(); } } Ok(transactions_found) } #[derive(Serialize, Deserialize)] #[serde(rename_all = "camelCase")] struct CliRentCalculation { pub lamports_per_byte_year: u64, pub lamports_per_epoch: u64, pub rent_exempt_minimum_lamports: u64, #[serde(skip)] pub use_lamports_unit: bool, } impl CliRentCalculation { fn build_balance_message(&self, lamports: u64) -> String { build_balance_message(lamports, self.use_lamports_unit, true) } } impl fmt::Display for CliRentCalculation { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let per_byte_year = self.build_balance_message(self.lamports_per_byte_year); let per_epoch = self.build_balance_message(self.lamports_per_epoch); let exempt_minimum = self.build_balance_message(self.rent_exempt_minimum_lamports); writeln_name_value(f, "Rent per byte-year:", &per_byte_year)?; writeln_name_value(f, "Rent per epoch:", &per_epoch)?; writeln_name_value(f, "Rent-exempt minimum:", &exempt_minimum) } } impl QuietDisplay for CliRentCalculation {} impl VerboseDisplay for CliRentCalculation {} #[derive(Debug, PartialEq)] pub enum RentLengthValue { Nonce, Stake, System, Vote, Bytes(usize), } impl RentLengthValue { pub fn length(&self) -> usize { match self { Self::Nonce => NonceState::size(), Self::Stake => std::mem::size_of::<StakeState>(), Self::System => 0, Self::Vote => VoteState::size_of(), Self::Bytes(l) => *l, } } } #[derive(Debug, Error)] #[error("expected number or moniker, got \"{0}\"")] pub struct RentLengthValueError(pub String); impl FromStr for RentLengthValue { type Err = RentLengthValueError; fn from_str(s: &str) -> Result<Self, Self::Err> { let s = s.to_ascii_lowercase(); match s.as_str() { "nonce" => Ok(Self::Nonce), "stake" => Ok(Self::Stake), "system" => Ok(Self::System), "vote" => Ok(Self::Vote), _ => usize::from_str(&s) .map(Self::Bytes) .map_err(|_| RentLengthValueError(s)), } } } pub fn process_calculate_rent( rpc_client: &RpcClient, config: &CliConfig, data_length: usize, use_lamports_unit: bool, ) -> ProcessResult { let epoch_schedule = rpc_client.get_epoch_schedule()?; let rent_account = rpc_client.get_account(&sysvar::rent::id())?; let rent: Rent = rent_account.deserialize_data()?; let rent_exempt_minimum_lamports = rent.minimum_balance(data_length); let seconds_per_tick = Duration::from_secs_f64(1.0 / clock::DEFAULT_TICKS_PER_SECOND as f64); let slots_per_year = timing::years_as_slots(1.0, &seconds_per_tick, clock::DEFAULT_TICKS_PER_SLOT); let slots_per_epoch = epoch_schedule.slots_per_epoch as f64; let years_per_epoch = slots_per_epoch / slots_per_year; let lamports_per_epoch = rent.due(0, data_length, years_per_epoch).lamports(); let cli_rent_calculation = CliRentCalculation { lamports_per_byte_year: rent.lamports_per_byte_year, lamports_per_epoch, rent_exempt_minimum_lamports, use_lamports_unit, }; Ok(config.output_format.formatted_string(&cli_rent_calculation)) } #[cfg(test)] mod tests { use { super::*, crate::{clap_app::get_clap_app, cli::parse_command}, solana_sdk::signature::{write_keypair, Keypair}, std::str::FromStr, tempfile::NamedTempFile, }; fn make_tmp_file() -> (String, NamedTempFile) { let tmp_file = NamedTempFile::new().unwrap(); (String::from(tmp_file.path().to_str().unwrap()), tmp_file) } #[test] fn test_parse_command() { let test_commands = get_clap_app("test", "desc", "version"); let default_keypair = Keypair::new(); let (default_keypair_file, mut tmp_file) = make_tmp_file(); write_keypair(&default_keypair, tmp_file.as_file_mut()).unwrap(); let default_signer = DefaultSigner::new("", &default_keypair_file); let test_cluster_version = test_commands .clone() .get_matches_from(vec!["test", "cluster-date"]); assert_eq!( parse_command(&test_cluster_version, &default_signer, &mut None).unwrap(), CliCommandInfo { command: CliCommand::ClusterDate, signers: vec![], } ); let test_cluster_version = test_commands .clone() .get_matches_from(vec!["test", "cluster-version"]); assert_eq!( parse_command(&test_cluster_version, &default_signer, &mut None).unwrap(), CliCommandInfo { command: CliCommand::ClusterVersion, signers: vec![], } ); let test_fees = test_commands.clone().get_matches_from(vec!["test", "fees"]); assert_eq!( parse_command(&test_fees, &default_signer, &mut None).unwrap(), CliCommandInfo { command: CliCommand::Fees { blockhash: None }, signers: vec![], } ); let blockhash = Hash::new_unique(); let test_fees = test_commands.clone().get_matches_from(vec![ "test", "fees", "--blockhash", &blockhash.to_string(), ]); assert_eq!( parse_command(&test_fees, &default_signer, &mut None).unwrap(), CliCommandInfo { command: CliCommand::Fees { blockhash: Some(blockhash) }, signers: vec![], } ); let slot = 100; let test_get_block_time = test_commands .clone() .get_matches_from(vec!["test", "block-time", &slot.to_string()]); assert_eq!( parse_command(&test_get_block_time, &default_signer, &mut None).unwrap(), CliCommandInfo { command: CliCommand::GetBlockTime { slot: Some(slot) }, signers: vec![], } ); let test_get_epoch = test_commands .clone() .get_matches_from(vec!["test", "epoch"]); assert_eq!( parse_command(&test_get_epoch, &default_signer, &mut None).unwrap(), CliCommandInfo { command: CliCommand::GetEpoch, signers: vec![], } ); let test_get_epoch_info = test_commands .clone() .get_matches_from(vec!["test", "epoch-info"]); assert_eq!( parse_command(&test_get_epoch_info, &default_signer, &mut None).unwrap(), CliCommandInfo { command: CliCommand::GetEpochInfo, signers: vec![], } ); let test_get_genesis_hash = test_commands .clone() .get_matches_from(vec!["test", "genesis-hash"]); assert_eq!( parse_command(&test_get_genesis_hash, &default_signer, &mut None).unwrap(), CliCommandInfo { command: CliCommand::GetGenesisHash, signers: vec![], } ); let test_get_slot = test_commands.clone().get_matches_from(vec!["test", "slot"]); assert_eq!( parse_command(&test_get_slot, &default_signer, &mut None).unwrap(), CliCommandInfo { command: CliCommand::GetSlot, signers: vec![], } ); let test_total_supply = test_commands .clone() .get_matches_from(vec!["test", "total-supply"]); assert_eq!( parse_command(&test_total_supply, &default_signer, &mut None).unwrap(), CliCommandInfo { command: CliCommand::TotalSupply, signers: vec![], } ); let test_transaction_count = test_commands .clone() .get_matches_from(vec!["test", "transaction-count"]); assert_eq!( parse_command(&test_transaction_count, &default_signer, &mut None).unwrap(), CliCommandInfo { command: CliCommand::GetTransactionCount, signers: vec![], } ); let test_ping = test_commands.clone().get_matches_from(vec![ "test", "ping", "-i", "1", "-c", "2", "-t", "3", "-D", "--blockhash", "4CCNp28j6AhGq7PkjPDP4wbQWBS8LLbQin2xV5n8frKX", ]); assert_eq!( parse_command(&test_ping, &default_signer, &mut None).unwrap(), CliCommandInfo { command: CliCommand::Ping { lamports: 1, interval: Duration::from_secs(1), count: Some(2), timeout: Duration::from_secs(3), blockhash: Some( Hash::from_str("4CCNp28j6AhGq7PkjPDP4wbQWBS8LLbQin2xV5n8frKX").unwrap() ), print_timestamp: true, }, signers: vec![default_keypair.into()], } ); } }
ess_live_slots(con
bloomfilter.py
from unittest import TestCase from helper import bit_field_to_bytes, encode_varint, int_to_little_endian, murmur3 from network import GenericMessage BIP37_CONSTANT = 0xfba4c795 class BloomFilter: def __init__(self, size, function_count, tweak):
self.size = size self.bit_field = [0] * (size * 8) self.function_count = function_count self.tweak = tweak def add(self, item): '''Add an item to the filter''' # iterate self.function_count number of times for i in range(self.function_count): # BIP0037 spec seed is i*BIP37_CONSTANT + self.tweak seed = i * BIP37_CONSTANT + self.tweak # get the murmur3 hash given that seed h = murmur3(item, seed=seed) # set the bit at the hash mod the bitfield size (self.size*8) self.bit_field[h % (self.size * 8)] = 1 # set the bit field at bit to be 1 def filter_bytes(self): return bit_field_to_bytes(self.bit_field) def filterload(self, flag=1): '''Return a network message whose command is filterload''' # encode_varint self.size result = encode_varint(self.size) # next is the self.filter_bytes() result += self.filter_bytes() # function count is 4 bytes little endian result += int_to_little_endian(self.function_count, 4) # tweak is 4 bytes little endian result += int_to_little_endian(self.tweak, 4) # flag is 1 byte little endian result += int_to_little_endian(flag, 1) # return a GenericMessage with b'filterload' as the command return GenericMessage(b'filterload', result) class BloomFilterTest(TestCase): def test_add(self): bf = BloomFilter(10, 5, 99) item = b'Hello World' bf.add(item) expected = '0000000a080000000140' self.assertEqual(bf.filter_bytes().hex(), expected) item = b'Goodbye!' bf.add(item) expected = '4000600a080000010940' self.assertEqual(bf.filter_bytes().hex(), expected) def test_filterload(self): bf = BloomFilter(10, 5, 99) item = b'Hello World' bf.add(item) item = b'Goodbye!' bf.add(item) expected = '0a4000600a080000010940050000006300000001' self.assertEqual(bf.filterload().serialize().hex(), expected)
item.rs
use std::convert::TryFrom; #[derive(Clone, Copy, PartialEq, Eq, Debug, FromPrimitive, ToPrimitive)] #[repr(i32)] /// Represents a block. Not all blocks are implimented or supported yet. pub enum Item { Air = 0, Stone = 1, Granite = 2, PolishedGranite = 3, Diorite = 4, PolishedDiorite = 5, Andesite = 6, PolishedAndesite = 7, Deepslate = 8, CobbledDeepslate = 9, PolishedDeepslate = 10, Calcite = 11, Tuff = 12, DripstoneBlock = 13, GrassBlock = 14, Dirt = 15, CoarseDirt = 16, Podzol = 17, RootedDirt = 18, CrimsonNylium = 19, WarpedNylium = 20, Cobblestone = 21, OakPlanks = 22, SprucePlanks = 23, BirchPlanks = 24, JunglePlanks = 25, AcaciaPlanks = 26, DarkOakPlanks = 27, CrimsonPlanks = 28, WarpedPlanks = 29, OakSapling = 30, SpruceSapling = 31, BirchSapling = 32, JungleSapling = 33, AcaciaSapling = 34, DarkOakSapling = 35, Bedrock = 36, Sand = 37,
CoalOre = 40, DeepslateCoalOre = 41, IronOre = 42, DeepslateIronOre = 43, CopperOre = 44, DeepslateCopperOre = 45, GoldOre = 46, DeepslateGoldOre = 47, RedstoneOre = 48, DeepslateRedstoneOre = 49, EmeraldOre = 50, DeepslateEmeraldOre = 51, LapisOre = 52, DeepslateLapisOre = 53, DiamondOre = 54, DeepslateDiamondOre = 55, NetherGoldOre = 56, NetherQuartzOre = 57, AncientDebris = 58, CoalBlock = 59, RawIronBlock = 60, RawCopperBlock = 61, RawGoldBlock = 62, AmethystBlock = 63, BuddingAmethyst = 64, IronBlock = 65, CopperBlock = 66, GoldBlock = 67, DiamondBlock = 68, NetheriteBlock = 69, ExposedCopper = 70, } impl Item { pub fn to_identifier(self) -> crate::Identifier { todo!(); } } use crate::Error; impl TryFrom<crate::VarInt> for Item { type Error = Error; fn try_from(value: crate::VarInt) -> Result<Self, Self::Error> { return num_traits::FromPrimitive::from_i32(value.value()).ok_or(Error::EnumOutOfBound); } }
RedSand = 38, Gravel = 39,
folder_select.py
from pathlib import Path from sepal_ui import sepalwidgets as sw from component import parameter as cp from component.message import cm class FolderSelect(sw.FileInput): def __init__(self): super().__init__([''], label=cm.widget.folder.label, folder=cp.down_dir) def _on_file_select(self, change): """Dispatch the behaviour between file selection and folder change""" if not change['new']: return self new_value = Path(change['new']) # I keep the same behaviour but I write the value for each directory as no file will ever be selected if new_value.is_dir(): self.folder = new_value self.file = str(new_value) self._change_folder() return self def is_valid_ts(self): """Check if the current folder is a SEPAL generated time series folder""" # clean the errors self.selected_file.error_messages = None # avoid bug at start if not self.v_model: return True folder = Path(self.v_model) valid = True dirs = [d for d in folder.glob('*/')] if len(dirs) == 0: valid = False else: for d in dirs:
valid = False break # write an error message self.selected_file.error_messages = None if valid else cm.widget.folder.no_ts.format('') return valid
try: n = int(d.stem) except:
dependencies.go
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package metadata import ( "regexp" "sort" "strings" "github.com/apache/camel-k/pkg/apis/camel/v1alpha1" "github.com/apache/camel-k/pkg/util/camel" ) var ( additionalDependencies = map[string]string{ ".*JsonLibrary\\.Jackson.*": "camel:jackson", } ) // discoverDependencies returns a list of dependencies required by the given source code func discoverDependencies(source v1alpha1.SourceSpec, fromURIs []string, toURIs []string) []string
func decodeComponent(uri string) string { uriSplit := strings.SplitN(uri, ":", 2) if len(uriSplit) < 2 { return "" } uriStart := uriSplit[0] if component := camel.Runtime.GetArtifactByScheme(uriStart); component != nil { artifactID := component.ArtifactID if component.GroupID == "org.apache.camel" && strings.HasPrefix(artifactID, "camel-") { return "camel:" + artifactID[6:] } if component.GroupID == "org.apache.camel.k" && strings.HasPrefix(artifactID, "camel-") { return "camel-k:" + artifactID[6:] } return "mvn:" + component.GroupID + ":" + artifactID + ":" + component.Version } return "" } func findAdditionalDependencies(source v1alpha1.SourceSpec) []string { additional := make([]string, 0) for pattern, dep := range additionalDependencies { pat := regexp.MustCompile(pattern) if pat.MatchString(source.Content) { additional = append(additional, dep) } } return additional }
{ candidateMap := make(map[string]bool) uris := make([]string, 0, len(fromURIs)+len(toURIs)) uris = append(uris, fromURIs...) uris = append(uris, toURIs...) for _, uri := range uris { candidateComp := decodeComponent(uri) if candidateComp != "" { candidateMap[candidateComp] = true } } additional := findAdditionalDependencies(source) for _, dep := range additional { candidateMap[dep] = true } // Remove duplicates and sort candidateComponents := make([]string, 0, len(candidateMap)) for cmp := range candidateMap { candidateComponents = append(candidateComponents, cmp) } sort.Strings(candidateComponents) return candidateComponents }
functions.rs
// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::AccelGroup; use crate::Orientation; use crate::PageSetup; use crate::PositionType; use crate::PrintSettings; use crate::SelectionData; use crate::SpinButton; use crate::StyleContext; use crate::TextBuffer; use crate::TextDirection; use crate::TreeModel; use crate::TreePath; use crate::Widget; use crate::Window; use glib::object::IsA; use glib::translate::*; use std::boxed::Box as Box_; use std::mem; use std::ptr; #[doc(alias = "gtk_accel_groups_activate")] pub fn accel_groups_activate<P: IsA<glib::Object>>( object: &P, accel_key: u32, accel_mods: gdk::ModifierType, ) -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_accel_groups_activate( object.as_ref().to_glib_none().0, accel_key, accel_mods.into_glib(), )) } } #[doc(alias = "gtk_accel_groups_from_object")] pub fn accel_groups_from_object<P: IsA<glib::Object>>(object: &P) -> Vec<AccelGroup> { assert_initialized_main_thread!(); unsafe { FromGlibPtrContainer::from_glib_none(ffi::gtk_accel_groups_from_object( object.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_accelerator_get_default_mod_mask")] pub fn accelerator_get_default_mod_mask() -> gdk::ModifierType { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_accelerator_get_default_mod_mask()) } } #[doc(alias = "gtk_accelerator_get_label")] pub fn accelerator_get_label( accelerator_key: u32, accelerator_mods: gdk::ModifierType, ) -> Option<glib::GString> { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gtk_accelerator_get_label( accelerator_key, accelerator_mods.into_glib(), )) } } #[doc(alias = "gtk_accelerator_get_label_with_keycode")] pub fn accelerator_get_label_with_keycode( display: Option<&gdk::Display>, accelerator_key: u32, keycode: u32, accelerator_mods: gdk::ModifierType, ) -> Option<glib::GString> { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gtk_accelerator_get_label_with_keycode( display.to_glib_none().0, accelerator_key, keycode, accelerator_mods.into_glib(), )) } } #[doc(alias = "gtk_accelerator_name")] pub fn accelerator_name( accelerator_key: u32, accelerator_mods: gdk::ModifierType, ) -> Option<glib::GString> { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gtk_accelerator_name( accelerator_key, accelerator_mods.into_glib(), )) } } #[doc(alias = "gtk_accelerator_name_with_keycode")] pub fn accelerator_name_with_keycode( display: Option<&gdk::Display>, accelerator_key: u32, keycode: u32, accelerator_mods: gdk::ModifierType, ) -> Option<glib::GString> { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gtk_accelerator_name_with_keycode( display.to_glib_none().0, accelerator_key, keycode, accelerator_mods.into_glib(), )) } } #[doc(alias = "gtk_accelerator_parse")] pub fn accelerator_parse(accelerator: &str) -> (u32, gdk::ModifierType) { assert_initialized_main_thread!(); unsafe { let mut accelerator_key = mem::MaybeUninit::uninit(); let mut accelerator_mods = mem::MaybeUninit::uninit(); ffi::gtk_accelerator_parse( accelerator.to_glib_none().0, accelerator_key.as_mut_ptr(), accelerator_mods.as_mut_ptr(), ); let accelerator_key = accelerator_key.assume_init(); let accelerator_mods = accelerator_mods.assume_init(); (accelerator_key, from_glib(accelerator_mods)) } } //#[doc(alias = "gtk_accelerator_parse_with_keycode")] //pub fn accelerator_parse_with_keycode(accelerator: &str, accelerator_codes: Vec<u32>) -> (u32, gdk::ModifierType) { // unsafe { TODO: call ffi:gtk_accelerator_parse_with_keycode() } //} #[doc(alias = "gtk_accelerator_set_default_mod_mask")] pub fn accelerator_set_default_mod_mask(default_mod_mask: gdk::ModifierType) { assert_initialized_main_thread!(); unsafe { ffi::gtk_accelerator_set_default_mod_mask(default_mod_mask.into_glib()); } } #[doc(alias = "gtk_accelerator_valid")] pub fn accelerator_valid(keyval: u32, modifiers: gdk::ModifierType) -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_accelerator_valid(keyval, modifiers.into_glib())) } } #[doc(alias = "gtk_bindings_activate")] pub fn bindings_activate<P: IsA<glib::Object>>( object: &P, keyval: u32, modifiers: gdk::ModifierType, ) -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_bindings_activate( object.as_ref().to_glib_none().0, keyval, modifiers.into_glib(), )) } } #[doc(alias = "gtk_bindings_activate_event")] pub fn bindings_activate_event<P: IsA<glib::Object>>( object: &P, event: &mut gdk::EventKey, ) -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_bindings_activate_event( object.as_ref().to_glib_none().0, event.to_glib_none_mut().0, )) } } #[doc(alias = "gtk_cairo_should_draw_window")] pub fn cairo_should_draw_window(cr: &cairo::Context, window: &gdk::Window) -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_cairo_should_draw_window( mut_override(cr.to_glib_none().0), window.to_glib_none().0, )) } } #[doc(alias = "gtk_cairo_transform_to_window")] pub fn cairo_transform_to_window<P: IsA<Widget>>( cr: &cairo::Context, widget: &P, window: &gdk::Window, ) { skip_assert_initialized!(); unsafe { ffi::gtk_cairo_transform_to_window( mut_override(cr.to_glib_none().0), widget.as_ref().to_glib_none().0, window.to_glib_none().0, ); } } #[doc(alias = "gtk_check_version")] pub fn check_version( required_major: u32, required_minor: u32, required_micro: u32, ) -> Option<glib::GString> { skip_assert_initialized!(); unsafe { from_glib_none(ffi::gtk_check_version( required_major, required_minor, required_micro, )) } } #[doc(alias = "gtk_device_grab_add")] pub fn device_grab_add<P: IsA<Widget>>(widget: &P, device: &gdk::Device, block_others: bool) { skip_assert_initialized!(); unsafe { ffi::gtk_device_grab_add( widget.as_ref().to_glib_none().0, device.to_glib_none().0, block_others.into_glib(), ); } } #[doc(alias = "gtk_device_grab_remove")] pub fn device_grab_remove<P: IsA<Widget>>(widget: &P, device: &gdk::Device) { skip_assert_initialized!(); unsafe { ffi::gtk_device_grab_remove(widget.as_ref().to_glib_none().0, device.to_glib_none().0); } } #[doc(alias = "gtk_disable_setlocale")] pub fn disable_setlocale() { assert_not_initialized!(); unsafe { ffi::gtk_disable_setlocale(); } } //#[doc(alias = "gtk_distribute_natural_allocation")] //pub fn distribute_natural_allocation(extra_space: i32, n_requested_sizes: u32, sizes: /*Ignored*/&mut RequestedSize) -> i32 { // unsafe { TODO: call ffi:gtk_distribute_natural_allocation() } //} #[doc(alias = "gtk_events_pending")] pub fn events_pending() -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_events_pending()) } } #[doc(alias = "gtk_false")] #[doc(alias = "false")] pub fn false_() -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_false()) } } #[doc(alias = "gtk_get_binary_age")] #[doc(alias = "get_binary_age")] pub fn binary_age() -> u32 { skip_assert_initialized!(); unsafe { ffi::gtk_get_binary_age() } } #[doc(alias = "gtk_get_current_event")] #[doc(alias = "get_current_event")] pub fn current_event() -> Option<gdk::Event> { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gtk_get_current_event()) } } #[doc(alias = "gtk_get_current_event_device")] #[doc(alias = "get_current_event_device")] pub fn current_event_device() -> Option<gdk::Device> { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::gtk_get_current_event_device()) } } #[doc(alias = "gtk_get_current_event_state")] #[doc(alias = "get_current_event_state")] pub fn current_event_state() -> Option<gdk::ModifierType> { assert_initialized_main_thread!(); unsafe { let mut state = mem::MaybeUninit::uninit(); let ret = from_glib(ffi::gtk_get_current_event_state(state.as_mut_ptr())); let state = state.assume_init(); if ret { Some(from_glib(state)) } else { None } } } #[doc(alias = "gtk_get_current_event_time")] #[doc(alias = "get_current_event_time")] pub fn current_event_time() -> u32 { assert_initialized_main_thread!(); unsafe { ffi::gtk_get_current_event_time() } } #[doc(alias = "gtk_get_debug_flags")] #[doc(alias = "get_debug_flags")] pub fn debug_flags() -> u32 { assert_initialized_main_thread!(); unsafe { ffi::gtk_get_debug_flags() } } #[doc(alias = "gtk_get_default_language")] #[doc(alias = "get_default_language")] pub fn default_language() -> Option<pango::Language> { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::gtk_get_default_language()) } } #[doc(alias = "gtk_get_event_widget")] #[doc(alias = "get_event_widget")] pub fn event_widget(event: &mut gdk::Event) -> Option<Widget> { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::gtk_get_event_widget(event.to_glib_none_mut().0)) } } #[doc(alias = "gtk_get_interface_age")] #[doc(alias = "get_interface_age")] pub fn interface_age() -> u32 { skip_assert_initialized!(); unsafe { ffi::gtk_get_interface_age() } } #[doc(alias = "gtk_get_locale_direction")] #[doc(alias = "get_locale_direction")] pub fn locale_direction() -> TextDirection { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_get_locale_direction()) } } #[doc(alias = "gtk_get_major_version")] #[doc(alias = "get_major_version")] pub fn major_version() -> u32 { skip_assert_initialized!(); unsafe { ffi::gtk_get_major_version() } } #[doc(alias = "gtk_get_micro_version")] #[doc(alias = "get_micro_version")] pub fn micro_version() -> u32 { skip_assert_initialized!(); unsafe { ffi::gtk_get_micro_version() } } #[doc(alias = "gtk_get_minor_version")] #[doc(alias = "get_minor_version")] pub fn minor_version() -> u32 { skip_assert_initialized!(); unsafe { ffi::gtk_get_minor_version() } } //#[doc(alias = "gtk_get_option_group")] //#[doc(alias = "get_option_group")] //pub fn option_group(open_default_display: bool) -> /*Ignored*/Option<glib::OptionGroup> { // unsafe { TODO: call ffi:gtk_get_option_group() } //} #[doc(alias = "gtk_grab_get_current")] pub fn grab_get_current() -> Option<Widget> { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::gtk_grab_get_current()) } } //#[doc(alias = "gtk_init_check")] //pub fn init_check(argv: /*Unimplemented*/Vec<glib::GString>) -> bool { // unsafe { TODO: call ffi:gtk_init_check() } //} //#[doc(alias = "gtk_init_with_args")] //pub fn init_with_args(argv: /*Unimplemented*/Vec<glib::GString>, parameter_string: Option<&str>, entries: /*Ignored*/&[&glib::OptionEntry], translation_domain: Option<&str>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:gtk_init_with_args() } //} #[doc(alias = "gtk_main")] pub fn main() { assert_initialized_main_thread!(); unsafe { ffi::gtk_main(); } } #[doc(alias = "gtk_main_do_event")] pub fn main_do_event(event: &mut gdk::Event) { assert_initialized_main_thread!(); unsafe { ffi::gtk_main_do_event(event.to_glib_none_mut().0); } } #[doc(alias = "gtk_main_iteration")] pub fn main_iteration() -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_main_iteration()) } } #[doc(alias = "gtk_main_iteration_do")] pub fn main_iteration_do(blocking: bool) -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_main_iteration_do(blocking.into_glib())) } } #[doc(alias = "gtk_main_level")] pub fn main_level() -> u32 { assert_initialized_main_thread!(); unsafe { ffi::gtk_main_level() } } //#[doc(alias = "gtk_parse_args")] //pub fn parse_args(argv: /*Unimplemented*/Vec<glib::GString>) -> bool { // unsafe { TODO: call ffi:gtk_parse_args() } //} #[doc(alias = "gtk_print_run_page_setup_dialog")] pub fn print_run_page_setup_dialog<P: IsA<Window>>( parent: Option<&P>, page_setup: Option<&PageSetup>, settings: &PrintSettings, ) -> Option<PageSetup> { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gtk_print_run_page_setup_dialog( parent.map(|p| p.as_ref()).to_glib_none().0, page_setup.to_glib_none().0, settings.to_glib_none().0, )) } } #[doc(alias = "gtk_print_run_page_setup_dialog_async")] pub fn print_run_page_setup_dialog_async< P: IsA<Window>, Q: FnOnce(&PageSetup) + Send + Sync + 'static, >( parent: Option<&P>, page_setup: Option<&PageSetup>, settings: &PrintSettings, done_cb: Q, ) { skip_assert_initialized!(); let done_cb_data: Box_<Q> = Box_::new(done_cb); unsafe extern "C" fn done_cb_func< P: IsA<Window>, Q: FnOnce(&PageSetup) + Send + Sync + 'static, >( page_setup: *mut ffi::GtkPageSetup, data: glib::ffi::gpointer, ) { let page_setup = from_glib_borrow(page_setup); let callback: Box_<Q> = Box_::from_raw(data as *mut _); (*callback)(&page_setup); } let done_cb = Some(done_cb_func::<P, Q> as _); let super_callback0: Box_<Q> = done_cb_data; unsafe { ffi::gtk_print_run_page_setup_dialog_async( parent.map(|p| p.as_ref()).to_glib_none().0, page_setup.to_glib_none().0, settings.to_glib_none().0, done_cb, Box_::into_raw(super_callback0) as *mut _, ); } } #[doc(alias = "gtk_propagate_event")] pub fn propagate_event<P: IsA<Widget>>(widget: &P, event: &mut gdk::Event) { skip_assert_initialized!(); unsafe { ffi::gtk_propagate_event(widget.as_ref().to_glib_none().0, event.to_glib_none_mut().0); } } #[doc(alias = "gtk_render_activity")] pub fn render_activity<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_activity( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, width, height, ); } } #[doc(alias = "gtk_render_arrow")] pub fn render_arrow<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, angle: f64, x: f64, y: f64, size: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_arrow( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), angle, x, y, size, ); } } #[doc(alias = "gtk_render_background")] pub fn render_background<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_background( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, width, height, ); } } #[cfg(any(feature = "v3_20", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] #[doc(alias = "gtk_render_background_get_clip")] pub fn render_background_get_clip<P: IsA<StyleContext>>( context: &P, x: f64, y: f64, width: f64, height: f64, ) -> gdk::Rectangle { skip_assert_initialized!(); unsafe { let mut out_clip = gdk::Rectangle::uninitialized(); ffi::gtk_render_background_get_clip( context.as_ref().to_glib_none().0, x, y, width, height, out_clip.to_glib_none_mut().0, ); out_clip } } #[doc(alias = "gtk_render_check")] pub fn render_check<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_check( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, width, height, ); } } #[doc(alias = "gtk_render_expander")] pub fn render_expander<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_expander( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, width, height, ); } } #[doc(alias = "gtk_render_extension")] pub fn render_extension<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64, gap_side: PositionType, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_extension( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, width, height, gap_side.into_glib(), ); } } #[doc(alias = "gtk_render_focus")] pub fn render_focus<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_focus( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, width, height, ); } } #[doc(alias = "gtk_render_frame")] pub fn render_frame<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_frame( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, width, height, ); } } #[cfg_attr(feature = "v3_24", deprecated = "Since 3.24")] #[doc(alias = "gtk_render_frame_gap")] pub fn render_frame_gap<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64, gap_side: PositionType, xy0_gap: f64, xy1_gap: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_frame_gap( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, width, height, gap_side.into_glib(), xy0_gap, xy1_gap, ); } } #[doc(alias = "gtk_render_handle")] pub fn render_handle<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_handle( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, width, height, ); } } #[doc(alias = "gtk_render_icon")] pub fn render_icon<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, pixbuf: &gdk_pixbuf::Pixbuf, x: f64, y: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_icon( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), pixbuf.to_glib_none().0, x, y, ); } } #[doc(alias = "gtk_render_icon_surface")] pub fn render_icon_surface<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, surface: &cairo::Surface, x: f64, y: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_icon_surface( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), mut_override(surface.to_glib_none().0), x, y, ); } } #[doc(alias = "gtk_render_insertion_cursor")] pub fn render_insertion_cursor<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, layout: &pango::Layout, index: i32, direction: pango::Direction, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_insertion_cursor( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, layout.to_glib_none().0, index, direction.into_glib(), ); } } #[doc(alias = "gtk_render_layout")] pub fn render_layout<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, layout: &pango::Layout, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_layout( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, layout.to_glib_none().0, ); } } #[doc(alias = "gtk_render_line")] pub fn render_line<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x0: f64, y0: f64, x1: f64, y1: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_line( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x0, y0, x1, y1, ); } } #[doc(alias = "gtk_render_option")] pub fn render_option<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_option( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, width, height, ); } } #[doc(alias = "gtk_render_slider")] pub fn render_slider<P: IsA<StyleContext>>( context: &P, cr: &cairo::Context, x: f64, y: f64, width: f64, height: f64, orientation: Orientation, ) { skip_assert_initialized!(); unsafe { ffi::gtk_render_slider( context.as_ref().to_glib_none().0, mut_override(cr.to_glib_none().0), x, y, width, height, orientation.into_glib(), ); } } #[doc(alias = "gtk_rgb_to_hsv")] pub fn rgb_to_hsv(r: f64, g: f64, b: f64) -> (f64, f64, f64) { assert_initialized_main_thread!(); unsafe { let mut h = mem::MaybeUninit::uninit(); let mut s = mem::MaybeUninit::uninit(); let mut v = mem::MaybeUninit::uninit(); ffi::gtk_rgb_to_hsv(r, g, b, h.as_mut_ptr(), s.as_mut_ptr(), v.as_mut_ptr()); let h = h.assume_init(); let s = s.assume_init(); let v = v.assume_init(); (h, s, v) } } #[doc(alias = "gtk_selection_add_target")] pub fn selection_add_target<P: IsA<Widget>>( widget: &P, selection: &gdk::Atom, target: &gdk::Atom, info: u32, ) { skip_assert_initialized!(); unsafe { ffi::gtk_selection_add_target( widget.as_ref().to_glib_none().0, selection.to_glib_none().0, target.to_glib_none().0, info, ); } } #[doc(alias = "gtk_selection_clear_targets")] pub fn selection_clear_targets<P: IsA<Widget>>(widget: &P, selection: &gdk::Atom) { skip_assert_initialized!(); unsafe { ffi::gtk_selection_clear_targets( widget.as_ref().to_glib_none().0, selection.to_glib_none().0, ); } } #[doc(alias = "gtk_selection_convert")] pub fn selection_convert<P: IsA<Widget>>( widget: &P, selection: &gdk::Atom, target: &gdk::Atom, time_: u32, ) -> bool { skip_assert_initialized!(); unsafe { from_glib(ffi::gtk_selection_convert( widget.as_ref().to_glib_none().0, selection.to_glib_none().0, target.to_glib_none().0, time_, )) } } #[doc(alias = "gtk_selection_owner_set")] pub fn selection_owner_set<P: IsA<Widget>>( widget: Option<&P>, selection: &gdk::Atom, time_: u32, ) -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_selection_owner_set( widget.map(|p| p.as_ref()).to_glib_none().0, selection.to_glib_none().0, time_, )) } } #[doc(alias = "gtk_selection_owner_set_for_display")] pub fn selection_owner_set_for_display<P: IsA<Widget>>( display: &gdk::Display, widget: Option<&P>, selection: &gdk::Atom, time_: u32, ) -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_selection_owner_set_for_display( display.to_glib_none().0, widget.map(|p| p.as_ref()).to_glib_none().0, selection.to_glib_none().0, time_, )) } } #[doc(alias = "gtk_selection_remove_all")] pub fn selection_remove_all<P: IsA<Widget>>(widget: &P) { skip_assert_initialized!(); unsafe { ffi::gtk_selection_remove_all(widget.as_ref().to_glib_none().0); } } #[doc(alias = "gtk_set_debug_flags")] pub fn set_debug_flags(flags: u32) { assert_initialized_main_thread!(); unsafe { ffi::gtk_set_debug_flags(flags); } } //#[doc(alias = "gtk_show_about_dialog")] //pub fn show_about_dialog<P: IsA<Window>>(parent: Option<&P>, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { // unsafe { TODO: call ffi:gtk_show_about_dialog() } //} #[doc(alias = "gtk_show_uri")] pub fn show_uri( screen: Option<&gdk::Screen>, uri: &str, timestamp: u32, ) -> Result<(), glib::Error> { assert_initialized_main_thread!(); unsafe { let mut error = ptr::null_mut(); let _ = ffi::gtk_show_uri( screen.to_glib_none().0, uri.to_glib_none().0, timestamp, &mut error, ); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } #[cfg(any(feature = "v3_22", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))] #[doc(alias = "gtk_show_uri_on_window")] pub fn show_uri_on_window<P: IsA<Window>>( parent: Option<&P>, uri: &str, timestamp: u32, ) -> Result<(), glib::Error> { assert_initialized_main_thread!(); unsafe { let mut error = ptr::null_mut(); let _ = ffi::gtk_show_uri_on_window( parent.map(|p| p.as_ref()).to_glib_none().0, uri.to_glib_none().0, timestamp, &mut error, ); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } #[doc(alias = "gtk_targets_include_image")] pub fn targets_include_image(targets: &[&gdk::Atom], writable: bool) -> bool
#[doc(alias = "gtk_targets_include_rich_text")] pub fn targets_include_rich_text<P: IsA<TextBuffer>>(targets: &[&gdk::Atom], buffer: &P) -> bool { skip_assert_initialized!(); let n_targets = targets.len() as i32; unsafe { from_glib(ffi::gtk_targets_include_rich_text( targets.to_glib_none().0, n_targets, buffer.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_targets_include_text")] pub fn targets_include_text(targets: &[&gdk::Atom]) -> bool { assert_initialized_main_thread!(); let n_targets = targets.len() as i32; unsafe { from_glib(ffi::gtk_targets_include_text( targets.to_glib_none().0, n_targets, )) } } #[doc(alias = "gtk_targets_include_uri")] pub fn targets_include_uri(targets: &[&gdk::Atom]) -> bool { assert_initialized_main_thread!(); let n_targets = targets.len() as i32; unsafe { from_glib(ffi::gtk_targets_include_uri( targets.to_glib_none().0, n_targets, )) } } #[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")] #[doc(alias = "gtk_test_create_simple_window")] pub fn test_create_simple_window(window_title: &str, dialog_text: &str) -> Option<Widget> { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::gtk_test_create_simple_window( window_title.to_glib_none().0, dialog_text.to_glib_none().0, )) } } //#[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")] //#[doc(alias = "gtk_test_create_widget")] //pub fn test_create_widget(widget_type: glib::types::Type, first_property_name: Option<&str>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Option<Widget> { // unsafe { TODO: call ffi:gtk_test_create_widget() } //} //#[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")] //#[doc(alias = "gtk_test_display_button_window")] //pub fn test_display_button_window(window_title: &str, dialog_text: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Option<Widget> { // unsafe { TODO: call ffi:gtk_test_display_button_window() } //} #[doc(alias = "gtk_test_find_label")] pub fn test_find_label<P: IsA<Widget>>(widget: &P, label_pattern: &str) -> Option<Widget> { skip_assert_initialized!(); unsafe { from_glib_none(ffi::gtk_test_find_label( widget.as_ref().to_glib_none().0, label_pattern.to_glib_none().0, )) } } #[doc(alias = "gtk_test_find_sibling")] pub fn test_find_sibling<P: IsA<Widget>>( base_widget: &P, widget_type: glib::types::Type, ) -> Option<Widget> { skip_assert_initialized!(); unsafe { from_glib_none(ffi::gtk_test_find_sibling( base_widget.as_ref().to_glib_none().0, widget_type.into_glib(), )) } } #[doc(alias = "gtk_test_find_widget")] pub fn test_find_widget<P: IsA<Widget>>( widget: &P, label_pattern: &str, widget_type: glib::types::Type, ) -> Option<Widget> { skip_assert_initialized!(); unsafe { from_glib_none(ffi::gtk_test_find_widget( widget.as_ref().to_glib_none().0, label_pattern.to_glib_none().0, widget_type.into_glib(), )) } } //#[doc(alias = "gtk_test_init")] //pub fn test_init(argvp: /*Unimplemented*/Vec<glib::GString>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { // unsafe { TODO: call ffi:gtk_test_init() } //} //#[doc(alias = "gtk_test_list_all_types")] //pub fn test_list_all_types() -> /*Unimplemented*/CArray TypeId { ns_id: 0, id: 30 } { // unsafe { TODO: call ffi:gtk_test_list_all_types() } //} #[doc(alias = "gtk_test_register_all_types")] pub fn test_register_all_types() { assert_initialized_main_thread!(); unsafe { ffi::gtk_test_register_all_types(); } } #[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")] #[doc(alias = "gtk_test_slider_get_value")] pub fn test_slider_get_value<P: IsA<Widget>>(widget: &P) -> f64 { skip_assert_initialized!(); unsafe { ffi::gtk_test_slider_get_value(widget.as_ref().to_glib_none().0) } } #[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")] #[doc(alias = "gtk_test_slider_set_perc")] pub fn test_slider_set_perc<P: IsA<Widget>>(widget: &P, percentage: f64) { skip_assert_initialized!(); unsafe { ffi::gtk_test_slider_set_perc(widget.as_ref().to_glib_none().0, percentage); } } #[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")] #[doc(alias = "gtk_test_spin_button_click")] pub fn test_spin_button_click<P: IsA<SpinButton>>(spinner: &P, button: u32, upwards: bool) -> bool { skip_assert_initialized!(); unsafe { from_glib(ffi::gtk_test_spin_button_click( spinner.as_ref().to_glib_none().0, button, upwards.into_glib(), )) } } #[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")] #[doc(alias = "gtk_test_text_get")] pub fn test_text_get<P: IsA<Widget>>(widget: &P) -> Option<glib::GString> { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gtk_test_text_get(widget.as_ref().to_glib_none().0)) } } #[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")] #[doc(alias = "gtk_test_text_set")] pub fn test_text_set<P: IsA<Widget>>(widget: &P, string: &str) { skip_assert_initialized!(); unsafe { ffi::gtk_test_text_set(widget.as_ref().to_glib_none().0, string.to_glib_none().0); } } #[cfg_attr(feature = "v3_20", deprecated = "Since 3.20")] #[doc(alias = "gtk_test_widget_click")] pub fn test_widget_click<P: IsA<Widget>>( widget: &P, button: u32, modifiers: gdk::ModifierType, ) -> bool { skip_assert_initialized!(); unsafe { from_glib(ffi::gtk_test_widget_click( widget.as_ref().to_glib_none().0, button, modifiers.into_glib(), )) } } #[doc(alias = "gtk_test_widget_send_key")] pub fn test_widget_send_key<P: IsA<Widget>>( widget: &P, keyval: u32, modifiers: gdk::ModifierType, ) -> bool { skip_assert_initialized!(); unsafe { from_glib(ffi::gtk_test_widget_send_key( widget.as_ref().to_glib_none().0, keyval, modifiers.into_glib(), )) } } #[doc(alias = "gtk_test_widget_wait_for_draw")] pub fn test_widget_wait_for_draw<P: IsA<Widget>>(widget: &P) { skip_assert_initialized!(); unsafe { ffi::gtk_test_widget_wait_for_draw(widget.as_ref().to_glib_none().0); } } #[doc(alias = "gtk_tree_get_row_drag_data")] pub fn tree_get_row_drag_data( selection_data: &SelectionData, ) -> Option<(Option<TreeModel>, Option<TreePath>)> { assert_initialized_main_thread!(); unsafe { let mut tree_model = ptr::null_mut(); let mut path = ptr::null_mut(); let ret = from_glib(ffi::gtk_tree_get_row_drag_data( mut_override(selection_data.to_glib_none().0), &mut tree_model, &mut path, )); if ret { Some((from_glib_none(tree_model), from_glib_full(path))) } else { None } } } #[doc(alias = "gtk_tree_set_row_drag_data")] pub fn tree_set_row_drag_data<P: IsA<TreeModel>>( selection_data: &SelectionData, tree_model: &P, path: &mut TreePath, ) -> bool { skip_assert_initialized!(); unsafe { from_glib(ffi::gtk_tree_set_row_drag_data( mut_override(selection_data.to_glib_none().0), tree_model.as_ref().to_glib_none().0, path.to_glib_none_mut().0, )) } } #[doc(alias = "gtk_true")] #[doc(alias = "true")] pub fn true_() -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::gtk_true()) } }
{ assert_initialized_main_thread!(); let n_targets = targets.len() as i32; unsafe { from_glib(ffi::gtk_targets_include_image( targets.to_glib_none().0, n_targets, writable.into_glib(), )) } }
chain_store.go
package file import ( "encoding/json" "io/ioutil" "os" "github.com/xzor-dev/xzor/internal/xzor/block" ) var _ block.ChainStore = &ChainStore{} // ChainStore provides reading and writing of chains to the file system. type ChainStore struct { RootDir string } func (s *ChainStore) filename(hash block.ChainHash) string { return s.RootDir + "/" + string(hash) } // Delete removes the chain's data file. func (s *ChainStore) Delete(hash block.ChainHash) error { return os.Remove(s.filename(hash)) } // Read chain's data using its hash. func (s *ChainStore) Read(hash block.ChainHash) (*block.Chain, error) { filename := s.filename(hash) data, err := ioutil.ReadFile(filename) if err != nil { return nil, err } c := &block.Chain{} err = json.Unmarshal(data, c) if err != nil { return nil, err } return c, nil }
err := os.MkdirAll(s.RootDir, 0666) if err != nil { return err } filename := s.filename(c.Hash) f, err := os.Create(filename) if err != nil { return err } defer f.Close() data, err := json.Marshal(c) if err != nil { return err } _, err = f.Write(data) if err != nil { return err } return nil }
// Write a chain to the file system. func (s *ChainStore) Write(c *block.Chain) error {
etcd.go
// Package etcd provides an etcd service registry package etcd import ( "context" "crypto/tls" "net" "path" "sort" "strings" "sync" "time" "github.com/Allenxuxu/stark/log" "github.com/Allenxuxu/stark/registry" json "github.com/json-iterator/go" hash "github.com/mitchellh/hashstructure" "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" ) var ( DefaultAddr = "127.0.0.1:2379" DefaultTimeout = 5 * time.Second defaultPrefix = "/stark/registry/" ) type etcdRegistry struct { client *clientv3.Client options registry.Options prefix string sync.RWMutex register map[string]uint64 leases map[string]clientv3.LeaseID } func NewRegistry(opts ...registry.Option) (registry.Registry, error) { e := &etcdRegistry{ options: registry.Options{}, prefix: defaultPrefix, register: make(map[string]uint64), leases: make(map[string]clientv3.LeaseID), } if err := e.configure(opts...); err != nil { return nil, err } return e, nil } func (e *etcdRegistry) configure(opts ...registry.Option) error { config := clientv3.Config{ Endpoints: []string{DefaultAddr}, } for _, o := range opts { o(&e.options) } if e.options.Timeout == 0 { e.options.Timeout = DefaultTimeout } if e.options.Secure || e.options.TLSConfig != nil { tlsConfig := e.options.TLSConfig if tlsConfig == nil { tlsConfig = &tls.Config{ InsecureSkipVerify: true, } } config.TLS = tlsConfig } if e.options.Context != nil { u, ok := e.options.Context.Value(authKey{}).(*authCreds) if ok { config.Username = u.Username config.Password = u.Password } p, ok := e.options.Context.Value(prefixKey{}).(string) if ok { e.prefix = p } } var cAddrs []string for _, address := range e.options.Addrs { if len(address) == 0 { continue } addr, port, err := net.SplitHostPort(address) if ae, ok := err.(*net.AddrError); ok && ae.Err == "missing port in address" { port = "2379" addr = address cAddrs = append(cAddrs, net.JoinHostPort(addr, port)) } else if err == nil { cAddrs = append(cAddrs, net.JoinHostPort(addr, port)) }
// if we got addrs then we'll update if len(cAddrs) > 0 { config.Endpoints = cAddrs } cli, err := clientv3.New(config) if err != nil { return err } e.client = cli return nil } func (e *etcdRegistry) Options() registry.Options { return e.options } func (e *etcdRegistry) registerNode(s *registry.Service, node *registry.Node, opts ...registry.RegisterOption) error { if len(s.Nodes) == 0 { return registry.ErrNoNode } // check existing lease cache e.RLock() leaseID, ok := e.leases[s.Name+node.Id] e.RUnlock() if !ok { // missing lease, check if the key exists ctx, cancel := context.WithTimeout(context.Background(), e.options.Timeout) defer cancel() // look for the existing key rsp, err := e.client.Get(ctx, nodePath(e.prefix, s.Name, node.Id), clientv3.WithSerializable()) if err != nil { return err } // get the existing lease for _, kv := range rsp.Kvs { if kv.Lease > 0 { leaseID = clientv3.LeaseID(kv.Lease) // decode the existing node srv := decode(kv.Value) if srv == nil || len(srv.Nodes) == 0 { continue } // create hash of service; uint64 h, err := hash.Hash(srv.Nodes[0], nil) if err != nil { continue } // save the info e.Lock() e.leases[s.Name+node.Id] = leaseID e.register[s.Name+node.Id] = h e.Unlock() break } } } var leaseNotFound bool // renew the lease if it exists if leaseID > 0 { log.Tracef("Renewing existing lease for %s %d", s.Name, leaseID) if _, err := e.client.KeepAliveOnce(context.TODO(), leaseID); err != nil { if err != rpctypes.ErrLeaseNotFound { return err } log.Tracef("Lease not found for %s %d", s.Name, leaseID) // lease not found do register leaseNotFound = true } } // create hash of service; uint64 h, err := hash.Hash(node, nil) if err != nil { return err } // get existing hash for the service node e.Lock() v, ok := e.register[s.Name+node.Id] e.Unlock() // the service is unchanged, skip registering if ok && v == h && !leaseNotFound { log.Tracef("Service %s node %s unchanged skipping registration", s.Name, node.Id) return nil } service := &registry.Service{ Name: s.Name, Version: s.Version, Endpoints: s.Endpoints, Nodes: []*registry.Node{node}, } var options registry.RegisterOptions for _, o := range opts { o(&options) } ctx, cancel := context.WithTimeout(context.Background(), e.options.Timeout) defer cancel() var lgr *clientv3.LeaseGrantResponse if options.TTL.Seconds() > 0 { // get a lease used to expire keys since we have a ttl lgr, err = e.client.Grant(ctx, int64(options.TTL.Seconds())) if err != nil { return err } } log.Tracef("Registering %s id %s with lease %v and ttl %v", service.Name, node.Id, lgr, options.TTL) // create an entry for the node if lgr != nil { _, err = e.client.Put(ctx, nodePath(e.prefix, service.Name, node.Id), encode(service), clientv3.WithLease(lgr.ID)) } else { _, err = e.client.Put(ctx, nodePath(e.prefix, service.Name, node.Id), encode(service)) } if err != nil { return err } e.Lock() // save our hash of the service e.register[s.Name+node.Id] = h // save our leaseID of the service if lgr != nil { e.leases[s.Name+node.Id] = lgr.ID } e.Unlock() return nil } func (e *etcdRegistry) Deregister(s *registry.Service) error { if len(s.Nodes) == 0 { return registry.ErrNoNode } for _, node := range s.Nodes { e.Lock() // delete our hash of the service delete(e.register, s.Name+node.Id) // delete our lease of the service delete(e.leases, s.Name+node.Id) e.Unlock() ctx, cancel := context.WithTimeout(context.Background(), e.options.Timeout) defer cancel() log.Tracef("Registering %s id %s", s.Name, node.Id) _, err := e.client.Delete(ctx, nodePath(e.prefix, s.Name, node.Id)) if err != nil { return err } } return nil } func (e *etcdRegistry) Register(s *registry.Service, opts ...registry.RegisterOption) error { if len(s.Nodes) == 0 { return registry.ErrNoNode } var gerr error // register each node individually for _, node := range s.Nodes { err := e.registerNode(s, node, opts...) if err != nil { gerr = err } } return gerr } func (e *etcdRegistry) GetService(name string) ([]*registry.Service, error) { ctx, cancel := context.WithTimeout(context.Background(), e.options.Timeout) defer cancel() rsp, err := e.client.Get(ctx, servicePath(e.prefix, name)+"/", clientv3.WithPrefix(), clientv3.WithSerializable()) if err != nil { return nil, err } if len(rsp.Kvs) == 0 { return nil, registry.ErrNotFound } serviceMap := map[string]*registry.Service{} for _, n := range rsp.Kvs { if sn := decode(n.Value); sn != nil { s, ok := serviceMap[sn.Version] if !ok { s = &registry.Service{ Name: sn.Name, Version: sn.Version, Endpoints: sn.Endpoints, } serviceMap[s.Version] = s } s.Nodes = append(s.Nodes, sn.Nodes...) } } services := make([]*registry.Service, 0, len(serviceMap)) for _, service := range serviceMap { services = append(services, service) } return services, nil } func (e *etcdRegistry) ListServices() ([]*registry.Service, error) { versions := make(map[string]*registry.Service) ctx, cancel := context.WithTimeout(context.Background(), e.options.Timeout) defer cancel() rsp, err := e.client.Get(ctx, e.prefix, clientv3.WithPrefix(), clientv3.WithSerializable()) if err != nil { return nil, err } if len(rsp.Kvs) == 0 { return []*registry.Service{}, nil } for _, n := range rsp.Kvs { sn := decode(n.Value) if sn == nil { continue } v, ok := versions[sn.Name+sn.Version] if !ok { versions[sn.Name+sn.Version] = sn continue } // append to service:version nodes v.Nodes = append(v.Nodes, sn.Nodes...) } services := make([]*registry.Service, 0, len(versions)) for _, service := range versions { services = append(services, service) } // sort the services sort.Slice(services, func(i, j int) bool { return services[i].Name < services[j].Name }) return services, nil } func (e *etcdRegistry) Watch(opts ...registry.WatchOption) (registry.Watcher, error) { return newEtcdWatcher(e, e.options.Timeout, opts...) } func (e *etcdRegistry) String() string { return "etcd" } func encode(s *registry.Service) string { b, _ := json.Marshal(s) return string(b) } func decode(ds []byte) *registry.Service { var s *registry.Service _ = json.Unmarshal(ds, &s) return s } func nodePath(prefix, s, id string) string { service := strings.Replace(s, "/", "-", -1) node := strings.Replace(id, "/", "-", -1) return path.Join(prefix, service, node) } func servicePath(prefix, s string) string { return path.Join(prefix, strings.Replace(s, "/", "-", -1)) }
}
index.ts
import { CompletionFunc } from '@pnpm/command' import { types as allTypes } from '@pnpm/config' import { audit } from '@pnpm/plugin-commands-audit' import { importCommand } from '@pnpm/plugin-commands-import' import { add, fetch, install, link, prune, remove, unlink, update } from '@pnpm/plugin-commands-installation' import { list, ll, why } from '@pnpm/plugin-commands-listing' import { outdated } from '@pnpm/plugin-commands-outdated' import { pack, publish } from '@pnpm/plugin-commands-publishing' import { rebuild } from '@pnpm/plugin-commands-rebuild' import { exec, restart, run, test, } from '@pnpm/plugin-commands-script-runners' import { server } from '@pnpm/plugin-commands-server' import { setup } from '@pnpm/plugin-commands-setup' import { store } from '@pnpm/plugin-commands-store' import pick from 'ramda/src/pick' import { PnpmOptions } from '../types' import * as bin from './bin' import createCompletion from './completion' import createHelp from './help' import * as installTest from './installTest' import * as recursive from './recursive' import * as root from './root' export const GLOBAL_OPTIONS = pick([ 'color', 'dir', 'filter', 'filter-prod', 'loglevel', 'help', 'parseable', 'prefix', 'reporter', 'stream', 'test-pattern', 'use-stderr', 'workspace-packages', 'workspace-root', ], allTypes) export type CommandResponse = string | { output: string, exitCode: number } | undefined export type Command = ( opts: PnpmOptions, params: string[] ) => CommandResponse | Promise<CommandResponse> const commands: Array<{ cliOptionsTypes: () => Object commandNames: string[] completion?: CompletionFunc handler: Function help: () => string rcOptionsTypes: () => Record<string, unknown> shorthands?: Record<string, string | string[]> }> = [ add, audit, bin, exec, fetch, importCommand, install, installTest, link, list, ll, outdated, pack, prune, publish, rebuild, recursive, remove, restart, root, run, server, setup, store, test, unlink, update, why, ] const handlerByCommandName: Record<string, Command> = {} const helpByCommandName: Record<string, () => string> = {} const cliOptionsTypesByCommandName: Record<string, () => Object> = {} const aliasToFullName: Map<string, string> = new Map() const completionByCommandName: Record<string, CompletionFunc> = {} const shorthandsByCommandName: Record<string, Record<string, string | string[]>> = {} const rcOptionsTypes: Record<string, unknown> = {} for (let i = 0; i < commands.length; i++) { const { cliOptionsTypes, commandNames, completion, handler, help, rcOptionsTypes, shorthands, } = commands[i] if (!commandNames || commandNames.length === 0) { throw new Error(`The command at index ${i} doesn't have command names`) } for (const commandName of commandNames) { handlerByCommandName[commandName] = handler as Command helpByCommandName[commandName] = help cliOptionsTypesByCommandName[commandName] = cliOptionsTypes shorthandsByCommandName[commandName] = shorthands ?? {} if (completion != null) { completionByCommandName[commandName] = completion }
} if (commandNames.length > 1) { const fullName = commandNames[0] for (let i = 1; i < commandNames.length; i++) { aliasToFullName.set(commandNames[i], fullName) } } } handlerByCommandName.help = createHelp(helpByCommandName) handlerByCommandName.completion = createCompletion({ cliOptionsTypesByCommandName, completionByCommandName, initialCompletion, shorthandsByCommandName, universalOptionsTypes: GLOBAL_OPTIONS, }) function initialCompletion () { return Object.keys(handlerByCommandName).map((name) => ({ name })) } export default handlerByCommandName export function getCliOptionsTypes (commandName: string) { return cliOptionsTypesByCommandName[commandName]?.() || {} } export function getCommandFullName (commandName: string) { return aliasToFullName.get(commandName) ?? (handlerByCommandName[commandName] ? commandName : null) } export { shorthandsByCommandName, rcOptionsTypes }
Object.assign(rcOptionsTypes, rcOptionsTypes())
consensusMessage.go
package dbft import ( "bytes" "errors" "github.com/Ontology/common/log" ser "github.com/Ontology/common/serialization" "io" ) type ConsensusMessage interface { ser.SerializableData Type() ConsensusMessageType ViewNumber() byte ConsensusMessageData() *ConsensusMessageData } type ConsensusMessageData struct { Type ConsensusMessageType ViewNumber byte } func
(data []byte) (ConsensusMessage, error) { log.Debug() msgType := ConsensusMessageType(data[0]) r := bytes.NewReader(data) switch msgType { case PrepareRequestMsg: prMsg := &PrepareRequest{} err := prMsg.Deserialize(r) if err != nil { log.Error("[DeserializeMessage] PrepareRequestMsg Deserialize Error: ", err.Error()) return nil, err } return prMsg, nil case PrepareResponseMsg: presMsg := &PrepareResponse{} err := presMsg.Deserialize(r) if err != nil { log.Error("[DeserializeMessage] PrepareResponseMsg Deserialize Error: ", err.Error()) return nil, err } return presMsg, nil case ChangeViewMsg: cv := &ChangeView{} err := cv.Deserialize(r) if err != nil { log.Error("[DeserializeMessage] ChangeViewMsg Deserialize Error: ", err.Error()) return nil, err } return cv, nil case BlockSignaturesMsg: blockSigs := &BlockSignatures{} err := blockSigs.Deserialize(r) if err != nil { log.Error("[DeserializeMessage] BlockSignaturesMsg Deserialize Error: ", err.Error()) return nil, err } return blockSigs, nil } return nil, errors.New("The message is invalid.") } func (cd *ConsensusMessageData) Serialize(w io.Writer) { log.Debug() //ConsensusMessageType w.Write([]byte{byte(cd.Type)}) //ViewNumber w.Write([]byte{byte(cd.ViewNumber)}) } //read data to reader func (cd *ConsensusMessageData) Deserialize(r io.Reader) error { log.Debug() //ConsensusMessageType var msgType [1]byte _, err := io.ReadFull(r, msgType[:]) if err != nil { return err } cd.Type = ConsensusMessageType(msgType[0]) //ViewNumber var vNumber [1]byte _, err = io.ReadFull(r, vNumber[:]) if err != nil { return err } cd.ViewNumber = vNumber[0] return nil }
DeserializeMessage
main.rs
#![allow(dead_code)] // TODO: finish this use processing::errors::ProcessingErr; use processing::Screen; #[derive(Debug)] struct CA { cells: Vec<i8>, ruleset: [i8; 8], cell_size: f64, generation: u32, } impl CA { fn new(screen: &Screen) -> Self { let len = screen.width() as usize; let mut cells = vec![0; len]; cells[len / 2] = 1; let ruleset = [0, 1, 0, 1, 1, 0, 1, 0]; Self { cells, ruleset, cell_size: 10.0, generation: 0, } } fn generate(&mut self) { let mut next_gen = Vec::with_capacity(self.cells.len()); for (i, next) in next_gen .iter_mut() .enumerate() .take(self.cells.len() - 1) .skip(1) { let left = self.cells[i - 1]; let me = self.cells[i]; let right = self.cells[i + 1]; *next = self.rules(left, me, right); } self.cells = next_gen; self.generation += 1; } fn rules(&self, a: i8, b: i8, c: i8) -> i8 { let s = format!("{}{}{}", a, b, c); let index = s.parse::<usize>().unwrap(); self.ruleset[index] } fn draw(&self, screen: &mut Screen) -> Result<(), ProcessingErr> { for i in 0..self.cells.len() { if self.cells[i] == 1 { core::fill_grayscale(screen, 0.0); } else { core::fill_grayscale(screen, 255.0); } core::shapes::rect( screen, i as f64 * self.cell_size, self.generation as f64 * self.cell_size, self.cell_size, self.cell_size, )?; } Ok(()) } } fn setup<'a>() -> Result<Screen<'a>, ProcessingErr> { core::create_canvas(640, 360) } fn draw(screen: &mut Screen, _dt: f64) -> Result<(), ProcessingErr> { core::background_grayscale(screen, 255.0); Ok(()) } fn
() -> Result<(), ProcessingErr> { core::run(setup, draw)?; Ok(()) }
main
b1_q10_quadrado.py
import math lado = eval(input("Informe o lado do quadrado em cm: ")) area = math.pow(lado,2) perim = lado*4 print('A área do quadrado é igual a: ', area, 'cm')
print('O perímetro do quadro é igual a: ', perim, 'cm')
version.go
package mp4 import ( "fmt" "strconv" "time" ) var ( commitVersion string = "v0.21.1" // Updated when building using Makefile commitDate string // commitDate in Epoch seconds (inserted from Makefile) ) // GetVersion - get version and also commitHash and commitDate if inserted via Makefile func GetVersion() string { seconds, _ := strconv.Atoi(commitDate) if commitDate != ""
return commitVersion }
{ t := time.Unix(int64(seconds), 0) return fmt.Sprintf("%s, date: %s", commitVersion, t.Format("2006-01-02")) }
CreateApplicationVersionCommand.ts
import { ServerlessApplicationRepositoryClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes, } from "../ServerlessApplicationRepositoryClient"; import { CreateApplicationVersionRequest, CreateApplicationVersionResponse } from "../models/models_0"; import { deserializeAws_restJson1CreateApplicationVersionCommand, serializeAws_restJson1CreateApplicationVersionCommand, } from "../protocols/Aws_restJson1"; import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; import { Command as $Command } from "@aws-sdk/smithy-client"; import { FinalizeHandlerArguments, Handler, HandlerExecutionContext, MiddlewareStack, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, SerdeContext as __SerdeContext, } from "@aws-sdk/types"; export type CreateApplicationVersionCommandInput = CreateApplicationVersionRequest; export type CreateApplicationVersionCommandOutput = CreateApplicationVersionResponse & __MetadataBearer; /** * <p>Creates an application version.</p> */ export class
extends $Command< CreateApplicationVersionCommandInput, CreateApplicationVersionCommandOutput, ServerlessApplicationRepositoryClientResolvedConfig > { // Start section: command_properties // End section: command_properties constructor(readonly input: CreateApplicationVersionCommandInput) { // Start section: command_constructor super(); // End section: command_constructor } /** * @internal */ resolveMiddleware( clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: ServerlessApplicationRepositoryClientResolvedConfig, options?: __HttpHandlerOptions ): Handler<CreateApplicationVersionCommandInput, CreateApplicationVersionCommandOutput> { this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); const stack = clientStack.concat(this.middlewareStack); const { logger } = configuration; const clientName = "ServerlessApplicationRepositoryClient"; const commandName = "CreateApplicationVersionCommand"; const handlerExecutionContext: HandlerExecutionContext = { logger, clientName, commandName, inputFilterSensitiveLog: CreateApplicationVersionRequest.filterSensitiveLog, outputFilterSensitiveLog: CreateApplicationVersionResponse.filterSensitiveLog, }; const { requestHandler } = configuration; return stack.resolve( (request: FinalizeHandlerArguments<any>) => requestHandler.handle(request.request as __HttpRequest, options || {}), handlerExecutionContext ); } private serialize(input: CreateApplicationVersionCommandInput, context: __SerdeContext): Promise<__HttpRequest> { return serializeAws_restJson1CreateApplicationVersionCommand(input, context); } private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateApplicationVersionCommandOutput> { return deserializeAws_restJson1CreateApplicationVersionCommand(output, context); } // Start section: command_body_extra // End section: command_body_extra }
CreateApplicationVersionCommand
persona_propietario-filter.pipe.ts
import * as _ from 'lodash'; import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'persona_propietarioDataFilter' }) export class
implements PipeTransform { transform(array: any[], query: string): any { if (query) { return _.filter(array, row => row.persona_propietario.indexOf(query) > -1); } return array; } }
Persona_propietarioFilterPipe
lib.rs
//! Import and export library for Visualization Toolkit (VTK) //! [files](https://lorensen.github.io/VTKExamples/site/VTKFileFormats/). //! //! Legacy `.vtk` files as well as modern XML formats are supported. //! Both "serial" and "parallel" XML files are supported with facilities for lazily loading. //! //! The [`Vtk`] struct exposes the primary IO API. //! //! # Examples //! //! Many sample files can be found in the `assets` directory. //! //! For the following example, we will load a VTK file named `tet.vtk`, modify it and write it back //! in Legacy ASCII format. //! //! ```no_run //! use vtkio::model::*; // import model definition of a VTK file //! fn main() { //! use std::path::PathBuf; //! let file_path = PathBuf::from("../assets/tet.vtk"); //! //! let mut vtk_file = Vtk::import(&file_path) //! .expect(&format!("Failed to load file: {:?}", file_path)); //! //! vtk_file.version = Version::new((4,2)); // arbitrary change //! //! vtk_file.export_ascii(&file_path) //! .expect(&format!("Failed to save file: {:?}", file_path)); //! } //! ``` //! //! Files are sometimes provided as strings or byte slices, so it is also useful to be able to //! parse VTK files and write them back to a string or byte slice. //! //! ```no_run //! use vtkio::model::*; // import model definition of a VTK file //! fn main() { //! let data: &[u8] = include_str!("../assets/tet.vtk").as_bytes(); // Or just include_bytes! //! //! let mut vtk_file = Vtk::parse_legacy_be(data).expect(&format!("Failed to parse file")); //! //! vtk_file.version = Version::new((4,2)); // arbitrary change //! //! let mut output = String::new(); //! Vtk::write_legacy_ascii(vtk_file, &mut output).expect(&format!("Failed to write file")); //! //! println!("{}", output); //! } //! ``` #[macro_use] extern crate nom; #[macro_use] pub mod basic; #[macro_use] pub mod model; pub mod parser; pub mod writer; #[cfg(feature = "xml")] pub mod xml; #[cfg(feature = "xml")] use std::convert::{TryFrom, TryInto}; use std::fs::File; #[cfg(feature = "xml")] use std::io::BufRead; use std::io::{self, BufWriter, Read, Write}; use std::path::Path; use crate::writer::{AsciiWriter, BinaryWriter, WriteVtk}; pub use model::IOBuffer; /// The primary `vtkio` API is provided through the `Vtk` struct. pub use model::Vtk; /// Error type for Import/Export operations. #[derive(Debug)] pub enum Error { IO(io::Error), Write(writer::Error), Parse(nom::ErrorKind<u32>), #[cfg(feature = "xml")] XML(xml::Error), UnknownFileExtension(Option<String>), Load(model::Error), Unknown, } impl std::fmt::Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Error::IO(source) => write!(f, "IO error: {}", source), Error::Write(source) => write!(f, "Write error: {}", source), Error::Parse(source) => write!(f, "Parse error: {:?}", source), #[cfg(feature = "xml")] Error::XML(source) => write!(f, "XML error: {}", source), Error::UnknownFileExtension(Some(ext)) => { write!(f, "Unknown file extension: {:?}", ext) } Error::UnknownFileExtension(None) => write!(f, "Missing file extension"), Error::Load(source) => write!(f, "Load error: {}", source), Error::Unknown => write!(f, "Unknown error"), } } } impl std::error::Error for Error { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match self { Error::IO(source) => Some(source), Error::Write(source) => Some(source), Error::Parse(_) => None, #[cfg(feature = "xml")] Error::XML(source) => Some(source), Error::UnknownFileExtension(_) => None, Error::Load(source) => Some(source), Error::Unknown => None, } } } /// Convert `std::io` error into `vtkio` error. impl From<io::Error> for Error { fn from(e: io::Error) -> Error { Error::IO(e) } } /// Convert [`xml::Error`] error into the top level `vtkio` error. /// /// [`xml::Error`]: xml.enum.Error.html #[cfg(feature = "xml")] impl From<xml::Error> for Error { fn from(e: xml::Error) -> Error { Error::XML(e) } } /// Convert `vtkio` error into `std::io` error. impl From<Error> for io::Error { fn from(err: Error) -> io::Error { match err { Error::IO(e) => e, _ => io::Error::new(io::ErrorKind::Other, format!("{:?}", err)), } } } impl From<writer::Error> for Error { fn from(e: writer::Error) -> Error { Error::Write(e) } } impl Vtk { /// Helper for parsing legacy VTK files. fn parse_vtk<F>(mut reader: impl Read, parse: F, buf: &mut Vec<u8>) -> Result<Vtk, Error> where F: Fn(&[u8]) -> nom::IResult<&[u8], Vtk>, { use nom::IResult; reader.read_to_end(buf)?; match parse(buf) { IResult::Done(_, vtk) => Ok(vtk), IResult::Error(e) => Err(Error::Parse(e.into_error_kind())), IResult::Incomplete(_) => Err(Error::Unknown), } } /// Helper for importing legacy VTK files from the given path. fn import_vtk<F>(file_path: &Path, parse: F) -> Result<Vtk, Error> where F: Fn(&[u8]) -> nom::IResult<&[u8], Vtk>, { let file = File::open(file_path)?; Vtk::parse_vtk(file, parse, &mut Vec::new()) } /// Parse a legacy VTK file from the given reader. /// /// If the file is in binary format, numeric types will be interpreted in big endian format, /// which is the most common among VTK files. /// Note that this function and [`parse_legacy_le`](Vtk::parse_legacy_le) also work equally well for /// parsing VTK files in ASCII format. /// /// # Examples /// /// Parsing an ASCII file: /// /// ``` /// use vtkio::model::*; // import the model definition of a VTK file /// let vtk_ascii: &[u8] = b" /// ## vtk DataFile Version 2.0 /// Triangle example /// ASCII /// DATASET POLYDATA /// POINTS 3 float /// 0.0 0.0 0.0 /// 1.0 0.0 0.0 /// 0.0 0.0 -1.0 /// /// POLYGONS 1 4 /// 3 0 1 2 /// "; /// /// let vtk = Vtk::parse_legacy_be(vtk_ascii).expect("Failed to parse vtk file"); /// /// assert_eq!(vtk, Vtk { /// version: Version::new((2,0)), /// byte_order: ByteOrder::BigEndian, /// title: String::from("Triangle example"), /// file_path: None, /// data: DataSet::inline(PolyDataPiece { /// points: vec![0.0f32, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0].into(), /// polys: Some(VertexNumbers::Legacy { /// num_cells: 1, /// vertices: vec![3, 0, 1, 2] /// }), /// data: Attributes::new(), /// ..Default::default() /// }) /// }); /// ``` pub fn parse_legacy_be(reader: impl Read) -> Result<Vtk, Error> { Vtk::parse_vtk(reader, parser::parse_be, &mut Vec::new()) } /// Parse a legacy VTK file from the given reader. /// /// If the file is in binary format, numeric types will be interpreted in little endian format. /// Note that this function and [`parse_legacy_be`](Vtk::parse_legacy_be) also work equally well for /// parsing VTK files in ASCII format. /// /// # Examples /// /// Parsing an ASCII file: /// /// ``` /// use vtkio::model::*; // import the model definition of a VTK file /// let vtk_ascii: &[u8] = b" /// ## vtk DataFile Version 2.0 /// Triangle example /// ASCII /// DATASET POLYDATA /// POINTS 3 float /// 0.0 0.0 0.0 /// 1.0 0.0 0.0 /// 0.0 0.0 -1.0 /// /// POLYGONS 1 4 /// 3 0 1 2 /// "; /// /// let vtk = Vtk::parse_legacy_le(vtk_ascii).expect("Failed to parse vtk file"); /// /// assert_eq!(vtk, Vtk { /// version: Version::new((2,0)), /// byte_order: ByteOrder::LittleEndian, /// title: String::from("Triangle example"), /// file_path: None, /// data: DataSet::inline(PolyDataPiece { /// points: vec![0.0f32, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0].into(), /// polys: Some(VertexNumbers::Legacy { /// num_cells: 1, /// vertices: vec![3, 0, 1, 2] /// }), /// data: Attributes::new(), /// ..Default::default() /// }) /// }); /// ``` pub fn parse_legacy_le(reader: impl Read) -> Result<Vtk, Error> { Vtk::parse_vtk(reader, parser::parse_le, &mut Vec::new()) } /// Parse a legacy VTK file in big endian format from the given reader and a buffer. /// /// This is the buffered version of [`Vtk::parse_legacy_be`](Vtk::parse_legacy_be), which allows one to reuse the same /// heap allocated space when reading many files. pub fn parse_legacy_buf_be(reader: impl Read, buf: &mut Vec<u8>) -> Result<Vtk, Error> { Vtk::parse_vtk(reader, parser::parse_be, buf) } /// Parse a legacy VTK file in little endian format from the given reader and a buffer.
pub fn parse_legacy_buf_le(reader: impl Read, buf: &mut Vec<u8>) -> Result<Vtk, Error> { Vtk::parse_vtk(reader, parser::parse_le, buf) } /// Parse a modern XML style VTK file from a given reader. /// /// # Examples /// /// Parsing a binary file in big endian format representing a polygon mesh consisting of a single /// triangle: /// /// ``` /// use vtkio::model::*; // import the model definition of a VTK file /// /// let input: &[u8] = b"\ /// <VTKFile type=\"PolyData\" version=\"2.0\" byte_order=\"BigEndian\">\ /// <PolyData>\ /// <Piece NumberOfPoints=\"3\" NumberOfLines=\"0\" NumberOfStrips=\"0\" NumberOfPolys=\"1\" NumberOfVerts=\"0\">\ /// <PointData/>\ /// <CellData/>\ /// <Points>\ /// <DataArray type=\"Float32\" format=\"binary\" NumberOfComponents=\"3\">\ /// AAAAAAAAAAQAAAAAAAAAAAAAAAA/gAAAAAAAAAAAAAAAAAAAAAAAAL+AAAA=\ /// </DataArray>\ /// </Points>\ /// <Polys>\ /// <DataArray type=\"UInt64\" Name=\"connectivity\" format=\"binary\" NumberOfComponents=\"1\">\ /// AAAAAAAAAAgAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAI=\ /// </DataArray>\ /// <DataArray type=\"UInt64\" Name=\"offsets\" format=\"binary\" NumberOfComponents=\"1\">\ /// AAAAAAAAAAgAAAAAAAAAAw==\ /// </DataArray>\ /// </Polys>\ /// </Piece>\ /// </PolyData>\ /// </VTKFile>"; /// /// let vtk = Vtk::parse_xml(input).expect("Failed to parse XML VTK file"); /// /// assert_eq!(vtk, Vtk { /// version: Version::new((2,0)), /// byte_order: ByteOrder::BigEndian, // This is default /// title: String::new(), /// file_path: None, /// data: DataSet::inline(PolyDataPiece { /// points: vec![0.0f32, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0].into(), /// polys: Some(VertexNumbers::XML { /// connectivity: vec![0, 1, 2], /// offsets: vec![3] /// }), /// data: Attributes::new(), /// ..Default::default() /// }) /// }); /// ``` #[cfg(feature = "xml")] pub fn parse_xml(reader: impl BufRead) -> Result<Vtk, Error> { // There is no extension to check with the data is provided directly. // Luckily the xml file contains all the data necessary to determine which data is // being parsed. let vtk_file = xml::parse(reader)?; Ok(vtk_file.try_into()?) } #[cfg(feature = "async_blocked")] async fn import_vtk_async<F>(file_path: &Path, parse: F) -> Result<Vtk, Error> where F: Fn(&[u8]) -> nom::IResult<&[u8], Vtk>, { use nom::IResult; use tokio::fs::File; use tokio::io::AsyncReadExt; let mut file = File::open(file_path).await?; let mut buf = Vec::new(); file.read_to_end(&mut buf).await?; match parse(&buf) { IResult::Done(_, vtk) => Ok(vtk), IResult::Error(e) => Err(Error::Parse(e.into_error_kind())), IResult::Incomplete(_) => Err(Error::Unknown), } } /// Import a VTK file at the specified path. /// /// This function determines the vtk file type from the extension as prescribed by the [VTK /// file formats documentation](https://lorensen.github.io/VTKExamples/site/VTKFileFormats/): /// /// - Legacy (`.vtk`) -- Simple legacy file format (Non-XML) /// - Image data (`.vti`) -- Serial vtkImageData (structured) /// - PolyData (`.vtp`) -- Serial vtkPolyData (unstructured) /// - RectilinearGrid (`.vtr`) -- Serial vtkRectilinearGrid (structured) /// - StructuredGrid (`.vts`) -- Serial vtkStructuredGrid (structured) /// - UnstructuredGrid (`.vtu`) -- Serial vtkUnstructuredGrid (unstructured) /// - PImageData (`.pvti`) -- Parallel vtkImageData (structured) /// - PPolyData (`.pvtp`) -- Parallel vtkPolyData (unstructured) /// - PRectilinearGrid (`.pvtr`) -- Parallel vtkRectilinearGrid (structured) /// - PStructuredGrid (`.pvts`) -- Parallel vtkStructuredGrid (structured) /// - PUnstructuredGrid (`.pvtu`) -- Parallel vtkUnstructuredGrid (unstructured) /// /// # Examples /// /// The following example imports a legacy `.vtk` file called `tet.vtk`, and panics with an /// appropriate error message if the file fails to load. /// /// ```should_panic /// use vtkio::Vtk; /// use std::path::PathBuf; /// /// let file_path = PathBuf::from("tet.vtk"); /// /// let mut vtk_file = Vtk::import(&file_path) /// .expect(&format!("Failed to load file: {:?}", file_path)); /// ``` pub fn import(file_path: impl AsRef<Path>) -> Result<Vtk, Error> { Vtk::import_impl(file_path.as_ref()) } /// A non-generic helper for the `import` function. fn import_impl(path: &Path) -> Result<Vtk, Error> { let ext = path .extension() .and_then(|s| s.to_str()) .ok_or(Error::UnknownFileExtension(None))?; match ext { "vtk" => Vtk::import_vtk(path, parser::parse_be), #[cfg(feature = "xml")] ext => { let ft = xml::FileType::try_from_ext(ext) .ok_or(Error::UnknownFileExtension(Some(ext.to_string())))?; let vtk_file = xml::import(path)?; let exp_ft = xml::FileType::from(vtk_file.data_set_type); if ft != exp_ft { Err(Error::XML(xml::Error::TypeExtensionMismatch)) } else { let mut vtk: Vtk = vtk_file.try_into()?; vtk.file_path = Some(path.into()); Ok(vtk) } } #[cfg(not(feature = "xml"))] _ => Err(Error::UnknownFileExtension(None)), } } /// Import a VTK file at the specified path. /// /// This is the async version of [`import`](Vtk::import). /// /// This function determines the vtk file type from the extension as prescribed by the [VTK /// file formats documentation](https://lorensen.github.io/VTKExamples/site/VTKFileFormats/): /// /// - Legacy (`.vtk`) -- Simple legacy file format (Non-XML) /// - Image data (`.vti`) -- Serial vtkImageData (structured) /// - PolyData (`.vtp`) -- Serial vtkPolyData (unstructured) /// - RectilinearGrid (`.vtr`) -- Serial vtkRectilinearGrid (structured) /// - StructuredGrid (`.vts`) -- Serial vtkStructuredGrid (structured) /// - UnstructuredGrid (`.vtu`) -- Serial vtkUnstructuredGrid (unstructured) /// - PImageData (`.pvti`) -- Parallel vtkImageData (structured) /// - PPolyData (`.pvtp`) -- Parallel vtkPolyData (unstructured) /// - PRectilinearGrid (`.pvtr`) -- Parallel vtkRectilinearGrid (structured) /// - PStructuredGrid (`.pvts`) -- Parallel vtkStructuredGrid (structured) /// - PUnstructuredGrid (`.pvtu`) -- Parallel vtkUnstructuredGrid (unstructured) /// /// # Examples /// /// The following example imports a legacy `.vtk` file called `tet.vtk`, and panics with an /// appropriate error message if the file fails to load. /// /// ```should_panic /// use vtkio::Vtk; /// use std::path::PathBuf; /// /// let file_path = PathBuf::from("tet.vtk"); /// /// let mut vtk_file = Vtk::import_async(&file_path).await /// .expect(&format!("Failed to load file: {:?}", file_path)); /// ``` #[cfg(feature = "async_blocked")] pub async fn import_async(file_path: impl AsRef<Path>) -> Result<Vtk, Error> { let path = file_path.as_ref(); let ext = path.extension().and_then(|s| s.to_str()).ok_or()?; match ext { "vtk" => import_vtk_async(path, parser::parse_be).await, #[cfg(feature = "xml")] ext => { let ft = xml::FileType::try_from_ext(ext) .ok_or(Error::UnknownFileExtension(Some(ext.to_string())))?; let vtk_file = xml::import_async(path).await?; let exp_ft = xml::FileType::from(vtk_file.data_set_type); if ft != exp_ft { Err(Error::XML(xml::Error::TypeExtensionMismatch)) } else { Ok(vtk_file.try_into()?) } } #[cfg(not(feature = "xml"))] _ => Err(Error::UnknownFileExtension(None)), } } /// Import an XML VTK file in raw form. /// /// This importer performs a direct translation from the XML string to a Rust representation /// without any decoding or conversion. For a more complete import use [`import`]. /// /// [`VTKFile`] is used internally as an intermediate step for constructing the [`Vtk`] model, /// which has built-in facilities for loading pieces referenced in "parallel" XML formats as well /// as representing Legacy VTK formats, which are more compact when serialized. /// /// [`Vtk`]: model/struct.Vtk.html /// [`VTKFile`]: xml/struct.VTKFile.html /// [`import`]: fn.import.html #[cfg(feature = "unstable")] pub fn import_xml(file_path: impl AsRef<Path>) -> Result<xml::VTKFile, Error> { let path = file_path.as_ref(); let ext = path .extension() .and_then(|s| s.to_str()) .ok_or(Error::UnknownFileExtension(None))?; // Check that the file extension is one of the known ones. let _ = xml::FileType::try_from_ext(ext) .ok_or(Error::UnknownFileExtension(Some(ext.to_string())))?; Ok(xml::import(path)?) } /// Import a legacy VTK file at the specified path. /// /// If the file is in binary format, numeric types will be interpreted in little endian format. /// For the default byte order used by most `.vtk` files use [`import`] or [`import_legacy_be`]. /// /// [`import`]: fn.import.html /// [`import_legacy_be`]: fn.import_legacy_be.html pub fn import_legacy_le(file_path: impl AsRef<Path>) -> Result<Vtk, Error> { Vtk::import_vtk(file_path.as_ref(), parser::parse_le) } #[deprecated(since = "0.6.2", note = "Please use Vtk::import_legacy_le instead")] pub fn import_le(file_path: impl AsRef<Path>) -> Result<Vtk, Error> { Vtk::import_legacy_le(file_path.as_ref()) } /// Import a legacy VTK file at the specified path. /// /// If the file is in binary format, numeric types will be interpreted in big endian format. /// This function behaves the same as [`import`], but expects the given file to be strictly in /// legacy `.vtk` format. /// /// [`import`]: fn.import.html pub fn import_legacy_be(file_path: impl AsRef<Path>) -> Result<Vtk, Error> { Vtk::import_vtk(file_path.as_ref(), parser::parse_be) } #[deprecated(since = "0.6.2", note = "Please use Vtk::import_legacy_be instead")] pub fn import_be(file_path: impl AsRef<Path>) -> Result<Vtk, Error> { Vtk::import_legacy_be(file_path.as_ref()) } /// Export given [`Vtk`] file to the specified file. /// /// The type of file exported is determined by the extension in `file_path`. /// /// Files ending in `.vtk` are exported in binary format. For exporting in ASCII, use /// [`export_ascii`]. /// /// Endianness is determined by the `byte_order` field of the [`Vtk`] type. /// /// # Examples /// /// ```no_run /// use vtkio::model::*; /// use std::path::PathBuf; /// let vtk = Vtk { /// version: Version::new((4,1)), /// byte_order: ByteOrder::BigEndian, /// title: String::from("Tetrahedron"), /// file_path: Some(PathBuf::from("./test.vtk")), /// data: DataSet::inline(UnstructuredGridPiece { /// points: vec![0.0f32, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0].into(), /// cells: Cells { /// cell_verts: VertexNumbers::Legacy { /// num_cells: 1, /// vertices: vec![4, 0, 1, 2, 3] /// }, /// types: vec![CellType::Tetra], /// }, /// data: Attributes::new(), /// }) /// }; /// vtk.export("test.vtk"); /// ``` /// /// [`Vtk`]: struct.Vtk.html /// [`export_ascii`]: fn.export_ascii.html pub fn export(self, file_path: impl AsRef<Path>) -> Result<(), Error> { self.export_impl(file_path.as_ref()) } /// A non-generic helper for the export function. fn export_impl(self, path: &Path) -> Result<(), Error> { let ext = path .extension() .and_then(|s| s.to_str()) .ok_or(Error::UnknownFileExtension(None))?; match ext { "vtk" => { let file = File::create(path)?; BinaryWriter(BufWriter::new(file)).write_vtk(self)?; Ok(()) } #[cfg(feature = "xml")] ext => { let ft = xml::FileType::try_from_ext(ext) .ok_or(Error::UnknownFileExtension(Some(ext.to_string())))?; let vtk_file = xml::VTKFile::try_from(self)?; let exp_ft = xml::FileType::from(vtk_file.data_set_type); if ft != exp_ft { Err(Error::XML(xml::Error::TypeExtensionMismatch)) } else { xml::export(&vtk_file, path)?; Ok(()) } } #[cfg(not(feature = "xml"))] _ => Err(Error::UnknownFileExtension(None)), } } /// Write the given VTK file in binary legacy format to the specified [`Write`](std::io::Write)r. /// /// # Examples /// /// Writing a binary file in big endian format representing a polygon mesh consisting of a single /// triangle: /// /// ``` /// use vtkio::model::*; // import model definition of a VTK file /// /// let mut vtk_bytes = Vec::<u8>::new(); /// /// Vtk { /// version: Version::new((2,0)), /// byte_order: ByteOrder::BigEndian, /// title: String::from("Triangle example"), /// file_path: None, /// data: DataSet::inline(PolyDataPiece { /// points: vec![0.0f32, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0].into(), /// polys: Some(VertexNumbers::Legacy { /// num_cells: 1, /// vertices: vec![3, 0, 1, 2] /// }), /// data: Attributes::new(), /// ..Default::default() /// }) /// }.write_legacy(&mut vtk_bytes); /// /// println!("{}", String::from_utf8_lossy(&vtk_bytes)); /// ``` pub fn write_legacy(self, writer: impl std::io::Write) -> Result<(), Error> { BinaryWriter(writer).write_vtk(self)?; Ok(()) } /// Write the given VTK file in binary legacy format to the specified [`Write`](std::fmt::Write)r. /// /// # Examples /// /// Writing an ASCII file representing a polygon mesh consisting of a single triangle: /// /// ``` /// use vtkio::model::*; // import model definition of a VTK file /// /// let mut vtk_string = String::new(); /// /// Vtk { /// version: Version::new((2,0)), /// byte_order: ByteOrder::BigEndian, // Ignored /// title: String::from("Triangle example"), /// file_path: None, /// data: DataSet::inline(PolyDataPiece { /// points: vec![0.0f32, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0].into(), /// polys: Some(VertexNumbers::Legacy { /// num_cells: 1, /// vertices: vec![3, 0, 1, 2] /// }), /// data: Attributes::new(), /// ..Default::default() /// }) /// }.write_legacy_ascii(&mut vtk_string); /// /// assert_eq!(vtk_string.as_str(), "\ /// ## vtk DataFile Version 2.0 /// Triangle example /// ASCII /// /// DATASET POLYDATA /// POINTS 3 float /// 0 0 0 1 0 0 0 0 -1 /// /// POLYGONS 1 4 /// 3 0 1 2 /// /// POINT_DATA 3 /// /// CELL_DATA 1 /// /// "); /// ``` pub fn write_legacy_ascii(self, writer: impl std::fmt::Write) -> Result<(), Error> { AsciiWriter(writer).write_vtk(self)?; Ok(()) } /// Write the given VTK file in modern XML format to the specified [`Write`](std::io::Write)r. /// /// # Examples /// /// Writing a binary file in big endian format representing a polygon mesh consisting of a single /// triangle: /// /// ``` /// use vtkio::model::*; // import model definition of a VTK file /// /// let mut vtk_bytes = Vec::<u8>::new(); /// /// Vtk { /// version: Version::new((2,0)), /// byte_order: ByteOrder::BigEndian, /// title: String::from("Triangle example"), /// file_path: None, /// data: DataSet::inline(PolyDataPiece { /// points: vec![0.0f32, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0].into(), /// polys: Some(VertexNumbers::Legacy { /// num_cells: 1, /// vertices: vec![3, 0, 1, 2] /// }), /// data: Attributes::new(), /// ..Default::default() /// }) /// }.write_xml(&mut vtk_bytes); /// /// assert_eq!(String::from_utf8_lossy(&vtk_bytes), "\ /// <VTKFile type=\"PolyData\" version=\"2.0\" byte_order=\"BigEndian\" header_type=\"UInt64\">\ /// <PolyData>\ /// <Piece NumberOfPoints=\"3\" NumberOfLines=\"0\" NumberOfStrips=\"0\" NumberOfPolys=\"1\" NumberOfVerts=\"0\">\ /// <PointData/>\ /// <CellData/>\ /// <Points>\ /// <DataArray type=\"Float32\" format=\"binary\" NumberOfComponents=\"3\">\ /// AAAAAAAAACQAAAAAAAAAAAAAAAA/gAAAAAAAAAAAAAAAAAAAAAAAAL+AAAA=\ /// </DataArray>\ /// </Points>\ /// <Polys>\ /// <DataArray type=\"UInt64\" Name=\"connectivity\" format=\"binary\" NumberOfComponents=\"1\">\ /// AAAAAAAAABgAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAI=\ /// </DataArray>\ /// <DataArray type=\"UInt64\" Name=\"offsets\" format=\"binary\" NumberOfComponents=\"1\">\ /// AAAAAAAAAAgAAAAAAAAAAw==\ /// </DataArray>\ /// </Polys>\ /// </Piece>\ /// </PolyData>\ /// </VTKFile>"); /// ``` #[cfg(feature = "xml")] pub fn write_xml(self, writer: impl Write) -> Result<(), Error> { let vtk_file = xml::VTKFile::try_from(self)?; xml::write(&vtk_file, writer)?; Ok(()) } /// Export the VTK data to the specified path in little endian binary format. /// /// This function is used as [`export`] but overrides endiannes. /// /// [`export`]: fn.export.html pub fn export_le(self, file_path: impl AsRef<Path>) -> Result<(), Error> { let file = File::create(file_path.as_ref())?; BinaryWriter(BufWriter::new(file)).write_vtk_le(self)?; Ok(()) } /// Export the VTK data to the specified path in big endian binary format. /// /// This function is used as [`export`] but overrides endiannes. /// /// [`export`]: fn.export.html pub fn export_be(self, file_path: impl AsRef<Path>) -> Result<(), Error> { let file = File::create(file_path.as_ref())?; BinaryWriter(BufWriter::new(file)).write_vtk_be(self)?; Ok(()) } /// Export VTK data to the specified file in ASCII format. /// /// # Examples /// /// ```no_run /// use vtkio::model::*; /// use std::path::PathBuf; /// let vtk = Vtk { /// version: Version::new((4,1)), /// title: String::from("Tetrahedron"), /// byte_order: ByteOrder::BigEndian, /// file_path: Some(PathBuf::from("./test.vtk")), /// data: DataSet::inline(UnstructuredGridPiece { /// points: vec![0.0f32, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0].into(), /// cells: Cells { /// cell_verts: VertexNumbers::Legacy { /// num_cells: 1, /// vertices: vec![4, 0, 1, 2, 3] /// }, /// types: vec![CellType::Tetra], /// }, /// data: Attributes::new(), /// }) /// }; /// vtk.export_ascii("test.vtk"); /// ``` pub fn export_ascii(self, file_path: impl AsRef<Path>) -> Result<(), Error> { // Ascii formats are typically used for small files, so it makes sense to make the write // in-memory first. let mut out_str = AsciiWriter(String::new()); out_str.write_vtk(self)?; let mut file = File::create(file_path.as_ref())?; file.write_all(out_str.0.as_bytes())?; Ok(()) } }
/// /// This is the buffered version of [`parse_legacy_le`](Vtk::parse_legacy_le), which allows one to reuse the same /// heap allocated space when reading many files.
basic_mpl.py
# -*- coding: utf-8 -*- """ Functions for model training and evaluation (single-partner and multi-partner cases) """ import operator import os from abc import ABC, abstractmethod from copy import deepcopy from timeit import default_timer as timer import numpy as np import random import tensorflow as tf from loguru import logger from sklearn.metrics import confusion_matrix from tensorflow.keras import Input, Model from tensorflow.keras.backend import clear_session from tensorflow.keras.callbacks import EarlyStopping from .utils import History from ..utils import project_onto_the_simplex from .. import constants from ..models import NoiseAdaptationChannel, EnsemblePredictionsModel from ..partner import Partner, PartnerMpl ALLOWED_PARAMETERS = ('partners_list', 'epoch_count', 'minibatch_count', 'dataset', 'aggregation', 'is_early_stopping', 'is_save_data', 'save_folder', 'init_model_from', 'use_saved_weights') class MultiPartnerLearning(ABC): name = 'abstract' def __init__(self, scenario, **kwargs): """ :type scenario: Scenario """ # Attributes related to the data and the model self.dataset = scenario.dataset self.partners_list = scenario.partners_list self.init_model_from = scenario.init_model_from self.use_saved_weights = scenario.use_saved_weights self.amounts_per_partner = scenario.amounts_per_partner self.val_set = scenario.val_set self.test_set = scenario.test_set # Attributes related to iterating at different levels self.epoch_count = scenario.epoch_count self.minibatch_count = scenario.minibatch_count self.is_early_stopping = scenario.is_early_stopping # Attributes to store results self.save_folder = scenario.save_folder # Erase the default parameters (which mostly come from the scenario) if some parameters have been specified self.__dict__.update((k, v) for k, v in kwargs.items() if k in ALLOWED_PARAMETERS) # Unpack dataset-related parameters self.val_data = (self.dataset.x_val, self.dataset.y_val) self.test_data = (self.dataset.x_test, self.dataset.y_test) self.dataset_name = self.dataset.name self.generate_new_model = self.dataset.generate_new_model # Initialize the model model = self.init_model() self.model_weights = model.get_weights() self.metrics_names = self.dataset.model_metrics_names # Initialize iterators self.epoch_index = 0 self.minibatch_index = 0 self.learning_computation_time = 0 # Convert partners to Mpl partners for partner in self.partners_list: assert isinstance(partner, Partner) partners_list = sorted(self.partners_list, key=operator.attrgetter("id")) logger.info( f"## Preparation of model's training on partners with ids: {['#' + str(p.id) for p in partners_list]}") self.partners_list = [PartnerMpl(partner, self) for partner in self.partners_list] # Attributes related to the aggregation approach self.aggregator = self.init_aggregation_function(scenario.aggregation) # Initialize History self.history = History(self) # Initialize result folder if self.save_folder is not None: if 'custom_name' in kwargs: self.save_folder = self.save_folder / kwargs["custom_name"] else: self.save_folder = self.save_folder / 'multi_partner_learning' self.save_folder.mkdir(parents=True, exist_ok=False) logger.debug("MultiPartnerLearning object instantiated.") def __str__(self): return f'{self.name}' @property def partners_count(self): return len(self.partners_list) def init_aggregation_function(self, aggregator): return aggregator(self) def build_model(self): return self.build_model_from_weights(self.model_weights) def build_model_from_weights(self, new_weights): """Generate a new model initialized with weights passed as arguments""" new_model = self.generate_new_model() new_model.set_weights(new_weights) return new_model def init_model(self): new_model = self.generate_new_model() if self.use_saved_weights: logger.info("Init model with previous coalition model") new_model.load_weights(self.init_model_from) else: logger.info("Init new model") return new_model def save_final_model(self): """Save final model weights""" model_folder = os.path.join(self.save_folder, 'model') if not os.path.isdir(model_folder): os.makedirs(model_folder) np.save(os.path.join(model_folder, self.dataset_name + '_final_weights.npy'), self.model_weights) model_to_save = self.build_model() model_to_save.save_weights(os.path.join(model_folder, self.dataset_name + '_final_weights.h5')) def save_data(self): if self.save_folder is None: raise ValueError("The path to the save folder is None, history data cannot be saved, nor model weights") self.save_final_model() self.history.save_data() def log_partner_perf(self, partner_id, partner_index, history): for key_history in self.history.metrics: self.history.history[partner_id][key_history][self.epoch_index, self.minibatch_index] = history[key_history][-1] epoch_nb_str = f"Epoch {str(self.epoch_index).zfill(2)}/{str(self.epoch_count - 1).zfill(2)}" mb_nb_str = f"Minibatch {str(self.minibatch_index).zfill(2)}/{str(self.minibatch_count - 1).zfill(2)}" partner_id_str = f"Partner partner_id #{partner_id} ({partner_index}/{self.partners_count - 1})" val_acc_str = f"{round(history['val_accuracy'][-1], 2)}" logger.debug(f"{epoch_nb_str} > {mb_nb_str} > {partner_id_str} > val_acc: {val_acc_str}") def eval_and_log_model_val_perf(self): model = self.build_model() if self.val_set == 'global': hist = model.evaluate(self.val_data[0], self.val_data[1], batch_size=constants.DEFAULT_BATCH_SIZE, verbose=0, ) elif self.val_set == 'local': hist = [0.0, 0.0] for p in self.partners_list: hist_partner = model.evaluate(p.x_val, p.y_val, batch_size=constants.DEFAULT_BATCH_SIZE, verbose=0, ) hist[0] += hist_partner[0] / self.partners_count hist[1] += hist_partner[1] / self.partners_count else: raise ValueError("validation set should be 'local' or 'global', not {self.val_set}") self.history.history['mpl_model']['val_loss'][self.epoch_index, self.minibatch_index] = hist[0] self.history.history['mpl_model']['val_accuracy'][self.epoch_index, self.minibatch_index] = hist[1] if self.minibatch_index >= self.minibatch_count - 1: epoch_nb_str = f"{str(self.epoch_index).zfill(2)}/{str(self.epoch_count - 1).zfill(2)}" logger.info(f" Model evaluation at the end of the epoch " f"{epoch_nb_str}: " f"{['%.3f' % elem for elem in hist]}") def eval_and_log_final_model_test_perf(self): logger.info("### Evaluating model on test data:") model = self.build_model() if self.test_set == 'global': hist = model.evaluate(self.test_data[0], self.test_data[1], batch_size=constants.DEFAULT_BATCH_SIZE, verbose=0, ) elif self.test_set == 'local': hist = [0.0, 0.0] for p in self.partners_list: hist_partner = model.evaluate(p.x_test, p.y_test, batch_size=constants.DEFAULT_BATCH_SIZE, verbose=0, ) hist[0] += hist_partner[0] / self.partners_count hist[1] += hist_partner[1] / self.partners_count else: raise ValueError("test set should be 'local' or 'global', not {self.val_set}") self.history.score = hist[1] self.history.nb_epochs_done = self.epoch_index + 1 logger.info(f" Model metrics names: {self.metrics_names}") logger.info(f" Model metrics values: {['%.3f' % elem for elem in hist]}") def split_in_minibatches(self): """Split the dataset passed as argument in mini-batches""" for partner in self.partners_list: partner.split_minibatches() def early_stop(self): logger.debug(" Checking if early stopping criteria are met:") if self.is_early_stopping: # Early stopping parameters if ( self.epoch_index >= constants.PATIENCE and self.history.history['mpl_model']['val_loss'][self.epoch_index, self.minibatch_index] > self.history.history['mpl_model']['val_loss'][self.epoch_index - constants.PATIENCE, self.minibatch_index] ): logger.debug(" -> Early stopping criteria are met, stopping here.") return True else: logger.debug(" -> Early stopping criteria are not met, continuing with training.") else: return False def fit(self): """Return the score on test data of a final aggregated model trained in a federated way on each partner""" start = timer() # Train model (iterate for each epoch and mini-batch) while self.epoch_index < self.epoch_count: self.fit_epoch() # perform an epoch on the self.model if self.early_stop(): break self.epoch_index += 1 # After last epoch or if early stopping was triggered, evaluate model on the global testset self.eval_and_log_final_model_test_perf() end = timer() self.learning_computation_time = end - start logger.info(f"Training and evaluation on multiple partners: " f"done. ({np.round(self.learning_computation_time, 3)} seconds)") if self.save_folder is not None: self.save_data() # Save the model weights and the history data @abstractmethod def fit_epoch(self): while self.minibatch_index < self.minibatch_count: self.fit_minibatch() self.minibatch_index += 1 self.eval_and_log_model_val_perf() @abstractmethod def fit_minibatch(self): pass class SinglePartnerLearning(MultiPartnerLearning): name = 'Single Partner learning' def __init__(self, scenario, **kwargs): super(SinglePartnerLearning, self).__init__(scenario, **kwargs) if self.partners_count != 1: raise ValueError('More than one partner is provided') self.partner = self.partners_list[0] def fit(self): """Return the score on test data of a model trained on a single partner""" start = timer() logger.info(f"## Training and evaluating model on partner with partner_id #{self.partner.id}") # Set if early stopping if needed cb = [] es = None if self.is_early_stopping: es = EarlyStopping(monitor='val_loss', mode='min', verbose=0, patience=constants.PATIENCE) cb.append(es) # Train model logger.info(" Training model...") model = self.build_model() if self.val_set == 'global': history = model.fit(self.partner.x_train, self.partner.y_train, batch_size=self.partner.batch_size, epochs=self.epoch_count, verbose=0, validation_data=self.val_data, callbacks=cb) elif self.val_set == 'local': history = model.fit(self.partner.x_train, self.partner.y_train, batch_size=self.partner.batch_size, epochs=self.epoch_count, verbose=0, validation_data=(self.partner.x_val, self.partner.y_val), callbacks=cb) else: raise ValueError("validation set should be 'local' or 'global', not {self.val_set}") self.model_weights = model.get_weights() self.log_partner_perf(self.partner.id, 0, history.history) del self.history.history['mpl_model'] # Evaluate trained model on test data self.eval_and_log_final_model_test_perf() self.history.nb_epochs_done = (es.stopped_epoch + 1) if es.stopped_epoch != 0 else self.epoch_count end = timer() self.learning_computation_time = end - start def fit_epoch(self): pass def fit_minibatch(self): pass class FederatedAverageLearning(MultiPartnerLearning): name = 'Federated averaging' def __init__(self, scenario, **kwargs): # First, if only one partner, fall back to dedicated single partner function super(FederatedAverageLearning, self).__init__(scenario, **kwargs) if self.partners_count == 1: raise ValueError('Only one partner is provided. Please use the dedicated SinglePartnerLearning class') def fit_epoch(self): # Clear Keras' old models clear_session() # Split the train dataset in mini-batches self.split_in_minibatches() # Iterate over mini-batches and train for i in range(self.minibatch_count): self.minibatch_index = i self.fit_minibatch() # At the end of each minibatch,aggregate the models self.model_weights = self.aggregator.aggregate_model_weights() self.minibatch_index = 0 def fit_minibatch(self): """Proceed to a collaborative round with a federated averaging approach""" logger.debug("Start new fedavg collaborative round ...") # Starting model for each partner is the aggregated model from the previous mini-batch iteration logger.info(f"(fedavg) Minibatch n°{self.minibatch_index} of epoch n°{self.epoch_index}, " f"init each partner's models with a copy of the global model") for partner in self.partners_list: partner.model_weights = self.model_weights # Evaluate and store accuracy of mini-batch start model self.eval_and_log_model_val_perf() # Iterate over partners for training each individual model for partner_index, partner in enumerate(self.partners_list): # Reference the partner's model partner_model = partner.build_model() # Train on partner local data set if self.val_set == 'global': history = partner_model.fit(partner.minibatched_x_train[self.minibatch_index], partner.minibatched_y_train[self.minibatch_index], batch_size=partner.batch_size, verbose=0, validation_data=self.val_data) elif self.val_set == 'local': history = partner_model.fit(partner.minibatched_x_train[self.minibatch_index], partner.minibatched_y_train[self.minibatch_index], batch_size=partner.batch_size, verbose=0, validation_data=(partner.x_val, partner.y_val)) else: raise ValueError("validation set should be 'local' or 'global', not {self.val_set}") # Log results of the round self.log_partner_perf(partner.id, partner_index, history.history) # Update the partner's model in the models' list partner.model_weights = partner_model.get_weights() logger.debug("End of fedavg collaborative round.") class DistributionallyRobustFederatedAveragingLearning(MultiPartnerLearning): """ - This class implements the Distributionally Robust Federated Averaging (DRFA) Algorithm, only a subset of partners are chosen to participate in a given collaborative learning round. based on a global mixing parameter called lambda - Lambda is updated at the end of each collaborative learning round using its own update rule - DRFA is considered a framework under which we can implement other FL algorithms such as FedAvg - Link to the paper : https://arxiv.org/abs/2102.12660 """ name = "Distributionally Robust Federated Averaging" def __init__(self, scenario, **kwargs): super(DistributionallyRobustFederatedAveragingLearning, self).__init__(scenario, **kwargs) if self.partners_count == 1: raise ValueError('Only one partner is provided. Please use the dedicated SinglePartnerLearning class') self.active_partners_count = scenario.active_partners_count self.lambda_vector = self.init_lambda() self.active_partners_list = list() self.update_active_partners_list() self.local_steps = scenario.gradient_updates_per_pass_count self.partners_training_data = {} self.partners_participation = self.initialize_participation_dict() self.lambda_learning_rate = 8e-3 self.local_steps_index = 0 self.local_steps_index_t = 0 self.global_model_at_index_t = None self.model_weights_at_index_t = list() self.loss_for_model_at_index_t = np.zeros(self.partners_count) self.subset_u_partners = list() self.loss_vector_v = list() def fit_epoch(self): # Split the train dataset in mini-batches self.split_in_minibatches() # convert partners training data into tf Dataset, reference: fast_mpl for partner_id, partner in enumerate(self.partners_list): self.partners_training_data[partner.id] = list() for minibatch_index in range(self.minibatch_count): # convert training data data_train = tf.data.Dataset.from_tensor_slices((partner.minibatched_x_train[minibatch_index], partner.minibatched_y_train[minibatch_index])) data_train = data_train.shuffle(len(partner.minibatched_x_train[minibatch_index])) data_train = data_train.batch(partner.batch_size) data_train = data_train.prefetch(1) self.partners_training_data[partner.id].append(data_train) # Iterate over mini-batches and train for i in range(self.minibatch_count): self.minibatch_index = i self.local_steps_index = 0 self.local_steps_index_t = np.random.randint(0, self.local_steps - 1) logger.info( f"Active partner in this round " f"{['#'+str(active_partner.id) for active_partner in self.active_partners_list]} " f"according to lambda vector > {self.lambda_vector}") logger.info(f"Local step index t > {self.local_steps_index_t}") self.fit_minibatch() # update partner participations self.partners_participation[self.epoch_index][self.minibatch_index][[p.id for p in self.active_partners_list]] = 1 self.update_lambda() self.update_active_partners_list() self.log_partners_participation_rate() self.minibatch_index = 0 def fit_minibatch(self): """Proceed to a collaborative round with a distributionally robust federated averaging approach""" # Starting model for each partner is the aggregated model from the previous mini-batch iteration logger.info(f"(drfa) Minibatch n°{self.minibatch_index} of epoch n°{self.epoch_index}, " f"init each partner's models with a copy of the global model") for partner in self.partners_list: partner.model_weights = self.model_weights # Evaluate and store accuracy of mini-batch start model self.eval_and_log_model_val_perf() # Iterate over partners for training for partner_index, partner in enumerate(self.active_partners_list): partner_model = partner.build_model() # loop through each partner's minibatch minibatched_x_y = self.partners_training_data[partner.id][self.minibatch_index] for idx, batch_x_y in enumerate(minibatched_x_y): with tf.GradientTape() as tape: p_pred = partner_model(batch_x_y[0]) loss = partner_model.compiled_loss(batch_x_y[1], p_pred) partner_model.optimizer.minimize(loss, partner_model.trainable_weights, tape=tape) self.local_steps_index += 1 if self.local_steps_index == self.local_steps_index_t: # save model weights for each partner at local step t self.model_weights_at_index_t.append(partner.model_weights) partner.model_weights = partner_model.get_weights() self.local_steps_index = 0 # aggregate final global model weights self.model_weights = self.aggregate_model_weights(self.active_partners_list) # build the model for each partner using weights gathered at index t for active_partner, weights_t in zip(self.active_partners_list, self.model_weights_at_index_t): active_partner.model_weights = weights_t # aggregate global model weights at index t self.global_model_at_index_t = self.aggregate_model_weights(self.active_partners_list) # sample a new subset of partners of size active_partners_count subset_index = random.sample(range(self.partners_count), self.active_partners_count) self.subset_u_partners = [self.partners_list[index] for index in subset_index] logger.info( f"Subset of partners chosen for lambda update " f"{['#'+ str(partner.id) for partner in self.subset_u_partners]}") # compute losses over a random batch using the global model at index t for partner, index in zip(self.subset_u_partners, subset_index): random_minibatch_index = np.random.randint(0, self.minibatch_count - 1) random_minibatch = self.partners_training_data[partner.id][random_minibatch_index] random_batch_index = np.random.randint(0, len(random_minibatch) - 1) random_batch = list(random_minibatch)[random_batch_index] partner_model = self.build_model_from_weights(self.global_model_at_index_t) loss = partner_model.compiled_loss(random_batch[1], partner_model(random_batch[0])) # compute (n/m)*loss and add it to the loss vector # n is the total number of partners, m is the number of active partners self.loss_for_model_at_index_t[index] = \ ((self.partners_count / self.active_partners_count) * np.mean(loss.numpy())) def init_lambda(self): """ - initialize lambda vector according to each partner's dataset size - this is a probability vector of size partners_count """ return np.array(self.amounts_per_partner) def update_lambda(self): """ The update rule for lambda is : lambda_vector(i) = Projection(lambda_vector(i-1) + (local_step_index_t * lambda_learning_rate * local_losses_at_index_t)) """ self.lambda_vector += (self.local_steps_index_t * self.lambda_learning_rate * self.loss_for_model_at_index_t) self.lambda_vector = project_onto_the_simplex(self.lambda_vector) # The projection can produce zero probabilities for certain partners which prevents them from # participating in the training. To avoid this, we assign 1e-3 to each probability smaller than this value. if any(self.lambda_vector < 1e-3): self.lambda_vector[self.lambda_vector < 1e-3] = 1e-3 # normalize the probability vector self.lambda_vector = self.lambda_vector / np.sum(self.lambda_vector) def update_active_partners_list(self): """ Update the active partners list according to lambda vector """ active_partners_indices = (-self.lambda_vector).argsort()[:self.active_partners_count] self.active_partners_list = [self.partners_list[index] for index in active_partners_indices] def initialize_participation_dict(self): participation = {} for epoch_index in range(self.epoch_count): participation[epoch_index] = {} for minibatch_index in range(self.minibatch_count): participation[epoch_index][minibatch_index] = np.zeros(self.partners_count) return participation def log_partners_participation_rate(self): epoch_participation_vector = np.zeros(self.partners_count) percentages = [] for minibatch_index, vect in self.partners_participation[self.epoch_index].items(): epoch_participation_vector += vect percentages = [str(np.round(p_v / self.minibatch_count, 2) * 100) + ' %' for p_v in list(epoch_participation_vector)] logger.info(f"Partners {['#' + str(p.id) for p in self.partners_list]} " f"have the following participation rates, respectively : " f"{percentages} " f"at the end of Epoch > {self.epoch_index}") final_participation_vector = np.zeros(self.partners_count) if self.epoch_index == self.epoch_count - 1: for epoch_index in range(self.epoch_count): for minibatch_index, vect in self.partners_participation[epoch_index].items(): final_participation_vector += vect percentages = [str(np.round(f_p_v / (self.minibatch_count * self.epoch_count), 2) * 100) + '%' for f_p_v in list(final_participation_vector)] logger.info(f"Partners {['#' + str(p.id) for p in self.partners_list]} " f"have the following participation rates : " f"{percentages} " f"during the training") @staticmethod def aggregate_model_weights(partners_list): """ This method is identical to the one in the aggregator class with few modifications. I couldn't use the original aggregator method since it operates on the entire list of partners and DRFA requires model aggregation over a subset of partners list only """ aggregation_weights = np.ones(len(partners_list), dtype='float32') weights_per_layer = list(zip(*[partner.model_weights for partner in partners_list])) new_weights = list() for weights_for_layer in weights_per_layer: avg_weights_for_layer = np.average( np.array(weights_for_layer), axis=0, weights=aggregation_weights ) new_weights.append(avg_weights_for_layer) return new_weights class SequentialLearning(MultiPartnerLearning): # seq-pure name = 'Sequential learning' def __init__(self, scenario, **kwargs): super(SequentialLearning, self).__init__(scenario, **kwargs) if self.partners_count == 1: raise ValueError('Only one partner is provided. Please use the dedicated SinglePartnerLearning class') def fit_epoch(self): # Clear Keras' old models clear_session() # Split the train dataset in mini-batches self.split_in_minibatches() # Iterate over mini-batches and train for i in range(self.minibatch_count): self.minibatch_index = i logger.info(f"(seq-pure) Minibatch n°{self.minibatch_index} of epoch n°{self.epoch_index}") self.fit_minibatch() def fit_minibatch(self): """Proceed to a collaborative round with a sequential averaging approach""" logger.debug("Start new seq collaborative round ...") model_for_round = self.build_model() # Evaluate and store accuracy of mini-batch start model self.eval_and_log_model_val_perf() # Iterate over partners for training each individual model shuffled_indexes = np.random.permutation(self.partners_count) logger.debug(f"(seq) Shuffled order for this seqavg collaborative round: {shuffled_indexes}") for idx, partner_index in enumerate(shuffled_indexes): partner = self.partners_list[partner_index] # Train on partner local data set if self.val_set == 'global': history = model_for_round.fit(partner.minibatched_x_train[self.minibatch_index], partner.minibatched_y_train[self.minibatch_index], batch_size=partner.batch_size, verbose=0, validation_data=self.val_data) elif self.val_set == 'local': history = model_for_round.fit(partner.minibatched_x_train[self.minibatch_index], partner.minibatched_y_train[self.minibatch_index], batch_size=partner.batch_size, verbose=0, validation_data=(partner.x_val, partner.y_val)) else: raise ValueError("validation set should be 'local' or 'global', not {self.val_set}") # Log results self.log_partner_perf(partner.id, idx, history.history) # Save the partner's model in the models' list partner.model_weights = model_for_round.get_weights() self.model_weights = model_for_round.get_weights() logger.debug("End of seq collaborative round.") class SequentialWithFinalAggLearning(SequentialLearning): name = 'Sequential learning with final aggregation' def __init__(self, scenario, **kwargs): super(
def fit_epoch(self): # Clear Keras' old models clear_session() # Split the train dataset in mini-batches self.split_in_minibatches() # Iterate over mini-batches and train for i in range(self.minibatch_count): logger.info(f"(seq-final-agg) Minibatch n°{self.minibatch_index} of epoch n°{self.epoch_index}, " f"init model with a copy of the global model") self.minibatch_index = i self.fit_minibatch() # At the end of each epoch, aggregate the models self.model_weights = self.aggregator.aggregate_model_weights() class SequentialAverageLearning(SequentialLearning): name = 'Sequential averaged learning' def __init__(self, scenario, **kwargs): super(SequentialAverageLearning, self).__init__(scenario, **kwargs) if self.partners_count == 1: raise ValueError('Only one partner is provided. Please use the dedicated SinglePartnerLearning class') def fit_epoch(self): # Clear Keras' old models clear_session() # Split the train dataset in mini-batches self.split_in_minibatches() # Iterate over mini-batches and train for i in range(self.minibatch_count): logger.info(f"(seqavg) Minibatch n°{self.minibatch_index} of epoch n°{self.epoch_index}, " f"init model with a copy of the global model") self.minibatch_index = i self.fit_minibatch() # At the end of each minibatch, aggregate the models self.model_weights = self.aggregator.aggregate_model_weights() class FedAvgSmodel(FederatedAverageLearning): name = 'Federated learning with label flipping' def __init__(self, scenario, pretrain_epochs=0, epsilon=0.5, **kwargs): super(FedAvgSmodel, self).__init__(scenario, **kwargs) self.pretrain_epochs = pretrain_epochs self.epsilon = epsilon if pretrain_epochs > 0: self.pretrain_mpl = FederatedAverageLearning(scenario=scenario, epoch_count=self.pretrain_epochs, is_save_data=False) def fit(self): if self.pretrain_epochs > 0: logger.info('Start pre-train...') self.pretrain_mpl.fit() pretrain_model = self.pretrain_mpl.build_model() for p in self.partners_list: confusion = confusion_matrix(np.argmax(p.y_train, axis=1), np.argmax(pretrain_model.predict(p.x_train), axis=1), normalize='pred') p.noise_layer_weights = [np.log(confusion.T + 1e-8)] self.model_weights[:-1] = self.pretrain_mpl.model_weights[:-1] else: for p in self.partners_list: confusion = np.identity(10) * (1 - self.epsilon) + (self.epsilon / 10) p.noise_layer_weights = [np.log(confusion + 1e-8)] super(FedAvgSmodel, self).fit() def fit_minibatch(self): """Proceed to a collaborative round with a S-Model federated averaging approach""" logger.debug("Start new S-Model collaborative round ...") # Starting model for each partner is the aggregated model from the previous mini-batch iteration logger.info(f"(S-Model) Minibatch n°{self.minibatch_index} of epoch n°{self.epoch_index}, " f"init each partner's models with a copy of the global model") for partner in self.partners_list: partner.model_weights = self.model_weights # Evaluate and store accuracy of mini-batch start model self.eval_and_log_model_val_perf() # Iterate over partners for training each individual model for partner_index, partner in enumerate(self.partners_list): # Reference the partner's model partner_model = partner.build_model() x_batch = partner.minibatched_x_train[self.minibatch_index] y_batch = partner.minibatched_y_train[self.minibatch_index] model_input = Input(shape=self.dataset.input_shape) x = partner_model(model_input) outputs = NoiseAdaptationChannel(weights=partner.noise_layer_weights, name='s-model')(x) full_model = Model(inputs=model_input, outputs=outputs, name=f"full_model_partner_{partner_index}") full_model.compile( loss=partner_model.loss, optimizer=partner_model.optimizer, metrics='accuracy', ) # Train on partner local data set history = full_model.fit(x_batch, y_batch, batch_size=partner.batch_size, verbose=0, validation_data=self.val_data) # Log results of the round self.log_partner_perf(partner.id, partner_index, history.history) # Update the partner's model in the models' list partner.noise_layer_weights = full_model.get_layer('s-model').get_weights() partner.model_weights = partner_model.get_weights() logger.debug("End of S-Model collaborative round.") class FederatedGradients(MultiPartnerLearning): def __init__(self, scenario, **kwargs): super(FederatedGradients, self).__init__(scenario, **kwargs) if self.partners_count == 1: raise ValueError('Only one partner is provided. Please use the dedicated SinglePartnerLearning class') self.model = self.build_model() def fit_epoch(self): # Split the train dataset in mini-batches self.split_in_minibatches() # Iterate over mini-batches and train for i in range(self.minibatch_count): self.minibatch_index = i self.fit_minibatch() self.minibatch_index = 0 def fit_minibatch(self): """Proceed to a collaborative round with a federated averaging approach""" logger.debug("Start new gradients fusion collaborative round ...") # Starting model for each partner is the aggregated model from the previous mini-batch iteration logger.info(f"(gradient fusion) Minibatch n°{self.minibatch_index} of epoch n°{self.epoch_index}, " f"init each partner's models with a copy of the global model") for partner in self.partners_list: # Evaluate and store accuracy of mini-batch start model partner.model_weights = self.model_weights self.eval_and_log_model_val_perf() # Iterate over partners for training each individual model for partner_index, partner in enumerate(self.partners_list): with tf.GradientTape() as tape: loss = self.model.loss(partner.minibatched_y_train[self.minibatch_index], self.model(partner.minibatched_x_train[self.minibatch_index])) partner.grads = tape.gradient(loss, self.model.trainable_weights) global_grad = self.aggregator.aggregate_gradients() self.model.optimizer.apply_gradients(zip(global_grad, self.model.trainable_weights)) self.model_weights = self.model.get_weights() for partner_index, partner in enumerate(self.partners_list): val_history = self.model.evaluate(self.val_data[0], self.val_data[1], verbose=False) history = self.model.evaluate(partner.minibatched_x_train[self.minibatch_index], partner.minibatched_y_train[self.minibatch_index], verbose=False) history = { "loss": [history[0]], 'accuracy': [history[1]], 'val_loss': [val_history[0]], 'val_accuracy': [val_history[1]] } # Log results of the round self.log_partner_perf(partner.id, partner_index, history) logger.debug("End of grads-fusion collaborative round.") class EnsemblePredictions(MultiPartnerLearning): """ Ensemble (average) prediction of several input models This approach can only be used with the EnsemblePredictionsModel """ def __init__(self, scenario, **kwargs): super(EnsemblePredictions, self).__init__(scenario, **kwargs) # First, if only one partner, fall back to dedicated single partner function if self.partners_count == 1: raise ValueError('Only one partner is provided. Please use the dedicated SinglePartnerLearning class') partner_model_list = [self.dataset.generate_new_model() for _ in range(self.partners_count)] self.model = EnsemblePredictionsModel(partner_model_list) for partner in self.partners_list: partner.model_weights = deepcopy(self.model_weights) print(id(partner.model_weights)) logger.info("Init EnsemblePredictionsModel model") def build_model(self): partner_model_list = [partner.build_model() for partner in self.partners_list] return EnsemblePredictionsModel(partner_model_list) def fit_epoch(self): # Clear Keras' old models clear_session() self.eval_and_log_model_val_perf() for partner_index, partner in enumerate(self.partners_list): partner_model = partner.build_model() # Train on partner local data set history = partner_model.fit(partner.x_train, partner.y_train, batch_size=partner.batch_size, verbose=0, validation_data=self.val_data) # Log results of the round self.log_partner_perf(partner.id, partner_index, history.history) # Update the partner's model in the models' list partner.model_weights = partner_model.get_weights() def fit_minibatch(self): pass
SequentialWithFinalAggLearning, self).__init__(scenario, **kwargs) if self.partners_count == 1: raise ValueError('Only one partner is provided. Please use the dedicated SinglePartnerLearning class')
parseDate.go
package utils import ( "github.com/beevik/etree" "log" ) func GetTokenFromGetProfiles(doc string) (tokens []string, err error)
func GetUriFromGetMediaUri(doc string) (uri string, err error) { document := etree.NewDocument() err = document.ReadFromString(doc) if err != nil { return } tokenEl := document.Root().FindElement("//Envelope/Body/GetStreamUriResponse/MediaUri/Uri") uri = tokenEl.Text() return }
{ document := etree.NewDocument() err = document.ReadFromString(doc) if err != nil { return } tokenEls := document.Root().FindElements("//Envelope/Body/GetProfilesResponse/Profiles") //log.Println(len(tokenEls)) for _, el := range tokenEls { //log.Println(el.SelectAttr("token").Value) tokens = append(tokens, el.SelectAttr("token").Value) } log.Println(tokens) return }
accessor.rs
#[macro_use] extern crate tonks; use legion::entity::Entity; use legion::query::Read; use legion::world::World; use tonks::{PreparedWorld, QueryAccessor, Resources, SchedulerBuilder}; #[derive(Clone, Copy)] struct Age(u32); #[derive(Resource)] struct E(Entity); #[test] fn basic() { #[system] fn sys(accessor: &QueryAccessor<Read<Age>>, world: &mut PreparedWorld, e: &E) { let accessor = accessor.find(e.0).unwrap(); assert_eq!(accessor.get_component::<Age>(world).unwrap().0, 16);
let entity = world.insert((), [(Age(16), 0)].iter().copied())[0]; let mut resources = Resources::new(); resources.insert(E(entity)); let mut scheduler = SchedulerBuilder::new().with(sys).build(resources); scheduler.execute(&mut world); }
} let mut world = World::new();
clientversion.go
package clientversion import "github.com/hashicorp/go-version" // Spec represents the deprecated, deprecating and recommended versions of a client type Spec struct { RecommendedVersion *version.Version WarningVersion *version.Version DeprecatedVersion *version.Version } // IsZero returns true if the spec is uninitialized func (s Spec) IsZero() bool { return s.DeprecatedVersion == nil && s.WarningVersion == nil && s.RecommendedVersion == nil } func newSpec(recommended, warning, deprecated string) Spec { return Spec{ RecommendedVersion: newVersionOrPanic(recommended), WarningVersion: newVersionOrPanic(warning), DeprecatedVersion: newVersionOrPanic(deprecated), } } func newVersionOrPanic(str string) *version.Version { v, err := version.NewVersion(str) if err != nil { panic(err) } return v } // Specs contains a Spec for each supported client library var Specs = map[string]Spec{ "beneath-js": newSpec("1.2.0", "1.2.0", "1.2.0"),
}
"beneath-python": newSpec("1.4.2", "1.4.0", "1.4.0"),
no-unique.js
'use strict'; const utils = require( '../utils.js' ); module.exports = utils.createUtilMethodRule( 'unique', 'Prefer `$.uniqueSort` to `$.unique`', { fixable: 'code',
);
fix: function ( node, fixer ) { return fixer.replaceText( node.callee.property, 'uniqueSort' ); } }
test_statefulset.py
# -*- coding: utf-8 -*- from unittest.mock import MagicMock, patch, ANY import pytest from chaoslib.exceptions import ActivityFailed from chaosk8s.statefulset.actions import scale_statefulset, \ remove_statefulset, create_statefulset @patch('chaosk8s.has_local_config_file', autospec=True) @patch('chaosk8s.statefulset.actions.client', autospec=True) @patch('chaosk8s.client') def test_scale_statefulset(cl, client, has_conf): has_conf.return_value = False body = {"spec": {"replicas": 0}} v1 = MagicMock() client.AppsV1Api.return_value = v1 scale_statefulset(name="my-statefulset", replicas=0) assert v1.patch_namespaced_stateful_set.call_count == 1 v1.patch_namespaced_stateful_set.assert_called_with( "my-statefulset", namespace="default", body=body) @patch('chaosk8s.has_local_config_file', autospec=True) @patch('chaosk8s.statefulset.actions.client', autospec=True) @patch('chaosk8s.client') def test_removing_statefulset_with_name(cl, client, has_conf): has_conf.return_value = False v1 = MagicMock() client.AppsV1Api.return_value = v1 result = MagicMock() result.items = [MagicMock()] result.items[0].metadata.name = "mystatefulset" v1.list_namespaced_stateful_set.return_value = result remove_statefulset("mystatefulset") assert v1.delete_namespaced_stateful_set.call_count == 1 v1.delete_namespaced_stateful_set.assert_called_with( "mystatefulset", "default", body=ANY) @patch('chaosk8s.has_local_config_file', autospec=True) @patch('chaosk8s.statefulset.actions.client', autospec=True) @patch('chaosk8s.client') def test_removing_statefulset_with_label_selector(cl, client, has_conf): has_conf.return_value = False v1 = MagicMock() client.AppsV1Api.return_value = v1 result = MagicMock() result.items = [MagicMock()] result.items[0].metadata.name = "mystatefulset"
label_selector = "app=my-super-app" remove_statefulset("mystatefulset", label_selector=label_selector) assert v1.delete_namespaced_stateful_set.call_count == 1 v1.delete_namespaced_stateful_set.assert_called_with( "mystatefulset", "default", body=ANY) @patch('chaosk8s.has_local_config_file', autospec=True) @patch('chaosk8s.statefulset.actions.client', autospec=True) @patch('chaosk8s.client') def test_creating_statefulset_with_file_json(cl, client, has_conf): has_conf.return_value = False body = "example of body" v1 = MagicMock() client.AppsV1Api.return_value = v1 create_statefulset("tests/fixtures/statefulset/create/file.json") assert v1.create_namespaced_stateful_set.call_count == 1 v1.create_namespaced_stateful_set.assert_called_with( "default", body=body) @patch('chaosk8s.has_local_config_file', autospec=True) @patch('chaosk8s.statefulset.actions.client', autospec=True) @patch('chaosk8s.client') def test_creating_statefulset_with_file_yaml(cl, client, has_conf): has_conf.return_value = False body = "example of body" v1 = MagicMock() client.AppsV1Api.return_value = v1 create_statefulset("tests/fixtures/statefulset/create/file.yaml") assert v1.create_namespaced_stateful_set.call_count == 1 v1.create_namespaced_stateful_set.assert_called_with( "default", body=body) @patch('chaosk8s.has_local_config_file', autospec=True) @patch('chaosk8s.statefulset.actions.client', autospec=True) @patch('chaosk8s.client') def test_creating_statefulset_with_file_txt_KO(cl, client, has_conf): has_conf.return_value = False path = "tests/fixtures/statefulset/create/file.txt" v1 = MagicMock() client.AppsV1Api.return_value = v1 with pytest.raises(ActivityFailed) as excinfo: create_statefulset(path) assert "cannot process {path}".format(path=path) in str(excinfo.value)
result.items[0].metadata.labels.app = "my-super-app" v1.list_namespaced_stateful_set.return_value = result
pullrequest_update.go
// Code generated by entc, DO NOT EDIT. package ent import ( "context" "fmt" "time" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/google/uuid" "github.com/shinnosuke-K/github-dev-insight/ent/commits" "github.com/shinnosuke-K/github-dev-insight/ent/predicate" "github.com/shinnosuke-K/github-dev-insight/ent/pullrequest" "github.com/shinnosuke-K/github-dev-insight/ent/repository" ) // PullRequestUpdate is the builder for updating PullRequest entities. type PullRequestUpdate struct { config hooks []Hook mutation *PullRequestMutation } // Where appends a list predicates to the PullRequestUpdate builder. func (pru *PullRequestUpdate) Where(ps ...predicate.PullRequest) *PullRequestUpdate { pru.mutation.Where(ps...) return pru } // SetGithubID sets the "github_id" field. func (pru *PullRequestUpdate) SetGithubID(s string) *PullRequestUpdate { pru.mutation.SetGithubID(s) return pru } // SetTitle sets the "title" field. func (pru *PullRequestUpdate) SetTitle(s string) *PullRequestUpdate { pru.mutation.SetTitle(s) return pru } // SetTotalCommits sets the "total_commits" field. func (pru *PullRequestUpdate) SetTotalCommits(i int64) *PullRequestUpdate { pru.mutation.ResetTotalCommits() pru.mutation.SetTotalCommits(i) return pru } // SetNillableTotalCommits sets the "total_commits" field if the given value is not nil. func (pru *PullRequestUpdate) SetNillableTotalCommits(i *int64) *PullRequestUpdate { if i != nil { pru.SetTotalCommits(*i) } return pru } // AddTotalCommits adds i to the "total_commits" field. func (pru *PullRequestUpdate) AddTotalCommits(i int64) *PullRequestUpdate { pru.mutation.AddTotalCommits(i) return pru } // SetGetCommit sets the "get_commit" field. func (pru *PullRequestUpdate) SetGetCommit(b bool) *PullRequestUpdate { pru.mutation.SetGetCommit(b) return pru } // SetNillableGetCommit sets the "get_commit" field if the given value is not nil. func (pru *PullRequestUpdate) SetNillableGetCommit(b *bool) *PullRequestUpdate { if b != nil { pru.SetGetCommit(*b) } return pru } // SetCreatedAt sets the "created_at" field. func (pru *PullRequestUpdate) SetCreatedAt(t time.Time) *PullRequestUpdate { pru.mutation.SetCreatedAt(t) return pru } // SetNillableCreatedAt sets the "created_at" field if the given value is not nil. func (pru *PullRequestUpdate) SetNillableCreatedAt(t *time.Time) *PullRequestUpdate { if t != nil { pru.SetCreatedAt(*t) } return pru } // SetUpdatedAt sets the "updated_at" field. func (pru *PullRequestUpdate) SetUpdatedAt(t time.Time) *PullRequestUpdate { pru.mutation.SetUpdatedAt(t) return pru } // SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. func (pru *PullRequestUpdate) SetNillableUpdatedAt(t *time.Time) *PullRequestUpdate { if t != nil { pru.SetUpdatedAt(*t) } return pru } // SetClosedAt sets the "closed_at" field. func (pru *PullRequestUpdate) SetClosedAt(t time.Time) *PullRequestUpdate { pru.mutation.SetClosedAt(t) return pru } // SetNillableClosedAt sets the "closed_at" field if the given value is not nil. func (pru *PullRequestUpdate) SetNillableClosedAt(t *time.Time) *PullRequestUpdate { if t != nil { pru.SetClosedAt(*t) } return pru } // ClearClosedAt clears the value of the "closed_at" field. func (pru *PullRequestUpdate) ClearClosedAt() *PullRequestUpdate { pru.mutation.ClearClosedAt() return pru } // SetMergedAt sets the "merged_at" field. func (pru *PullRequestUpdate) SetMergedAt(t time.Time) *PullRequestUpdate { pru.mutation.SetMergedAt(t) return pru } // SetNillableMergedAt sets the "merged_at" field if the given value is not nil. func (pru *PullRequestUpdate) SetNillableMergedAt(t *time.Time) *PullRequestUpdate { if t != nil { pru.SetMergedAt(*t) } return pru } // ClearMergedAt clears the value of the "merged_at" field. func (pru *PullRequestUpdate) ClearMergedAt() *PullRequestUpdate { pru.mutation.ClearMergedAt() return pru } // AddCommitIDs adds the "commits" edge to the Commits entity by IDs. func (pru *PullRequestUpdate) AddCommitIDs(ids ...uuid.UUID) *PullRequestUpdate { pru.mutation.AddCommitIDs(ids...) return pru } // AddCommits adds the "commits" edges to the Commits entity. func (pru *PullRequestUpdate) AddCommits(c ...*Commits) *PullRequestUpdate { ids := make([]uuid.UUID, len(c)) for i := range c { ids[i] = c[i].ID } return pru.AddCommitIDs(ids...) } // SetRepositoryID sets the "repository" edge to the Repository entity by ID. func (pru *PullRequestUpdate) SetRepositoryID(id uuid.UUID) *PullRequestUpdate { pru.mutation.SetRepositoryID(id) return pru } // SetNillableRepositoryID sets the "repository" edge to the Repository entity by ID if the given value is not nil. func (pru *PullRequestUpdate) SetNillableRepositoryID(id *uuid.UUID) *PullRequestUpdate { if id != nil { pru = pru.SetRepositoryID(*id) } return pru } // SetRepository sets the "repository" edge to the Repository entity. func (pru *PullRequestUpdate) SetRepository(r *Repository) *PullRequestUpdate { return pru.SetRepositoryID(r.ID) } // Mutation returns the PullRequestMutation object of the builder. func (pru *PullRequestUpdate) Mutation() *PullRequestMutation { return pru.mutation } // ClearCommits clears all "commits" edges to the Commits entity. func (pru *PullRequestUpdate) ClearCommits() *PullRequestUpdate { pru.mutation.ClearCommits() return pru } // RemoveCommitIDs removes the "commits" edge to Commits entities by IDs. func (pru *PullRequestUpdate) RemoveCommitIDs(ids ...uuid.UUID) *PullRequestUpdate { pru.mutation.RemoveCommitIDs(ids...) return pru } // RemoveCommits removes "commits" edges to Commits entities. func (pru *PullRequestUpdate) RemoveCommits(c ...*Commits) *PullRequestUpdate { ids := make([]uuid.UUID, len(c)) for i := range c { ids[i] = c[i].ID } return pru.RemoveCommitIDs(ids...) } // ClearRepository clears the "repository" edge to the Repository entity. func (pru *PullRequestUpdate) ClearRepository() *PullRequestUpdate { pru.mutation.ClearRepository() return pru } // Save executes the query and returns the number of nodes affected by the update operation. func (pru *PullRequestUpdate) Save(ctx context.Context) (int, error) { var ( err error affected int ) if len(pru.hooks) == 0 { if err = pru.check(); err != nil { return 0, err } affected, err = pru.sqlSave(ctx) } else { var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { mutation, ok := m.(*PullRequestMutation) if !ok { return nil, fmt.Errorf("unexpected mutation type %T", m) } if err = pru.check(); err != nil { return 0, err } pru.mutation = mutation affected, err = pru.sqlSave(ctx) mutation.done = true return affected, err }) for i := len(pru.hooks) - 1; i >= 0; i-- { if pru.hooks[i] == nil { return 0, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)") } mut = pru.hooks[i](mut) } if _, err := mut.Mutate(ctx, pru.mutation); err != nil { return 0, err } } return affected, err } // SaveX is like Save, but panics if an error occurs. func (pru *PullRequestUpdate) SaveX(ctx context.Context) int { affected, err := pru.Save(ctx) if err != nil { panic(err) } return affected } // Exec executes the query. func (pru *PullRequestUpdate) Exec(ctx context.Context) error { _, err := pru.Save(ctx) return err } // ExecX is like Exec, but panics if an error occurs. func (pru *PullRequestUpdate) ExecX(ctx context.Context) { if err := pru.Exec(ctx); err != nil { panic(err) } } // check runs all checks and user-defined validators on the builder. func (pru *PullRequestUpdate) check() error { if v, ok := pru.mutation.GithubID(); ok { if err := pullrequest.GithubIDValidator(v); err != nil { return &ValidationError{Name: "github_id", err: fmt.Errorf("ent: validator failed for field \"github_id\": %w", err)} } } if v, ok := pru.mutation.Title(); ok { if err := pullrequest.TitleValidator(v); err != nil { return &ValidationError{Name: "title", err: fmt.Errorf("ent: validator failed for field \"title\": %w", err)} } } if v, ok := pru.mutation.TotalCommits(); ok { if err := pullrequest.TotalCommitsValidator(v); err != nil { return &ValidationError{Name: "total_commits", err: fmt.Errorf("ent: validator failed for field \"total_commits\": %w", err)} } } return nil } func (pru *PullRequestUpdate) sqlSave(ctx context.Context) (n int, err error) { _spec := &sqlgraph.UpdateSpec{ Node: &sqlgraph.NodeSpec{ Table: pullrequest.Table, Columns: pullrequest.Columns, ID: &sqlgraph.FieldSpec{ Type: field.TypeUUID, Column: pullrequest.FieldID, }, }, } if ps := pru.mutation.predicates; len(ps) > 0 { _spec.Predicate = func(selector *sql.Selector) { for i := range ps { ps[i](selector) } } } if value, ok := pru.mutation.GithubID(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeString, Value: value, Column: pullrequest.FieldGithubID, }) } if value, ok := pru.mutation.Title(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeString, Value: value, Column: pullrequest.FieldTitle, }) } if value, ok := pru.mutation.TotalCommits(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeInt64, Value: value, Column: pullrequest.FieldTotalCommits, }) } if value, ok := pru.mutation.AddedTotalCommits(); ok { _spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{ Type: field.TypeInt64, Value: value, Column: pullrequest.FieldTotalCommits, }) } if value, ok := pru.mutation.GetCommit(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeBool, Value: value, Column: pullrequest.FieldGetCommit, }) } if value, ok := pru.mutation.CreatedAt(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeTime, Value: value, Column: pullrequest.FieldCreatedAt, }) } if value, ok := pru.mutation.UpdatedAt(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeTime, Value: value, Column: pullrequest.FieldUpdatedAt, }) } if value, ok := pru.mutation.ClosedAt(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeTime, Value: value, Column: pullrequest.FieldClosedAt, }) } if pru.mutation.ClosedAtCleared() { _spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{ Type: field.TypeTime, Column: pullrequest.FieldClosedAt, }) } if value, ok := pru.mutation.MergedAt(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeTime, Value: value, Column: pullrequest.FieldMergedAt, }) } if pru.mutation.MergedAtCleared() { _spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{ Type: field.TypeTime, Column: pullrequest.FieldMergedAt, }) } if pru.mutation.CommitsCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, Inverse: false, Table: pullrequest.CommitsTable, Columns: []string{pullrequest.CommitsColumn}, Bidi: false, Target: &sqlgraph.EdgeTarget{ IDSpec: &sqlgraph.FieldSpec{ Type: field.TypeUUID, Column: commits.FieldID, }, }, } _spec.Edges.Clear = append(_spec.Edges.Clear, edge) } if nodes := pru.mutation.RemovedCommitsIDs(); len(nodes) > 0 && !pru.mutation.CommitsCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, Inverse: false, Table: pullrequest.CommitsTable, Columns: []string{pullrequest.CommitsColumn}, Bidi: false, Target: &sqlgraph.EdgeTarget{ IDSpec: &sqlgraph.FieldSpec{ Type: field.TypeUUID, Column: commits.FieldID, }, }, } for _, k := range nodes { edge.Target.Nodes = append(edge.Target.Nodes, k) } _spec.Edges.Clear = append(_spec.Edges.Clear, edge) } if nodes := pru.mutation.CommitsIDs(); len(nodes) > 0 { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, Inverse: false, Table: pullrequest.CommitsTable, Columns: []string{pullrequest.CommitsColumn}, Bidi: false, Target: &sqlgraph.EdgeTarget{ IDSpec: &sqlgraph.FieldSpec{ Type: field.TypeUUID, Column: commits.FieldID, }, }, } for _, k := range nodes { edge.Target.Nodes = append(edge.Target.Nodes, k) } _spec.Edges.Add = append(_spec.Edges.Add, edge) } if pru.mutation.RepositoryCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.M2O, Inverse: true, Table: pullrequest.RepositoryTable, Columns: []string{pullrequest.RepositoryColumn}, Bidi: false, Target: &sqlgraph.EdgeTarget{ IDSpec: &sqlgraph.FieldSpec{ Type: field.TypeUUID, Column: repository.FieldID, }, }, } _spec.Edges.Clear = append(_spec.Edges.Clear, edge) } if nodes := pru.mutation.RepositoryIDs(); len(nodes) > 0
if n, err = sqlgraph.UpdateNodes(ctx, pru.driver, _spec); err != nil { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pullrequest.Label} } else if sqlgraph.IsConstraintError(err) { err = &ConstraintError{err.Error(), err} } return 0, err } return n, nil } // PullRequestUpdateOne is the builder for updating a single PullRequest entity. type PullRequestUpdateOne struct { config fields []string hooks []Hook mutation *PullRequestMutation } // SetGithubID sets the "github_id" field. func (pruo *PullRequestUpdateOne) SetGithubID(s string) *PullRequestUpdateOne { pruo.mutation.SetGithubID(s) return pruo } // SetTitle sets the "title" field. func (pruo *PullRequestUpdateOne) SetTitle(s string) *PullRequestUpdateOne { pruo.mutation.SetTitle(s) return pruo } // SetTotalCommits sets the "total_commits" field. func (pruo *PullRequestUpdateOne) SetTotalCommits(i int64) *PullRequestUpdateOne { pruo.mutation.ResetTotalCommits() pruo.mutation.SetTotalCommits(i) return pruo } // SetNillableTotalCommits sets the "total_commits" field if the given value is not nil. func (pruo *PullRequestUpdateOne) SetNillableTotalCommits(i *int64) *PullRequestUpdateOne { if i != nil { pruo.SetTotalCommits(*i) } return pruo } // AddTotalCommits adds i to the "total_commits" field. func (pruo *PullRequestUpdateOne) AddTotalCommits(i int64) *PullRequestUpdateOne { pruo.mutation.AddTotalCommits(i) return pruo } // SetGetCommit sets the "get_commit" field. func (pruo *PullRequestUpdateOne) SetGetCommit(b bool) *PullRequestUpdateOne { pruo.mutation.SetGetCommit(b) return pruo } // SetNillableGetCommit sets the "get_commit" field if the given value is not nil. func (pruo *PullRequestUpdateOne) SetNillableGetCommit(b *bool) *PullRequestUpdateOne { if b != nil { pruo.SetGetCommit(*b) } return pruo } // SetCreatedAt sets the "created_at" field. func (pruo *PullRequestUpdateOne) SetCreatedAt(t time.Time) *PullRequestUpdateOne { pruo.mutation.SetCreatedAt(t) return pruo } // SetNillableCreatedAt sets the "created_at" field if the given value is not nil. func (pruo *PullRequestUpdateOne) SetNillableCreatedAt(t *time.Time) *PullRequestUpdateOne { if t != nil { pruo.SetCreatedAt(*t) } return pruo } // SetUpdatedAt sets the "updated_at" field. func (pruo *PullRequestUpdateOne) SetUpdatedAt(t time.Time) *PullRequestUpdateOne { pruo.mutation.SetUpdatedAt(t) return pruo } // SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. func (pruo *PullRequestUpdateOne) SetNillableUpdatedAt(t *time.Time) *PullRequestUpdateOne { if t != nil { pruo.SetUpdatedAt(*t) } return pruo } // SetClosedAt sets the "closed_at" field. func (pruo *PullRequestUpdateOne) SetClosedAt(t time.Time) *PullRequestUpdateOne { pruo.mutation.SetClosedAt(t) return pruo } // SetNillableClosedAt sets the "closed_at" field if the given value is not nil. func (pruo *PullRequestUpdateOne) SetNillableClosedAt(t *time.Time) *PullRequestUpdateOne { if t != nil { pruo.SetClosedAt(*t) } return pruo } // ClearClosedAt clears the value of the "closed_at" field. func (pruo *PullRequestUpdateOne) ClearClosedAt() *PullRequestUpdateOne { pruo.mutation.ClearClosedAt() return pruo } // SetMergedAt sets the "merged_at" field. func (pruo *PullRequestUpdateOne) SetMergedAt(t time.Time) *PullRequestUpdateOne { pruo.mutation.SetMergedAt(t) return pruo } // SetNillableMergedAt sets the "merged_at" field if the given value is not nil. func (pruo *PullRequestUpdateOne) SetNillableMergedAt(t *time.Time) *PullRequestUpdateOne { if t != nil { pruo.SetMergedAt(*t) } return pruo } // ClearMergedAt clears the value of the "merged_at" field. func (pruo *PullRequestUpdateOne) ClearMergedAt() *PullRequestUpdateOne { pruo.mutation.ClearMergedAt() return pruo } // AddCommitIDs adds the "commits" edge to the Commits entity by IDs. func (pruo *PullRequestUpdateOne) AddCommitIDs(ids ...uuid.UUID) *PullRequestUpdateOne { pruo.mutation.AddCommitIDs(ids...) return pruo } // AddCommits adds the "commits" edges to the Commits entity. func (pruo *PullRequestUpdateOne) AddCommits(c ...*Commits) *PullRequestUpdateOne { ids := make([]uuid.UUID, len(c)) for i := range c { ids[i] = c[i].ID } return pruo.AddCommitIDs(ids...) } // SetRepositoryID sets the "repository" edge to the Repository entity by ID. func (pruo *PullRequestUpdateOne) SetRepositoryID(id uuid.UUID) *PullRequestUpdateOne { pruo.mutation.SetRepositoryID(id) return pruo } // SetNillableRepositoryID sets the "repository" edge to the Repository entity by ID if the given value is not nil. func (pruo *PullRequestUpdateOne) SetNillableRepositoryID(id *uuid.UUID) *PullRequestUpdateOne { if id != nil { pruo = pruo.SetRepositoryID(*id) } return pruo } // SetRepository sets the "repository" edge to the Repository entity. func (pruo *PullRequestUpdateOne) SetRepository(r *Repository) *PullRequestUpdateOne { return pruo.SetRepositoryID(r.ID) } // Mutation returns the PullRequestMutation object of the builder. func (pruo *PullRequestUpdateOne) Mutation() *PullRequestMutation { return pruo.mutation } // ClearCommits clears all "commits" edges to the Commits entity. func (pruo *PullRequestUpdateOne) ClearCommits() *PullRequestUpdateOne { pruo.mutation.ClearCommits() return pruo } // RemoveCommitIDs removes the "commits" edge to Commits entities by IDs. func (pruo *PullRequestUpdateOne) RemoveCommitIDs(ids ...uuid.UUID) *PullRequestUpdateOne { pruo.mutation.RemoveCommitIDs(ids...) return pruo } // RemoveCommits removes "commits" edges to Commits entities. func (pruo *PullRequestUpdateOne) RemoveCommits(c ...*Commits) *PullRequestUpdateOne { ids := make([]uuid.UUID, len(c)) for i := range c { ids[i] = c[i].ID } return pruo.RemoveCommitIDs(ids...) } // ClearRepository clears the "repository" edge to the Repository entity. func (pruo *PullRequestUpdateOne) ClearRepository() *PullRequestUpdateOne { pruo.mutation.ClearRepository() return pruo } // Select allows selecting one or more fields (columns) of the returned entity. // The default is selecting all fields defined in the entity schema. func (pruo *PullRequestUpdateOne) Select(field string, fields ...string) *PullRequestUpdateOne { pruo.fields = append([]string{field}, fields...) return pruo } // Save executes the query and returns the updated PullRequest entity. func (pruo *PullRequestUpdateOne) Save(ctx context.Context) (*PullRequest, error) { var ( err error node *PullRequest ) if len(pruo.hooks) == 0 { if err = pruo.check(); err != nil { return nil, err } node, err = pruo.sqlSave(ctx) } else { var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { mutation, ok := m.(*PullRequestMutation) if !ok { return nil, fmt.Errorf("unexpected mutation type %T", m) } if err = pruo.check(); err != nil { return nil, err } pruo.mutation = mutation node, err = pruo.sqlSave(ctx) mutation.done = true return node, err }) for i := len(pruo.hooks) - 1; i >= 0; i-- { if pruo.hooks[i] == nil { return nil, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)") } mut = pruo.hooks[i](mut) } if _, err := mut.Mutate(ctx, pruo.mutation); err != nil { return nil, err } } return node, err } // SaveX is like Save, but panics if an error occurs. func (pruo *PullRequestUpdateOne) SaveX(ctx context.Context) *PullRequest { node, err := pruo.Save(ctx) if err != nil { panic(err) } return node } // Exec executes the query on the entity. func (pruo *PullRequestUpdateOne) Exec(ctx context.Context) error { _, err := pruo.Save(ctx) return err } // ExecX is like Exec, but panics if an error occurs. func (pruo *PullRequestUpdateOne) ExecX(ctx context.Context) { if err := pruo.Exec(ctx); err != nil { panic(err) } } // check runs all checks and user-defined validators on the builder. func (pruo *PullRequestUpdateOne) check() error { if v, ok := pruo.mutation.GithubID(); ok { if err := pullrequest.GithubIDValidator(v); err != nil { return &ValidationError{Name: "github_id", err: fmt.Errorf("ent: validator failed for field \"github_id\": %w", err)} } } if v, ok := pruo.mutation.Title(); ok { if err := pullrequest.TitleValidator(v); err != nil { return &ValidationError{Name: "title", err: fmt.Errorf("ent: validator failed for field \"title\": %w", err)} } } if v, ok := pruo.mutation.TotalCommits(); ok { if err := pullrequest.TotalCommitsValidator(v); err != nil { return &ValidationError{Name: "total_commits", err: fmt.Errorf("ent: validator failed for field \"total_commits\": %w", err)} } } return nil } func (pruo *PullRequestUpdateOne) sqlSave(ctx context.Context) (_node *PullRequest, err error) { _spec := &sqlgraph.UpdateSpec{ Node: &sqlgraph.NodeSpec{ Table: pullrequest.Table, Columns: pullrequest.Columns, ID: &sqlgraph.FieldSpec{ Type: field.TypeUUID, Column: pullrequest.FieldID, }, }, } id, ok := pruo.mutation.ID() if !ok { return nil, &ValidationError{Name: "ID", err: fmt.Errorf("missing PullRequest.ID for update")} } _spec.Node.ID.Value = id if fields := pruo.fields; len(fields) > 0 { _spec.Node.Columns = make([]string, 0, len(fields)) _spec.Node.Columns = append(_spec.Node.Columns, pullrequest.FieldID) for _, f := range fields { if !pullrequest.ValidColumn(f) { return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)} } if f != pullrequest.FieldID { _spec.Node.Columns = append(_spec.Node.Columns, f) } } } if ps := pruo.mutation.predicates; len(ps) > 0 { _spec.Predicate = func(selector *sql.Selector) { for i := range ps { ps[i](selector) } } } if value, ok := pruo.mutation.GithubID(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeString, Value: value, Column: pullrequest.FieldGithubID, }) } if value, ok := pruo.mutation.Title(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeString, Value: value, Column: pullrequest.FieldTitle, }) } if value, ok := pruo.mutation.TotalCommits(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeInt64, Value: value, Column: pullrequest.FieldTotalCommits, }) } if value, ok := pruo.mutation.AddedTotalCommits(); ok { _spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{ Type: field.TypeInt64, Value: value, Column: pullrequest.FieldTotalCommits, }) } if value, ok := pruo.mutation.GetCommit(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeBool, Value: value, Column: pullrequest.FieldGetCommit, }) } if value, ok := pruo.mutation.CreatedAt(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeTime, Value: value, Column: pullrequest.FieldCreatedAt, }) } if value, ok := pruo.mutation.UpdatedAt(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeTime, Value: value, Column: pullrequest.FieldUpdatedAt, }) } if value, ok := pruo.mutation.ClosedAt(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeTime, Value: value, Column: pullrequest.FieldClosedAt, }) } if pruo.mutation.ClosedAtCleared() { _spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{ Type: field.TypeTime, Column: pullrequest.FieldClosedAt, }) } if value, ok := pruo.mutation.MergedAt(); ok { _spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{ Type: field.TypeTime, Value: value, Column: pullrequest.FieldMergedAt, }) } if pruo.mutation.MergedAtCleared() { _spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{ Type: field.TypeTime, Column: pullrequest.FieldMergedAt, }) } if pruo.mutation.CommitsCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, Inverse: false, Table: pullrequest.CommitsTable, Columns: []string{pullrequest.CommitsColumn}, Bidi: false, Target: &sqlgraph.EdgeTarget{ IDSpec: &sqlgraph.FieldSpec{ Type: field.TypeUUID, Column: commits.FieldID, }, }, } _spec.Edges.Clear = append(_spec.Edges.Clear, edge) } if nodes := pruo.mutation.RemovedCommitsIDs(); len(nodes) > 0 && !pruo.mutation.CommitsCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, Inverse: false, Table: pullrequest.CommitsTable, Columns: []string{pullrequest.CommitsColumn}, Bidi: false, Target: &sqlgraph.EdgeTarget{ IDSpec: &sqlgraph.FieldSpec{ Type: field.TypeUUID, Column: commits.FieldID, }, }, } for _, k := range nodes { edge.Target.Nodes = append(edge.Target.Nodes, k) } _spec.Edges.Clear = append(_spec.Edges.Clear, edge) } if nodes := pruo.mutation.CommitsIDs(); len(nodes) > 0 { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.O2M, Inverse: false, Table: pullrequest.CommitsTable, Columns: []string{pullrequest.CommitsColumn}, Bidi: false, Target: &sqlgraph.EdgeTarget{ IDSpec: &sqlgraph.FieldSpec{ Type: field.TypeUUID, Column: commits.FieldID, }, }, } for _, k := range nodes { edge.Target.Nodes = append(edge.Target.Nodes, k) } _spec.Edges.Add = append(_spec.Edges.Add, edge) } if pruo.mutation.RepositoryCleared() { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.M2O, Inverse: true, Table: pullrequest.RepositoryTable, Columns: []string{pullrequest.RepositoryColumn}, Bidi: false, Target: &sqlgraph.EdgeTarget{ IDSpec: &sqlgraph.FieldSpec{ Type: field.TypeUUID, Column: repository.FieldID, }, }, } _spec.Edges.Clear = append(_spec.Edges.Clear, edge) } if nodes := pruo.mutation.RepositoryIDs(); len(nodes) > 0 { edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.M2O, Inverse: true, Table: pullrequest.RepositoryTable, Columns: []string{pullrequest.RepositoryColumn}, Bidi: false, Target: &sqlgraph.EdgeTarget{ IDSpec: &sqlgraph.FieldSpec{ Type: field.TypeUUID, Column: repository.FieldID, }, }, } for _, k := range nodes { edge.Target.Nodes = append(edge.Target.Nodes, k) } _spec.Edges.Add = append(_spec.Edges.Add, edge) } _node = &PullRequest{config: pruo.config} _spec.Assign = _node.assignValues _spec.ScanValues = _node.scanValues if err = sqlgraph.UpdateNode(ctx, pruo.driver, _spec); err != nil { if _, ok := err.(*sqlgraph.NotFoundError); ok { err = &NotFoundError{pullrequest.Label} } else if sqlgraph.IsConstraintError(err) { err = &ConstraintError{err.Error(), err} } return nil, err } return _node, nil }
{ edge := &sqlgraph.EdgeSpec{ Rel: sqlgraph.M2O, Inverse: true, Table: pullrequest.RepositoryTable, Columns: []string{pullrequest.RepositoryColumn}, Bidi: false, Target: &sqlgraph.EdgeTarget{ IDSpec: &sqlgraph.FieldSpec{ Type: field.TypeUUID, Column: repository.FieldID, }, }, } for _, k := range nodes { edge.Target.Nodes = append(edge.Target.Nodes, k) } _spec.Edges.Add = append(_spec.Edges.Add, edge) }
getVirtualMachineExtension.go
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package v20191201 import ( "github.com/pulumi/pulumi/sdk/v2/go/pulumi" ) func LookupVirtualMachineExtension(ctx *pulumi.Context, args *LookupVirtualMachineExtensionArgs, opts ...pulumi.InvokeOption) (*LookupVirtualMachineExtensionResult, error)
type LookupVirtualMachineExtensionArgs struct { // The expand expression to apply on the operation. Expand *string `pulumi:"expand"` // The name of the resource group. ResourceGroupName string `pulumi:"resourceGroupName"` // The name of the virtual machine extension. VmExtensionName string `pulumi:"vmExtensionName"` // The name of the virtual machine containing the extension. VmName string `pulumi:"vmName"` } // Describes a Virtual Machine Extension. type LookupVirtualMachineExtensionResult struct { // Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. AutoUpgradeMinorVersion *bool `pulumi:"autoUpgradeMinorVersion"` // How the extension handler should be forced to update even if the extension configuration has not changed. ForceUpdateTag *string `pulumi:"forceUpdateTag"` // The virtual machine extension instance view. InstanceView *VirtualMachineExtensionInstanceViewResponse `pulumi:"instanceView"` // Resource location Location string `pulumi:"location"` // Resource name Name string `pulumi:"name"` // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. ProtectedSettings interface{} `pulumi:"protectedSettings"` // The provisioning state, which only appears in the response. ProvisioningState string `pulumi:"provisioningState"` // The name of the extension handler publisher. Publisher *string `pulumi:"publisher"` // Json formatted public settings for the extension. Settings interface{} `pulumi:"settings"` // Resource tags Tags map[string]string `pulumi:"tags"` // Resource type Type string `pulumi:"type"` // Specifies the version of the script handler. TypeHandlerVersion *string `pulumi:"typeHandlerVersion"` }
{ var rv LookupVirtualMachineExtensionResult err := ctx.Invoke("azure-nextgen:compute/v20191201:getVirtualMachineExtension", args, &rv, opts...) if err != nil { return nil, err } return &rv, nil }
rule.js
import { parse } from 'url'; // mock tableListDataSource let tableListDataSource = []; for (let i = 0; i < 46; i += 1) { tableListDataSource.push({ key: i, disabled: i % 6 === 0, href: 'https://ant.design', avatar: [ 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', ][i % 2], no: `TradeCode ${i}`, title: `【Python实战】手把手超详细教程教你Scrapy爬达盖尔社区,有彩蛋`, owner: '曲丽丽', description: '这是一段描述', callNo: Math.floor(Math.random() * 1000), reward: Math.floor(Math.random() * 1000), status: Math.floor(Math.random() * 10) % 4, updatedAt: new Date(`2017-07-${Math.floor(i / 2) + 1}`), createdAt: new Date(`2017-07-${Math.floor(i / 2) + 1}`), progress: Math.ceil(Math.random() * 100), }); } export function getRule(req, res, u) { let url = u; if (!url || Object.prototype.toString.call(url) !== '[object String]') { url = req.url; // eslint-disable-line } const params = parse(url, true).query; let dataSource = [...tableListDataSource]; if (params.sorter) {
} return prev[s[0]] - next[s[0]]; }); } if (params.status) { const status = params.status.split(','); let filterDataSource = []; status.forEach(s => { filterDataSource = filterDataSource.concat( [...dataSource].filter(data => parseInt(data.status, 10) === parseInt(s[0], 10)) ); }); dataSource = filterDataSource; } if (params.no) { dataSource = dataSource.filter(data => data.no.indexOf(params.no) > -1); } let pageSize = 10; if (params.pageSize) { pageSize = params.pageSize * 1; } const result = { list: dataSource, pagination: { total: dataSource.length, pageSize, current: parseInt(params.currentPage, 10) || 1, }, }; if (res && res.json) { res.json(result); } else { return result; } } export function postRule(req, res, u, b) { let url = u; if (!url || Object.prototype.toString.call(url) !== '[object String]') { url = req.url; // eslint-disable-line } const body = (b && b.body) || req.body; const { method, no, description } = body; switch (method) { /* eslint no-case-declarations:0 */ case 'delete': tableListDataSource = tableListDataSource.filter(item => no.indexOf(item.no) === -1); break; case 'post': const i = Math.ceil(Math.random() * 10000); tableListDataSource.unshift({ key: i, href: 'https://ant.design', avatar: [ 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', ][i % 2], no: `TradeCode ${i}`, title: `一个任务名称 ${i}`, owner: '曲丽丽', description, callNo: Math.floor(Math.random() * 1000), status: Math.floor(Math.random() * 10) % 2, updatedAt: new Date(), createdAt: new Date(), progress: Math.ceil(Math.random() * 100), }); break; default: break; } const result = { list: tableListDataSource, pagination: { total: tableListDataSource.length, }, }; if (res && res.json) { res.json(result); } else { return result; } } export default { getRule, postRule, };
const s = params.sorter.split('_'); dataSource = dataSource.sort((prev, next) => { if (s[1] === 'descend') { return next[s[0]] - prev[s[0]];
http-auth.service.ts
import { Injectable } from '@angular/core'; import { Observable, Subject } from 'rxjs/Rx'; import { DummyWorkService } from '../../../../core'; import { AuthService, Principal } from '../../contract'; import { HttpPrincipal } from './http-principal'; import { PrincipalsService } from './principals.service'; import { UserSession } from './user-session'; @Injectable() export class HttpAuthService implements AuthService { public currentPrincipal: Observable<Principal>; private readonly loginAttempt = new Subject<HttpPrincipal>(); public constructor( private readonly principalsService: PrincipalsService, private readonly userSession: UserSession, private readonly dummyWorkService: DummyWorkService ) { this.currentPrincipal = this.userSession.currentPrincipal .map(httpPrincipal => { return httpPrincipal ? { login: httpPrincipal.login, userId: httpPrincipal.userId } : null; }); this.loginAttempt .filter(principal => principal != null) .subscribe(principal => this.userSession.beginSession(principal)); } public login(userName: string, password: string): Observable<boolean> { const result: Observable<boolean> = this.principalsService .getPrincipal({ login: userName, password }) .do(principal => this.loginAttempt.next(principal)) .map(principal => principal != null);
public logout(): Observable<void> { const result: Observable<void> = Observable .of(null) .do(() => this.userSession.endSession()); return this.dummyWorkService.workOn(result); } public IsAuthenticated(): boolean { return this.userSession.hasSession(); } }
return this.dummyWorkService.workOn(result); }
tagsView.js
/* * @Author: Hzh * @Date: 2020-07-22 18:16:18 * @LastEditTime: 2020-08-05 16:01:57 * @LastEditors: Hzh * @Description:标签操作 */ import { sessionData } from '@/utils/storage' const state = { visitedViews: sessionData('get', 'visitedViews') || [], // 用户访问过的页面 就是标签栏导航显示的一个个 tag 数组集合 对象数组 cachedViews: sessionData('get', 'cachedViews') || [] // 实际 keep-alive 的路由。可以在配置路由的时候通过 meta.noCache 来设置是否需要缓存这个路由 默认都缓存 普通数组 } const mutations = { /* 添加访问的视图 */ ADD_VISITED_VIEW: (state, view) => { // 如果已经存在此视图了,则不添加 if (state.visitedViews.some(v => v.path === view.path)) { return } state.visitedViews.push( Object.assign({}, view, { title: view.meta.title || 'no-name' // 避免标签没有title }) ) // 存到本地浏览器sessionStorage sessionData('set', 'visitedViews', state.visitedViews) }, /* 添加缓存的视图 */ ADD_CACHED_VIEW: (state, view) => { // 如果数组中已存在缓存的视图 if (state.cachedViews.includes(view.name)) return // 如果没有在router的meta里面设置不缓存 if (!view.meta.noCache) { state.cachedViews.push(view.name) // 存到本地浏览器sessionStorage sessionData('set', 'cachedViews', state.cachedViews) } }, /* 删除访问的视图 */ DEL_VISITED_VIEW: (state, view) => { // entries() 方法返回一个数组的迭代对象,该对象包含数组的键值对 (key/value)。 for (const [i, v] of state.visitedViews.entries()) { // console.log(i, v) if (v.path === view.path) { state.visitedViews.splice(i, 1) break } } sessionData('set', 'visitedViews', state.visitedViews) // 等效于 // for (let i = 0; i < state.visitedViews.length; i++) { // if (state.visitedViews[i].path === view.path) {
// state.visitedViews.splice(i, 1) // break // } // } }, /* 删除缓存的视图 */ DEL_CACHED_VIEW: (state, view) => { const index = state.cachedViews.indexOf(view.name) index > -1 && state.cachedViews.splice(index, 1) sessionData('set', 'cachedViews', state.cachedViews) }, /* 删除其他视图,除了在router设置了affix或当前选中的视图 */ DEL_OTHERS_VISITED_VIEWS: (state, view) => { state.visitedViews = state.visitedViews.filter(v => { return v.meta.affix || v.path === view.path }) sessionData('set', 'visitedViews', state.visitedViews) }, /* 删除其他缓存的视图,除了当前选中的缓存视图 */ DEL_OTHERS_CACHED_VIEWS: (state, view) => { const index = state.cachedViews.indexOf(view.name) if (index > -1) { state.cachedViews = state.cachedViews.slice(index, index + 1) // 等同于state.cachedViews = [view.name] } else { // 如果index = -1 则说明没有缓存的视图 state.cachedViews = [] } sessionData('set', 'cachedViews', state.cachedViews) }, /* 删除所有访问的视图,除了在router设置固定的标签栏 */ DEL_ALL_VISITED_VIEWS: state => { const affixTags = state.visitedViews.filter(tag => tag.meta.affix) state.visitedViews = affixTags sessionData('set', 'visitedViews', state.visitedViews) }, /* 删除所有缓存的视图 */ DEL_ALL_CACHED_VIEWS: state => { state.cachedViews = [] sessionData('set', 'cachedViews', state.cachedViews) }, /* 更新路由的传值 */ UPDATE_VISITED_VIEW: (state, view) => { for (let v of state.visitedViews) { if (v.path === view.path) { v = Object.assign(v, view) // 方法用于将所有可枚举属性的值从一个或多个源对象复制到目标对象。它将返回目标对象。 break } } sessionData('set', 'visitedViews', state.visitedViews) } } const actions = { /** * @description: 添加标签 * @param {Object} view 标签 */ addView({ dispatch }, view) { dispatch('addVisitedView', view) dispatch('addCachedView', view) }, /** * @description: 添加访问的视图 * @param {Object} view 标签 */ addVisitedView({ commit }, view) { commit('ADD_VISITED_VIEW', view) }, /** * @description: 添加缓存的视图 * @param {Object} view 标签 */ addCachedView({ commit }, view) { commit('ADD_CACHED_VIEW', view) }, /** * @description: 删除单个标签 * @param {Object} view 标签 */ delView({ dispatch, state }, view) { return new Promise(resolve => { dispatch('delVisitedView', view) dispatch('delCachedView', view) resolve({ visitedViews: [...state.visitedViews], cachedViews: [...state.cachedViews] }) }) }, /** * @description: 删除访问的视图 * @param {Object} view 标签 * @returns {Object} */ delVisitedView({ commit, state }, view) { return new Promise(resolve => { commit('DEL_VISITED_VIEW', view) resolve([...state.visitedViews]) }) }, /** * @description: 删除缓存的视图 * @param {Object} view 标签 * @returns {Object} */ delCachedView({ commit, state }, view) { return new Promise(resolve => { commit('DEL_CACHED_VIEW', view) resolve([...state.cachedViews]) }) }, /** * @description: 删除其他标签 * @param {Object} view 当前选中的标签 */ delOthersViews({ dispatch, state }, view) { return new Promise(resolve => { dispatch('delOthersVisitedViews', view) dispatch('delOthersCachedViews', view) resolve({ visitedViews: [...state.visitedViews], cachedViews: [...state.cachedViews] }) }) }, /** * @description: 删除其他视图 * @param {Object} view 标签 */ delOthersVisitedViews({ commit, state }, view) { return new Promise(resolve => { commit('DEL_OTHERS_VISITED_VIEWS', view) resolve([...state.visitedViews]) }) }, /** * @description: 删除缓存视图 * @param {Object} view 标签 */ delOthersCachedViews({ commit, state }, view) { return new Promise(resolve => { commit('DEL_OTHERS_CACHED_VIEWS', view) resolve([...state.cachedViews]) }) }, /** * @description: 删除所有标签 * @param {Object} view 当前选中的标签 */ delAllViews({ dispatch, state }, view) { return new Promise(resolve => { dispatch('delAllVisitedViews', view) dispatch('delAllCachedViews', view) resolve({ visitedViews: [...state.visitedViews], cachedViews: [...state.cachedViews] }) }) }, /** * @description: 删除所有访问的视图 * @param {Object} view 标签 */ delAllVisitedViews({ commit, state }) { return new Promise(resolve => { commit('DEL_ALL_VISITED_VIEWS') resolve([...state.visitedViews]) }) }, /** * @description: 删除所有缓存的视图 * @param {Object} view 标签 * @returns {Object} */ delAllCachedViews({ commit, state }) { return new Promise(resolve => { commit('DEL_ALL_CACHED_VIEWS') resolve([...state.cachedViews]) }) }, /** * @description: 更新路由的传值 * @param {Object} view 当前的路由 */ updateVisitedView({ commit }, view) { commit('UPDATE_VISITED_VIEW', view) } } export default { namespaced: true, state, mutations, actions }
xdr.rs
#![crate_id = "xdr#0.1"] #![crate_type = "lib"] //! Implementation of unpacking routines for External Data Representation (XDR) format. //! Follows the RFC at https://tools.ietf.org/html/rfc4506 //! To Do: //! - Implement quadruple precision floats //! - Implement structs and unions //! Copyright 2014 Charith Ellawala: charith {at} lucideelectricdreams {dot} com pub mod xdr { use std::io::{MemReader,IoResult}; use std::str; use std::vec::Vec; pub type XdrResult<T> = Result<T,&'static str>; static PADDING_MULTIPLE:uint = 4; /// Struct holding a buffer of bytes encoded using XDR pub struct Xdr { reader: MemReader } pub trait XdrPrimitive { fn read_from_xdr(x: &mut Xdr, _: Option<Self>) -> XdrResult<Self>; } impl XdrPrimitive for u32 { fn read_from_xdr(x: &mut Xdr, _: Option<u32>) -> XdrResult<u32> { read_val(x.reader.read_be_u32()) } } impl XdrPrimitive for i32 { fn read_from_xdr(x: &mut Xdr, _:Option<i32>) -> XdrResult<i32> { read_val(x.reader.read_be_i32()) } } impl XdrPrimitive for u64 { fn read_from_xdr(x: &mut Xdr, _: Option<u64>) -> XdrResult<u64> { read_val(x.reader.read_be_u64()) } }
impl XdrPrimitive for i64 { fn read_from_xdr(x: &mut Xdr, _:Option<i64>) -> XdrResult<i64> { read_val(x.reader.read_be_i64()) } } impl XdrPrimitive for f32 { fn read_from_xdr(x: &mut Xdr, _:Option<f32>) -> XdrResult<f32> { read_val(x.reader.read_be_f32()) } } impl XdrPrimitive for f64 { fn read_from_xdr(x: &mut Xdr, _:Option<f64>) -> XdrResult<f64> { read_val(x.reader.read_be_f64()) } } impl XdrPrimitive for bool { fn read_from_xdr(x: &mut Xdr, _:Option<bool>) -> XdrResult<bool> { match read_val(x.reader.read_be_u32()) { Ok(0) => Ok(false), Ok(1) => Ok(true), Ok(_) => Err("Boolean values must be between 0 and 1"), Err(e) => Err(e) } } } fn read_val<T>(val: IoResult<T>) -> XdrResult<T> { match val { Ok(v) => Ok(v), Err(e) => Err(e.desc) } } impl Xdr { /// Create a new instance of a reader using the provided byte vector. pub fn new(data : &[u8]) -> Xdr { Xdr { reader: MemReader::new(Vec::from_slice(data)) } } /// Read a primitive (u32, i32, u64, i64, f32 and f64) type from the buffer pub fn unpack_primitive<T:XdrPrimitive>(&mut self) -> XdrResult<T> { XdrPrimitive::read_from_xdr(self, None::<T>) } /// Read a 32-bit unsigned integer pub fn unpack_uint(&mut self) -> XdrResult<u32> { self.unpack_primitive() } /// Read a 32-bit signed integer pub fn unpack_int(&mut self) -> XdrResult<i32> { self.unpack_primitive() } /// Read a 64-bit unsigned integer pub fn unpack_ulong(&mut self) -> XdrResult<u64> { self.unpack_primitive() } /// Read a 64 bit signed integer pub fn unpack_long(&mut self) -> XdrResult<i64> { self.unpack_primitive() } /// Read a 32-bit float pub fn unpack_float(&mut self) -> XdrResult<f32> { self.unpack_primitive() } /// Read a 64-bit double pub fn unpack_double(&mut self) -> XdrResult<f64> { self.unpack_primitive() } /// Read a boolean pub fn unpack_boolean(&mut self) -> XdrResult<bool> { self.unpack_primitive() } /// Read a byte array of the specified length pub fn unpack_bytes(&mut self, num_bytes: uint) -> XdrResult<~[u8]> { let unpack_len = if num_bytes % PADDING_MULTIPLE != 0 { num_bytes + (PADDING_MULTIPLE - (num_bytes % PADDING_MULTIPLE)) } else { num_bytes }; match read_val(self.reader.read_exact(unpack_len)) { Ok(v) => Ok(v.slice_to(num_bytes).to_owned()), Err(e) => Err(e) } } /// Read a variable length byte array pub fn unpack_varlen_bytes(&mut self) -> XdrResult<~[u8]> { let len_result:XdrResult<u32> = self.unpack_primitive(); match len_result { Ok(len) => self.unpack_bytes(len as uint), Err(e) => Err(e) } } /// Read a UTF-8 string pub fn unpack_string(&mut self) -> XdrResult<~str> { match self.unpack_varlen_bytes() { Ok(slice) => match str::from_utf8_owned(slice) { Some(s) => Ok(s), None => Err("Failed to create string") }, Err(e) => Err(e) } } /// Unpack an array of primitives with a known length pub fn unpack_array<T:XdrPrimitive + Clone>(&mut self, num_elements: uint) -> XdrResult<~[T]> { /* the elegant solution is to do this: Vec::from_fn(num_elements, |_| { self.unpack_primitive().unwrap() }); but I am not aware of a way to handle error conditions in the closure and return early from the method */ let mut tmp_vec:Vec<T> = Vec::with_capacity(num_elements); for _ in range(0,num_elements) { tmp_vec.push(try!(self.unpack_primitive())) } Ok(tmp_vec.as_slice().to_owned()) } /// Unpack an array of primitives with an unknown length pub fn unpack_varlen_array<T:XdrPrimitive + Clone>(&mut self) -> XdrResult<~[T]> { let len:u32 = try!(self.unpack_primitive()); self.unpack_array(len as uint) } } } mod xdr_tests;
rpc.rs
//! A collection of node-specific RPC methods. //! Substrate provides the `sc-rpc` crate, which defines the core RPC layer //! used by Substrate nodes. This file extends those RPC definitions with //! capabilities that are specific to this project's runtime configuration. #![warn(missing_docs)] use std::sync::Arc; use node_helixstreet_runtime::{opaque::Block, AccountId, Balance, Index}; pub use sc_rpc_api::DenyUnsafe; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; /// Full client dependencies. pub struct FullDeps<C, P> { /// The client instance to use. pub client: Arc<C>, /// Transaction pool instance. pub pool: Arc<P>, /// Whether to deny unsafe calls pub deny_unsafe: DenyUnsafe, } /// Instantiate all full RPC extensions. pub fn create_full<C, P>(deps: FullDeps<C, P>) -> jsonrpc_core::IoHandler<sc_rpc::Metadata> where C: ProvideRuntimeApi<Block>, C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError> + 'static, C: Send + Sync + 'static, C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>, C::Api: BlockBuilder<Block>, P: TransactionPool + 'static,
{ use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; use substrate_frame_rpc_system::{FullSystem, SystemApi}; let mut io = jsonrpc_core::IoHandler::default(); let FullDeps { client, pool, deny_unsafe } = deps; io.extend_with(SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe))); io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone()))); // Extend this RPC with a custom API by using the following syntax. // `YourRpcStruct` should have a reference to a client, which is needed // to call into the runtime. // `io.extend_with(YourRpcTrait::to_delegate(YourRpcStruct::new(ReferenceToClient, ...)));` io }
carwash.module.ts
import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { CategoryModule } from '../category/category.module'; import { CarwashController } from './controllers/carwash/carwash.controller'; import { CarwashEntity } from './models/carwash.entity'; import { CarwashService } from './services/carwash/carwash.service'; @Module({ imports: [ TypeOrmModule.forFeature([CarwashEntity]) ], providers:[CarwashService],
}) export class CarwashModule {}
controllers:[CarwashController], exports:[CarwashService, TypeOrmModule]
CustomizedAsset.stories.tsx
import CustomizedAsset, { CustomizedAssetProps } from 'components/CustomizedAsset' const stories = storiesOf('Customized Asset', module) const baseProps = { tokenId: 'token id', tokenName: 'token name', symbol: 'SYM', createdDate: Date.now().toString(), assetAmount: '10000', outPoint: { txHash: 'tx hash', index: '0x0', }, isMainnet: false, isOnline: false, } const propsList: Record<string, CustomizedAssetProps> = { 'type = ckb': { type: 'ckb', ...baseProps, }, 'type = sudt': { type: 'sudt', ...baseProps, }, 'type = unknown': { type: 'unknown', ...baseProps, }, } Object.entries(propsList).forEach(([title, props]) => { stories.add(title, () => { return <CustomizedAsset {...props} /> }) }) stories.addDecorator(withKnobs()).add('With Knob', () => { const props: CustomizedAssetProps = { type: select('Type', ['ckb', 'sudt', 'unknown'], 'ckb', 'type') as CustomizedAssetProps['type'], tokenId: text('Token Id', 'token id'), tokenName: text('Token Name', 'token name'), symbol: text('Symbol', 'SYM'), createdDate: text('Created Date', Date.now().toString()), assetAmount: text('Amount', '10000'), outPoint: { txHash: text('Tx Hash', 'tx hash'), index: text('Index', '0x0'), }, isMainnet: boolean('Is Mainnet', false), isOnline: boolean('Is Online', false), } return <CustomizedAsset {...props} /> })
import React from 'react' import { storiesOf } from '@storybook/react' import { withKnobs, boolean, text, select } from '@storybook/addon-knobs'
mod.rs
pub mod force_directed;
pub mod layered;
user.management.component.ts
import { Component } from '@angular/core'; @Component({ selector: 'usermanagement', template: `<router-outlet></router-outlet>` }) export class UserManagement { constructor() { }
}
github_updater.rs
use ::db::connect_db; use regex::Regex; use time; use error::Result; use failure::err_msg; /// Fields we need use in cratesfyi #[derive(Debug)] struct GitHubFields { pub description: String, pub stars: i64, pub forks: i64, pub issues: i64, pub last_commit: time::Timespec, } /// Updates github fields in crates table pub fn github_updater() -> Result<()> { let conn = connect_db()?; // TODO: This query assumes repository field in Cargo.toml is // always the same across all versions of a crate for row in &conn.query("SELECT DISTINCT ON (crates.name) crates.name, crates.id, releases.repository_url FROM crates INNER JOIN releases ON releases.crate_id = crates.id WHERE releases.repository_url ~ '^https*://github.com' AND (crates.github_last_update < NOW() - INTERVAL '1 day' OR crates.github_last_update IS NULL) ORDER BY crates.name, releases.release_time DESC", &[])? { let crate_name: String = row.get(0); let crate_id: i32 = row.get(1); let repository_url: String = row.get(2); if let Err(err) = get_github_path(&repository_url[..]) .ok_or_else(|| err_msg("Failed to get github path")) .and_then(|path| get_github_fields(&path[..])) .and_then(|fields| { conn.execute("UPDATE crates SET github_description = $1, github_stars = $2, github_forks = $3, github_issues = $4, github_last_commit = $5, github_last_update = NOW() WHERE id = $6", &[&fields.description, &(fields.stars as i32), &(fields.forks as i32), &(fields.issues as i32), &(fields.last_commit), &crate_id]) .or_else(|e| Err(e.into())) }) { debug!("Failed to update github fields of: {} {}", crate_name, err); } // sleep for rate limits use std::thread; use std::time::Duration; thread::sleep(Duration::from_secs(2)); } Ok(()) } fn
(path: &str) -> Result<GitHubFields> { use rustc_serialize::json::Json; let body = { use std::io::Read; use reqwest::{Client, StatusCode}; use reqwest::header::USER_AGENT; use std::env; let client = Client::new(); let mut body = String::new(); let mut resp = client.get(&format!("https://api.github.com/repos/{}", path)[..]) .header(USER_AGENT, format!("cratesfyi/{}", env!("CARGO_PKG_VERSION"))) .basic_auth( env::var("CRATESFYI_GITHUB_USERNAME") .ok() .and_then(|u| Some(u.to_string())) .unwrap_or("".to_string()), env::var("CRATESFYI_GITHUB_ACCESSTOKEN").ok(), ) .send()?; if resp.status() != StatusCode::OK { return Err(err_msg("Failed to get github data")); } resp.read_to_string(&mut body)?; body }; let json = Json::from_str(&body[..])?; let obj = json.as_object().unwrap(); Ok(GitHubFields { description: obj.get("description").and_then(|d| d.as_string()).unwrap_or("").to_string(), stars: obj.get("stargazers_count").and_then(|d| d.as_i64()).unwrap_or(0), forks: obj.get("forks_count").and_then(|d| d.as_i64()).unwrap_or(0), issues: obj.get("open_issues").and_then(|d| d.as_i64()).unwrap_or(0), last_commit: time::strptime(obj.get("pushed_at") .and_then(|d| d.as_string()) .unwrap_or(""), "%Y-%m-%dT%H:%M:%S") .unwrap_or(time::now()) .to_timespec(), }) } fn get_github_path(url: &str) -> Option<String> { let re = Regex::new(r"https?://github\.com/([\w\._-]+)/([\w\._-]+)").unwrap(); match re.captures(url) { Some(cap) => { let username = cap.get(1).unwrap().as_str(); let reponame = cap.get(2).unwrap().as_str(); Some(format!("{}/{}", username, if reponame.ends_with(".git") { reponame.split(".git").nth(0).unwrap() } else { reponame })) } None => None, } } #[cfg(test)] mod test { extern crate env_logger; use super::{get_github_path, get_github_fields, github_updater}; #[test] fn test_get_github_path() { assert_eq!(get_github_path("https://github.com/onur/cratesfyi"), Some("onur/cratesfyi".to_string())); assert_eq!(get_github_path("http://github.com/onur/cratesfyi"), Some("onur/cratesfyi".to_string())); assert_eq!(get_github_path("https://github.com/onur/cratesfyi.git"), Some("onur/cratesfyi".to_string())); assert_eq!(get_github_path("https://github.com/onur23cmD_M_R_L_/crates_fy-i"), Some("onur23cmD_M_R_L_/crates_fy-i".to_string())); assert_eq!(get_github_path("https://github.com/docopt/docopt.rs"), Some("docopt/docopt.rs".to_string())); } #[test] #[ignore] fn test_get_github_fields() { let _ = env_logger::try_init(); let fields = get_github_fields("onur/cratesfyi"); assert!(fields.is_ok()); let fields = fields.unwrap(); assert!(fields.description != "".to_string()); assert!(fields.stars >= 0); assert!(fields.forks >= 0); assert!(fields.issues >= 0); use time; assert!(fields.last_commit <= time::now().to_timespec()); } #[test] #[ignore] fn test_github_updater() { let _ = env_logger::try_init(); assert!(github_updater().is_ok()); } }
get_github_fields
getItemOp.go
package commands import "1_session_generation/pkg/serializeb" type GetItemOp struct { ContainerID string ItemIndex int } func (op GetItemOp) Serialize() []byte { writer := serializeb.NewWriter() writer.WriteString(op.ContainerID) writer.WriteUint32(op.ItemIndex)
func DeserializeGetItemOp(buf []byte) (GetItemOp, error) { reader := serializeb.NewReader(buf) containerID, err := reader.ReadString() if err != nil { return GetItemOp{}, err } itemIndex, err := reader.ReadUint32() if err != nil { return GetItemOp{}, err } return GetItemOp{ ContainerID: containerID, ItemIndex: itemIndex, }, nil }
return writer.GetBytes() }
messages.rs
use chrono::{DateTime, Utc}; use serde::Deserialize; use serde::Serialize; use tako::messages::common::{ProgramDefinition, WorkerConfiguration}; use crate::client::status::Status; use crate::common::arraydef::IntArray; use crate::common::manager::info::ManagerType; use crate::server::autoalloc::{Allocation, AllocationEventHolder, DescriptorId, QueueInfo}; use crate::server::job::{JobTaskCounters, JobTaskInfo}; use crate::{JobId, JobTaskCount, JobTaskId, Map, WorkerId}; use bstr::BString; use std::path::PathBuf; use std::time::Duration; use tako::common::resources::ResourceRequest; use tako::messages::gateway::{CollectedOverview, GenericResourceNames, OverviewRequest}; // Messages client -> server #[derive(Serialize, Deserialize, Debug)] pub enum FromClientMessage { Submit(SubmitRequest), Resubmit(ResubmitRequest), Cancel(CancelRequest), JobDetail(JobDetailRequest), JobInfo(JobInfoRequest), WorkerList, WorkerInfo(WorkerInfoRequest), Stats, StopWorker(StopWorkerMessage), Stop, AutoAlloc(AutoAllocRequest), WaitForJobs(WaitForJobsRequest), Overview(OverviewRequest), GetGenericResourceNames(GenericResourceNames), } #[derive(Serialize, Deserialize, Debug)] pub struct TaskBody { pub program: ProgramDefinition, pub pin: bool, pub job_id: JobId, pub task_id: JobTaskId, } #[derive(Serialize, Deserialize, Debug, Clone)] pub enum JobType { Simple, Array(IntArray), } #[derive(Serialize, Deserialize, Debug)] pub struct SubmitRequest { pub job_type: JobType, pub name: String, pub max_fails: Option<JobTaskCount>, pub spec: ProgramDefinition, pub resources: ResourceRequest, pub pin: bool, pub entries: Option<Vec<BString>>, pub submit_dir: PathBuf, pub priority: tako::Priority, pub time_limit: Option<Duration>, pub log: Option<PathBuf>, } #[derive(Serialize, Deserialize, Debug, Clone)] pub enum Selector { All, LastN(u32), Specific(IntArray), } #[derive(Serialize, Deserialize, Debug)] pub struct ResubmitRequest { pub job_id: JobId, pub status: Option<Vec<Status>>, } #[derive(Serialize, Deserialize, Debug)] pub struct CancelRequest { pub selector: Selector, } #[derive(Serialize, Deserialize, Debug)] pub struct JobInfoRequest { pub selector: Selector, } #[derive(Serialize, Deserialize, Debug)] pub struct JobDetailRequest { pub selector: Selector, pub include_tasks: bool, } #[derive(Serialize, Deserialize, Debug)] pub struct StopWorkerMessage { pub selector: Selector, } #[derive(Serialize, Deserialize, Debug)] pub struct WorkerInfoRequest { pub worker_id: WorkerId, } #[derive(Serialize, Deserialize, Debug)] pub enum AutoAllocRequest { List, Events { descriptor: DescriptorId }, Info { descriptor: DescriptorId }, AddQueue(AddQueueRequest), RemoveQueue(DescriptorId), } #[derive(Serialize, Deserialize, Debug)] pub enum AddQueueRequest { Pbs(AddQueueParams), Slurm(AddQueueParams), } #[derive(Serialize, Deserialize, Debug)] pub struct AddQueueParams { pub workers_per_alloc: u32, pub backlog: u32, pub timelimit: Option<Duration>, pub name: Option<String>, pub additional_args: Vec<String>, } #[derive(Serialize, Deserialize, Debug)] pub struct WaitForJobsRequest { pub selector: Selector, } // Messages server -> client #[allow(clippy::large_enum_variant)] #[derive(Serialize, Deserialize, Debug)] pub enum ToClientMessage { JobInfoResponse(JobInfoResponse), JobDetailResponse(Vec<(JobId, Option<JobDetail>)>), SubmitResponse(SubmitResponse), WorkerListResponse(WorkerListResponse), WorkerInfoResponse(Option<WorkerInfo>), StatsResponse(StatsResponse), StopWorkerResponse(Vec<(WorkerId, StopWorkerResponse)>), CancelJobResponse(Vec<(JobId, CancelJobResponse)>), AutoAllocResponse(AutoAllocResponse), WaitForJobsResponse(WaitForJobsResponse), OverviewResponse(CollectedOverview), Error(String), GenericResourceNames(GenericResourceNames), } #[derive(Serialize, Deserialize, Debug)] pub enum CancelJobResponse { Canceled(Vec<JobTaskId>, JobTaskCount), InvalidJob, Failed(String), } #[derive(Serialize, Deserialize, Debug)] pub enum StopWorkerResponse { Stopped, AlreadyStopped, InvalidWorker, Failed(String), } #[derive(Serialize, Deserialize, Debug)] pub struct
{ pub connections: Vec<String>, pub registrations: Vec<(JobId, PathBuf)>, pub files: Vec<String>, } #[derive(Serialize, Deserialize, Debug)] pub struct StatsResponse { pub stream_stats: StreamStats, } #[derive(Serialize, Deserialize, Debug)] pub struct SubmitResponse { pub job: JobDetail, } #[derive(Serialize, Deserialize, Debug)] pub enum JobStatus { Submitted, Waiting, Running, Finished, Failed(String), Canceled, } #[derive(Serialize, Deserialize, Debug, Clone)] pub struct JobInfo { pub id: JobId, pub name: String, pub n_tasks: JobTaskCount, pub counters: JobTaskCounters, pub resources: ResourceRequest, } // We need to duplicate LostWorkerReason because of serialization problems (msgpack vs. binpack) #[derive(Serialize, Deserialize, Debug, Clone)] pub enum LostWorkerReasonInfo { Stopped, ConnectionLost, HeartbeatLost, IdleTimeout, } #[derive(Serialize, Deserialize, Debug, Clone)] pub struct WorkerExitInfo { pub ended_at: DateTime<Utc>, pub reason: LostWorkerReasonInfo, } #[derive(Serialize, Deserialize, Debug, Clone)] pub struct WorkerInfo { pub id: WorkerId, pub configuration: WorkerConfiguration, pub ended: Option<WorkerExitInfo>, } #[derive(Serialize, Deserialize, Debug)] pub struct JobInfoResponse { pub jobs: Vec<JobInfo>, } #[derive(Serialize, Deserialize, Debug)] pub struct JobDetail { pub info: JobInfo, pub job_type: JobType, pub program_def: ProgramDefinition, pub tasks: Vec<JobTaskInfo>, pub resources: ResourceRequest, pub pin: bool, pub max_fails: Option<JobTaskCount>, pub priority: tako::Priority, pub time_limit: Option<Duration>, // Date when job was submitted pub submission_date: DateTime<Utc>, // Time when job was completed or now if job is not completed pub completion_date_or_now: DateTime<Utc>, } #[derive(Serialize, Deserialize, Debug)] pub struct WorkerListResponse { pub workers: Vec<WorkerInfo>, } #[derive(Serialize, Deserialize, Debug)] pub struct WorkerInfoResponse { pub worker: WorkerInfo, } #[derive(Serialize, Deserialize, Debug)] pub enum AutoAllocResponse { QueueCreated(DescriptorId), QueueRemoved(DescriptorId), Events(Vec<AllocationEventHolder>), Info(Vec<Allocation>), List(AutoAllocListResponse), } #[derive(Serialize, Deserialize, Debug)] pub struct AutoAllocListResponse { pub descriptors: Map<DescriptorId, QueueDescriptorData>, } #[derive(Serialize, Deserialize, Debug)] pub struct QueueDescriptorData { pub info: QueueInfo, pub name: Option<String>, pub manager_type: ManagerType, } #[derive(Serialize, Deserialize, Debug, Default)] pub struct WaitForJobsResponse { pub finished: u32, pub failed: u32, pub canceled: u32, pub invalid: u32, }
StreamStats
views.py
# Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import copy import json from django import forms from django import http from django import shortcuts from django.views import generic import six from horizon import exceptions from horizon.forms import views as hz_views from horizon.forms.views import ADD_TO_FIELD_HEADER # noqa from horizon import messages class WorkflowView(hz_views.ModalBackdropMixin, generic.TemplateView): """A generic class-based view which handles the intricacies of workflow processing with minimal user configuration. .. attribute:: workflow_class The :class:`~horizon.workflows.Workflow` class which this view handles. Required. .. attribute:: template_name The template to use when rendering this view via standard HTTP requests. Required. .. attribute:: ajax_template_name The template to use when rendering the workflow for AJAX requests. In general the default common template should be used. Defaults to ``"horizon/common/_workflow.html"``. .. attribute:: context_object_name The key which should be used for the workflow object in the template context. Defaults to ``"workflow"``. """ workflow_class = None template_name = 'horizon/common/_workflow_base.html' context_object_name = "workflow" ajax_template_name = 'horizon/common/_workflow.html' step_errors = {} def __init__(self): super(WorkflowView, self).__init__() if not self.workflow_class: raise AttributeError("You must set the workflow_class attribute " "on %s." % self.__class__.__name__) def get_initial(self): """Returns initial data for the workflow. Defaults to using the GET parameters to allow pre-seeding of the workflow context values. """ return copy.copy(self.request.GET) def get_workflow(self): """Returns the instantiated workflow class.""" extra_context = self.get_initial() entry_point = self.request.GET.get("step", None) workflow = self.workflow_class(self.request, context_seed=extra_context, entry_point=entry_point) return workflow def get_context_data(self, **kwargs): """Returns the template context, including the workflow class. This method should be overridden in subclasses to provide additional context data to the template. """ context = super(WorkflowView, self).get_context_data(**kwargs) workflow = self.get_workflow() context[self.context_object_name] = workflow next = self.request.REQUEST.get(workflow.redirect_param_name, None) context['REDIRECT_URL'] = next context['layout'] = self.get_layout() # For consistency with Workflow class context['modal'] = 'modal' in context['layout'] if ADD_TO_FIELD_HEADER in self.request.META: context['add_to_field'] = self.request.META[ADD_TO_FIELD_HEADER] return context def get_layout(self): """returns classes for the workflow element in template based on the workflow characteristics """ if self.request.is_ajax(): layout = ['modal', ] if self.workflow_class.fullscreen: layout += ['fullscreen', ] else: layout = ['static_page', ] if self.workflow_class.wizard: layout += ['wizard', ]
def get_template_names(self): """Returns the template name to use for this request.""" if self.request.is_ajax(): template = self.ajax_template_name else: template = self.template_name return template def get_object_id(self, obj): return getattr(obj, "id", None) def get_object_display(self, obj): return getattr(obj, "name", None) def add_error_to_step(self, error_msg, step): self.step_errors[step] = error_msg def set_workflow_step_errors(self, context): workflow = context['workflow'] for step in self.step_errors: error_msg = self.step_errors[step] workflow.add_error_to_step(error_msg, step) def get(self, request, *args, **kwargs): """Handler for HTTP GET requests.""" context = self.get_context_data(**kwargs) self.set_workflow_step_errors(context) return self.render_to_response(context) def validate_steps(self, request, workflow, start, end): """Validates the workflow steps from ``start`` to ``end``, inclusive. Returns a dict describing the validation state of the workflow. """ errors = {} for step in workflow.steps[start:end + 1]: if not step.action.is_valid(): errors[step.slug] = dict( (field, [unicode(error) for error in errors]) for (field, errors) in six.iteritems(step.action.errors)) return { 'has_errors': bool(errors), 'workflow_slug': workflow.slug, 'errors': errors, } def post(self, request, *args, **kwargs): """Handler for HTTP POST requests.""" context = self.get_context_data(**kwargs) workflow = context[self.context_object_name] try: # Check for the VALIDATE_STEP* headers, if they are present # and valid integers, return validation results as JSON, # otherwise proceed normally. validate_step_start = int(self.request.META.get( 'HTTP_X_HORIZON_VALIDATE_STEP_START', '')) validate_step_end = int(self.request.META.get( 'HTTP_X_HORIZON_VALIDATE_STEP_END', '')) except ValueError: # No VALIDATE_STEP* headers, or invalid values. Just proceed # with normal workflow handling for POSTs. pass else: # There are valid VALIDATE_STEP* headers, so only do validation # for the specified steps and return results. data = self.validate_steps(request, workflow, validate_step_start, validate_step_end) return http.HttpResponse(json.dumps(data), content_type="application/json") if not workflow.is_valid(): return self.render_to_response(context) try: success = workflow.finalize() except forms.ValidationError: return self.render_to_response(context) except Exception: success = False exceptions.handle(request) if success: msg = workflow.format_status_message(workflow.success_message) messages.success(request, msg) else: msg = workflow.format_status_message(workflow.failure_message) messages.error(request, msg) if "HTTP_X_HORIZON_ADD_TO_FIELD" in self.request.META: field_id = self.request.META["HTTP_X_HORIZON_ADD_TO_FIELD"] response = http.HttpResponse() if workflow.object: data = [self.get_object_id(workflow.object), self.get_object_display(workflow.object)] response.content = json.dumps(data) response["X-Horizon-Add-To-Field"] = field_id return response next_url = self.request.REQUEST.get(workflow.redirect_param_name, None) return shortcuts.redirect(next_url or workflow.get_success_url())
return layout
main.go
package main import ( "errors" "fmt" "net/http" "net/url" "os" "strconv" "strings" "time" "github.com/asaskevich/govalidator" "golang.org/x/net/html" ) type httpRequest struct { URL string } type httpStatus struct { URL string `json:"url"` Status int `json:"status"` Rtime time.Duration `json:"rtime"` } //type HttpRequests []HttpRequest func httpHead(site string) (httpstatus httpStatus, err error) { //if var is not null check site status if len(site) != 0 { //validate site var validURL := govalidator.IsURL(site) //error if invalid if validURL == false { return httpstatus, errors.New("Invalid URL") } //record time to measure response time start := time.Now() //HEAD request URL resp, err := http.Head(site) //Stop Response time timer Rtime := time.Since(start) //handle error from HEAD request if err != nil { return httpstatus, errors.New("Error requesting HEAD") } //unescape URL before writeout usite, err := url.QueryUnescape(site) if err != nil { return httpstatus, errors.New("Error requesting Unescaping url") } //assemble JSON response httpstatus = httpStatus{ URL: usite, Status: resp.StatusCode, Rtime: Rtime, } return httpstatus, nil //else return no var } return httpstatus, errors.New("No Site Requested!\n") } // Helper function to pull the href attribute from a Token func getHref(t html.Token) (ok bool, href string) { // Iterate over all of the Token's attributes until we find an "href" for _, a := range t.Attr { if a.Key == "href" { href = a.Val ok = true } } // "bare" return will return the variables (ok, href) as defined in // the function definition return } // Extract all http** links from a given webpage func crawl(url string, ch chan string, chFinished chan bool)
func main() { foundUrls := make(map[string]bool) seedUrls := os.Args[1:] // Channels chUrls := make(chan string) chFinished := make(chan bool) // Kick off the crawl process (concurrently) for _, url := range seedUrls { go crawl(url, chUrls, chFinished) } // Subscribe to both channels for c := 0; c < len(seedUrls); { select { case url := <-chUrls: foundUrls[url] = true //crawl(url, chUrls, chFinished) case <-chFinished: c++ } } // We're done! Print the results... fmt.Println("\nFound", len(foundUrls), "unique urls:") for url := range foundUrls { result, err := httpHead(url) if err != nil { print(err) } fmt.Printf("URL: %v STATUS: %v\n", result.URL, result.Status) } close(chUrls) }
{ fmt.Println("Attempting to Crawl: \"" + url + "\"") resp, err := http.Get(url) defer func() { // Notify that we're done after this function chFinished <- true }() if err != nil { fmt.Println("ERROR: Failed to crawl \"" + url + "\"") fmt.Println("ERROR: " + strconv.Itoa(resp.StatusCode)) return } b := resp.Body defer b.Close() // close Body when the function returns z := html.NewTokenizer(b) for { tt := z.Next() switch { case tt == html.ErrorToken: // End of the document, we're done return case tt == html.StartTagToken: t := z.Token() // Check if the token is an <a> tag isAnchor := t.Data == "a" if !isAnchor { continue } // Extract the href value, if there is one ok, href := getHref(t) if !ok { continue } // Make sure the url begines in http** switch strings.Split(href, ":")[0] { case "mailto", "http", "https", "ftp": /*if href == url { continue }*/ ch <- href default: if strings.LastIndex(url, "/") != len(url)-1 && strings.Index(href, "/") != 0 { url = url + "/" } else if strings.LastIndex(url, "/") == len(url)-1 && strings.Index(href, "/") == 0 { url = strings.TrimSuffix(url, "/") } ch <- (url + href) } /*hasProto := strings.Index(href, "http") == 0 if hasProto { ch <- href }else if len(href) > 1 && strings.Index(href, "mailto") != 0 { //fmt.Println("url2: " + url2) if strings.LastIndex(url, "/") != len(url)-1 && strings.Index(href, "/") != 0 { url = url + "/" } ch <- (url + href) }else{ ch <- href }*/ } } }
models.py
from django.db import models from django.utils.translation import ugettext_lazy as _ from model_utils import FieldTracker from waldur_core.core import models as core_models from waldur_core.structure import models as structure_models class VirtualMachineMixin(models.Model): class Meta: abstract = True guest_os = models.CharField( max_length=50, help_text=_( 'Defines the valid guest operating system ' 'types used for configuring a virtual machine' ), ) cores = models.PositiveSmallIntegerField( default=0, help_text=_('Number of cores in a VM') ) cores_per_socket = models.PositiveSmallIntegerField( default=1, help_text=_('Number of cores per socket in a VM') ) ram = models.PositiveIntegerField( default=0, help_text=_('Memory size in MiB'), verbose_name=_('RAM') ) disk = models.PositiveIntegerField(default=0, help_text=_('Disk size in MiB')) class VirtualMachine( VirtualMachineMixin, core_models.RuntimeStateMixin, structure_models.BaseResource ): class RuntimeStates: POWERED_OFF = 'POWERED_OFF' POWERED_ON = 'POWERED_ON' SUSPENDED = 'SUSPENDED' CHOICES = ( (POWERED_OFF, 'Powered off'), (POWERED_ON, 'Powered on'), (SUSPENDED, 'Suspended'), ) class GuestPowerStates: RUNNING = 'RUNNING' SHUTTING_DOWN = 'SHUTTING_DOWN' RESETTING = 'RESETTING' STANDBY = 'STANDBY' NOT_RUNNING = 'NOT_RUNNING' UNAVAILABLE = 'UNAVAILABLE' CHOICES = ( (RUNNING, 'Running'), (SHUTTING_DOWN, 'Shutting down'), (RESETTING, 'Resetting'), (STANDBY, 'Standby'), (NOT_RUNNING, 'Not running'), (UNAVAILABLE, 'Unavailable'), ) class ToolsStates: STARTING = 'STARTING' RUNNING = 'RUNNING' NOT_RUNNING = 'NOT_RUNNING' CHOICES = ( (STARTING, 'Starting'), (RUNNING, 'Running'), (NOT_RUNNING, 'Not running'), ) template = models.ForeignKey('Template', null=True, on_delete=models.SET_NULL) cluster = models.ForeignKey('Cluster', null=True, on_delete=models.SET_NULL) datastore = models.ForeignKey('Datastore', null=True, on_delete=models.SET_NULL) folder = models.ForeignKey('Folder', null=True, on_delete=models.SET_NULL) networks = models.ManyToManyField('Network', blank=True) guest_power_enabled = models.BooleanField( default=False, help_text='Flag indicating if the virtual machine is ready to process soft power operations.', ) guest_power_state = models.CharField( 'The power state of the guest operating system.', max_length=150, blank=True, choices=GuestPowerStates.CHOICES, ) tools_installed = models.BooleanField(default=False) tools_state = models.CharField( 'Current running status of VMware Tools running in the guest operating system.', max_length=50, blank=True, choices=ToolsStates.CHOICES, ) tracker = FieldTracker() @classmethod def get_backend_fields(cls): return super(VirtualMachine, cls).get_backend_fields() + ( 'runtime_state', 'cores', 'cores_per_socket', 'ram', 'disk', 'tools_installed', 'tools_state', ) @classmethod def get_url_name(cls): return 'vmware-virtual-machine' @property def total_disk(self): return self.disks.aggregate(models.Sum('size'))['size__sum'] or 0 def __str__(self): return self.name class Port(core_models.RuntimeStateMixin, structure_models.BaseResource): vm = models.ForeignKey(on_delete=models.CASCADE, to=VirtualMachine) network = models.ForeignKey(on_delete=models.CASCADE, to='Network') mac_address = models.CharField( max_length=32, blank=True, verbose_name=_('MAC address') ) @classmethod def get_backend_fields(cls): return super(Port, cls).get_backend_fields() + ('name', 'mac_address') @classmethod def get_url_name(cls): return 'vmware-port' def __str__(self): return self.name class Disk(structure_models.BaseResource): size = models.PositiveIntegerField(help_text=_('Size in MiB')) vm = models.ForeignKey( on_delete=models.CASCADE, to=VirtualMachine, related_name='disks' ) @classmethod def get_url_name(cls): return 'vmware-disk' def __str__(self): return self.name @classmethod def get_backend_fields(cls): return super(Disk, cls).get_backend_fields() + ('name', 'size') class Template( VirtualMachineMixin, core_models.DescribableMixin, structure_models.ServiceProperty ): created = models.DateTimeField() modified = models.DateTimeField() @classmethod def get_url_name(cls): return 'vmware-template' def __str__(self): return self.name class Cluster(structure_models.ServiceProperty): @classmethod def get_url_name(cls): return 'vmware-cluster' def __str__(self): return '%s / %s' % (self.settings, self.name) class CustomerCluster(models.Model): customer = models.ForeignKey(structure_models.Customer, on_delete=models.CASCADE) cluster = models.ForeignKey('Cluster', on_delete=models.CASCADE) def __str__(self): return '%s / %s' % (self.customer, self.cluster) class Meta: unique_together = ('customer', 'cluster') class Network(structure_models.ServiceProperty): type = models.CharField(max_length=255) @classmethod def get_url_name(cls): return 'vmware-network' def __str__(self): return '%s / %s' % (self.settings, self.name) class CustomerNetwork(models.Model): # This model allows to specify allowed networks for VM provision customer = models.ForeignKey(structure_models.Customer, on_delete=models.CASCADE) network = models.ForeignKey('Network', on_delete=models.CASCADE) def __str__(self): return '%s / %s' % (self.customer, self.network) class Meta:
class CustomerNetworkPair(models.Model): # This model allows to specify allowed networks for existing VM NIC provision customer = models.ForeignKey(structure_models.Customer, on_delete=models.CASCADE) network = models.ForeignKey('Network', on_delete=models.CASCADE) def __str__(self): return '%s / %s' % (self.customer, self.network) class Meta: unique_together = ('customer', 'network') class Datastore(structure_models.ServiceProperty): type = models.CharField(max_length=255) capacity = models.PositiveIntegerField( help_text="Capacity, in MB.", null=True, blank=True ) free_space = models.PositiveIntegerField( help_text="Available space, in MB.", null=True, blank=True ) @classmethod def get_url_name(cls): return 'vmware-datastore' def __str__(self): return '%s / %s' % (self.settings, self.name) class CustomerDatastore(models.Model): customer = models.ForeignKey(structure_models.Customer, on_delete=models.CASCADE) datastore = models.ForeignKey('Datastore', on_delete=models.CASCADE) def __str__(self): return '%s / %s' % (self.customer, self.datastore) class Meta: unique_together = ('customer', 'datastore') class Folder(structure_models.ServiceProperty): def __str__(self): return '%s / %s' % (self.settings, self.name) @classmethod def get_url_name(cls): return 'vmware-folder' class CustomerFolder(models.Model): customer = models.ForeignKey(structure_models.Customer, on_delete=models.CASCADE) folder = models.ForeignKey('Folder', on_delete=models.CASCADE) def __str__(self): return '%s / %s' % (self.customer, self.folder) class Meta: unique_together = ('customer', 'folder')
unique_together = ('customer', 'network')
test_output.py
# Copyright (C) 2015-2016 The bitcoin-blockchain-parser developers # # This file is part of bitcoin-blockchain-parser. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of bitcoin-blockchain-parser, including this file, may be copied, # modified, propagated, or distributed except according to the terms contained # in the LICENSE file. import unittest from binascii import a2b_hex from blockchain_parser.output import Output class TestOutput(unittest.TestCase): def test_pubkeyhash_from_hex(self): raw_output = "01000000000000001976a91432ba382cf668657bae15ee0a97fa87" \ "f12e1bc89f88ac" output = Output.from_hex(a2b_hex(raw_output)) self.assertTrue(output.is_pubkeyhash()) self.assertEqual("pubkeyhash", output.type) self.assertEqual(1, output.value) self.assertEqual(1, len(output.addresses)) def test_pubkey_from_hex(self): raw_output = "0100000000000000232102c0993f639534d348e1dca30566491e6c" \ "b11c14afa13ec244c05396a9839aeb17ac" output = Output.from_hex(a2b_hex(raw_output)) self.assertTrue(output.is_pubkey()) self.assertEqual("pubkey", output.type) self.assertEqual(1, len(output.addresses)) def test_p2sh_from_hex(self): raw_output = "010000000000000017a91471c5c3727fac8dbace94bd38cf8ac16a" \ "034a794787" output = Output.from_hex(a2b_hex(raw_output)) self.assertTrue(output.is_p2sh()) self.assertEqual("p2sh", output.type) self.assertEqual(1, len(output.addresses)) def test_return_from_hex(self): raw_output = "01000000000000002a6a2846610000000024958857cc0da391b" \ "7b2bf61bcba59bb9ee438873f902c25da4c079e53d0c55fe991" output = Output.from_hex(a2b_hex(raw_output)) self.assertTrue(output.is_return()) self.assertEqual("OP_RETURN", output.type) self.assertEqual(0, len(output.addresses)) def test_multisig_from_hex(self): raw_output = "0100000000000000475121025cd452979d4d5e928d47c3581bb287" \ "41b2cf9c54185e7d563a663707b00d956d2102ff99d00aa9d195b9" \ "3732254def8bfe80a786a7973ef8e63afd8d2a65e97b6c3b52ae" output = Output.from_hex(a2b_hex(raw_output)) self.assertTrue(output.is_multisig()) self.assertEqual("multisig", output.type) self.assertEqual(2, len(output.addresses)) def test_unknown_from_hex(self): raw_output = "01000000000000000151" output = Output.from_hex(a2b_hex(raw_output)) self.assertEqual("unknown", output.type)
self.assertEqual(0, len(output.addresses))
__init__.py
# # Copyright 2021 Splunk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # from ..error import RestError from ..util import get_base_app_name __all__ = [ "RestModel", "RestEndpoint", "SingleModel", "MultipleModel", "DataInputModel", ] class RestModel: def __init__(self, fields, name=None): """ REST Model. :param name: :param fields: """ self.name = name self.fields = fields class RestEndpoint: """ REST Endpoint. """ def __init__(self, user="nobody", app=None, *args, **kwargs): """ :param user: :param app: if None, it will be base app name :param args: :param kwargs: """ self.user = user self.app = app or get_base_app_name() self.args = args self.kwargs = kwargs # If reload is needed while GET request self.need_reload = False @property def internal_endpoint(self): """ Endpoint of Splunk internal service. :return: """ raise NotImplementedError() def model(self, name): """ Real model for given name. :param name: :return: """ raise NotImplementedError() def _loop_fields(self, meth, name, data, *args, **kwargs): model = self.model(name) return [getattr(f, meth)(data, *args, **kwargs) for f in model.fields] def validate(self, name, data, existing=None): self._loop_fields("validate", name, data, existing=existing) def encode(self, name, data): self._loop_fields("encode", name, data) def decode(self, name, data): self._loop_fields("decode", name, data) class SingleModel(RestEndpoint):
class MultipleModel(RestEndpoint): """ REST Model with Multiple Modes. It will store stanzas with different formats into one conf file. """ def __init__(self, conf_name, models, user="nobody", app=None, *args, **kwargs): """ :param conf_name: :type conf_name: basestring :param models: list of RestModel :type models: list :param args: :param kwargs: """ super().__init__(user=user, app=app, *args, **kwargs) self.need_reload = True self.conf_name = conf_name self.models = {model.name: model for model in models} @property def internal_endpoint(self): return "configs/conf-{}".format(self.conf_name) def model(self, name): try: return self.models[name] except KeyError: raise RestError(404, "name=%s" % name) class DataInputModel(RestEndpoint): """ REST Model for Data Input. """ def __init__(self, input_type, model, user="nobody", app=None, *args, **kwargs): super().__init__(user=user, app=app, *args, **kwargs) self.input_type = input_type self._model = model @property def internal_endpoint(self): return "data/inputs/{}".format(self.input_type) def model(self, name): return self._model
""" REST Model with Single Mode. It will store stanzas with same format into one conf file. """ def __init__(self, conf_name, model, user="nobody", app=None, *args, **kwargs): """ :param conf_name: conf file name :param model: REST model :type model: RestModel :param args: :param kwargs: """ super().__init__(user=user, app=app, *args, **kwargs) self.need_reload = True self._model = model self.conf_name = conf_name self.config_name = kwargs.get("config_name") @property def internal_endpoint(self): return "configs/conf-{}".format(self.conf_name) def model(self, name): return self._model
switch.rs
// Copyright 2021 Datafuse Labs. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use std::fs; use std::sync::Arc; use clap::Arg; use clap::ArgMatches; use clap::Command as App; use crate::cmds::command::Command; use crate::cmds::Config; use crate::cmds::ListCommand; use crate::cmds::Status; use crate::cmds::Writer; use crate::error::Result; #[derive(Clone)] pub struct SwitchCommand { conf: Config, } impl SwitchCommand { pub fn create(conf: Config) -> Self
fn get_latest_tag(&self) -> Result<String> { let tag_url = self.conf.mirror.databend_tag_url.clone(); let resp = ureq::get(tag_url.as_str()).call()?; let json: serde_json::Value = resp.into_json().unwrap(); Ok(format!("{}", json[0]["name"]).replace('\"', "")) } } #[async_trait::async_trait] impl Command for SwitchCommand { fn name(&self) -> &str { "switch" } fn clap(&self) -> App<'static> { App::new("switch") .about(self.about()) .arg(Arg::new("version").required(true).help( "Version of databend package, e.g. v0.4.69-nightly. Check the versions: package list", )) } fn subcommands(&self) -> Vec<Arc<dyn Command>> { vec![] } fn about(&self) -> &'static str { "Switch the active databend to a specified version" } fn is(&self, s: &str) -> bool { s.contains(self.name()) } async fn exec_matches(&self, writer: &mut Writer, args: Option<&ArgMatches>) -> Result<()> { match args { Some(matches) => { let bin_dir = format!("{}/bin", self.conf.databend_dir.clone()); let paths = fs::read_dir(bin_dir)?; let current_tag = if matches.value_of("version").unwrap() == "latest" { self.get_latest_tag()? } else { matches.value_of("version").unwrap().to_string() }; let status = Status::read(self.conf.clone())?; if status.version == current_tag { return Ok(()); } let mut exists = false; for path in paths { let path = path.unwrap().path(); let version = path.file_name().unwrap().to_string_lossy().into_owned(); if version == current_tag { exists = true; break; } } if !exists { writer.write_err(format!( "Can't found version: {}, package list:", current_tag )); let list = ListCommand::create(self.conf.clone()); list.exec_matches(writer, args).await?; writer.write_err(format!( "Use command bendctl package fetch {} to retrieve this version", current_tag )); return Ok(()); } // Write to status. let mut status = Status::read(self.conf.clone())?; status.version = current_tag; status.write()?; writer.write_ok(format!("Package switch to {}", status.version)); Ok(()) } None => { println!("no command in switch"); Ok(()) } } } }
{ SwitchCommand { conf } }
rpc_scantxoutset.py
#!/usr/bin/env python3 # Copyright (c) 2018-2019 The BitPal Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the scantxoutset rpc call.""" from test_framework.test_framework import BitPalTestFramework from test_framework.util import assert_equal, assert_raises_rpc_error from decimal import Decimal import shutil import os def descriptors(out): return sorted(u['desc'] for u in out['unspents']) class ScantxoutsetTest(BitPalTestFramework): def
(self): self.num_nodes = 1 self.setup_clean_chain = True def skip_test_if_missing_module(self): self.skip_if_no_wallet() def run_test(self): self.log.info("Mining blocks...") self.nodes[0].generate(110) addr_P2SH_SEGWIT = self.nodes[0].getnewaddress("", "p2sh-segwit") pubk1 = self.nodes[0].getaddressinfo(addr_P2SH_SEGWIT)['pubkey'] addr_LEGACY = self.nodes[0].getnewaddress("", "legacy") pubk2 = self.nodes[0].getaddressinfo(addr_LEGACY)['pubkey'] addr_BECH32 = self.nodes[0].getnewaddress("", "bech32") pubk3 = self.nodes[0].getaddressinfo(addr_BECH32)['pubkey'] self.nodes[0].sendtoaddress(addr_P2SH_SEGWIT, 0.001) self.nodes[0].sendtoaddress(addr_LEGACY, 0.002) self.nodes[0].sendtoaddress(addr_BECH32, 0.004) #send to child keys of tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK self.nodes[0].sendtoaddress("mkHV1C6JLheLoUSSZYk7x3FH5tnx9bu7yc", 0.008) # (m/0'/0'/0') self.nodes[0].sendtoaddress("mipUSRmJAj2KrjSvsPQtnP8ynUon7FhpCR", 0.016) # (m/0'/0'/1') self.nodes[0].sendtoaddress("n37dAGe6Mq1HGM9t4b6rFEEsDGq7Fcgfqg", 0.032) # (m/0'/0'/1500') self.nodes[0].sendtoaddress("mqS9Rpg8nNLAzxFExsgFLCnzHBsoQ3PRM6", 0.064) # (m/0'/0'/0) self.nodes[0].sendtoaddress("mnTg5gVWr3rbhHaKjJv7EEEc76ZqHgSj4S", 0.128) # (m/0'/0'/1) self.nodes[0].sendtoaddress("mketCd6B9U9Uee1iCsppDJJBHfvi6U6ukC", 0.256) # (m/0'/0'/1500) self.nodes[0].sendtoaddress("mj8zFzrbBcdaWXowCQ1oPZ4qioBVzLzAp7", 0.512) # (m/1/1/0') self.nodes[0].sendtoaddress("mfnKpKQEftniaoE1iXuMMePQU3PUpcNisA", 1.024) # (m/1/1/1') self.nodes[0].sendtoaddress("mou6cB1kaP1nNJM1sryW6YRwnd4shTbXYQ", 2.048) # (m/1/1/1500') self.nodes[0].sendtoaddress("mtfUoUax9L4tzXARpw1oTGxWyoogp52KhJ", 4.096) # (m/1/1/0) self.nodes[0].sendtoaddress("mxp7w7j8S1Aq6L8StS2PqVvtt4HGxXEvdy", 8.192) # (m/1/1/1) self.nodes[0].sendtoaddress("mpQ8rokAhp1TAtJQR6F6TaUmjAWkAWYYBq", 16.384) # (m/1/1/1500) self.nodes[0].generate(1) self.log.info("Stop node, remove wallet, mine again some blocks...") self.stop_node(0) shutil.rmtree(os.path.join(self.nodes[0].datadir, self.chain, 'wallets')) self.start_node(0) self.nodes[0].generate(110) scan = self.nodes[0].scantxoutset("start", []) info = self.nodes[0].gettxoutsetinfo() assert_equal(scan['success'], True) assert_equal(scan['height'], info['height']) assert_equal(scan['txouts'], info['txouts']) assert_equal(scan['bestblock'], info['bestblock']) self.restart_node(0, ['-nowallet']) self.log.info("Test if we have found the non HD unspent outputs.") assert_equal(self.nodes[0].scantxoutset("start", [ "pkh(" + pubk1 + ")", "pkh(" + pubk2 + ")", "pkh(" + pubk3 + ")"])['total_amount'], Decimal("0.002")) assert_equal(self.nodes[0].scantxoutset("start", [ "wpkh(" + pubk1 + ")", "wpkh(" + pubk2 + ")", "wpkh(" + pubk3 + ")"])['total_amount'], Decimal("0.004")) assert_equal(self.nodes[0].scantxoutset("start", [ "sh(wpkh(" + pubk1 + "))", "sh(wpkh(" + pubk2 + "))", "sh(wpkh(" + pubk3 + "))"])['total_amount'], Decimal("0.001")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(" + pubk1 + ")", "combo(" + pubk2 + ")", "combo(" + pubk3 + ")"])['total_amount'], Decimal("0.007")) assert_equal(self.nodes[0].scantxoutset("start", [ "addr(" + addr_P2SH_SEGWIT + ")", "addr(" + addr_LEGACY + ")", "addr(" + addr_BECH32 + ")"])['total_amount'], Decimal("0.007")) assert_equal(self.nodes[0].scantxoutset("start", [ "addr(" + addr_P2SH_SEGWIT + ")", "addr(" + addr_LEGACY + ")", "combo(" + pubk3 + ")"])['total_amount'], Decimal("0.007")) self.log.info("Test range validation.") assert_raises_rpc_error(-8, "End of range is too high", self.nodes[0].scantxoutset, "start", [ {"desc": "desc", "range": -1}]) assert_raises_rpc_error(-8, "Range should be greater or equal than 0", self.nodes[0].scantxoutset, "start", [ {"desc": "desc", "range": [-1, 10]}]) assert_raises_rpc_error(-8, "End of range is too high", self.nodes[0].scantxoutset, "start", [ {"desc": "desc", "range": [(2 << 31 + 1) - 1000000, (2 << 31 + 1)]}]) assert_raises_rpc_error(-8, "Range specified as [begin,end] must not have begin after end", self.nodes[0].scantxoutset, "start", [ {"desc": "desc", "range": [2, 1]}]) assert_raises_rpc_error(-8, "Range is too large", self.nodes[0].scantxoutset, "start", [ {"desc": "desc", "range": [0, 1000001]}]) self.log.info("Test extended key derivation.") # Run various scans, and verify that the sum of the amounts of the matches corresponds to the expected subset. # Note that all amounts in the UTXO set are powers of 2 multiplied by 0.001 BCC, so each amounts uniquely identifies a subset. assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0h/0h)"])['total_amount'], Decimal("0.008")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/1h)"])['total_amount'], Decimal("0.016")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0h/0'/1500')"])['total_amount'], Decimal("0.032")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0h/0h/0)"])['total_amount'], Decimal("0.064")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0h/1)"])['total_amount'], Decimal("0.128")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0h/0'/1500)"])['total_amount'], Decimal("0.256")) assert_equal(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0h/*h)", "range": 1499}])['total_amount'], Decimal("0.024")) assert_equal(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0'/*h)", "range": 1500}])['total_amount'], Decimal("0.056")) assert_equal(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0h/0'/*)", "range": 1499}])['total_amount'], Decimal("0.192")) assert_equal(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0'/0h/*)", "range": 1500}])['total_amount'], Decimal("0.448")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/0')"])['total_amount'], Decimal("0.512")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/1')"])['total_amount'], Decimal("1.024")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/1500h)"])['total_amount'], Decimal("2.048")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/0)"])['total_amount'], Decimal("4.096")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/1)"])['total_amount'], Decimal("8.192")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/1500)"])['total_amount'], Decimal("16.384")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/0)"])['total_amount'], Decimal("4.096")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo([abcdef88/1/2'/3/4h]tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/1)"])['total_amount'], Decimal("8.192")) assert_equal(self.nodes[0].scantxoutset("start", [ "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/1500)"])['total_amount'], Decimal("16.384")) assert_equal(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*')", "range": 1499}])['total_amount'], Decimal("1.536")) assert_equal(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*')", "range": 1500}])['total_amount'], Decimal("3.584")) assert_equal(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)", "range": 1499}])['total_amount'], Decimal("12.288")) assert_equal(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)", "range": 1500}])['total_amount'], Decimal("28.672")) assert_equal(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/*)", "range": 1499}])['total_amount'], Decimal("12.288")) assert_equal(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/*)", "range": 1500}])['total_amount'], Decimal("28.672")) assert_equal(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/*)", "range": [1500,1500]}])['total_amount'], Decimal("16.384")) # Test the reported descriptors for a few matches assert_equal(descriptors(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0h/0'/*)", "range": 1499}])), ["pkh([0c5f9a1e/0'/0'/0]026dbd8b2315f296d36e6b6920b1579ca75569464875c7ebe869b536a7d9503c8c)#dzxw429x", "pkh([0c5f9a1e/0'/0'/1]033e6f25d76c00bedb3a8993c7d5739ee806397f0529b1b31dda31ef890f19a60c)#43rvceed"]) assert_equal(descriptors(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/0)"])), ["pkh([0c5f9a1e/1/1/0]03e1c5b6e650966971d7e71ef2674f80222752740fc1dfd63bbbd220d2da9bd0fb)#cxmct4w8"]) assert_equal(descriptors(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/*)", "range": 1500}])), ['pkh([0c5f9a1e/1/1/0]03e1c5b6e650966971d7e71ef2674f80222752740fc1dfd63bbbd220d2da9bd0fb)#cxmct4w8', 'pkh([0c5f9a1e/1/1/1500]03832901c250025da2aebae2bfb38d5c703a57ab66ad477f9c578bfbcd78abca6f)#vchwd07g', 'pkh([0c5f9a1e/1/1/1]030d820fc9e8211c4169be8530efbc632775d8286167afd178caaf1089b77daba7)#z2t3ypsa']) # Check that status and abort don't need second arg assert_equal(self.nodes[0].scantxoutset("status"), None) assert_equal(self.nodes[0].scantxoutset("abort"), False) # Check that second arg is needed for start assert_raises_rpc_error(-1, "scanobjects argument is required for the start action", self.nodes[0].scantxoutset, "start") if __name__ == '__main__': ScantxoutsetTest().main()
set_test_params
59-es5.439c8287aed2d0a91213.js
function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function asyncGeneratorStep(e,t,n,i,r,o,a){try{var s=e[o](a),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).then(i,r)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){asyncGeneratorStep(o,i,r,a,s,"next",e)}function s(e){asyncGeneratorStep(o,i,r,a,s,"throw",e)}a(void 0)}))}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{WHty:function(e,t,n){"use strict";n.r(t),n.d(t,"ion_menu",(function(){return h})),n.d(t,"ion_menu_button",(function(){return g})),n.d(t,"ion_menu_toggle",(function(){return v}));var i=n("54nT"),r=n("AfW+"),o=n("aiEM"),a=(n("iAHb"),n("0AIG")),s=n("AzGJ"),c=n("MgeF"),u=n("Dl6n"),h=function(){function
(t){_classCallCheck(this,e),Object(i.k)(this,t),this.lastOnEnd=0,this.blocker=s.GESTURE_CONTROLLER.createBlocker({disableScroll:!0}),this.mode=Object(i.d)(this),this.easing="ios"===this.mode?"cubic-bezier(0.32,0.72,0,1)":"cubic-bezier(0.0,0.0,0.2,1)",this.easingReverse="ios"===this.mode?"cubic-bezier(1, 0, 0.68, 0.28)":"cubic-bezier(0.4, 0, 0.6, 1)",this.isAnimating=!1,this._isOpen=!1,this.isPaneVisible=!1,this.isEndSide=!1,this.disabled=!1,this.side="start",this.swipeGesture=!0,this.maxEdgeStart=50,this.ionWillOpen=Object(i.e)(this,"ionWillOpen",7),this.ionWillClose=Object(i.e)(this,"ionWillClose",7),this.ionDidOpen=Object(i.e)(this,"ionDidOpen",7),this.ionDidClose=Object(i.e)(this,"ionDidClose",7),this.ionMenuChange=Object(i.e)(this,"ionMenuChange",7)}var t,u,h,f,g;return _createClass(e,[{key:"typeChanged",value:function(e,t){var n=this.contentEl;n&&(void 0!==t&&n.classList.remove("menu-content-".concat(t)),n.classList.add("menu-content-".concat(e)),n.removeAttribute("style")),this.menuInnerEl&&this.menuInnerEl.removeAttribute("style"),this.animation=void 0}},{key:"disabledChanged",value:function(){this.updateState(),this.ionMenuChange.emit({disabled:this.disabled,open:this._isOpen})}},{key:"sideChanged",value:function(){this.isEndSide=Object(o.h)(this.side)}},{key:"swipeGestureChanged",value:function(){this.updateState()}},{key:"connectedCallback",value:(g=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,i,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===this.type&&(this.type=r.b.get("menuType","overlay")),t=this.el.parentNode,void 0===this.contentId&&console.warn('[DEPRECATED][ion-menu] Using the [main] attribute is deprecated, please use the "contentId" property instead:\nBEFORE:\n <ion-menu>...</ion-menu>\n <div main>...</div>\n\nAFTER:\n <ion-menu contentId="main-content"></ion-menu>\n <div id="main-content">...</div>\n'),!(i=void 0!==this.contentId?document.getElementById(this.contentId):t&&t.querySelector&&t.querySelector("[main]"))||!i.tagName){e.next=17;break}return this.contentEl=i,i.classList.add("menu-content"),this.typeChanged(this.type,void 0),this.sideChanged(),c.a._register(this),e.next=12,Promise.resolve().then(n.bind(null,"AzGJ"));case 12:e.t0={el:document,gestureName:"menu-swipe",gesturePriority:30,threshold:10,canStart:function(e){return o.canStart(e)},onWillStart:function(){return o.onWillStart()},onStart:function(){return o.onStart()},onMove:function(e){return o.onMove(e)},onEnd:function(e){return o.onEnd(e)}},this.gesture=e.sent.createGesture(e.t0),this.updateState(),e.next=18;break;case 17:console.error('Menu: must have a "content" element to listen for drag events on.');case 18:case"end":return e.stop()}}),e,this)}))),function(){return g.apply(this,arguments)})},{key:"componentDidLoad",value:(f=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.ionMenuChange.emit({disabled:this.disabled,open:this._isOpen}),this.updateState();case 1:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"disconnectedCallback",value:function(){this.blocker.destroy(),c.a._unregister(this),this.animation&&this.animation.destroy(),this.gesture&&(this.gesture.destroy(),this.gesture=void 0),this.animation=void 0,this.contentEl=this.backdropEl=this.menuInnerEl=void 0}},{key:"onSplitPaneChanged",value:function(e){this.isPaneVisible=e.detail.isPane(this.el),this.updateState()}},{key:"onBackdropClick",value:function(e){this._isOpen&&this.lastOnEnd<e.timeStamp-100&&e.composedPath&&!e.composedPath().includes(this.menuInnerEl)&&(e.preventDefault(),e.stopPropagation(),this.close())}},{key:"isOpen",value:function(){return Promise.resolve(this._isOpen)}},{key:"isActive",value:function(){return Promise.resolve(this._isActive())}},{key:"open",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.setOpen(!0,e)}},{key:"close",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.setOpen(!1,e)}},{key:"toggle",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.setOpen(!this._isOpen,e)}},{key:"setOpen",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return c.a._setOpen(this,e,t)}},{key:"_setOpen",value:(h=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(i.length>1&&void 0!==i[1])||i[1],e.t0=!this._isActive()||this.isAnimating||t===this._isOpen,e.t0){e.next=10;break}return this.beforeAnimation(t),e.next=6,this.loadAnimation();case 6:return e.next=8,this.startAnimation(t,n);case 8:this.afterAnimation(t),e.t0=0;case 10:return e.abrupt("return",!e.t0);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"loadAnimation",value:(u=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.menuInnerEl.offsetWidth,e.t0=t===this.width&&void 0!==this.animation,e.t0){e.next=10;break}return this.width=t,this.animation&&(this.animation.destroy(),this.animation=void 0),e.next=7,c.a._createAnimation(this.type,this);case 7:this.animation=e.sent,r.b.getBoolean("animated",!0)||this.animation.duration(0),this.animation.fill("both");case 10:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"startAnimation",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(t,n){var i,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=!t,r=this.animation.direction(i?"reverse":"normal").easing(i?this.easingReverse:this.easing).onFinish((function(){"reverse"===r.getDirection()&&r.direction("normal")})),!n){e.next=6;break}return e.next=4,r.play();case 4:e.next=7;break;case 6:r.play({sync:!0});case 7:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"_isActive",value:function(){return!this.disabled&&!this.isPaneVisible}},{key:"canSwipe",value:function(){return this.swipeGesture&&!this.isAnimating&&this._isActive()}},{key:"canStart",value:function(e){return!!this.canSwipe()&&(!!this._isOpen||!c.a._getOpenSync()&&d(window,e.currentX,this.isEndSide,this.maxEdgeStart))}},{key:"onWillStart",value:function(){return this.beforeAnimation(!this._isOpen),this.loadAnimation()}},{key:"onStart",value:function(){this.isAnimating&&this.animation?this.animation.progressStart(!0,this._isOpen?1:0):Object(o.b)(!1,"isAnimating has to be true")}},{key:"onMove",value:function(e){if(this.isAnimating&&this.animation){var t=l(e.deltaX,this._isOpen,this.isEndSide)/this.width;this.animation.progressStep(this._isOpen?1-t:t)}else Object(o.b)(!1,"isAnimating has to be true")}},{key:"onEnd",value:function(e){var t=this;if(this.isAnimating&&this.animation){var n=this._isOpen,i=this.isEndSide,r=l(e.deltaX,n,i),s=this.width,c=r/s,u=e.velocityX,h=s/2,d=u>=0&&(u>.2||e.deltaX>h),p=u<=0&&(u<-.2||e.deltaX<-h),m=n?i?d:p:i?p:d,b=!n&&m;n&&!m&&(b=!0),this.lastOnEnd=e.currentTime;var f=m?.001:-.001,g=c<0?.01:c;f+=Object(a.a)([0,0],[.4,0],[.6,1],[1,1],Object(o.c)(0,g,.9999))[0]||0;var v=this._isOpen?!m:m;this.animation.easing("cubic-bezier(0.4, 0.0, 0.6, 1)").onFinish((function(){return t.afterAnimation(b)}),{oneTimeCallback:!0}).progressEnd(v?1:0,this._isOpen?1-f:f,300)}else Object(o.b)(!1,"isAnimating has to be true")}},{key:"beforeAnimation",value:function(e){Object(o.b)(!this.isAnimating,"_before() should not be called while animating"),this.el.classList.add(p),this.backdropEl&&this.backdropEl.classList.add(m),this.blocker.block(),this.isAnimating=!0,e?this.ionWillOpen.emit():this.ionWillClose.emit()}},{key:"afterAnimation",value:function(e){Object(o.b)(this.isAnimating,"_before() should be called while animating"),this._isOpen=e,this.isAnimating=!1,this._isOpen||this.blocker.unblock(),e?(this.contentEl&&this.contentEl.classList.add(b),this.ionDidOpen.emit()):(this.el.classList.remove(p),this.contentEl&&this.contentEl.classList.remove(b),this.backdropEl&&this.backdropEl.classList.remove(m),this.animation&&this.animation.stop(),this.ionDidClose.emit())}},{key:"updateState",value:function(){var e=this._isActive();this.gesture&&this.gesture.enable(e&&this.swipeGesture),!e&&this._isOpen&&this.forceClosing(),this.disabled||c.a._setActiveMenu(this),Object(o.b)(!this.isAnimating,"can not be animating")}},{key:"forceClosing",value:function(){Object(o.b)(this._isOpen,"menu cannot be closed"),this.isAnimating=!0,this.animation.direction("reverse").play({sync:!0}),this.afterAnimation(!1)}},{key:"render",value:function(){var e,t=this,n=this.isEndSide,r=this.type,o=this.disabled,a=this.mode,s=this.isPaneVisible;return Object(i.i)(i.a,{role:"navigation",class:(e={},_defineProperty(e,a,!0),_defineProperty(e,"menu-type-".concat(r),!0),_defineProperty(e,"menu-enabled",!o),_defineProperty(e,"menu-side-end",n),_defineProperty(e,"menu-side-start",!n),_defineProperty(e,"menu-pane-visible",s),e)},Object(i.i)("div",{class:"menu-inner",ref:function(e){return t.menuInnerEl=e}},Object(i.i)("slot",null)),Object(i.i)("ion-backdrop",{ref:function(e){return t.backdropEl=e},class:"menu-backdrop",tappable:!1,stopPropagation:!1}))}},{key:"el",get:function(){return Object(i.f)(this)}}],[{key:"watchers",get:function(){return{type:["typeChanged"],disabled:["disabledChanged"],side:["sideChanged"],swipeGesture:["swipeGestureChanged"]}}},{key:"style",get:function(){return":host{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color,#fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}:host(.show-menu){display:block}.menu-inner{left:0;right:auto;top:0;bottom:0;-webkit-transform:translate3d(-9999px,0,0);transform:translate3d(-9999px,0,0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:strict}:host-context([dir=rtl]) .menu-inner,[dir=rtl] .menu-inner{left:unset;right:unset;left:auto;right:0;-webkit-transform:translate3d(calc(-1 * -9999px),0,0);transform:translate3d(calc(-1 * -9999px),0,0)}:host(.menu-side-start) .menu-inner{--ion-safe-area-right:0px;right:auto;left:0}:host(.menu-side-end) .menu-inner{--ion-safe-area-left:0px;right:0;left:auto}ion-backdrop{display:none;opacity:.01;z-index:-1}@media (max-width:340px){.menu-inner{--width:264px}}:host(.menu-type-reveal){z-index:0}:host(.menu-type-reveal.show-menu) .menu-inner{-webkit-transform:translateZ(0);transform:translateZ(0)}:host(.menu-type-overlay){z-index:1000}:host(.menu-type-overlay) .show-backdrop{display:block;cursor:pointer}:host(.menu-pane-visible){width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}:host(.menu-pane-visible) .menu-inner{left:0;right:0;width:auto;-webkit-transform:none!important;transform:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}:host(.menu-pane-visible) ion-backdrop{display:hidden!important}:host(.menu-type-overlay) .menu-inner{-webkit-box-shadow:4px 0 16px rgba(0,0,0,.18);box-shadow:4px 0 16px rgba(0,0,0,.18)}"}}]),e}(),l=function(e,t,n){return Math.max(0,t!==n?-e:e)},d=function(e,t,n,i){return n?t>=e.innerWidth-i:t<=i},p="show-menu",m="show-backdrop",b="menu-content-open",f=function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.a.get(t);case 2:if(n=e.sent,e.t0=!n,e.t0){e.next=8;break}return e.next=7,n.isActive();case 7:e.t0=!e.sent;case 8:return e.abrupt("return",!e.t0);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),g=function(){function e(t){var n=this;_classCallCheck(this,e),Object(i.k)(this,t),this.visible=!1,this.disabled=!1,this.autoHide=!0,this.type="button",this.onClick=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.a.toggle(n.menu));case 1:case"end":return e.stop()}}),e)})))}var t;return _createClass(e,[{key:"componentDidLoad",value:function(){this.visibilityChanged()}},{key:"visibilityChanged",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(this.menu);case 2:this.visible=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this.color,t=this.disabled,n=Object(i.d)(this),o=r.b.get("menuIcon","ios"===n?"menu-outline":"menu-sharp"),a=this.autoHide&&!this.visible,s={type:this.type};return Object(i.i)(i.a,{onClick:this.onClick,"aria-disabled":t?"true":null,"aria-hidden":a?"true":null,class:Object.assign(Object.assign(_defineProperty({},n,!0),Object(u.a)(e)),{button:!0,"menu-button-hidden":a,"menu-button-disabled":t,"in-toolbar":Object(u.c)("ion-toolbar",this.el),"ion-activatable":!0,"ion-focusable":!0})},Object(i.i)("button",Object.assign({},s,{disabled:t,class:"button-native"}),Object(i.i)("span",{class:"button-inner"},Object(i.i)("slot",null,Object(i.i)("ion-icon",{icon:o,mode:n,lazy:!1}))),"md"===n&&Object(i.i)("ion-ripple-effect",{type:"unbounded"})))}},{key:"el",get:function(){return Object(i.f)(this)}}],[{key:"style",get:function(){return':host{--background:transparent;--color-focused:currentColor;--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-inner{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}ion-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}:host(.menu-button-hidden){display:none}:host(.menu-button-disabled){cursor:default;opacity:.5;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native:after{background:var(--background-focused);opacity:var(--background-focused-opacity)}.button-native:after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}@media (any-hover:hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native:after{background:var(--background-hover);opacity:var(--background-hover-opacity,0)}}:host(.ion-color) .button-native{color:var(--ion-color-base)}:host(.in-toolbar){color:var(--ion-toolbar-color,var(--color))}:host{--background-focused:currentColor;--background-focused-opacity:.12;--background-hover:currentColor;--background-hover-opacity:.04;--border-radius:50%;--color:initial;--padding-start:8px;--padding-end:8px;width:48px;height:48px;font-size:24px}:host(.ion-color.ion-focused):after{background:var(--ion-color-base)}@media (any-hover:hover){:host(.ion-color:hover) .button-native:after{background:var(--ion-color-base)}}'}}]),e}(),v=function(){function e(t){var n=this;_classCallCheck(this,e),Object(i.k)(this,t),this.visible=!1,this.autoHide=!0,this.onClick=function(){return c.a.toggle(n.menu)}}var t;return _createClass(e,[{key:"connectedCallback",value:function(){this.visibilityChanged()}},{key:"visibilityChanged",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(this.menu);case 2:this.visible=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e,t=Object(i.d)(this),n=this.autoHide&&!this.visible;return Object(i.i)(i.a,{onClick:this.onClick,"aria-hidden":n?"true":null,class:(e={},_defineProperty(e,t,!0),_defineProperty(e,"menu-toggle-hidden",n),e)},Object(i.i)("slot",null))}}],[{key:"style",get:function(){return":host(.menu-toggle-hidden){display:none}"}}]),e}()}}]);
e
print_each_packet.rs
//! A "print-each-packet" server with Tokio //! //! This server will create a TCP listener, accept connections in a loop, and //! put down in the stdout everything that's read off of each TCP connection. //! //! Because the Tokio runtime uses a thread pool, each TCP connection is //! processed concurrently with all other TCP connections across multiple //! threads. //! //! To see this server in action, you can run this in one terminal: //! //! cargo run --example print\_each\_packet //! //! and in another terminal you can run: //! //! cargo run --example connect 127.0.0.1:8080 //! //! Each line you type in to the `connect` terminal should be written to terminal! //! //! Minimal js example: //! //! ```js //! var net = require("net"); //! //! var listenPort = 8080; //! //! var server = net.createServer(function (socket) { //! socket.on("data", function (bytes) { //! console.log("bytes", bytes); //! }); //! //! socket.on("end", function() { //! console.log("Socket received FIN packet and closed connection"); //! }); //! socket.on("error", function (error) { //! console.log("Socket closed with error", error); //! }); //! //! socket.on("close", function (with_error) { //! if (with_error) { //! console.log("Socket closed with result: Err(SomeError)"); //! } else { //! console.log("Socket closed with result: Ok(())"); //! } //! }); //! //! }); //! //! server.listen(listenPort); //! //! console.log("Listening on:", listenPort); //! ``` //! #![deny(warnings, rust_2018_idioms)] use std::env; use std::net::SocketAddr; use tokio; use tokio::codec::Decoder; use tokio::net::TcpListener; use tokio::prelude::*; use tokio_codec::BytesCodec; fn main() -> Result<(), Box<dyn std::error::Error>>
{ // Allow passing an address to listen on as the first argument of this // program, but otherwise we'll just set up our TCP listener on // 127.0.0.1:8080 for connections. let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string()); let addr = addr.parse::<SocketAddr>()?; // Next up we create a TCP listener which will listen for incoming // connections. This TCP listener is bound to the address we determined // above and must be associated with an event loop, so we pass in a handle // to our event loop. After the socket's created we inform that we're ready // to go and start accepting connections. let socket = TcpListener::bind(&addr)?; println!("Listening on: {}", addr); // Here we convert the `TcpListener` to a stream of incoming connections // with the `incoming` method. We then define how to process each element in // the stream with the `for_each` method. // // This combinator, defined on the `Stream` trait, will allow us to define a // computation to happen for all items on the stream (in this case TCP // connections made to the server). The return value of the `for_each` // method is itself a future representing processing the entire stream of // connections, and ends up being our server. let done = socket .incoming() .map_err(|e| println!("failed to accept socket; error = {:?}", e)) .for_each(move |socket| { // Once we're inside this closure this represents an accepted client // from our server. The `socket` is the client connection (similar to // how the standard library operates). // // We're parsing each socket with the `BytesCodec` included in `tokio_io`, // and then we `split` each codec into the reader/writer halves. // // See https://docs.rs/tokio-codec/0.1/src/tokio_codec/bytes_codec.rs.html let framed = BytesCodec::new().framed(socket); let (_writer, reader) = framed.split(); let processor = reader .for_each(|bytes| { println!("bytes: {:?}", bytes); Ok(()) }) // After our copy operation is complete we just print out some helpful // information. .and_then(|()| { println!("Socket received FIN packet and closed connection"); Ok(()) }) .or_else(|err| { println!("Socket closed with error: {:?}", err); // We have to return the error to catch it in the next ``.then` call Err(err) }) .then(|result| { println!("Socket closed with result: {:?}", result); Ok(()) }); // And this is where much of the magic of this server happens. We // crucially want all clients to make progress concurrently, rather than // blocking one on completion of another. To achieve this we use the // `tokio::spawn` function to execute the work in the background. // // This function will transfer ownership of the future (`msg` in this // case) to the Tokio runtime thread pool that. The thread pool will // drive the future to completion. // // Essentially here we're executing a new task to run concurrently, // which will allow all of our clients to be processed concurrently. tokio::spawn(processor) }); // And finally now that we've define what our server is, we run it! // // This starts the Tokio runtime, spawns the server task, and blocks the // current thread until all tasks complete execution. Since the `done` task // never completes (it just keeps accepting sockets), `tokio::run` blocks // forever (until ctrl-c is pressed). tokio::run(done); Ok(()) }
register.component.ts
* Version 0.1 (Working first step blog) */ import { UserService } from '../../services/user.service'; import { User } from './../../models/user'; import { Component, OnInit } from '@angular/core'; import { AuthenticationService } from 'src/app/services/authentication.service'; @Component({ selector: 'register', templateUrl: './register.component.html', styleUrls: ['./register.component.scss'], providers: [UserService] }) export class RegisterComponent implements OnInit { public page_title: string; public user: User; public status: string; constructor( private _userService: UserService, public authService: AuthenticationService ) { this.page_title = 'Regístrate'; // this.user = new User(-1, '', '', 'ROLE_USER', '', '', '', ''); } ngOnInit() { // console.log(this._userService.test()); } onSubmit(form) { // this._userService.register(this.user).subscribe( // response => { // if(response.status == "succes") { // this.status = response.status; // form.reset(); // } else { // this.status = 'error'; // } // }, // error => { // this.status = 'error'; // console.log(<any>error); // } // ); } }
/* * Copyright 2019 Ignacio Loyola @nodonade.com
snippets.py
from django.apps import apps from django.core.urlresolvers import reverse from django.http import Http404 from django.shortcuts import get_object_or_404, redirect, render from django.utils.text import capfirst from django.utils.translation import ugettext as _ from wagtail.utils.pagination import paginate from wagtail.wagtailadmin import messages from wagtail.wagtailadmin.edit_handlers import ( ObjectList, extract_panel_definitions_from_model_class) from wagtail.wagtailadmin.forms import SearchForm from wagtail.wagtailadmin.utils import permission_denied from wagtail.wagtailsearch.backends import get_search_backend from wagtail.wagtailsearch.index import class_is_indexed from wagtail.wagtailsnippets.models import get_snippet_models from wagtail.wagtailsnippets.permissions import get_permission_name, user_can_edit_snippet_type # == Helper functions == def get_snippet_model_from_url_params(app_name, model_name): """ Retrieve a model from an app_label / model_name combo. Raise Http404 if the model is not a valid snippet type. """ try: model = apps.get_model(app_name, model_name) except LookupError: raise Http404 if model not in get_snippet_models(): # don't allow people to hack the URL to edit content types that aren't registered as snippets raise Http404 return model SNIPPET_EDIT_HANDLERS = {} def get_snippet_edit_handler(model): if model not in SNIPPET_EDIT_HANDLERS: if hasattr(model, 'edit_handler'): # use the edit handler specified on the page class edit_handler = model.edit_handler else: panels = extract_panel_definitions_from_model_class(model) edit_handler = ObjectList(panels) SNIPPET_EDIT_HANDLERS[model] = edit_handler.bind_to_model(model) return SNIPPET_EDIT_HANDLERS[model] # == Views == def index(request): snippet_model_opts = [ model._meta for model in get_snippet_models() if user_can_edit_snippet_type(request.user, model)] return render(request, 'wagtailsnippets/snippets/index.html', { 'snippet_model_opts': sorted( snippet_model_opts, key=lambda x: x.verbose_name.lower())}) def list(request, app_label, model_name): model = get_snippet_model_from_url_params(app_label, model_name) permissions = [ get_permission_name(action, model) for action in ['add', 'change', 'delete'] ] if not any([request.user.has_perm(perm) for perm in permissions]): return permission_denied(request) items = model.objects.all() # Search is_searchable = class_is_indexed(model) is_searching = False search_query = None if is_searchable and 'q' in request.GET:
else: search_form = SearchForm(placeholder=_("Search %(snippet_type_name)s") % { 'snippet_type_name': model._meta.verbose_name_plural }) paginator, paginated_items = paginate(request, items) # Template if request.is_ajax(): template = 'wagtailsnippets/snippets/results.html' else: template = 'wagtailsnippets/snippets/type_index.html' return render(request, template, { 'model_opts': model._meta, 'items': paginated_items, 'can_add_snippet': request.user.has_perm(get_permission_name('add', model)), 'is_searchable': is_searchable, 'search_form': search_form, 'is_searching': is_searching, 'query_string': search_query, }) def create(request, app_label, model_name): model = get_snippet_model_from_url_params(app_label, model_name) permission = get_permission_name('add', model) if not request.user.has_perm(permission): return permission_denied(request) instance = model() edit_handler_class = get_snippet_edit_handler(model) form_class = edit_handler_class.get_form_class(model) if request.POST: form = form_class(request.POST, request.FILES, instance=instance) if form.is_valid(): form.save() messages.success( request, _("{snippet_type} '{instance}' created.").format( snippet_type=capfirst(model._meta.verbose_name), instance=instance ), buttons=[ messages.button(reverse( 'wagtailsnippets:edit', args=(app_label, model_name, instance.id) ), _('Edit')) ] ) return redirect('wagtailsnippets:list', app_label, model_name) else: messages.error(request, _("The snippet could not be created due to errors.")) edit_handler = edit_handler_class(instance=instance, form=form) else: form = form_class(instance=instance) edit_handler = edit_handler_class(instance=instance, form=form) return render(request, 'wagtailsnippets/snippets/create.html', { 'model_opts': model._meta, 'edit_handler': edit_handler, }) def edit(request, app_label, model_name, id): model = get_snippet_model_from_url_params(app_label, model_name) permission = get_permission_name('change', model) if not request.user.has_perm(permission): return permission_denied(request) instance = get_object_or_404(model, id=id) edit_handler_class = get_snippet_edit_handler(model) form_class = edit_handler_class.get_form_class(model) if request.POST: form = form_class(request.POST, request.FILES, instance=instance) if form.is_valid(): form.save() messages.success( request, _("{snippet_type} '{instance}' updated.").format( snippet_type=capfirst(model._meta.verbose_name_plural), instance=instance ), buttons=[ messages.button(reverse( 'wagtailsnippets:edit', args=(app_label, model_name, instance.id) ), _('Edit')) ] ) return redirect('wagtailsnippets:list', app_label, model_name) else: messages.error(request, _("The snippet could not be saved due to errors.")) edit_handler = edit_handler_class(instance=instance, form=form) else: form = form_class(instance=instance) edit_handler = edit_handler_class(instance=instance, form=form) return render(request, 'wagtailsnippets/snippets/edit.html', { 'model_opts': model._meta, 'instance': instance, 'edit_handler': edit_handler }) def delete(request, app_label, model_name, id): model = get_snippet_model_from_url_params(app_label, model_name) permission = get_permission_name('delete', model) if not request.user.has_perm(permission): return permission_denied(request) instance = get_object_or_404(model, id=id) if request.POST: instance.delete() messages.success( request, _("{snippet_type} '{instance}' deleted.").format( snippet_type=capfirst(model._meta.verbose_name_plural), instance=instance ) ) return redirect('wagtailsnippets:list', app_label, model_name) return render(request, 'wagtailsnippets/snippets/confirm_delete.html', { 'model_opts': model._meta, 'instance': instance, }) def usage(request, app_label, model_name, id): model = get_snippet_model_from_url_params(app_label, model_name) instance = get_object_or_404(model, id=id) paginator, used_by = paginate(request, instance.get_usage()) return render(request, "wagtailsnippets/snippets/usage.html", { 'instance': instance, 'used_by': used_by })
search_form = SearchForm(request.GET, placeholder=_("Search %(snippet_type_name)s") % { 'snippet_type_name': model._meta.verbose_name_plural }) if search_form.is_valid(): search_query = search_form.cleaned_data['q'] search_backend = get_search_backend() items = search_backend.search(search_query, items) is_searching = True
settings.js
// @flow import type { BaseModel } from './index'; import * as db from '../common/database'; import { UPDATE_CHANNEL_STABLE } from '../common/constants'; import * as hotkeys from '../common/hotkeys'; type BaseSettings = { showPasswords: boolean, useBulkHeaderEditor: boolean, followRedirects: boolean, editorFontSize: number, editorIndentSize: number, editorLineWrapping: boolean, editorKeyMap: string, editorIndentWithTabs: boolean, httpProxy: string, httpsProxy: string, noProxy: string, proxyEnabled: boolean, timeout: number, validateSSL: boolean, forceVerticalLayout: boolean, autoHideMenuBar: boolean, theme: string, maxRedirects: number, maxHistoryResponses: number, pluginPath: string, nunjucksPowerUserMode: boolean, deviceId: string | null, updateChannel: string, updateAutomatically: boolean, disableUpdateNotification: boolean, environmentHighlightColorStyle: string, autocompleteDelay: number, fontMonospace: string | null, fontInterface: string | null, fontSize: number, fontVariantLigatures: boolean, maxTimelineDataSizeKB: number, // Feature flags enableSyncBeta: boolean, hotKeyRegistry: hotkeys.HotKeyRegistry, }; export type Settings = BaseModel & BaseSettings; export const name = 'Settings'; export const type = 'Settings'; export const prefix = 'set'; export const canDuplicate = false; export const canSync = false; export function init(): BaseSettings { return { showPasswords: false, useBulkHeaderEditor: false, followRedirects: true, editorFontSize: 11, editorIndentSize: 2, editorLineWrapping: true, editorKeyMap: 'default', editorIndentWithTabs: true, httpProxy: '', httpsProxy: '', noProxy: '', maxRedirects: -1, maxHistoryResponses: 20, proxyEnabled: false, timeout: 0, validateSSL: true, forceVerticalLayout: false, autoHideMenuBar: false, theme: 'default', pluginPath: '', nunjucksPowerUserMode: false, deviceId: null, updateChannel: UPDATE_CHANNEL_STABLE, updateAutomatically: true, disableUpdateNotification: false, environmentHighlightColorStyle: 'sidebar-indicator', autocompleteDelay: 700, fontMonospace: null, fontInterface: null, fontSize: 13, fontVariantLigatures: false, maxTimelineDataSizeKB: 10, enableSyncBeta: false, hotKeyRegistry: hotkeys.newDefaultRegistry(), }; } export function
(doc: Settings): Settings { doc = migrateEnsureHotKeys(doc); return doc; } export async function all(patch: Object = {}): Promise<Array<Settings>> { const settings = await db.all(type); if (settings.length === 0) { return [await getOrCreate()]; } else { return settings; } } export async function create(patch: Object = {}): Promise<Settings> { return db.docCreate(type, patch); } export async function update(settings: Settings, patch: Object): Promise<Settings> { return db.docUpdate(settings, patch); } export async function getOrCreate(patch: Object = {}): Promise<Settings> { const results = await db.all(type); if (results.length === 0) { return create(patch); } else { return results[0]; } } /** * Ensure map is updated when new hotkeys are added */ function migrateEnsureHotKeys(settings: Settings): Settings { settings.hotKeyRegistry = { ...hotkeys.newDefaultRegistry(), ...settings.hotKeyRegistry, }; return settings; }
migrate
devices.rs
// Copyright © 2021 HQS Quantum Simulations GmbH. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except // in compliance with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed under the // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either // express or implied. See the License for the specific language governing permissions and // limitations under the License. use ndarray::{array, Array2}; use roqoqo::devices::Device; use std::collections::HashMap; #[derive(Debug, Clone, PartialEq)] struct TestDevice { number_qubits: usize, single_qubit_gates: HashMap<String, HashMap<usize, f64>>, two_qubit_gates: HashMap<String, HashMap<(usize, usize), f64>>, multi_qubit_gates: HashMap<String, f64>, rates: HashMap<usize, Array2<f64>>, } impl TestDevice { pub fn new( number_qubits: usize, single_qubit_gates: HashMap<String, HashMap<usize, f64>>, two_qubit_gates: HashMap<String, HashMap<(usize, usize), f64>>, multi_qubit_gates: HashMap<String, f64>, rates: HashMap<usize, Array2<f64>>, ) -> Self { TestDevice { number_qubits, single_qubit_gates, two_qubit_gates, multi_qubit_gates, rates, } } } impl Device for TestDevice { fn single_qubit_gate_time(&self, hqslang: &str, qubit: &usize) -> Option<f64> { match self.single_qubit_gates.get(&hqslang.to_string()) { Some(x) => x.get(&qubit).map(|x| *x), None => None, } } fn two_qubit_gate_time(&self, hqslang: &str, control: &usize, target: &usize) -> Option<f64> { match self.two_qubit_gates.get(&hqslang.to_string()) { Some(x) => x.get(&(*control, *target)).map(|x| *x), None => None, } } fn multi_qubit_gate_time(&self, hqslang: &str, _qubits: &[usize]) -> Option<f64> { self.multi_qubit_gates.get(&hqslang.to_string()).map(|x| *x) } fn qubit_decoherence_rates(&self, qubit: &usize) -> Option<Array2<f64>> { self.rates.get(&qubit).map(|x| x.to_owned()) } fn number_qubits(&self) -> usize { self.number_qubits } fn t
&self) -> Vec<(usize, usize)> { let mut edges: Vec<(usize, usize)> = Vec::new(); for row in 0..self.number_qubits { for column in row + 1..self.number_qubits { edges.push((row, column)); } } edges } } /// Basic functional test #[test] fn it_works() { let mut rotate_x_map: HashMap<usize, f64> = HashMap::new(); rotate_x_map.insert(0, 0.1); rotate_x_map.insert(1, 0.05); rotate_x_map.insert(2, 0.07); let mut single_qubit_gates: HashMap<String, HashMap<usize, f64>> = HashMap::new(); single_qubit_gates.insert("RotateX".to_string(), rotate_x_map); let mut cnot_map: HashMap<(usize, usize), f64> = HashMap::new(); cnot_map.insert((0, 1), 0.5); cnot_map.insert((0, 2), 0.4); cnot_map.insert((1, 2), 0.3); let mut two_qubit_gates: HashMap<String, HashMap<(usize, usize), f64>> = HashMap::new(); two_qubit_gates.insert("CNOT".to_string(), cnot_map); let mut multi_qubit_gates: HashMap<String, f64> = HashMap::new(); multi_qubit_gates.insert("MultiQubitMS".to_string(), 0.8); let mut rates: HashMap<usize, Array2<f64>> = HashMap::new(); rates.insert( 0, array![[0.003, 0.0, 0.0], [0.0, 0.0, 00.0], [0.0, 0.0, 0.0]], ); rates.insert( 1, array![[0.0, 0.0, 0.0], [0.0, 0.002, 0.0], [0.0, 0.0, 0.0]], ); rates.insert( 2, array![[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.001, 0.0]], ); let device = TestDevice::new( 3, single_qubit_gates, two_qubit_gates, multi_qubit_gates, rates, ); let array: Array2<f64> = array![[0.003, 0.0, 0.0], [0.0, 0.0, 00.0], [0.0, 0.0, 0.0]]; assert_eq!(device.number_qubits(), 3usize); assert_eq!(device.qubit_decoherence_rates(&0), Some(array)); assert_eq!(device.single_qubit_gate_time("RotateX", &0), Some(0.1f64)); assert_eq!(device.single_qubit_gate_time("RotateX", &3), None); assert_eq!(device.single_qubit_gate_time("RotateZ", &0), None); assert_eq!(device.two_qubit_gate_time("CNOT", &0, &1), Some(0.5f64)); assert_eq!(device.two_qubit_gate_time("CNOT", &0, &3), None); assert_eq!(device.two_qubit_gate_time("CZ", &0, &1), None); assert_eq!( device.multi_qubit_gate_time("MultiQubitMS", &[0, 1, 2]), Some(0.8f64) ); assert_eq!(device.multi_qubit_gate_time("Other", &[0, 1, 2]), None); let test_edges = vec![(0, 1), (0, 2), (1, 2)]; let edges = device.two_qubit_edges(); assert_eq!(test_edges.len(), edges.len()); for edge in edges { assert!(test_edges.contains(&edge)); } } /// Basic functional test #[test] fn change_device_test() { let mut rotate_x_map: HashMap<usize, f64> = HashMap::new(); rotate_x_map.insert(0, 0.1); rotate_x_map.insert(1, 0.05); rotate_x_map.insert(2, 0.07); let mut single_qubit_gates: HashMap<String, HashMap<usize, f64>> = HashMap::new(); single_qubit_gates.insert("RotateX".to_string(), rotate_x_map); let mut cnot_map: HashMap<(usize, usize), f64> = HashMap::new(); cnot_map.insert((0, 1), 0.5); cnot_map.insert((0, 2), 0.4); cnot_map.insert((1, 2), 0.3); let mut two_qubit_gates: HashMap<String, HashMap<(usize, usize), f64>> = HashMap::new(); two_qubit_gates.insert("CNOT".to_string(), cnot_map); let mut multi_qubit_gates: HashMap<String, f64> = HashMap::new(); multi_qubit_gates.insert("MultiQubitMS".to_string(), 0.8); let mut rates: HashMap<usize, Array2<f64>> = HashMap::new(); rates.insert( 0, array![[0.003, 0.0, 0.0], [0.0, 0.0, 00.0], [0.0, 0.0, 0.0]], ); rates.insert( 1, array![[0.0, 0.0, 0.0], [0.0, 0.002, 0.0], [0.0, 0.0, 0.0]], ); rates.insert( 2, array![[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.001, 0.0]], ); let mut device = TestDevice::new( 3, single_qubit_gates, two_qubit_gates, multi_qubit_gates, rates, ); let empty_serialisation: Vec<u8> = Vec::new(); let result = device.change_device("", &empty_serialisation); assert!(result.is_err()); }
wo_qubit_edges(
exponentiation.go
// exponentiation.go // description: Implementation of Modular Exponentiation Algorithm // details: // A simple implementation of Modular Exponentiation - [Modular Exponenetation wiki](https://en.wikipedia.org/wiki/Modular_exponentiation) // author(s) [Taj](https://github.com/tjgurwara99) // see exponentiation_test.go package modular import ( "errors" "math" ) // ErrorIntOverflow For asserting that the values do not overflow in Int64 var ErrorIntOverflow = errors.New("integer overflow") // ErrorNegativeExponent for asserting that the exponent we receive is positive var ErrorNegativeExponent = errors.New("negative Exponent provided") // Exponentiation returns base^exponent % mod func
(base, exponent, mod int64) (int64, error) { if mod == 1 { return 0, nil } if exponent < 0 { return -1, ErrorNegativeExponent } _, err := Multiply64BitInt(mod-1, mod-1) if err != nil { return -1, err } var result int64 = 1 base = base % mod for exponent > 0 { if exponent%2 == 1 { result = (result * base) % mod } exponent = exponent >> 1 base = (base * base) % mod } return result, nil } // Multiply64BitInt Checking if the integer multiplication overflows func Multiply64BitInt(left, right int64) (int64, error) { if math.Abs(float64(left)) > float64(math.MaxInt64)/math.Abs(float64(right)) { return 0, ErrorIntOverflow } return left * right, nil }
Exponentiation
0005_course_last_modified.py
# Generated by Django 2.0.8 on 2019-01-11 00:05 from django.db import migrations, models class
(migrations.Migration): dependencies = [ ("course_catalog", "0004_make_short_description_nullable_20190110_2018") ] operations = [ migrations.AddField( model_name="course", name="last_modified", field=models.DateTimeField(null=True), ), migrations.AlterField( model_name="course", name="instructors", field=models.ManyToManyField( blank=True, related_name="courses", to="course_catalog.CourseInstructor" ), ), migrations.AlterField( model_name="course", name="prices", field=models.ManyToManyField( blank=True, related_name="courses", to="course_catalog.CoursePrice" ), ), migrations.AlterField( model_name="course", name="topics", field=models.ManyToManyField( blank=True, related_name="courses", to="course_catalog.CourseTopic" ), ), ]
Migration
story.js
import c from '../utils/constants'; // import sc from './storyConstants'; import intro from './scenes/intro'; import mainMenu from './scenes/mainMenu'; import scene001 from './scenes/scene001'; import scene002 from './scenes/scene002'; import plates from '../plates'; import timing from '../utils/timing'; import hud from '../hud'; import entities from '../entities/entities'; import soundEffects from '../audio/soundEffects'; import music from '../audio/music'; import { shields, status, makeName, storePlayerProgress, readPlayerProgress, hasThePlayerMadeProgress, alertsAndWarnings, dialog, } from '../utils/helpers'; import formations from '../behavior/formations'; import shots from '../shots'; import gameMenus from '../gameMenus'; import initialGameState from '../initialGameState'; import controlSchemes from '../controlSchemes'; const story = { handlers: { dispatch: null, state: null, stage: null, playVolume: null, playVolumeBoundaries: null, frameZero: null, hudShouldBeShowing: null, activeKeyboardLayout: null, }, // gets its values in App.js sceneList: [ { id: 'intro', sceneObject: intro, hasTitlePlate: false, hasEntities: false, hasGameplay: false, showStatusBar: false, }, { id: 'mainMenu', sceneObject: mainMenu, hasTitlePlate: false, hasEntities: false, hasGameplay: false, showStatusBar: false, }, { id: '001', sceneObject: scene001, hasTitlePlate: true, hasEntities: true, hasGameplay: true, showStatusBar: true, }, { id: '002', sceneObject: scene002, hasTitlePlate: true, hasEntities: true, hasGameplay: true, showStatusBar: true, }, ], currentScene: null, currentSceneBeat: null, missionFailureWasTriggered: false, noOfTimesHitEscMessageWasAppended: 0, escAddendum: '&nbsp;&nbsp;&nbsp;&lt;&nbsp;&nbsp;&nbsp;Hit [ESC] to see your current objectives', currentObjectives: { show: [], advanceWhen: [], }, currentStoryEntities: {}, noProgressYetMessage: "According to your browser's storage, you haven't made any progress in this game yet, please choose 'New game' instead!", assertClassification(entityId) { const storyEntity = story.currentStoryEntities[entityId]; if (storyEntity === undefined) { return ''; } else { const fullTypeName = storyEntity.type; if ( fullTypeName.includes('fighter') || fullTypeName.includes('fenrir') || fullTypeName.includes('valkyrie') ) { return 'Fighter '; } else if (fullTypeName.includes('shuttle')) { return 'Shuttle '; } else if (fullTypeName.includes('freighter')) { return 'Freighter '; } else if (fullTypeName.includes('container')) { return 'Container '; } } }, advance(playScene = null, playSceneBeat = 0, hurryUp = false) { // call with playScene = null to auto-advance // to the next scene if (c.debug.sequentialEvents) console.log('advance()', playScene, playSceneBeat); const currentState = story.handlers.state(); let cleanUpNeeded = false; const playerId = c.playerIdPartial + currentState.game.playerShips.currentIdSuffix; const playerShipType = currentState.game.playerShips.current; if (story.currentScene === null) { story.currentScene = story.sceneList[0].id; } else { if (playSceneBeat === 0) cleanUpNeeded = true; if (playScene !== null) { story.currentScene = playScene; } else { let index = story.sceneList.findIndex( (el) => el.id === story.currentScene ); index++; if (story.sceneList[index] !== undefined) { // more scenes exist story.currentScene = story.sceneList[index].id; } else { // no more scenes, end of the game if (c.debug.sequentialEvents) console.log('THIS IS THE END OF THE GAME'); plates.fullMatte(); plates.loadPlate('the_end'); plates.fadeInPlate(25); timing.toggleEntityMovement(false, 'story.js@advance() 1', 1000); timing.setTimeout( () => { soundEffects.muteUnmuteAllLoops('story.js@advance() 2', true); }, timing.modes.play, 1000 ); plates.fadeOutPlate(25, 7000); timing.setTimeout( () => { story.advance('mainMenu', 0); }, timing.modes.play, 8200 ); return; } } } if (c.debug.sequentialEvents) console.log('story.currentScene:', story.currentScene); const currentSceneListObject = story.sceneList.find( (el) => el.id === story.currentScene ); const currentSceneObject = currentSceneListObject.sceneObject; if (playSceneBeat === 0) { if (currentSceneListObject.hasEntities) { story.currentStoryEntities = currentSceneObject.entities; } story.handlers.playVolume.current = currentSceneObject.playVolume; story.handlers.playVolume.recalculateSoftBoundaries(); story.handlers.playVolumeBoundaries.reDraw(currentSceneObject.playVolume); story.missionFailureWasTriggered = false; if (currentSceneListObject.id !== 'mainMenu') { const localStoragePlayerProgress = readPlayerProgress(); if (currentSceneListObject.id === 'intro') { if (localStoragePlayerProgress === null) { // this player is a first time visitor if (c.debug.localStorage) console.log( 'no localStorage string found, populating with the defaults from initialGameState.js' ); storePlayerProgress( story.handlers.state, currentSceneListObject.id ); } else { if (c.debug.localStorage) console.log( 'updating player progress from localStorage:', localStoragePlayerProgress ); story.handlers.dispatch({ type: c.actions.UPDATE_PLAYER_PROGRESS_BASED_ON_LOCAL_STORAGE, localStoragePlayerProgress: localStoragePlayerProgress, }); } } else { const playersBestSceneId = localStoragePlayerProgress.bestSceneId; const playersBestSceneIndex = story.sceneList.findIndex( (sc) => sc.id === playersBestSceneId ); const currentSceneIndex = story.sceneList.findIndex( (sc2) => sc2.id === currentSceneListObject.id ); let writeBestSceneId = playersBestSceneId; if (currentSceneIndex > playersBestSceneIndex) writeBestSceneId = currentSceneListObject.id; storePlayerProgress(story.handlers.state, writeBestSceneId); } } } let currentStateScene = currentState.game.currentScene; if (currentStateScene !== story.currentScene) { story.handlers.dispatch({ type: c.actions.SET_CURRENT_SCENE, newCurrentScene: story.currentScene, }); } story.currentSceneBeat = playSceneBeat; if (c.debug.sequentialEvents) console.log('story.currentSceneBeat:', story.currentSceneBeat); const currentSceneBeatObj = currentSceneObject.storyBeats[story.currentSceneBeat]; if (c.debug.sequentialEvents) console.log(currentSceneObject); if (cleanUpNeeded) { story.cleanUp(); } if (currentSceneListObject.hasTitlePlate && playSceneBeat === 0) { currentSceneObject.handlers.checkBeatCompletion = story.checkBeatCompletion; status.add( 'aqua', `---&nbsp;&nbsp;&nbsp;${currentSceneObject.titlePlate.mainText}&nbsp;&nbsp;&nbsp;---`, timing.times.play ); plates.fullMatte(); plates.loadPlate( 'mission_title', -1, currentSceneObject.titlePlate.mainText, currentSceneObject.titlePlate.wittyText ); timing.toggleEntityMovement(false, 'story.js@advance() 3'); soundEffects.muteUnmuteAllLoops('story.js@advance() 4', true); plates.fadeInPlate(25); plates.fadeOutMatte(50, 4000); timing.toggleEntityMovement(true, 'story.js@advance() 5', 4000); timing.setTimeout( () => { soundEffects.muteUnmuteAllLoops('story.js@advance() 6', false); }, timing.modes.play, 4000 ); plates.fadeOutPlate(25, 6000); } if (!currentSceneListObject.hasEntities) { timing.toggleEntityMovement(false, 'story.js@advance() 7'); } if (currentSceneListObject.showStatusBar) { document.getElementById('game__status').style.display = 'flex'; } else { document.getElementById('game__status').style.display = 'none'; } //register new objectives if (currentSceneListObject.hasGameplay) { const objectiveUpdates = currentSceneBeatObj.registerObjectives(); story.updateCurrentObjectives(objectiveUpdates); } // set the keyboard layout story.handlers.activeKeyboardLayout.current = currentSceneBeatObj.keyboardLayout; story.handlers.activeKeyboardLayout.currentStoryBeatLayout = currentSceneBeatObj.keyboardLayout; // scene object execution currentSceneBeatObj.execute({ playerId, playerShipType, hurryUp }); if (currentSceneBeatObj.cameraMode === c.cameraModes.gameplay) { story.handlers.hudShouldBeShowing.actual = true; timing.setTrigger( 'story-hud-trigger1', () => { shots.registerEntityCannons(playerId); }, timing.modes.play, 1500 ); timing.setTrigger( 'story-hud-trigger2', () => { hud.reInitPixiHUD(playerId); // hud.toggle('story.js@advance() 4', true); }, timing.modes.play, 6000 ); } else { story.handlers.hudShouldBeShowing.actual = false; // hud.toggle('story.js@advance() 4', false); } }, restartMission() { gameMenus.clearButtons(); alertsAndWarnings.clear(); alertsAndWarnings.hide(); dialog.hide(); plates.clearAll(); timing.clearAllScheduledEvents(); status.add('aqua', 'Mission restarted...', timing.times.play); story.handlers.dispatch({ type: c.actions.RESTART_MISSION }); story.advance(story.currentScene, 0); story.handlers.frameZero.actual = true; }, mainMenu(askForConfirmation = true, hurryUp = false) { function
() { alertsAndWarnings.clear(); alertsAndWarnings.hide(); dialog.hide(); plates.clearAll(); timing.clearAllScheduledEvents(); if (timing.isPaused()) window.pixiapp.togglePause('dontFadeMatte'); gameMenus.clearButtons(); story.advance('mainMenu', 0, hurryUp); } if (askForConfirmation) { if ( confirm( 'Returning to the main menu will reset your progress on the current mission. Continue anyway?' ) ) { mainMenuProper(); } } else { mainMenuProper(); } }, replayScene() { const localStoragePlayerProgress = readPlayerProgress(); let goAhead = false; if (localStoragePlayerProgress === null) { goAhead = true; } else { if (!hasThePlayerMadeProgress(localStoragePlayerProgress)) { alert(story.noProgressYetMessage); } else { goAhead = true; } } if (goAhead) { story.handlers.activeKeyboardLayout.current = controlSchemes.replaySceneMenu.id; story.removeMainMenuTopPortion(); gameMenus.clearButtons(); gameMenus.showReplaySceneButtonSet(story.sceneList); } }, replaySceneActual(sceneId, sceneIndex) { const localStoragePlayerProgress = readPlayerProgress(); if (c.debug.sequentialEvents) console.log('story.js@replaySceneActual', sceneId, sceneIndex); let goAhead = false; if (localStoragePlayerProgress === null) { goAhead = true; } else { const bestSceneId = localStoragePlayerProgress.bestSceneId; const bestSceneIndex = story.sceneList.findIndex( (sc) => sc.id === bestSceneId ); if (bestSceneIndex < sceneIndex) { alert("I'm sorry, you haven't unlocked that scene yet."); } else { goAhead = true; } } if (c.debug.sequentialEvents) console.log({ goAhead }); if (goAhead) { music.stopPlaying(); gameMenus.clearButtons(); story.advance(sceneId, 0); } }, newGame() { const localStoragePlayerProgress = readPlayerProgress(); function newGameProper() { music.stopPlaying(); gameMenus.clearButtons(); story.removeMainMenuTopPortion(); story.advance(); } if (!hasThePlayerMadeProgress(localStoragePlayerProgress)) { newGameProper(); } else { if ( confirm( 'Starting a new game will revert your previous progress. Continue anyway?' ) ) { story.handlers.dispatch({ type: c.actions.REVERT_PLAYER_PROGRESS_TO_DEFAULTS, defaultPlayerProgress: initialGameState.game.playerShips, callbackFn: newGameProper, }); } } }, continueGame() { const localStoragePlayerProgress = readPlayerProgress(); if (!hasThePlayerMadeProgress(localStoragePlayerProgress)) { alert(story.noProgressYetMessage); } else { music.stopPlaying(); gameMenus.clearButtons(); story.removeMainMenuTopPortion(); story.advance(localStoragePlayerProgress.bestSceneId, 0); } }, removeMainMenuTopPortion() { document .getElementById('game__main_menu') .classList.remove('game__main_menu--shown', 'game__main_menu--quickshow'); document .getElementById('header__title') .classList.remove('header__title--hidden'); }, init() { gameMenus.buttonFunctions.restartMission = story.restartMission; gameMenus.buttonFunctions.mainMenu = story.mainMenu; gameMenus.buttonFunctions.newGame = story.newGame; gameMenus.buttonFunctions.continueGame = story.continueGame; gameMenus.buttonFunctions.replayScene = story.replayScene; gameMenus.buttonFunctions.replaySceneActual = story.replaySceneActual; }, updateCurrentObjectives(updates) { if (c.debug.objectives) console.log('updateCurrentObjectives()', updates); story.currentObjectives.show = [ ...story.currentObjectives.show, ...updates.show, ]; story.currentObjectives.show.forEach((sitem) => { if (sitem.currentPercentage === undefined) { sitem.currentPercentage = 0; sitem.failed = false; } }); story.currentObjectives.advanceWhen = updates.advanceWhen; story.currentObjectives.advanceWhen.forEach((awitem) => { if (awitem.currentPercentage === undefined) { awitem.currentPercentage = 0; awitem.failed = false; } }); if (updates.show.length > 0) { let escAddendum = ''; if (story.noOfTimesHitEscMessageWasAppended < 4) { escAddendum = story.escAddendum; story.noOfTimesHitEscMessageWasAppended++; } status.add( 'yellow', 'Mission objectives updated.' + escAddendum, timing.times.play ); } story.updateObjectiveDisplay(); }, checkAgainstCurrentObjectives( entityId, eventId, wasPreviouslyInspected = false ) { if (c.debug.objectives) console.log( 'checkAgainstCurrentObjectives', entityId, eventId, wasPreviouslyInspected ); if (typeof eventId !== 'string') { console.error( 'eventId must be a string, this was received instead:', eventId ); } if (eventId === c.objectiveTypes.destroyed.id) { story.currentStoryEntities[entityId].wasDespawned = true; } let entityGroup = null; let entitiesInGroup = 0; const currentStoryEntity = story.currentStoryEntities[entityId]; if (currentStoryEntity !== undefined) { if (currentStoryEntity.groupId !== undefined) { entityGroup = currentStoryEntity.groupId; for (const storyEntityId in story.currentStoryEntities) { if (story.currentStoryEntities[storyEntityId].groupId === entityGroup) entitiesInGroup++; } } } let entityClassification = story.assertClassification(entityId); let entityInvolvedIn = []; // look through all objectives in both stores // to see if the entity is involved for (const objectiveStore in story.currentObjectives) { story.currentObjectives[objectiveStore].forEach((obj) => { if (obj.groupId === undefined) { if (entityId === obj.entityId) { entityInvolvedIn.push({ store: objectiveStore, objectiveObj: obj, }); } } else { if (entityGroup === null) return; if (entityGroup === obj.groupId) { entityInvolvedIn.push({ store: objectiveStore, objectiveObj: obj, }); } } }); } // walk through the collected objectives and update them // based on this event let failState = false; let meansProgress = false; let updatedObjectiveMessages = []; entityInvolvedIn.forEach((el) => { const objectiveType = el.objectiveObj.type; let hasUpdated = false; if ( c.objectiveTypes[objectiveType].failsIfEventIs.includes(eventId) || (eventId === c.objectiveTypes.destroyed.id && !wasPreviouslyInspected && objectiveType === c.objectiveTypes.inspected.id) ) { // example: the entity should have been disabled, // but it was destroyed instead if ( el.objectiveObj.groupId === undefined || el.objectiveObj.requiredPercentage === 100 ) { failState = true; el.objectiveObj.failed = true; hasUpdated = true; } else { // determine if the objective can still be completed // after this change let remainingPercentage = 0; for (const cseid in story.currentStoryEntities) { if ( story.currentStoryEntities[cseid].groupId === entityGroup && !story.currentStoryEntities[cseid].wasDespawned ) { remainingPercentage += (1 / entitiesInGroup) * 100; } } if (remainingPercentage < el.objectiveObj.requiredPercentage) { failState = true; el.objectiveObj.failed = true; hasUpdated = true; } } } else { if (eventId === objectiveType) { meansProgress = true; hasUpdated = true; if (el.objectiveObj.groupId === undefined) { // this objective only involves a single entity el.objectiveObj.currentPercentage = 100; } else { el.objectiveObj.currentPercentage += (1 / entitiesInGroup) * 100; } } } if (hasUpdated && el.store !== 'advanceWhen') { const [itemColor, objectiveText] = story.returnObjectiveText( el.objectiveObj, meansProgress ); let escAddendum = ''; if (story.noOfTimesHitEscMessageWasAppended < 4) { escAddendum = story.escAddendum; story.noOfTimesHitEscMessageWasAppended++; } updatedObjectiveMessages.push({ color: itemColor, message: 'Objectives: ' + objectiveText + escAddendum, }); } }); story.updateObjectiveDisplay(); if (updatedObjectiveMessages.length < 1) { // this event didnt cause any progress with the objectives // so we'll print a yellow status message let printStatus = true; let statusColor = 'yellow'; let statusMessage = `${entityClassification}[${makeName(entityId)}] ${ c.objectiveTypes[eventId].completed_desc }`; if ( (eventId === c.objectiveTypes.inspected.id && !meansProgress) || (eventId === c.objectiveTypes.hasDespawned.id && !failState) || eventId === c.objectiveTypes.mustHaveArrived.id ) { printStatus = false; } if (printStatus) { status.add(statusColor, statusMessage, timing.times.play); } } else { updatedObjectiveMessages.forEach((el) => { let printThisStatus = true; if (eventId === c.objectiveTypes.hasDespawned.id && !failState) { printThisStatus = false; } if (printThisStatus) { status.add(el.color, el.message, timing.times.play); } }); } story.checkBeatCompletion(); if (failState && !story.missionFailureWasTriggered) { story.missionFailureWasTriggered = true; if (c.debug.objectives) console.log('MISSION FAILED!', story.currentObjectives); plates.loadPlate('mission_failed', -1, 'Mission failed'); plates.fadeInPlate(25); plates.fadeInMatte(50, 1000); timing.toggleEntityMovement( false, 'story.js@checkAgainstCurrentObjectives() 1', 3000 ); timing.setTimeout( () => { soundEffects.muteUnmuteAllLoops( 'story.js@checkAgainstCurrentObjectives() 2', true ); }, timing.modes.play, 3000 ); plates.fadeOutPlate(25, 4000); timing.setTimeout( () => { gameMenus.showMissionFailedButtonSet(); }, timing.modes.play, 5100 ); } }, checkBeatCompletion() { let updatedObjectiveMessages = []; const currentSceneObject = story.sceneList.find( (el) => el.id === story.currentScene ).sceneObject; const isTheFinalGameplayBeat = currentSceneObject.storyBeats[story.currentSceneBeat] .isTheFinalGameplayBeat; // if this is the final gameplay beat, all other objectives // are complete, and the designated entities survived // then set the mustHaveSurvived objectives to 100% if (isTheFinalGameplayBeat) { let allOthersComplete = true; story.currentObjectives.show.forEach((obj) => { if ( obj.type !== c.objectiveTypes.mustHaveSurvived.id && Math.ceil(obj.currentPercentage) < obj.requiredPercentage ) { allOthersComplete = false; } }); if (allOthersComplete) { story.currentObjectives.show.forEach((obj2) => { if ( obj2.type === c.objectiveTypes.mustHaveSurvived.id && obj2.failed === false ) { obj2.currentPercentage = 100; const [itemColor, objectiveText] = story.returnObjectiveText( obj2, true ); updatedObjectiveMessages.push({ color: itemColor, message: 'Objectives: ' + objectiveText, }); } }); } } story.updateObjectiveDisplay(); if (updatedObjectiveMessages.length > 0) { updatedObjectiveMessages.forEach((el) => { status.add(el.color, el.message, timing.times.play); }); } // if all needed objectives are done, we can advance to the // next story beat let allComplete = true; story.currentObjectives.advanceWhen.forEach((obj) => { if ( Math.ceil(obj.currentPercentage) < obj.requiredPercentage || obj.failed ) allComplete = false; }); if (isTheFinalGameplayBeat) { story.currentObjectives.show.forEach((obj) => { if ( Math.ceil(obj.currentPercentage) < obj.requiredPercentage || obj.failed ) allComplete = false; }); if (c.debug.objectives) console.log('isTheFinalGameplayBeat'); } if (c.debug.objectives) console.log('allComplete:', allComplete, story.currentObjectives); if (allComplete) { if (c.debug.objectives) console.log( 'ALLCOMPLETE IS TRUE, ADVANCE TO THE NEXT STORY BEAT!', story.currentObjectives ); if (story.currentSceneBeat < currentSceneObject.storyBeats.length - 1) { // there are more beats in this scene story.advance(story.currentScene, story.currentSceneBeat + 1); } else { // advance to the next scene plates.loadPlate('mission_success', 1000); plates.fadeInPlate(25, 1000); timing.toggleEntityMovement( false, 'story.js@checkBeatCompletion() 1', 2000 ); timing.setTimeout( () => { soundEffects.muteUnmuteAllLoops( 'story.js@checkBeatCompletion() 2', true ); }, timing.modes.play, 2000 ); plates.fadeInMatte(50, 1000); plates.fadeOutPlate(50, 5000); timing.setTimeout( () => { story.advance(null, 0); }, timing.modes.play, 8500 ); } } }, entityWasDespawned(entityId) { if (c.debug.objectives) console.log('entityWasDespawned:', entityId); if (story.currentStoryEntities[entityId] === undefined) return; story.currentStoryEntities[entityId].wasDespawned = true; story.checkAgainstCurrentObjectives( entityId, c.objectiveTypes.hasDespawned.id ); }, updateObjectiveDisplay() { // console.log('updateObjectiveDisplay() called'); const re = []; re.push( "<div class='game__pause-objectives-title'>Current objectives:</div>\n<ul class='game__pause-objectives-list'>" ); const objectiveLis = story.currentObjectives.show.map((obj) => { const [itemColor, objectiveText] = story.returnObjectiveText(obj); return `<li class='game__pause-objective game__pause-objective--${itemColor}'>${objectiveText}</li>`; }); re.push(objectiveLis.join('')); re.push('</ul>'); document.getElementById('game__pause-objectives').innerHTML = re.join(''); }, returnObjectiveText(objectiveObj, meansProgress = false) { let itemColor = 'yellow'; if (meansProgress) itemColor = 'dark_green'; let objectiveText = ''; let completed = false; if ( objectiveObj.requiredPercentage <= Math.ceil(objectiveObj.currentPercentage) ) { itemColor = 'green'; completed = true; } if (objectiveObj.failed) itemColor = 'red'; if (objectiveObj.groupId === undefined) { let entityClassification = story.assertClassification( objectiveObj.entityId ); let mainText = c.objectiveTypes[objectiveObj.type].desc; let parensText = 'incomplete'; if (completed) { parensText = 'complete'; mainText = c.objectiveTypes[objectiveObj.type].completed_desc; } if (objectiveObj.failed) { parensText = 'failed'; mainText = c.objectiveTypes[objectiveObj.type].desc; } objectiveText = `${entityClassification}${makeName( objectiveObj.entityId )} ${mainText} (${parensText})`; } else { let groupClassification = ''; let firstInGroup = Object.values(story.currentStoryEntities).find( (en) => en.groupId === objectiveObj.groupId ); if (firstInGroup !== undefined) groupClassification = story.assertClassification(firstInGroup.id); if (groupClassification !== '') groupClassification = groupClassification.toLowerCase(); let mainText = c.objectiveTypes[objectiveObj.type].desc; let parensText = Math.ceil(objectiveObj.currentPercentage) + '% complete'; if (completed) { parensText = 'complete'; mainText = c.objectiveTypes[objectiveObj.type].completed_desc; } if (objectiveObj.failed) { parensText = 'failed'; mainText = c.objectiveTypes[objectiveObj.type].desc; } objectiveText = `${ objectiveObj.requiredPercentage }% of ${groupClassification}group ${ objectiveObj.groupId.charAt(0).toUpperCase() + objectiveObj.groupId.slice(1) } ${mainText} (${parensText})`; } return [itemColor, objectiveText]; }, cleanUp() { if (c.debug.objectives) console.log('story.cleanUp() called'); story.currentObjectives = { show: [], advanceWhen: [], }; story.handlers.dispatch({ type: c.actions.CLEANUP }); entities.cleanUp(); shots.cleanUp(); soundEffects.cleanUp(); shields.cleanUp(); formations.cleanUp(); hud.cleanUp(); }, }; export default story;
mainMenuProper
TimerManager.ts
namespace g { /** * `Scene#setTimeout` や `Scene#setInterval` の実行単位を表す。 * ゲーム開発者が本クラスのインスタンスを直接生成することはなく、 * 本クラスの機能を直接利用することはない。 */ export class TimerIdentifier implements Destroyable { /** * @private */ _timer: Timer; /** * @private */ _handler:
/** * @private */ _handlerOwner: any; /** * @private */ _fired: (c: TimerIdentifier) => void; /** * @private */ _firedOwner: any; constructor(timer: Timer, handler: () => void, handlerOwner: any, fired?: (c: TimerIdentifier) => void, firedOwner?: any) { this._timer = timer; this._handler = handler; this._handlerOwner = handlerOwner; this._fired = fired; this._firedOwner = firedOwner; this._timer.elapsed.add(this._fire, this); } destroy(): void { this._timer.elapsed.remove(this._fire, this); this._timer = undefined; this._handler = undefined; this._handlerOwner = undefined; this._fired = undefined; this._firedOwner = undefined; } destroyed(): boolean { return this._timer === undefined; } /** * @private */ _fire(): void { this._handler.call(this._handlerOwner); if (this._fired) { this._fired.call(this._firedOwner, this); } } } /** * Timerを管理する機構を提供する。 * ゲーム開発者が本クラスを利用する事はない。 */ export class TimerManager implements Destroyable { _timers: Timer[]; _trigger: Trigger<void>; _identifiers: TimerIdentifier[]; _fps: number; _registered: boolean; constructor(trigger: Trigger<void>, fps: number) { this._timers = []; this._trigger = trigger; this._identifiers = []; this._fps = fps; this._registered = false; } destroy(): void { for (var i = 0; i < this._identifiers.length; ++i) { this._identifiers[i].destroy(); } for (var i = 0; i < this._timers.length; ++i) { this._timers[i].destroy(); } this._timers = undefined; this._trigger = undefined; this._identifiers = undefined; this._fps = undefined; } destroyed(): boolean { return this._timers === undefined; } /** * 定期間隔で処理を実行するTimerを作成する。 * 本Timerはフレーム経過によって動作する疑似タイマーであるため、実時間の影響は受けない * @param interval Timerの実行間隔(ミリ秒) * @returns 作成したTimer */ createTimer(interval: number): Timer { if (! this._registered) { this._trigger.add(this._tick, this); this._registered = true; } if (interval < 0) throw ExceptionFactory.createAssertionError("TimerManager#createTimer: invalid interval"); // NODE: intervalが0の場合に、Timer#tick()で無限ループとなるためintervalの最小値を1とする。 if (interval < 1) interval = 1; // NOTE: Timerの_scaledElapsedと比較するため、this.fps倍した値を用いる // Math.min(1000 / this._fps * this.fps, interval * this._fps); var acceptableMargin = Math.min(1000, interval * this._fps); for (var i = 0; i < this._timers.length; ++i) { if (this._timers[i].interval === interval) { if (this._timers[i]._scaledElapsed < acceptableMargin) { return this._timers[i]; } } } var timer = new Timer(interval, this._fps); this._timers.push(timer); return timer; } /** * Timerを削除する。 * @param timer 削除するTimer */ deleteTimer(timer: Timer): void { if (! timer.canDelete()) return; var index = this._timers.indexOf(timer); if (index < 0) throw ExceptionFactory.createAssertionError("TimerManager#deleteTimer: can not find timer"); this._timers.splice(index, 1); timer.destroy(); if (! this._timers.length) { if (! this._registered) throw ExceptionFactory.createAssertionError("TimerManager#deleteTimer: handler is not handled"); this._trigger.remove(this._tick, this); this._registered = false; } } setTimeout(handler: () => void, milliseconds: number, owner?: any): TimerIdentifier { var timer = this.createTimer(milliseconds); var identifier = new TimerIdentifier(timer, handler, owner, this._onTimeoutFired, this); this._identifiers.push(identifier); return identifier; } clearTimeout(identifier: TimerIdentifier): void { this._clear(identifier); } setInterval(handler: () => void, interval: number, owner?: any): TimerIdentifier { var timer = this.createTimer(interval); var identifier = new TimerIdentifier(timer, handler, owner); this._identifiers.push(identifier); return identifier; } clearInterval(identifier: TimerIdentifier): void { this._clear(identifier); } /** * すべてのTimerを時間経過させる。 * @private */ _tick(): void { var timers = this._timers.concat(); for (var i = 0; i < timers.length; ++i) timers[i].tick(); } /** * @private */ _onTimeoutFired(identifier: TimerIdentifier): void { var index = this._identifiers.indexOf(identifier); if (index < 0) throw ExceptionFactory.createAssertionError("TimerManager#_onTimeoutFired: can not find identifier"); this._identifiers.splice(index, 1); var timer = identifier._timer; identifier.destroy(); this.deleteTimer(timer); } /** * @private */ _clear(identifier: TimerIdentifier): void { var index = this._identifiers.indexOf(identifier); if (index < 0) throw ExceptionFactory.createAssertionError("TimerManager#_clear: can not find identifier"); if (identifier.destroyed()) throw ExceptionFactory.createAssertionError("TimerManager#_clear: invalid identifier"); this._identifiers.splice(index, 1); var timer = identifier._timer; identifier.destroy(); this.deleteTimer(timer); } } }
() => void;
memory_saving_gradients.py
from toposort import toposort import contextlib import numpy as np import tensorflow as tf import tensorflow.contrib.graph_editor as ge import time import sys sys.setrecursionlimit(10000) # refers back to current module if we decide to split helpers out util = sys.modules[__name__] # getting rid of "WARNING:tensorflow:VARIABLES collection name is deprecated" setattr(tf.GraphKeys, "VARIABLES", "variables") # save original gradients since tf.gradient could be monkey-patched to point # to our version from tensorflow.python.ops import gradients as tf_gradients_lib tf_gradients = tf_gradients_lib.gradients MIN_CHECKPOINT_NODE_SIZE=1024 # use lower value during testing # specific versions we can use to do process-wide replacement of tf.gradients def gradients_speed(ys, xs, grad_ys=None, **kwargs): return gradients(ys, xs, grad_ys, checkpoints='speed', **kwargs) def gradients_memory(ys, xs, grad_ys=None, **kwargs): return gradients(ys, xs, grad_ys, checkpoints='memory', **kwargs) def gradients_collection(ys, xs, grad_ys=None, **kwargs): return gradients(ys, xs, grad_ys, checkpoints='collection', **kwargs) def gradients(ys, xs, grad_ys=None, checkpoints='collection', **kwargs): ''' Authors: Tim Salimans & Yaroslav Bulatov memory efficient gradient implementation inspired by "Training Deep Nets with Sublinear Memory Cost" by Chen et al. 2016 (https://arxiv.org/abs/1604.06174) ys,xs,grad_ys,kwargs are the arguments to standard tensorflow tf.gradients (https://www.tensorflow.org/versions/r0.12/api_docs/python/train.html#gradients) 'checkpoints' can either be - a list consisting of tensors from the forward pass of the neural net that we should re-use when calculating the gradients in the backward pass all other tensors that do not appear in this list will be re-computed - a string specifying how this list should be determined. currently we support - 'speed': checkpoint all outputs of convolutions and matmuls. these ops are usually the most expensive, so checkpointing them maximizes the running speed (this is a good option if nonlinearities, concats, batchnorms, etc are taking up a lot of memory) - 'memory': try to minimize the memory usage (currently using a very simple strategy that identifies a number of bottleneck tensors in the graph to checkpoint) - 'collection': look for a tensorflow collection named 'checkpoints', which holds the tensors to checkpoint ''' # print("Calling memsaving gradients with", checkpoints) if not isinstance(ys,list): ys = [ys] if not isinstance(xs,list): xs = [xs] bwd_ops = ge.get_backward_walk_ops([y.op for y in ys], inclusive=True) debug_print("bwd_ops: %s", bwd_ops) # forward ops are all ops that are candidates for recomputation fwd_ops = ge.get_forward_walk_ops([x.op for x in xs], inclusive=True, within_ops=bwd_ops) debug_print("fwd_ops: %s", fwd_ops) # exclude ops with no inputs fwd_ops = [op for op in fwd_ops if op.inputs] # don't recompute xs, remove variables xs_ops = _to_ops(xs) fwd_ops = [op for op in fwd_ops if not op in xs_ops] fwd_ops = [op for op in fwd_ops if not '/assign' in op.name] fwd_ops = [op for op in fwd_ops if not '/Assign' in op.name] fwd_ops = [op for op in fwd_ops if not '/read' in op.name] ts_all = ge.filter_ts(fwd_ops, True) # get the tensors ts_all = [t for t in ts_all if '/read' not in t.name] ts_all = set(ts_all) - set(xs) - set(ys) # construct list of tensors to checkpoint during forward pass, if not # given as input if type(checkpoints) is not list: if checkpoints == 'collection': checkpoints = tf.get_collection('checkpoints') elif checkpoints == 'speed': # checkpoint all expensive ops to maximize running speed checkpoints = ge.filter_ts_from_regex(fwd_ops, 'conv2d|Conv|MatMul') elif checkpoints == 'memory': # remove very small tensors and some weird ops
else: raise Exception('%s is unsupported input for "checkpoints"' % (checkpoints,)) checkpoints = list(set(checkpoints).intersection(ts_all)) # at this point automatic selection happened and checkpoints is list of nodes assert isinstance(checkpoints, list) debug_print("Checkpoint nodes used: %s", checkpoints) # better error handling of special cases # xs are already handled as checkpoint nodes, so no need to include them xs_intersect_checkpoints = set(xs).intersection(set(checkpoints)) if xs_intersect_checkpoints: debug_print("Warning, some input nodes are also checkpoint nodes: %s", xs_intersect_checkpoints) ys_intersect_checkpoints = set(ys).intersection(set(checkpoints)) debug_print("ys: %s, checkpoints: %s, intersect: %s", ys, checkpoints, ys_intersect_checkpoints) # saving an output node (ys) gives no benefit in memory while creating # new edge cases, exclude them if ys_intersect_checkpoints: debug_print("Warning, some output nodes are also checkpoints nodes: %s", format_ops(ys_intersect_checkpoints)) # remove initial and terminal nodes from checkpoints list if present checkpoints = list(set(checkpoints) - set(ys) - set(xs)) # check that we have some nodes to checkpoint if not checkpoints: raise Exception('no checkpoints nodes found or given as input! ') # disconnect dependencies between checkpointed tensors checkpoints_disconnected = {} for x in checkpoints: if x.op and x.op.name is not None: grad_node = tf.stop_gradient(x, name=x.op.name+"_sg") else: grad_node = tf.stop_gradient(x) checkpoints_disconnected[x] = grad_node # partial derivatives to the checkpointed tensors and xs ops_to_copy = fast_backward_ops(seed_ops=[y.op for y in ys], stop_at_ts=checkpoints, within_ops=fwd_ops) debug_print("Found %s ops to copy within fwd_ops %s, seed %s, stop_at %s", len(ops_to_copy), fwd_ops, [r.op for r in ys], checkpoints) debug_print("ops_to_copy = %s", ops_to_copy) debug_print("Processing list %s", ys) copied_sgv, info = ge.copy_with_input_replacements(ge.sgv(ops_to_copy), {}) for origin_op, op in info._transformed_ops.items(): op._set_device(origin_op.node_def.device) copied_ops = info._transformed_ops.values() debug_print("Copied %s to %s", ops_to_copy, copied_ops) ge.reroute_ts(checkpoints_disconnected.values(), checkpoints_disconnected.keys(), can_modify=copied_ops) debug_print("Rewired %s in place of %s restricted to %s", checkpoints_disconnected.values(), checkpoints_disconnected.keys(), copied_ops) # get gradients with respect to current boundary + original x's copied_ys = [info._transformed_ops[y.op]._outputs[0] for y in ys] boundary = list(checkpoints_disconnected.values()) dv = tf_gradients(ys=copied_ys, xs=boundary+xs, grad_ys=grad_ys, **kwargs) debug_print("Got gradients %s", dv) debug_print("for %s", copied_ys) debug_print("with respect to %s", boundary+xs) inputs_to_do_before = [y.op for y in ys] if grad_ys is not None: inputs_to_do_before += grad_ys wait_to_do_ops = list(copied_ops) + [g.op for g in dv if g is not None] my_add_control_inputs(wait_to_do_ops, inputs_to_do_before) # partial derivatives to the checkpointed nodes # dictionary of "node: backprop" for nodes in the boundary d_checkpoints = {r: dr for r,dr in zip(checkpoints_disconnected.keys(), dv[:len(checkpoints_disconnected)])} # partial derivatives to xs (usually the params of the neural net) d_xs = dv[len(checkpoints_disconnected):] # incorporate derivatives flowing through the checkpointed nodes checkpoints_sorted_lists = tf_toposort(checkpoints, within_ops=fwd_ops) for ts in checkpoints_sorted_lists[::-1]: debug_print("Processing list %s", ts) checkpoints_other = [r for r in checkpoints if r not in ts] checkpoints_disconnected_other = [checkpoints_disconnected[r] for r in checkpoints_other] # copy part of the graph below current checkpoint node, stopping at # other checkpoints nodes ops_to_copy = fast_backward_ops(within_ops=fwd_ops, seed_ops=[r.op for r in ts], stop_at_ts=checkpoints_other) debug_print("Found %s ops to copy within %s, seed %s, stop_at %s", len(ops_to_copy), fwd_ops, [r.op for r in ts], checkpoints_other) debug_print("ops_to_copy = %s", ops_to_copy) if not ops_to_copy: # we're done! break copied_sgv, info = ge.copy_with_input_replacements(ge.sgv(ops_to_copy), {}) for origin_op, op in info._transformed_ops.items(): op._set_device(origin_op.node_def.device) copied_ops = info._transformed_ops.values() debug_print("Copied %s to %s", ops_to_copy, copied_ops) ge.reroute_ts(checkpoints_disconnected_other, checkpoints_other, can_modify=copied_ops) debug_print("Rewired %s in place of %s restricted to %s", checkpoints_disconnected_other, checkpoints_other, copied_ops) # gradient flowing through the checkpointed node boundary = [info._transformed_ops[r.op]._outputs[0] for r in ts] substitute_backprops = [d_checkpoints[r] for r in ts] dv = tf_gradients(boundary, checkpoints_disconnected_other+xs, grad_ys=substitute_backprops, **kwargs) debug_print("Got gradients %s", dv) debug_print("for %s", boundary) debug_print("with respect to %s", checkpoints_disconnected_other+xs) debug_print("with boundary backprop substitutions %s", substitute_backprops) inputs_to_do_before = [d_checkpoints[r].op for r in ts] wait_to_do_ops = list(copied_ops) + [g.op for g in dv if g is not None] my_add_control_inputs(wait_to_do_ops, inputs_to_do_before) # partial derivatives to the checkpointed nodes for r, dr in zip(checkpoints_other, dv[:len(checkpoints_other)]): if dr is not None: if d_checkpoints[r] is None: d_checkpoints[r] = dr else: d_checkpoints[r] += dr def _unsparsify(x): if not isinstance(x, tf.IndexedSlices): return x assert x.dense_shape is not None, "memory_saving_gradients encountered sparse gradients of unknown shape" indices = x.indices while indices.shape.ndims < x.values.shape.ndims: indices = tf.expand_dims(indices, -1) return tf.scatter_nd(indices, x.values, x.dense_shape) # partial derivatives to xs (usually the params of the neural net) d_xs_new = dv[len(checkpoints_other):] for j in range(len(xs)): if d_xs_new[j] is not None: if d_xs[j] is None: d_xs[j] = _unsparsify(d_xs_new[j]) else: d_xs[j] += _unsparsify(d_xs_new[j]) return d_xs def tf_toposort(ts, within_ops=None): all_ops = ge.get_forward_walk_ops([x.op for x in ts], within_ops=within_ops) deps = {} for op in all_ops: for o in op.outputs: deps[o] = set(op.inputs) sorted_ts = toposort(deps) # only keep the tensors from our original list ts_sorted_lists = [] for l in sorted_ts: keep = list(set(l).intersection(ts)) if keep: ts_sorted_lists.append(keep) return ts_sorted_lists def fast_backward_ops(within_ops, seed_ops, stop_at_ts): bwd_ops = set(ge.get_backward_walk_ops(seed_ops, stop_at_ts=stop_at_ts)) ops = bwd_ops.intersection(within_ops).difference([t.op for t in stop_at_ts]) return list(ops) @contextlib.contextmanager def capture_ops(): """Decorator to capture ops created in the block. with capture_ops() as ops: # create some ops print(ops) # => prints ops created. """ micros = int(time.time()*10**6) scope_name = str(micros) op_list = [] with tf.name_scope(scope_name): yield op_list g = tf.get_default_graph() op_list.extend(ge.select_ops(scope_name+"/.*", graph=g)) def _to_op(tensor_or_op): if hasattr(tensor_or_op, "op"): return tensor_or_op.op return tensor_or_op def _to_ops(iterable): if not _is_iterable(iterable): return iterable return [_to_op(i) for i in iterable] def _is_iterable(o): try: _ = iter(o) except Exception: return False return True DEBUG_LOGGING=False def debug_print(s, *args): """Like logger.log, but also replaces all TensorFlow ops/tensors with their names. Sensitive to value of DEBUG_LOGGING, see enable_debug/disable_debug Usage: debug_print("see tensors %s for %s", tensorlist, [1,2,3]) """ if DEBUG_LOGGING: formatted_args = [format_ops(arg) for arg in args] print("DEBUG "+s % tuple(formatted_args)) def format_ops(ops, sort_outputs=True): """Helper method for printing ops. Converts Tensor/Operation op to op.name, rest to str(op).""" if hasattr(ops, '__iter__') and not isinstance(ops, str): l = [(op.name if hasattr(op, "name") else str(op)) for op in ops] if sort_outputs: return sorted(l) return l else: return ops.name if hasattr(ops, "name") else str(ops) def my_add_control_inputs(wait_to_do_ops, inputs_to_do_before): for op in wait_to_do_ops: ci = [i for i in inputs_to_do_before if op.control_inputs is None or i not in op.control_inputs] ge.add_control_inputs(op, ci)
def fixdims(t): # tf.Dimension values are not compatible with int, convert manually try: return [int(e if e.value is not None else 64) for e in t] except: return [0] # unknown shape ts_all = [t for t in ts_all if np.prod(fixdims(t.shape)) > MIN_CHECKPOINT_NODE_SIZE] ts_all = [t for t in ts_all if 'L2Loss' not in t.name] ts_all = [t for t in ts_all if 'entropy' not in t.name] ts_all = [t for t in ts_all if 'FusedBatchNorm' not in t.name] ts_all = [t for t in ts_all if 'Switch' not in t.name] ts_all = [t for t in ts_all if 'dropout' not in t.name] # DV: FP16_FIX - need to add 'Cast' layer here to make it work for FP16 ts_all = [t for t in ts_all if 'Cast' not in t.name] # filter out all tensors that are inputs of the backward graph with util.capture_ops() as bwd_ops: tf_gradients(ys, xs, grad_ys, **kwargs) bwd_inputs = [t for op in bwd_ops for t in op.inputs] # list of tensors in forward graph that is in input to bwd graph ts_filtered = list(set(bwd_inputs).intersection(ts_all)) debug_print("Using tensors %s", ts_filtered) # try two slightly different ways of getting bottlenecks tensors # to checkpoint for ts in [ts_filtered, ts_all]: # get all bottlenecks in the graph bottleneck_ts = [] for t in ts: b = set(ge.get_backward_walk_ops(t.op, inclusive=True, within_ops=fwd_ops)) f = set(ge.get_forward_walk_ops(t.op, inclusive=False, within_ops=fwd_ops)) # check that there are not shortcuts b_inp = set([inp for op in b for inp in op.inputs]).intersection(ts_all) f_inp = set([inp for op in f for inp in op.inputs]).intersection(ts_all) if not set(b_inp).intersection(f_inp) and len(b_inp)+len(f_inp) >= len(ts_all): bottleneck_ts.append(t) # we have a bottleneck! else: debug_print("Rejected bottleneck candidate and ops %s", [t] + list(set(ts_all) - set(b_inp) - set(f_inp))) # success? or try again without filtering? if len(bottleneck_ts) >= np.sqrt(len(ts_filtered)): # yes, enough bottlenecks found! break if not bottleneck_ts: raise Exception('unable to find bottleneck tensors! please provide checkpoint nodes manually, or use checkpoints="speed".') # sort the bottlenecks bottlenecks_sorted_lists = tf_toposort(bottleneck_ts, within_ops=fwd_ops) sorted_bottlenecks = [t for ts in bottlenecks_sorted_lists for t in ts] # save an approximately optimal number ~ sqrt(N) N = len(ts_filtered) if len(bottleneck_ts) <= np.ceil(np.sqrt(N)): checkpoints = sorted_bottlenecks else: step = int(np.ceil(len(bottleneck_ts) / np.sqrt(N))) checkpoints = sorted_bottlenecks[step::step]
log2timeline_tool.py
# -*- coding: utf-8 -*- """The log2timeline CLI tool.""" from __future__ import unicode_literals import argparse import os import sys import time import textwrap from dfvfs.lib import definitions as dfvfs_definitions import plaso # The following import makes sure the output modules are registered. from plaso import output # pylint: disable=unused-import from plaso.analyzers.hashers import manager as hashers_manager from plaso.cli import extraction_tool from plaso.cli import logger from plaso.cli import status_view from plaso.cli import tools from plaso.cli import views from plaso.cli.helpers import manager as helpers_manager from plaso.engine import engine from plaso.engine import single_process as single_process_engine from plaso.lib import definitions from plaso.lib import errors from plaso.lib import loggers from plaso.multi_processing import task_engine as multi_process_engine from plaso.parsers import manager as parsers_manager from plaso.storage import factory as storage_factory class Log2TimelineTool(extraction_tool.ExtractionTool): """Log2timeline CLI tool. Attributes: dependencies_check (bool): True if the availability and versions of dependencies should be checked. list_hashers (bool): True if the hashers should be listed. list_parsers_and_plugins (bool): True if the parsers and plugins should be listed. list_profilers (bool): True if the profilers should be listed. show_info (bool): True if information about hashers, parsers, plugins, etc. should be shown. """ NAME = 'log2timeline' DESCRIPTION = textwrap.dedent('\n'.join([ '', ('log2timeline is a command line tool to extract events from ' 'individual '), 'files, recursing a directory (e.g. mount point) or storage media ', 'image or device.', '', 'More information can be gathered from here:', ' https://plaso.readthedocs.io/en/latest/sources/user/' 'Using-log2timeline.html', ''])) EPILOG = textwrap.dedent('\n'.join([ '', 'Example usage:', '', 'Run the tool against a storage media image (full kitchen sink)', ' log2timeline.py /cases/mycase/storage.plaso ímynd.dd', '', 'Instead of answering questions, indicate some of the options on the', 'command line (including data from particular VSS stores).', (' log2timeline.py -o 63 --vss_stores 1,2 /cases/plaso_vss.plaso ' 'image.E01'), '', 'And that is how you build a timeline using log2timeline...', ''])) _SOURCE_TYPES_TO_PREPROCESS = frozenset([ dfvfs_definitions.SOURCE_TYPE_DIRECTORY, dfvfs_definitions.SOURCE_TYPE_STORAGE_MEDIA_DEVICE, dfvfs_definitions.SOURCE_TYPE_STORAGE_MEDIA_IMAGE]) def __init__(self, input_reader=None, output_writer=None): """Initializes a log2timeline CLI tool. Args: input_reader (Optional[InputReader]): input reader, where None indicates that the stdin input reader should be used. output_writer (Optional[OutputWriter]): output writer, where None indicates that the stdout output writer should be used. """ super(Log2TimelineTool, self).__init__( input_reader=input_reader, output_writer=output_writer) self._command_line_arguments = None self._enable_sigsegv_handler = False self._number_of_extraction_workers = 0 self._storage_serializer_format = definitions.SERIALIZER_FORMAT_JSON self._source_type = None self._status_view = status_view.StatusView(self._output_writer, self.NAME) self._status_view_mode = status_view.StatusView.MODE_WINDOW self._stdout_output_writer = isinstance( self._output_writer, tools.StdoutOutputWriter) self._worker_memory_limit = None self.dependencies_check = True self.list_hashers = False self.list_parsers_and_plugins = False self.list_profilers = False self.show_info = False def _GetPluginData(self): """Retrieves the version and various plugin information. Returns: dict[str, list[str]]: available parsers and plugins. """ return_dict = {} return_dict['Versions'] = [ ('plaso engine', plaso.__version__), ('python', sys.version)] hashers_information = hashers_manager.HashersManager.GetHashersInformation() parsers_information = parsers_manager.ParsersManager.GetParsersInformation() plugins_information = ( parsers_manager.ParsersManager.GetParserPluginsInformation()) presets_information = self._GetParserPresetsInformation() return_dict['Hashers'] = hashers_information return_dict['Parsers'] = parsers_information return_dict['Parser Plugins'] = plugins_information return_dict['Parser Presets'] = presets_information return return_dict def ParseArguments(self): "
def ParseOptions(self, options): """Parses the options. Args: options (argparse.Namespace): command line arguments. Raises: BadConfigOption: if the options are invalid. """ # The extraction options are dependent on the data location. helpers_manager.ArgumentHelperManager.ParseOptions( options, self, names=['data_location']) presets_file = os.path.join(self._data_location, 'presets.yaml') if not os.path.isfile(presets_file): raise errors.BadConfigOption( 'No such parser presets file: {0:s}.'.format(presets_file)) parsers_manager.ParsersManager.ReadPresetsFromFile(presets_file) # Check the list options first otherwise required options will raise. argument_helper_names = ['hashers', 'parsers', 'profiling'] helpers_manager.ArgumentHelperManager.ParseOptions( options, self, names=argument_helper_names) self._ParseTimezoneOption(options) self.list_hashers = self._hasher_names_string == 'list' self.list_parsers_and_plugins = self._parser_filter_expression == 'list' self.list_profilers = self._profilers == 'list' self.show_info = getattr(options, 'show_info', False) if getattr(options, 'use_markdown', False): self._views_format_type = views.ViewsFactory.FORMAT_TYPE_MARKDOWN self.dependencies_check = getattr(options, 'dependencies_check', True) if (self.list_hashers or self.list_parsers_and_plugins or self.list_profilers or self.list_timezones or self.show_info): return self._ParseInformationalOptions(options) argument_helper_names = [ 'artifact_definitions', 'artifact_filters', 'extraction', 'filter_file', 'status_view', 'storage_file', 'storage_format', 'text_prepend', 'yara_rules'] helpers_manager.ArgumentHelperManager.ParseOptions( options, self, names=argument_helper_names) self._ParseLogFileOptions(options) self._ParseStorageMediaOptions(options) self._ParsePerformanceOptions(options) self._ParseProcessingOptions(options) if not self._storage_file_path: raise errors.BadConfigOption('Missing storage file option.') serializer_format = getattr( options, 'serializer_format', definitions.SERIALIZER_FORMAT_JSON) if serializer_format not in definitions.SERIALIZER_FORMATS: raise errors.BadConfigOption( 'Unsupported storage serializer format: {0:s}.'.format( serializer_format)) self._storage_serializer_format = serializer_format # TODO: where is this defined? self._operating_system = getattr(options, 'os', None) if self._operating_system: self._mount_path = getattr(options, 'filename', None) helpers_manager.ArgumentHelperManager.ParseOptions( options, self, names=['status_view']) self._enable_sigsegv_handler = getattr(options, 'sigsegv_handler', False) self._EnforceProcessMemoryLimit(self._process_memory_limit) def ExtractEventsFromSources(self): """Processes the sources and extracts events. Raises: BadConfigOption: if the storage file path is invalid or the storage format not supported or an invalid filter was specified. SourceScannerError: if the source scanner could not find a supported file system. UserAbort: if the user initiated an abort. """ self._CheckStorageFile(self._storage_file_path, warn_about_existing=True) scan_context = self.ScanSource(self._source_path) self._source_type = scan_context.source_type self._status_view.SetMode(self._status_view_mode) self._status_view.SetSourceInformation( self._source_path, self._source_type, artifact_filters=self._artifact_filters, filter_file=self._filter_file) status_update_callback = ( self._status_view.GetExtractionStatusUpdateCallback()) self._output_writer.Write('\n') self._status_view.PrintExtractionStatusHeader(None) self._output_writer.Write('Processing started.\n') session = engine.BaseEngine.CreateSession( artifact_filter_names=self._artifact_filters, command_line_arguments=self._command_line_arguments, debug_mode=self._debug_mode, filter_file_path=self._filter_file, preferred_encoding=self.preferred_encoding, preferred_time_zone=self._preferred_time_zone, preferred_year=self._preferred_year) storage_writer = storage_factory.StorageFactory.CreateStorageWriter( self._storage_format, session, self._storage_file_path) if not storage_writer: raise errors.BadConfigOption( 'Unsupported storage format: {0:s}'.format(self._storage_format)) single_process_mode = self._single_process_mode if self._source_type == dfvfs_definitions.SOURCE_TYPE_FILE: # No need to multi process a single file source. single_process_mode = True if single_process_mode: extraction_engine = single_process_engine.SingleProcessEngine() else: extraction_engine = multi_process_engine.TaskMultiProcessEngine( use_zeromq=self._use_zeromq) # If the source is a directory or a storage media image # run pre-processing. if self._source_type in self._SOURCE_TYPES_TO_PREPROCESS: self._PreprocessSources(extraction_engine) configuration = self._CreateProcessingConfiguration( extraction_engine.knowledge_base) self._SetExtractionParsersAndPlugins(configuration, session) self._SetExtractionPreferredTimeZone(extraction_engine.knowledge_base) try: filter_find_specs = engine.BaseEngine.BuildFilterFindSpecs( self._artifact_definitions_path, self._custom_artifacts_path, extraction_engine.knowledge_base, self._artifact_filters, self._filter_file) except errors.InvalidFilter as exception: raise errors.BadConfigOption( 'Unable to build filter specification: {0!s}'.format(exception)) processing_status = None if single_process_mode: logger.debug('Starting extraction in single process mode.') processing_status = extraction_engine.ProcessSources( self._source_path_specs, storage_writer, self._resolver_context, configuration, filter_find_specs=filter_find_specs, status_update_callback=status_update_callback) else: logger.debug('Starting extraction in multi process mode.') processing_status = extraction_engine.ProcessSources( session.identifier, self._source_path_specs, storage_writer, configuration, enable_sigsegv_handler=self._enable_sigsegv_handler, filter_find_specs=filter_find_specs, number_of_worker_processes=self._number_of_extraction_workers, status_update_callback=status_update_callback, worker_memory_limit=self._worker_memory_limit) self._status_view.PrintExtractionSummary(processing_status) def ShowInfo(self): """Shows information about available hashers, parsers, plugins, etc.""" self._output_writer.Write( '{0:=^80s}\n'.format(' log2timeline/plaso information ')) plugin_list = self._GetPluginData() for header, data in plugin_list.items(): table_view = views.ViewsFactory.GetTableView( self._views_format_type, column_names=['Name', 'Description'], title=header) for entry_header, entry_data in sorted(data): table_view.AddRow([entry_header, entry_data]) table_view.Write(self._output_writer)
""Parses the command line arguments. Returns: bool: True if the arguments were successfully parsed. """ loggers.ConfigureLogging() argument_parser = argparse.ArgumentParser( description=self.DESCRIPTION, epilog=self.EPILOG, add_help=False, formatter_class=argparse.RawDescriptionHelpFormatter) self.AddBasicOptions(argument_parser) helpers_manager.ArgumentHelperManager.AddCommandLineArguments( argument_parser, names=['storage_file']) data_location_group = argument_parser.add_argument_group( 'data location arguments') argument_helper_names = ['artifact_definitions', 'data_location'] helpers_manager.ArgumentHelperManager.AddCommandLineArguments( data_location_group, names=argument_helper_names) extraction_group = argument_parser.add_argument_group( 'extraction arguments') argument_helper_names = [ 'artifact_filters', 'extraction', 'filter_file', 'hashers', 'parsers', 'yara_rules'] helpers_manager.ArgumentHelperManager.AddCommandLineArguments( extraction_group, names=argument_helper_names) self.AddStorageMediaImageOptions(extraction_group) self.AddTimeZoneOption(extraction_group) self.AddVSSProcessingOptions(extraction_group) self.AddCredentialOptions(extraction_group) info_group = argument_parser.add_argument_group('informational arguments') self.AddInformationalOptions(info_group) info_group.add_argument( '--info', dest='show_info', action='store_true', default=False, help='Print out information about supported plugins and parsers.') info_group.add_argument( '--use_markdown', '--use-markdown', dest='use_markdown', action='store_true', default=False, help=( 'Output lists in Markdown format use in combination with ' '"--hashers list", "--parsers list" or "--timezone list"')) info_group.add_argument( '--no_dependencies_check', '--no-dependencies-check', dest='dependencies_check', action='store_false', default=True, help='Disable the dependencies check.') self.AddLogFileOptions(info_group) helpers_manager.ArgumentHelperManager.AddCommandLineArguments( info_group, names=['status_view']) output_group = argument_parser.add_argument_group('output arguments') helpers_manager.ArgumentHelperManager.AddCommandLineArguments( output_group, names=['text_prepend']) processing_group = argument_parser.add_argument_group( 'processing arguments') self.AddPerformanceOptions(processing_group) self.AddProcessingOptions(processing_group) processing_group.add_argument( '--sigsegv_handler', '--sigsegv-handler', dest='sigsegv_handler', action='store_true', default=False, help=( 'Enables the SIGSEGV handler. WARNING this functionality is ' 'experimental and will a deadlock worker process if a real ' 'segfault is caught, but not signal SIGSEGV. This functionality ' 'is therefore primarily intended for debugging purposes')) profiling_group = argument_parser.add_argument_group('profiling arguments') helpers_manager.ArgumentHelperManager.AddCommandLineArguments( profiling_group, names=['profiling']) storage_group = argument_parser.add_argument_group('storage arguments') helpers_manager.ArgumentHelperManager.AddCommandLineArguments( storage_group, names=['storage_format']) argument_parser.add_argument( self._SOURCE_OPTION, action='store', metavar='SOURCE', nargs='?', default=None, type=str, help=( 'Path to a source device, file or directory. If the source is ' 'a supported storage media device or image file, archive file ' 'or a directory, the files within are processed recursively.')) try: options = argument_parser.parse_args() except UnicodeEncodeError: # If we get here we are attempting to print help in a non-Unicode # terminal. self._output_writer.Write('\n') self._output_writer.Write(argument_parser.format_help()) return False # Properly prepare the attributes according to local encoding. if self.preferred_encoding == 'ascii': logger.warning( 'The preferred encoding of your system is ASCII, which is not ' 'optimal for the typically non-ASCII characters that need to be ' 'parsed and processed. The tool will most likely crash and die, ' 'perhaps in a way that may not be recoverable. A five second delay ' 'is introduced to give you time to cancel the runtime and ' 'reconfigure your preferred encoding, otherwise continue at own ' 'risk.') time.sleep(5) if self._process_archives: logger.warning( 'Scanning archive files currently can cause deadlock. Continue at ' 'your own risk.') time.sleep(5) try: self.ParseOptions(options) except errors.BadConfigOption as exception: self._output_writer.Write('ERROR: {0!s}\n'.format(exception)) self._output_writer.Write('\n') self._output_writer.Write(argument_parser.format_usage()) return False self._command_line_arguments = self.GetCommandLineArguments() loggers.ConfigureLogging( debug_output=self._debug_mode, filename=self._log_file, quiet_mode=self._quiet_mode) return True
tag.rs
//! Provides a small simple tag component for identifying entities. use std::marker::PhantomData; use amethyst_core::ecs::*; use serde::{Deserialize, Serialize}; /// Tag component that can be used with a custom type to tag entities for processing #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(default)] pub struct Tag<T> where T: Clone + Send + Sync + 'static, { _m: PhantomData<T>, } impl<T> Default for Tag<T> where T: Clone + Send + Sync + 'static, { fn
() -> Self { Tag { _m: PhantomData } } } /// Utility lookup for tag components #[allow(missing_debug_implementations)] pub struct TagFinder<T> where T: Clone + Send + Sync + 'static, { _m: PhantomData<T>, } impl<T> TagFinder<T> where T: Clone + Send + Sync + 'static, { /// Returns the first entity found with the tag in question. pub fn find(&self, subworld: &mut SubWorld<'_>) -> Option<Entity> { <(Entity, Read<Tag<T>>)>::query() .iter(subworld) .map(|(ent, _)| *ent) .next() } }
default
useInitSettings.ts
import { existsSync, writeFileSync } from "fs"; import { useEffect } from "react"; import { LocalStorage } from "@raycast/api"; import { SVGR_DEFAULT, SVGO_DEFAULT } from "../constants"; interface UseInitSettings { svgoConfigPath: string; } const useInitSettings = ({ svgoConfigPath }: UseInitSettings) => { useEffect(() => { const handleSvgrConfig = async () => { const localSvgrSettings = await LocalStorage.getItem("svgr"); if (!localSvgrSettings) { await LocalStorage.setItem("svgr", JSON.stringify(SVGR_DEFAULT));
}; handleSvgrConfig(); const svgoSettings = existsSync(svgoConfigPath); if (!svgoSettings) writeFileSync(svgoConfigPath, JSON.stringify(SVGO_DEFAULT)); }, []); }; export default useInitSettings;
}
csv-converter.ts
import { promises } from "fs"; import moment from "moment"; interface InputDataFormat { logId: string; weight: number; bmi: number; date: string; time: string; fat: number; source: "API" | "Aria" } interface DataFormat { date: string; weight: number; fatMass: number; } const data: DataFormat[] = []; async function
() { const dir = await promises.opendir("weight"); for await (const dirent of dir) { if (dirent.isFile && dirent.name.startsWith("weight-")) { await processInputFile(dirent.name); } } await createOutputFiles(); } async function processInputFile(fileName: string) { const fileContent = await promises.readFile(`weight/${fileName}`, "utf-8"); const parsedContent = JSON.parse(fileContent) as InputDataFormat[]; parsedContent.forEach(item => { const date = moment(`${item.date} ${item.time}`, "MM/DD/YY hh:mm:ss") .format("YYYY-MM-DD hh:mm:ss"); const weight = item.weight; const fatMass = item.fat * item.weight / 100; data.push({ date, weight, fatMass }); }); } async function createOutputFiles() { let fileNumber = 0; let lineCount = 0; const headers = `Date,"Weight (lb)","Fat mass (lb)"\n`; await promises.unlink(`output-${fileNumber}.csv`); await promises.appendFile(`output-${fileNumber}.csv`, headers, { encoding: "utf-8" }); for (let i = 0; i < data.length; i++) { const item = data[i]; const line = `${item.date},${item.weight},${isNaN(item.fatMass) ? "" : item.fatMass}\n`; await promises.appendFile(`output-${fileNumber}.csv`, line, { encoding: "utf-8" }); lineCount += 1; if (lineCount > 250) { fileNumber += 1; lineCount = 0; await promises.unlink(`output-${fileNumber}.csv`); await promises.appendFile(`output-${fileNumber}.csv`, headers, { encoding: "utf-8" }); } } } processFiles().catch(console.error);
processFiles
label_loader.py
""" Copyright 2019-present NAVER Corp. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ #-*- coding: utf-8 -*- def load_label(label_path): char2index = dict() # [ch] = id index2char = dict() # [id] = ch with open(label_path, 'r') as f: # 파일을 열면 닫아주는게 좋다. with문은 다음과 같은 역할을 한다. for no, line in enumerate(f): if line[0] == '#': continue index, char, freq = line.strip().split('\t') char = char.strip() if len(char) == 0: char = ' ' char2index[char] = int(index) index2char[int(index)] = char return char2index, index2char
http://www.apache.org/licenses/LICENSE-2.0
customer-data.component.ts
import { Component, OnInit } from '@angular/core'; import { BranchEntity } from '../entities/branch.entity'; import { ServiceEntity } from '../entities/service.entity'; import { TranslateService } from 'ng2-translate'; import { RetryService } from '../shared/retry.service'; import { AlertDialogService } from '../shared/alert-dialog/alert-dialog.service'; import { Config } from '../config/config'; import { Router } from '@angular/router'; import { Util } from '../util/util'; declare var MobileTicketAPI: any; declare var ga: Function; @Component({ selector: 'app-customer-data', templateUrl: './customer-data.component.html', styleUrls: ['./customer-data.component.css'] }) export class CustomerDataComponent implements OnInit { public selectedBranch: BranchEntity; public selectedService: ServiceEntity; private _showNetWorkError = false; private isTakeTicketClickedOnce: boolean; constructor( private translate: TranslateService, public router: Router, private retryService: RetryService, private alertDialogService: AlertDialogService, private config: Config ) { } ngOnInit() {
} getSelectedBranch() { this.selectedBranch = MobileTicketAPI.getSelectedBranch(); } getSelectedServices() { this.selectedService = MobileTicketAPI.getSelectedService(); } get showNetWorkError(): boolean { return this._showNetWorkError; } showHideNetworkError(event) { this._showNetWorkError = event; } // creating visit createVisit() { if (!this.isTakeTicketClickedOnce) { this.isTakeTicketClickedOnce = true; if (MobileTicketAPI.getCurrentVisit()) { this.router.navigate(['ticket']); } else { let isDeviceBounded = this.config.getConfig('block_other_browsers'); if (isDeviceBounded === 'enable') { System.import('fingerprintjs2').then(Fingerprint2 => { var that = this; Fingerprint2.getPromise({ excludes: { availableScreenResolution: true, adBlock: true, enumerateDevices: true } }).then(function (components) { var values = components.map(function (component) { return component.value }); var murmur = Fingerprint2.x64hash128(values.join(''), 31); MobileTicketAPI.setFingerprint(murmur); that.createTicket(); }) }); } else { this.createTicket(); } } } } public createTicket() { MobileTicketAPI.createVisit( (visitInfo) => { ga('send', { hitType: 'event', eventCategory: 'visit', eventAction: 'create', eventLabel: 'vist-create' }); this.router.navigate(['ticket']); this.isTakeTicketClickedOnce = false; }, (xhr, status, errorMessage) => { let util = new Util(); this.isTakeTicketClickedOnce = false; if (util.getStatusErrorCode(xhr && xhr.getAllResponseHeaders()) === "8042") { this.translate.get('error_codes.error_8042').subscribe((res: string) => { this.alertDialogService.activate(res); }); } else if (util.getStatusErrorCode(xhr && xhr.getAllResponseHeaders()) === "11000") { this.translate.get('ticketInfo.visitAppRemoved').subscribe((res: string) => { this.alertDialogService.activate(res); }); } else if (errorMessage === 'Gateway Timeout') { this.translate.get('connection.issue_with_connection').subscribe((res: string) => { this.alertDialogService.activate(res); }); } else { this.showHideNetworkError(true); this.retryService.retry(() => { /** * replace this function once #140741231 is done */ MobileTicketAPI.getBranchesNearBy(0, 0, 2147483647, () => { this.retryService.abortRetry(); this.showHideNetworkError(false); }, () => { //Do nothing on error this.router.navigate(['no_visit']); }); }); } } ); } }
this.getSelectedBranch(); this.getSelectedServices();
interfaces.py
from enum import Enum # # This code was taken from: # https://gist.github.com/cr0hn/89172938b7ac42c3100f4980ad881a24 # class Serializable: def _clean_dict_(self, data = None, clean_or_raw: str = "clean") -> dict: # DICT if type(data) is dict: ret = {} for x, y in data.items(): if x.startswith("raw") and clean_or_raw == "clean": continue ret[x] = self._clean_dict_(y, clean_or_raw=clean_or_raw) return ret # LIST elif type(data) is list: ret = [] for d in data: ret.append(self._clean_dict_(d, clean_or_raw=clean_or_raw)) return ret elif hasattr(data, "clean_dict"): return data.clean_dict(clean_or_raw=clean_or_raw)
else: if hasattr(data, "decode"): return data.decode() return data def clean_dict(self, clean_or_raw: str = "clean") -> dict: """removes fields 'raw' from content""" return self._clean_dict_(self.__dict__, clean_or_raw=clean_or_raw) def raw_dict(self) -> dict: """Dumps all content to valid json file""" return self.clean_dict(clean_or_raw="raw")
elif isinstance(data, Enum): return data.value
connection.rs
//! # commands //! //! Manages the redis connection and ensures it is valid. //! #[cfg(test)] #[path = "./connection_test.rs"] mod connection_test; use crate::types::{RedisEmptyResult, RedisError, RedisResult}; use std::option::Option; /// The redis client which enables to invoke redis operations. pub(crate) struct Connection { /// Holds the current redis connection connection: Option<redis::Connection>, } /// If the client connection is not open or not valid, this function will create /// a new redis connection and modify the client to store this new connection. fn open_connection(connection: &mut Connection, client: &redis::Client) -> RedisEmptyResult { let output: RedisEmptyResult; if !connection.is_connection_open() { output = match client.get_connection() { Ok(redis_connection) => { connection.connection = Some(redis_connection); Ok(()) } Err(error) => Err(RedisError::RedisError(error)), } } else { output = Ok(()); } output } impl Connection { /// Returns true if the currently stored connection is valid, otherwise false.<br> /// There is no need to call this function as any redis operation invocation will /// ensure a valid connection is created. pub(crate) fn is_connection_open(self: &mut Connection) -> bool { let open; match self.connection { Some(ref mut redis_connection) => { let result: redis::RedisResult<()> = redis::cmd("PING").query(redis_connection); open = result.is_ok(); } None => open = false, } open } pub(crate) fn get_redis_connection( self: &mut Connection, client: &redis::Client, ) -> RedisResult<&mut redis::Connection> { match open_connection(self, client) { Err(error) => Err(error), _ => match self.connection { Some(ref mut redis_connection) => Ok(redis_connection), None => Err(RedisError::Description("Redis connection not available.")), }, } } } /// Creates and returns a new connection pub(crate) fn create() -> Connection
{ Connection { connection: None } }
test_ucx_tls.py
#!/usr/bin/python # # Copyright (C) Mellanox Technologies Ltd. 2017-. ALL RIGHTS RESERVED. # # See file LICENSE for terms. # import sys import subprocess import os import re import commands from distutils.version import LooseVersion #expected AM transport selections per given number of eps mlx4_am = { 2 : "rc_verbs", 16 : "rc_verbs", 32 : "rc_verbs", 64 : "rc_verbs", 256 : "ud_verbs", 512 : "ud_verbs", 1024 : "ud_verbs", 1000000 : "ud_verbs", } mlx5_am = { 2 : "rc_mlx5", 16 : "rc_mlx5", 32 : "rc_mlx5", 64 : "dc_mlx5", 256 : "dc_mlx5", 512 : "dc_mlx5", 1024 : "dc_mlx5", 1000000 : "dc_mlx5", } mlx5_am_no_dc = { 2 : "rc_mlx5", 16 : "rc_mlx5", 32 : "rc_mlx5", 64 : "rc_mlx5", 256 : "ud_mlx5", 512 : "ud_mlx5", 1024 : "ud_mlx5", 1000000 : "ud_mlx5", } # check that UCX_NUM_EPS work mlx5_am_override = { 2 : "rc_mlx5", 16 : "rc_mlx5", 32 : "rc_mlx5", 64 : "rc_mlx5", 256 : "rc_mlx5", 512 : "rc_mlx5", 1024 : "rc_mlx5", 1000000 : "rc_mlx5", } mlx4_am_override = { 2 : "rc_verbs", 16 : "rc_verbs", 32 : "rc_verbs", 64 : "rc_verbs", 256 : "rc_verbs", 512 : "rc_verbs", 1024 : "rc_verbs", 1000000 : "rc_verbs", } am_tls = { "mlx4" : mlx4_am, "mlx5" : mlx5_am, "mlx5_roce_dc" : mlx5_am, # mlx5 RoCE port which supports DC "mlx5_roce_no_dc" : mlx5_am_no_dc, # mlx5 RoCE port which doesn't support DC "mlx4_override" : mlx4_am_override, "mlx5_override" : mlx5_am_override } def find_am_transport(dev, neps, override = 0) :
def test_fallback_from_rc(dev, neps) : os.putenv("UCX_TLS", "ib") os.putenv("UCX_NET_DEVICES", dev) status,output = commands.getstatusoutput(ucx_info + ucx_info_args + str(neps) + " | grep rc") os.unsetenv("UCX_TLS") os.unsetenv("UCX_NET_DEVICES") if output != "": print "RC transport must not be used when estimated number of EPs = " + str(neps) sys.exit(1) os.putenv("UCX_TLS", "rc,ud,tcp") status,output_rc = commands.getstatusoutput(ucx_info + ucx_info_args + str(neps) + " | grep rc") status,output_tcp = commands.getstatusoutput(ucx_info + ucx_info_args + str(neps) + " | grep tcp") if output_rc != "" or output_tcp != "": print "RC/TCP transports must not be used when estimated number of EPs = " + str(neps) sys.exit(1) os.unsetenv("UCX_TLS") if len(sys.argv) > 1: bin_prefix = sys.argv[1] + "/bin" else: bin_prefix = "./src/tools/info" ucx_info = bin_prefix + "/ucx_info" ucx_info_args = " -e -u t -n " status, output = commands.getstatusoutput(ucx_info + " -c | grep -e \"UCX_RC_.*_MAX_NUM_EPS\"") match = re.findall(r'\S+=(\d+)', output) if match: rc_max_num_eps = int(max(match)) else: rc_max_num_eps = 0 status, output = commands.getstatusoutput("ibv_devinfo -l | tail -n +2 | sed -e 's/^[ \t]*//' | head -n -1 ") dev_list = output.splitlines() port = "1" for dev in sorted(dev_list): status, dev_attrs = commands.getstatusoutput("ibv_devinfo -d " + dev + " -i " + port) if dev_attrs.find("PORT_ACTIVE") == -1: continue driver_name = os.path.basename(os.readlink("/sys/class/infiniband/%s/device/driver" % dev)) dev_name = driver_name.split("_")[0] # should be mlx4 or mlx5 if not dev_name in ['mlx4', 'mlx5']: print "Skipping unknown device: ", dev_name continue if dev_attrs.find("Ethernet") == -1: dev_tl_map = am_tls[dev_name] dev_tl_override_map = am_tls[dev_name + "_override"] override = 1 else: fw_ver = open("/sys/class/infiniband/%s/fw_ver" % dev).read() if LooseVersion(fw_ver) >= LooseVersion("16.23.0"): dev_tl_map = am_tls[dev_name+"_roce_dc"] else: dev_tl_map = am_tls[dev_name+"_roce_no_dc"] override = 0 for n_eps in sorted(dev_tl_map): tl = find_am_transport(dev + ':' + port, n_eps) print dev+':' + port + " eps: ", n_eps, " expected am tl: " + \ dev_tl_map[n_eps] + " selected: " + tl if dev_tl_map[n_eps] != tl: sys.exit(1) if override: tl = find_am_transport(dev + ':' + port, n_eps, 1) print dev+':' + port + " UCX_NUM_EPS=2 eps: ", n_eps, " expected am tl: " + \ dev_tl_override_map[n_eps] + " selected: " + tl if dev_tl_override_map[n_eps] != tl: sys.exit(1) if n_eps >= (rc_max_num_eps * 2): test_fallback_from_rc(dev + ':' + port, n_eps) sys.exit(0)
os.putenv("UCX_TLS", "ib") os.putenv("UCX_NET_DEVICES", dev) if (override): os.putenv("UCX_NUM_EPS", "2") status, output = commands.getstatusoutput(ucx_info + ucx_info_args + str(neps) + " | grep am") os.unsetenv("UCX_TLS") os.unsetenv("UCX_NET_DEVICES") match = re.search(r'\d+:(\S+)/\S+', output) if match: am_tls = match.group(1) if (override): os.unsetenv("UCX_NUM_EPS") return am_tls else: return "no am tls"
api.py
from . import textakel FUNCTIONS = { "alphabetical": textakel.alphabetical, "capitalize": textakel.capitalize, "casefold": textakel.casefold, "count_multiples": textakel.count_multiples, "lower": textakel.lower, "remove-consonant": textakel.remove_consonant, "remove-digit": textakel.remove_digit, "remove-letter": textakel.remove_letter, "remove-punctuation": textakel.remove_punctuation, "remove-space": textakel.remove_space, "remove-vowel": textakel.remove_vowel, "reverse": textakel.reverse, "rot13": textakel.rot13, "stretch": textakel.stretch, "swap-pairs": textakel.swap_pairs, "swap-umlaut": textakel.swap_umlaut, "swapcase": textakel.swapcase, "title": textakel.title, "upper": textakel.upper } def get_function(name): return FUNCTIONS[name] def get_functions():
def takel(function_name, s): function = get_function(function_name) return function(s)
return list(FUNCTIONS.keys())
json.ts
/*----------------------------------------------------------------------------- | Copyright (c) 2014-2017, PhosphorJS Contributors | | Distributed under the terms of the BSD 3-Clause License.
/** * A type alias for a JSON primitive. */ export type JSONPrimitive = boolean | number | string | null; /** * A type alias for a JSON value. */ export type JSONValue = JSONPrimitive | JSONObject | JSONArray; /** * A type definition for a JSON object. */ export interface JSONObject { [key: string]: JSONValue; } /** * A type definition for a JSON array. */ export interface JSONArray extends Array<JSONValue> { } /** * The namespace for JSON-specific functions. */ export namespace JSONExt { /** * Test whether a JSON value is a primitive. * * @param value - The JSON value of interest. * * @returns `true` if the value is a primitive,`false` otherwise. */ export function isPrimitive(value: JSONValue): value is JSONPrimitive { return ( value === null || typeof value === 'boolean' || typeof value === 'number' || typeof value === 'string' ); } /** * Test whether a JSON value is an array. * * @param value - The JSON value of interest. * * @returns `true` if the value is a an array, `false` otherwise. */ export function isArray(value: JSONValue): value is JSONArray { return Array.isArray(value); } /** * Test whether a JSON value is an object. * * @param value - The JSON value of interest. * * @returns `true` if the value is a an object, `false` otherwise. */ export function isObject(value: JSONValue): value is JSONObject { return !isPrimitive(value) && !isArray(value); } /** * Compare two JSON values for deep equality. * * @param first - The first JSON value of interest. * * @param second - The second JSON value of interest. * * @returns `true` if the values are equivalent, `false` otherwise. */ export function deepEqual(first: JSONValue, second: JSONValue): boolean { // Check referential and primitive equality first. if (first === second) { return true; } // If one is a primitive, the `===` check ruled out the other. if (isPrimitive(first) || isPrimitive(second)) { return false; } // Test whether they are arrays. let a1 = isArray(first); let a2 = isArray(second); // Bail if the types are different. if (a1 !== a2) { return false; } // If they are both arrays, compare them. if (a1 && a2) { return deepArrayEqual(first as JSONArray, second as JSONArray); } // At this point, they must both be objects. return deepObjectEqual(first as JSONObject, second as JSONObject); } /** * Compare two JSON arrays for deep equality. * * @param first - The first JSON array of interest. * * @param second - The second JSON array of interest. * * @returns `true` if the arrays are equal, `false` otherwise. */ export function deepArrayEqual(first: JSONArray, second: JSONArray): boolean { // Check referential equality first. if (first === second) { return true; } // Test the arrays for equal length. if (first.length !== second.length) { return false; } // Compare the values for equality. for (let i = 0, n = first.length; i < n; ++i) { if (!deepEqual(first[i], second[i])) { return false; } } // At this point, the arrays are equal. return true; } /** * Compare two JSON objects for deep equality. * * @param first - The first JSON array of interest. * * @param second - The second JSON array of interest. * * @returns `true` if the arrays are equal, `false` otherwise. */ export function deepObjectEqual(first: JSONObject, second: JSONObject): boolean { // Check referential equality first. if (first === second) { return true; } // Check for the first object's keys in the second object. for (let key in first) { if (!(key in second)) { return false; } } // Check for the second object's keys in the first object. for (let key in second) { if (!(key in first)) { return false; } } // Compare the values for equality. for (let key in first) { if (!deepEqual(first[key], second[key])) { return false; } } // At this point, the objects are equal. return true; } }
| | The full license is in the file LICENSE, distributed with this software. |----------------------------------------------------------------------------*/
array.py
import unittest class
(unittest.TestCase): def test_zip(self): """ zip takes to arrays and makes an array of tuples where tuple 1 is a tuple composed of element 1 of array 1 and 2, etc... """ # combines to arrays into one array of tuples self.assertEqual( zip(sorted(set('qwerty')), sorted(set('asdfgh'))), [('e', 'a'), ('q', 'd'), ('r', 'f'), ('t', 'g'), ('w', 'h'), ('y', 's')] ) questions = ['name', 'quest', 'favorite color', "WILL GET SKIPPED"] answers = ['lancelot', 'the holy grail', 'blue'] self.assertEqual( zip(questions, answers), [('name', 'lancelot'), ('quest', 'the holy grail'), ('favorite color', 'blue')] ) a = [1, 2] b = [(1), (2)] c = [(1,), (2,)] d = [(1, 1), (2, 2)] self.assertEquals( zip(a, d), zip(b, d), [(1, (1, 1)), (2, (2, 2))] ) self.assertEquals( zip(a, b), [(1, 1), (2, 2)], ) self.assertEquals( zip(a, c), zip(b, c), [(1, (1,)), (2, (2,))], ) self.assertEquals( zip(c, d), [((1,), (1, 1)), ((2,), (2, 2))], ) def test_any(self): """ any([array]) => takes an array and returns true if any of the elements are true """ self.assertEquals(any([True, False]), True) self.assertEquals(any([None, "apple"]), True) self.assertEquals(any([False, False]), False) self.assertEquals(any([None, ""]), False) def test_enumerate_and_string_sets(self): """ * set('string') => returns a set of the charcacters of the string, it also skips any duplicate characters. * enumerate(<list>) => returns a list of the following nature: [(1, <first_element_of_list>), ..., (N, <Nth_element_of_list>)] * <dict>.items() => returns a list of the following nature: [(key, value), ...] """ # generates an itterator that returns [(index, value), ....] char_list = [(index, v) for index, v in enumerate(sorted(set('abca')))] self.assertEquals( {0: "a", 1: 'b', 2: 'c'}.items(), char_list ) def test_reverse_enumerate_and_string_sets(self): self.assertEquals( [x for x in reversed(sorted(set(('aceg'*4) + ('bdfh'*3))))], list(reversed(sorted(set('abcdefgh')))) ) if __name__ == "__main__": unittest.main()
Tester
async_fn.rs
#[path = "../../tracing-futures/tests/support.rs"] // we don't use some of the test support functions, but `tracing-futures` does. #[allow(dead_code)] mod support; use support::*; use tracing::subscriber::with_default; use tracing_attributes::instrument; #[instrument] async fn test_async_fn(polls: usize) -> Result<(), ()> { let future = PollN::new_ok(polls); tracing::trace!(awaiting = true); future.await } #[test] fn async_fn_only_enters_for_polls()
#[test] fn async_fn_nested() { #[instrument] async fn test_async_fns_nested() { test_async_fns_nested_other().await } #[instrument] async fn test_async_fns_nested_other() { tracing::trace!(nested = true); } let span = span::mock().named("test_async_fns_nested"); let span2 = span::mock().named("test_async_fns_nested_other"); let (subscriber, handle) = subscriber::mock() .new_span(span.clone()) .enter(span.clone()) .new_span(span2.clone()) .enter(span2.clone()) .event(event::mock().with_fields(field::mock("nested").with_value(&true))) .exit(span2.clone()) .drop_span(span2) .exit(span.clone()) .drop_span(span) .done() .run_with_handle(); with_default(subscriber, || { block_on_future(async { test_async_fns_nested().await }); }); handle.assert_finished(); } #[test] fn async_fn_with_async_trait() { use async_trait::async_trait; // test the correctness of the metadata obtained by #[instrument] // (function name, functions parameters) when async-trait is used #[async_trait] pub trait TestA { async fn foo(&mut self, v: usize); } // test nesting of async fns with aync-trait #[async_trait] pub trait TestB { async fn bar(&self); } // test skip(self) with async-await #[async_trait] pub trait TestC { async fn baz(&self); } #[derive(Debug)] struct TestImpl(usize); #[async_trait] impl TestA for TestImpl { #[instrument] async fn foo(&mut self, v: usize) { self.baz().await; self.0 = v; self.bar().await } } #[async_trait] impl TestB for TestImpl { #[instrument] async fn bar(&self) { tracing::trace!(val = self.0); } } #[async_trait] impl TestC for TestImpl { #[instrument(skip(self))] async fn baz(&self) { tracing::trace!(val = self.0); } } let span = span::mock().named("foo"); let span2 = span::mock().named("bar"); let span3 = span::mock().named("baz"); let (subscriber, handle) = subscriber::mock() .new_span( span.clone() .with_field(field::mock("self")) .with_field(field::mock("v")), ) .enter(span.clone()) .new_span(span3.clone()) .enter(span3.clone()) .event(event::mock().with_fields(field::mock("val").with_value(&2u64))) .exit(span3.clone()) .drop_span(span3) .new_span(span2.clone().with_field(field::mock("self"))) .enter(span2.clone()) .event(event::mock().with_fields(field::mock("val").with_value(&5u64))) .exit(span2.clone()) .drop_span(span2) .exit(span.clone()) .drop_span(span) .done() .run_with_handle(); with_default(subscriber, || { let mut test = TestImpl(2); block_on_future(async { test.foo(5).await }); }); handle.assert_finished(); } #[test] fn async_fn_with_async_trait_and_fields_expressions() { use async_trait::async_trait; #[async_trait] pub trait Test { async fn call(&mut self, v: usize); } #[derive(Clone, Debug)] struct TestImpl; impl TestImpl { fn foo(&self) -> usize { 42 } } #[async_trait] impl Test for TestImpl { // check that self is correctly handled, even when using async_trait #[instrument(fields(val=self.foo(), test=%v+5))] async fn call(&mut self, v: usize) {} } let span = span::mock().named("call"); let (subscriber, handle) = subscriber::mock() .new_span( span.clone().with_field( field::mock("v") .with_value(&tracing::field::debug(5)) .and(field::mock("test").with_value(&tracing::field::debug(10))) .and(field::mock("val").with_value(&42u64)), ), ) .enter(span.clone()) .exit(span.clone()) .drop_span(span) .done() .run_with_handle(); with_default(subscriber, || { block_on_future(async { TestImpl.call(5).await }); }); handle.assert_finished(); } #[test] fn async_fn_with_async_trait_and_fields_expressions_with_generic_parameter() { use async_trait::async_trait; #[async_trait] pub trait Test { async fn call(); async fn call_with_self(&self); async fn call_with_mut_self(&mut self); } #[derive(Clone, Debug)] struct TestImpl; #[async_trait] impl Test for TestImpl { // instrumenting this is currently not possible, see https://github.com/tokio-rs/tracing/issues/864#issuecomment-667508801 //#[instrument(fields(Self=std::any::type_name::<Self>()))] async fn call() {} #[instrument(fields(Self=std::any::type_name::<Self>()))] async fn call_with_self(&self) {} #[instrument(fields(Self=std::any::type_name::<Self>()))] async fn call_with_mut_self(&mut self) {} } //let span = span::mock().named("call"); let span2 = span::mock().named("call_with_self"); let span3 = span::mock().named("call_with_mut_self"); let (subscriber, handle) = subscriber::mock() /*.new_span(span.clone() .with_field( field::mock("Self").with_value(&"TestImpler"))) .enter(span.clone()) .exit(span.clone()) .drop_span(span)*/ .new_span( span2 .clone() .with_field(field::mock("Self").with_value(&std::any::type_name::<TestImpl>())), ) .enter(span2.clone()) .exit(span2.clone()) .drop_span(span2) .new_span( span3 .clone() .with_field(field::mock("Self").with_value(&std::any::type_name::<TestImpl>())), ) .enter(span3.clone()) .exit(span3.clone()) .drop_span(span3) .done() .run_with_handle(); with_default(subscriber, || { block_on_future(async { TestImpl::call().await; TestImpl.call_with_self().await; TestImpl.call_with_mut_self().await }); }); handle.assert_finished(); }
{ let (subscriber, handle) = subscriber::mock() .new_span(span::mock().named("test_async_fn")) .enter(span::mock().named("test_async_fn")) .event(event::mock().with_fields(field::mock("awaiting").with_value(&true))) .exit(span::mock().named("test_async_fn")) .enter(span::mock().named("test_async_fn")) .exit(span::mock().named("test_async_fn")) .drop_span(span::mock().named("test_async_fn")) .done() .run_with_handle(); with_default(subscriber, || { block_on_future(async { test_async_fn(2).await }).unwrap(); }); handle.assert_finished(); }
teabot.py
import os import time from slackclient import SlackClient import requests import json # starterbot's ID as an environment variable BOT_ID = "<YOUR_BOT_ID>" # constants AT_BOT = "<@" + BOT_ID + ">" MAKE_TEA_COMMAND = "make tea" STOP_BOILING_COMMAND = "stop boiling" # instantiate Slack & Twilio clients slack_client = SlackClient('<YOUR_SLACK_API_TOKEN>') headers = {'content-type': 'application/json', 'Authorization': '<YOUR_RELAYR_TOKEN>', 'Cache-Control':'no-cache'} def handle_command(command, channel):
def parse_slack_output(slack_rtm_output): """ The Slack Real Time Messaging API is an events firehose. this parsing function returns None unless a message is directed at the Bot, based on its ID. """ output_list = slack_rtm_output if output_list and len(output_list) > 0: for output in output_list: if output and 'text' in output and AT_BOT in output['text']: # return text after the @ mention, whitespace removed return output['text'].split(AT_BOT)[1].strip().lower(), \ output['channel'] return None, None if __name__ == "__main__": READ_WEBSOCKET_DELAY = 1 # 1 second delay between reading from firehose if slack_client.rtm_connect(): print("StarterBot connected and running!") while True: command, channel = parse_slack_output(slack_client.rtm_read()) if command and channel: handle_command(command, channel) time.sleep(READ_WEBSOCKET_DELAY) else: print("Connection failed. Invalid Slack token or bot ID?")
""" Receives commands directed at the bot and determines if they are valid commands. If so, then acts on the commands. If not, returns back what it needs for clarification. """ response = "Not sure what you mean. Use the *" + MAKE_TEA_COMMAND + \ "* command with numbers, delimited by spaces." if command.startswith(MAKE_TEA_COMMAND): data = {'meaning': 'kettle', 'value': 'true'} r = requests.post('https://api.relayr.io/devices/<KETTLE_DEVICE_ID>/data', data=json.dumps(data), headers=headers) response = "Sure... Your water is boiling now!" if command.startswith(STOP_BOILING_COMMAND): data = {'meaning': 'kettle', 'value': 'false'} r = requests.post('https://api.relayr.io/devices/<KETTLE_DEVICE_ID>/data', data=json.dumps(data), headers=headers) response = "OK - I stopped the kettle!" if command.startswith("is the kettle boiling?"): r = requests.get('https://api.relayr.io/devices/<KETTLE_DEVICE_ID>/readings', headers=headers) resp = json.loads(r.text) try: if resp['readings'][0]['value'] == "true": response = "Yes, the kettle is currently boiling." if resp['readings'][0]['value'] == "false": response = "No, the kettle is currently off." except: response = "Unfortunately.. I don't know :(" # # Optional: check if the water is hot - only if you have a temperature sensor connected! # # uncomment the lines below if you want to add this function # if command.startswith("is the water hot?"): # r = requests.get('https://api.relayr.io/devices/<KETTLE_TEMPERATURE_DEVICE_ID>/readings', headers=headers) # resp = json.loads(r.text) # try: # if float(resp['readings'][0]['value']) < 25: # response = "The water is currently cold. You can say \"make tea\" to me and I will heat it up." # if 25 <= float(resp['readings'][0]['value']) <= 45: # response = "The water is still quite warm, I can reheat it for you. You can ask me \"make tea\"." # if float(resp['readings'][0]['value']) > 45: # response = "The water is still hot. Probably it just boiled." # except: # response = "Unfortunately.. I don't know :(" slack_client.api_call("chat.postMessage", channel=channel, text=response, as_user=True)
logger.go
package middleware import ( "fmt" "net" "net/http" "strings" "time" "github.com/rizalgowandy/gdk/pkg/env" "github.com/rizalgowandy/gdk/pkg/httpx/mux" "github.com/sirupsen/logrus" // nolint:depguard ) type timer interface { Now() time.Time Since(time.Time) time.Duration } // realClock save request times type realClock struct{} func (rc *realClock) Now() time.Time { return time.Now() } func (rc *realClock) Since(t time.Time) time.Duration { return time.Since(t) } // LogOptions logging middleware options type LogOptions struct { Formatter logrus.Formatter } // LoggingMiddleware is a middleware handler that logs the request as it goes in and the response as it goes out. type LoggingMiddleware struct { logger *logrus.Logger clock timer enableStarting bool } // NewLogger returns a new *LoggingMiddleware, yay! func NewLogger(opts ...LogOptions) *LoggingMiddleware { var opt LogOptions if len(opts) == 0 { opt = LogOptions{} } else { opt = opts[0] } if opt.Formatter == nil { opt.Formatter = &logrus.JSONFormatter{ TimestampFormat: time.RFC3339, DisableTimestamp: false, DisableHTMLEscape: !env.IsProduction(), DataKey: "", FieldMap: nil, CallerPrettyfier: nil, PrettyPrint: false, } } log := logrus.New() log.Formatter = opt.Formatter return &LoggingMiddleware{
} // realIP get the real IP from http request func realIP(req *http.Request) string { ra := req.RemoteAddr if ip := req.Header.Get(mux.HeaderXForwardedFor); ip != "" { ra = strings.Split(ip, ", ")[0] } else if ip := req.Header.Get(mux.HeaderXRealIP); ip != "" { ra = ip } else { ra, _, _ = net.SplitHostPort(ra) } return ra } // Middleware implement mux middleware interface func (m *LoggingMiddleware) Middleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { entry := logrus.NewEntry(m.logger) start := m.clock.Now() if reqID := r.Header.Get(mux.HeaderXRequestID); reqID != "" { entry = entry.WithField("request_id", reqID) } if remoteAddr := realIP(r); remoteAddr != "" { entry = entry.WithField("remote_addr", remoteAddr) } if m.enableStarting { entry.WithFields(logrus.Fields{ "request": r.RequestURI, "method": r.Method, }).Info(fmt.Sprintf("operation %s starting", r.URL.Path)) } lw := mux.NewWriter(w) next.ServeHTTP(lw, r) if !env.IsProduction() { entry = entry.WithField("response", lw.Response) } entry.WithFields(logrus.Fields{ "request_uri": r.RequestURI, "status_code": lw.StatusCode, "took": m.clock.Since(start).String(), }).Info(fmt.Sprintf("operation %s result", r.URL.Path)) }) }
logger: log, clock: &realClock{}, enableStarting: !env.IsProduction(), }
microtvm_api_server.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. import atexit import collections import collections.abc import enum import fcntl import logging import os import os.path import pathlib import queue import re import select import shlex import shutil import subprocess import sys import tarfile import tempfile import threading import time import json import serial import serial.tools.list_ports import yaml from tvm.micro.project_api import server _LOG = logging.getLogger(__name__) API_SERVER_DIR = pathlib.Path(os.path.dirname(__file__) or os.path.getcwd()) BUILD_DIR = API_SERVER_DIR / "build" MODEL_LIBRARY_FORMAT_RELPATH = "model.tar" IS_TEMPLATE = not (API_SERVER_DIR / MODEL_LIBRARY_FORMAT_RELPATH).exists() BOARDS = API_SERVER_DIR / "boards.json" # Data structure to hold the information microtvm_api_server.py needs # to communicate with each of these boards. try: with open(BOARDS) as boards: BOARD_PROPERTIES = json.load(boards) except FileNotFoundError: raise FileNotFoundError(f"Board file {{{BOARDS}}} does not exist.") def check_call(cmd_args, *args, **kwargs): cwd_str = "" if "cwd" not in kwargs else f" (in cwd: {kwargs['cwd']})" _LOG.info("run%s: %s", cwd_str, " ".join(shlex.quote(a) for a in cmd_args)) return subprocess.check_call(cmd_args, *args, **kwargs) CACHE_ENTRY_RE = re.compile(r"(?P<name>[^:]+):(?P<type>[^=]+)=(?P<value>.*)") CMAKE_BOOL_MAP = dict( [(k, True) for k in ("1", "ON", "YES", "TRUE", "Y")] + [(k, False) for k in ("0", "OFF", "NO", "FALSE", "N", "IGNORE", "NOTFOUND", "")] ) class CMakeCache(collections.abc.Mapping): def __init__(self, path): self._path = path self._dict = None def __iter__(self): return iter(self._dict) def __getitem__(self, key): if self._dict is None: self._dict = self._read_cmake_cache() return self._dict[key] def __len__(self): return len(self._dict) def _read_cmake_cache(self): """Read a CMakeCache.txt-like file and return a dictionary of values.""" entries = collections.OrderedDict() with open(self._path, encoding="utf-8") as f: for line in f: m = CACHE_ENTRY_RE.match(line.rstrip("\n")) if not m: continue if m.group("type") == "BOOL": value = CMAKE_BOOL_MAP[m.group("value").upper()] else: value = m.group("value") entries[m.group("name")] = value return entries CMAKE_CACHE = CMakeCache(BUILD_DIR / "CMakeCache.txt") class BoardError(Exception): """Raised when an attached board cannot be opened (i.e. missing /dev nodes, etc).""" class BoardAutodetectFailed(Exception): """Raised when no attached hardware is found matching the board= given to ZephyrCompiler.""" def _get_flash_runner(): flash_runner = CMAKE_CACHE.get("ZEPHYR_BOARD_FLASH_RUNNER") if flash_runner is not None: return flash_runner with open(CMAKE_CACHE["ZEPHYR_RUNNERS_YAML"]) as f: doc = yaml.load(f, Loader=yaml.FullLoader) return doc["flash-runner"] def _get_device_args(options): flash_runner = _get_flash_runner() if flash_runner == "nrfjprog": return _get_nrf_device_args(options) if flash_runner == "openocd": return _get_openocd_device_args(options) raise BoardError( f"Don't know how to find serial terminal for board {CMAKE_CACHE['BOARD']} with flash " f"runner {flash_runner}" ) # kwargs passed to usb.core.find to find attached boards for the openocd flash runner. BOARD_USB_FIND_KW = { "nucleo_l4r5zi": {"idVendor": 0x0483, "idProduct": 0x374B}, "nucleo_f746zg": {"idVendor": 0x0483, "idProduct": 0x374B}, "stm32f746g_disco": {"idVendor": 0x0483, "idProduct": 0x374B}, "mimxrt1050_evk": {"idVendor": 0x1366, "idProduct": 0x0105}, } def openocd_serial(options): """Find the serial port to use for a board with OpenOCD flash strategy.""" if "openocd_serial" in options: return options["openocd_serial"] import usb # pylint: disable=import-outside-toplevel find_kw = BOARD_USB_FIND_KW[CMAKE_CACHE["BOARD"]] boards = usb.core.find(find_all=True, **find_kw) serials = [] for b in boards: serials.append(b.serial_number) if len(serials) == 0: raise BoardAutodetectFailed(f"No attached USB devices matching: {find_kw!r}") serials.sort() autodetected_openocd_serial = serials[0] _LOG.debug("zephyr openocd driver: autodetected serial %s", serials[0]) return autodetected_openocd_serial def _get_openocd_device_args(options): return ["--serial", openocd_serial(options)] def _get_nrf_device_args(options): nrfjprog_args = ["nrfjprog", "--ids"] nrfjprog_ids = subprocess.check_output(nrfjprog_args, encoding="utf-8") if not nrfjprog_ids.strip("\n"): raise BoardAutodetectFailed(f'No attached boards recognized by {" ".join(nrfjprog_args)}') boards = nrfjprog_ids.split("\n")[:-1] if len(boards) > 1: if options["nrfjprog_snr"] is None: raise BoardError( "Multiple boards connected; specify one with nrfjprog_snr=: " f'{", ".join(boards)}' ) if str(options["nrfjprog_snr"]) not in boards: raise BoardError( f"nrfjprog_snr ({options['nrfjprog_snr']}) not found in {nrfjprog_args}: {boards}" ) return ["--snr", options["nrfjprog_snr"]] if not boards: return [] return ["--snr", boards[0]] PROJECT_TYPES = [] if IS_TEMPLATE: for d in (API_SERVER_DIR / "src").iterdir(): if d.is_dir(): PROJECT_TYPES.append(d.name) PROJECT_OPTIONS = [ server.ProjectOption( "extra_files_tar", help="If given, during generate_project, uncompress the tarball at this path into the project dir.", ), server.ProjectOption( "gdbserver_port", help=("If given, port number to use when running the local gdbserver.") ), server.ProjectOption( "nrfjprog_snr", help=("When used with nRF targets, serial # of the attached board to use, from nrfjprog."), ), server.ProjectOption( "openocd_serial", help=("When used with OpenOCD targets, serial # of the attached board to use."), ), server.ProjectOption( "project_type", help="Type of project to generate.", choices=tuple(PROJECT_TYPES), ), server.ProjectOption("verbose", help="Run build with verbose output.", choices=(True, False)), server.ProjectOption( "west_cmd", help=( "Path to the west tool. If given, supersedes both the zephyr_base " "option and ZEPHYR_BASE environment variable." ), ), server.ProjectOption("zephyr_base", help="Path to the zephyr base directory."), server.ProjectOption( "zephyr_board", choices=list(BOARD_PROPERTIES), help="Name of the Zephyr board to build for.", ), server.ProjectOption( "config_main_stack_size", help="Sets CONFIG_MAIN_STACK_SIZE for Zephyr board.", ), ] class Handler(server.ProjectAPIHandler): def __init__(self): super(Handler, self).__init__() self._proc = None def server_info_query(self, tvm_version): return server.ServerInfo( platform_name="zephyr", is_template=IS_TEMPLATE, model_library_format_path="" if IS_TEMPLATE else (API_SERVER_DIR / MODEL_LIBRARY_FORMAT_RELPATH), project_options=PROJECT_OPTIONS, ) # These files and directories will be recursively copied into generated projects from the CRT. CRT_COPY_ITEMS = ("include", "Makefile", "src") # Maps extra line added to prj.conf to a tuple or list of zephyr_board for which it is needed. EXTRA_PRJ_CONF_DIRECTIVES = { "CONFIG_TIMER_RANDOM_GENERATOR=y": ( "qemu_x86", "qemu_riscv32", "qemu_cortex_r5", "qemu_riscv64", ), "CONFIG_ENTROPY_GENERATOR=y": ( "mps2_an521", "nrf5340dk_nrf5340_cpuapp", "nucleo_f746zg", "nucleo_l4r5zi", "stm32f746g_disco", ), } def _create_prj_conf(self, project_dir, options): with open(project_dir / "prj.conf", "w") as f: f.write( "# For UART used from main().\n" "CONFIG_RING_BUFFER=y\n" "CONFIG_UART_CONSOLE=n\n" "CONFIG_UART_INTERRUPT_DRIVEN=y\n" "\n" ) f.write("# For TVMPlatformAbort().\n" "CONFIG_REBOOT=y\n" "\n") if options["project_type"] == "host_driven": f.write("# For RPC server C++ bindings.\n" "CONFIG_CPLUSPLUS=y\n" "\n") f.write("# For math routines\n" "CONFIG_NEWLIB_LIBC=y\n" "\n") if self._has_fpu(options["zephyr_board"]): f.write("# For models with floating point.\n" "CONFIG_FPU=y\n" "\n") # Set main stack size, if needed. if options.get("config_main_stack_size") is not None: f.write(f"CONFIG_MAIN_STACK_SIZE={options['config_main_stack_size']}\n") f.write("# For random number generation.\n" "CONFIG_TEST_RANDOM_GENERATOR=y\n") f.write("\n# Extra prj.conf directives\n") for line, board_list in self.EXTRA_PRJ_CONF_DIRECTIVES.items(): if options["zephyr_board"] in board_list: f.write(f"{line}\n") f.write("\n") API_SERVER_CRT_LIBS_TOKEN = "<API_SERVER_CRT_LIBS>" CRT_LIBS_BY_PROJECT_TYPE = { "host_driven": "microtvm_rpc_server microtvm_rpc_common common", "aot_demo": "memory microtvm_rpc_common common", } def generate_project(self, model_library_format_path, standalone_crt_dir, project_dir, options): project_dir = pathlib.Path(project_dir) # Make project directory. project_dir.mkdir() # Copy ourselves to the generated project. TVM may perform further build steps on the generated project # by launching the copy. shutil.copy2(__file__, project_dir / os.path.basename(__file__)) # Copy boards.json file to generated project. shutil.copy2(BOARDS, project_dir / BOARDS.name) # Place Model Library Format tarball in the special location, which this script uses to decide # whether it's being invoked in a template or generated project. project_model_library_format_tar_path = project_dir / MODEL_LIBRARY_FORMAT_RELPATH shutil.copy2(model_library_format_path, project_model_library_format_tar_path) # Extract Model Library Format tarball.into <project_dir>/model. extract_path = os.path.splitext(project_model_library_format_tar_path)[0] with tarfile.TarFile(project_model_library_format_tar_path) as tf: os.makedirs(extract_path) tf.extractall(path=extract_path) if self._is_qemu(options): shutil.copytree(API_SERVER_DIR / "qemu-hack", project_dir / "qemu-hack") # Populate CRT. crt_path = project_dir / "crt" crt_path.mkdir() for item in self.CRT_COPY_ITEMS: src_path = os.path.join(standalone_crt_dir, item) dst_path = crt_path / item if os.path.isdir(src_path): shutil.copytree(src_path, dst_path) else: shutil.copy2(src_path, dst_path) # Populate Makefile. with open(API_SERVER_DIR / "CMakeLists.txt.template", "r") as cmake_template_f: with open(project_dir / "CMakeLists.txt", "w") as cmake_f: for line in cmake_template_f: if self.API_SERVER_CRT_LIBS_TOKEN in line: crt_libs = self.CRT_LIBS_BY_PROJECT_TYPE[options["project_type"]] line = line.replace("<API_SERVER_CRT_LIBS>", crt_libs) cmake_f.write(line) self._create_prj_conf(project_dir, options) # Populate crt-config.h crt_config_dir = project_dir / "crt_config" crt_config_dir.mkdir() shutil.copy2( API_SERVER_DIR / "crt_config" / "crt_config.h", crt_config_dir / "crt_config.h" ) # Populate src/ src_dir = project_dir / "src" shutil.copytree(API_SERVER_DIR / "src" / options["project_type"], src_dir) # Populate extra_files if options.get("extra_files_tar"): with tarfile.open(options["extra_files_tar"], mode="r:*") as tf: tf.extractall(project_dir) def build(self, options): BUILD_DIR.mkdir() cmake_args = ["cmake", ".."] if options.get("verbose"): cmake_args.append("-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE") if options.get("zephyr_base"): cmake_args.append(f"-DZEPHYR_BASE:STRING={options['zephyr_base']}") if options.get("west_cmd"): cmake_args.append(f"-DWEST={options['west_cmd']}") cmake_args.append(f"-DBOARD:STRING={options['zephyr_board']}") check_call(cmake_args, cwd=BUILD_DIR) args = ["make", "-j2"] if options.get("verbose"): args.append("VERBOSE=1") check_call(args, cwd=BUILD_DIR) # A list of all zephyr_board values which are known to launch using QEMU. Many platforms which # launch through QEMU by default include "qemu" in their name. However, not all do. This list # includes those tested platforms which do not include qemu. _KNOWN_QEMU_ZEPHYR_BOARDS = ("mps2_an521",) @classmethod def _is_qemu(cls, options): return ( "qemu" in options["zephyr_board"] or options["zephyr_board"] in cls._KNOWN_QEMU_ZEPHYR_BOARDS ) @classmethod def _has_fpu(cls, zephyr_board): fpu_boards = [name for name, board in BOARD_PROPERTIES.items() if board["fpu"]] return zephyr_board in fpu_boards def flash(self, options): if self._is_qemu(options): return # NOTE: qemu requires no flash step--it is launched from open_transport. zephyr_board = options["zephyr_board"] # The nRF5340DK requires an additional `nrfjprog --recover` before each flash cycle. # This is because readback protection is enabled by default when this device is flashed. # Otherwise, flashing may fail with an error such as the following: # ERROR: The operation attempted is unavailable due to readback protection in # ERROR: your device. Please use --recover to unlock the device. if zephyr_board.startswith("nrf5340dk") and _get_flash_runner() == "nrfjprog": recover_args = ["nrfjprog", "--recover"] recover_args.extend(_get_nrf_device_args(options)) check_call(recover_args, cwd=API_SERVER_DIR / "build") check_call(["make", "flash"], cwd=API_SERVER_DIR / "build") def open_transport(self, options): if self._is_qemu(options): transport = ZephyrQemuTransport(options) else: transport = ZephyrSerialTransport(options) to_return = transport.open() self._transport = transport atexit.register(lambda: self.close_transport()) return to_return def close_transport(self): if self._transport is not None: self._transport.close() self._transport = None def read_transport(self, n, timeout_sec): if self._transport is None: raise server.TransportClosedError() return self._transport.read(n, timeout_sec) def write_transport(self, data, timeout_sec): if self._transport is None: raise server.TransportClosedError() return self._transport.write(data, timeout_sec) def _set_nonblock(fd): flag = fcntl.fcntl(fd, fcntl.F_GETFL) fcntl.fcntl(fd, fcntl.F_SETFL, flag | os.O_NONBLOCK) new_flag = fcntl.fcntl(fd, fcntl.F_GETFL) assert (new_flag & os.O_NONBLOCK) != 0, "Cannot set file descriptor {fd} to non-blocking" class ZephyrSerialTransport: @classmethod def _lookup_baud_rate(cls, options): zephyr_base = options.get("zephyr_base", os.environ["ZEPHYR_BASE"]) sys.path.insert(0, os.path.join(zephyr_base, "scripts", "dts")) try: import dtlib # pylint: disable=import-outside-toplevel finally: sys.path.pop(0) dt_inst = dtlib.DT(BUILD_DIR / "zephyr" / "zephyr.dts") uart_baud = ( dt_inst.get_node("/chosen") .props["zephyr,console"] .to_path() .props["current-speed"] .to_num() ) _LOG.debug("zephyr transport: found UART baudrate from devicetree: %d", uart_baud) return uart_baud @classmethod def _find_nrf_serial_port(cls, options): com_ports = subprocess.check_output( ["nrfjprog", "--com"] + _get_device_args(options), encoding="utf-8" ) ports_by_vcom = {} for line in com_ports.split("\n")[:-1]: parts = line.split() ports_by_vcom[parts[2]] = parts[1] return ports_by_vcom["VCOM2"] @classmethod def _find_openocd_serial_port(cls, options): serial_number = openocd_serial(options) ports = [p for p in serial.tools.list_ports.grep(serial_number)] if len(ports) != 1: raise Exception( f"_find_openocd_serial_port: expected 1 port to match {serial_number}, " f"found: {ports!r}" ) return ports[0].device @classmethod def _find_jlink_serial_port(cls, options): return cls._find_openocd_serial_port(options) @classmethod def _find_serial_port(cls, options): flash_runner = _get_flash_runner() if flash_runner == "nrfjprog": return cls._find_nrf_serial_port(options) if flash_runner == "openocd": return cls._find_openocd_serial_port(options) if flash_runner == "jlink": return cls._find_jlink_serial_port(options) raise RuntimeError(f"Don't know how to deduce serial port for flash runner {flash_runner}") def __init__(self, options): self._options = options self._port = None def
(self): port_path = self._find_serial_port(self._options) self._port = serial.Serial(port_path, baudrate=self._lookup_baud_rate(self._options)) return server.TransportTimeouts( session_start_retry_timeout_sec=2.0, session_start_timeout_sec=5.0, session_established_timeout_sec=5.0, ) def close(self): self._port.close() self._port = None def read(self, n, timeout_sec): self._port.timeout = timeout_sec to_return = self._port.read(n) if not to_return: raise server.IoTimeoutError() return to_return def write(self, data, timeout_sec): self._port.write_timeout = timeout_sec bytes_written = 0 while bytes_written < len(data): n = self._port.write(data) data = data[n:] bytes_written += n class ZephyrQemuMakeResult(enum.Enum): QEMU_STARTED = "qemu_started" MAKE_FAILED = "make_failed" EOF = "eof" class ZephyrQemuTransport: """The user-facing Zephyr QEMU transport class.""" def __init__(self, options): self.options = options self.proc = None self.pipe_dir = None self.read_fd = None self.write_fd = None self._queue = queue.Queue() def open(self): self.pipe_dir = pathlib.Path(tempfile.mkdtemp()) self.pipe = self.pipe_dir / "fifo" self.write_pipe = self.pipe_dir / "fifo.in" self.read_pipe = self.pipe_dir / "fifo.out" os.mkfifo(self.write_pipe) os.mkfifo(self.read_pipe) if "gdbserver_port" in self.options: if "env" in self.kwargs: self.kwargs["env"] = copy.copy(self.kwargs["env"]) else: self.kwargs["env"] = os.environ.copy() self.kwargs["env"]["TVM_QEMU_GDBSERVER_PORT"] = str(self.options["gdbserver_port"]) self.proc = subprocess.Popen( ["make", "run", f"QEMU_PIPE={self.pipe}"], cwd=BUILD_DIR, stdout=subprocess.PIPE, ) self._wait_for_qemu() # NOTE: although each pipe is unidirectional, open both as RDWR to work around a select # limitation on linux. Without this, non-blocking I/O can't use timeouts because named # FIFO are always considered ready to read when no one has opened them for writing. self.read_fd = os.open(self.read_pipe, os.O_RDWR | os.O_NONBLOCK) self.write_fd = os.open(self.write_pipe, os.O_RDWR | os.O_NONBLOCK) _set_nonblock(self.read_fd) _set_nonblock(self.write_fd) return server.TransportTimeouts( session_start_retry_timeout_sec=2.0, session_start_timeout_sec=10.0, session_established_timeout_sec=10.0, ) def close(self): did_write = False if self.write_fd is not None: try: server.write_with_timeout( self.write_fd, b"\x01x", 1.0 ) # Use a short timeout since we will kill the process did_write = True except server.IoTimeoutError: pass os.close(self.write_fd) self.write_fd = None if self.proc: if not did_write: self.proc.terminate() try: self.proc.wait(5.0) except subprocess.TimeoutExpired: self.proc.kill() if self.read_fd: os.close(self.read_fd) self.read_fd = None if self.pipe_dir is not None: shutil.rmtree(self.pipe_dir) self.pipe_dir = None def read(self, n, timeout_sec): return server.read_with_timeout(self.read_fd, n, timeout_sec) def write(self, data, timeout_sec): to_write = bytearray() escape_pos = [] for i, b in enumerate(data): if b == 0x01: to_write.append(b) escape_pos.append(i) to_write.append(b) while to_write: num_written = server.write_with_timeout(self.write_fd, to_write, timeout_sec) to_write = to_write[num_written:] def _qemu_check_stdout(self): for line in self.proc.stdout: line = str(line) _LOG.info("%s", line) if "[QEMU] CPU" in line: self._queue.put(ZephyrQemuMakeResult.QEMU_STARTED) else: line = re.sub("[^a-zA-Z0-9 \n]", "", line) pattern = r"recipe for target (\w*) failed" if re.search(pattern, line, re.IGNORECASE): self._queue.put(ZephyrQemuMakeResult.MAKE_FAILED) self._queue.put(ZephyrQemuMakeResult.EOF) def _wait_for_qemu(self): threading.Thread(target=self._qemu_check_stdout, daemon=True).start() while True: try: item = self._queue.get(timeout=120) except Exception: raise TimeoutError("QEMU setup timeout.") if item == ZephyrQemuMakeResult.QEMU_STARTED: break if item in [ZephyrQemuMakeResult.MAKE_FAILED, ZephyrQemuMakeResult.EOF]: raise RuntimeError("QEMU setup failed.") raise ValueError(f"{item} not expected.") if __name__ == "__main__": server.main(Handler())
open
user.py
from sqlalchemy import Column, Integer, ForeignKey, DateTime from sqlalchemy.sql.sqltypes import Boolean, String from app.db.database import Base class
(Base): __tablename__ = "users" id = Column(Integer, primary_key=True, index=True) username = Column(String, nullable=False, index=True) disabled = Column(Boolean, default=False) hashed_password = Column(String, nullable=False)
UserModel
dcim_front_port_templates_partial_update_responses.go
// Code generated by go-swagger; DO NOT EDIT. // Copyright 2020 The go-netbox Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // package dcim // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "fmt" "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" "github.com/digitalocean/go-netbox/netbox/models" ) // DcimFrontPortTemplatesPartialUpdateReader is a Reader for the DcimFrontPortTemplatesPartialUpdate structure. type DcimFrontPortTemplatesPartialUpdateReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *DcimFrontPortTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewDcimFrontPortTemplatesPartialUpdateOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
func NewDcimFrontPortTemplatesPartialUpdateOK() *DcimFrontPortTemplatesPartialUpdateOK { return &DcimFrontPortTemplatesPartialUpdateOK{} } /* DcimFrontPortTemplatesPartialUpdateOK describes a response with status code 200, with default header values. DcimFrontPortTemplatesPartialUpdateOK dcim front port templates partial update o k */ type DcimFrontPortTemplatesPartialUpdateOK struct { Payload *models.FrontPortTemplate } func (o *DcimFrontPortTemplatesPartialUpdateOK) Error() string { return fmt.Sprintf("[PATCH /dcim/front-port-templates/{id}/][%d] dcimFrontPortTemplatesPartialUpdateOK %+v", 200, o.Payload) } func (o *DcimFrontPortTemplatesPartialUpdateOK) GetPayload() *models.FrontPortTemplate { return o.Payload } func (o *DcimFrontPortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.FrontPortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil }
} } // NewDcimFrontPortTemplatesPartialUpdateOK creates a DcimFrontPortTemplatesPartialUpdateOK with default headers values
accessible.rs
// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::AccessibleProperty; use crate::AccessibleRelation; use crate::AccessibleRole; use crate::AccessibleState; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; glib::wrapper! { pub struct Accessible(Interface<ffi::GtkAccessible, ffi::GtkAccessibleInterface>); match fn { get_type => || ffi::gtk_accessible_get_type(), }
pub const NONE_ACCESSIBLE: Option<&Accessible> = None; pub trait AccessibleExt: 'static { #[doc(alias = "gtk_accessible_get_accessible_role")] fn accessible_role(&self) -> AccessibleRole; #[doc(alias = "gtk_accessible_reset_property")] fn reset_property(&self, property: AccessibleProperty); #[doc(alias = "gtk_accessible_reset_relation")] fn reset_relation(&self, relation: AccessibleRelation); #[doc(alias = "gtk_accessible_reset_state")] fn reset_state(&self, state: AccessibleState); #[doc(alias = "set_property_accessible_role")] fn set_accessible_role(&self, accessible_role: AccessibleRole); fn connect_property_accessible_role_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId; } impl<O: IsA<Accessible>> AccessibleExt for O { fn accessible_role(&self) -> AccessibleRole { unsafe { from_glib(ffi::gtk_accessible_get_accessible_role( self.as_ref().to_glib_none().0, )) } } fn reset_property(&self, property: AccessibleProperty) { unsafe { ffi::gtk_accessible_reset_property(self.as_ref().to_glib_none().0, property.to_glib()); } } fn reset_relation(&self, relation: AccessibleRelation) { unsafe { ffi::gtk_accessible_reset_relation(self.as_ref().to_glib_none().0, relation.to_glib()); } } fn reset_state(&self, state: AccessibleState) { unsafe { ffi::gtk_accessible_reset_state(self.as_ref().to_glib_none().0, state.to_glib()); } } fn set_accessible_role(&self, accessible_role: AccessibleRole) { unsafe { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"accessible-role\0".as_ptr() as *const _, glib::Value::from(&accessible_role).to_glib_none().0, ); } } fn connect_property_accessible_role_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_accessible_role_trampoline<P, F: Fn(&P) + 'static>( this: *mut ffi::GtkAccessible, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) where P: IsA<Accessible>, { let f: &F = &*(f as *const F); f(&Accessible::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_<F> = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accessible-role\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accessible_role_trampoline::<Self, F> as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for Accessible { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Accessible") } }
}
models.py
""" .. module: lemur.certificates.models :platform: Unix :copyright: (c) 2018 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Kevin Glisson <[email protected]> """ from datetime import timedelta import arrow from cryptography import x509 from flask import current_app from idna.core import InvalidCodepoint from sqlalchemy import ( event, Integer, ForeignKey, String, PassiveDefault, func, Column, Text, Boolean, Index, ) from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.orm import relationship from sqlalchemy.sql.expression import case, extract from sqlalchemy_utils.types.arrow import ArrowType from werkzeug.utils import cached_property from lemur.common import defaults, utils, validators from lemur.constants import SUCCESS_METRIC_STATUS, FAILURE_METRIC_STATUS from lemur.database import db from lemur.domains.models import Domain from lemur.extensions import metrics from lemur.extensions import sentry from lemur.models import ( certificate_associations, certificate_source_associations, certificate_destination_associations, certificate_notification_associations, certificate_replacement_associations, roles_certificates, pending_cert_replacement_associations, ) from lemur.plugins.base import plugins from lemur.policies.models import RotationPolicy from lemur.utils import Vault def get_sequence(name): if "-" not in name: return name, None parts = name.split("-") # see if we have an int at the end of our name try: seq = int(parts[-1]) except ValueError: return name, None # we might have a date at the end of our name if len(parts[-1]) == 8: return name, None root = "-".join(parts[:-1]) return root, seq def get_or_increase_name(name, serial): certificates = Certificate.query.filter(Certificate.name == name).all() if not certificates: return name serial_name = "{0}-{1}".format(name, hex(int(serial))[2:].upper()) certificates = Certificate.query.filter(Certificate.name == serial_name).all() if not certificates: return serial_name certificates = Certificate.query.filter( Certificate.name.ilike("{0}%".format(serial_name)) ).all() ends = [0] root, end = get_sequence(serial_name) for cert in certificates: root, end = get_sequence(cert.name) if end: ends.append(end) return "{0}-{1}".format(root, max(ends) + 1) class Certificate(db.Model): __tablename__ = "certificates" __table_args__ = ( Index( "ix_certificates_cn", "cn", postgresql_ops={"cn": "gin_trgm_ops"}, postgresql_using="gin", ), Index( "ix_certificates_name", "name", postgresql_ops={"name": "gin_trgm_ops"}, postgresql_using="gin", ), ) id = Column(Integer, primary_key=True) ix = Index( "ix_certificates_id_desc", id.desc(), postgresql_using="btree", unique=True ) external_id = Column(String(128)) owner = Column(String(128), nullable=False) name = Column(String(256), unique=True) description = Column(String(1024)) notify = Column(Boolean, default=True) body = Column(Text(), nullable=False) chain = Column(Text()) csr = Column(Text()) private_key = Column(Vault) issuer = Column(String(128)) serial = Column(String(128)) cn = Column(String(128)) deleted = Column(Boolean, index=True, default=False) dns_provider_id = Column( Integer(), ForeignKey("dns_providers.id", ondelete="CASCADE"), nullable=True ) not_before = Column(ArrowType) not_after = Column(ArrowType) not_after_ix = Index("ix_certificates_not_after", not_after.desc()) date_created = Column(ArrowType, PassiveDefault(func.now()), nullable=False) signing_algorithm = Column(String(128)) status = Column(String(128)) bits = Column(Integer()) san = Column(String(1024)) # TODO this should be migrated to boolean rotation = Column(Boolean, default=False) user_id = Column(Integer, ForeignKey("users.id")) authority_id = Column(Integer, ForeignKey("authorities.id", ondelete="CASCADE")) root_authority_id = Column( Integer, ForeignKey("authorities.id", ondelete="CASCADE") ) rotation_policy_id = Column(Integer, ForeignKey("rotation_policies.id")) key_type = Column(String(128)) notifications = relationship( "Notification", secondary=certificate_notification_associations, backref="certificate", ) destinations = relationship( "Destination", secondary=certificate_destination_associations, backref="certificate", ) sources = relationship( "Source", secondary=certificate_source_associations, backref="certificate" ) domains = relationship( "Domain", secondary=certificate_associations, backref="certificate" ) roles = relationship("Role", secondary=roles_certificates, backref="certificate") replaces = relationship( "Certificate", secondary=certificate_replacement_associations, primaryjoin=id == certificate_replacement_associations.c.certificate_id, # noqa secondaryjoin=id == certificate_replacement_associations.c.replaced_certificate_id, # noqa backref="replaced", ) replaced_by_pending = relationship( "PendingCertificate", secondary=pending_cert_replacement_associations, backref="pending_replace", viewonly=True, ) logs = relationship("Log", backref="certificate") endpoints = relationship("Endpoint", backref="certificate") rotation_policy = relationship("RotationPolicy") sensitive_fields = ("private_key",) def __init__(self, **kwargs): self.body = kwargs["body"].strip() cert = self.parsed_cert self.issuer = defaults.issuer(cert) self.cn = defaults.common_name(cert) self.san = defaults.san(cert) self.not_before = defaults.not_before(cert) self.not_after = defaults.not_after(cert) self.serial = defaults.serial(cert) # when destinations are appended they require a valid name. if kwargs.get("name"): self.name = get_or_increase_name( defaults.text_to_slug(kwargs["name"]), self.serial ) else: self.name = get_or_increase_name( defaults.certificate_name( self.cn, self.issuer, self.not_before, self.not_after, self.san ), self.serial, ) self.owner = kwargs["owner"] if kwargs.get("private_key"): self.private_key = kwargs["private_key"].strip() if kwargs.get("chain"): self.chain = kwargs["chain"].strip() if kwargs.get("csr"): self.csr = kwargs["csr"].strip() self.notify = kwargs.get("notify", True) self.destinations = kwargs.get("destinations", []) self.notifications = kwargs.get("notifications", []) self.description = kwargs.get("description") self.roles = list(set(kwargs.get("roles", []))) self.replaces = kwargs.get("replaces", []) self.rotation = kwargs.get("rotation") self.rotation_policy = kwargs.get("rotation_policy") self.signing_algorithm = defaults.signing_algorithm(cert) self.bits = defaults.bitstrength(cert) self.external_id = kwargs.get("external_id") self.authority_id = kwargs.get("authority_id") self.dns_provider_id = kwargs.get("dns_provider_id") for domain in defaults.domains(cert): self.domains.append(Domain(name=domain)) # Check integrity before saving anything into the database. # For user-facing API calls, validation should also be done in schema validators. self.check_integrity() def check_integrity(self): """ Integrity checks: Does the cert have a valid chain and matching private key? """ if self.private_key: validators.verify_private_key_match( utils.parse_private_key(self.private_key), self.parsed_cert, error_class=AssertionError, ) if self.chain: chain = [self.parsed_cert] + utils.parse_cert_chain(self.chain) validators.verify_cert_chain(chain, error_class=AssertionError) @cached_property def parsed_cert(self): assert self.body, "Certificate body not set" return utils.parse_certificate(self.body) @property def active(self): return self.notify @property def organization(self): return defaults.organization(self.parsed_cert) @property def organizational_unit(self): return defaults.organizational_unit(self.parsed_cert) @property def country(self): return defaults.country(self.parsed_cert) @property def state(self): return defaults.state(self.parsed_cert) @property def location(self): return defaults.location(self.parsed_cert) @property def
(self): return self.parsed_cert.subject.rfc4514_string() """ # Commenting this property as key_type is now added as a column. This code can be removed in future. @property def key_type(self): if isinstance(self.parsed_cert.public_key(), rsa.RSAPublicKey): return "RSA{key_size}".format( key_size=self.parsed_cert.public_key().key_size ) elif isinstance(self.parsed_cert.public_key(), ec.EllipticCurvePublicKey): return get_key_type_from_ec_curve(self.parsed_cert.public_key().curve.name) """ @property def validity_remaining(self): return abs(self.not_after - arrow.utcnow()) @property def validity_range(self): return self.not_after - self.not_before @property def max_issuance_days(self): public_CA = current_app.config.get("PUBLIC_CA_AUTHORITY_NAMES", []) if self.name.lower() in [ca.lower() for ca in public_CA]: return current_app.config.get("PUBLIC_CA_MAX_VALIDITY_DAYS", 397) @property def default_validity_days(self): public_CA = current_app.config.get("PUBLIC_CA_AUTHORITY_NAMES", []) if self.name.lower() in [ca.lower() for ca in public_CA]: return current_app.config.get("PUBLIC_CA_MAX_VALIDITY_DAYS", 397) return current_app.config.get("DEFAULT_VALIDITY_DAYS", 365) # 1 year default @property def subject(self): return self.parsed_cert.subject @property def public_key(self): return self.parsed_cert.public_key() @hybrid_property def expired(self): # can't compare offset-naive and offset-aware datetimes if arrow.Arrow.fromdatetime(self.not_after) <= arrow.utcnow(): return True @expired.expression def expired(cls): return case([(cls.not_after <= arrow.utcnow(), True)], else_=False) @hybrid_property def revoked(self): if "revoked" == self.status: return True @revoked.expression def revoked(cls): return case([(cls.status == "revoked", True)], else_=False) @hybrid_property def has_private_key(self): return self.private_key is not None @has_private_key.expression def has_private_key(cls): return case([(cls.private_key.is_(None), True)], else_=False) @hybrid_property def in_rotation_window(self): """ Determines if a certificate is available for rotation based on the rotation policy associated. :return: """ now = arrow.utcnow() end = now + timedelta(days=self.rotation_policy.days) if self.not_after <= end: return True @in_rotation_window.expression def in_rotation_window(cls): """ Determines if a certificate is available for rotation based on the rotation policy associated. :return: """ return case( [(extract("day", cls.not_after - func.now()) <= RotationPolicy.days, True)], else_=False, ) @property def extensions(self): # setup default values return_extensions = {"sub_alt_names": {"names": []}} try: for extension in self.parsed_cert.extensions: value = extension.value if isinstance(value, x509.BasicConstraints): return_extensions["basic_constraints"] = value elif isinstance(value, x509.SubjectAlternativeName): return_extensions["sub_alt_names"]["names"] = value elif isinstance(value, x509.ExtendedKeyUsage): return_extensions["extended_key_usage"] = value elif isinstance(value, x509.KeyUsage): return_extensions["key_usage"] = value elif isinstance(value, x509.SubjectKeyIdentifier): return_extensions["subject_key_identifier"] = {"include_ski": True} elif isinstance(value, x509.AuthorityInformationAccess): return_extensions["certificate_info_access"] = {"include_aia": True} elif isinstance(value, x509.AuthorityKeyIdentifier): aki = {"use_key_identifier": False, "use_authority_cert": False} if value.key_identifier: aki["use_key_identifier"] = True if value.authority_cert_issuer: aki["use_authority_cert"] = True return_extensions["authority_key_identifier"] = aki elif isinstance(value, x509.CRLDistributionPoints): return_extensions["crl_distribution_points"] = { "include_crl_dp": value } # TODO: Not supporting custom OIDs yet. https://github.com/Netflix/lemur/issues/665 else: current_app.logger.warning( "Custom OIDs not yet supported for clone operation." ) except InvalidCodepoint as e: sentry.captureException() current_app.logger.warning( "Unable to parse extensions due to underscore in dns name" ) except ValueError as e: sentry.captureException() current_app.logger.warning("Unable to parse") current_app.logger.exception(e) return return_extensions def __repr__(self): return "Certificate(name={name})".format(name=self.name) @event.listens_for(Certificate.destinations, "append") def update_destinations(target, value, initiator): """ Attempt to upload certificate to the new destination :param target: :param value: :param initiator: :return: """ destination_plugin = plugins.get(value.plugin_name) status = FAILURE_METRIC_STATUS if target.expired: return try: if target.private_key or not destination_plugin.requires_key: destination_plugin.upload( target.name, target.body, target.private_key, target.chain, value.options, ) status = SUCCESS_METRIC_STATUS except Exception as e: sentry.captureException() raise metrics.send( "destination_upload", "counter", 1, metric_tags={ "status": status, "certificate": target.name, "destination": value.label, }, ) @event.listens_for(Certificate.replaces, "append") def update_replacement(target, value, initiator): """ When a certificate is marked as 'replaced' we should not notify. :param target: :param value: :param initiator: :return: """ value.notify = False
distinguished_name
TaobaoWeikePerformancePutResponse.go
package servicecenter import ( "encoding/xml" "github.com/bububa/opentaobao/model" ) /* 提交客服绩效接口 APIResponse taobao.weike.performance.put 提交客服绩效接口 */ type TaobaoWeikePerformancePutAPIResponse struct { model.CommonResponse TaobaoWeikePerformancePutResponse } type TaobaoWeikePerformancePutResponse struct { XMLName xml.Name `xml:"weike_performance_put_response"` RequestId string `json:"request_id,omitempty" xml:"request_id,omitempty"` // 平台颁发的每次请求访问的唯一标识
Result bool `json:"result,omitempty" xml:"result,omitempty"` }
// 返回结果
effectwidget3_advanced.py
''' This example demonstrates creating and using an AdvancedEffectBase. In this case, we use it to efficiently pass the touch coordinates into the shader. ''' from kivy.base import runTouchApp from kivy.properties import ListProperty from kivy.lang import Builder from kivy.uix.effectwidget import EffectWidget, AdvancedEffectBase effect_string = ''' uniform vec2 touch; vec4 effect(vec4 color, sampler2D texture, vec2 tex_coords, vec2 coords) { vec2 distance = 0.025*(coords - touch); float dist_mag = (distance.x*distance.x + distance.y*distance.y); vec3 multiplier = vec3(abs(sin(dist_mag - time))); return vec4(multiplier * color.xyz, 1.0); } ''' class TouchEffect(AdvancedEffectBase): touch = ListProperty([0.0, 0.0]) def __init__(self, *args, **kwargs): super(TouchEffect, self).__init__(*args, **kwargs) self.glsl = effect_string self.uniforms = {'touch': [0.0, 0.0]} def on_touch(self, *args, **kwargs): self.uniforms['touch'] = [float(i) for i in self.touch] class
(EffectWidget): def __init__(self, *args, **kwargs): super(TouchWidget, self).__init__(*args, **kwargs) self.effect = TouchEffect() self.effects = [self.effect] def on_touch_down(self, touch): super(TouchWidget, self).on_touch_down(touch) self.on_touch_move(touch) def on_touch_move(self, touch): self.effect.touch = touch.pos root = Builder.load_string(''' TouchWidget: Button: text: 'Some text!' Image: source: 'data/logo/kivy-icon-512.png' allow_stretch: True keep_ratio: False ''') runTouchApp(root)
TouchWidget
webserver.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import rospy, os import SimpleHTTPServer def
(): os.system("kill -KILL " + str(os.getpid())) os.chdir(os.path.dirname(__file__)) rospy.init_node("webserver") rospy.on_shutdown(kill) SimpleHTTPServer.test()
kill
data.py
FILENAME = 'sequences_full.csv' VOCAB_SIZE = None UNK = 'UNK' POS_TAGS = { 'CC' : '<CC>', 'CD' : '<CD>', 'DT' : '<DT>', 'EX' : '<EX>', 'FW' : '<FW>', 'IN' : '<IN>', 'JJ' : '<JJ>', 'JJR' : '<JJR>', 'JJS' : '<JJS>', 'LS' : '<LS>', 'MD' : '<MD>', 'NN' : '<NN>', 'NNS' : '<NNS>', 'NNP' : '<NNP>', 'NNPS' : '<NNPS>', 'PDT' : '<PDT>', 'POS' : '<POS>', 'PRP' : '<PRP>', 'PRP' : '<PRP>', 'RB' : '<RB>', 'RBR' : '<RBR>', 'RBS' : '<RBS>', 'RP' : '<RP>', 'SYM' : '<SYM>', 'TO' : '<TO>', 'UH' : '<UH>', 'VB' : '<VB>', 'VBD' : '<VBD>', 'VBG' : '<VBG>', 'VBN' : '<VBN>', 'VBP' : '<VBP>', 'VBZ' : '<VBZ>', 'WDT' : '<WDT>', 'WP' : '<WP>', 'WP$' : '<WP$>', 'WRB' : '<WRB>' } # imports : in the order of usage import itertools import nltk import random import sys import pickle ''' read lines from file return [list of lines] ''' def read_lines(filename): return fix_win_encode(open(filename).read()).split('\n')[1:-1] def fix_win_encode(text): return text.replace('\x92', "'").replace('\x97', ' ').replace('\x91', '').replace('_b_','').replace('*','').replace('\x93','') ''' split each row of form "query |respect| response" to [ query, response, respect ] ''' def split_row(lines): q,r,respect = [], [], [] for line in lines: line = line.split('|') r.append(split_and_tag(line[0])) q.append(split_and_tag(line[-1])) respect.append(int(line[1])) return q,r,respect ''' split sentences into words and tags with nltk replace foreign words and numbers into <FW> and <CD> tags ''' def split_and_tag(line): wtags = nltk.pos_tag(nltk.word_tokenize(line.strip())) words = [] for w,t in wtags: if t == 'CD' or t == 'FW': w = t words.append(w) return words ''' read list of words, create index to word, word to index dictionaries return tuple( vocab->(word, count), idx2w, w2idx ) ''' def index_(tokenized_sentences, vocab_size): # get frequency distribution freq_dist = nltk.FreqDist(itertools.chain(*tokenized_sentences)) # get vocabulary of 'vocab_size' most used words vocab = freq_dist.most_common(vocab_size) vocab = [ item for item in vocab if item[1] > 1 ] # index2word index2word = ['_'] + ['UNK'] + list(POS_TAGS.keys()) + [ x[0] for x in vocab ] # word2index word2index = dict([(w,i) for i,w in enumerate(index2word)] ) return index2word, word2index, freq_dist ''' There will be no zero padding! ''' def encode(q, r, w2idx): # num of rows data_len = len(q) idx_q, idx_r = [], [] for i in range(data_len): idx_q.append(encode_seq(q[i], w2idx)) idx_r.append(encode_seq(r[i], w2idx)) return idx_q, idx_r ''' replace words with indices in a sequence replace with unknown if word not in lookup return [list of indices] ''' def
(seq, lookup): indices = [] for word in seq: if word in lookup: indices.append(lookup[word]) else: tag = nltk.pos_tag([word])[-1][-1] if tag in lookup: indices.append(lookup[tag]) else: indices.append(lookup[UNK]) return indices def process_data(): print('\n>> Read lines from file') lines = read_lines(filename=FILENAME) # change to lower case lines = [ line.lower() for line in lines ] print('>> [read_lines] {} lines;\nexamples\n{}'. format(len(lines), lines[121:125])) # split row into query, response and respect q, r, respect = split_row(lines) print('\n>> [split_row] \n{} {} {}'. format( q[121:125], r[121:125], respect[121:125])) ############# # NL pipeline #### ## # [1] Spell Check # # [2] POS tagging # indexing -> idx2w, w2idx : en/ta print('\n >> Index words') idx2w, w2idx, freq_dist = index_(q+r, vocab_size=None) idx_q, idx_r = encode(q, r, w2idx) data = { 'q' : idx_q, 'r' : idx_r, 'respect' : respect } # let us now save the necessary dictionaries metadata = { 'w2idx' : w2idx, 'idx2w' : idx2w, 'freq_dist' : freq_dist, 'respect_size' : max(respect) + 1 } # write to disk : data control dictionaries with open('metadata.pkl', 'wb') as f: pickle.dump(metadata, f) with open('data.pkl', 'wb') as f: pickle.dump(data, f) def load_data(PATH=''): # read data control dictionaries with open(PATH + 'metadata.pkl', 'rb') as f: metadata = pickle.load(f) with open(PATH + 'data.pkl', 'rb') as f: data = pickle.load(f) return data, metadata if __name__ == '__main__': process_data()
encode_seq
CronController.ts
import {Request, Response} from 'express'; import {Controller, Get} from '@overnightjs/core'; import {Logger} from '@overnightjs/logger'; import {Ctrl} from './Ctrl'; import Api from '../api/Api'; import Rates from '../model/Rates'; @Controller('cron') export class
implements Ctrl { private readonly API_BASE_URL: string = `http://data.fixer.io/api/latest?access_key=${process.env.API_KEY}&format=1`; private readonly api: Api; constructor(api: Api) { this.api = api; } @Get() private async fetchLatestCurrencies(req: Request, res: Response): Promise<void> { try { const rates: Rates = await this.api.fetchExternalRates(this.API_BASE_URL); this.api.storeRates(rates); res.status(200).json({ok: true}); } catch (e) { Logger.Err(e, true); res.status(500).json({ok: false}); } } }
CronController
recurringjob.go
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +kubebuilder:validation:Enum=snapshot;backup type RecurringJobType string const ( RecurringJobTypeSnapshot = RecurringJobType("snapshot") RecurringJobTypeBackup = RecurringJobType("backup") RecurringJobGroupDefault = "default" ) type VolumeRecurringJob struct { Name string `json:"name"` IsGroup bool `json:"isGroup"` } // RecurringJobSpec defines the desired state of the Longhorn recurring job type RecurringJobSpec struct { // The recurring job name. // +optional Name string `json:"name"` // The recurring job group. // +optional Groups []string `json:"groups,omitempty"` // The recurring job type. // Can be "snapshot" or "backup". // +optional Task RecurringJobType `json:"task"` // The cron setting. // +optional Cron string `json:"cron"` // The retain count of the snapshot/backup. // +kubebuilder:validation:Minimum=1 // +kubebuilder:validation:Maximum=50 // +optional Retain int `json:"retain"` // The concurrency of taking the snapshot/backup. // +kubebuilder:validation:Minimum=1 // +optional Concurrency int `json:"concurrency"` // The label of the snapshot/backup. // +optional Labels map[string]string `json:"labels,omitempty"` } // RecurringJobStatus defines the observed state of the Longhorn recurring job type RecurringJobStatus struct { // The owner ID which is responsible to reconcile this recurring job CR. // +optional OwnerID string `json:"ownerID"` } // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:shortName=lhrj // +kubebuilder:subresource:status // +kubebuilder:storageversion // +kubebuilder:printcolumn:name="Groups",type=string,JSONPath=`.spec.groups`,description="Sets groupings to the jobs. When set to \"default\" group will be added to the volume label when no other job label exist in volume" // +kubebuilder:printcolumn:name="Task",type=string,JSONPath=`.spec.task`,description="Should be one of \"backup\" or \"snapshot\"" // +kubebuilder:printcolumn:name="Cron",type=string,JSONPath=`.spec.cron`,description="The cron expression represents recurring job scheduling" // +kubebuilder:printcolumn:name="Retain",type=integer,JSONPath=`.spec.retain`,description="The number of snapshots/backups to keep for the volume" // +kubebuilder:printcolumn:name="Concurrency",type=integer,JSONPath=`.spec.concurrency`,description="The concurrent job to run by each cron job" // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // +kubebuilder:printcolumn:name="Labels",type=string,JSONPath=`.spec.labels`,description="Specify the labels" // RecurringJob is where Longhorn stores recurring job object. type RecurringJob struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec RecurringJobSpec `json:"spec,omitempty"` Status RecurringJobStatus `json:"status,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // RecurringJobList is a list of RecurringJobs. type RecurringJobList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []RecurringJob `json:"items"` }
package v1beta2
routes.py
from flask import (render_template, url_for, flash, redirect, request, abort, Blueprint) from flask_login import current_user, login_required from flaskblog import db from flaskblog.models import Post from flaskblog.posts.forms import PostForm posts = Blueprint('posts', __name__) @posts.route("/post/new", methods=['GET', 'POST']) @login_required def new_post(): form = PostForm() if form.validate_on_submit(): post = Post(title=form.title.data, content=form.content.data, author=current_user) db.session.add(post) db.session.commit() flash('Your post has been created!', 'success') return redirect(url_for('main.home_page')) return render_template('create_post.html', title='New Post', form=form, legend='New Post') @posts.route("/post/<int:post_id>") def post(post_id): post = Post.query.get_or_404(post_id) return render_template('post.html', title=post.title, post=post) @posts.route("/post/<int:post_id>/update", methods=['GET', 'POST']) @login_required def update_post(post_id): post = Post.query.get_or_404(post_id) if post.author != current_user: abort(403) form = PostForm() if form.validate_on_submit(): post.title = form.title.data post.content = form.content.data db.session.commit() flash('Your post has been updated!', 'success') return redirect(url_for('posts.post', post_id=post.id)) elif request.method == 'GET': form.title.data = post.title form.content.data = post.content return render_template('create_post.html', title='Update Post', form=form, legend='Update Post') @posts.route("/post/<int:post_id>/delete", methods=['POST']) @login_required def delete_post(post_id): post = Post.query.get_or_404(post_id) if post.author != current_user: abort(403)
db.session.delete(post) db.session.commit() flash('Your post has been deleted!', 'success') return redirect(url_for('main.home'))
xiangs_timing_tape_code.py
def set_conditional_tape(self, awg_nr, tape_nr, tape): ''' set the conditional tape content for an awg @param awg : the awg of the dac, (0,1,2). @param tape_nr : the number of the tape, integer ranging (0~6) @param tape : the array of entries, with a maximum number of entries 512. Every entry is an integer has the following structure: |WaitingTime (9bits) | PUlse number (3 bits) | EndofSegment marker (1bit)| WaitingTime: The waiting time before the end of last pulse or trigger, in ns. Pulse number: 0~7, indicating which pulse to be output EndofSegment marker: 1 if the entry is the last entry of the tape, otherwise 0. @return stat : 0 if the upload succeeded and 1 if the upload failed. ''' length = len(tape) tape_addr_width = 9 entry_length = 9 + 3 + 1 # Check out of bounds if awg_nr < 0 or awg_nr > 2: raise ValueError if tape_nr < 0 or tape_nr > 6: raise ValueError if length < 1 or length > 512: raise ValueError cmd = defHeaders.AwgCondionalTape data_bytes = [] data_bytes.append(self.encode_byte(awg_nr, 4)) data_bytes.append(self.encode_byte(tape_nr, 4)) data_bytes.append(self.encode_byte(length-1, 7, signed_integer_length=tape_addr_width, expected_number_of_bytes=np.ceil(tape_addr_width/7.0))) for sample_data in tape: data_bytes.append(self.encode_byte(self.convert_to_signed(sample_data, entry_length), 7, signed_integer_length=entry_length,
(stat, mesg) = self.serial_write(message) return (stat, mesg) def set_segmented_tape(self, awg_nr, tape): ''' set the conditional tape content for an awg @param awg : the awg of the dac, (0,1,2). @param tape : the array of entries, with a maximum number of entries 29184. Every entry is an integer has the following structure: |WaitingTime (9bits) | PUlse number (3 bits) | EndofSegment marker (1bit)| WaitingTime: The waiting time before the end of last pulse or trigger, in ns. Pulse number: 0~7, indicating which pulse to be output EndofSegment marker: 1 if the entry is the last entry of a segment, otherwise 0. @return stat : 0 if the upload succeeded and 1 if the upload failed. ''' length = len(tape) tape_addr_width = 15 entry_length = 9 + 3 + 1 # Check out of bounds if awg_nr < 0 or awg_nr > 2: raise ValueError if length < 1 or length > 29184: raise ValueError cmd = defHeaders.AwgSegmentedTape data_bytes = [] data_bytes.append(self.encode_byte(awg_nr, 4)) data_bytes.append(self.encode_byte(length-1, 7, signed_integer_length=tape_addr_width, expected_number_of_bytes=np.ceil(tape_addr_width / 7.0))) for sample_data in tape: data_bytes.append(self.encode_byte(self.convert_to_signed(sample_data, entry_length), 7, signed_integer_length=entry_length, expected_number_of_bytes=np.ceil(entry_length / 7.0))) message = self.create_message(cmd, data_bytes) (stat, mesg) = self.serial_write(message) return (stat, mesg) def create_entry(self, interval, pulse_num, end_of_marker): ''' @param interval : The waiting time before the end of last pulse or trigger in ns, ranging from 0ns to 2560ns with minimum step of 5ns. @param pulse_num : 0~7, indicating which pulse to be output @param end_of_marker : 1 if the entry is the last entry of a segment, otherwise 0. ''' if interval < 0 or interval > 2560: raise ValueError if pulse_num < 0 or pulse_num > 7: raise ValueError if end_of_marker < 0 or end_of_marker > 1: raise ValueError entry_bits = BitArray(Bits(uint=interval, length=9)) entry_bits.append(BitArray(Bits(uint=pulse_num, length=3))) entry_bits.append(BitArray(Bits(uint=end_of_marker, length=1))) # print "The entry generated is: ", # print entry_bits.uint return entry_bits.uint
expected_number_of_bytes=np.ceil(entry_length/7.0))) message = self.create_message(cmd, data_bytes)
utils.py
# coding=utf-8 # Copyright (c) DIRECT Contributors import argparse import pathlib import sys from direct.types import FileOrUrl, PathOrString from direct.utils.io import check_is_valid_url def is_file(path): path = pathlib.Path(path) if path.is_file(): return path raise argparse.ArgumentTypeError(f"{path} is not a valid file or url.") def file_or_url(path: PathOrString) -> FileOrUrl:
def check_train_val(key, name): if key is not None and len(key) != 2: sys.exit(f"--{name} has to be of the form `train_folder, validation_folder` if a validation folder is set.")
if check_is_valid_url(path): return FileOrUrl(path) path = pathlib.Path(path) if path.is_file(): return FileOrUrl(path) raise argparse.ArgumentTypeError(f"{path} is not a valid file or url.")
models.py
# Copyright The IETF Trust 2015, All Rights Reserved from django.db import models class
(models.Model): date = models.DateTimeField() host = models.CharField(max_length=128)
DumpInfo