code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
#ifndef OPENTISSUE_DYNAMICS_EDM_EDM_SOLID_H #define OPENTISSUE_DYNAMICS_EDM_EDM_SOLID_H // // OpenTissue Template Library // - A generic toolbox for physics-based modeling and simulation. // Copyright (C) 2008 Department of Computer Science, University of Copenhagen. // // OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php // #include <OpenTissue/configuration.h> #include <OpenTissue/core/math/math_functions.h> #include <cmath> #include <cassert> #include <vector> namespace OpenTissue { namespace edm { template<typename edm_types> class Solid : public edm_types::model_type { public: typedef typename edm_types::model_type base_type; typedef typename edm_types::value_traits value_traits; typedef typename edm_types::real_type real_type; typedef typename edm_types::vector3_type vector3_type; typedef typename edm_types::tensor2_type tensor2_type; typedef typename edm_types::tensor3_type tensor3_type; typedef typename edm_types::Particle particle_type; typedef typename base_type::EDMMatrix EDMMatrix; typedef typename base_type::EDMVector EDMVector; struct SolidParticle : public particle_type { SolidParticle() : particle_type() {} virtual ~SolidParticle() {} tensor3_type e; ///< solid tension (eta) tensor3_type p; ///< solid piller (rho) tensor2_type u; ///< solid spatial (upsilon) tensor3_type G0; ///< solid natural xtended metric (metrix) shape tensor3_type P0; ///< solid natural pillar shape tensor2_type N0; ///< solid natural spatial shape }; typedef std::vector<SolidParticle> SolidParticles; protected: size_t m_L, m_M, m_N; bool m_wrap_L, m_wrap_M, m_wrap_N; private: real_type m_h1, m_h2, m_h3; SolidParticles m_P; public: Solid() : base_type(edm_types::EDM_Solid) , m_L(0) , m_M(0) , m_N(0) , m_wrap_L(false) , m_wrap_M(false) , m_wrap_N(false) , m_h1(value_traits::one()) , m_h2(value_traits::one()) , m_h3(value_traits::one()) {} virtual ~Solid() {} public: bool initialize(size_t L, size_t M, size_t N) { if ( !m_P.empty() || L < 3 || M < 3 || N < 3 ) // if already created or too few particles return false; // create particles m_P.resize((m_L = L)*(m_M = M)*(m_N = N)); real_type const du = m_h1 = value_traits::one() / ( L - 1 ); real_type const dv = m_h2 = value_traits::one() / ( M - 1 ); real_type const dw = m_h3 = value_traits::one() / ( N - 1 ); real_type u, v, w; u = v = w = value_traits::zero(); for ( size_t n = 0; n < N; n++, w += dw, v = 0 ) for ( size_t m = 0; m < M; m++, v += dv, u = 0 ) for ( size_t l = 0; l < L; l++, u += du ) grid( l, m, n ).r = position( this->m_rest, u, v, w ); // calculate the natural shape position for this particle // create natural extended shape metrix tensor G0, spatial tensor N0, and pillar tensor P0. for ( size_t n = 0; n < N; ++n ) for ( size_t m = 0; m < M; ++m ) for ( size_t l = 0; l < L; ++l ) { SolidParticle & a = grid( l, m, n ); a.G0 = metrix( l, m, n ); a.N0 = spatial( l, m, n ); a.P0 = pillar( l, m, n ); } u = v = w = value_traits::zero(); for ( size_t n = 0; n < N; n++, w += dw, v = 0 ) for ( size_t m = 0; m < M; m++, v += dv, u = 0 ) for ( size_t l = 0; l < L; l++, u += du ) { SolidParticle & a = grid( l, m, n ); a.r = position( this->m_init, u, v, w ); // calculate the initial shape position for this particle a.o = a.r; a.v *= value_traits::zero(); //TODO: Textures on some edges that share the same UV TexCoords are not correct, // due to the fact that we only have 1 texture to use on all 6 faces! if ( l == 0 || l == L - 1 ) { a.t.u = math::clamp_zero_one(w); a.t.v = math::clamp_zero_one(v); } else if ( m == 0 || m == M - 1 ) { a.t.u = math::clamp_zero_one(w); a.t.v = math::clamp_zero_one(u); } else if ( n == 0 || n == N - 1 ) { a.t.u = math::clamp_zero_one(v); a.t.v = math::clamp_zero_one(u); } } // create initial surface normals compute_surface_normals(); return true; } Solid & wrapping(bool L, bool M, bool N) { m_wrap_L = L; m_wrap_M = M; m_wrap_N = N; return *this; } size_t get_num_L(bool include_wrapping = false) const { return size_t(m_L + (!include_wrapping ? 0 : m_wrap_L ? 1 : 0)); } size_t get_num_M(bool include_wrapping = false) const { return size_t(m_M + (!include_wrapping ? 0 : m_wrap_M ? 1 : 0)); } size_t get_num_N(bool include_wrapping = false) const { return size_t(m_N + (!include_wrapping ? 0 : m_wrap_N ? 1 : 0)); } SolidParticle const & particle(size_t l, size_t m, size_t n) const { return grid(l, m, n); } // creation of the parametric solid size_t nodes() const { return size_t(this->m_max_nodes); } size_t index_adjust(long l, long m, long n) const { // TODO: use math::clamp instead of min/max using std::min; using std::max; size_t const l_ = m_wrap_L ? l % ( ( l < 0 ? -1 : 1 ) * static_cast<long>( m_L ) ) + ( l < 0 ? m_L : 0 ) : static_cast<size_t>( max( 0L, min( l, static_cast<long>( m_L - 1 ) ) ) ); size_t const m_ = m_wrap_M ? m % ( ( m < 0 ? -1 : 1 ) * static_cast<long>( m_M ) ) + ( m < 0 ? m_M : 0 ) : static_cast<size_t>( max( 0L, min( m, static_cast<long>( m_M - 1 ) ) ) ); size_t const n_ = m_wrap_N ? n % ( ( n < 0 ? -1 : 1 ) * static_cast<long>( m_N ) ) + ( n < 0 ? m_N : 0 ) : static_cast<size_t>( max( 0L, min( n, static_cast<long>( m_N - 1 ) ) ) ); return size_t(n_*(m_L*m_M) + m_*m_L + l_); } Solid & set_natural_position(size_t idx, vector3_type const & r) { assert(idx < this->m_max_nodes || !"set_natural_position: idx out of range."); this->m_rest[idx] = r; return set_initial_position(idx, r); // default behavior if init pos isn't called explicitly } Solid & set_initial_position(size_t idx, vector3_type const & r) { assert(idx < this->m_max_nodes || !"set_natural_position: idx out of range."); this->m_init[idx] = r; return *this; } // particles (initialize must be called before); Solid & set_fixed(size_t l, size_t m, size_t n, bool fixed) { assert(l < m_L && m < m_M && n < m_N); grid(l, m, n).f = fixed ; return *this; } Solid & set_mass(size_t l, size_t m, size_t n, real_type const & mass) { assert(l < m_L && m < m_M && n < m_N); grid(l, m, n).m = mass; return *this; } Solid & set_damping(size_t l, size_t m, size_t n, real_type const & damping) { assert(l < m_L && m < m_M && n < m_N); grid(l, m, n).g = damping; return *this; } Solid & set_tension(size_t l, size_t m, size_t n, tensor3_type const & tension) { assert(l < m_L && m < m_M && n < m_N); grid(l, m, n).e = tension; set_pillar(l, m, n, tension); // original default behavior: pillar uses the same as tension return *this; } Solid & set_pillar(size_t l, size_t m, size_t n, tensor3_type const & pillar) { assert(l < m_L && m < m_M && n < m_N); grid(l, m, n).p = pillar; return *this; } Solid & set_spatial(size_t l, size_t m, size_t n, tensor2_type const & spatial) { assert(l < m_L && m < m_M && n < m_N); grid(l, m, n).u = spatial; return *this; } protected: bool index_check(long l, long m, long n) const { return ( m_wrap_L ? true : 0 <= l && l < static_cast<long>( m_L ) ) && ( m_wrap_M ? true : 0 <= m && m < static_cast<long>( m_M ) ) && ( m_wrap_N ? true : 0 <= n && n < static_cast<long>( m_N ) ); } SolidParticle const & grid_adjust(long l, long m, long n) const { return m_P[index_adjust(l, m, n)]; } vector3_type const & r(long l, long m, long n) const { return grid_adjust(l, m, n).r; } private: virtual vector3_type position(vector3_type const * a, real_type const & u, real_type const & v, real_type const & w ) const = 0; virtual vector3_type normal(size_t l, size_t m, size_t n) const = 0; private: void compute_stiffness(EDMMatrix & K) const { typedef std::vector<tensor3_type> Tensors; typedef std::vector<tensor2_type> Tensorx; //precalculation of tensors Tensors alpha( m_P.size() ); Tensors rho( m_P.size() ); Tensorx nu( m_P.size() ); for ( size_t n = 0; n < m_N; ++n ) for ( size_t m = 0; m < m_M; ++m ) for ( size_t l = 0; l < m_L; ++l ) { size_t const i = index_adjust( l, m, n ); SolidParticle const & a = grid( l, m, n ); tensor3_type& alpha_ = alpha[ i ]; tensor3_type m_ = metrix( l, m, n ); alpha_.t0[ 0 ] = this->m_strength * a.e.t0[ 0 ] * ( m_.t0[ 0 ] - a.G0.t0[ 0 ] ); alpha_.t1[ 1 ] = this->m_strength * a.e.t1[ 1 ] * ( m_.t1[ 1 ] - a.G0.t1[ 1 ] ); alpha_.t2[ 2 ] = this->m_strength * a.e.t2[ 2 ] * ( m_.t2[ 2 ] - a.G0.t2[ 2 ] ); alpha_.t0[ 1 ] = this->m_strength * a.e.t0[ 1 ] * ( m_.t0[ 1 ] - a.G0.t0[ 1 ] ); alpha_.t1[ 0 ] = this->m_strength * a.e.t1[ 0 ] * ( m_.t1[ 0 ] - a.G0.t1[ 0 ] ); alpha_.t0[ 2 ] = this->m_strength * a.e.t0[ 2 ] * ( m_.t0[ 2 ] - a.G0.t0[ 2 ] ); alpha_.t2[ 0 ] = this->m_strength * a.e.t2[ 0 ] * ( m_.t2[ 0 ] - a.G0.t2[ 0 ] ); alpha_.t1[ 2 ] = this->m_strength * a.e.t1[ 2 ] * ( m_.t1[ 2 ] - a.G0.t1[ 2 ] ); alpha_.t2[ 1 ] = this->m_strength * a.e.t2[ 1 ] * ( m_.t2[ 1 ] - a.G0.t2[ 1 ] ); tensor3_type& rho_ = rho[ i ]; tensor3_type p_ = pillar( l, m, n ); rho_.t0[ 0 ] = this->m_strength * a.p.t0[ 0 ] * ( p_.t0[ 0 ] - a.P0.t0[ 0 ] ); rho_.t1[ 1 ] = this->m_strength * a.p.t1[ 1 ] * ( p_.t1[ 1 ] - a.P0.t1[ 1 ] ); rho_.t2[ 2 ] = this->m_strength * a.p.t2[ 2 ] * ( p_.t2[ 2 ] - a.P0.t2[ 2 ] ); tensor2_type& nu_ = nu[ i ]; tensor2_type x_ = spatial( l, m, n ); nu_.t0[ 0 ] = this->m_strength * a.u.t0[ 0 ] * ( x_.t0[ 0 ] - a.N0.t0[ 0 ] ); nu_.t0[ 1 ] = this->m_strength * a.u.t0[ 1 ] * ( x_.t0[ 1 ] - a.N0.t0[ 1 ] ); nu_.t1[ 0 ] = this->m_strength * a.u.t1[ 0 ] * ( x_.t1[ 0 ] - a.N0.t1[ 0 ] ); nu_.t1[ 1 ] = this->m_strength * a.u.t1[ 1 ] * ( x_.t1[ 1 ] - a.N0.t1[ 1 ] ); } real_type const inv_h1h1 = 1. / ( m_h1 * m_h1 ); real_type const inv_h2h2 = 1. / ( m_h2 * m_h2 ); real_type const inv_h3h3 = 1. / ( m_h3 * m_h3 ); real_type const inv_len2 = 1. / ( m_h1 * m_h1 + m_h2 * m_h2 + m_h3 * m_h3 ); real_type const inv_4h1h1 = 0.25 * inv_h1h1; real_type const inv_4h2h2 = 0.25 * inv_h2h2; real_type const inv_4h3h3 = 0.25 * inv_h3h3; real_type const iLL12 = 1. / ( m_h1 * m_h1 + m_h2 * m_h2 ); real_type const iLL13 = 1. / ( m_h1 * m_h1 + m_h3 * m_h3 ); real_type const iLL23 = 1. / ( m_h2 * m_h2 + m_h3 * m_h3 ); size_t const LMN = m_L*m_M*m_N; for ( size_t n = 0; n < m_N; ++n ) for ( size_t m = 0; m < m_M; ++m ) for ( size_t l = 0; l < m_L; ++l ) { // rho (pillar) 5x5x5 stencil part tensor3_type const & plM1_m_n = rho[index_adjust(l-1, m, n)]; tensor3_type const & plP1_m_n = rho[index_adjust(l+1, m ,n)]; tensor3_type const & pl_mM1_n = rho[index_adjust(l, m-1, n)]; tensor3_type const & pl_mP1_n = rho[index_adjust(l, m+1, n)]; tensor3_type const & pl_m_nM1 = rho[index_adjust(l, m, n-1)]; tensor3_type const & pl_m_nP1 = rho[index_adjust(l, m, n+1)]; real_type Pl_m_n = 0; real_type PlP2_m_n = 0; real_type PlM2_m_n = 0; real_type Pl_mP2_n = 0; real_type Pl_mM2_n = 0; real_type Pl_m_nP2 = 0; real_type Pl_m_nM2 = 0; // - 1/4h1h1*v11[l+1,m,n] * (r[l+2,m,n]-r[l,m,n]) if ( index_check( l + 2, m, n ) ) { real_type const tmp = - inv_4h1h1 * plP1_m_n.t0[ 0 ]; PlP2_m_n += + tmp; Pl_m_n += - tmp; } // + 1/4h1h1*v11[l-1,m,n] * (r[l,m,n]-r[l-2,m,n]) if ( index_check( l - 2, m, n ) ) { real_type const tmp = + inv_4h1h1 * plM1_m_n.t0[ 0 ]; Pl_m_n += + tmp; PlM2_m_n += - tmp; } // - 1/4h2h2*v22[l,m+1,n] * (r[l,m+2,n]-r[l,m,n]) if ( index_check( l, m + 2, n ) ) { real_type const tmp = - inv_4h2h2 * pl_mP1_n.t1[ 1 ]; Pl_mP2_n += + tmp; Pl_m_n += - tmp; } // + 1/4h2h2*v22[l,m-1,n] * (r[l,m,n]-r[l,m-2,n]) if ( index_check( l, m - 2, n ) ) { real_type const tmp = + inv_4h2h2 * pl_mM1_n.t1[ 1 ]; Pl_m_n += + tmp; Pl_mM2_n += - tmp; } // - 1/4h3h3*v33[l,m,n+1] * (r[l,m,n+2]-r[l,m,n]) if ( index_check( l, m, n + 2 ) ) { real_type const tmp = - inv_4h3h3 * pl_m_nP1.t2[ 2 ]; Pl_m_nP2 += + tmp; Pl_m_n += - tmp; } // + 1/4h3h3*v33[l,m,n-1] * (r[l,m,n]-r[l,m,n-2]) if ( index_check( l, m, n - 2 ) ) { real_type const tmp = + inv_4h3h3 * pl_m_nM1.t2[ 2 ]; Pl_m_n += + tmp; Pl_m_nM2 += - tmp; } // nu (spatial) 3x3x3 stencil part tensor2_type const & vl_m_n = nu[index_adjust(l, m, n)]; tensor2_type const & vlP1_mM1_nM1 = nu[index_adjust(l+1, m-1, n-1)]; tensor2_type const & vlP1_mP1_nM1 = nu[index_adjust(l+1, m+1, n-1)]; tensor2_type const & vlM1_mM1_nM1 = nu[index_adjust(l-1, m-1, n-1)]; tensor2_type const & vlM1_mP1_nM1 = nu[index_adjust(l-1, m+1, n-1)]; real_type Vl_m_n = 0; real_type VlM1_mP1_nP1 = 0; real_type VlP1_mM1_nM1 = 0; real_type VlM1_mM1_nP1 = 0; real_type VlP1_mP1_nM1 = 0; real_type VlP1_mP1_nP1 = 0; real_type VlM1_mM1_nM1 = 0; real_type VlP1_mM1_nP1 = 0; real_type VlM1_mP1_nM1 = 0; // - iLen2*v11[l,m,n] * (r[l-1,m+1,n+1]-r[l,m,n]) if ( index_check( l - 1, m + 1, n + 1 ) ) { real_type const tmp = - inv_len2 * vl_m_n.t0[ 0 ]; VlM1_mP1_nP1 += + tmp; Vl_m_n += - tmp; } // + iLen2*v11[l+1,m-1,n-1] * (r[l,m,n]-r[l+1,m-1,n-1]) if ( index_check( l + 1, m - 1, n - 1 ) ) { real_type const tmp = + inv_len2 * vlP1_mM1_nM1.t0[ 0 ]; Vl_m_n += + tmp; VlP1_mM1_nM1 += - tmp; } // - iLen2*v13[l,m,n] * (r[l-1,m-1,n+1]-r[l,m,n]) if ( index_check( l - 1, m - 1, n + 1 ) ) { real_type const tmp = - inv_len2 * vl_m_n.t0[ 1 ]; VlM1_mM1_nP1 += + tmp; Vl_m_n += - tmp; } // + iLen2*v13[l+1,m+1,n-1] * (r[l,m,n]-r[l+1,m+1,n-1]) if ( index_check( l + 1, m + 1, n - 1 ) ) { real_type const tmp = + inv_len2 * vlP1_mP1_nM1.t0[ 1 ]; Vl_m_n += + tmp; VlP1_mP1_nM1 += - tmp; } // - iLen2*v31[l,m,n] * (r[l+1,m+1,n+1]-r[l,m,n]) if ( index_check( l + 1, m + 1, n + 1 ) ) { real_type const tmp = - inv_len2 * vl_m_n.t1[ 0 ]; VlP1_mP1_nP1 += + tmp; Vl_m_n += - tmp; } // + iLen2*v31[l-1,m-1,n-1] * (r[l,m,n]-r[l-1,m-1,n-1]) if ( index_check( l - 1, m - 1, n - 1 ) ) { real_type const tmp = + inv_len2 * vlM1_mM1_nM1.t1[ 0 ]; Vl_m_n += + tmp; VlM1_mM1_nM1 += - tmp; } // - iLen2*v33[l,m,n] * (r[l+1,m-1,n+1]-r[l,m,n]) if ( index_check( l + 1, m - 1, n + 1 ) ) { real_type const tmp = - inv_len2 * vl_m_n.t1[ 1 ]; VlP1_mM1_nP1 += + tmp; Vl_m_n += - tmp; } // + iLen2*v33[l-1,m+1,n-1] * (r[l,m,n]-r[l-1,m+1,n-1]) if ( index_check( l - 1, m + 1, n - 1 ) ) { real_type const tmp = + inv_len2 * vlM1_mP1_nM1.t1[ 1 ]; Vl_m_n += + tmp; VlM1_mP1_nM1 += - tmp; } // create the 3x3x3 alpha stencil A tensor3_type const & al_m_n = alpha[index_adjust(l, m, n)]; tensor3_type const & alM1_m_n = alpha[index_adjust(l-1, m, n)]; tensor3_type const & al_mM1_n = alpha[index_adjust(l, m-1, n)]; tensor3_type const & al_m_nM1 = alpha[index_adjust(l, m, n-1)]; tensor3_type const & alM1_mM1_n = alpha[index_adjust(l-1, m-1, n)]; tensor3_type const & alP1_mM1_n = alpha[index_adjust(l+1, m-1, n)]; tensor3_type const & alM1_m_nM1 = alpha[index_adjust(l-1, m, n-1)]; tensor3_type const & alP1_m_nM1 = alpha[index_adjust(l+1, m, n-1)]; tensor3_type const & al_mM1_nM1 = alpha[index_adjust(l, m-1, n-1)]; tensor3_type const & al_mP1_nM1 = alpha[index_adjust(l ,m+1, n-1)]; real_type SlP2_m_n = PlP2_m_n; real_type SlM2_m_n = PlM2_m_n; real_type Sl_mP2_n = Pl_mP2_n; real_type Sl_mM2_n = Pl_mM2_n; real_type Sl_m_nP2 = Pl_m_nP2; real_type Sl_m_nM2 = Pl_m_nM2; real_type SlP1_mM1_nP1 = VlP1_mM1_nP1; real_type SlM1_mP1_nM1 = VlM1_mP1_nM1; real_type SlP1_mM1_nM1 = VlP1_mM1_nM1; real_type SlM1_mM1_nP1 = VlM1_mM1_nP1; real_type SlP1_mP1_nM1 = VlP1_mP1_nM1; real_type SlM1_mP1_nP1 = VlM1_mP1_nP1; real_type SlP1_mP1_nP1 = VlP1_mP1_nP1; real_type SlM1_mM1_nM1 = VlM1_mM1_nM1; real_type SlP1_m_n = 0; real_type Sl_mP1_n = 0; real_type Sl_m_nP1 = 0; real_type Sl_m_n = Vl_m_n + Pl_m_n; real_type SlM1_m_n = 0; real_type Sl_mM1_n = 0; real_type Sl_m_nM1 = 0; real_type SlM1_mP1_n = 0; real_type SlM1_m_nP1 = 0; real_type SlP1_mM1_n = 0; real_type Sl_mM1_nP1 = 0; real_type SlP1_m_nM1 = 0; real_type Sl_mP1_nM1 = 0; real_type SlP1_mP1_n = 0; real_type SlM1_mM1_n = 0; real_type SlP1_m_nP1 = 0; real_type SlM1_m_nM1 = 0; real_type Sl_mP1_nP1 = 0; real_type Sl_mM1_nM1 = 0; // D1P(r[l,m,n]) = r[l+1,m,n]-r[l,m,n] if ( index_check( l + 1, m, n ) ) { real_type const tmp = inv_h1h1 * al_m_n.t0[ 0 ]; SlP1_m_n += - tmp; Sl_m_n += + tmp; } // D1P(r[l-1,m,n]) = r[l,m,n]-r[l-1,m,n] if ( index_check( l - 1, m, n ) ) { real_type const tmp = inv_h1h1 * alM1_m_n.t0[ 0 ]; Sl_m_n += + tmp; SlM1_m_n += - tmp; } // D2P(r[l,m,n]) = r[l,m+1,n]-r[l,m,n] if ( index_check( l, m + 1, n ) ) { real_type const tmp = inv_h2h2 * al_m_n.t1[ 1 ]; Sl_mP1_n += - tmp; Sl_m_n += + tmp; } // D2P(r[l,m-1,n]) = r[l,m,n]-r[l,m-1,n] if ( index_check( l, m - 1, n ) ) { real_type const tmp = inv_h2h2 * al_mM1_n.t1[ 1 ]; Sl_m_n += + tmp; Sl_mM1_n += - tmp; } // D3P(r[l,m,n]) = r[l,m,n+1]-r[l,m,n] if ( index_check( l, m, n + 1 ) ) { real_type const tmp = inv_h3h3 * al_m_n.t2[ 2 ]; Sl_m_nP1 += - tmp; Sl_m_n += + tmp; } // D3P(r[l,m,n-1]) = r[l,m,n]-r[l,m,n-1] if ( index_check( l, m, n - 1 ) ) { real_type const tmp = inv_h3h3 * al_m_nM1.t2[ 2 ]; Sl_m_n += + tmp; Sl_m_nM1 += - tmp; } // - iLL12*v12[l,m,n] * (r[l+1,m+1,n]-r[l,m,n]) if ( index_check( l + 1, m + 1, n ) ) { real_type const tmp = - iLL12 * al_m_n.t0[ 1 ]; SlP1_mP1_n += + tmp; Sl_m_n += - tmp; } // + iLL12*v12[l-1,m-1,n] * (r[m,n,l]-r[l-1,m-1,n]) if ( index_check( l - 1, m - 1, n ) ) { real_type const tmp = + iLL12 * alM1_mM1_n.t0[ 1 ]; Sl_m_n += + tmp; SlM1_mM1_n += - tmp; } // - iLL12*v21[l,m,n] * (r[l-1,m+1,n]-r[l,m,n]) if ( index_check( l - 1, m + 1, n ) ) { real_type const tmp = - iLL12 * al_m_n.t1[ 0 ]; SlM1_mP1_n += + tmp; Sl_m_n += - tmp; } // + iLL12*v21[l+1,m-1,n] * (r[l,m,n]-r[l+1,m-1,n]) if ( index_check( l + 1, m - 1, n ) ) { real_type const tmp = + iLL12 * alP1_mM1_n.t1[ 0 ]; Sl_m_n += + tmp; SlP1_mM1_n += - tmp; } // - iLL13*v13[l,m,n] * (r[l+1,m,n+1]-r[l,m,n]) if ( index_check( l + 1, m, n + 1 ) ) { real_type const tmp = - iLL13 * al_m_n.t0[ 2 ]; SlP1_m_nP1 += + tmp; Sl_m_n += - tmp; } // + iLL13*v13[l-1,m,n-1] * (r[m,n,l]-r[l-1,m,n-1]) if ( index_check( l - 1, m, n - 1 ) ) { real_type const tmp = + iLL13 * alM1_m_nM1.t0[ 2 ]; Sl_m_n += + tmp; SlM1_m_nM1 += - tmp; } // - iLL13*v31[l,m,n] * (r[l-1,m,n+1]-r[l,m,n]) if ( index_check( l - 1, m, n + 1 ) ) { real_type const tmp = - iLL13 * al_m_n.t2[ 0 ]; SlM1_m_nP1 += + tmp; Sl_m_n += - tmp; } // + iLL13*v31[l+1,m,n-1] * (r[l,m,n]-r[l+1,m,n-1]) if ( index_check( l + 1, m, n - 1 ) ) { real_type const tmp = + iLL13 * alP1_m_nM1.t2[ 0 ]; Sl_m_n += + tmp; SlP1_m_nM1 += - tmp; } // - iLL23*v23[l,m,n] * (r[l,m+1,n+1]-r[l,m,n]) if ( index_check( l, m + 1, n + 1 ) ) { real_type const tmp = - iLL23 * al_m_n.t1[ 2 ]; Sl_mP1_nP1 += + tmp; Sl_m_n += - tmp; } // + iLL23*v23[l,m-1,n-1] * (r[m,n,l]-r[l,m-1,n-1]) if ( index_check( l, m - 1, n - 1 ) ) { real_type const tmp = + iLL23 * al_mM1_nM1.t1[ 2 ]; Sl_m_n += + tmp; Sl_mM1_nM1 += - tmp; } // - iLL23*v32[l,m,n] * (r[l,m-1,n+1]-r[l,m,n]) if ( index_check( l, m - 1, n + 1 ) ) { real_type const tmp = - iLL23 * al_m_n.t2[ 1 ]; Sl_mM1_nP1 += + tmp; Sl_m_n += - tmp; } // + iLL23*v32[l,m+1,n-1] * (r[l,m,n]-r[l,m+1,n-1]) if ( index_check( l, m + 1, n - 1 ) ) { real_type const tmp = + iLL23 * al_mP1_nM1.t2[ 1 ]; Sl_m_n += + tmp; Sl_mP1_nM1 += - tmp; } EDMVector row( LMN ); row.clear(); // NOTICE: This was the culprit in the upgrade to boost_1_32_0! Construction is uninitialized. row( index_adjust( l + 2, m , n ) ) += zeroize( SlP2_m_n ); row( index_adjust( l - 2, m , n ) ) += zeroize( SlM2_m_n ); row( index_adjust( l , m + 2, n ) ) += zeroize( Sl_mP2_n ); row( index_adjust( l , m - 2, n ) ) += zeroize( Sl_mM2_n ); row( index_adjust( l , m , n + 2 ) ) += zeroize( Sl_m_nP2 ); row( index_adjust( l , m , n - 2 ) ) += zeroize( Sl_m_nM2 ); row( index_adjust( l + 1, m + 1, n ) ) += zeroize( SlP1_mP1_n ); row( index_adjust( l - 1, m - 1, n ) ) += zeroize( SlM1_mM1_n ); row( index_adjust( l + 1, m , n + 1 ) ) += zeroize( SlP1_m_nP1 ); row( index_adjust( l - 1, m , n - 1 ) ) += zeroize( SlM1_m_nM1 ); row( index_adjust( l , m + 1, n + 1 ) ) += zeroize( Sl_mP1_nP1 ); row( index_adjust( l , m - 1, n - 1 ) ) += zeroize( Sl_mM1_nM1 ); row( index_adjust( l + 1, m - 1, n + 1 ) ) += zeroize( SlP1_mM1_nP1 ); row( index_adjust( l - 1, m + 1, n - 1 ) ) += zeroize( SlM1_mP1_nM1 ); row( index_adjust( l + 1, m - 1, n - 1 ) ) += zeroize( SlP1_mM1_nM1 ); row( index_adjust( l - 1, m - 1, n + 1 ) ) += zeroize( SlM1_mM1_nP1 ); row( index_adjust( l + 1, m + 1, n - 1 ) ) += zeroize( SlP1_mP1_nM1 ); row( index_adjust( l - 1, m + 1, n + 1 ) ) += zeroize( SlM1_mP1_nP1 ); row( index_adjust( l - 1, m - 1, n - 1 ) ) += zeroize( SlM1_mM1_nM1 ); row( index_adjust( l + 1, m + 1, n + 1 ) ) += zeroize( SlP1_mP1_nP1 ); row( index_adjust( l , m , n - 1 ) ) += zeroize( Sl_m_nM1 ); row( index_adjust( l + 1, m , n - 1 ) ) += zeroize( SlP1_m_nM1 ); row( index_adjust( l , m + 1, n - 1 ) ) += zeroize( Sl_mP1_nM1 ); row( index_adjust( l , m - 1, n ) ) += zeroize( Sl_mM1_n ); row( index_adjust( l + 1, m - 1, n ) ) += zeroize( SlP1_mM1_n ); row( index_adjust( l - 1, m , n ) ) += zeroize( SlM1_m_n ); row( index_adjust( l , m , n ) ) += zeroize( Sl_m_n ); row( index_adjust( l + 1, m , n ) ) += zeroize( SlP1_m_n ); row( index_adjust( l - 1, m + 1, n ) ) += zeroize( SlM1_mP1_n ); row( index_adjust( l , m + 1, n ) ) += zeroize( Sl_mP1_n ); row( index_adjust( l , m - 1, n + 1 ) ) += zeroize( Sl_mM1_nP1 ); row( index_adjust( l - 1, m , n + 1 ) ) += zeroize( SlM1_m_nP1 ); row( index_adjust( l , m , n + 1 ) ) += zeroize( Sl_m_nP1 ); ublas::row(K, index_adjust( l, m, n) ) = row; } } SolidParticle & grid(size_t l, size_t m, size_t n) { return m_P[n*(m_L*m_M) + m*m_L + l]; } SolidParticle const & grid(size_t l, size_t m, size_t n) const { return m_P[n*(m_L*m_M) + m*m_L + l]; } tensor3_type metrix(size_t l, size_t m, size_t n) const { vector3_type const v1 = D1Pb( l, m, n ); vector3_type const v2 = D2Pb( l, m, n ); vector3_type const v3 = D3Pb( l, m, n ); vector3_type const v12 = index_check( l + 1, m + 1, n ) ? ( r( l + 1, m + 1, n ) - r( l, m, n ) ) : vector3_type(); vector3_type const v21 = index_check( l - 1, m + 1, n ) ? ( r( l - 1, m + 1, n ) - r( l, m, n ) ) : vector3_type(); vector3_type const v13 = index_check( l + 1, m, n + 1 ) ? ( r( l + 1, m, n + 1 ) - r( l, m, n ) ) : vector3_type(); vector3_type const v31 = index_check( l - 1, m, n + 1 ) ? ( r( l - 1, m, n + 1 ) - r( l, m, n ) ) : vector3_type(); vector3_type const v23 = index_check( l, m + 1, n + 1 ) ? ( r( l, m + 1, n + 1 ) - r( l, m, n ) ) : vector3_type(); vector3_type const v32 = index_check( l, m - 1, n + 1 ) ? ( r( l, m - 1, n + 1 ) - r( l, m, n ) ) : vector3_type(); real_type const iLL12 = 1. / ( m_h1 * m_h1 + m_h2 * m_h2 ); real_type const iLL13 = 1. / ( m_h1 * m_h1 + m_h3 * m_h3 ); real_type const iLL23 = 1. / ( m_h2 * m_h2 + m_h3 * m_h3 ); tensor3_type G; G.t0[ 0 ] = v1 * v1; // G11 G.t1[ 1 ] = v2 * v2; // G22 G.t2[ 2 ] = v3 * v3; // G33 G.t0[ 1 ] = ( v12 * v12 ) * iLL12; G.t1[ 0 ] = ( v21 * v21 ) * iLL12; G.t0[ 2 ] = ( v13 * v13 ) * iLL13; G.t2[ 0 ] = ( v31 * v31 ) * iLL13; G.t1[ 2 ] = ( v23 * v23 ) * iLL23; G.t2[ 1 ] = ( v32 * v32 ) * iLL23; /* G._0[1] = (v12*v12); G._0[1] *= G._0[1]*iLL12; G._1[0] = (v21*v21); G._1[0] *= G._1[0]*iLL12; G._0[2] = (v13*v13); G._0[2] *= G._0[2]*iLL13; G._2[0] = (v31*v31); G._2[0] *= G._2[0]*iLL13; G._1[2] = (v23*v23); G._1[2] *= G._1[2]*iLL23; G._2[1] = (v32*v32); G._2[1] *= G._2[1]*iLL23; */ return tensor3_type(G); } tensor2_type spatial(size_t l, size_t m, size_t n) const { vector3_type const v1 = index_check( l - 1, m + 1, n + 1 ) ? ( r( l - 1, m + 1, n + 1 ) - r( l, m, n ) ) : vector3_type(); vector3_type const v2 = index_check( l - 1, m - 1, n + 1 ) ? ( r( l - 1, m - 1, n + 1 ) - r( l, m, n ) ) : vector3_type(); vector3_type const v3 = index_check( l + 1, m + 1, n + 1 ) ? ( r( l + 1, m + 1, n + 1 ) - r( l, m, n ) ) : vector3_type(); vector3_type const v4 = index_check( l + 1, m - 1, n + 1 ) ? ( r( l + 1, m - 1, n + 1 ) - r( l, m, n ) ) : vector3_type(); real_type const iLen = 1. / ( m_h1 * m_h1 + m_h2 * m_h2 + m_h3 * m_h3 ); tensor2_type N; /* N._0[0] = (v1*v1)*iLen; N._0[1] = (v2*v2)*iLen; N._1[0] = (v3*v3)*iLen; N._1[1] = (v4*v4)*iLen; */ N.t0[ 0 ] = ( v1 * v1 ); N.t0[ 0 ] *= N.t0[ 0 ] * iLen; N.t0[ 1 ] = ( v2 * v2 ); N.t0[ 1 ] *= N.t0[ 1 ] * iLen; N.t1[ 0 ] = ( v3 * v3 ); N.t1[ 0 ] *= N.t1[ 0 ] * iLen; N.t1[ 1 ] = ( v4 * v4 ); N.t1[ 1 ] *= N.t1[ 1 ] * iLen; return tensor2_type(N); } tensor3_type pillar(size_t l, size_t m, size_t n) const { vector3_type const v1 = index_check( l + 1, m, n ) && index_check( l - 1, m, n ) ? ( r( l + 1, m, n ) - r( l - 1, m, n ) ) / ( 2. * m_h1 ) : vector3_type(); vector3_type const v2 = index_check( l, m + 1, n ) && index_check( l, m - 1, n ) ? ( r( l, m + 1, n ) - r( l, m - 1, n ) ) / ( 2. * m_h2 ) : vector3_type(); vector3_type const v3 = index_check( l, m, n + 1 ) && index_check( l, m, n - 1 ) ? ( r( l, m, n + 1 ) - r( l, m, n - 1 ) ) / ( 2. * m_h3 ) : vector3_type(); tensor3_type P; P.t0[ 0 ] = v1 * v1; P.t1[ 1 ] = v2 * v2; P.t2[ 2 ] = v3 * v3; return tensor3_type(P); } void compute_surface_normals() { for (size_t n = 0; n < m_N; ++n) for (size_t m = 0; m < m_M; ++m) for (size_t l = 0; l < m_L; ++l) grid(l, m, n).n = normal(l, m, n); } size_t particle_count() const { return size_t(static_cast<size_t>(m_P.size())); } particle_type & get_particle(size_t idx) { return m_P[idx]; } particle_type const & get_particle(size_t idx) const { return m_P[idx]; } vector3_type D1Pb(size_t l, size_t m, size_t n) const { return vector3_type(index_check(l+1,m,n)?(r(l+1,m,n)-r(l,m,n))/m_h1:vector3_type(value_traits::zero())); } vector3_type D2Pb(size_t l, size_t m, size_t n) const { return vector3_type(index_check(l,m+1,n)?(r(l,m+1,n)-r(l,m,n))/m_h2:vector3_type(value_traits::zero())); } vector3_type D3Pb(size_t l, size_t m, size_t n) const { return vector3_type(index_check(l,m,n+1)?(r(l,m,n+1)-r(l,m,n))/m_h3:vector3_type(value_traits::zero())); } }; } // namespace edm } // namespace OpenTissue // OPENTISSUE_DYNAMICS_EDM_EDM_SOLID_H #endif
marizoldi/Hapty
Dependencies/OpenTissue/include/OpenTissue/dynamics/edm/edm_solid.h
C
mit
34,438
Trace-VstsEnteringInvocation $MyInvocation Import-VstsLocStrings "$PSScriptRoot\Task.json" # Get inputs. $scriptType = Get-VstsInput -Name ScriptType -Require $scriptPath = Get-VstsInput -Name ScriptPath $scriptInline = Get-VstsInput -Name Inline $scriptArguments = Get-VstsInput -Name ScriptArguments $__vsts_input_errorActionPreference = Get-VstsInput -Name errorActionPreference $__vsts_input_failOnStandardError = Get-VstsInput -Name FailOnStandardError $targetAzurePs = Get-VstsInput -Name TargetAzurePs $customTargetAzurePs = Get-VstsInput -Name CustomTargetAzurePs # Validate the script path and args do not contains new-lines. Otherwise, it will # break invoking the script via Invoke-Expression. if ($scriptType -eq "FilePath") { if ($scriptPath -match '[\r\n]' -or [string]::IsNullOrWhitespace($scriptPath)) { throw (Get-VstsLocString -Key InvalidScriptPath0 -ArgumentList $scriptPath) } } if ($scriptArguments -match '[\r\n]') { throw (Get-VstsLocString -Key InvalidScriptArguments0 -ArgumentList $scriptArguments) } # string constants $otherVersion = "OtherVersion" $latestVersion = "LatestVersion" if ($targetAzurePs -eq $otherVersion) { if ($customTargetAzurePs -eq $null) { throw (Get-VstsLocString -Key InvalidAzurePsVersion $customTargetAzurePs) } else { $targetAzurePs = $customTargetAzurePs.Trim() } } $pattern = "^[0-9]+\.[0-9]+\.[0-9]+$" $regex = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList $pattern if ($targetAzurePs -eq $latestVersion) { $targetAzurePs = "" } elseif (-not($regex.IsMatch($targetAzurePs))) { throw (Get-VstsLocString -Key InvalidAzurePsVersion -ArgumentList $targetAzurePs) } . "$PSScriptRoot\Utility.ps1" $targetAzurePs = Get-RollForwardVersion -azurePowerShellVersion $targetAzurePs $authScheme = '' try { $serviceNameInput = Get-VstsInput -Name ConnectedServiceNameSelector -Default 'ConnectedServiceName' $serviceName = Get-VstsInput -Name $serviceNameInput -Default (Get-VstsInput -Name DeploymentEnvironmentName) if (!$serviceName) { Get-VstsInput -Name $serviceNameInput -Require } $endpoint = Get-VstsEndpoint -Name $serviceName -Require if($endpoint) { $authScheme = $endpoint.Auth.Scheme } Write-Verbose "AuthScheme $authScheme" } catch { $error = $_.Exception.Message Write-Verbose "Unable to get the authScheme $error" } Update-PSModulePathForHostedAgent -targetAzurePs $targetAzurePs -authScheme $authScheme try { # Initialize Azure. Import-Module $PSScriptRoot\ps_modules\VstsAzureHelpers_ Initialize-Azure -azurePsVersion $targetAzurePs -strict # Trace the expression as it will be invoked. $__vstsAzPSInlineScriptPath = $null If ($scriptType -eq "InlineScript") { $scriptArguments = $null $__vstsAzPSInlineScriptPath = [System.IO.Path]::Combine($env:Agent_TempDirectory, ([guid]::NewGuid().ToString() + ".ps1")); ($scriptInline | Out-File $__vstsAzPSInlineScriptPath) $scriptPath = $__vstsAzPSInlineScriptPath } $scriptCommand = "& '$($scriptPath.Replace("'", "''"))' $scriptArguments" Remove-Variable -Name scriptType Remove-Variable -Name scriptPath Remove-Variable -Name scriptInline Remove-Variable -Name scriptArguments # Remove all commands imported from VstsTaskSdk, other than Out-Default. # Remove all commands imported from VstsAzureHelpers_. Get-ChildItem -LiteralPath function: | Where-Object { ($_.ModuleName -eq 'VstsTaskSdk' -and $_.Name -ne 'Out-Default') -or ($_.Name -eq 'Invoke-VstsTaskScript') -or ($_.ModuleName -eq 'VstsAzureHelpers_' ) } | Remove-Item # For compatibility with the legacy handler implementation, set the error action # preference to continue. An implication of changing the preference to Continue, # is that Invoke-VstsTaskScript will no longer handle setting the result to failed. $global:ErrorActionPreference = 'Continue' # Undocumented VstsTaskSdk variable so Verbose/Debug isn't converted to ##vso[task.debug]. # Otherwise any content the ad-hoc script writes to the verbose pipeline gets dropped by # the agent when System.Debug is not set. $global:__vstsNoOverrideVerbose = $true # Run the user's script. Redirect the error pipeline to the output pipeline to enable # a couple goals due to compatibility with the legacy handler implementation: # 1) STDERR from external commands needs to be converted into error records. Piping # the redirected error output to an intermediate command before it is piped to # Out-Default will implicitly perform the conversion. # 2) The task result needs to be set to failed if an error record is encountered. # As mentioned above, the requirement to handle this is an implication of changing # the error action preference. ([scriptblock]::Create($scriptCommand)) | ForEach-Object { Remove-Variable -Name scriptCommand Write-Host "##[command]$_" . $_ 2>&1 } | ForEach-Object { if($_ -is [System.Management.Automation.ErrorRecord]) { if($_.FullyQualifiedErrorId -eq "NativeCommandError" -or $_.FullyQualifiedErrorId -eq "NativeCommandErrorMessage") { ,$_ if($__vsts_input_failOnStandardError -eq $true) { "##vso[task.complete result=Failed]" } } else { if($__vsts_input_errorActionPreference -eq "continue") { ,$_ if($__vsts_input_failOnStandardError -eq $true) { "##vso[task.complete result=Failed]" } } elseif($__vsts_input_errorActionPreference -eq "stop") { throw $_ } } } else { ,$_ } } } finally { if ($__vstsAzPSInlineScriptPath -and (Test-Path -LiteralPath $__vstsAzPSInlineScriptPath) ) { Remove-Item -LiteralPath $__vstsAzPSInlineScriptPath -ErrorAction 'SilentlyContinue' } Import-Module $PSScriptRoot\ps_modules\VstsAzureHelpers_ Remove-EndpointSecrets }
grawcho/vso-agent-tasks
Tasks/AzurePowerShellV3/AzurePowerShell.ps1
PowerShell
mit
6,411
import {Entity, PrimaryGeneratedColumn} from "../../../../src"; import {Column} from "../../../../src/decorator/columns/Column"; @Entity() export class Post { @PrimaryGeneratedColumn() id: number; @Column("timestamp", { precision: 3, default: () => "CURRENT_TIMESTAMP(3)", onUpdate: "CURRENT_TIMESTAMP(3)"}) updateAt: Date; }
typeorm/typeorm
test/github-issues/1901/entity/Post.ts
TypeScript
mit
345
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage * @package Mage_Oauth * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * OAuth Consumer Edit Block * * @category Mage * @package Mage_Oauth * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Oauth_Block_Adminhtml_Oauth_Consumer_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { /** * Consumer model * * @var Mage_Oauth_Model_Consumer */ protected $_model; /** * Get consumer model * * @return Mage_Oauth_Model_Consumer */ public function getModel() { if (null === $this->_model) { $this->_model = Mage::registry('current_consumer'); } return $this->_model; } /** * Construct edit page */ public function __construct() { parent::__construct(); $this->_blockGroup = 'oauth'; $this->_controller = 'adminhtml_oauth_consumer'; $this->_mode = 'edit'; $this->_addButton('save_and_continue', array( 'label' => Mage::helper('oauth')->__('Save and Continue Edit'), 'onclick' => 'saveAndContinueEdit()', 'class' => 'save' ), 100); $this->_formScripts[] = "function saveAndContinueEdit()" . "{editForm.submit($('edit_form').action + 'back/edit/')}"; $this->_updateButton('save', 'label', $this->__('Save')); $this->_updateButton('save', 'id', 'save_button'); $this->_updateButton('delete', 'label', $this->__('Delete')); /** @var $session Mage_Admin_Model_Session */ $session = Mage::getSingleton('admin/session'); if (!$this->getModel() || !$this->getModel()->getId() || !$session->isAllowed('system/oauth/consumer/delete')) { $this->_removeButton('delete'); } } /** * Get header text * * @return string */ public function getHeaderText() { if ($this->getModel()->getId()) { return $this->__('Edit Consumer'); } else { return $this->__('New Consumer'); } } }
almadaocta/lordbike-production
errors/includes/src/Mage_Oauth_Block_Adminhtml_Oauth_Consumer_Edit.php
PHP
mit
3,076
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage * @package Mage_Customer * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Customer sharing config model * * @category Mage * @package Mage_Customer * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Customer_Model_Config_Share extends Mage_Core_Model_Config_Data { /** * Xml config path to customers sharing scope value * */ const XML_PATH_CUSTOMER_ACCOUNT_SHARE = 'customer/account_share/scope'; /** * Possible customer sharing scopes * */ const SHARE_GLOBAL = 0; const SHARE_WEBSITE = 1; /** * Check whether current customers sharing scope is global * * @return bool */ public function isGlobalScope() { return !$this->isWebsiteScope(); } /** * Check whether current customers sharing scope is website * * @return bool */ public function isWebsiteScope() { return Mage::getStoreConfig(self::XML_PATH_CUSTOMER_ACCOUNT_SHARE) == self::SHARE_WEBSITE; } /** * Get possible sharing configuration options * * @return array */ public function toOptionArray() { return array( self::SHARE_GLOBAL => Mage::helper('customer')->__('Global'), self::SHARE_WEBSITE => Mage::helper('customer')->__('Per Website'), ); } /** * Check for email dublicates before saving customers sharing options * * @return Mage_Customer_Model_Config_Share * @throws Mage_Core_Exception */ public function _beforeSave() { $value = $this->getValue(); if ($value == self::SHARE_GLOBAL) { if (Mage::getResourceSingleton('customer/customer')->findEmailDuplicates()) { Mage::throwException( Mage::helper('customer')->__('Cannot share customer accounts globally because some customer accounts with the same emails exist on multiple websites and cannot be merged.') ); } } return $this; } }
almadaocta/lordbike-production
errors/includes/src/Mage_Customer_Model_Config_Share.php
PHP
mit
3,055
package com.cvtalks; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import static org.junit.Assert.assertEquals; public class SubtractTest { @Rule public ExpectedException thrown = ExpectedException.none(); @Test public void canSubtractValues() { Value seven = new Value(7.0); Value two = new Value(2.0); Operation subtract = new Subtract(seven, two); assertEquals(5, subtract.evaluate(), 1e-6); } @Test public void returnsCorrectStringOutput() { Value seven = new Value(7.0); Value two = new Value(2.0); Operation subtract = new Subtract(seven, two); assertEquals("7.0 - 2.0", subtract.toString()); } @Test public void makesCorrectStringOutputBraces() { Operation subtract = new Subtract(new Subtract(new Value(8.0), new Value(2.0)), new Value(3.0)); assertEquals("(8.0 - 2.0) - 3.0", subtract.toString()); } }
razakpm/oopjavacalculator
src/test/java/com/cvtalks/SubtractTest.java
Java
mit
985
#!/bin/bash set -e apt-get -y update apt-get -y install linux-headers-$(uname -r) build-essential dkms puppet-common apt-get -y clean mount -o loop /tmp/VBoxGuestAdditions.iso /media/cdrom /media/cdrom/VBoxLinuxAdditions.run || true umount /media/cdrom
cppforlife/packer-bosh
dev/scripts/vbox-guest-additions.sh
Shell
mit
256
/* This file is part of Magnum. Copyright © 2010, 2011, 2012, 2013, 2014, 2015 Vladimír Vondruš <mosra@centrum.cz> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "DistanceFieldVector.h" #include <Corrade/Utility/Resource.h> #include "Magnum/Context.h" #include "Magnum/Extensions.h" #include "Magnum/Shader.h" #include "Implementation/CreateCompatibilityShader.h" namespace Magnum { namespace Shaders { namespace { template<UnsignedInt> constexpr const char* vertexShaderName(); template<> constexpr const char* vertexShaderName<2>() { return "AbstractVector2D.vert"; } template<> constexpr const char* vertexShaderName<3>() { return "AbstractVector3D.vert"; } } template<UnsignedInt dimensions> DistanceFieldVector<dimensions>::DistanceFieldVector(): transformationProjectionMatrixUniform(0), colorUniform(1), outlineColorUniform(2), outlineRangeUniform(3), smoothnessUniform(4) { #ifdef MAGNUM_BUILD_STATIC /* Import resources on static build, if not already */ if(!Utility::Resource::hasGroup("MagnumShaders")) importShaderResources(); #endif Utility::Resource rs("MagnumShaders"); #ifndef MAGNUM_TARGET_GLES const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210}); #else const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment); frag.addSource(rs.get("generic.glsl")) .addSource(rs.get(vertexShaderName<dimensions>())); vert.addSource(rs.get("DistanceFieldVector.frag")); CORRADE_INTERNAL_ASSERT_OUTPUT(Shader::compile({frag, vert})); AbstractShaderProgram::attachShaders({frag, vert}); #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version)) #else if(!Context::current()->isVersionSupported(Version::GLES300)) #endif { AbstractShaderProgram::bindAttributeLocation(AbstractVector<dimensions>::Position::Location, "position"); AbstractShaderProgram::bindAttributeLocation(AbstractVector<dimensions>::TextureCoordinates::Location, "textureCoordinates"); } CORRADE_INTERNAL_ASSERT_OUTPUT(AbstractShaderProgram::link()); #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version)) #endif { transformationProjectionMatrixUniform = AbstractShaderProgram::uniformLocation("transformationProjectionMatrix"); colorUniform = AbstractShaderProgram::uniformLocation("color"); outlineColorUniform = AbstractShaderProgram::uniformLocation("outlineColor"); outlineRangeUniform = AbstractShaderProgram::uniformLocation("outlineRange"); smoothnessUniform = AbstractShaderProgram::uniformLocation("smoothness"); } #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>(version)) #endif { AbstractShaderProgram::setUniform(AbstractShaderProgram::uniformLocation("vectorTexture"), AbstractVector<dimensions>::VectorTextureLayer); } /* Set defaults in OpenGL ES (for desktop they are set in shader code itself) */ #ifdef MAGNUM_TARGET_GLES setOutlineRange(0.5f, 1.0f); setSmoothness(0.04f); #endif } template class DistanceFieldVector<2>; template class DistanceFieldVector<3>; }}
ashimidashajia/magnum
src/Magnum/Shaders/DistanceFieldVector.cpp
C++
mit
4,761
import enum class calendar_permissions(enum.IntEnum): ASCIT = 21 AVERY = 22 BECHTEL = 23 BLACKER = 24 DABNEY = 25 FLEMING = 26 LLOYD = 27 PAGE = 28 RICKETTS = 29 RUDDOCK = 30 OTHER = 31 ATHLETICS = 32
ASCIT/donut-python
donut/modules/calendar/permissions.py
Python
mit
251
require 'date' require 'set' require PomodoroTracker::POMODORO_DIR + 'models/file_persistor' require PomodoroTracker::POMODORO_DIR + 'models/activity' require PomodoroTracker::POMODORO_DIR + 'models/activity_inventory' require PomodoroTracker::POMODORO_DIR + 'models/day' require PomodoroTracker::POMODORO_DIR + 'models/options'
PragTob/pomodoro_tracker
lib/pomodoro_tracker/models/all.rb
Ruby
mit
331
import React from 'react'; import Paper from '@material-ui/core/Paper'; import { makeStyles, createStyles, Theme } from '@material-ui/core/styles'; import Grid from '@material-ui/core/Grid'; import Avatar from '@material-ui/core/Avatar'; import Typography from '@material-ui/core/Typography'; const useStyles = makeStyles((theme: Theme) => createStyles({ root: { flexGrow: 1, overflow: 'hidden', padding: theme.spacing(0, 3), }, paper: { maxWidth: 400, margin: `${theme.spacing(1)}px auto`, padding: theme.spacing(2), }, }), ); const message = `Truncation should be conditionally applicable on this long line of text as this is a much longer line than what the container can support. `; export default function AutoGridNoWrap() { const classes = useStyles(); return ( <div className={classes.root}> <Paper className={classes.paper}> <Grid container wrap="nowrap" spacing={2}> <Grid item> <Avatar>W</Avatar> </Grid> <Grid item xs zeroMinWidth> <Typography noWrap>{message}</Typography> </Grid> </Grid> </Paper> <Paper className={classes.paper}> <Grid container wrap="nowrap" spacing={2}> <Grid item> <Avatar>W</Avatar> </Grid> <Grid item xs> <Typography noWrap>{message}</Typography> </Grid> </Grid> </Paper> <Paper className={classes.paper}> <Grid container wrap="nowrap" spacing={2}> <Grid item> <Avatar>W</Avatar> </Grid> <Grid item xs> <Typography>{message}</Typography> </Grid> </Grid> </Paper> </div> ); }
lgollut/material-ui
docs/src/pages/components/grid/AutoGridNoWrap.tsx
TypeScript
mit
1,762
# Changelog - newLEGACYinc-app-server ### 1.1.1 - Fix Twitch notification logic ### 1.1.0 - Major server rewrite ### 1.0.2 (2016-01-01) - When I first bothered to start versioning
newLEGACYinc/newLEGACYinc-app-server
CHANGELOG.md
Markdown
mit
188
//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- #pragma once namespace IR { class LabelInstr; } enum JsNativeValueType: int; class ScriptContextInfo; namespace Js { #define DeclareExceptionPointer(ep) \ EXCEPTION_RECORD ep##er; \ CONTEXT ep##c; \ EXCEPTION_POINTERS ep = {&ep##er, &ep##c}; // Typeof operator should return 'undefined' for undeclared or hoisted vars // and propagate all other exceptions. // // NB: Re-throw from catch unwinds the active frame but doesn't clear the stack // (catch clauses keep accumulating at the top of the stack until a catch // that doesn't re-throw). This is problematic if we've detected potential // stack overflow and report it via exceptions: the handling of throw // might actually overflow the stack and cause system SO exception. // Thus, use catch to cache the exception, and re-throw it outside of the catch. #define TYPEOF_ERROR_HANDLER_CATCH(scriptContext, var) \ } \ catch (const JavascriptException& err) \ { \ exceptionObject = err.GetAndClear(); \ var = scriptContext->GetLibrary()->GetUndefined(); \ #define TYPEOF_ERROR_HANDLER_THROW(scriptContext, var) \ } \ if (exceptionObject != nullptr) \ { \ Js::Var errorObject = exceptionObject->GetThrownObject(nullptr); \ if (JavascriptError::ShouldTypeofErrorBeReThrown(errorObject)) \ { \ if (scriptContext->IsScriptContextInDebugMode()) \ { \ JavascriptExceptionOperators::ThrowExceptionObject(exceptionObject, scriptContext, true); \ } \ else \ { \ JavascriptExceptionOperators::DoThrowCheckClone(exceptionObject, scriptContext); \ } \ } \ } \ if (scriptContext->IsUndeclBlockVar(var)) \ { \ JavascriptError::ThrowReferenceError(scriptContext, JSERR_UseBeforeDeclaration); \ } \ } #ifdef ENABLE_SCRIPT_DEBUGGING #define BEGIN_TYPEOF_ERROR_HANDLER_DEBUGGER_THROW_IS_INTERNAL \ class AutoCleanup \ { \ private: \ ScriptContext *const scriptContext; \ public: \ AutoCleanup(ScriptContext *const scriptContext) : scriptContext(scriptContext) \ { \ if (scriptContext->IsScriptContextInDebugMode()) \ { \ scriptContext->GetDebugContext()->GetProbeContainer()->SetThrowIsInternal(true); \ } \ } \ ~AutoCleanup() \ { \ if (scriptContext->IsScriptContextInDebugMode()) \ { \ scriptContext->GetDebugContext()->GetProbeContainer()->SetThrowIsInternal(false); \ } \ } \ } autoCleanup(scriptContext); #else #define BEGIN_TYPEOF_ERROR_HANDLER_DEBUGGER_THROW_IS_INTERNAL #endif #define BEGIN_TYPEOF_ERROR_HANDLER(scriptContext) \ { \ JavascriptExceptionObject* exceptionObject = nullptr; \ try { \ Js::JavascriptExceptionOperators::AutoCatchHandlerExists autoCatchHandlerExists(scriptContext); \ BEGIN_TYPEOF_ERROR_HANDLER_DEBUGGER_THROW_IS_INTERNAL #define END_TYPEOF_ERROR_HANDLER(scriptContext, var) \ TYPEOF_ERROR_HANDLER_CATCH(scriptContext, var) \ TYPEOF_ERROR_HANDLER_THROW(scriptContext, var) #define BEGIN_PROFILED_TYPEOF_ERROR_HANDLER(scriptContext) \ BEGIN_TYPEOF_ERROR_HANDLER(scriptContext) #define END_PROFILED_TYPEOF_ERROR_HANDLER(scriptContext, var, functionBody, inlineCacheIndex) \ TYPEOF_ERROR_HANDLER_CATCH(scriptContext, var) \ functionBody->GetDynamicProfileInfo()->RecordFieldAccess(functionBody, inlineCacheIndex, var, FldInfo_NoInfo); \ TYPEOF_ERROR_HANDLER_THROW(scriptContext, var) class JavascriptOperators /* All static */ { // Methods public: static bool IsArray(_In_ RecyclableObject* instanceObj); static bool IsArray(_In_ Var instanceVar); static bool IsArray(_In_ JavascriptProxy * proxy); static bool IsConstructor(_In_ RecyclableObject* instanceObj); static bool IsConstructor(_In_ Var instanceVar); static bool IsConstructor(_In_ JavascriptProxy * proxy); static BOOL IsConcatSpreadable(Var instanceVar); static bool IsConstructorSuperCall(Arguments args); static bool GetAndAssertIsConstructorSuperCall(Arguments args); static RecyclableObject* ToObject(Var aRight,ScriptContext* scriptContext); static Var ToUnscopablesWrapperObject(Var aRight, ScriptContext* scriptContext); static Var OP_LdCustomSpreadIteratorList(Var aRight, ScriptContext* scriptContext); static Var ToNumber(Var aRight,ScriptContext* scriptContext); static Var ToNumberInPlace(Var aRight,ScriptContext* scriptContext, JavascriptNumber* result); static Var ToNumeric(Var aRight, ScriptContext* scriptContext); static Var ToNumericInPlace(Var aRight, ScriptContext* scriptContext, JavascriptNumber* result); #ifdef _M_IX86 static Var Int32ToVar(int32 value, ScriptContext* scriptContext); static Var Int32ToVarInPlace(int32 value, ScriptContext* scriptContext, JavascriptNumber *result); static Var UInt32ToVar(uint32 value, ScriptContext* scriptContext); static Var UInt32ToVarInPlace(uint32 value, ScriptContext* scriptContext, JavascriptNumber *result); #endif static Var OP_FinishOddDivBy2(uint32 value, ScriptContext *scriptContext); static Var OP_ApplyArgs(Var func,Var instance,__in_xcount(8)void** stackPtr,CallInfo callInfo,ScriptContext* scriptContext); static Var Typeof(Var var, ScriptContext* scriptContext); static Var TypeofFld(Var instance, PropertyId propertyId, ScriptContext* scriptContext); static Var TypeofRootFld(Var instance, PropertyId propertyId, ScriptContext* scriptContext); static Var TypeofElem(Var instance, Var index, ScriptContext* scriptContext); static Var TypeofElem_UInt32(Var instance, uint32 index, ScriptContext* scriptContext); static Var TypeofElem_Int32(Var instance, int32 index, ScriptContext* scriptContext); static Var Delete(Var var, ScriptContext* scriptContext); static JavascriptString * Concat3(Var aLeft, Var aCenter, Var aRight, ScriptContext * scriptContext); static JavascriptString * NewConcatStrMulti(Var a1, Var a2, uint count, ScriptContext * scriptContext); static void SetConcatStrMultiItem(Var concatStr, Var str, uint index, ScriptContext * scriptContext); static void SetConcatStrMultiItem2(Var concatStr, Var str1, Var str2, uint index, ScriptContext * scriptContext); static BOOL Equal(Var aLeft, Var aRight,ScriptContext* scriptContext); static BOOL Equal_Full(Var aLeft, Var aRight,ScriptContext* scriptContext); static BOOL Greater(Var aLeft, Var aRight,ScriptContext* scriptContext); static BOOL Greater_Full(Var aLeft, Var aRight,ScriptContext* scriptContext); static BOOL GreaterEqual(Var aLeft, Var aRight,ScriptContext* scriptContext); static BOOL Less(Var aLeft, Var aRight,ScriptContext* scriptContext); static BOOL Less_Full(Var aLeft, Var aRight,ScriptContext* scriptContext); static BOOL LessEqual(Var aLeft, Var aRight,ScriptContext* scriptContext); static BOOL NotEqual(Var aLeft, Var aRight,ScriptContext* scriptContext); static BOOL StrictEqual(Var aLeft, Var aRight,ScriptContext* scriptContext); static BOOL StrictEqualString(Var aLeft, JavascriptString* aRight); static BOOL StrictEqualEmptyString(Var aLeft); #ifdef _CHAKRACOREBUILD static BOOL StrictEqualNumberType(Var aLeft, Var aRight, TypeId leftType, TypeId rightType, ScriptContext *requestContext); #endif static BOOL NotStrictEqual(Var aLeft, Var aRight,ScriptContext* scriptContext); static BOOL HasOwnProperty(Var instance, PropertyId propertyId, _In_ ScriptContext * requestContext, _In_opt_ PropertyString * propString); static BOOL GetOwnProperty(Var instance, PropertyId propertyId, Var* value, ScriptContext* requestContext, PropertyValueInfo * propertyValueInfo); static BOOL GetOwnAccessors(Var instance, PropertyId propertyId, Var* getter, Var* setter, ScriptContext * requestContext); static BOOL EnsureProperty(Var instance, PropertyId propertyId); static void OP_EnsureNoRootProperty(Var instance, PropertyId propertyId); static void OP_EnsureNoRootRedeclProperty(Var instance, PropertyId propertyId); static void OP_EnsureCanDeclGloFunc(Var instance, PropertyId propertyId); static void OP_ScopedEnsureNoRedeclProperty(FrameDisplay *pDisplay, PropertyId propertyId, Var instanceDefault); static JavascriptArray* GetOwnPropertyNames(Var instance, ScriptContext *scriptContext); static JavascriptArray* GetOwnPropertySymbols(Var instance, ScriptContext *scriptContext); static JavascriptArray* GetOwnPropertyKeys(Var instance, ScriptContext *scriptContext); static JavascriptArray* GetOwnEnumerablePropertyNames(RecyclableObject* instance, ScriptContext *scriptContext); static JavascriptArray* GetOwnEnumerablePropertyNamesSymbols(RecyclableObject* instance, ScriptContext *scriptContext); static BOOL GetOwnPropertyDescriptor(RecyclableObject* obj, PropertyId propertyId, ScriptContext* scriptContext, PropertyDescriptor* propertyDescriptor); static BOOL GetOwnPropertyDescriptor(RecyclableObject* obj, JavascriptString* propertyKey, ScriptContext* scriptContext, PropertyDescriptor* propertyDescriptor); static BOOL IsPropertyUnscopable (Var instanceVar, PropertyId propertyId); static BOOL IsPropertyUnscopable (Var instanceVar, JavascriptString *propertyString); static BOOL HasPropertyUnscopables(RecyclableObject* instance, PropertyId propertyId); static BOOL HasProperty(RecyclableObject* instance, PropertyId propertyId); static BOOL HasRootProperty(RecyclableObject* instance, PropertyId propertyId); static BOOL HasProxyOrPrototypeInlineCacheProperty(RecyclableObject* instance, PropertyId propertyId); template<bool OutputExistence, typename PropertyKeyType> static BOOL GetPropertyWPCache(Var instance, RecyclableObject* propertyObject, PropertyKeyType propertyKey, Var* value, ScriptContext* requestContext, _Inout_ PropertyValueInfo * info); static BOOL GetPropertyUnscopable(Var instance, RecyclableObject* propertyObject, PropertyId propertyId, Var* value, ScriptContext* requestContext, PropertyValueInfo* info=NULL); static Var GetProperty(RecyclableObject* instance, PropertyId propertyId, ScriptContext* requestContext, PropertyValueInfo* info = NULL); static BOOL GetProperty(RecyclableObject* instance, PropertyId propertyId, Var* value, ScriptContext* requestContext, PropertyValueInfo* info = NULL); static Var GetProperty(Var instance, RecyclableObject* propertyObject, PropertyId propertyId, ScriptContext* requestContext, PropertyValueInfo* info = NULL); static Var GetPropertyNoCache(Var instance, RecyclableObject* propertyObject, PropertyId propertyId, ScriptContext* requestContext); static Var GetPropertyNoCache(RecyclableObject* instance, PropertyId propertyId, ScriptContext* requestContext); static BOOL GetPropertyNoCache(RecyclableObject* instance, PropertyId propertyId, Var* value, ScriptContext* requestContext); static BOOL GetPropertyNoCache(Var instance, RecyclableObject* propertyObject, PropertyId propertyId, Var* value, ScriptContext* requestContext); static BOOL GetProperty(Var instance, RecyclableObject* propertyObject, PropertyId propertyId, Var* value, ScriptContext* requestContext, PropertyValueInfo* info = NULL); static BOOL GetPropertyObject(Var instance, ScriptContext * scriptContext, RecyclableObject** propertyObject); static bool GetPropertyObjectForElementAccess( _In_ Var instance, _In_ Var index, _In_ ScriptContext* scriptContext, _Out_ RecyclableObject** propertyObject, _In_ rtErrors error); static bool GetPropertyObjectForSetElementI( _In_ Var instance, _In_ Var index, _In_ ScriptContext* scriptContext, _Out_ RecyclableObject** propertyObject); static bool GetPropertyObjectForGetElementI( _In_ Var instance, _In_ Var index, _In_ ScriptContext* scriptContext, _Out_ RecyclableObject** propertyObject); static BOOL GetRootProperty(Var instance, PropertyId propertyId, Var* value, ScriptContext* requestContext, PropertyValueInfo* info = NULL); static Var GetRootProperty(RecyclableObject* instance, PropertyId propertyId, ScriptContext* requestContext, PropertyValueInfo* info = NULL); static Var GetPropertyReference(RecyclableObject* instance, PropertyId propertyId, ScriptContext* requestContext); static BOOL GetPropertyReference(RecyclableObject* instance, PropertyId propertyId, Var* value,ScriptContext* requestContext, PropertyValueInfo* info = NULL); static BOOL GetPropertyReference(Var instance, RecyclableObject* propertyObject, PropertyId propertyId, Var* value,ScriptContext* requestContext, PropertyValueInfo* info = NULL); static BOOL GetRootPropertyReference(RecyclableObject* instance, PropertyId propertyId, Var* value,ScriptContext* requestContext, PropertyValueInfo* info = NULL); template<typename PropertyKeyType> static BOOL SetPropertyWPCache(Var instance, RecyclableObject* object, PropertyKeyType propertyKey, Var newValue, ScriptContext* requestContext, PropertyOperationFlags flags, _Inout_ PropertyValueInfo * info); static BOOL SetPropertyUnscopable(Var instance, RecyclableObject* receiver, PropertyId propertyId, Var newValue, PropertyValueInfo * info, ScriptContext* requestContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL SetProperty(Var instance, RecyclableObject* object, PropertyId propertyId, Var newValue, ScriptContext* requestContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL SetProperty(Var instance, RecyclableObject* receiver, PropertyId propertyId, Var newValue, PropertyValueInfo * info, ScriptContext* requestContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL SetRootProperty(RecyclableObject* instance, PropertyId propertyId, Var newValue, PropertyValueInfo * info, ScriptContext* requestContext, PropertyOperationFlags flags = PropertyOperation_None); static _Check_return_ _Success_(return) BOOL GetAccessors(RecyclableObject* instance, PropertyId propertyId, ScriptContext* requestContext, _Out_ Var* getter, _Out_ Var* setter); static BOOL SetAccessors(RecyclableObject* instance, PropertyId propertyId, Var getter, Var setter, PropertyOperationFlags flags = PropertyOperation_None); static BOOL InitProperty(RecyclableObject* instance, PropertyId propertyId, Var newValue, PropertyOperationFlags flags = PropertyOperation_None); static BOOL DeleteProperty(RecyclableObject* instance, PropertyId propertyId, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None); static BOOL DeleteProperty(RecyclableObject* instance, JavascriptString *propertyNameString, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None); static bool ShouldTryDeleteProperty(RecyclableObject* instance, JavascriptString *propertyNameString, PropertyRecord const **pPropertyRecord); static BOOL DeletePropertyUnscopables(RecyclableObject* instance, PropertyId propertyId, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None); template<bool unscopables> static BOOL DeleteProperty_Impl(RecyclableObject* instance, PropertyId propertyId, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None); static TypeId GetTypeId(_In_ const Var instance); static TypeId GetTypeId(_In_ RecyclableObject* instance); static TypeId GetTypeIdNoCheck(Var instance); template <typename T, typename U> __forceinline static T* TryFromVar(_In_ U* value) { return VarIs<T>(value) ? UnsafeVarTo<T>(value) : nullptr; } template <typename T, typename U> __forceinline static T* TryFromVar(WriteBarrierPtr<U> value) { return VarIs<T>(value) ? UnsafeVarTo<T>(value) : nullptr; } static BOOL IsObject(_In_ Var instance); static BOOL IsObject(_In_ RecyclableObject* instance); static BOOL IsExposedType(TypeId typeId); static BOOL IsObjectType(TypeId typeId); static BOOL IsObjectOrNull(Var instance); static BOOL IsUndefined(_In_ RecyclableObject* instance); static BOOL IsUndefined(Var instance); static BOOL IsUndefinedObject(RecyclableObject* instance); static BOOL IsUndefinedOrNullType(TypeId); static BOOL IsUndefinedOrNull(Var instance); static BOOL IsUndefinedOrNull(RecyclableObject* instance); static BOOL IsNull(Var instance); static BOOL IsNull(RecyclableObject* instance); static BOOL IsSpecialObjectType(TypeId typeId); static BOOL IsJsNativeType(TypeId typeId); static BOOL IsJsNativeObject(Var instance); static BOOL IsJsNativeObject(_In_ RecyclableObject* instance); static BOOL IsUndefinedObject(Var instance); static BOOL IsAnyNumberValue(Var instance); static BOOL IsClassConstructor(Var instance); static BOOL IsClassMethod(Var instance); static BOOL IsBaseConstructorKind(Var instance); // careful using the versions below. (instance's scriptContext better be === scriptContext) static BOOL IsUndefinedOrNull(Var instance, JavascriptLibrary* library); static BOOL IsUndefinedOrNull(Var instance, ScriptContext* scriptContext); static BOOL IsNull(Var instance, ScriptContext* scriptContext); static BOOL IsNull(Var instance, JavascriptLibrary* library); static BOOL IsUndefinedObject(Var instance, ScriptContext* scriptContext); static BOOL IsUndefinedObject(Var instance, RecyclableObject* libraryUndefined); static BOOL IsUndefinedObject(Var instance, JavascriptLibrary* library); static bool CanShortcutOnUnknownPropertyName(RecyclableObject * instance); static bool CanShortcutInstanceOnUnknownPropertyName(RecyclableObject *instance); static bool CanShortcutPrototypeChainOnUnknownPropertyName(RecyclableObject *instance); static BOOL HasOwnItem(RecyclableObject* instance, uint32 index); static BOOL HasItem(RecyclableObject* instance, uint32 index); static BOOL HasItem(RecyclableObject* instance, uint64 index); static BOOL GetOwnItem(RecyclableObject* instance, uint32 index, Var* value, ScriptContext* requestContext); static Var GetItem(RecyclableObject* instance, uint64 index, ScriptContext* requestContext); static Var GetItem(RecyclableObject* instance, uint32 index, ScriptContext* requestContext); static BOOL GetItem(RecyclableObject* instance, uint64 index, Var* value, ScriptContext* requestContext); static BOOL GetItem(RecyclableObject* instance, uint32 index, Var* value, ScriptContext* requestContext); static BOOL GetItem(Var instance, RecyclableObject* propertyObject, uint32 index, Var* value, ScriptContext* requestContext); static BOOL GetItemReference(RecyclableObject* instance, uint32 index, Var* value, ScriptContext* requestContext); static BOOL GetItemReference(Var instance, RecyclableObject* propertyObject, uint32 index, Var* value, ScriptContext* requestContext); static BOOL SetItem(Var instance, RecyclableObject* object, uint64 index, Var value, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL SetItem(Var instance, RecyclableObject* object, uint32 index, Var value, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None, BOOL skipPrototypeCheck = FALSE); static BOOL DeleteItem(RecyclableObject* instance, uint32 index, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None); static BOOL DeleteItem(RecyclableObject* instance, uint64 index, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None); static RecyclableObject* CreateFromConstructor(RecyclableObject* constructor, ScriptContext* scriptContext); static RecyclableObject* OrdinaryCreateFromConstructor(RecyclableObject* constructor, RecyclableObject* obj, DynamicObject* intrinsicProto, ScriptContext* scriptContext); template<typename PropertyKeyType> static BOOL CheckPrototypesForAccessorOrNonWritablePropertySlow(RecyclableObject* instance, PropertyKeyType propertyKey, Var* setterValueOrProxy, DescriptorFlags* flags, bool isRoot, ScriptContext* scriptContext); static BOOL CheckPrototypesForAccessorOrNonWritableProperty(RecyclableObject* instance, PropertyId propertyId, Var* setterValueOrProxy, DescriptorFlags* flags, PropertyValueInfo* info, ScriptContext* scriptContext); static BOOL CheckPrototypesForAccessorOrNonWritableProperty(RecyclableObject* instance, JavascriptString* propertyNameString, Var* setterValueOrProxy, DescriptorFlags* flags, PropertyValueInfo* info, ScriptContext* scriptContext); static BOOL CheckPrototypesForAccessorOrNonWritableRootProperty(RecyclableObject* instance, PropertyId propertyId, Var* setterValueOrProxy, DescriptorFlags* flags, PropertyValueInfo* info, ScriptContext* scriptContext); static BOOL CheckPrototypesForAccessorOrNonWritableItem(RecyclableObject* instance, uint32 index, Var* setterValueOrProxy, DescriptorFlags* flags, ScriptContext* scriptContext, BOOL skipPrototypeCheck = FALSE); template <typename PropertyKeyType, bool unscopable> static DescriptorFlags GetterSetter_Impl(RecyclableObject* instance, PropertyKeyType propertyKey, Var* setterValue, PropertyValueInfo* info, ScriptContext* scriptContext); static DescriptorFlags GetterSetterUnscopable(RecyclableObject* instance, PropertyId propertyId, Var* setterValue, PropertyValueInfo* info, ScriptContext* scriptContext); static DescriptorFlags GetterSetter(RecyclableObject* instance, PropertyId propertyId, Var* setterValue, PropertyValueInfo* info, ScriptContext* scriptContext); static DescriptorFlags GetterSetter(RecyclableObject* instance, JavascriptString * propertyName, Var* setterValue, PropertyValueInfo* info, ScriptContext* scriptContext); static void OP_InvalidateProtoCaches(PropertyId propertyId, ScriptContext *scriptContext); static BOOL SetGlobalPropertyNoHost(char16 const * propertyName, charcount_t propertyLength, Var value, ScriptContext * scriptContext); static RecyclableObject* GetPrototype(RecyclableObject* instance); static RecyclableObject* OP_GetPrototype(Var instance, ScriptContext* scriptContext); static BOOL OP_HasProperty(Var instance, PropertyId propertyId, ScriptContext* scriptContext); static BOOL OP_HasOwnProperty(Var instance, PropertyId propertyId, ScriptContext* scriptContext, _In_opt_ PropertyString * propString = nullptr); static BOOL HasOwnPropertyNoHostObject(Var instance, PropertyId propertyId); static BOOL HasOwnPropertyNoHostObjectForHeapEnum(Var instance, PropertyId propertyId, ScriptContext* scriptContext, Var& getter, Var& setter); static Var GetOwnPropertyNoHostObjectForHeapEnum(Var instance, PropertyId propertyId, ScriptContext* scriptContext, Var& getter, Var &setter); static BOOL OP_HasOwnPropScoped(Var instance, PropertyId propertyId, Var defaultInstance, ScriptContext* scriptContext); static Var OP_GetProperty(Var instance, PropertyId propertyId, ScriptContext* scriptContext); static Var OP_GetRootProperty(Var instance, PropertyId propertyId, PropertyValueInfo * info, ScriptContext* scriptContext); static BOOL OP_SetProperty(Var instance, PropertyId propertyId, Var newValue, ScriptContext* scriptContext, PropertyValueInfo * info = nullptr, PropertyOperationFlags flags = PropertyOperation_None, Var thisInstance = nullptr); static bool SetElementIOnTaggedNumber( _In_ Var receiver, _In_ RecyclableObject* object, _In_ Var index, _In_ Var value, _In_ ScriptContext* requestContext, _In_ PropertyOperationFlags propertyOperationFlags); static BOOL SetPropertyOnTaggedNumber(Var instance, RecyclableObject* object, PropertyId propertyId, Var newValue, ScriptContext* requestContext, PropertyOperationFlags flags); static BOOL SetItemOnTaggedNumber(Var instance, RecyclableObject* object, uint32 index, Var newValue, ScriptContext* requestContext, PropertyOperationFlags propertyOperationFlags); static BOOL OP_StFunctionExpression(Var instance, PropertyId propertyId, Var newValue); static BOOL OP_InitProperty(Var instance, PropertyId propertyId, Var newValue); static Var OP_DeleteProperty(Var instance, PropertyId propertyId, ScriptContext* scriptContext, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None); static Var OP_DeleteRootProperty(Var instance, PropertyId propertyId, ScriptContext* scriptContext, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None); static BOOL OP_InitLetProperty(Var instance, PropertyId propertyId, Var newValue); static BOOL OP_InitConstProperty(Var instance, PropertyId propertyId, Var newValue); static BOOL OP_InitUndeclRootLetProperty(Var instance, PropertyId propertyId); static BOOL OP_InitUndeclRootConstProperty(Var instance, PropertyId propertyId); static BOOL OP_InitUndeclConsoleLetProperty(Var instance, PropertyId propertyId); static BOOL OP_InitUndeclConsoleConstProperty(Var instance, PropertyId propertyId); static BOOL OP_InitClassMember(Var instance, PropertyId propertyId, Var newValue); static void OP_InitClassMemberComputedName(Var object, Var elementName, Var value, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static void OP_InitClassMemberGet(Var object, PropertyId propertyId, Var getter); static void OP_InitClassMemberGetComputedName(Var object, Var elementName, Var getter, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static void OP_InitClassMemberSet(Var object, PropertyId propertyId, Var setter); static void OP_InitClassMemberSetComputedName(Var object, Var elementName, Var getter, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static Field(Var)* OP_GetModuleExportSlotArrayAddress(uint moduleIndex, uint slotIndex, ScriptContextInfo* scriptContext); static Field(Var)* OP_GetModuleExportSlotAddress(uint moduleIndex, uint slotIndex, ScriptContext* scriptContext); static Var OP_LdModuleSlot(uint moduleIndex, uint slotIndex, ScriptContext* scriptContext); static void OP_StModuleSlot(uint moduleIndex, uint slotIndex, Var value, ScriptContext* scriptContext); static Var OP_LdImportMeta(uint moduleIndex, ScriptContext* scriptContext); static Js::PropertyId GetPropertyId(Var propertyName, ScriptContext* scriptContext); static BOOL OP_HasItem(Var instance, Var aElementIndex, ScriptContext* scriptContext); static Var OP_GetElementI(Var instance, Var aElementIndex, ScriptContext* scriptContext); static Var OP_GetElementI_UInt32(Var instance, uint32 aElementIndex, ScriptContext* scriptContext); static Var OP_GetElementI_Int32(Var instance, int32 aElementIndex, ScriptContext* scriptContext); static Var OP_GetElementI_JIT(Var instance, Var index, ScriptContext *scriptContext); static Var GetElementIHelper(Var instance, Var index, Var receiver, ScriptContext* scriptContext); static int32 OP_GetNativeIntElementI(Var instance, Var index); static int32 OP_GetNativeIntElementI_Int32(Var instance, int32 index, ScriptContext *scriptContext); static int32 OP_GetNativeIntElementI_UInt32(Var instance, uint32 index, ScriptContext *scriptContext); static double OP_GetNativeFloatElementI(Var instance, Var index); static double OP_GetNativeFloatElementI_Int32(Var instance, int32 index, ScriptContext *scriptContext); static double OP_GetNativeFloatElementI_UInt32(Var instance, uint32 index, ScriptContext *scriptContext); static Var OP_GetMethodElement(Var instance, Var aElementIndex, ScriptContext* scriptContext); static Var OP_GetMethodElement_UInt32(Var instance, uint32 aElementIndex, ScriptContext* scriptContext); static Var OP_GetMethodElement_Int32(Var instance, int32 aElementIndex, ScriptContext* scriptContext); static BOOL OP_SetElementI(Var instance, Var aElementIndex, Var aValue, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL OP_SetElementI_JIT(Var instance, Var aElementIndex, Var aValue, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL OP_SetElementI_UInt32(Var instance, uint32 aElementIndex, Var aValue, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL OP_SetElementI_Int32(Var instance, int32 aElementIndex, Var aValue, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL SetElementIHelper(Var receiver, RecyclableObject* object, Var index, Var value, ScriptContext* scriptContext, PropertyOperationFlags flags); static BOOL OP_SetNativeIntElementI_NoConvert(Var instance, Var aElementIndex, int32 aValue, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL OP_SetNativeIntElementI_UInt32_NoConvert(Var instance, uint32 aElementIndex, int32 aValue, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL OP_SetNativeIntElementI_Int32_NoConvert(Var instance, int aElementIndex, int32 aValue, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL OP_SetNativeFloatElementI_NoConvert(Var instance, Var aElementIndex, ScriptContext* scriptContext, PropertyOperationFlags flags, double value); static BOOL OP_SetNativeFloatElementI_UInt32_NoConvert(Var instance, uint32 aElementIndex, ScriptContext* scriptContext, PropertyOperationFlags flags, double value); static BOOL OP_SetNativeFloatElementI_Int32_NoConvert(Var instance, int aElementIndex, ScriptContext* scriptContext, PropertyOperationFlags flags, double value); static BOOL OP_SetNativeIntElementI(Var instance, Var aElementIndex, int32 aValue, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL OP_SetNativeIntElementI_UInt32(Var instance, uint32 aElementIndex, int32 aValue, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL OP_SetNativeIntElementI_Int32(Var instance, int aElementIndex, int32 aValue, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static BOOL OP_SetNativeFloatElementI(Var instance, Var aElementIndex, ScriptContext* scriptContext, PropertyOperationFlags flags, double value); static BOOL OP_SetNativeFloatElementI_UInt32(Var instance, uint32 aElementIndex, ScriptContext* scriptContext, PropertyOperationFlags flags, double value); static BOOL OP_SetNativeFloatElementI_Int32(Var instance, int aElementIndex, ScriptContext* scriptContext, PropertyOperationFlags flags, double value); static Var OP_DeleteElementI(Var instance, Var aElementIndex, ScriptContext* scriptContext, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None); static Var OP_DeleteElementI_UInt32(Var instance, uint32 aElementIndex, ScriptContext* scriptContext, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None); static Var OP_DeleteElementI_Int32(Var instance, int32 aElementIndex, ScriptContext* scriptContext, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None); static BOOL OP_Memset(Var instance, int32 start, Var value, int32 length, ScriptContext* scriptContext); static BOOL OP_Memcopy(Var dstInstance, int32 dstStart, Var srcInstance, int32 srcStart, int32 length, ScriptContext* scriptContext); static Var OP_GetLength(Var instance, ScriptContext* scriptContext); static Var OP_GetThis(Var thisVar, int moduleID, ScriptContextInfo* scriptContext); static Var OP_GetThisNoFastPath(Var thisVar, int moduleID, ScriptContext* scriptContext); static bool IsThisSelf(TypeId typeId); static Var GetThisHelper(Var thisVar, TypeId typeId, int moduleID, ScriptContextInfo *scriptContext); static Var GetThisFromModuleRoot(Var thisVar); static Var OP_GetThisScoped(FrameDisplay *pScope, Var defaultInstance, ScriptContext* scriptContext); static Var OP_UnwrapWithObj(Var aValue); static Var OP_GetInstanceScoped(FrameDisplay *pScope, PropertyId propertyId, Var rootObject, Var* result2, ScriptContext* scriptContext); static BOOL OP_InitPropertyScoped(FrameDisplay *pScope, PropertyId propertyId, Var newValue, Var defaultInstance, ScriptContext* scriptContext); static BOOL OP_InitFuncScoped(FrameDisplay *pScope, PropertyId propertyId, Var newValue, Var defaultInstance, ScriptContext* scriptContext); static Var OP_DeletePropertyScoped( FrameDisplay *pScope, PropertyId propertyId, Var defaultInstance, ScriptContext* scriptContext, PropertyOperationFlags propertyOperationFlags = PropertyOperation_None); static Var OP_TypeofPropertyScoped(FrameDisplay *pScope, PropertyId propertyId, Var defaultInstance, ScriptContext* scriptContext); static void OP_InitGetter(Var object, PropertyId propertyId, Var getter); static Js::PropertyId OP_InitElemGetter(Var object, Var elementName, Var getter, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static void OP_InitSetter(Var object, PropertyId propertyId, Var setter); static Js::PropertyId OP_InitElemSetter(Var object, Var elementName, Var getter, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static void OP_InitComputedProperty(Var object, Var elementName, Var value, ScriptContext* scriptContext, PropertyOperationFlags flags = PropertyOperation_None); static void OP_InitProto(Var object, PropertyId propertyId, Var value); static void OP_InitForInEnumerator(Var enumerable, ForInObjectEnumerator * enumerator, ScriptContext* scriptContext, EnumeratorCache * forInCache = nullptr); static Var OP_BrOnEmpty(ForInObjectEnumerator * enumerator); static BOOL OP_BrHasSideEffects(int se,ScriptContext* scriptContext); static BOOL OP_BrNotHasSideEffects(int se,ScriptContext* scriptContext); static BOOL OP_BrFncEqApply(Var instance,ScriptContext* scriptContext); static BOOL OP_BrFncNeqApply(Var instance,ScriptContext* scriptContext); static Var OP_CmEq_A(Js::Var a,Js::Var b,ScriptContext* scriptContext); static Var OP_CmNeq_A(Js::Var a,Js::Var b,ScriptContext* scriptContext); static Var OP_CmSrEq_A(Js::Var a,Js::Var b,ScriptContext* scriptContext); static Var OP_CmSrEq_String(Var a, JavascriptString* b, ScriptContext *scriptContext); static Var OP_CmSrEq_EmptyString(Var a, ScriptContext *scriptContext); static Var OP_CmSrNeq_A(Js::Var a,Js::Var b,ScriptContext* scriptContext); static Var OP_CmLt_A(Js::Var a,Js::Var b,ScriptContext* scriptContext); static Var OP_CmLe_A(Js::Var a,Js::Var b,ScriptContext* scriptContext); static Var OP_CmGt_A(Js::Var a,Js::Var b,ScriptContext* scriptContext); static Var OP_CmGe_A(Js::Var a,Js::Var b,ScriptContext* scriptContext); static Var OP_ToPropertyKey(Js::Var argument, ScriptContext* scriptContext); static FunctionInfo * GetConstructorFunctionInfo(Var instance, ScriptContext * scriptContext); // Detach the type array buffer, if possible, and returns the state of the object which can be used to initialize another object static DetachedStateBase* DetachVarAndGetState(Var var, bool queueForDelayFree = true); static bool IsObjectDetached(Var var); // This will return a new object from the state returned by the above operation static Var NewVarFromDetachedState(DetachedStateBase* state, JavascriptLibrary *library); static Var NewScObjectLiteral(ScriptContext* scriptContext, const Js::PropertyIdArray *propIds, Field(DynamicType*)* literalType); static DynamicType * EnsureObjectLiteralType(ScriptContext* scriptContext, const Js::PropertyIdArray *propIds, Field(DynamicType*)* literalType); static uint GetLiteralSlotCapacity(Js::PropertyIdArray const * propIds); static uint GetLiteralInlineSlotCapacity(Js::PropertyIdArray const * propIds); static Var NewJavascriptObjectNoArg(ScriptContext* requestContext); static Var NewJavascriptArrayNoArg(ScriptContext* requestContext); static Var NewScObjectNoCtorCommon(Var instance, ScriptContext* requestContext, bool isBaseClassConstructorNewScObject = false); static Var NewScObjectNoCtor(Var instance, ScriptContext* requestContext); static Var NewScObjectNoCtorFull(Var instance, ScriptContext* requestContext); static Var NewScObjectNoArgNoCtorCommon(Var instance, ScriptContext* requestContext, bool isBaseClassConstructorNewScObject = false); static Var NewScObjectNoArgNoCtor(Var instance, ScriptContext* requestContext); static Var NewScObjectNoArgNoCtorFull(Var instance, ScriptContext* requestContext); static Var NewScObjectNoArg(Var instance, ScriptContext* requestContext); static Var NewScObject(const Var callee, const Arguments args, ScriptContext *const scriptContext, const Js::AuxArray<uint32> *spreadIndices = nullptr); template <typename Fn> static Var NewObjectCreationHelper_ReentrancySafe(RecyclableObject* constructor, bool isDefaultConstructor, ThreadContext * threadContext, Fn newObjectCreationFunction); static Var AddVarsToArraySegment(SparseArraySegment<Var> * segment, const Js::VarArray *vars); static void AddIntsToArraySegment(SparseArraySegment<int32> * segment, const Js::AuxArray<int32> *ints); static void AddFloatsToArraySegment(SparseArraySegment<double> * segment, const Js::AuxArray<double> *doubles); static void UpdateNewScObjectCache(Var function, Var instance, ScriptContext* requestContext); static RecyclableObject* GetIteratorFunction(Var iterable, ScriptContext* scriptContext, bool optional = false); static RecyclableObject* GetIteratorFunction(RecyclableObject* instance, ScriptContext * scriptContext, bool optional = false); static RecyclableObject* GetIterator(Var instance, ScriptContext* scriptContext, bool optional = false); static RecyclableObject* GetIterator(RecyclableObject* instance, ScriptContext* scriptContext, bool optional = false); static RecyclableObject* CacheIteratorNext(RecyclableObject* iterator, ScriptContext* scriptContext); static RecyclableObject* IteratorNext(RecyclableObject* iterator, ScriptContext* scriptContext, RecyclableObject* nextFunc, Var value = nullptr); static void IteratorClose(RecyclableObject* iterator, ScriptContext* scriptContext); template <typename THandler> static void DoIteratorStepAndValue(RecyclableObject* iterator, ScriptContext* scriptContext, THandler handler); static bool IteratorComplete(RecyclableObject* iterResult, ScriptContext* scriptContext); static Var IteratorValue(RecyclableObject* iterResult, ScriptContext* scriptContext); static bool IteratorStep(RecyclableObject* iterator, ScriptContext* scriptContext, RecyclableObject* nextFunc, RecyclableObject** result); static bool IteratorStepAndValue(RecyclableObject* iterator, ScriptContext* scriptContext, RecyclableObject* nextFunc, Var* resultValue); static void TraceUseConstructorCache(const ConstructorCache* ctorCache, const JavascriptFunction* ctor, bool isHit); static void TraceUpdateConstructorCache(const ConstructorCache* ctorCache, const FunctionBody* ctorBody, bool updated, const char16* reason); static Var ConvertToUnmappedArguments(HeapArgumentsObject *argumentsObject, uint32 paramCount, Var *paramAddr, DynamicObject* frameObject, Js::PropertyIdArray *propIds, uint32 formalsCount, ScriptContext* scriptContext); static Js::GlobalObject * OP_LdRoot(ScriptContext* scriptContext); static Js::ModuleRoot * GetModuleRoot(int moduleID, ScriptContext* scriptContext); static Js::Var OP_LoadModuleRoot(int moduleID, ScriptContext* scriptContext); static Var OP_LdNull(ScriptContext* scriptContext); static Var OP_LdUndef(ScriptContext* scriptContext); static Var OP_LdNaN(ScriptContext* scriptContext); static Var OP_LdChakraLib(ScriptContext* scriptContext); static Var OP_LdInfinity(ScriptContext* scriptContext); static FrameDisplay* OP_LdHandlerScope(Var argThis, ScriptContext* scriptContext); static FrameDisplay* OP_LdFrameDisplay(void *argHead, void *argEnv, ScriptContext* scriptContext); static FrameDisplay* OP_LdFrameDisplayNoParent(void *argHead, ScriptContext* scriptContext); static FrameDisplay* OP_LdStrictFrameDisplay(void *argHead, void *argEnv, ScriptContext* scriptContext); static FrameDisplay* OP_LdStrictFrameDisplayNoParent(void *argHead, ScriptContext* scriptContext); static FrameDisplay* OP_LdInnerFrameDisplay(void *argHead, void *argEnv, ScriptContext* scriptContext); static FrameDisplay* OP_LdInnerFrameDisplayNoParent(void *argHead, ScriptContext* scriptContext); static FrameDisplay* OP_LdStrictInnerFrameDisplay(void *argHead, void *argEnv, ScriptContext* scriptContext); static FrameDisplay* OP_LdStrictInnerFrameDisplayNoParent(void *argHead, ScriptContext* scriptContext); static void CheckInnerFrameDisplayArgument(void *argHead); static Var LoadHeapArguments(JavascriptFunction *funcCallee, uint32 count, Var *pParams, Var frameObj, Var vArray, ScriptContext* scriptContext, bool nonSimpleParamList); static Var LoadHeapArgsCached(JavascriptFunction *funcCallee, uint32 actualsCount, uint32 formalsCount, Var *pParams, Var frameObj, ScriptContext* scriptContext, bool nonSimpleParamList); static Var FillScopeObject(JavascriptFunction *funcCallee, uint32 actualsCount, uint32 formalsCount, Var frameObj, Var * paramAddr, Js::PropertyIdArray *propIds, HeapArgumentsObject * argsObj, ScriptContext * scriptContext, bool nonSimpleParamList, bool useCachedScope); static HeapArgumentsObject *CreateHeapArguments(JavascriptFunction *funcCallee, uint32 actualsCount, uint32 formalsCount, Var frameObj, ScriptContext* scriptContext); static Var OP_InitCachedScope(Var varFunc, const PropertyIdArray *propIds, Field(DynamicType*)* literalType, bool formalsAreLetDecls, ScriptContext *scriptContext); static void OP_InvalidateCachedScope(Var varEnv, int32 envIndex); static void OP_InitCachedFuncs(Var varScope, FrameDisplay *pDisplay, const FuncInfoArray *info, ScriptContext *scriptContext); static Var OP_NewScopeObject(ScriptContext* scriptContext); static Var OP_NewScopeObjectWithFormals(ScriptContext* scriptContext, FunctionBody * calleeBody, bool nonSimpleParamList); static Field(Var)* OP_NewScopeSlots(unsigned int count, ScriptContext *scriptContext, Var scope); static Field(Var)* OP_NewScopeSlotsWithoutPropIds(unsigned int count, int index, ScriptContext *scriptContext, FunctionBody *functionBody); static Field(Var)* OP_CloneScopeSlots(Field(Var) *scopeSlots, ScriptContext *scriptContext); static Var OP_NewPseudoScope(ScriptContext *scriptContext); static Var OP_NewBlockScope(ScriptContext *scriptContext); static Var OP_CloneBlockScope(BlockActivationObject *blockScope, ScriptContext *scriptContext); static Var OP_NewClassProto(Var protoParent, ScriptContext * scriptContext); static void OP_LoadUndefinedToElement(Var instance, PropertyId propertyId); static void OP_LoadUndefinedToElementDynamic(Var instance, PropertyId propertyId, ScriptContext* scriptContext); static void OP_LoadUndefinedToElementScoped(FrameDisplay *pScope, PropertyId propertyId, Var defaultInstance, ScriptContext* scriptContext); static Var OP_IsInst(Var instance, Var aClass, ScriptContext* scriptContext, IsInstInlineCache *inlineCache); static Var IsIn(Var argProperty, Var instance, ScriptContext* scriptContext); static BOOL GetRemoteTypeId(Var instance, __out TypeId* typeId); static FunctionProxy* GetDeferredDeserializedFunctionProxy(JavascriptFunction* func); template <bool IsFromFullJit, class TInlineCache> static Var PatchGetValue(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId); template <bool IsFromFullJit, class TInlineCache> static Var PatchGetValueWithThisPtr(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId, Var thisInstance); template <bool IsFromFullJit, class TInlineCache> static Var PatchGetValueForTypeOf(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId); static Var PatchGetValueUsingSpecifiedInlineCache(InlineCache * inlineCache, Var instance, RecyclableObject * object, PropertyId propertyId, ScriptContext* scriptContext); static Var PatchGetValueNoFastPath(FunctionBody *const functionBody, InlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId); static Var PatchGetValueWithThisPtrNoFastPath(FunctionBody *const functionBody, InlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId, Var thisInstance); template <bool IsFromFullJit, class TInlineCache> static Var PatchGetRootValue(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, DynamicObject* object, PropertyId propertyId); template <bool IsFromFullJit, class TInlineCache> static Var PatchGetRootValueForTypeOf(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, DynamicObject* object, PropertyId propertyId); static Var PatchGetRootValueNoFastPath_Var(FunctionBody *const functionBody, InlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId); static Var PatchGetRootValueNoFastPath(FunctionBody *const functionBody, InlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, DynamicObject* object, PropertyId propertyId); template <bool IsFromFullJit, class TInlineCache> static Var PatchGetPropertyScoped(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, FrameDisplay *pScope, PropertyId propertyId, Var defaultInstance); template <bool IsFromFullJit, class TInlineCache> static void PatchSetPropertyScoped(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, FrameDisplay *pScope, PropertyId propertyId, Var newValue, Var defaultInstance, PropertyOperationFlags flags = PropertyOperation_None); template <bool IsFromFullJit, class TInlineCache> static Var PatchGetPropertyForTypeOfScoped(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, FrameDisplay *pScope, PropertyId propertyId, Var defaultInstance); template <bool IsFromFullJit, class TInlineCache> static void PatchPutValue(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var obj, PropertyId propertyId, Var newValue, PropertyOperationFlags flags = PropertyOperation_None); template <bool IsFromFullJit, class TInlineCache> static void PatchPutValueWithThisPtr(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var obj, PropertyId propertyId, Var newValue, Var thisInstance, PropertyOperationFlags flags = PropertyOperation_None); template <bool IsFromFullJit, class TInlineCache> static void PatchPutRootValue(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var obj, PropertyId propertyId, Var newValue, PropertyOperationFlags flags = PropertyOperation_None); template <bool IsFromFullJit, class TInlineCache> static void PatchPutValueNoLocalFastPath(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId, Var newValue, PropertyOperationFlags flags = PropertyOperation_None); template <bool IsFromFullJit, class TInlineCache> static void PatchPutValueWithThisPtrNoLocalFastPath(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId, Var newValue, Var thisInstance, PropertyOperationFlags flags = PropertyOperation_None); template <bool IsFromFullJit, class TInlineCache> static void PatchPutRootValueNoLocalFastPath(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId, Var newValue, PropertyOperationFlags flags = PropertyOperation_None); static void PatchPutValueNoFastPath(FunctionBody *const functionBody, InlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var obj, PropertyId propertyId, Var newValue, PropertyOperationFlags flags = PropertyOperation_None); static void PatchPutValueWithThisPtrNoFastPath(FunctionBody *const functionBody, InlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var obj, PropertyId propertyId, Var newValue, Var thisInstance, PropertyOperationFlags flags = PropertyOperation_None); static void PatchPutRootValueNoFastPath(FunctionBody *const functionBody, InlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var obj, PropertyId propertyId, Var newValue, PropertyOperationFlags flags = PropertyOperation_None); template <bool IsFromFullJit, class TInlineCache> static void PatchInitValue(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, RecyclableObject* object, PropertyId propertyId, Var newValue); static void PatchInitValueNoFastPath(FunctionBody *const functionBody, InlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, RecyclableObject* object, PropertyId propertyId, Var newValue); template <class TInlineCache> static bool PatchPutValueCantChangeType(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var obj, PropertyId propertyId, Var newValue, PropertyOperationFlags flags = PropertyOperation_None); template <class TInlineCache> static bool PatchPutValueWithThisPtrCantChangeType(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var obj, PropertyId propertyId, Var newValue, Var thisInstance, PropertyOperationFlags flags = PropertyOperation_None); template <class TInlineCache> static bool PatchPutValueNoLocalFastPathCantChangeType(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId, Var newValue, PropertyOperationFlags flags = PropertyOperation_None); template <class TInlineCache> static bool PatchPutValueWithThisPtrNoLocalFastPathCantChangeType(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId, Var newValue, Var thisInstance, PropertyOperationFlags flags = PropertyOperation_None); template <class TInlineCache> static bool PatchInitValueCantChangeType(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, RecyclableObject* object, PropertyId propertyId, Var newValue); template <class TInlineCache> static bool PatchPutValueCheckLayout(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var obj, PropertyId propertyId, Var newValue, PropertyOperationFlags flags = PropertyOperation_None); template <class TInlineCache> static bool PatchPutValueWithThisPtrCheckLayout(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var obj, PropertyId propertyId, Var newValue, Var thisInstance, PropertyOperationFlags flags = PropertyOperation_None); template <class TInlineCache> static bool PatchPutValueNoLocalFastPathCheckLayout(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId, Var newValue, PropertyOperationFlags flags = PropertyOperation_None); template <class TInlineCache> static bool PatchPutValueWithThisPtrNoLocalFastPathCheckLayout(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId, Var newValue, Var thisInstance, PropertyOperationFlags flags = PropertyOperation_None); template <class TInlineCache> static bool PatchInitValueCheckLayout(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, RecyclableObject* object, PropertyId propertyId, Var newValue); static bool LayoutChanged(DynamicObject * instance, DynamicTypeHandler * oldTypeHandler); template <bool IsFromFullJit, class TInlineCache> static Var PatchGetMethod(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId); template <bool IsFromFullJit, class TInlineCache> static Var PatchGetRootMethod(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, DynamicObject* object, PropertyId propertyId); template <bool IsFromFullJit, class TInlineCache> static Var PatchScopedGetMethod(FunctionBody *const functionBody, TInlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId); static Var PatchGetMethodNoFastPath(FunctionBody *const functionBody, InlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId); static Var PatchGetRootMethodNoFastPath_Var(FunctionBody *const functionBody, InlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, Var instance, PropertyId propertyId); static Var PatchGetRootMethodNoFastPath(FunctionBody *const functionBody, InlineCache *const inlineCache, const InlineCacheIndex inlineCacheIndex, DynamicObject* object, PropertyId propertyId); static Var PatchGetMethodFromObject(Var instance, RecyclableObject * propertyObject, PropertyId propertyId, PropertyValueInfo * info, ScriptContext * scriptContext, bool isRootLd); static void GetPropertyIdForInt(uint64 value, ScriptContext* scriptContext, PropertyRecord const ** propertyRecord); static void GetPropertyIdForInt(uint32 value, ScriptContext* scriptContext, PropertyRecord const ** propertyRecord); static BOOL TryConvertToUInt32(const char16* str, int length, uint32* value); static BOOL ToPropertyDescriptor(Var propertySpec, PropertyDescriptor* descriptor, ScriptContext* scriptContext); static Var FromPropertyDescriptor(const PropertyDescriptor& descriptor, ScriptContext* scriptContext); static void CompletePropertyDescriptor(PropertyDescriptor* resultDescriptor, PropertyDescriptor* likePropertyDescriptor, ScriptContext* requestContext); static BOOL SetPropertyDescriptor(RecyclableObject* object, PropertyId propId, const PropertyDescriptor& descriptor); static BOOL DefineOwnPropertyDescriptor(RecyclableObject* object, PropertyId propId, const PropertyDescriptor& descriptor, bool throwOnError, ScriptContext* scriptContext); static BOOL DefineOwnPropertyForArray(JavascriptArray* arr, PropertyId propId, const PropertyDescriptor& descriptor, bool throwOnError, ScriptContext* scriptContext); static BOOL DefineOwnPropertyForTypedArray(TypedArrayBase * typedArray, PropertyId propId, const PropertyDescriptor & descriptor, bool throwOnError, ScriptContext * scriptContext); static BOOL IsCompatiblePropertyDescriptor(const PropertyDescriptor& descriptor, PropertyDescriptor* currentDescriptor, bool isExtensible, bool throwOnError, ScriptContext* scriptContext); template <bool needToSetProperty> static BOOL ValidateAndApplyPropertyDescriptor(RecyclableObject* obj, PropertyId propId, const PropertyDescriptor& descriptor, PropertyDescriptor* currentPropertyDescriptor, bool isExtensible, bool throwOnError, ScriptContext* scriptContext); template <bool isAccessor> static PropertyDescriptor FillMissingPropertyDescriptorFields(PropertyDescriptor descriptor, ScriptContext* scriptContext); static Var DefaultAccessor(RecyclableObject* function, CallInfo callInfo, ...); static bool IsUndefinedAccessor(Var accessor, ScriptContext* scriptContext); static void SetAttributes(RecyclableObject* object, PropertyId propId, const PropertyDescriptor& descriptor, bool force); static void OP_ClearAttributes(Var instance, PropertyId propertyId); static Var RootToThisObject(const Var object, ScriptContext * const scriptContext); static Var CallGetter(RecyclableObject * const function, Var const object, ScriptContext * const scriptContext); static void CallSetter(RecyclableObject * const function, Var const object, Var const value, ScriptContext * const scriptContext); static bool CheckIfObjectAndPrototypeChainHasOnlyWritableDataProperties(_In_ RecyclableObject* object); static bool CheckIfPrototypeChainHasOnlyWritableDataProperties(_In_ RecyclableObject* prototype); static bool CheckIfObjectAndProtoChainHasNoSpecialProperties(_In_ RecyclableObject* object); static bool CheckIfPrototypeChainContainsProxyObject(RecyclableObject* prototype); static void OP_SetComputedNameVar(Var method, Var computedNameVar); static void OP_SetHomeObj(Var method, Var homeObj); static Var OP_LdHomeObj(Var scriptFunction, ScriptContext * scriptContext); static Var OP_LdFuncObj(Var scriptFunction, ScriptContext * scriptContext); static Var OP_LdHomeObjProto(Var aRight, ScriptContext* scriptContext); static Var OP_LdFuncObjProto(Var aRight, ScriptContext* scriptContext); static Var OP_ImportCall(__in JavascriptFunction *function, __in Var specifier, __in ScriptContext* scriptContext); static Var OP_NewAwaitObject(ScriptContext* scriptContext); static Var OP_NewAsyncFromSyncIterator(Var syncIterator, ScriptContext* scriptContext); template <typename T> static void * JitRecyclerAlloc(DECLSPEC_GUARD_OVERFLOW size_t size, Recycler* recycler) { TRACK_ALLOC_INFO(recycler, T, Recycler, size - sizeof(T), (size_t)-1); return recycler->AllocZero(size); } static void * AllocMemForVarArray(DECLSPEC_GUARD_OVERFLOW size_t size, Recycler* recycler); static void * AllocUninitializedNumber(RecyclerJavascriptNumberAllocator * allocator); static void ScriptAbort(); class EntryInfo { public: static FunctionInfo DefaultAccessor; }; template <BOOL stopAtProxy, class Func> static void MapObjectAndPrototypes(RecyclableObject* object, Func func); template <BOOL stopAtProxy, class Func> static bool MapObjectAndPrototypesUntil(RecyclableObject* object, Func func); #if ENABLE_PROFILE_INFO static void UpdateNativeArrayProfileInfoToCreateVarArray(Var instance, const bool expectingNativeFloatArray, const bool expectingVarArray); static bool SetElementMayHaveImplicitCalls(ScriptContext *const scriptContext); #endif static RecyclableObject *GetCallableObjectOrThrow(const Var callee, ScriptContext *const scriptContext); static Js::Var BoxStackInstance(Js::Var value, ScriptContext * scriptContext, bool allowStackFunction, bool deepCopy); static BOOL PropertyReferenceWalkUnscopable(Var instance, RecyclableObject** propertyObject, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext); static BOOL PropertyReferenceWalk(Var instance, RecyclableObject** propertyObject, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext); static void VarToNativeArray(Var arrayObject, JsNativeValueType valueType, __in UINT length, __in UINT elementSize, __out_bcount(length*elementSize) byte* contentBuffer, Js::ScriptContext* scriptContext); // Returns a RecyclableObject* which is either a JavascriptFunction* or a JavascriptProxy* that targets a JavascriptFunction* static RecyclableObject* SpeciesConstructor(_In_ RecyclableObject* object, _In_ JavascriptFunction* defaultConstructor, _In_ ScriptContext* scriptContext); static Var GetSpecies(RecyclableObject* constructor, ScriptContext* scriptContext); // Get the property record usage cache from the given index variable, if it has one. // Adds a PropertyString to a LiteralStringWithPropertyStringPtr on second call with that string. // Also outputs the object that owns the usage cache, since PropertyRecordUsageCache is an interior pointer. // Returns whether a PropertyRecordUsageCache was found. _Success_(return) static bool GetPropertyRecordUsageCache(Var index, ScriptContext* scriptContext, _Outptr_ PropertyRecordUsageCache** propertyRecordUsageCache, _Outptr_ RecyclableObject** cacheOwner); template <bool ReturnOperationInfo> static bool SetElementIWithCache( _In_ Var receiver, _In_ RecyclableObject* object, _In_ RecyclableObject* index, _In_ Var value, _In_ PropertyRecordUsageCache* propertyRecordUsageCache, _In_ ScriptContext* scriptContext, _In_ PropertyOperationFlags flags, _Inout_opt_ PropertyCacheOperationInfo* operationInfo); template <bool ReturnOperationInfo> static Var GetElementIWithCache( _In_ Var instance, _In_ RecyclableObject* index, _In_ PropertyRecordUsageCache* propertyRecordUsageCache, _In_ ScriptContext* scriptContext, _Inout_opt_ PropertyCacheOperationInfo* operationInfo); private: static BOOL RelationalComparisonHelper(Var aLeft, Var aRight, ScriptContext* scriptContext, bool leftFirst, bool undefinedAs); template <typename ArrayType> static void ObjectToNativeArray(ArrayType* arrayObject, JsNativeValueType valueType, __in UINT length, __in UINT elementSize, __out_bcount(length*elementSize) byte* contentBuffer, Js::ScriptContext* scriptContext); template <typename ArrayType> static Js::Var GetElementAtIndex(ArrayType* arrayObject, UINT index, Js::ScriptContext* scriptContext); static Var GetElementIIntIndex(_In_ Var instance, _In_ Var index, _In_ ScriptContext* scriptContext); #if DBG static BOOL IsPropertyObject(RecyclableObject * instance); #endif template<typename PropertyKeyType, bool doFastProtoChainCheck, bool isRoot> static BOOL CheckPrototypesForAccessorOrNonWritablePropertyCore(RecyclableObject* instance, PropertyKeyType propertyKey, Var* setterValue, DescriptorFlags* flags, PropertyValueInfo* info, ScriptContext* scriptContext); static RecyclableObject * GetPrototypeObject(RecyclableObject * constructorFunction, ScriptContext * scriptContext); static RecyclableObject * GetPrototypeObjectForConstructorCache(RecyclableObject * constructor, ScriptContext * scriptContext, bool& canBeCached); static bool PrototypeObject(Var prototypeProperty, RecyclableObject * constructorFunction, ScriptContext * scriptContext, RecyclableObject** prototypeObject); static Var NewScObjectHostDispatchOrProxy(RecyclableObject * function, ScriptContext * requestContext); static Var NewScObjectCommon(RecyclableObject * functionObject, FunctionInfo * functionInfo, ScriptContext * scriptContext, bool isBaseClassConstructorNewScObject = false); static BOOL Reject(bool throwOnError, ScriptContext* scriptContext, int32 errorCode, PropertyId propertyId); static bool AreSamePropertyDescriptors(const PropertyDescriptor* x, const PropertyDescriptor* y, ScriptContext* scriptContext); static Var CanonicalizeAccessor(Var accessor, ScriptContext* scriptContext); static void BuildHandlerScope(Var argThis, RecyclableObject * hostObject, FrameDisplay * pScopes, ScriptContext * scriptContext); static void TryLoadRoot(Var& thisVar, TypeId typeId, int moduleID, ScriptContextInfo* scriptContext); static BOOL GetProperty_InternalSimple(Var instance, RecyclableObject* object, PropertyId propertyId, _Outptr_result_maybenull_ Var* value, ScriptContext* requestContext); template <bool unscopables> static BOOL GetProperty_Internal(Var instance, RecyclableObject* propertyObject, const bool isRoot, PropertyId propertyId, Var* value, ScriptContext* requestContext, PropertyValueInfo* info); static void TryCacheMissingProperty(Var instance, Var cacheInstance, bool isRoot, PropertyId propertyId, ScriptContext* requestContext, _Inout_ PropertyValueInfo * info); static RecyclableObject* GetPrototypeNoTrap(RecyclableObject* instance); static BOOL GetPropertyReference_Internal(Var instance, RecyclableObject* propertyObject, const bool isRoot, PropertyId propertyId, Var* value,ScriptContext* requestContext, PropertyValueInfo* info); template <bool unscopables> static BOOL PropertyReferenceWalk_Impl(Var instance, RecyclableObject** propertyObject, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext); static Var TypeofFld_Internal(Var instance, const bool isRoot, PropertyId propertyId, ScriptContext* scriptContext); static bool SetAccessorOrNonWritableProperty( Var receiver, RecyclableObject* object, PropertyId propertyId, Var newValue, PropertyValueInfo * info, ScriptContext* requestContext, PropertyOperationFlags propertyOperationFlags, bool isRoot, bool allowUndecInConsoleScope, BOOL *result); template <bool unscopables> static BOOL SetProperty_Internal(Var instance, RecyclableObject* object, const bool isRoot, PropertyId propertyId, Var newValue, PropertyValueInfo * info, ScriptContext* requestContext, PropertyOperationFlags flags); template <typename TPropertyKey> static DescriptorFlags GetRootSetter(RecyclableObject* instance, TPropertyKey propertyKey, Var *setterValue, PropertyValueInfo* info, ScriptContext* requestContext); static BOOL IsNumberFromNativeArray(Var instance, uint32 index, ScriptContext* scriptContext); static BOOL GetItemFromArrayPrototype(JavascriptArray * arr, int32 indexInt, Var * result, ScriptContext * scriptContext); template <typename T> static BOOL OP_GetElementI_ArrayFastPath(T * arr, int indexInt, Var * result, ScriptContext * scriptContext); static ImplicitCallFlags CacheAndClearImplicitBit(ScriptContext* scriptContext); static ImplicitCallFlags CheckAndUpdateFunctionBodyWithImplicitFlag(FunctionBody* functionBody); static void RestoreImplicitFlag(ScriptContext* scriptContext, ImplicitCallFlags prevImplicitCallFlags, ImplicitCallFlags currImplicitCallFlags); static BOOL ToPropertyDescriptorForProxyObjects(Var propertySpec, PropertyDescriptor* descriptor, ScriptContext* scriptContext); static BOOL ToPropertyDescriptorForGenericObjects(Var propertySpec, PropertyDescriptor* descriptor, ScriptContext* scriptContext); static BOOL IsRemoteArray(RecyclableObject* instance); }; } // namespace Js
Microsoft/ChakraCore
lib/Runtime/Language/JavascriptOperators.h
C
mit
70,527
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >Requirements</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REV="MADE" HREF="mailto:pgsql-docs@postgresql.org"><LINK REL="HOME" TITLE="PostgreSQL 9.6.2 Documentation" HREF="index.html"><LINK REL="UP" TITLE=" Installation from Source Code" HREF="installation.html"><LINK REL="PREVIOUS" TITLE="Short Version" HREF="install-short.html"><LINK REL="NEXT" TITLE="Getting The Source" HREF="install-getsource.html"><LINK REL="STYLESHEET" TYPE="text/css" HREF="stylesheet.css"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"><META NAME="creation" CONTENT="2017-02-06T21:56:32"></HEAD ><BODY CLASS="SECT1" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="4" ALIGN="center" VALIGN="bottom" ><A HREF="index.html" >PostgreSQL 9.6.2 Documentation</A ></TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="top" ><A TITLE="Short Version" HREF="install-short.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="10%" ALIGN="left" VALIGN="top" ><A HREF="installation.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="60%" ALIGN="center" VALIGN="bottom" >Chapter 16. Installation from Source Code</TD ><TD WIDTH="20%" ALIGN="right" VALIGN="top" ><A TITLE="Getting The Source" HREF="install-getsource.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="INSTALL-REQUIREMENTS" >16.2. Requirements</A ></H1 ><P > In general, a modern Unix-compatible platform should be able to run <SPAN CLASS="PRODUCTNAME" >PostgreSQL</SPAN >. The platforms that had received specific testing at the time of release are listed in <A HREF="supported-platforms.html" >Section 16.6</A > below. In the <TT CLASS="FILENAME" >doc</TT > subdirectory of the distribution there are several platform-specific <ACRONYM CLASS="ACRONYM" >FAQ</ACRONYM > documents you might wish to consult if you are having trouble. </P ><P > The following software packages are required for building <SPAN CLASS="PRODUCTNAME" >PostgreSQL</SPAN >: <P ></P ></P><UL ><LI ><P > <ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > <SPAN CLASS="APPLICATION" >make</SPAN > version 3.80 or newer is required; other <SPAN CLASS="APPLICATION" >make</SPAN > programs or older <ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > <SPAN CLASS="APPLICATION" >make</SPAN > versions will <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >not</I ></SPAN > work. (<ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > <SPAN CLASS="APPLICATION" >make</SPAN > is sometimes installed under the name <TT CLASS="FILENAME" >gmake</TT >.) To test for <ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > <SPAN CLASS="APPLICATION" >make</SPAN > enter: </P><PRE CLASS="SCREEN" ><KBD CLASS="USERINPUT" >make --version</KBD ></PRE ><P> </P ></LI ><LI ><P > You need an <ACRONYM CLASS="ACRONYM" >ISO</ACRONYM >/<ACRONYM CLASS="ACRONYM" >ANSI</ACRONYM > C compiler (at least C89-compliant). Recent versions of <SPAN CLASS="PRODUCTNAME" >GCC</SPAN > are recommended, but <SPAN CLASS="PRODUCTNAME" >PostgreSQL</SPAN > is known to build using a wide variety of compilers from different vendors. </P ></LI ><LI ><P > <SPAN CLASS="APPLICATION" >tar</SPAN > is required to unpack the source distribution, in addition to either <SPAN CLASS="APPLICATION" >gzip</SPAN > or <SPAN CLASS="APPLICATION" >bzip2</SPAN >. </P ></LI ><LI ><P > The <ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > <SPAN CLASS="PRODUCTNAME" >Readline</SPAN > library is used by default. It allows <SPAN CLASS="APPLICATION" >psql</SPAN > (the PostgreSQL command line SQL interpreter) to remember each command you type, and allows you to use arrow keys to recall and edit previous commands. This is very helpful and is strongly recommended. If you don't want to use it then you must specify the <TT CLASS="OPTION" >--without-readline</TT > option to <TT CLASS="FILENAME" >configure</TT >. As an alternative, you can often use the BSD-licensed <TT CLASS="FILENAME" >libedit</TT > library, originally developed on <SPAN CLASS="PRODUCTNAME" >NetBSD</SPAN >. The <TT CLASS="FILENAME" >libedit</TT > library is GNU <SPAN CLASS="PRODUCTNAME" >Readline</SPAN >-compatible and is used if <TT CLASS="FILENAME" >libreadline</TT > is not found, or if <TT CLASS="OPTION" >--with-libedit-preferred</TT > is used as an option to <TT CLASS="FILENAME" >configure</TT >. If you are using a package-based Linux distribution, be aware that you need both the <TT CLASS="LITERAL" >readline</TT > and <TT CLASS="LITERAL" >readline-devel</TT > packages, if those are separate in your distribution. </P ></LI ><LI ><P > The <SPAN CLASS="PRODUCTNAME" >zlib</SPAN > compression library is used by default. If you don't want to use it then you must specify the <TT CLASS="OPTION" >--without-zlib</TT > option to <TT CLASS="FILENAME" >configure</TT >. Using this option disables support for compressed archives in <SPAN CLASS="APPLICATION" >pg_dump</SPAN > and <SPAN CLASS="APPLICATION" >pg_restore</SPAN >. </P ></LI ></UL ><P> </P ><P > The following packages are optional. They are not required in the default configuration, but they are needed when certain build options are enabled, as explained below: <P ></P ></P><UL ><LI ><P > To build the server programming language <SPAN CLASS="APPLICATION" >PL/Perl</SPAN > you need a full <SPAN CLASS="PRODUCTNAME" >Perl</SPAN > installation, including the <TT CLASS="FILENAME" >libperl</TT > library and the header files. Since <SPAN CLASS="APPLICATION" >PL/Perl</SPAN > will be a shared library, the <TT CLASS="FILENAME" >libperl</TT > library must be a shared library also on most platforms. This appears to be the default in recent <SPAN CLASS="PRODUCTNAME" >Perl</SPAN > versions, but it was not in earlier versions, and in any case it is the choice of whomever installed Perl at your site. <TT CLASS="FILENAME" >configure</TT > will fail if building <SPAN CLASS="APPLICATION" >PL/Perl</SPAN > is selected but it cannot find a shared <TT CLASS="FILENAME" >libperl</TT >. In that case, you will have to rebuild and install <SPAN CLASS="PRODUCTNAME" >Perl</SPAN > manually to be able to build <SPAN CLASS="APPLICATION" >PL/Perl</SPAN >. During the configuration process for <SPAN CLASS="PRODUCTNAME" >Perl</SPAN >, request a shared library. </P ><P > If you intend to make more than incidental use of <SPAN CLASS="APPLICATION" >PL/Perl</SPAN >, you should ensure that the <SPAN CLASS="PRODUCTNAME" >Perl</SPAN > installation was built with the <TT CLASS="LITERAL" >usemultiplicity</TT > option enabled (<TT CLASS="LITERAL" >perl -V</TT > will show whether this is the case). </P ></LI ><LI ><P > To build the <SPAN CLASS="APPLICATION" >PL/Python</SPAN > server programming language, you need a <SPAN CLASS="PRODUCTNAME" >Python</SPAN > installation with the header files and the <SPAN CLASS="APPLICATION" >distutils</SPAN > module. The minimum required version is <SPAN CLASS="PRODUCTNAME" >Python</SPAN > 2.3. (To work with function arguments of type <TT CLASS="TYPE" >numeric</TT >, a 2.3.x installation must include the separately-available <TT CLASS="FILENAME" >cdecimal</TT > module; note the <SPAN CLASS="APPLICATION" >PL/Python</SPAN > regression tests will not pass if that is missing.) <SPAN CLASS="PRODUCTNAME" >Python 3</SPAN > is supported if it's version 3.1 or later; but see <A HREF="plpython-python23.html" >Section 44.1</A > when using Python 3. </P ><P > Since <SPAN CLASS="APPLICATION" >PL/Python</SPAN > will be a shared library, the <TT CLASS="FILENAME" >libpython</TT > library must be a shared library also on most platforms. This is not the case in a default <SPAN CLASS="PRODUCTNAME" >Python</SPAN > installation built from source, but a shared library is available in many operating system distributions. <TT CLASS="FILENAME" >configure</TT > will fail if building <SPAN CLASS="APPLICATION" >PL/Python</SPAN > is selected but it cannot find a shared <TT CLASS="FILENAME" >libpython</TT >. That might mean that you either have to install additional packages or rebuild (part of) your <SPAN CLASS="PRODUCTNAME" >Python</SPAN > installation to provide this shared library. When building from source, run <SPAN CLASS="PRODUCTNAME" >Python</SPAN >'s configure with the <TT CLASS="LITERAL" >--enable-shared</TT > flag. </P ></LI ><LI ><P > To build the <SPAN CLASS="APPLICATION" >PL/Tcl</SPAN > procedural language, you of course need a <SPAN CLASS="PRODUCTNAME" >Tcl</SPAN > installation. The minimum required version is <SPAN CLASS="PRODUCTNAME" >Tcl</SPAN > 8.4. </P ></LI ><LI ><P > To enable Native Language Support (<ACRONYM CLASS="ACRONYM" >NLS</ACRONYM >), that is, the ability to display a program's messages in a language other than English, you need an implementation of the <SPAN CLASS="APPLICATION" >Gettext</SPAN > <ACRONYM CLASS="ACRONYM" >API</ACRONYM >. Some operating systems have this built-in (e.g., <SPAN CLASS="SYSTEMITEM" >Linux</SPAN >, <SPAN CLASS="SYSTEMITEM" >NetBSD</SPAN >, <SPAN CLASS="SYSTEMITEM" >Solaris</SPAN >), for other systems you can download an add-on package from <A HREF="http://www.gnu.org/software/gettext/" TARGET="_top" >http://www.gnu.org/software/gettext/</A >. If you are using the <SPAN CLASS="APPLICATION" >Gettext</SPAN > implementation in the <ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > C library then you will additionally need the <SPAN CLASS="PRODUCTNAME" >GNU Gettext</SPAN > package for some utility programs. For any of the other implementations you will not need it. </P ></LI ><LI ><P > You need <SPAN CLASS="APPLICATION" >Kerberos</SPAN >, <SPAN CLASS="PRODUCTNAME" >OpenSSL</SPAN >, <SPAN CLASS="PRODUCTNAME" >OpenLDAP</SPAN >, and/or <SPAN CLASS="APPLICATION" >PAM</SPAN >, if you want to support authentication or encryption using those services. </P ></LI ><LI ><P > To build the <SPAN CLASS="PRODUCTNAME" >PostgreSQL</SPAN > documentation, there is a separate set of requirements; see <A HREF="docguide-toolsets.html" >Section J.2</A >. </P ></LI ></UL ><P> </P ><P > If you are building from a <SPAN CLASS="PRODUCTNAME" >Git</SPAN > tree instead of using a released source package, or if you want to do server development, you also need the following packages: <P ></P ></P><UL ><LI ><P > GNU <SPAN CLASS="APPLICATION" >Flex</SPAN > and <SPAN CLASS="APPLICATION" >Bison</SPAN > are needed to build from a Git checkout, or if you changed the actual scanner and parser definition files. If you need them, be sure to get <SPAN CLASS="APPLICATION" >Flex</SPAN > 2.5.31 or later and <SPAN CLASS="APPLICATION" >Bison</SPAN > 1.875 or later. Other <SPAN CLASS="APPLICATION" >lex</SPAN > and <SPAN CLASS="APPLICATION" >yacc</SPAN > programs cannot be used. </P ></LI ><LI ><P > <SPAN CLASS="APPLICATION" >Perl</SPAN > 5.8 or later is needed to build from a Git checkout, or if you changed the input files for any of the build steps that use Perl scripts. If building on Windows you will need <SPAN CLASS="APPLICATION" >Perl</SPAN > in any case. <SPAN CLASS="APPLICATION" >Perl</SPAN > is also required to run some test suites. </P ></LI ></UL ><P> </P ><P > If you need to get a <ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > package, you can find it at your local <ACRONYM CLASS="ACRONYM" >GNU</ACRONYM > mirror site (see <A HREF="http://www.gnu.org/order/ftp.html" TARGET="_top" >http://www.gnu.org/order/ftp.html</A > for a list) or at <A HREF="ftp://ftp.gnu.org/gnu/" TARGET="_top" >ftp://ftp.gnu.org/gnu/</A >. </P ><P > Also check that you have sufficient disk space. You will need about 100 MB for the source tree during compilation and about 20 MB for the installation directory. An empty database cluster takes about 35 MB; databases take about five times the amount of space that a flat text file with the same data would take. If you are going to run the regression tests you will temporarily need up to an extra 150 MB. Use the <TT CLASS="COMMAND" >df</TT > command to check free disk space. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="install-short.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="install-getsource.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Short Version</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="installation.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Getting The Source</TD ></TR ></TABLE ></DIV ></BODY ></HTML >
unsupo/ogame
ogamebotserver/src/main/resources/databases/postgres/share/doc/postgresql/html/install-requirements.html
HTML
mit
13,788
const path = require('path'); const webpack = require('webpack'); module.exports = { devtool: 'cheap-module-eval-source-map', entry: './index.js', output: { path: path.join(__dirname, 'dist'), filename: 'bundle.js', publicPath: '/static/' }, module: { loaders: [ { test: /\.js?$/, loaders: ['babel'], exclude: /node_modules/, }, { test: /\.css$/, loaders: 'style-loader!css-loaders', } ] } }
ahbing/Pure
examples/video/webpack.config.js
JavaScript
mit
489
// Copy <array> to the device void bones_copy<direction>_<id>_<array>(<definition>) { cudaStreamSynchronize(kernel_stream); bones_memcpy(device_<array>, <array><flatten>, <variable_dimensions>*sizeof(<type>), cudaMemcpyHostToDevice, <state>, <index>); }
tue-es/bones
skeletons/GPU-CUDA/common/mem_async_copyin.c
C
mit
258
{% extends "parts/base.html" %} {% set active_page = "login" -%} {% block content %} <div class="mdl-grid"> <div class="mdl-cell mdl-cell--10-col text-center"> <h1>Login</h1> </div> <div class="mdl-cell mdl-cell--2-col"> <span id="login_saved" class="hidden mdl-chip mdl-chip--deletable"> <span class="mdl-chip__text">saved</span> <button id="login_saved_cancel" type="button" class="mdl-chip__action"><i class="material-icons">cancel</i></button> </span> </div> </div> <div class="mdl-grid"> <div class="mdl-cell mdl-cell--4-col"> <p> Fill in the fields to the right then hit the login button. </p> </div> <div class="mdl-cell--8-col"> <div class="mdl-grid"> <form action="#"> <div class="mdl-textfield mdl-js-textfield"> <input class="mdl-textfield__input" type="text" id="username"> <label class="mdl-textfield__label" for="username">Username</label> </div> <div class="mdl-textfield mdl-js-textfield"> <input class="mdl-textfield__input" type="password" id="password"> <label class="mdl-textfield__label" for="password">Password</label> </div> <div class="mdl-textfield mdl-js-textfield"> <input class="mdl-textfield__input" type="text" id="engineer"> <label class="mdl-textfield__label" for="engineer">Engineer Number</label> </div> <div class="mdl-cell--12-col"> <button class="mdl-button mdl-js-button mdl-cell--middle mdl-button--raised mdl-js-ripple-effect" id="login">Login</button> <div id="ajax" class="mdl-spinner mdl-js-spinner"></div> <label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="livedb"> <input value="live" type="radio" id="livedb" class="mdl-radio__button" name="options" checked /> <span class="mdl-radio__label">Live</span> </label> <label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="testdb"> <input value ="test" type="radio" id="testdb" class="mdl-radio__button" name="options" /> <span class="mdl-radio__label">Test</span> </label> </div> </form> </div> </div> </div> {% endblock %}
k33k00/tesseract_infinity
t_infinity.old/app/templates/login.html
HTML
mit
2,096
<?php namespace AppBundle\Repository; use AppBundle\Entity\PastTimeline; use AppBundle\Entity\User; use Doctrine\ORM\EntityRepository; /** * PastTimelineRepository. * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class PastTimelineRepository extends EntityRepository { public function insert(User $user, array $json, \DateTime $date) { $pastTimeLine = new PastTimeline(); $pastTimeLine->setUser($user); $pastTimeLine->setTimeline($json); $pastTimeLine->setDate($date); $now = new \DateTime(); $pastTimeLine->setCreateAt($now); $pastTimeLine->setUpdateAt($now); $this->_em->persist($pastTimeLine); $this->_em->flush(); } }
ryota-murakami/tweet-pick
src/AppBundle/Repository/PastTimelineRepository.php
PHP
mit
768
import logging, sys from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL class InfoFilter(logging.Filter): def filter(self, rec): return rec.levelno in (logging.DEBUG, logging.INFO) def _new_custom_logger(name='BiblioPixel', fmt='%(levelname)s - %(module)s - %(message)s'): logger = logging.getLogger(name) formatter = logging.Formatter(fmt=fmt) if len(logger.handlers) == 0: logger.setLevel(logging.INFO) h1 = logging.StreamHandler(sys.stdout) h1.setLevel(logging.DEBUG) h1.addFilter(InfoFilter()) h1.setFormatter(formatter) h2 = logging.StreamHandler(sys.stderr) h2.setLevel(logging.WARNING) h2.setFormatter(formatter) logger.addHandler(h1) logger.addHandler(h2) return logger logger = _new_custom_logger() setLogLevel = logger.setLevel debug, info, warning, error, critical, exception = ( logger.debug, logger.info, logger.warning, logger.error, logger.critical, logger.exception)
sethshill/final
build/lib.linux-armv7l-2.7/bibliopixel/log.py
Python
mit
1,041
using Kentico.Kontent.Delivery.Abstractions; using Kentico.Kontent.Delivery.Tests.DependencyInjectionFrameworks.Helpers; using Microsoft.Extensions.DependencyInjection; using Xunit; namespace Kentico.Kontent.Delivery.Tests.DependencyInjectionFrameworks { [Collection("DI Tests")] public class UnityTests { [Fact] public void DeliveryClientIsSuccessfullyResolvedFromUnityContainer() { var provider = DependencyInjectionFrameworksHelper .GetServiceCollection() .RegisterInlineContentItemResolvers() .BuildUnityServiceProvider(); var client = (DeliveryClient)provider.GetRequiredService<IDeliveryClient>(); client.AssertDefaultDependencies(); } [Fact] public void DeliveryClientIsSuccessfullyResolvedFromUnityContainer_CustomModelProvider() { var provider = DependencyInjectionFrameworksHelper .GetServiceCollection() .AddSingleton<IModelProvider, FakeModelProvider>() .BuildUnityServiceProvider(); var client = (DeliveryClient)provider.GetRequiredService<IDeliveryClient>(); client.AssertDefaultDependenciesWithModelProviderAndInlineContentItemTypeResolvers<FakeModelProvider>(); } } }
Kentico/Deliver-.NET-SDK
Kentico.Kontent.Delivery.Tests/DependencyInjectionFrameworks/UnityTests.cs
C#
mit
1,341
/* * (c) Copyright 2015 Micro Focus or one of its affiliates. * * Licensed under the MIT License (the "License"); you may not use this file * except in compliance with the License. * * The only warranties for products and services of Micro Focus and its affiliates * and licensors ("Micro Focus") are as may be set forth in the express warranty * statements accompanying such products and services. Nothing herein should be * construed as constituting an additional warranty. Micro Focus shall not be * liable for technical or editorial errors or omissions contained herein. The * information contained herein is subject to change without notice. */ package com.hp.autonomy.searchcomponents.hod.databases; import com.hp.autonomy.searchcomponents.core.requests.RequestObject; import com.hp.autonomy.searchcomponents.core.requests.RequestObjectBuilder; import com.hp.autonomy.types.IdolDatabase; import lombok.Builder; import lombok.Data; @SuppressWarnings("WeakerAccess") @Data @Builder(toBuilder = true) public final class Database implements IdolDatabase, Comparable<Database>, RequestObject<Database, Database.DatabaseBuilder> { private static final long serialVersionUID = -3966566623844850811L; static final String ROOT_FIELD = "database"; private final String name; private final String displayName; private final long documents; private final boolean isPublic; private final String domain; @Override public int compareTo(final Database other) { return name.compareTo(other.name); } public static class DatabaseBuilder implements RequestObjectBuilder<Database, DatabaseBuilder> {} }
hpe-idol/haven-search-components
hod/src/main/java/com/hp/autonomy/searchcomponents/hod/databases/Database.java
Java
mit
1,658
package vStrikerEntities; import java.io.Serializable; import javax.persistence.*; import java.util.List; /** * The persistent class for the OBJECT_SIZE_REPORT_UNIT database table. * */ @Entity @Table(name="OBJECT_SIZE_REPORT_UNIT", schema="VSTRIKERDB") @NamedQuery(name="ObjectSizeReportUnit.findAll", query="SELECT o FROM ObjectSizeReportUnit o") public class ObjectSizeReportUnit implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="OBJECT_SIZE_REPORT_UNIT_ID") private int objectSizeReportUnitId; @Column(name="REPORT_UNIT_NAME") private String reportUnitName; @Column(name="REPORT_UNIT_VALUE") private String reportUnitValue; public ObjectSizeReportUnit() { } public int getObjectSizeReportUnitId() { return this.objectSizeReportUnitId; } public void setObjectSizeReportUnitId(int objectSizeReportUnitId) { this.objectSizeReportUnitId = objectSizeReportUnitId; } public String getReportUnitName() { return this.reportUnitName; } public void setReportUnitName(String reportUnitName) { this.reportUnitName = reportUnitName; } public String getReportUnitValue() { return this.reportUnitValue; } public void setReportUnitValue(String reportUnitValue) { this.reportUnitValue = reportUnitValue; } @Override public String toString() { return this.reportUnitName; } }
emccode/VStriker
vStrikerEntities/src/vStrikerEntities/ObjectSizeReportUnit.java
Java
mit
1,437
using System.Collections.Generic; using System.Linq; using BenchmarkDotNet.Engines; using BenchmarkDotNet.Extensions; using BenchmarkDotNet.Horology; using BenchmarkDotNet.Reports; namespace BenchmarkDotNet.Analysers { public class ZeroMeasurementAnalyser : AnalyserBase { public override string Id => "ZeroMeasurement"; public static readonly IAnalyser Default = new ZeroMeasurementAnalyser(); private static readonly TimeInterval FallbackCpuResolutionValue = TimeInterval.FromNanoseconds(0.2d); private ZeroMeasurementAnalyser() { } protected override IEnumerable<Conclusion> AnalyseReport(BenchmarkReport report, Summary summary) { var currentFrequency = summary.HostEnvironmentInfo.CpuInfo.Value.MaxFrequency; if (!currentFrequency.HasValue || currentFrequency <= 0) currentFrequency = FallbackCpuResolutionValue.ToFrequency(); var entire = report.AllMeasurements; var overheadMeasurements = entire.Where(m => m.Is(IterationMode.Overhead, IterationStage.Actual)).ToArray(); var workloadMeasurements = entire.Where(m => m.Is(IterationMode.Workload, IterationStage.Actual)).ToArray(); if (workloadMeasurements.IsEmpty()) yield break; var workload = workloadMeasurements.GetStatistics(); var threshold = currentFrequency.Value.ToResolution().Nanoseconds / 2; var zeroMeasurement = overheadMeasurements.Any() ? ZeroMeasurementHelper.CheckZeroMeasurementTwoSamples(workload.WithoutOutliers(), overheadMeasurements.GetStatistics().WithoutOutliers()) : ZeroMeasurementHelper.CheckZeroMeasurementOneSample(workload.WithoutOutliers(), threshold); if (zeroMeasurement) yield return CreateWarning("The method duration is indistinguishable from the empty method duration", report, false); } } }
ig-sinicyn/BenchmarkDotNet
src/BenchmarkDotNet/Analysers/ZeroMeasurementAnalyser.cs
C#
mit
2,051
def make_colorscale_from_colors(colors): if len(colors) == 1: colors *= 2 return tuple((i / (len(colors) - 1), color) for i, color in enumerate(colors))
KwatME/plot
plot/make_colorscale_from_colors.py
Python
mit
172
#ifndef __PPU_LV2_H__ #define __PPU_LV2_H__ #include <ppu-types.h> #define LV2_INLINE static inline #define LV2_SYSCALL LV2_INLINE s32 #define lv2syscall0(syscall) \ register u64 p1 asm("3"); \ register u64 p2 asm("4"); \ register u64 p3 asm("5"); \ register u64 p4 asm("6"); \ register u64 p5 asm("7"); \ register u64 p6 asm("8"); \ register u64 p7 asm("9"); \ register u64 p8 asm("10"); \ register u64 scn asm("11") = (syscall); \ __asm__ __volatile__("sc" \ : "=r"(p1), "=r"(p2), "=r"(p3), "=r"(p4), \ "=r"(p5), "=r"(p6), "=r"(p7), "=r"(p8), "=r"(scn) \ : "r"(p1), "r"(p2), "r"(p3), "r"(p4), \ "r"(p5), "r"(p6), "r"(p7), "r"(p8), "r"(scn) \ : "r0","r12","lr","ctr","xer","cr0","cr1","cr5","cr6","cr7","memory") #define lv2syscall1(syscall,a1) \ register u64 p1 asm("3") = (a1); \ register u64 p2 asm("4"); \ register u64 p3 asm("5"); \ register u64 p4 asm("6"); \ register u64 p5 asm("7"); \ register u64 p6 asm("8"); \ register u64 p7 asm("9"); \ register u64 p8 asm("10"); \ register u64 scn asm("11") = (syscall); \ __asm__ __volatile__("sc" \ : "=r"(p1), "=r"(p2), "=r"(p3), "=r"(p4), \ "=r"(p5), "=r"(p6), "=r"(p7), "=r"(p8), "=r"(scn) \ : "r"(p1), "r"(p2), "r"(p3), "r"(p4), \ "r"(p5), "r"(p6), "r"(p7), "r"(p8), "r"(scn) \ : "r0","r12","lr","ctr","xer","cr0","cr1","cr5","cr6","cr7","memory") #define lv2syscall2(syscall,a1,a2) \ register u64 p1 asm("3") = (a1); \ register u64 p2 asm("4") = (a2); \ register u64 p3 asm("5"); \ register u64 p4 asm("6"); \ register u64 p5 asm("7"); \ register u64 p6 asm("8"); \ register u64 p7 asm("9"); \ register u64 p8 asm("10"); \ register u64 scn asm("11") = (syscall); \ __asm__ __volatile__("sc" \ : "=r"(p1), "=r"(p2), "=r"(p3), "=r"(p4), \ "=r"(p5), "=r"(p6), "=r"(p7), "=r"(p8), "=r"(scn) \ : "r"(p1), "r"(p2), "r"(p3), "r"(p4), \ "r"(p5), "r"(p6), "r"(p7), "r"(p8), "r"(scn) \ : "r0","r12","lr","ctr","xer","cr0","cr1","cr5","cr6","cr7","memory") #define lv2syscall3(syscall,a1,a2,a3) \ register u64 p1 asm("3") = (a1); \ register u64 p2 asm("4") = (a2); \ register u64 p3 asm("5") = (a3); \ register u64 p4 asm("6"); \ register u64 p5 asm("7"); \ register u64 p6 asm("8"); \ register u64 p7 asm("9"); \ register u64 p8 asm("10"); \ register u64 scn asm("11") = (syscall); \ __asm__ __volatile__("sc" \ : "=r"(p1), "=r"(p2), "=r"(p3), "=r"(p4), \ "=r"(p5), "=r"(p6), "=r"(p7), "=r"(p8), "=r"(scn) \ : "r"(p1), "r"(p2), "r"(p3), "r"(p4), \ "r"(p5), "r"(p6), "r"(p7), "r"(p8), "r"(scn) \ : "r0","r12","lr","ctr","xer","cr0","cr1","cr5","cr6","cr7","memory") #define lv2syscall4(syscall,a1,a2,a3,a4) \ register u64 p1 asm("3") = (a1); \ register u64 p2 asm("4") = (a2); \ register u64 p3 asm("5") = (a3); \ register u64 p4 asm("6") = (a4); \ register u64 p5 asm("7"); \ register u64 p6 asm("8"); \ register u64 p7 asm("9"); \ register u64 p8 asm("10"); \ register u64 scn asm("11") = (syscall); \ __asm__ __volatile__("sc" \ : "=r"(p1), "=r"(p2), "=r"(p3), "=r"(p4), \ "=r"(p5), "=r"(p6), "=r"(p7), "=r"(p8), "=r"(scn) \ : "r"(p1), "r"(p2), "r"(p3), "r"(p4), \ "r"(p5), "r"(p6), "r"(p7), "r"(p8), "r"(scn) \ : "r0","r12","lr","ctr","xer","cr0","cr1","cr5","cr6","cr7","memory") #define lv2syscall5(syscall,a1,a2,a3,a4,a5) \ register u64 p1 asm("3") = (a1); \ register u64 p2 asm("4") = (a2); \ register u64 p3 asm("5") = (a3); \ register u64 p4 asm("6") = (a4); \ register u64 p5 asm("7") = (a5); \ register u64 p6 asm("8"); \ register u64 p7 asm("9"); \ register u64 p8 asm("10"); \ register u64 scn asm("11") = (syscall); \ __asm__ __volatile__("sc" \ : "=r"(p1), "=r"(p2), "=r"(p3), "=r"(p4), \ "=r"(p5), "=r"(p6), "=r"(p7), "=r"(p8), "=r"(scn) \ : "r"(p1), "r"(p2), "r"(p3), "r"(p4), \ "r"(p5), "r"(p6), "r"(p7), "r"(p8), "r"(scn) \ : "r0","r12","lr","ctr","xer","cr0","cr1","cr5","cr6","cr7","memory") #define lv2syscall6(syscall,a1,a2,a3,a4,a5,a6) \ register u64 p1 asm("3") = (a1); \ register u64 p2 asm("4") = (a2); \ register u64 p3 asm("5") = (a3); \ register u64 p4 asm("6") = (a4); \ register u64 p5 asm("7") = (a5); \ register u64 p6 asm("8") = (a6); \ register u64 p7 asm("9"); \ register u64 p8 asm("10"); \ register u64 scn asm("11") = (syscall); \ __asm__ __volatile__("sc" \ : "=r"(p1), "=r"(p2), "=r"(p3), "=r"(p4), \ "=r"(p5), "=r"(p6), "=r"(p7), "=r"(p8), "=r"(scn) \ : "r"(p1), "r"(p2), "r"(p3), "r"(p4), \ "r"(p5), "r"(p6), "r"(p7), "r"(p8), "r"(scn) \ : "r0","r12","lr","ctr","xer","cr0","cr1","cr5","cr6","cr7","memory") #define lv2syscall7(syscall,a1,a2,a3,a4,a5,a6,a7) \ register u64 p1 asm("3") = (a1); \ register u64 p2 asm("4") = (a2); \ register u64 p3 asm("5") = (a3); \ register u64 p4 asm("6") = (a4); \ register u64 p5 asm("7") = (a5); \ register u64 p6 asm("8") = (a6); \ register u64 p7 asm("9") = (a7); \ register u64 p8 asm("10"); \ register u64 scn asm("11") = (syscall); \ __asm__ __volatile__("sc" \ : "=r"(p1), "=r"(p2), "=r"(p3), "=r"(p4), \ "=r"(p5), "=r"(p6), "=r"(p7), "=r"(p8), "=r"(scn) \ : "r"(p1), "r"(p2), "r"(p3), "r"(p4), \ "r"(p5), "r"(p6), "r"(p7), "r"(p8), "r"(scn) \ : "r0","r12","lr","ctr","xer","cr0","cr1","cr5","cr6","cr7","memory") #define lv2syscall8(syscall,a1,a2,a3,a4,a5,a6,a7,a8) \ register u64 p1 asm("3") = (a1); \ register u64 p2 asm("4") = (a2); \ register u64 p3 asm("5") = (a3); \ register u64 p4 asm("6") = (a4); \ register u64 p5 asm("7") = (a5); \ register u64 p6 asm("8") = (a6); \ register u64 p7 asm("9") = (a7); \ register u64 p8 asm("10") = (a8); \ register u64 scn asm("11") = (syscall); \ __asm__ __volatile__("sc" \ : "=r"(p1), "=r"(p2), "=r"(p3), "=r"(p4), \ "=r"(p5), "=r"(p6), "=r"(p7), "=r"(p8), "=r"(scn) \ : "r"(p1), "r"(p2), "r"(p3), "r"(p4), \ "r"(p5), "r"(p6), "r"(p7), "r"(p8), "r"(scn) \ : "r0","r12","lr","ctr","xer","cr0","cr1","cr5","cr6","cr7","memory") #define return_to_user_prog(ret_type) return (ret_type)(p1) #define register_passing_1(type) (type)(p2) #define register_passing_2(type) (type)(p3) #define register_passing_3(type) (type)(p4) #define register_passing_4(type) (type)(p5) #define register_passing_5(type) (type)(p6) #define register_passing_6(type) (type)(p7) #define register_passing_7(type) (type)(p8) #define REG_PASS_SYS_EVENT_QUEUE_RECEIVE \ event->source = register_passing_1(u64); \ event->data_1 = register_passing_2(u64); \ event->data_2 = register_passing_3(u64); \ event->data_3 = register_passing_4(u64) #endif /* __PPU_LV2_H__ */
ps3dev/PSL1GHT
ppu/include/ppu-lv2.h
C
mit
13,162
package a.b; import java.lang.annotation.ElementType; import java.lang.annotation.Target; /** * @author Kohsuke Kawaguchi */ @Target({ElementType.PACKAGE, ElementType.TYPE}) @MyWay(X.class) public @interface MyWay { Class value(); }
kohsuke/sorcerer
core/src/test/java/a/b/MyWay.java
Java
mit
241
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="refresh" content="0;URL=../../../../../../../../libc/constant.SYS_io_submit.html"> </head> <body> <p>Redirecting to <a href="../../../../../../../../libc/constant.SYS_io_submit.html">../../../../../../../../libc/constant.SYS_io_submit.html</a>...</p> <script>location.replace("../../../../../../../../libc/constant.SYS_io_submit.html" + location.search + location.hash);</script> </body> </html>
malept/guardhaus
main/libc/unix/linux_like/linux/gnu/b64/x86_64/not_x32/constant.SYS_io_submit.html
HTML
mit
465
#include <iostream> #include <string> using namespace std; int main(int argc, char *argv[]) { string d, s; while (cin >> d >> s) (d.find(s) != string::npos) ? puts("Resistente"): puts("Nao resistente"); }
miguelarauj1o/URI
src/URI_2356 - (12578577) - Accepted.cpp
C++
mit
209
/* * JAWStats 0.8.0 Web Statistics * * Copyright (c) 2009 Jon Combe (jawstats.com) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * */ var oTranslation = {}; var aStatistics = []; var dtLastUpdate = 0; var sToolID; var aParts = []; // jQuery methods $(document).ready(function() { var aCurrentView = g_sCurrentView.split("."); $("#menu").children("ul:eq(0)").children("li").addClass("off"); $("#tab" + aCurrentView[0]).removeClass("off"); DrawPage(g_sCurrentView); // change language mouseover $("#toolLanguageButton").mouseover(function() { $("#toolLanguageButton img").attr("src", "themes/" + sThemeDir + "/images/change_language_on.gif"); }); $("#toolLanguageButton").mouseout(function() { $("#toolLanguageButton img").attr("src", "themes/" + sThemeDir + "/images/change_language.gif"); }); if (g_sParts.length == 0) aParts = [{name: "", active: true}]; else { aStr = g_sParts.split(','); for (iIndex in aStr) aParts.push({name: aStr[iIndex], active: true}); } window.onscroll = function(e) { $("#control").animate({"top": getScrollXY()[1] + 120}, 100); } }); function getScrollXY() { var scrOfX = 0, scrOfY = 0; if (typeof(window.pageYOffset) == 'number') { //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { //DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return [scrOfX, scrOfY]; } function AddLeadingZero(vValue, iLength) { sValue = vValue.toString(); while (sValue.length < iLength) { sValue = ("0" + sValue); } return sValue; } function ChangeLanguage(sLanguage) { $("#loading").show(); self.location.href = ("?config=" + g_sConfig + "&year=" + g_iYear + "&month=" + g_iMonth + "&view=" + g_sCurrentView + "&lang=" + sLanguage); } function ChangeMonth(iYear, iMonth) { $("#loading").show(); self.location.href = ("?config=" + g_sConfig + "&year=" + iYear + "&month=" + iMonth + "&view=" + g_sCurrentView + "&lang=" + g_sLanguage); } function ChangeSite(sConfig) { $("#loading").show(); self.location.href = ("?config=" + sConfig + "&year=" + g_iYear + "&month=" + g_iMonth + "&view=" + g_sCurrentView + "&lang=" + g_sLanguage); } function ChangeTab(oSpan, sPage) { $("#menu").children("ul:eq(0)").children("li").addClass("off"); $(oSpan).parent().removeClass("off"); DrawPage(sPage); } function ChangePart(oDom, sPart) { var iCount = 0; var iIdx = 0; for (iIndex in aParts) { if (aParts[iIndex].name == sPart) { iIdx = iIndex; aParts[iIndex].active = !aParts[iIndex].active; if (aParts[iIndex].active) $(oDom).addClass("selected"); else $(oDom).removeClass("selected"); } if (aParts[iIndex].active) iCount++; } // 1 part must be active if (iCount == 0) { $(oDom).addClass("selected"); aParts[iIdx].active = true; return; } DrawPage(g_sCurrentView); } function CheckLastUpdate(oXML) { /* CHECK:0.8 // removed check becouse of multiple parts, not clear what is the effect. if (parseInt($(oXML).find('info').attr("lastupdate")) != g_dtLastUpdate) { var sURL = "?config=" + g_sConfig + "&year=" + g_iYear + "&month=" + g_iMonth + "&view=" + g_sCurrentView; self.location.href = sURL; }*/ } function DisplayBandwidth(iBW) { iVal = iBW; iBW = (iBW / 1024); if (iBW < 1024) { return NumberFormat(iBW, 1) + "k"; } iBW = (iBW / 1024); if (iBW < 1024) { return NumberFormat(iBW, 1) + "M"; } iBW = (iBW / 1024); return NumberFormat(iBW, 1) + "G"; } function DrawGraph(aItem, aValue, aInitial, sMode) { var aSeries = []; for (var jIndex in aValue) { var data = []; for (var iIndex in aValue[jIndex]) data.push([aItem[iIndex], aValue[jIndex][iIndex]]); aSeries.push({data: data, points: {show: true, fill: true, fillColor: g_cGraphFillColor, lineWidth: g_cGraphLineWidth}, color: g_cGraphLineColor}); } // var xax = null; if (sMode != null) xax = {mode: sMode, min: aItem[0].getTime(), max: aItem[aItem.length - 1].getTime()}; else xax = {mode: sMode, ticks: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22], tickDecimals: 0}; var yax = {min: 0}; var aOptions = {series: {stack: true}, lines: {show: true, lineWidth: g_cGraphLineWidth, fill: true}, grid: {show: true, borderColor: "white"}, xaxis: xax, yaxis: yax}; $.plot($("#graph"), aSeries, aOptions); } function DrawBar(aItem, aValue, aInitial) { var aSeries = []; var aTicks = [[0, ""]]; var iSum = 0; var iCount = 0; for (var iPart in aValue) { var data = []; for (var iIndex in aValue[iPart]) { sBarColor = g_aBarColors[iPart]; /* if (aInitial[iIndex] == "Sat") sBarColor=g_aBarColors[2]; else if (aInitial[iIndex] == "Fri") sBarColor=g_aBarColors[1];*/ data.push([iIndex * 2, aValue[iPart][iIndex]]); if (iPart == 0) { if (iIndex % 2 == 0) aTicks.push([iIndex * 2 + 1, aItem[iIndex]]); else aTicks.push([iIndex * 2 + 1, ""]); } if (aValue[iPart][iIndex] > 0) { if (iPart == 0) iCount++; iSum += aValue[iPart][iIndex]; } } aSeries.push({data: data, color: g_cBarFrame, bars: {fillColor: sBarColor}}); // aSeries.push(data); } aMarkingLine = iSum / iCount; xax = {min: 0, max: aItem.length * 2, ticks: aTicks, mode: "time"}; yax = {labelWidth: 10, labelHeight: 10, tickDecimals: 0}; var aOptions = {xaxis: xax, yaxis: yax, bars: {show: true, barWidth: 1.85, lineWidth: 1}, grid: {show: true, hoverable: false, clickable: false, autohighlight: true, borderColor: "white", tickColor: "white" /* markings: [{ xaxis: { from: 1, to: 61 }, yaxis: {from: aMarkingLine, to: aMarkingLine}, color: g_cBarMarking, lineWidth:1 }]*/}, legend: {show: false}, series: {stack: true, labels: aInitial}, formatter: function(label, series) { return '<div style="font-size:8pt;text-align:center;padding:2px;color:blue;">' + label + '<br/>' + Math.round(series.percent) + '%</div>'; } }; var plot = $.plot($("#graph"), aSeries, aOptions); /* $("#graph").bind("plotclick", function (event, pos, item) { if (item) { // $("#graph").highlight(item.series, item.datapoint); oRow = oStatistics.oThisMonth.aData[item.seriesIndex]; window.location = g_sJAWStatsPath + "?config=" + oRow.sSite; } });*/ } function DrawPie(iTotal, aItem, aValue) { var data = []; if (!aItem.length) return; for (var iIndex in aValue) { data[iIndex] = {label: aItem[iIndex], data: aValue[iIndex], color: g_aPieColors[iIndex]}; // alert(data[i].label+" : "+data[i].data); } $.plot($("#pie"), data, { series: { pie: { show: true, radius: 1, label: { show: false, radius: 1, formatter: function(label, series) { return '<div style="font-size:8pt;text-align:center;padding:2px;color:blue;">' + label + '<br/>' + Math.round(series.percent) + '%</div>'; }}, threshold: 0.05 } }, legend: { show: true, position: "sw", margin: [10, -80], backgroundOpacity: 0.5 } }); } function DrawSubMenu(sMenu, sSelected) { oMenu = oSubMenu[sMenu]; // create menu var aMenu = []; for (sLabel in oMenu) { if (sSelected == sLabel) { aMenu.push("<span class=\"submenuselect\" onclick=\"DrawPage('" + oMenu[sLabel] + "')\">" + Lang(sLabel) + "</span>"); } else { aMenu.push("<span class=\"submenu\" onclick=\"DrawPage('" + oMenu[sLabel] + "')\">" + Lang(sLabel) + "</span>"); } } return ("<div id=\"submenu\">" + aMenu.join(" | ") + "</div>"); } function SumParts(oStats, sField, iRow) { var iSum = 0; for (iIndex in aParts) if (aParts[iIndex].active && (oStats[iIndex] != null) && oStats[iIndex].aData[iRow]) iSum += parseInt(oStats[iIndex].aData[iRow][sField]); return iSum; } function MergeParts_Country() { // merge helper function mergePart(oSum, oPart) { function mergeContinent(oSum, oPart) { // merge totals oSum.iTotalPages += oPart.iTotalPages; oSum.iTotalHits += oPart.iTotalHits; oSum.iTotalBW += oPart.iTotalBW; } // merge totals oSum.iTotalPages += oPart.iTotalPages; oSum.iTotalHits += oPart.iTotalHits; oSum.iTotalBW += oPart.iTotalBW; // merge data for (iRow in oPart.aData) { var found = false; for (jRow in oSum.aData) if (oPart.aData[iRow].sCountryCode == oSum.aData[jRow].sCountryCode) { oSum.aData[jRow].iPages += oPart.aData[iRow].iPages; oSum.aData[jRow].iHits += oPart.aData[iRow].iHits; oSum.aData[jRow].iBW += oPart.aData[iRow].iBW; found = true; break; } if (!found) oSum.aData.push(oPart.aData[iRow]); } mergeContinent(oSum.oContinent["Africa"], oPart.oContinent["Africa"]); mergeContinent(oSum.oContinent["Antartica"], oPart.oContinent["Antartica"]); mergeContinent(oSum.oContinent["Asia"], oPart.oContinent["Asia"]); mergeContinent(oSum.oContinent["Europe"], oPart.oContinent["Europe"]); mergeContinent(oSum.oContinent["North America"], oPart.oContinent["North America"]); mergeContinent(oSum.oContinent["Oceania"], oPart.oContinent["Oceania"]); mergeContinent(oSum.oContinent["Other"], oPart.oContinent["Other"]); mergeContinent(oSum.oContinent["South America"], oPart.oContinent["South America"]); } var foundFirst = false; var oCountry = aStatistics["country"]; for (iIndex in aParts) if (aParts[iIndex].active) if (!foundFirst) { // use first active part as base // deep copy oCountry[aParts.length + 1] = $.evalJSON($.toJSON(oCountry[iIndex])); foundFirst = true; } else mergePart(oCountry[aParts.length + 1], oCountry[iIndex]); // Sort oCountry[aParts.length + 1].aData.sort(Sort_Pages); } // Getting Data From Server: function PopulateData_Country(sPage) { $("#loading").show(); aStatistics[sPage.split(".")[0]] = []; GetPart_Country(sPage, aParts[0]); } function AddPart_Country(oData, sPage) { iCount = aStatistics[sPage.split(".")[0]].push(oData); if (iCount < aParts.length) { GetPart_Country(sPage, aParts[iCount]); } else { $("#loading").hide(); DrawPage(sPage); } } function GetPart_Country(sPage, oPart) { // create data objects var oC = {"bPopulated": false, "iTotalPages": 0, "iTotalHits": 0, "iTotalBW": 0, "aData": []}; oC.oContinent = {"Africa": {}, "Antartica": {}, "Asia": {}, "Europe": {}, "North America": {}, "Oceania": {}, "South America": {}, "Other": {}}; for (var sContinent in oC.oContinent) { oC.oContinent[sContinent] = {"iTotalPages": 0, "iTotalHits": 0, "iTotalBW": 0}; } $.ajax({ type: "GET", url: XMLURL("DOMAIN", oPart.name), success: function(oXML) { CheckLastUpdate(oXML); $(oXML).find('item').each(function() { // collect values var sCountryCode = $(this).attr("id"); var sCountryName = gc_aCountryName[sCountryCode]; if (typeof gc_aCountryName[sCountryCode] == "undefined") { sCountryName = ("Unknown (code: " + sCountryCode.toUpperCase() + ")"); } var sContinent = gc_aCountryContinent[sCountryCode]; if (typeof gc_aContinents[sContinent] == "undefined") { sContinent = "Other"; } var iPages = parseInt($(this).attr("pages")); var iHits = parseInt($(this).attr("hits")); var iBW = parseInt($(this).attr("bw")); // increment totals oC.iTotalPages += iPages; oC.iTotalHits += iHits; oC.iTotalBW += iBW; oC.oContinent[sContinent].iTotalPages += iPages; oC.oContinent[sContinent].iTotalHits += iHits; oC.oContinent[sContinent].iTotalBW += iBW; // populate array oC.aData.push({"sCountryCode": sCountryCode, "sCountryName": sCountryName, "sContinent": sContinent, "iPages": iPages, "iHits": iHits, "iBW": iBW}); }); // apply data oC.aData.sort(Sort_Pages); AddPart_Country(oC, sPage); } }); } // Other functions: get week number thanks to http://www.quirksmode.org/js/week.html function getWeekNr(dtTempDate) { Year = takeYear(dtTempDate); Month = dtTempDate.getMonth(); Day = dtTempDate.getDate(); now = Date.UTC(Year, Month, Day + 1, 0, 0, 0); var Firstday = new Date(); Firstday.setYear(Year); Firstday.setMonth(0); Firstday.setDate(1); then = Date.UTC(Year, 0, 1, 0, 0, 0); var Compensation = Firstday.getDay(); if (Compensation > 3) Compensation -= 4; else Compensation += 3; NumberOfWeek = Math.round((((now - then) / 86400000) + Compensation) / 7); // my alteration to make monday-sunday calendar // if (dtTempDate.getDay() == 0) { // NumberOfWeek--; //} // end return NumberOfWeek; } function takeYear(dtTempDate) { x = dtTempDate.getYear(); var y = x % 100; y += (y < 38) ? 2000 : 1900; return y; } // md5 thanks to http://www.webtoolkit.info var MD5 = function(string) { function RotateLeft(lValue, iShiftBits) { return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits)); } function AddUnsigned(lX, lY) { var lX4, lY4, lX8, lY8, lResult; lX8 = (lX & 0x80000000); lY8 = (lY & 0x80000000); lX4 = (lX & 0x40000000); lY4 = (lY & 0x40000000); lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF); if (lX4 & lY4) { return (lResult ^ 0x80000000 ^ lX8 ^ lY8); } if (lX4 | lY4) { if (lResult & 0x40000000) { return (lResult ^ 0xC0000000 ^ lX8 ^ lY8); } else { return (lResult ^ 0x40000000 ^ lX8 ^ lY8); } } else { return (lResult ^ lX8 ^ lY8); } } function F(x, y, z) { return (x & y) | ((~x) & z); } function G(x, y, z) { return (x & z) | (y & (~z)); } function H(x, y, z) { return (x ^ y ^ z); } function I(x, y, z) { return (y ^ (x | (~z))); } function FF(a, b, c, d, x, s, ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac)); return AddUnsigned(RotateLeft(a, s), b); } ; function GG(a, b, c, d, x, s, ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac)); return AddUnsigned(RotateLeft(a, s), b); } ; function HH(a, b, c, d, x, s, ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac)); return AddUnsigned(RotateLeft(a, s), b); } ; function II(a, b, c, d, x, s, ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac)); return AddUnsigned(RotateLeft(a, s), b); } ; function ConvertToWordArray(string) { var lWordCount; var lMessageLength = string.length; var lNumberOfWords_temp1 = lMessageLength + 8; var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64; var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16; var lWordArray = Array(lNumberOfWords - 1); var lBytePosition = 0; var lByteCount = 0; while (lByteCount < lMessageLength) { lWordCount = (lByteCount - (lByteCount % 4)) / 4; lBytePosition = (lByteCount % 4) * 8; lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition)); lByteCount++; } lWordCount = (lByteCount - (lByteCount % 4)) / 4; lBytePosition = (lByteCount % 4) * 8; lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition); lWordArray[lNumberOfWords - 2] = lMessageLength << 3; lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29; return lWordArray; } ; function WordToHex(lValue) { var WordToHexValue = "", WordToHexValue_temp = "", lByte, lCount; for (lCount = 0; lCount <= 3; lCount++) { lByte = (lValue >>> (lCount * 8)) & 255; WordToHexValue_temp = "0" + lByte.toString(16); WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2); } return WordToHexValue; } ; function Utf8Encode(string) { string = string.replace(/\r\n/g, "\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if ((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; } ; var x = Array(); var k, AA, BB, CC, DD, a, b, c, d; var S11 = 7, S12 = 12, S13 = 17, S14 = 22; var S21 = 5, S22 = 9, S23 = 14, S24 = 20; var S31 = 4, S32 = 11, S33 = 16, S34 = 23; var S41 = 6, S42 = 10, S43 = 15, S44 = 21; string = Utf8Encode(string); x = ConvertToWordArray(string); a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476; for (k = 0; k < x.length; k += 16) { AA = a; BB = b; CC = c; DD = d; a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478); d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756); c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB); b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE); a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF); d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A); c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613); b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501); a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8); d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF); c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1); b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE); a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122); d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193); c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E); b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821); a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562); d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340); c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51); b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA); a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D); d = GG(d, a, b, c, x[k + 10], S22, 0x2441453); c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681); b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8); a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6); d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6); c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87); b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED); a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905); d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8); c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9); b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A); a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942); d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681); c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122); b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C); a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44); d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9); c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60); b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70); a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6); d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA); c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085); b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05); a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039); d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5); c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8); b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665); a = II(a, b, c, d, x[k + 0], S41, 0xF4292244); d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97); c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7); b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039); a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3); d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92); c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D); b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1); a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F); d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0); c = II(c, d, a, b, x[k + 6], S43, 0xA3014314); b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1); a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82); d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235); c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB); b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391); a = AddUnsigned(a, AA); b = AddUnsigned(b, BB); c = AddUnsigned(c, CC); d = AddUnsigned(d, DD); } var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d); return temp.toLowerCase(); } // random stuff... function DateSuffix(iDate) { switch (iDate) { case 1: case 21: case 31: return "st"; case 2: case 22: return "nd"; case 3: case 23: return "rd"; default: return "th"; } } function NumberFormat(vValue, iDecimalPlaces) { if (typeof iDecimalPlaces != "undefined") { vValue = vValue.toFixed(iDecimalPlaces); } var oRegEx = /(\d{3})(?=\d)/g; var aDigits = vValue.toString().split("."); if (aDigits[0] >= 1000) { aDigits[0] = aDigits[0].split("").reverse().join("").replace(oRegEx, "$1,").split("").reverse().join(""); } return aDigits.join("."); } function StripLeadingZeroes(sString) { while (sString.substr(0, 1) == "0") { sString = sString.substr(1); } return sString; } $.tablesorter.addParser({ id: "commaNumber", is: function(s) { return false; }, format: function(s) { s = s.replace(/\,/g, ""); return s; }, type: "numeric" });
webino/JAWStats
js/jawstats.js
JavaScript
mit
25,586
# Bulma Changelog ## 0.6.1 ### New features * 🎉 [List of buttons](https://bulma.io/documentation/elements/button/#list-of-buttons) * 🎉 #1235 Support for five column grid: `.is-one-fifth, .is-two-fifths, .is-three-fifths, .is-four-fifths` * 🎉 #1287 New `.is-invisible` helper * 🎉 #1255 New `.is-expanded` modifier for `navbar-item` * 🎉 #1384 New `.is-centered` and `.is-right` modifiers for `tags` * 🎉 #1383 New `.is-empty` modifier for `file` * 🎉 #1380 Allow `.is-selected` class on `<td>` and `<th>` tags ### Improvements * #987 Improve `tag > icon` spacing * Improve `hamburger` alignment ### Bug fixes * #1358 Fix indentation bug for .is-one-fifth * #1356 SASS 3.5+ variable parsing compatibility allows only #{} * #1342 Remove black line from progress bar in IE * #1334 Fix progress bar colors in IE * #1313 Fix Table `is-selected` and `is-hoverable` styling issue * #963 Fix Delete Button Bug in iOS Safari ## 0.6.0 ### Breaking changes * The new `$link` color is part of the `$colors` map. As a result, `.button.is-link` is a colored button now. Use `.button.is-text` if you want the underlined button. * The deprecated `variables.sass` file has been removed. * The deprecated `nav.sass` file has been removed. ### New features * #1236 `.table` hover effect is opt-in, by using the `.is-hoverable` modifier class * #1254 `.dropdown` now supports `.is-up` modifier ### Improvements * #1257 Include placeholder mixin in `=input` The `$link` color is used instead of `$primary` in the following components: <table> <tr> <th>Variable</th> <th>Old value</th> <th>New value</th> </tr> <tr> <td><code>$dropdown-item-active-color</code></td> <td><code>$primary-invert</code></td> <td><code>$link-invert</code></td> </tr> <tr> <td><code>$dropdown-item-active-background-color</code></td> <td><code>$primary</code></td> <td><code>$link</code></td> </tr> <tr> <td><code>$navbar-tab-hover-border-bottom-color</code></td> <td><code>$primary</code></td> <td><code>$link</code></td> </tr> <tr> <td><code>$navbar-tab-active-color</code></td> <td><code>$primary</code></td> <td><code>$link</code></td> </tr> <tr> <td><code>$navbar-tab-active-border-bottom-color</code></td> <td><code>$primary</code></td> <td><code>$link</code></td> </tr> <tr> <td><code>$navbar-dropdown-item-active-color</code></td> <td><code>$primary</code></td> <td><code>$link</code></td> </tr> <tr> <td><code>$tabs-link-active-border-bottom-color</code></td> <td><code>$primary</code></td> <td><code>$link</code></td> </tr> <tr> <td><code>$tabs-link-active-color</code></td> <td><code>$primary</code></td> <td><code>$link</code></td> </tr> <tr> <td><code>$tabs-toggle-link-active-background-color</code></td> <td><code>$primary</code></td> <td><code>$link</code></td> </tr> <tr> <td><code>$tabs-toggle-link-active-border-color</code></td> <td><code>$primary</code></td> <td><code>$link</code></td> </tr> <tr> <td><code>$tabs-toggle-link-active-color</code></td> <td><code>$primary-invert</code></td> <td><code>$link-invert</code></td> </tr> </table> ### Issues closed * #708 Import variables in mixins ## 0.5.3 ### New features * #1101 `.card-header-title` can be centered with `.is-centered` * #1189 `.input` readonly and `.is-static` * #1189 `.textarea` readonly ### Issues closed * #1177 Fix `.message .tag` combination * #1167 Fix `pre code` * #1207 Fix `.breadcrumb` alignment ## 0.5.2 ### New features * #842 `navbar` color modifiers * #331 Support for third party icons * Added `$button-focus-box-shadow-size` and `$button-focus-box-shadow-color` for customization * Added `$input-focus-box-shadow-size` and `$input-focus-box-shadow-color` for customization * Navbar tabs ### Issues closed * #1168 Undefined variable: `$navbar-item` * #930 Remove `vertical-align: top` for icons * #735 Font awesome custom `font-size` * #395 Font awesome stacked icons * #1152 Level-items not centered horizontally on mobile * #1147 Add `text-size-adjust: 100%` to `html` * #1106 `pagination` docs * #1063 `$family-primary` customization ## 0.5.1 ### New features * 🎉 #280 [File upload element](https://bulma.io/documentation/form/file/) * `$container-offset` variable to determine the `.container` breakpoints * #1001 Text case helpers ### Issues closed * #1030 Add `!important` to non responsive display helpers * #1020 Customizing `.navbar-item img` max height * #998 `.navbar-dropdown` with **right** alignment * #877 `.pagination` isn't using `$pagination-background` * #989 `navbar-brand` overflowing on mobile * #975 Variable `$table-head-color` isn't used * #964 Tabs sass file throwing error with `!important` * #949 `.is-size-7` helper is missing ## 0.5.0 ### New features * 🎉 [List of tags](https://bulma.io/documentation/elements/tag/#list-of-tags) * New **variable naming system**: `component`-`subcomponent`-`state`-`property` * Improved **customization** thanks to new set of variables * #934 New `.is-shadowless` helper Variable name changes (mostly appending `-color`): <table> <tr><th>From</th><th>To</th></tr> <tr><td><code>$card</code></td><td><code>$card-color</code></td></tr> <tr><td><code>$card-background</code></td><td><code>$card-background-color</code></td></tr> <tr><td><code>$card-header</code></td><td><code>$card-header-color</code></td></tr> <tr><td><code>$dropdown-item</code></td><td><code>$dropdown-item-color</code></td></tr> <tr><td><code>$dropdown-content-background</code></td><td><code>$dropdown-content-background-color</code></td></tr> <tr><td><code>$dropdown-item-hover-background</code></td><td><code>$dropdown-item-hover-background-color</code></td></tr> <tr><td><code>$dropdown-item-hover</code></td><td><code>$dropdown-item-hover-color</code></td></tr> <tr><td><code>$dropdown-item-active-background</code></td><td><code>$dropdown-item-active-background-color</code></td></tr> <tr><td><code>$dropdown-item-active</code></td><td><code>$dropdown-item-active-color</code></td></tr> <tr><td><code>$dropdown-divider-background</code></td><td><code>$dropdown-divider-background-color</code></td></tr> <tr><td><code>$menu-item</code></td><td><code>$menu-item-color</code></td></tr> <tr><td><code>$menu-item-hover</code></td><td><code>$menu-item-hover-color</code></td></tr> <tr><td><code>$menu-item-hover-background</code></td><td><code>$menu-item-hover-background-color</code></td></tr> <tr><td><code>$menu-item-active</code></td><td><code>$menu-item-active-color</code></td></tr> <tr><td><code>$menu-item-active-background</code></td><td><code>$menu-item-active-background-color</code></td></tr> <tr><td><code>$menu-label</code></td><td><code>$menu-label-color</code></td></tr> <tr><td><code>$message-background</code></td><td><code>$message-background-color</code></td></tr> <tr><td><code>$message-header-background</code></td><td><code>$message-header-background-color</code></td></tr> <tr><td><code>$navbar-background</code></td><td><code>$navbar-background-color</code></td></tr> <tr><td><code>$navbar-item</code></td><td><code>$navbar-item-color</code></td></tr> <tr><td><code>$navbar-item-hover</code></td><td><code>$navbar-item-hover-color</code></td></tr> <tr><td><code>$navbar-item-hover-background</code></td><td><code>$navbar-item-hover-background-color</code></td></tr> <tr><td><code>$navbar-item-active</code></td><td><code>$navbar-item-active-color</code></td></tr> <tr><td><code>$navbar-item-active-background</code></td><td><code>$navbar-item-active-background-color</code></td></tr> <tr><td><code>$navbar-tab-hover-background</code></td><td><code>$navbar-tab-hover-background-color</code></td></tr> <tr><td><code>$navbar-tab-hover-border-bottom</code></td><td><code>$navbar-tab-hover-border-bottom-color</code></td></tr> <tr><td><code>$navbar-tab-active</code></td><td><code>$navbar-tab-active-color</code></td></tr> <tr><td><code>$navbar-tab-active-background</code></td><td><code>$navbar-tab-active-background-color</code></td></tr> <tr><td><code>$navbar-divider-background</code></td><td><code>$navbar-divider-background-color</code></td></tr> <tr><td><code>$navbar-dropdown-item-hover</code></td><td><code>$navbar-dropdown-item-hover-color</code></td></tr> <tr><td><code>$navbar-dropdown-item-hover-background</code></td><td><code>$navbar-dropdown-item-hover-background-color</code></td></tr> <tr><td><code>$navbar-dropdown-item-active</code></td><td><code>$navbar-dropdown-item-active-color</code></td></tr> <tr><td><code>$navbar-dropdown-item-active-background</code></td><td><code>$navbar-dropdown-item-active-background-color</code></td></tr> <tr><td><code>$pagination</code></td><td><code>$pagination-color</code></td></tr> <tr><td><code>$pagination-hover</code></td><td><code>$pagination-hover-color</code></td></tr> <tr><td><code>$pagination-hover-border</code></td><td><code>$pagination-hover-border-color</code></td></tr> <tr><td><code>$pagination-focus</code></td><td><code>$pagination-focus-color</code></td></tr> <tr><td><code>$pagination-focus-border</code></td><td><code>$pagination-focus-border-color</code></td></tr> <tr><td><code>$pagination-active</code></td><td><code>$pagination-active-color</code></td></tr> <tr><td><code>$pagination-active-border</code></td><td><code>$pagination-active-border-color</code></td></tr> <tr><td><code>$pagination-disabled</code></td><td><code>$pagination-disabled-color</code></td></tr> <tr><td><code>$pagination-disabled-background</code></td><td><code>$pagination-disabled-background-color</code></td></tr> <tr><td><code>$pagination-disabled-border</code></td><td><code>$pagination-disabled-border-color</code></td></tr> <tr><td><code>$pagination-current</code></td><td><code>$pagination-current-color</code></td></tr> <tr><td><code>$pagination-current-background</code></td><td><code>$pagination-current-background-color</code></td></tr> <tr><td><code>$pagination-current-border</code></td><td><code>$pagination-current-border-color</code></td></tr> <tr><td><code>$pagination-ellipsis</code></td><td><code>$pagination-ellipsis-color</code></td></tr> <tr><td><code>$box</code></td><td><code>$box-color</code></td></tr> <tr><td><code>$box-background</code></td><td><code>$box-background-color</code></td></tr> <tr><td><code>$button</code></td><td><code>$button-color</code></td></tr> <tr><td><code>$button-background</code></td><td><code>$button-background-color</code></td></tr> <tr><td><code>$button-border</code></td><td><code>$button-border-color</code></td></tr> <tr><td><code>$button-link</code></td><td><code>$button-link-color</code></td></tr> <tr><td><code>$button-link-hover-background</code></td><td><code>$button-link-hover-background-color</code></td></tr> <tr><td><code>$button-link-hover</code></td><td><code>$button-link-hover-color</code></td></tr> <tr><td><code>$button-disabled-background</code></td><td><code>$button-disabled-background-color</code></td></tr> <tr><td><code>$button-disabled-border</code></td><td><code>$button-disabled-border-color</code></td></tr> <tr><td><code>$button-static</code></td><td><code>$button-static-color</code></td></tr> <tr><td><code>$button-static-background</code></td><td><code>$button-static-background-color</code></td></tr> <tr><td><code>$button-static-border</code></td><td><code>$button-static-border-color</code></td></tr> <tr><td><code>$input</code></td><td><code>$input-color</code></td></tr> <tr><td><code>$input-background</code></td><td><code>$input-background-color</code></td></tr> <tr><td><code>$input-border</code></td><td><code>$input-border-color</code></td></tr> <tr><td><code>$input-hover</code></td><td><code>$input-hover-color</code></td></tr> <tr><td><code>$input-hover-border</code></td><td><code>$input-hover-border-color</code></td></tr> <tr><td><code>$input-focus</code></td><td><code>$input-focus-color</code></td></tr> <tr><td><code>$input-focus-border</code></td><td><code>$input-focus-border-color</code></td></tr> <tr><td><code>$input-disabled</code></td><td><code>$input-disabled-color</code></td></tr> <tr><td><code>$input-disabled-background</code></td><td><code>$input-disabled-background-color</code></td></tr> <tr><td><code>$input-disabled-border</code></td><td><code>$input-disabled-border-color</code></td></tr> <tr><td><code>$input-icon</code></td><td><code>$input-icon-color</code></td></tr> <tr><td><code>$input-icon-active</code></td><td><code>$input-icon-active-color</code></td></tr> <tr><td><code>$title</code></td><td><code>$title-color</code></td></tr> <tr><td><code>$subtitle</code></td><td><code>$subtitle-color</code></td></tr> <tr><td><code>$card-footer-border</code></td><td><code>$card-footer-border-top</code></td></tr> <tr><td><code>$menu-list-border</code></td><td><code>$menu-list-border-left</code></td></tr> <tr><td><code>$navbar-tab-hover-border</code></td><td><code>$navbar-tab-hover-border-bottom-color</code></td></tr> <tr><td><code>$navbar-tab-active-border</code></td><td><code>$navbar-tab-active-border-bottom</code></td></tr> <tr><td><code>$table-border</code></td><td><code>$table-cell-border</code></td></tr> <tr><td><code>$table-row-even-background</code></td><td><code>$table-striped-row-even-background-color</code></td></tr> <tr><td><code>$table-row-even-hover-background</code></td><td><code>$table-striped-row-even-hover-background-color</code></td></tr> </table> ### Improved documentation * [Starter template](https://bulma.io/documentation/overview/start/#starter-template) * [Colors page](https://bulma.io/documentation/overview/colors/) * [Typography helpers](https://bulma.io/documentation/modifiers/typography-helpers/) * **Meta** information for all elements and components * **Variables** information for most elements and components ### Issues closed * #909 `.dropdown` wrapping * #938 `.is-fullwidth` removed from docs * #900 Variable `.navbar-item` for hover+active background/color * #902 `.navbar-item` color overrides ## 0.4.4 ### New features * New [dropdown button](https://bulma.io/documentation/components/dropdown/)! * The breakpoints and `.container` **gap** can be customized with the new `$gap` variable * The `.container` has 2 new modifiers: `.is-widescreen` and `.is-fullhd` ### Issues closed * Fix #26 `.textarea` element will honors `[rows]` attribute * Fix #887 `body` scrollbar * Fix #715 `.help` class behaviour in horizontal form `is-grouped` field * Fix #842 Adding modifiers in `navbar` * Fix #841 `.container` as direct child of `.navbar` moves `.navbar-menu` below `.navbar-brand` * Fix #861 Box in hero as text and background white * Fix #852 charset and version number * Fix #856 JavaScript `.nav-burger` example * Fix #821 Notification strong color ## 0.4.3 ### New features * New navbar with dropdown support * Add new feature: Breadcrumb component (#632) @vinialbano * Add Bloomer to README.md (#787) @AlgusDark * Add responsive is-*-touch tags for .column sizes (#780) @tom-rb * Adding 'is-hidden' to helpers in docs (#798) @aheuermann * Add figure/figcaption as content element (#807) @werthen * Add <sup> and <sub> support to content (#808) @werthen * Add re-bulma and react-bulma (#809) @kulakowka * Add is-halfheight to hero (#783) @felipeas * Added a related project with Golang backend (#784) @Caiyeon ### Issues closed * Fix #827 Breadcrumb and Navbar in docs * Fix #824 Code examples broken because of `text-align: center` * Fix #820 Loading spinner resizes with controls * Fix #819 Remove `height: auto` from media elements * Fix #790 Documentation typo * Fix #814 Make use of +fullhd mixin for columns @Saboteur777 * Fix #781 Add min/max height/width to delete class size modifiers @ZackWard * Fix #391 Section docs update ## 0.4.2 * Fix #728 selected row on striped table * Fix #747 remove flex-shrink for is-expanded * Fix #702 add icons support for select dropdown * Fix #712 delete button as flexbox item * Fix #759 static button ## 0.4.1 * Fix #568 max-width container * Fix #589 notification delete * Fix #272 nav-right without nav-menu * Fix #616 hero and notification buttons * Fix #607 has-addons z-index * Feature #586 select color modifiers * Fix #537 -ms-expand * Fix #578 better `+center` mixin * Fix #565 `dl` styles * Fix #389 `pre` `margin-bottom` * Fix #484 icon alignment * Fix #506 bold nav menu * Fix #581 nav container * Fix #512 nav grouped buttons * Fix #605 container example * Fix #458 select expanded * Fix #403 separate animations * Fix #637 customize Bulma * Fix #584 loading select * Fix #571 control height * Fix #634 is-grouped control * Fix #676 checkbox/radio wrapping * Feature #479 has-icons placement * Fix #442 selected table row * Fix #187 add customize page * Fix #449 columns negative horizontal margin * Fix #399 pagination wrapping * Fix #227 color keys as strings ## 0.4.0 * **Default font-size is 16px** * **New `.field` element ; `.control` repurposed** * **New `.pagination` sizes** * **New `$fullhd` breakpoint (1344px)** * Remove monospace named fonts * Remove icon spacing logic * Split icon container dimensions and icon size * Fix delete button by using pixels instead of (r)em * Fix level on mobile * Add new `.is-spaced` modifier for titles and subtitles * Fix #487 * Fix #489 * Fix #502 * Fix #514 * Fix #524 * Fix #536 ## 0.3.2 * Fix #478 ## 0.3.1 * Fix #441 * Fix #443 ## 0.3.0 * Use `rem` and `em` (!) * Fix Font Awesome icons in buttons (!) * Fix message colors (!) * Use `{% capture %}` to ensure same display as code snippet (!) * Move variables to their own file * Remove small tag * Add `:focus` state * Fix table * Remove table `.is-icon` and `.is-link` * Add `.content` table * Fix inputs with icons * Input icons require the `.icon` container * Deprecate `.media-number` * Fix `.level-item` height * Fix `.menu` spacing * Deprecate `.menu-nav` * Add invert outlined buttons * Fix `.nav` * Fix `.pagination` * Fix `.tabs` * Fix `.panel` * Fix `.delete` * Add mixins documentation * Add functions documentation ## 0.2.2 * Fix: remove multiple imports ## 0.2.1 * Fix: container flex * Fix: nav-item flex * Fix: media-number flex * Fix: new brand colors ## 0.2.0 * Added: new branding * Added: modularity * Added: grid folder * Added: .github folder ## 0.1.1 * Remove `flex: 1` shorthand ## 0.1.0 * Fix #227 * Fix #232 * Fix #242 * Fix #243 * Fix #228 * Fix #245 * Fix #246 ## 0.0.28 * BREAKING: `.control.is-grouped` now uses `.control` elements as direct children * Fix #220 * Fix #214 * Fix #210 * Fix #206 * Fix #122 ## 0.0.27 * Fix: #217 * Fix: #213 * Fix: #209 * Fix: #205 * Fix: #204 * Fix: #81 ## 0.0.26 * Added: `.modal-card` * Added: display responsive utilites * Added: `.nav-center` * Added: `.tabs ul` left center right * Changed: `.navbar` renamed to `.level` * Changed: `.header` renamed to `.nav` * Deprecated: `.header` * Deprecated: `.navbar` * Fixed: `.hero` layout ## 0.0.25 * Added: `utilities/controls.sass` and `elements/form.sass` * Added: new responsive classes * Added: white/black and light/dark colors * Changed: `.tabs` need `.icon` now * Changed: cdnjs link doesn't include version ## 0.0.24 ### Added * `is-mobile` for the navbar ### Removed * removed border between sections. Use `<hr class="is-marginless">` now ### Updated * restructured files * added back `inline-flex` for controls and tags ### Removed * test tiles ## 0.0.23 ### BREAKING * `bulma` folder renamed to `sass` to avoid the redundant `bulma/bulma` path * `variables.sass` moved to `/utilities` * almost everything is singular now * **elements** only have one class * **components** have at least one sub-class * `.content` moved to elements * `.table` moved to elements * `.message` moved to components * `.table-icon`, `.table-link`, `.table-narrow` are now called `.is-icon`, `.is-link`, `.is-narrow` ### Added * all variables are now `!default` so you can set your custom variables before importing Bulma ## 0.0.22 ### Fixed * links in hero subtitle ## 0.0.21 ### Added * `.column.is-narrow` to make a column `flex: none` ## 0.0.20 ### Added * `.has-icon` support for different `.input` sizes ## 0.0.19 ### NEW!!! * `.tile` ### BREAKING * `.is-third` renamed to `.is-one-third` * `.is-quarter` renamed to `.is-one-quarter` ### Added * `.is-two-thirds` * `.is-three-quarters` ### Changed * `.delete` in `.tag` has no red ## 0.0.18 ### BREAKING * `.is-text-*` renamed to `.has-text-*` * removed `.is-fullwidth` helper ### Added * **small tag**: `.tag.is-small` * 12th column classes * `*-full` column classes * `$family-code` ### Fixed * disabled input with element * `.table` last row with `th` * `.card` color in `.hero` * `.columns.is-gapless` ### Removed * removed `box-shadow` from `.tag` * custom checkboxes and radio buttons ### Updated * `.tag` uses `display: inline-flex` now ## 0.0.17 ### Added * **pagination**: `.pagination` * **horizontal forms**: `.control.is-horizontal` * **help** text for form controls: `.help` * **progress bars**: `.progress` ### Updated * `.button` uses `display: inline-flex` now * `.button` needs an `.icon` now * `.control.is-grouped` renamed to `.control.has-addons` * `.control.is-inline` renamed to `.control.is-grouped` ### Removed * **helpers** `.is-inline` and `.is-block`
Akkowicz/webdev-assignments
node_modules/bulma/CHANGELOG.md
Markdown
mit
21,287
const request = require('request-promise') const config = require('../tool/config.js') const api = require('../tool/api.js') const error = require('../tool/error.js') const Const = require('../tool/const.js') const exp = { URL : '/authenticate', ACTION : (req, res) => { try { const params = req.body if (!params || !params.login || !params.password) { error.fn401(res, 'incorrect params') return } options = { method: 'POST', uri: api.getUrl(exp.URL), form: { login: params.login, password: params.password }, headers: { 'User-Agent': 'Request-Promise', }, json: true } request(options) .then((data) => { res.json({ success : true, token : data.token, user : data.user }) }) .catch((err) => { if (err.statusCode == 401) error.fn401(res, 'Authentication failed') else error.fn500(res, err) }) } catch(ex) { error.fn500(res, ex) } } } module.exports = exp
mignonat/healer
src/server/controller/authentication.js
JavaScript
mit
1,452
namespace Mapbox.IO.Compression { using System.Diagnostics; using System; // This class decodes GZip header and footer information. // See RFC 1952 for details about the format. internal class GZipDecoder : IFileFormatReader { private GzipHeaderState gzipHeaderSubstate; private GzipHeaderState gzipFooterSubstate; private int gzip_header_flag; private int gzip_header_xlen; private uint expectedCrc32; private uint expectedOutputStreamSizeModulo; private int loopCounter; private uint actualCrc32; private long actualStreamSizeModulo; public GZipDecoder() { Reset(); } public void Reset() { gzipHeaderSubstate = GzipHeaderState.ReadingID1; gzipFooterSubstate = GzipHeaderState.ReadingCRC; expectedCrc32 = 0; expectedOutputStreamSizeModulo = 0; } public bool ReadHeader(InputBuffer input) { while (true) { int bits; switch (gzipHeaderSubstate) { case GzipHeaderState.ReadingID1: bits = input.GetBits(8); if (bits < 0) { return false; } if (bits != GZipConstants.ID1) { throw new InvalidDataException(SR.GetString(SR.CorruptedGZipHeader)); } gzipHeaderSubstate = GzipHeaderState.ReadingID2; goto case GzipHeaderState.ReadingID2; case GzipHeaderState.ReadingID2: bits = input.GetBits(8); if (bits < 0) { return false; } if (bits != GZipConstants.ID2) { throw new InvalidDataException(SR.GetString(SR.CorruptedGZipHeader)); } gzipHeaderSubstate = GzipHeaderState.ReadingCM; goto case GzipHeaderState.ReadingCM; case GzipHeaderState.ReadingCM: bits = input.GetBits(8); if (bits < 0) { return false; } if (bits != GZipConstants.Deflate) { // compression mode must be 8 (deflate) throw new InvalidDataException(SR.GetString(SR.UnknownCompressionMode)); } gzipHeaderSubstate = GzipHeaderState.ReadingFLG; ; goto case GzipHeaderState.ReadingFLG; case GzipHeaderState.ReadingFLG: bits = input.GetBits(8); if (bits < 0) { return false; } gzip_header_flag = bits; gzipHeaderSubstate = GzipHeaderState.ReadingMMTime; loopCounter = 0; // 4 MMTIME bytes goto case GzipHeaderState.ReadingMMTime; case GzipHeaderState.ReadingMMTime: bits = 0; while (loopCounter < 4) { bits = input.GetBits(8); if (bits < 0) { return false; } loopCounter++; } gzipHeaderSubstate = GzipHeaderState.ReadingXFL; loopCounter = 0; goto case GzipHeaderState.ReadingXFL; case GzipHeaderState.ReadingXFL: // ignore XFL bits = input.GetBits(8); if (bits < 0) { return false; } gzipHeaderSubstate = GzipHeaderState.ReadingOS; goto case GzipHeaderState.ReadingOS; case GzipHeaderState.ReadingOS: // ignore OS bits = input.GetBits(8); if (bits < 0) { return false; } gzipHeaderSubstate = GzipHeaderState.ReadingXLen1; goto case GzipHeaderState.ReadingXLen1; case GzipHeaderState.ReadingXLen1: if ((gzip_header_flag & (int)GZipOptionalHeaderFlags.ExtraFieldsFlag) == 0) { goto case GzipHeaderState.ReadingFileName; } bits = input.GetBits(8); if (bits < 0) { return false; } gzip_header_xlen = bits; gzipHeaderSubstate = GzipHeaderState.ReadingXLen2; goto case GzipHeaderState.ReadingXLen2; case GzipHeaderState.ReadingXLen2: bits = input.GetBits(8); if (bits < 0) { return false; } gzip_header_xlen |= (bits << 8); gzipHeaderSubstate = GzipHeaderState.ReadingXLenData; loopCounter = 0; // 0 bytes of XLEN data read so far goto case GzipHeaderState.ReadingXLenData; case GzipHeaderState.ReadingXLenData: bits = 0; while (loopCounter < gzip_header_xlen) { bits = input.GetBits(8); if (bits < 0) { return false; } loopCounter++; } gzipHeaderSubstate = GzipHeaderState.ReadingFileName; loopCounter = 0; goto case GzipHeaderState.ReadingFileName; case GzipHeaderState.ReadingFileName: if ((gzip_header_flag & (int)GZipOptionalHeaderFlags.FileNameFlag) == 0) { gzipHeaderSubstate = GzipHeaderState.ReadingComment; goto case GzipHeaderState.ReadingComment; } do { bits = input.GetBits(8); if (bits < 0) { return false; } if (bits == 0) { // see '\0' in the file name string break; } } while (true); gzipHeaderSubstate = GzipHeaderState.ReadingComment; goto case GzipHeaderState.ReadingComment; case GzipHeaderState.ReadingComment: if ((gzip_header_flag & (int)GZipOptionalHeaderFlags.CommentFlag) == 0) { gzipHeaderSubstate = GzipHeaderState.ReadingCRC16Part1; goto case GzipHeaderState.ReadingCRC16Part1; } do { bits = input.GetBits(8); if (bits < 0) { return false; } if (bits == 0) { // see '\0' in the file name string break; } } while (true); gzipHeaderSubstate = GzipHeaderState.ReadingCRC16Part1; goto case GzipHeaderState.ReadingCRC16Part1; case GzipHeaderState.ReadingCRC16Part1: if ((gzip_header_flag & (int)GZipOptionalHeaderFlags.CRCFlag) == 0) { gzipHeaderSubstate = GzipHeaderState.Done; goto case GzipHeaderState.Done; } bits = input.GetBits(8); // ignore crc if (bits < 0) { return false; } gzipHeaderSubstate = GzipHeaderState.ReadingCRC16Part2; goto case GzipHeaderState.ReadingCRC16Part2; case GzipHeaderState.ReadingCRC16Part2: bits = input.GetBits(8); // ignore crc if (bits < 0) { return false; } gzipHeaderSubstate = GzipHeaderState.Done; goto case GzipHeaderState.Done; case GzipHeaderState.Done: return true; default: Debug.Assert(false, "We should not reach unknown state!"); throw new InvalidDataException(SR.GetString(SR.UnknownState)); } } } public bool ReadFooter(InputBuffer input) { input.SkipToByteBoundary(); if (gzipFooterSubstate == GzipHeaderState.ReadingCRC) { while (loopCounter < 4) { int bits = input.GetBits(8); if (bits < 0) { return false; } expectedCrc32 |= ((uint)bits << (8 * loopCounter)); loopCounter++; } gzipFooterSubstate = GzipHeaderState.ReadingFileSize; loopCounter = 0; } if (gzipFooterSubstate == GzipHeaderState.ReadingFileSize) { if (loopCounter == 0) expectedOutputStreamSizeModulo = 0; while (loopCounter < 4) { int bits = input.GetBits(8); if (bits < 0) { return false; } expectedOutputStreamSizeModulo |= ((uint) bits << (8 * loopCounter)); loopCounter++; } } return true; } public void UpdateWithBytesRead(byte[] buffer, int offset, int copied) { actualCrc32 = Crc32Helper.UpdateCrc32(actualCrc32, buffer, offset, copied); long n = actualStreamSizeModulo + (uint) copied; if (n >= GZipConstants.FileLengthModulo) { n %= GZipConstants.FileLengthModulo; } actualStreamSizeModulo = n; } public void Validate() { if (expectedCrc32 != actualCrc32) { throw new InvalidDataException(SR.GetString(SR.InvalidCRC)); } if (actualStreamSizeModulo != expectedOutputStreamSizeModulo) { throw new InvalidDataException(SR.GetString(SR.InvalidStreamSize)); } } internal enum GzipHeaderState { // GZIP header ReadingID1, ReadingID2, ReadingCM, ReadingFLG, ReadingMMTime, // iterates 4 times ReadingXFL, ReadingOS, ReadingXLen1, ReadingXLen2, ReadingXLenData, ReadingFileName, ReadingComment, ReadingCRC16Part1, ReadingCRC16Part2, Done, // done reading GZIP header // GZIP footer ReadingCRC, // iterates 4 times ReadingFileSize // iterates 4 times } [Flags] internal enum GZipOptionalHeaderFlags { CRCFlag = 2, ExtraFieldsFlag = 4, FileNameFlag = 8, CommentFlag = 16 } } }
binakot/Fleet-And-Staff-Location-Visualizer
FleetAndStaffLocationVisualizer/Assets/Mapbox/Core/Plugins/ThirdParty/Mapbox.IO.Compression/GZipDecoder.cs
C#
mit
11,973
@charset "UTF-8"; /** * reveal.js * http://lab.hakim.se/reveal-js * MIT licensed * * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se */ /********************************************* * RESET STYLES *********************************************/ html, body, .reveal div, .reveal span, .reveal applet, .reveal object, .reveal iframe, .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6, .reveal p, .reveal blockquote, .reveal pre, .reveal a, .reveal abbr, .reveal acronym, .reveal address, .reveal big, .reveal cite, .reveal code, .reveal del, .reveal dfn, .reveal em, .reveal img, .reveal ins, .reveal kbd, .reveal q, .reveal s, .reveal samp, .reveal small, .reveal strike, .reveal strong, .reveal sub, .reveal sup, .reveal tt, .reveal var, .reveal b, .reveal u, .reveal i, .reveal center, .reveal dl, .reveal dt, .reveal dd, .reveal ol, .reveal ul, .reveal li, .reveal fieldset, .reveal form, .reveal label, .reveal legend, .reveal table, .reveal caption, .reveal tbody, .reveal tfoot, .reveal thead, .reveal tr, .reveal th, .reveal td, .reveal article, .reveal aside, .reveal canvas, .reveal details, .reveal embed, .reveal figure, .reveal figcaption, .reveal footer, .reveal header, .reveal hgroup, .reveal menu, .reveal nav, .reveal output, .reveal ruby, .reveal section, .reveal summary, .reveal time, .reveal mark, .reveal audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } .reveal article, .reveal aside, .reveal details, .reveal figcaption, .reveal figure, .reveal footer, .reveal header, .reveal hgroup, .reveal menu, .reveal nav, .reveal section { display: block; } /********************************************* * GLOBAL STYLES *********************************************/ html, body { width: 100%; height: 100%; min-height: 600px; overflow: hidden; } body { position: relative; line-height: 1; } ::selection { background:#FF5E99; color:#fff; text-shadow: none; } @media screen and (max-width: 900px) { .reveal { font-size: 30px; } } /********************************************* * HEADERS *********************************************/ .reveal h1 { font-size: 3.77em; } .reveal h2 { font-size: 2.11em; } .reveal h3 { font-size: 1.55em; } .reveal h4 { font-size: 1em; } /********************************************* * VIEW FRAGMENTS *********************************************/ .reveal .slides section .fragment { opacity: 0; -webkit-transition: all .2s ease; -moz-transition: all .2s ease; -ms-transition: all .2s ease; -o-transition: all .2s ease; transition: all .2s ease; } .reveal .slides section .fragment.visible { opacity: 1; } /********************************************* * DEFAULT ELEMENT STYLES *********************************************/ .reveal .slides section { line-height: 1.2em; font-weight: normal; } .reveal img { /* preserve aspect ratio and scale image so it's bound within the section */ max-width: 100%; max-height: 100%; } .reveal strong, .reveal b { font-weight: bold; } .reveal em, .reveal i { font-style: italic; } .reveal ol, .reveal ul { display: inline-block; text-align: left; margin: 0 0 0 1em; } .reveal ol { list-style-type: decimal; } .reveal ul { list-style-type: disc; } .reveal ul ul { list-style-type: square; } .reveal ul ul ul { list-style-type: circle; } .reveal ul ul, .reveal ul ol, .reveal ol ol, .reveal ol ul { display: block; margin-left: 40px; } .reveal p { margin-bottom: 10px; line-height: 1.2em; } .reveal q, .reveal blockquote { quotes: none; } .reveal blockquote { display: block; position: relative; width: 70%; margin: 5px auto; padding: 5px; font-style: italic; background: rgba(255, 255, 255, 0.05); box-shadow: 0px 0px 2px rgba(0,0,0,0.2); } .reveal blockquote:before { content: '“'; } .reveal blockquote:after { content: '”'; } .reveal q { font-style: italic; } .reveal q:before { content: '“'; } .reveal q:after { content: '”'; } .reveal pre { display: block; position: relative; width: 90%; margin: 10px auto; text-align: left; font-size: 0.55em; font-family: monospace; line-height: 1.2em; word-wrap: break-word; box-shadow: 0px 0px 6px rgba(0,0,0,0.3); } .reveal code { font-family: monospace; overflow: auto; max-height: 400px; } .reveal table th, .reveal table td { text-align: left; padding-right: .3em; } .reveal table th { text-shadow: rgb(255,255,255) 1px 1px 2px; } .reveal sup { vertical-align: super; } .reveal sub { vertical-align: sub; } .reveal small { display: inline-block; font-size: 0.6em; line-height: 1.2em; vertical-align: top; } .reveal small * { vertical-align: top; } /********************************************* * CONTROLS *********************************************/ .reveal .controls { display: none; position: fixed; width: 100px; height: 100px; z-index: 30; right: 0; bottom: 0; } .reveal .controls a { font-family: Arial; font-size: 0.83em; position: absolute; opacity: 0.1; } .reveal .controls a.enabled { opacity: 0.6; } .reveal .controls a.enabled:active { margin-top: 1px; } .reveal .controls .left { top: 30px; } .reveal .controls .right { left: 60px; top: 30px; } .reveal .controls .up { left: 30px; } .reveal .controls .down { left: 30px; top: 60px; } /********************************************* * PROGRESS BAR *********************************************/ .reveal .progress { position: fixed; display: none; height: 3px; width: 100%; bottom: 0; left: 0; } .reveal .progress span { display: block; height: 100%; width: 0px; -webkit-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); -moz-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); -ms-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); -o-transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); } /********************************************* * ROLLING LINKS *********************************************/ .reveal .roll { display: inline-block; line-height: 1.2; overflow: hidden; vertical-align: top; -webkit-perspective: 400px; -moz-perspective: 400px; -ms-perspective: 400px; perspective: 400px; -webkit-perspective-origin: 50% 50%; -moz-perspective-origin: 50% 50%; -ms-perspective-origin: 50% 50%; perspective-origin: 50% 50%; } .reveal .roll:hover { background: none; text-shadow: none; } .reveal .roll span { display: block; position: relative; padding: 0 2px; pointer-events: none; -webkit-transition: all 400ms ease; -moz-transition: all 400ms ease; -ms-transition: all 400ms ease; transition: all 400ms ease; -webkit-transform-origin: 50% 0%; -moz-transform-origin: 50% 0%; -ms-transform-origin: 50% 0%; transform-origin: 50% 0%; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -ms-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; backface-visibility: hidden; } .reveal .roll:hover span { background: rgba(0,0,0,0.5); -webkit-transform: translate3d( 0px, 0px, -45px ) rotateX( 90deg ); -moz-transform: translate3d( 0px, 0px, -45px ) rotateX( 90deg ); -ms-transform: translate3d( 0px, 0px, -45px ) rotateX( 90deg ); transform: translate3d( 0px, 0px, -45px ) rotateX( 90deg ); } .reveal .roll span:after { content: attr(data-title); display: block; position: absolute; left: 0; top: 0; padding: 0 2px; -webkit-transform-origin: 50% 0%; -moz-transform-origin: 50% 0%; -ms-transform-origin: 50% 0%; transform-origin: 50% 0%; -webkit-transform: translate3d( 0px, 110%, 0px ) rotateX( -90deg ); -moz-transform: translate3d( 0px, 110%, 0px ) rotateX( -90deg ); -ms-transform: translate3d( 0px, 110%, 0px ) rotateX( -90deg ); transform: translate3d( 0px, 110%, 0px ) rotateX( -90deg ); } /********************************************* * SLIDES *********************************************/ .reveal .slides { position: absolute; max-width: 900px; width: 80%; height: 60%; left: 50%; top: 50%; margin-top: -320px; padding: 20px 0px; overflow: visible; z-index: 1; text-align: center; -webkit-transition: -webkit-perspective .4s ease; -moz-transition: -moz-perspective .4s ease; -ms-transition: -ms-perspective .4s ease; -o-transition: -o-perspective .4s ease; transition: perspective .4s ease; -webkit-perspective: 600px; -moz-perspective: 600px; -ms-perspective: 600px; perspective: 600px; -webkit-perspective-origin: 0% 25%; -moz-perspective-origin: 0% 25%; -ms-perspective-origin: 0% 25%; perspective-origin: 0% 25%; } .reveal .slides>section, .reveal .slides>section>section { display: none; position: absolute; width: 100%; min-height: 600px; z-index: 10; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -ms-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); -moz-transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); -ms-transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); -o-transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); transition: all 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985); } .reveal .slides>section.present { display: block; z-index: 11; opacity: 1; } .reveal .slides>section { margin-left: -50%; } /********************************************* * DEFAULT TRANSITION *********************************************/ .reveal .slides>section.past { display: block; opacity: 0; -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); -moz-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); -ms-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); } .reveal .slides>section.future { display: block; opacity: 0; -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); -moz-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); -ms-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); } .reveal .slides>section>section.past { display: block; opacity: 0; -webkit-transform: translate3d(0, -50%, 0) rotateX(70deg) translate3d(0, -50%, 0); -moz-transform: translate3d(0, -50%, 0) rotateX(70deg) translate3d(0, -50%, 0); -ms-transform: translate3d(0, -50%, 0) rotateX(70deg) translate3d(0, -50%, 0); transform: translate3d(0, -50%, 0) rotateX(70deg) translate3d(0, -50%, 0); } .reveal .slides>section>section.future { display: block; opacity: 0; -webkit-transform: translate3d(0, 50%, 0) rotateX(-70deg) translate3d(0, 50%, 0); -moz-transform: translate3d(0, 50%, 0) rotateX(-70deg) translate3d(0, 50%, 0); -ms-transform: translate3d(0, 50%, 0) rotateX(-70deg) translate3d(0, 50%, 0); transform: translate3d(0, 50%, 0) rotateX(-70deg) translate3d(0, 50%, 0); } /********************************************* * CONCAVE TRANSITION *********************************************/ .reveal.concave .slides>section.past { -webkit-transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); -moz-transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); -ms-transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); } .reveal.concave .slides>section.future { -webkit-transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); -moz-transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); -ms-transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); } .reveal.concave .slides>section>section.past { -webkit-transform: translate3d(0, -80%, 0) rotateX(-70deg) translate3d(0, -80%, 0); -moz-transform: translate3d(0, -80%, 0) rotateX(-70deg) translate3d(0, -80%, 0); -ms-transform: translate3d(0, -80%, 0) rotateX(-70deg) translate3d(0, -80%, 0); transform: translate3d(0, -80%, 0) rotateX(-70deg) translate3d(0, -80%, 0); } .reveal.concave .slides>section>section.future { -webkit-transform: translate3d(0, 80%, 0) rotateX(70deg) translate3d(0, 80%, 0); -moz-transform: translate3d(0, 80%, 0) rotateX(70deg) translate3d(0, 80%, 0); -ms-transform: translate3d(0, 80%, 0) rotateX(70deg) translate3d(0, 80%, 0); transform: translate3d(0, 80%, 0) rotateX(70deg) translate3d(0, 80%, 0); } /********************************************* * LINEAR TRANSITION *********************************************/ .reveal.linear .slides>section.past { -webkit-transform: translate(-150%, 0); -moz-transform: translate(-150%, 0); -ms-transform: translate(-150%, 0); -o-transform: translate(-150%, 0); transform: translate(-150%, 0); } .reveal.linear .slides>section.future { -webkit-transform: translate(150%, 0); -moz-transform: translate(150%, 0); -ms-transform: translate(150%, 0); -o-transform: translate(150%, 0); transform: translate(150%, 0); } .reveal.linear .slides>section>section.past { -webkit-transform: translate(0, -150%); -moz-transform: translate(0, -150%); -ms-transform: translate(0, -150%); -o-transform: translate(0, -150%); transform: translate(0, -150%); } .reveal.linear .slides>section>section.future { -webkit-transform: translate(0, 150%); -moz-transform: translate(0, 150%); -ms-transform: translate(0, 150%); -o-transform: translate(0, 150%); transform: translate(0, 150%); } /********************************************* * CUBE TRANSITION *********************************************/ .reveal.cube .slides { margin-top: -350px; -webkit-perspective-origin: 50% 25%; -moz-perspective-origin: 50% 25%; -ms-perspective-origin: 50% 25%; perspective-origin: 50% 25%; -webkit-perspective: 1300px; -moz-perspective: 1300px; -ms-perspective: 1300px; perspective: 1300px; } .reveal.cube .slides section { padding: 30px; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -ms-backface-visibility: hidden; backface-visibility: hidden; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .reveal.cube .slides section:not(.stack):before { content: ''; position: absolute; display: block; width: 100%; height: 100%; left: 0; top: 0; background: #232628; border-radius: 4px; -webkit-transform: translateZ( -20px ); -moz-transform: translateZ( -20px ); -ms-transform: translateZ( -20px ); -o-transform: translateZ( -20px ); transform: translateZ( -20px ); } .reveal.cube .slides section:not(.stack):after { content: ''; position: absolute; display: block; width: 90%; height: 30px; left: 5%; bottom: 0; background: none; z-index: 1; border-radius: 4px; box-shadow: 0px 95px 25px rgba(0,0,0,0.2); -webkit-transform: translateZ(-90px) rotateX( 65deg ); -moz-transform: translateZ(-90px) rotateX( 65deg ); -ms-transform: translateZ(-90px) rotateX( 65deg ); -o-transform: translateZ(-90px) rotateX( 65deg ); transform: translateZ(-90px) rotateX( 65deg ); } .reveal.cube .slides>section.stack { padding: 0; background: none; } .reveal.cube .slides>section.past { -webkit-transform-origin: 100% 0%; -moz-transform-origin: 100% 0%; -ms-transform-origin: 100% 0%; transform-origin: 100% 0%; -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg); -moz-transform: translate3d(-100%, 0, 0) rotateY(-90deg); -ms-transform: translate3d(-100%, 0, 0) rotateY(-90deg); transform: translate3d(-100%, 0, 0) rotateY(-90deg); } .reveal.cube .slides>section.future { -webkit-transform-origin: 0% 0%; -moz-transform-origin: 0% 0%; -ms-transform-origin: 0% 0%; transform-origin: 0% 0%; -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg); -moz-transform: translate3d(100%, 0, 0) rotateY(90deg); -ms-transform: translate3d(100%, 0, 0) rotateY(90deg); transform: translate3d(100%, 0, 0) rotateY(90deg); } .reveal.cube .slides>section>section.past { -webkit-transform-origin: 0% 100%; -moz-transform-origin: 0% 100%; -ms-transform-origin: 0% 100%; transform-origin: 0% 100%; -webkit-transform: translate3d(0, -100%, 0) rotateX(90deg); -moz-transform: translate3d(0, -100%, 0) rotateX(90deg); -ms-transform: translate3d(0, -100%, 0) rotateX(90deg); transform: translate3d(0, -100%, 0) rotateX(90deg); } .reveal.cube .slides>section>section.future { -webkit-transform-origin: 0% 0%; -moz-transform-origin: 0% 0%; -ms-transform-origin: 0% 0%; transform-origin: 0% 0%; -webkit-transform: translate3d(0, 100%, 0) rotateX(-90deg); -moz-transform: translate3d(0, 100%, 0) rotateX(-90deg); -ms-transform: translate3d(0, 100%, 0) rotateX(-90deg); transform: translate3d(0, 100%, 0) rotateX(-90deg); } /********************************************* * PAGE TRANSITION *********************************************/ .reveal.page .slides { margin-top: -350px; -webkit-perspective-origin: 50% 50%; -moz-perspective-origin: 50% 50%; -ms-perspective-origin: 50% 50%; perspective-origin: 50% 50%; -webkit-perspective: 3000px; -moz-perspective: 3000px; -ms-perspective: 3000px; perspective: 3000px; } .reveal.page .slides section { padding: 30px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .reveal.page .slides section.past { z-index: 12; } .reveal.page .slides section:not(.stack):before { content: ''; position: absolute; display: block; width: 100%; height: 100%; left: 0; top: 0; background: rgba(0,0,0,0.2); -webkit-transform: translateZ( -20px ); -moz-transform: translateZ( -20px ); -ms-transform: translateZ( -20px ); -o-transform: translateZ( -20px ); transform: translateZ( -20px ); } .reveal.page .slides section:not(.stack):after { content: ''; position: absolute; display: block; width: 90%; height: 30px; left: 5%; bottom: 0; background: none; z-index: 1; border-radius: 4px; box-shadow: 0px 95px 25px rgba(0,0,0,0.2); -webkit-transform: translateZ(-90px) rotateX( 65deg ); } .reveal.page .slides>section.stack { padding: 0; background: none; } .reveal.page .slides>section.past { -webkit-transform-origin: 0% 0%; -moz-transform-origin: 0% 0%; -ms-transform-origin: 0% 0%; transform-origin: 0% 0%; -webkit-transform: translate3d(-40%, 0, 0) rotateY(-80deg); -moz-transform: translate3d(-40%, 0, 0) rotateY(-80deg); -ms-transform: translate3d(-40%, 0, 0) rotateY(-80deg); transform: translate3d(-40%, 0, 0) rotateY(-80deg); } .reveal.page .slides>section.future { -webkit-transform-origin: 100% 0%; -moz-transform-origin: 100% 0%; -ms-transform-origin: 100% 0%; transform-origin: 100% 0%; -webkit-transform: translate3d(0, 0, 0); -moz-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } .reveal.page .slides>section>section.past { -webkit-transform-origin: 0% 0%; -moz-transform-origin: 0% 0%; -ms-transform-origin: 0% 0%; transform-origin: 0% 0%; -webkit-transform: translate3d(0, -40%, 0) rotateX(80deg); -moz-transform: translate3d(0, -40%, 0) rotateX(80deg); -ms-transform: translate3d(0, -40%, 0) rotateX(80deg); transform: translate3d(0, -40%, 0) rotateX(80deg); } .reveal.page .slides>section>section.future { -webkit-transform-origin: 0% 100%; -moz-transform-origin: 0% 100%; -ms-transform-origin: 0% 100%; transform-origin: 0% 100%; -webkit-transform: translate3d(0, 0, 0); -moz-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } /********************************************* * TILE-FLIP TRANSITION (CSS shader) *********************************************/ .reveal.tileflip .slides section.present { -webkit-transform: none; -webkit-transition-duration: 800ms; -webkit-filter: custom( url(shaders/tile-flip.vs) mix(url(shaders/tile-flip.fs) multiply source-atop), 10 10 border-box detached, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), amount 0, randomness 0, flipAxis 0 1 0, tileOutline 1 ); } .reveal.tileflip .slides section.past { -webkit-transform: none; -webkit-transition-duration: 800ms; -webkit-filter: custom( url(shaders/tile-flip.vs) mix(url(shaders/tile-flip.fs) multiply source-atop), 10 10 border-box detached, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), amount 1, randomness 0, flipAxis 0 1 0, tileOutline 1 ); } .reveal.tileflip .slides section.future { -webkit-transform: none; -webkit-transition-duration: 800ms; -webkit-filter: custom( url(shaders/tile-flip.vs) mix(url(shaders/tile-flip.fs) multiply source-atop), 10 10 border-box detached, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), amount 1, randomness 0, flipAxis 0 1 0, tileOutline 1 ); } .reveal.tileflip .slides>section>section.present { -webkit-filter: custom( url(shaders/tile-flip.vs) mix(url(shaders/tile-flip.fs) multiply source-atop), 10 10 border-box detached, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), amount 0, randomness 2, flipAxis 1 0 0, tileOutline 1 ); } .reveal.tileflip .slides>section>section.past { -webkit-filter: custom( url(shaders/tile-flip.vs) mix(url(shaders/tile-flip.fs) multiply source-atop), 10 10 border-box detached, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), amount 1, randomness 2, flipAxis 1 0 0, tileOutline 1 ); } .reveal.tileflip .slides>section>section.future { -webkit-filter: custom( url(shaders/tile-flip.vs) mix(url(shaders/tile-flip.fs) multiply source-atop), 10 10 border-box detached, transform perspective(1000) scale(1) rotateX(0deg) rotateY(0deg) rotateZ(0deg), amount 1, randomness 2, flipAxis 1 0 0, tileOutline 1 ); } /********************************************* * NO TRANSITION *********************************************/ .reveal.none .slides section { -webkit-transform: none; -moz-transform: none; -ms-transform: none; -o-transform: none; transform: none; -webkit-transition: none; -moz-transition: none; -ms-transition: none; -o-transition: none; transition: none; } /********************************************* * OVERVIEW *********************************************/ .reveal.overview .slides { -webkit-perspective: 700px; -moz-perspective: 700px; -ms-perspective: 700px; perspective: 700px; } .reveal.overview .slides section { padding: 20px 0; max-height: 600px; overflow: hidden; opacity: 1; cursor: pointer; background: rgba(0,0,0,0.1); } .reveal.overview .slides section .fragment { opacity: 1; } .reveal.overview .slides section:after, .reveal.overview .slides section:before { display: none !important; } .reveal.overview .slides section>section { opacity: 1; cursor: pointer; } .reveal.overview .slides section:hover { background: rgba(0,0,0,0.3); } .reveal.overview .slides section.present { background: rgba(0,0,0,0.3); } .reveal.overview .slides>section.stack { background: none; padding: 0; overflow: visible; } /********************************************* * PAUSED MODE *********************************************/ .reveal .pause-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: black; visibility: hidden; opacity: 0; z-index: 100; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; -ms-transition: all 1s ease; -o-transition: all 1s ease; transition: all 1s ease; } .reveal.paused .pause-overlay { visibility: visible; opacity: 1; } /********************************************* * FALLBACK *********************************************/ .no-transforms { overflow-y: auto; } .no-transforms .slides section { display: block!important; opacity: 1!important; position: relative!important; height: auto; min-height: auto; margin-bottom: 100px; -webkit-transform: none; -moz-transform: none; -ms-transform: none; transform: none; } /********************************************* * BACKGROUND STATES *********************************************/ .reveal .state-background { position: absolute; width: 100%; height: 100%; background: rgba( 0, 0, 0, 0 ); -webkit-transition: background 800ms ease; -moz-transition: background 800ms ease; -ms-transition: background 800ms ease; -o-transition: background 800ms ease; transition: background 800ms ease; } .alert .reveal .state-background { background: rgba( 200, 50, 30, 0.6 ); } .soothe .reveal .state-background { background: rgba( 50, 200, 90, 0.4 ); } .blackout .reveal .state-background { background: rgba( 0, 0, 0, 0.6 ); } /********************************************* * SPEAKER NOTES *********************************************/ .reveal aside.notes { display: none; }
wearefractal/fullstack-javascript
css/reveal.css
CSS
mit
26,241
<?php namespace Bl2\Service\Rest; use Bl2\Model\DamageType; use Bl2\Model\Manufacturer; use Bl2\Model\Rarity; use Bl2\Model\Weapon; use Bl2\Service\AbstractRestService; use Spore\ReST\Model\Request; use Spore\ReST\Model\Response; /** * REST Service providing operations on the {@link Weapon} entity. * @package Bl2\Service\Rest */ class WeaponService extends AbstractRestService { /** * Constructor */ function __construct() { parent::__construct(); } /** * Gets all weapons. * @url /weapons/ * @verbs GET * * @param Request $request * * @return array */ public function getAll(Request $request) { return parent::getAll($request); } /** * Gets the weapon with the given id. * @url /weapons/:id/ * @verbs GET * * @param Request $request the HTTP request * * @return Weapon */ public function get(Request $request) { return parent::load($request, $request->params['id']); } /** * Creates a new weapon. * @url /weapons/ * @verbs POST * @auth admin * * @param Request $request the HTTP request. * @param Response $response the HTTP response. * * @return Weapon the created weapon */ public function add(Request $request, Response $response) { // cast stdClass to array $properties = (array)$request->data; $weapon = new Weapon($properties); // load referenced entity instances $weapon->setRarity($this->getEntityManager()->find(Rarity::entityName(), $properties["rarity"]->id)); $weapon->setManufacturer($this->getEntityManager()->find(Manufacturer::entityName(), $properties["manufacturer"]->id)); $weapon->setDamageType($this->getEntityManager()->find(DamageType::entityName(), $properties["damageType"]->id)); return $this->create($request, $response, $weapon); } /** * Updates the weapon with the given id * @url /weapons/:id/ * @verbs PUT * @auth admin * * @param Request $request the HTTP request * * @return Weapon the updated weapon */ public function update(Request $request) { $properties = (array)$request->data; $weapon = new Weapon($properties); // load referenced entity instances $weapon->setRarity($this->getEntityManager()->find(Rarity::entityName(), $properties["rarity"]->id)); $weapon->setManufacturer($this->getEntityManager()->find(Manufacturer::entityName(), $properties["manufacturer"]->id)); $weapon->setDamageType($this->getEntityManager()->find(DamageType::entityName(), $properties["damageType"]->id)); return $this->save($weapon); } /** * Removes the weapon with the given id. * @url /weapons/:id/ * @verbs DELETE * @auth admin * * @param Request $request the HTTP request * @param Response $response the HTTP response * * @return string */ public function remove(Request $request, Response $response) { return parent::remove($request, $response, $request->params['id']); } /** * HTTP OPTIONS request used for CORS. * @url /weapons(/:id)/ * @verbs OPTIONS * * @param Request $request the HTTP request */ public function options(Request $request) { parent::options($request); } /** * Gets the name of the entity on which this service is based. * @return string the name of the entity on which this service is based. */ protected function getEntityName() { return Weapon::entityName(); } }
eras0r/bl2items-backend
src/Service/Rest/WeaponService.php
PHP
mit
3,725
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateMailinglistsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { if (! Schema::hasTable('mailinglists')) { Schema::create('mailinglists', function(Blueprint $table) { $table->increments('id'); $table->string('email', 255)->unique(); $table->string('first_name', 255); $table->string('last_name', 255); $table->boolean('active')->default(true); $table->timestamps(); }); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('mailinglists'); } }
matheusgomes17/redminportal
src/database/migrations/2014_06_06_075632_create_mailinglists_table.php
PHP
mit
858
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >it_idwt</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="LIBIT Documentation" HREF="index.html"><LINK REL="UP" HREF="refmanual.html"><LINK REL="PREVIOUS" TITLE="it_dwt" HREF="man.it-dwt.html"><LINK REL="NEXT" TITLE="it_wavelet_merge" HREF="man.it-wavelet-merge.html"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >LIBIT Documentation</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="man.it-dwt.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="man.it-wavelet-merge.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="MAN.IT-IDWT" ></A >it_idwt</H1 ><DIV CLASS="REFNAMEDIV" ><A NAME="AEN20852" ></A ><H2 >Name</H2 >it_idwt&nbsp;--&nbsp;inverse discrete wavelet transform</DIV ><DIV CLASS="REFSYNOPSISDIV" ><A NAME="AEN20855" ></A ><H2 >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN20856" ></A ><PRE CLASS="FUNCSYNOPSISINFO" >#include &lt;it/wavelet.h&gt; </PRE ><P ><CODE ><CODE CLASS="FUNCDEF" >vec it_idwt</CODE >( vec t, it_wavelet_lifting_t const *lifting, int levels );</CODE ></P ><P ></P ></DIV ></DIV ><H2 >DESCRIPTION</H2 ><P > This function computes the inverse discrete wavelet transform of <CODE CLASS="PARAMETER" >vt</CODE > using the lifting steps described by <CODE CLASS="PARAMETER" >lifting</CODE >. The input vector of coefficients <CODE CLASS="PARAMETER" >vt</CODE > is the concatenation of all the coefficients in each subbands starting from the low-frequency subband. Currently the lifting steps for the usual 5/3 and 9/7 biorthogonal filters are predefined as "it_wavelet_lifting_53" and "it_wavelet_lifting_97", although you can provide your own lifting steps. </P ><H2 >RETURN VALUE</H2 ><P > The set of inverse wavelet coefficients </P ><H2 >EXAMPLE</H2 ><PRE CLASS="PROGRAMLISTING" >&#13;#include &lt;wavelet.h&gt; ... /* analyse a signal 'v' using a 5-level 9/7 wavelet decomposition */ vec vt = it_dwt(v, it_wavelet_lifting_97, 5); /* clear the high subband */ vec_set_between(vt, (vec_length(v) + 1) / 2, end, 0); /* recompose the vector by inverse transform */ vec vr = it_idwt(vt, it_wavelet_lifting_97, 5);</PRE ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="man.it-dwt.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="man.it-wavelet-merge.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >it_dwt</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="refmanual.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >it_wavelet_merge</TD ></TR ></TABLE ></DIV ></BODY ></HTML >
xiao00li/Undergraduate_Dissertation
libit-0.2.3/doc/html/man.it-idwt.html
HTML
mit
3,393
require 'omniauth-oauth2' module OmniAuth module Strategies class Paymill < OmniAuth::Strategies::OAuth2 option :name, 'paymill' option :client_options, { :site => 'https://connect.paymill.com', :token_url => "/token", :authorize_url => "/authorize", :proxy => ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil } uid { raw_info['merchant_id'] } extra do { :raw_info => raw_info } end def raw_info @raw_info ||= access_token.params end end end end
subvisual/omniauth-paymill
lib/omniauth/strategies/paymill.rb
Ruby
mit
559
// // GJGCRecentChatDataManager.h // ZYChat // // Created by ZYVincent QQ:1003081775 on 15/11/18. // Copyright (c) 2015年 ZYProSoft. QQ群:219357847 All rights reserved. // #import <Foundation/Foundation.h> #import "GJGCRecentChatModel.h" #import "GJGCRecentChatTitleView.h" @class GJGCRecentChatDataManager; @protocol GJGCRecentChatDataManagerDelegate <NSObject> - (void)dataManagerRequireRefresh:(GJGCRecentChatDataManager *)dataManager; - (void)dataManagerRequireRefresh:(GJGCRecentChatDataManager *)dataManager requireDeletePaths:(NSArray *)paths; - (void)dataManager:(GJGCRecentChatDataManager *)dataManager requireUpdateTitleViewState:(GJGCRecentChatConnectState)connectState; - (BOOL)dataManagerRequireKnownViewIsShowing:(GJGCRecentChatDataManager *)dataManager; @end @interface GJGCRecentChatDataManager : NSObject @property (nonatomic,readonly)NSInteger totalCount; @property (nonatomic,weak)id<GJGCRecentChatDataManagerDelegate> delegate; - (GJGCRecentChatModel *)contentModelAtIndexPath:(NSIndexPath *)indexPath; - (CGFloat)contentHeightAtIndexPath:(NSIndexPath *)indexPath; - (void)deleteConversationAtIndexPath:(NSIndexPath *)indexPath; - (void)loadRecentConversations; - (NSArray *)allConversationModels; + (BOOL)isConversationHasBeenExist:(NSString *)chatter; @end
mrhyh/ZYChat
ZYChat-EaseMob/ZYChat/RecentChat/GJGCRecentChatDataManager.h
C
mit
1,304
version https://git-lfs.github.com/spec/v1 oid sha256:b50350c88fdc09c9af6a1f0164e978b55b04eeb59c87e7a73fbee13e2747243a size 1362
yogeshsaroya/new-cdnjs
ajax/libs/yui/3.16.0/datatable-highlight/assets/skins/sam/datatable-highlight.css
CSS
mit
129
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Sylius\Component\Grid\Filter; use Sylius\Component\Grid\Data\DataSourceInterface; use Sylius\Component\Grid\Data\ExpressionBuilderInterface; use Sylius\Component\Grid\Filtering\FilterInterface; /** * @author Paweł Jędrzejewski <pawel@sylius.org> */ final class StringFilter implements FilterInterface { public const NAME = 'string'; public const TYPE_EQUAL = 'equal'; public const TYPE_NOT_EQUAL = 'not_equal'; public const TYPE_EMPTY = 'empty'; public const TYPE_NOT_EMPTY = 'not_empty'; public const TYPE_CONTAINS = 'contains'; public const TYPE_NOT_CONTAINS = 'not_contains'; public const TYPE_STARTS_WITH = 'starts_with'; public const TYPE_ENDS_WITH = 'ends_with'; public const TYPE_IN = 'in'; public const TYPE_NOT_IN = 'not_in'; /** * {@inheritdoc} */ public function apply(DataSourceInterface $dataSource, string $name, $data, array $options): void { $expressionBuilder = $dataSource->getExpressionBuilder(); if (is_array($data) && !isset($data['type'])) { $data['type'] = $options['type'] ?? self::TYPE_CONTAINS; } if (!is_array($data)) { $data = ['type' => self::TYPE_CONTAINS, 'value' => $data]; } $fields = array_key_exists('fields', $options) ? $options['fields'] : [$name]; $type = $data['type']; $value = array_key_exists('value', $data) ? $data['value'] : null; if (!in_array($type, [self::TYPE_NOT_EMPTY, self::TYPE_EMPTY], true) && '' === trim($value)) { return; } if (1 === count($fields)) { $dataSource->restrict($this->getExpression($expressionBuilder, $type, current($fields), $value)); return; } $expressions = []; foreach ($fields as $field) { $expressions[] = $this->getExpression($expressionBuilder, $type, $field, $value); } if (self::TYPE_NOT_EQUAL === $type) { $dataSource->restrict($expressionBuilder->andX(...$expressions)); return; } $dataSource->restrict($expressionBuilder->orX(...$expressions)); } /** * @param ExpressionBuilderInterface $expressionBuilder * @param string $type * @param string $field * @param mixed $value * * @return mixed * * @throws \InvalidArgumentException */ private function getExpression( ExpressionBuilderInterface $expressionBuilder, string $type, string $field, $value ) { switch ($type) { case self::TYPE_EQUAL: return $expressionBuilder->equals($field, $value); case self::TYPE_NOT_EQUAL: return $expressionBuilder->notEquals($field, $value); case self::TYPE_EMPTY: return $expressionBuilder->isNull($field); case self::TYPE_NOT_EMPTY: return $expressionBuilder->isNotNull($field); case self::TYPE_CONTAINS: return $expressionBuilder->like($field, '%' . $value . '%'); case self::TYPE_NOT_CONTAINS: return $expressionBuilder->notLike($field, '%' . $value . '%'); case self::TYPE_STARTS_WITH: return $expressionBuilder->like($field, $value . '%'); case self::TYPE_ENDS_WITH: return $expressionBuilder->like($field, '%' . $value); case self::TYPE_IN: return $expressionBuilder->in($field, array_map('trim', explode(',', $value))); case self::TYPE_NOT_IN: return $expressionBuilder->notIn($field, array_map('trim', explode(',', $value))); default: throw new \InvalidArgumentException(sprintf('Could not get an expression for type "%s"!', $type)); } } }
gmoigneu/platformsh-integrations
src/Sylius/Component/Grid/Filter/StringFilter.php
PHP
mit
4,118
small.coming-soon { color: gray; text-transform: uppercase; margin-left: 10px; font-size: 10px; text-align: center; vertical-align: middle; } div.liquid-vars { display: none; } li.list-group-item { background-color: black; } .section-desc { width: 100%; height: 100%; margin: 20px 0; perspective: 1000px; } .gallery { text-align: center; display: block; padding: 30px 25px 0px 25px; box-sizing: border-box; } img.thumbnail { width: 100%; height: 230px; margin: 30px 0; display: inline; } #first-elem, #second-elem, #third-elem, #forth-elem, #fifth-elem, #sixth-elem { padding-top: 25px; } /* Responsize design - content oriented */ @media (max-width: 459px) { img.thumbnail { width: 70%; height: 300px; } } @media (min-width: 460px) and (max-width: 767px) { img.thumbnail { width: 50%; height: 350px; } }
mhd53/Matlab
docs/css/styles.css
CSS
mit
847
include(Platform/Windows-MSVC) set(CMAKE_CUDA_COMPILE_PTX_COMPILATION "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -ptx <SOURCE> -o <OBJECT> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS") set(CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -dc <SOURCE> -o <OBJECT> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS") set(CMAKE_CUDA_COMPILE_WHOLE_COMPILATION "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -c <SOURCE> -o <OBJECT> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS") set(__IMPLICT_LINKS ) foreach(dir ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES}) string(APPEND __IMPLICT_LINKS " -LIBPATH:\"${dir}\"") endforeach() foreach(lib ${CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES}) string(APPEND __IMPLICT_LINKS " \"${lib}\"") endforeach() set(CMAKE_CUDA_LINK_EXECUTABLE "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_CUDA_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_LIBRARIES>${__IMPLICT_LINKS}") set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll --intdir=<OBJECT_DIR> --manifests <MANIFESTS> -- ") set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe --intdir=<OBJECT_DIR> --manifests <MANIFESTS> -- ") set(CMAKE_CUDA_CREATE_SHARED_LIBRARY "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${__IMPLICT_LINKS} ${CMAKE_END_TEMP_FILE}") set(CMAKE_CUDA_CREATE_SHARED_MODULE ${CMAKE_CUDA_CREATE_SHARED_LIBRARY}) set(CMAKE_CUDA_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") set(CMAKE_CUDA_LINKER_SUPPORTS_PDB ON) set(CMAKE_CUDA_LINK_EXECUTABLE "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <CMAKE_CUDA_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${__IMPLICT_LINKS} ${CMAKE_END_TEMP_FILE}") unset(_CMAKE_VS_LINK_EXE) unset(_CMAKE_VS_LINK_EXE) set(CMAKE_CUDA_DEVICE_LINK_LIBRARY "<CMAKE_CUDA_COMPILER> <CMAKE_CUDA_LINK_FLAGS> <LANGUAGE_COMPILE_FLAGS> -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS") set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE "<CMAKE_CUDA_COMPILER> <FLAGS> <CMAKE_CUDA_LINK_FLAGS> -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS") string(REPLACE "/D" "-D" _PLATFORM_DEFINES_CUDA "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_CXX}") string(APPEND CMAKE_CUDA_FLAGS_INIT " ${PLATFORM_DEFINES_CUDA} -D_WINDOWS -Xcompiler=\"/W3${_FLAGS_CXX}\"") string(APPEND CMAKE_CUDA_FLAGS_DEBUG_INIT " -Xcompiler=\"-MDd -Zi -Ob0 -Od ${_RTC1}\"") string(APPEND CMAKE_CUDA_FLAGS_RELEASE_INIT " -Xcompiler=\"-MD -O2 -Ob2\" -DNDEBUG") string(APPEND CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT " -Xcompiler=\"-MD -Zi -O2 -Ob1\" -DNDEBUG") string(APPEND CMAKE_CUDA_FLAGS_MINSIZEREL_INIT " -Xcompiler=\"-MD -O1 -Ob1\" -DNDEBUG") set(CMAKE_CUDA_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
pipou/rae
builder/cmake/macos/share/cmake-3.8/Modules/Platform/Windows-NVIDIA-CUDA.cmake
CMake
mit
3,369
using System; using System.Configuration; using Harvester.Core.Messaging; /* Copyright (c) 2012-2013 CBaxter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ namespace Harvester.Core.Configuration { public class ListenersSection : ConfigurationSection { [ConfigurationProperty(null, Options = ConfigurationPropertyOptions.IsDefaultCollection)] public ListenerElementCollection Listeners { get { return (ListenerElementCollection)base[""] ?? new ListenerElementCollection(); } } } [ConfigurationCollection(typeof(ListenerElement), AddItemName = "listener", CollectionType = ConfigurationElementCollectionType.BasicMap)] public class ListenerElementCollection : ConfigurationElementCollection { protected override ConfigurationElement CreateNewElement() { return new ListenerElement(); } protected override Object GetElementKey(ConfigurationElement element) { return ((ListenerElement)element).Binding; } } public class ListenerElement : ExtendableConfigurationElement, IConfigureListeners { [ConfigurationProperty("binding", IsRequired = true)] public String Binding { get { return (String)base["binding"]; } } [ConfigurationProperty("mutex", IsRequired = true)] public String Mutex { get { return (String)base["mutex"]; } } [ConfigurationProperty("type", IsRequired = true)] public String TypeName { get { return (String)base["type"]; } } [ConfigurationProperty("elevatedOnly", IsRequired = false, DefaultValue = false)] public Boolean ElevatedOnly { get { return (Boolean)base["elevatedOnly"]; } } } }
jeoffman/Harvester
src/Core/Configuration/ListenersSection.cs
C#
mit
2,725
define(['./_baseFindIndex', './_baseIsNaN', './_strictLastIndexOf', './toInteger'], function(baseFindIndex, baseIsNaN, strictLastIndexOf, toInteger) { /** Used as a safe reference for `undefined` in pre-ES5 environments. */ var undefined; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max, nativeMin = Math.min; /** * This method is like `_.indexOf` except that it iterates over elements of * `array` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.lastIndexOf([1, 2, 1, 2], 2); * // => 3 * * // Search from the `fromIndex`. * _.lastIndexOf([1, 2, 1, 2], 2, 2); * // => 1 */ function lastIndexOf(array, value, fromIndex) { var length = array ? array.length : 0; if (!length) { return -1; } var index = length; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); } return lastIndexOf; });
fdeleo/alugaqui-webserver
node_modules/lodash-amd/lastIndexOf.js
JavaScript
mit
1,479
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/poi/shared_corellia_solitude_medium3.iff" result.attribute_template_id = -1 result.stfName("poi_n","base_poi_building") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
anhstudios/swganh
data/scripts/templates/object/building/poi/shared_corellia_solitude_medium3.py
Python
mit
456
class Solution(object): # def convert(self, s, numRows): # """ # :type s: str # :type numRows: int # :rtype: str # """ # ls = len(s) # if ls <= 1 or numRows == 1: # return s # temp_s = [] # for i in range(numRows): # temp_s.append(['']*(ls / 2)) # inter = numRows - 1 # col, row = 0, 0 # for i, ch in enumerate(s): # flag = True # if (i / inter) % 2 == 1: # # print i # flag = False # if flag: # temp_s[row][col] = ch # row += 1 # else: # temp_s[row][col] = ch # col += 1 # row -= 1 # result = '' # for i in range(numRows): # result += ''.join(temp_s[i]) # return result def convert(self, s, numRows): # https://leetcode.com/discuss/90908/easy-python-o-n-solution-94%25-with-explanations if numRows == 1: return s # calculate period p = 2 * (numRows - 1) result = [""] * numRows for i in xrange(len(s)): floor = i % p if floor >= p//2: floor = p - floor result[floor] += s[i] return "".join(result) if __name__ == '__main__': # begin s = Solution() print s.convert("PAYPALISHIRING", 3)
qiyuangong/leetcode
python/006_ZigZag_Conversion.py
Python
mit
1,447
/* must be manually run/created before upgrades can be done */ DROP TABLE IF EXISTS db_upgrades; CREATE TABLE db_upgrades ( upgrade_id INT(32) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, user_id INT(32) UNSIGNED NOT NULL, version_major INT(32) UNSIGNED NOT NULL, version_minor INT(32) UNSIGNED NOT NULL, timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
tl-its-umich-edu/ARISGames-server
services/v2/db/upgrades_table.sql
SQL
mit
355
using ZKWeb.Plugins.Common.Admin.src.Domain.Services; using ZKWeb.Plugins.Common.Base.src.Domain.Services; using ZKWeb.Plugins.Common.Base.src.UIComponents.Forms; using ZKWeb.Plugins.Common.Base.src.UIComponents.Forms.Attributes; using ZKWeb.Plugins.Common.Base.src.UIComponents.Forms.Extensions; using ZKWeb.Plugins.Common.Base.src.UIComponents.Forms.Interfaces; using ZKWeb.Plugins.Common.UserPanel.src.Controllers.Bases; using ZKWebStandard.Ioc; using ZKWebStandard.Web; namespace ZKWeb.Plugins.Common.UserPanel.src.Controllers { /// <summary> /// 修改自身头像的表单 /// </summary> [ExportMany] public class ChangeAvatarForm : FormUserPanelControllerBase { public override string Group { get { return "Account Manage"; } } public override string GroupIconClass { get { return "fa fa-user"; } } public override string Name { get { return "Change Avatar"; } } public override string IconClass { get { return "fa fa-smile-o"; } } public override string Url { get { return "/home/change_avatar"; } } protected override IModelFormBuilder GetForm() { return new Form(); } /// <summary> /// 表单 /// </summary> public class Form : ModelFormBuilder { /// <summary> /// 头像 /// </summary> [FileUploaderField("Avatar")] public IHttpPostedFile Avatar { get; set; } /// <summary> /// 删除头像 /// </summary> [CheckBoxField("DeleteAvatar")] public bool DeleteAvatar { get; set; } /// <summary> /// 绑定表单 /// </summary> protected override void OnBind() { } /// <summary> /// 提交表单 /// </summary> /// <returns></returns> protected override object OnSubmit() { var sessionManager = Application.Ioc.Resolve<SessionManager>(); var session = sessionManager.GetSession(); var userId = session.ReleatedId.Value; var userManager = Application.Ioc.Resolve<UserManager>(); if (Avatar != null) { userManager.SaveAvatar(userId, Avatar.OpenReadStream()); } else if (DeleteAvatar) { userManager.DeleteAvatar(userId); } return this.SaveSuccessAndRefreshPage(1500); } } } }
zkweb-framework/ZKWeb.Plugins
src/ZKWeb.Plugins/Common.UserPanel/src/Controllers/ChangeAvatarController.cs
C#
mit
2,178
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_11) on Wed Mar 06 22:23:50 GMT 2013 --> <title>controls Class Hierarchy</title> <meta name="date" content="2013-03-06"> <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="controls Class Hierarchy"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li><a href="../index-files/index-1.html">Index</a></li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li><a href="../tests/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../index.html?controls/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 class="title">Hierarchy For Package controls</h1> <span class="strong">Package Hierarchies:</span> <ul class="horizontal"> <li><a href="../overview-tree.html">All Packages</a></li> </ul> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.Object <ul> <li type="circle">controls.<a href="../controls/BaseControl.html" title="class in controls"><span class="strong">BaseControl</span></a> (implements controls.<a href="../controls/Detectable.html" title="interface in controls">Detectable</a>) <ul> <li type="circle">controls.<a href="../controls/Alert.html" title="class in controls"><span class="strong">Alert</span></a></li> <li type="circle">controls.<a href="../controls/Button.html" title="class in controls"><span class="strong">Button</span></a> (implements controls.<a href="../controls/Clickable.html" title="interface in controls">Clickable</a>, controls.<a href="../controls/Readable.html" title="interface in controls">Readable</a>)</li> <li type="circle">controls.<a href="../controls/CheckBox.html" title="class in controls"><span class="strong">CheckBox</span></a> (implements controls.<a href="../controls/Clickable.html" title="interface in controls">Clickable</a>, controls.<a href="../controls/Readable.html" title="interface in controls">Readable</a>, controls.<a href="../controls/Selectable.html" title="interface in controls">Selectable</a>)</li> <li type="circle">controls.<a href="../controls/Link.html" title="class in controls"><span class="strong">Link</span></a> (implements controls.<a href="../controls/Clickable.html" title="interface in controls">Clickable</a>, controls.<a href="../controls/Readable.html" title="interface in controls">Readable</a>)</li> <li type="circle">controls.<a href="../controls/RadioButton.html" title="class in controls"><span class="strong">RadioButton</span></a> (implements controls.<a href="../controls/Clickable.html" title="interface in controls">Clickable</a>, controls.<a href="../controls/Readable.html" title="interface in controls">Readable</a>)</li> <li type="circle">controls.<a href="../controls/SelectBox.html" title="class in controls"><span class="strong">SelectBox</span></a> (implements controls.<a href="../controls/Clickable.html" title="interface in controls">Clickable</a>, controls.<a href="../controls/Readable.html" title="interface in controls">Readable</a>)</li> <li type="circle">controls.<a href="../controls/Table.html" title="class in controls"><span class="strong">Table</span></a></li> <li type="circle">controls.<a href="../controls/TextBox.html" title="class in controls"><span class="strong">TextBox</span></a> (implements controls.<a href="../controls/Clickable.html" title="interface in controls">Clickable</a>, controls.<a href="../controls/Readable.html" title="interface in controls">Readable</a>, controls.<a href="../controls/Writeable.html" title="interface in controls">Writeable</a>)</li> </ul> </li> <li type="circle">controls.<a href="../controls/BasePage.html" title="class in controls"><span class="strong">BasePage</span></a></li> </ul> </li> </ul> <h2 title="Interface Hierarchy">Interface Hierarchy</h2> <ul> <li type="circle">controls.<a href="../controls/Clickable.html" title="interface in controls"><span class="strong">Clickable</span></a></li> <li type="circle">controls.<a href="../controls/Detectable.html" title="interface in controls"><span class="strong">Detectable</span></a></li> <li type="circle">controls.<a href="../controls/Readable.html" title="interface in controls"><span class="strong">Readable</span></a></li> <li type="circle">controls.<a href="../controls/Selectable.html" title="interface in controls"><span class="strong">Selectable</span></a></li> <li type="circle">controls.<a href="../controls/Writeable.html" title="interface in controls"><span class="strong">Writeable</span></a></li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li><a href="../index-files/index-1.html">Index</a></li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li><a href="../tests/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../index.html?controls/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
testworx/SeleniumFramework
doc/controls/package-tree.html
HTML
mit
7,350
// mail-enqueue - queue a mail message for delivery #include "libutil.h" #include "shutil.h" #include "xsys.h" #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/un.h> #include <string> using std::string; class spool_writer { string spooldir_; int notifyfd_; struct sockaddr_un notify_addr_; socklen_t notify_len_; public: spool_writer(const string &spooldir) : spooldir_(spooldir), notify_addr_{} { notifyfd_ = socket(AF_UNIX, SOCK_DGRAM, 0); if (notifyfd_ < 0) edie("socket failed"); notify_addr_.sun_family = AF_UNIX; snprintf(notify_addr_.sun_path, sizeof notify_addr_.sun_path, "%s/notify", spooldir.c_str()); notify_len_ = SUN_LEN(&notify_addr_); } void queue(int msgfd, const char *recipient, size_t limit = (size_t)-1) { // Create temporary message char tmpname[256]; snprintf(tmpname, sizeof tmpname, "%s/pid/%d", spooldir_.c_str(), getpid()); int tmpfd = open(tmpname, O_CREAT|O_EXCL|O_WRONLY, 0600); if (tmpfd < 0) edie("open %s failed", tmpname); if (copy_fd_n(tmpfd, msgfd, limit) < 0) edie("copy_fd message failed"); struct stat st; if (fstatx(tmpfd, &st, STAT_OMIT_NLINK) < 0) edie("fstat failed"); close(tmpfd); // Create envelope char envname[256]; snprintf(envname, sizeof envname, "%s/todo/%lu", spooldir_.c_str(), (unsigned long)st.st_ino); int envfd = open(envname, O_CREAT|O_EXCL|O_WRONLY, 0600); if (envfd < 0) edie("open %s failed", envname); xwrite(envfd, recipient, strlen(recipient)); close(envfd); // Move message into spool char msgname[256]; snprintf(msgname, sizeof msgname, "%s/mess/%lu", spooldir_.c_str(), (unsigned long)st.st_ino); if (rename(tmpname, msgname) < 0) edie("rename %s %s failed", tmpname, msgname); // Notify queue manager. We don't need an acknowledgment because // we've already "durably" queued the message. char notif[16]; snprintf(notif, sizeof notif, "%lu", (unsigned long)st.st_ino); if (sendto(notifyfd_, notif, strlen(notif), 0, (struct sockaddr*)&notify_addr_, notify_len_) < 0) edie("send failed"); } void queue_exit() { const char *msg = "EXIT"; if (sendto(notifyfd_, msg, strlen(msg), 0, (struct sockaddr*)&notify_addr_, notify_len_) < 0) edie("send failed"); } }; static void do_batch_mode(int fd, int resultfd, const char *recip, spool_writer *spool) { while (1) { uint64_t msg_len; size_t len = xread(fd, &msg_len, sizeof msg_len); if (len == 0) break; if (len != sizeof msg_len) die("short read of message length"); spool->queue(fd, recip, msg_len); // Indicate success uint64_t res = 0; xwrite(resultfd, &res, sizeof res); } } static void usage(const char *argv0) { fprintf(stderr, "Usage: %s spooldir recipient <message\n", argv0); fprintf(stderr, " %s -b spooldir recipient <message-stream\n", argv0); fprintf(stderr, " %s --exit spooldir\n", argv0); fprintf(stderr, "\n"); fprintf(stderr, "In batch mode, message-stream is a sequence of <u64 N><char[N]> and\n" "a <u64> return code will be written to stdout after every delivery.\n" ); exit(2); } int main(int argc, char **argv) { if (argc == 3 && strcmp(argv[1], "--exit") == 0) { spool_writer spool{argv[2]}; spool.queue_exit(); return 0; } int opt; bool batch_mode = false; while ((opt = getopt(argc, argv, "b")) != -1) { switch (opt) { case 'b': batch_mode = true; break; default: usage(argv[0]); } } if (argc - optind != 2) usage(argv[0]); const char *spooldir = argv[optind]; const char *recip = argv[optind + 1]; spool_writer spool{spooldir}; if (batch_mode) do_batch_mode(0, 1, recip, &spool); else spool.queue(0, recip); return 0; }
aclements/sv6
bin/mail-enqueue.cc
C++
mit
4,061
/** * Copyright 2013 Facebook, 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. * * @providesModule ChangeEventPlugin */ "use strict"; var EventConstants = require("./EventConstants"); var EventPluginHub = require("./EventPluginHub"); var EventPropagators = require("./EventPropagators"); var ExecutionEnvironment = require("./ExecutionEnvironment"); var SyntheticEvent = require("./SyntheticEvent"); var isEventSupported = require("./isEventSupported"); var keyOf = require("./keyOf"); var topLevelTypes = EventConstants.topLevelTypes; var eventTypes = { change: { phasedRegistrationNames: { bubbled: keyOf({onChange: null}), captured: keyOf({onChangeCapture: null}) } } }; /** * For IE shims */ var activeElement = null; var activeElementID = null; var activeElementValue = null; var activeElementValueProp = null; /** * SECTION: handle `change` event */ function shouldUseChangeEvent(elem) { return ( elem.nodeName === 'SELECT' || (elem.nodeName === 'INPUT' && elem.type === 'file') ); } var doesChangeEventBubble = false; if (ExecutionEnvironment.canUseDOM) { // See `handleChange` comment below doesChangeEventBubble = isEventSupported('change') && ( !('documentMode' in document) || document.documentMode > 8 ); } function manualDispatchChangeEvent(nativeEvent) { var event = SyntheticEvent.getPooled( eventTypes.change, activeElementID, nativeEvent ); EventPropagators.accumulateTwoPhaseDispatches(event); // If change bubbled, we'd just bind to it like all the other events // and have it go through ReactEventTopLevelCallback. Since it doesn't, we // manually listen for the change event and so we have to enqueue and // process the abstract event manually. EventPluginHub.enqueueEvents(event); EventPluginHub.processEventQueue(); } function startWatchingForChangeEventIE8(target, targetID) { activeElement = target; activeElementID = targetID; activeElement.attachEvent('onchange', manualDispatchChangeEvent); } function stopWatchingForChangeEventIE8() { if (!activeElement) { return; } activeElement.detachEvent('onchange', manualDispatchChangeEvent); activeElement = null; activeElementID = null; } function getTargetIDForChangeEvent( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topChange) { return topLevelTargetID; } } function handleEventsForChangeEventIE8( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topFocus) { // stopWatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopWatchingForChangeEventIE8(); startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID); } else if (topLevelType === topLevelTypes.topBlur) { stopWatchingForChangeEventIE8(); } } /** * SECTION: handle `input` event */ var isInputEventSupported = false; if (ExecutionEnvironment.canUseDOM) { // IE9 claims to support the input event but fails to trigger it when // deleting text, so we ignore its input events isInputEventSupported = isEventSupported('input') && ( !('documentMode' in document) || document.documentMode > 9 ); } /** * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary */ var supportedInputTypes = { 'color': true, 'date': true, 'datetime': true, 'datetime-local': true, 'email': true, 'month': true, 'number': true, 'password': true, 'range': true, 'search': true, 'tel': true, 'text': true, 'time': true, 'url': true, 'week': true }; function shouldUseInputEvent(elem) { return ( (elem.nodeName === 'INPUT' && supportedInputTypes[elem.type]) || elem.nodeName === 'TEXTAREA' ); } /** * (For old IE.) Replacement getter/setter for the `value` property that gets * set on the active element. */ var newValueProp = { get: function() { return activeElementValueProp.get.call(this); }, set: function(val) { // Cast to a string so we can do equality checks. activeElementValue = '' + val; activeElementValueProp.set.call(this, val); } }; /** * (For old IE.) Starts tracking propertychange events on the passed-in element * and override the value property so that we can distinguish user events from * value changes in JS. */ function startWatchingForValueChange(target, targetID) { activeElement = target; activeElementID = targetID; activeElementValue = target.value; activeElementValueProp = Object.getOwnPropertyDescriptor( target.constructor.prototype, 'value' ); Object.defineProperty(activeElement, 'value', newValueProp); activeElement.attachEvent('onpropertychange', handlePropertyChange); } /** * (For old IE.) Removes the event listeners from the currently-tracked element, * if any exists. */ function stopWatchingForValueChange() { if (!activeElement) { return; } // delete restores the original property definition delete activeElement.value; activeElement.detachEvent('onpropertychange', handlePropertyChange); activeElement = null; activeElementID = null; activeElementValue = null; activeElementValueProp = null; } /** * (For old IE.) Handles a propertychange event, sending a `change` event if * the value of the active element has changed. */ function handlePropertyChange(nativeEvent) { if (nativeEvent.propertyName !== 'value') { return; } var value = nativeEvent.srcElement.value; if (value === activeElementValue) { return; } activeElementValue = value; manualDispatchChangeEvent(nativeEvent); } /** * If a `change` event should be fired, returns the target's ID. */ function getTargetIDForInputEvent( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topInput) { // In modern browsers (i.e., not IE8 or IE9), the input event is exactly // what we want so fall through here and trigger an abstract event return topLevelTargetID; } } // For IE8 and IE9. function handleEventsForInputEventIE( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topFocus) { // In IE8, we can capture almost all .value changes by adding a // propertychange handler and looking for events with propertyName // equal to 'value' // In IE9, propertychange fires for most input events but is buggy and // doesn't fire when text is deleted, but conveniently, selectionchange // appears to fire in all of the remaining cases so we catch those and // forward the event if the value has changed // In either case, we don't want to call the event handler if the value // is changed from JS so we redefine a setter for `.value` that updates // our activeElementValue variable, allowing us to ignore those changes // // stopWatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopWatchingForValueChange(); startWatchingForValueChange(topLevelTarget, topLevelTargetID); } else if (topLevelType === topLevelTypes.topBlur) { stopWatchingForValueChange(); } } // For IE8 and IE9. function getTargetIDForInputEventIE( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) { // On the selectionchange event, the target is just document which isn't // helpful for us so just check activeElement instead. // // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire // propertychange on the first input event after setting `value` from a // script and fires only keydown, keypress, keyup. Catching keyup usually // gets it and catching keydown lets us fire an event for the first // keystroke if user does a key repeat (it'll be a little delayed: right // before the second keystroke). Other input methods (e.g., paste) seem to // fire selectionchange normally. if (activeElement && activeElement.value !== activeElementValue) { activeElementValue = activeElement.value; return activeElementID; } } } /** * SECTION: handle `click` event */ function shouldUseClickEvent(elem) { // Use the `click` event to detect changes to checkbox and radio inputs. // This approach works across all browsers, whereas `change` does not fire // until `blur` in IE8. return ( elem.nodeName === 'INPUT' && (elem.type === 'checkbox' || elem.type === 'radio') ); } function getTargetIDForClickEvent( topLevelType, topLevelTarget, topLevelTargetID) { if (topLevelType === topLevelTypes.topClick) { return topLevelTargetID; } } /** * This plugin creates an `onChange` event that normalizes change events * across form elements. This event fires at a time when it's possible to * change the element's value without seeing a flicker. * * Supported elements are: * - input (see `supportedInputTypes`) * - textarea * - select */ var ChangeEventPlugin = { eventTypes: eventTypes, /** * @param {string} topLevelType Record from `EventConstants`. * @param {DOMEventTarget} topLevelTarget The listening component root node. * @param {string} topLevelTargetID ID of `topLevelTarget`. * @param {object} nativeEvent Native browser event. * @return {*} An accumulation of synthetic events. * @see {EventPluginHub.extractEvents} */ extractEvents: function( topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) { var getTargetIDFunc, handleEventFunc; if (shouldUseChangeEvent(topLevelTarget)) { if (doesChangeEventBubble) { getTargetIDFunc = getTargetIDForChangeEvent; } else { handleEventFunc = handleEventsForChangeEventIE8; } } else if (shouldUseInputEvent(topLevelTarget)) { if (isInputEventSupported) { getTargetIDFunc = getTargetIDForInputEvent; } else { getTargetIDFunc = getTargetIDForInputEventIE; handleEventFunc = handleEventsForInputEventIE; } } else if (shouldUseClickEvent(topLevelTarget)) { getTargetIDFunc = getTargetIDForClickEvent; } if (getTargetIDFunc) { var targetID = getTargetIDFunc( topLevelType, topLevelTarget, topLevelTargetID ); if (targetID) { var event = SyntheticEvent.getPooled( eventTypes.change, targetID, nativeEvent ); EventPropagators.accumulateTwoPhaseDispatches(event); return event; } } if (handleEventFunc) { handleEventFunc( topLevelType, topLevelTarget, topLevelTargetID ); } } }; module.exports = ChangeEventPlugin;
hedgerwang/simple_react_py_app
node_modules/react-tools/build/modules/ChangeEventPlugin.js
JavaScript
mit
11,417
import lejos.nxt.*; import java.util.*; import lejos.robotics.*; /** * Localizes robot at beginning of run based on sensor readings * @author Anass Al-Wohoush, Mohamed Kleit * @version 2.1 */ public class Localizer { // OBJECTS private Robot robot; private Odometer odometer; private Navigation nav; // STARTING CORNER private int corner; private final int LEFT = 0, RIGHT = 1, FRONT = 2; private final double SIZE_OF_TILE = 30.48; // FILTER COUNTERS AND DATA private int[] sonicCounter = {0,0,0}; private int[] lightCounter = {0,0}; private int[] lineCounter = {0,0}; private int[][] distance = new int[3][3]; private int[][] intensity = new int[2][10]; private int[] threshold = {400, 400}; private int[] sortedIntensity = new int[intensity[0].length]; /** * Localizer constructor * * @param robot robot object containing all color sensor ports * @param odometer odometer object containing x, y and theta coordinates */ public Localizer(Robot robot, Odometer odometer, Navigation nav) { this.robot = robot; this.odometer = odometer; this.nav = nav; this.corner = corner; // SET UP MOVING AVERAGE FILTERS for (int i = 0; i < distance[0].length; i++) distance[LEFT][i] = robot.leftSonic.getDistance(); for (int i = 0; i < distance[0].length; i++) distance[RIGHT][i] = robot.rightSonic.getDistance(); for (int i = 0; i < distance[0].length; i++) distance[FRONT][i] = robot.centerSonic.getDistance(); for (int i = 0; i < 2; i++) for (int j = 0; j < intensity[0].length; j++) intensity[i][j] = 600; } /** * Localizes using ultrasonic sensor followed by downward facing * color sensors */ public void localize() { // SELF-EXPLANATORY localizeSonicly(); nav.turnTo(Math.PI / 2); // SELF-EXPLANATORY localizeLightly(); } /** * Returns whether a color sensor is straight on a line or not * * <TABLE BORDER=1> * <TR><TH>Return Code</TH><TH>Description</TH></TR> * <TR><TD>-1</TD><TD>Not on a line</TD></TR> * <TR><TD>0</TD><TD>Left color sensor on a line</TD></TR> * <TR><TD>1</TD><TD>Right color sensor on a line/TD></TR> * </TABLE> * * @return the return code */ public int isStraightOnLine() { double distanceToCheck = 5.00; robot.leftMotor.rotate(-convertDistance(robot.leftRadius, distanceToCheck), true); robot.rightMotor.rotate(-convertDistance(robot.rightRadius, distanceToCheck), true); while (robot.leftMotor.isMoving() || robot.rightMotor.isMoving()) { for (int side = 0; side < 2; side++) { if (isLine(side)) { lineCounter[side]++; } } } robot.leftMotor.rotate(convertDistance(robot.leftRadius, distanceToCheck), true); robot.rightMotor.rotate(convertDistance(robot.rightRadius, distanceToCheck), true); while (robot.leftMotor.isMoving() || robot.rightMotor.isMoving()) { for (int side = 0; side < 2; side++) { if (isLine(side)) { lineCounter[side]++; } } } if (lineCounter[LEFT] > 150) { lineCounter[LEFT] = 0; lineCounter[RIGHT] = 0; return LEFT; } if (lineCounter[RIGHT] > 150) { lineCounter[LEFT] = 0; lineCounter[RIGHT] = 0; return RIGHT; } return -1; } /** * Relocalizes using downward facing color sensors */ public void relocalize() { // INITIALIZE double[] desiredPos = {0.0, 0.0, 0.0}; double[] prevPos = {0.0, 0.0, 0.0}; double[] curPos = {0.0, 0.0, 0.0}; double delta = 0.00; // SET LOCALIZING FLAG robot.localizing = true; LCD.drawString("LOCATING...", 0, 7); // SET COLOR SENSOR FLOODLIGHT robot.leftColor.setFloodlight(true); robot.rightColor.setFloodlight(true); // START nav.turnTo(Math.PI / 2); // MAKE SURE NOT STRAIGHT ON LINE int problematic = isStraightOnLine(); if (problematic == LEFT) { nav.turnTo(Math.PI); nav.goForward(3); nav.turnTo(Math.PI / 2); } else if (problematic == RIGHT) { nav.turnTo(0); nav.goForward(3); nav.turnTo(Math.PI / 2); } boolean leftDone = false, rightDone = false; if (prevPos[1] < (nav.SIZE_OF_FIELD - 2.5) * SIZE_OF_TILE) { // MAKE SURE NOT ON LINE nav.goBackward(10); // GET CURRENT POSITION odometer.getPosition(prevPos, new boolean[] {true, true, true}); // CORRECT FOR NEGATIVE Y if (prevPos[1] < 0) desiredPos[1] = (int)(prevPos[1] / SIZE_OF_TILE) * SIZE_OF_TILE; else desiredPos[1] = (int)(prevPos[1] / SIZE_OF_TILE) * SIZE_OF_TILE + SIZE_OF_TILE; // GO FORWARD robot.leftMotor.forward(); robot.rightMotor.forward(); robot.leftMotor.setSpeed(250); robot.rightMotor.setSpeed(250); // THIS WILL MAKE THE ROBOT STOP ON THE X AXIS CORRECTING THE Y COORDINATES // WILL MOVE EACH TIRE UNTIL IT REACHES A GRIDLINE, STOPPING DIRECTLY ON THE LINE while (!leftDone || !rightDone) { if (!leftDone && isLine(LEFT)) { Sound.beep(); robot.leftMotor.stop(true); leftDone = true; } if (!rightDone && isLine(RIGHT)) { Sound.beep(); robot.rightMotor.stop(true); rightDone = true; } } // GET CURRENT POSITION odometer.getPosition(curPos, new boolean[] {true, true, true}); // GET DISTANCE double distanceTraveled = nav.distance(curPos, prevPos); // FIX DESIRED POSITION if (distanceTraveled > SIZE_OF_TILE / 2 + 10.00) { desiredPos[1] += SIZE_OF_TILE; } } else { // GET POSITION odometer.getPosition(prevPos, new boolean[] {true, true, true}); // GO FORWARD robot.leftMotor.backward(); robot.rightMotor.backward(); robot.leftMotor.setSpeed(250); robot.rightMotor.setSpeed(250); // THIS WILL MAKE THE ROBOT STOP ON THE X AXIS CORRECTING THE Y COORDINATES // WILL MOVE EACH TIRE UNTIL IT REACHES A GRIDLINE, STOPPING DIRECTLY ON THE LINE while (!leftDone || !rightDone) { if (!leftDone && isLine(LEFT)) { Sound.beep(); robot.leftMotor.stop(true); leftDone = true; } if (!rightDone && isLine(RIGHT)) { Sound.beep(); robot.rightMotor.stop(true); rightDone = true; } } // GET CURRENT POSITION odometer.getPosition(curPos, new boolean[] {true, true, true}); // GET DISTANCE double distanceTraveled = nav.distance(curPos, prevPos); // FIX DESIRED POSITION if (distanceTraveled > SIZE_OF_TILE / 2) { desiredPos[1] -= SIZE_OF_TILE; } } if (Math.abs(odometer.getTheta() - Math.PI / 2) <= Math.toRadians(15)) { // SETS THE ODOMETER AT 90 DEGREES IF ACCEPTABLE odometer.setPosition(new double[] {curPos[0], desiredPos[1], Math.PI / 2 }, new boolean[] {true, true, true}); } else { // RECORRECT OTHERWISE // relocalize(); // return; } // GET NEW CURRENT POSITION odometer.getPosition(prevPos, new boolean[] {true, true, true}); // TURN TO 0 DEGREES TO FIX THE X COORDINATES robot.leftMotor.rotate(-convertAngle(robot.leftTurningRadius, -Math.PI / 2), true); robot.rightMotor.rotate(convertAngle(robot.rightTurningRadius, -Math.PI / 2), false); // MAKE SURE NOT STRAIGHT ON LINE problematic = isStraightOnLine(); if (problematic == LEFT) { nav.turnTo(Math.PI / 2); nav.goForward(3); delta += 3.00; nav.turnTo(0); } else if (problematic == RIGHT) { nav.turnTo(3 * Math.PI / 2); nav.goForward(3); delta -= 3.00; nav.turnTo(0); } // RESET FLAGS leftDone = false; rightDone = false; if (prevPos[0] < (nav.SIZE_OF_FIELD - 2.5) * SIZE_OF_TILE) { // MAKE SURE NOT ON LINE nav.goBackward(10); // GET CURRENT POSITION odometer.getPosition(prevPos, new boolean[] {true, true, true}); // CORRECT FOR NEGATIVE Y if (prevPos[0] < 0) desiredPos[0] = (int)(prevPos[0] / SIZE_OF_TILE) * SIZE_OF_TILE; else desiredPos[0] = (int)(prevPos[0] / SIZE_OF_TILE) * SIZE_OF_TILE + SIZE_OF_TILE; // GO FORWARD robot.leftMotor.forward(); robot.rightMotor.forward(); robot.leftMotor.setSpeed(250); robot.rightMotor.setSpeed(250); // THIS WILL MAKE THE ROBOT STOP ON THE X AXIS CORRECTING THE Y COORDINATES // WILL MOVE EACH TIRE UNTIL IT REACHES A GRIDLINE, STOPPING DIRECTLY ON THE LINE while (!leftDone || !rightDone) { if (!leftDone && isLine(LEFT)) { Sound.beep(); robot.leftMotor.stop(true); leftDone = true; } if (!rightDone && isLine(RIGHT)) { Sound.beep(); robot.rightMotor.stop(true); rightDone = true; } } // GET CURRENT POSITION odometer.getPosition(curPos, new boolean[] {true, true, true}); // GET DISTANCE double distanceTraveled = nav.distance(curPos, prevPos); // FIX DESIRED POSITION if (distanceTraveled > SIZE_OF_TILE / 2) { desiredPos[0] += SIZE_OF_TILE; } } else { // GET POSITION odometer.getPosition(prevPos, new boolean[] {true, true, true}); // GO FORWARD robot.leftMotor.backward(); robot.rightMotor.backward(); robot.leftMotor.setSpeed(250); robot.rightMotor.setSpeed(250); // THIS WILL MAKE THE ROBOT STOP ON THE X AXIS CORRECTING THE Y COORDINATES // WILL MOVE EACH TIRE UNTIL IT REACHES A GRIDLINE, STOPPING DIRECTLY ON THE LINE while (!leftDone || !rightDone) { if (!leftDone && isLine(LEFT)) { Sound.beep(); robot.leftMotor.stop(true); leftDone = true; } if (!rightDone && isLine(RIGHT)) { Sound.beep(); robot.rightMotor.stop(true); rightDone = true; } } // GET CURRENT POSITION odometer.getPosition(curPos, new boolean[] {true, true, true}); // GET DISTANCE double distanceTraveled = nav.distance(curPos, prevPos); // FIX DESIRED POSITION if (distanceTraveled > SIZE_OF_TILE / 2 + 10.00) { desiredPos[0] -= SIZE_OF_TILE; } } // RESET COLOR SENSOR FLOODLIGHT robot.leftColor.setFloodlight(false); robot.rightColor.setFloodlight(false); if (Math.abs(odometer.getTheta()) <= Math.toRadians(35)) { // SETS THE ODOMETER AT 0 DEGREES IF CORRECT odometer.setPosition(new double[] {desiredPos[0] - 4.2, desiredPos[1] - 4.2 + delta, 0}, new boolean[] {true, true, true}); } else { // RECORRECT OTHERWISE relocalize(); return; } // RESET LOCALIZING FLAG robot.localizing = false; LCD.drawString(" ", 0, 7); } /** * Localizes using falling edge method with outermost ultrasonic sensor * and corrects odometer */ public void localizeSonicly() { // SET LOCALIZING FLAG robot.localizing = true; LCD.drawString("LOCATING...", 0, 7); // nav.setMotorRotateSpeed(480); // if (isWall(FRONT)) { // if (isWall(LEFT)) { // LCD.drawInt(1, 0, 6); // robot.leftMotor.forward(); // robot.rightMotor.backward(); // while (isWall(RIGHT)); // Sound.beep(); // nav.turn(-Math.PI / 3); // } else { // LCD.drawInt(2, 0, 6); // robot.leftMotor.backward(); // robot.rightMotor.forward(); // while (isWall(LEFT)); // Sound.beep(); // nav.turn(-Math.PI / 6); // } // } else { // if (isWall(LEFT)) { // LCD.drawInt(3, 0, 6); // robot.leftMotor.forward(); // robot.rightMotor.backward(); // while (isWall(LEFT)); // Sound.beep(); // nav.turn(Math.PI / 6); // } else { // LCD.drawInt(4, 0, 6); // robot.leftMotor.backward(); // robot.rightMotor.forward(); // while (!isWall(LEFT)); // Sound.beep(); // nav.turn(-Math.PI / 6); // } // } double firstAngle, secondAngle, deltaTheta; // ROTATE THE ROBOT UNTIL IT SEES NO WALL robot.leftMotor.forward(); robot.rightMotor.backward(); while (isWall(RIGHT)); // PLAY SOUND Sound.playTone(3000,100); // KEEP ROTATING UNTIL THE ROBOT SEES A WALL, THEN LATCH THE ANGLE while (!isWall(RIGHT)); firstAngle = Math.toDegrees(odometer.getTheta()); // PLAY LOWER FREQUENCY SOUND Sound.playTone(2000,100); // SWITCH DIRECTION AND WAIT UNTIL IT SEES NO WALL robot.leftMotor.backward(); robot.rightMotor.forward(); while (isWall(LEFT)); // PLAY HIGHER FREQUENCY SOUND Sound.playTone(3000,100); // KEEP ROTATING UNTIL THE ROBOT SEES A WALL, THEN LATCH THE ANGLE while (!isWall(LEFT)); secondAngle = Math.toDegrees(odometer.getTheta()); // PLAY LOWER FREQUENCY SOUND Sound.playTone(2000,100); // MEASURE ORIENTATION deltaTheta = (secondAngle + firstAngle) / 2 - 50; // UPDATE THE ODOMETER POSITION odometer.setTheta(Math.toRadians(secondAngle - deltaTheta)); // RESET LOCALIZING FLAG robot.localizing = false; LCD.drawString(" ", 0, 7); // STOP nav.stop(); } /** * Localizes using downward facing color sensors and corrects odometer */ public void localizeLightly() { // SET LOCALIZING FLAG robot.localizing = true; LCD.drawString("LOCATING...", 0, 7); // SET COLOR SENSOR FLOODLIGHT robot.leftColor.setFloodlight(true); robot.rightColor.setFloodlight(true); // GO FORWARD robot.leftMotor.forward(); robot.rightMotor.forward(); robot.leftMotor.setSpeed(250); robot.rightMotor.setSpeed(250); // THIS WILL MAKE THE ROBOT STOP ON THE X AXIS CORRECTING THE Y COORDINATES // WILL MOVE EACH TIRE UNTIL IT REACHES A GRIDLINE, STOPPING DIRECTLY ON THE LINE boolean leftDone = false, rightDone = false; while (!leftDone || !rightDone) { if (!leftDone && isLine(LEFT)) { Sound.beep(); robot.leftMotor.stop(true); leftDone = true; } if (!rightDone && isLine(RIGHT)) { Sound.beep(); robot.rightMotor.stop(true); rightDone = true; } } // SETS THE ODOMETER AT 90 DEGREES odometer.setPosition(new double[] {0, 0, Math.PI / 2}, new boolean[] {true, true, true}); // TURN TO 0 DEGREES TO FIX THE X COORDINATES robot.leftMotor.rotate(-convertAngle(robot.leftTurningRadius, -Math.PI / 2), true); robot.rightMotor.rotate(convertAngle(robot.rightTurningRadius, -Math.PI / 2), false); // GO FORWARD robot.leftMotor.forward(); robot.rightMotor.forward(); robot.leftMotor.setSpeed(250); robot.rightMotor.setSpeed(250); // THIS WILL MAKE THE ROBOT STOP ON THE Y AXIS CORRECTING THE X COORDINATES // WILL MOVE EACH TIRE UNTIL IT REACHES A GRIDLINE, STOPPING DIRECTLY ON THE LINE leftDone = false; rightDone = false; while (!leftDone || !rightDone) { if (!leftDone && isLine(LEFT)) { Sound.beep(); robot.leftMotor.stop(true); leftDone = true; } if (!rightDone && isLine(RIGHT)) { Sound.beep(); robot.rightMotor.stop(true); rightDone = true; } } // RESET COLOR SENSOR FLOODLIGHT robot.leftColor.setFloodlight(false); robot.rightColor.setFloodlight(false); // SETS THE ODOMETER AT 0 DEGREES odometer.setPosition(new double[] {-4.2, -4.2, 0}, new boolean[] {true, true, true}); // RESET LOCALIZING FLAG robot.localizing = false; LCD.drawString(" ", 0, 7); } /** * Computes the angle each wheel should rotate * in order to travel a certain distance * * @param radius radius in centimeters * @param distance distance in centimeters * * @return angle (in degrees) each wheel should rotate */ private int convertDistance(double radius, double distance) { return (int) ((180.0 * distance) / (Math.PI * radius)); } /** * Computes the angle each wheel should rotate * in order to rotate in place a certain angle * * @param radius radius in centimeters * @param angle angle in radians * * @return angle (in degrees) each wheel should rotate */ private int convertAngle(double radius, double angle) { return convertDistance(radius, robot.width * angle / 2.0); } /** * Returns whether a wall is detected by the selected ultrasonic sensor * * @param side select color sensor, 1 for RIGHT and 0 for LEFT * * @return <code>true</code> if wall detected; <code>false</code> otherwise */ private boolean isWall(int side) { // SELECT CORRECT ULTRASONIC SENSOR UltrasonicSensor sonic; if (side == RIGHT) sonic = robot.rightSonic; else if (side == LEFT) sonic = robot.leftSonic; else sonic = robot.centerSonic; // GET DISTANCE distance[side][sonicCounter[side]++] = sonic.getDistance(); if (sonicCounter[side] == distance[0].length) sonicCounter[side] = 0; // COMPUTE AVERAGE int sum = 0; for (int i = 0; i < distance[side].length; i++) sum += distance[side][i]; int avg = sum / distance[side].length; // ANALYZE if (avg < 30) { return true; } else return false; } /** * Returns whether a line is under the selected color sensor is above a * a black line * * @param side select color sensor, 1 for RIGHT and 0 for LEFT * * @return <code>true</code> if line detected; <code>false</code> otherwise */ public boolean isLine(int side) { // SELECT CORRECT COLOR SENSOR ColorSensor color = (side == RIGHT) ? robot.rightColor : robot.leftColor; // // GET LIGHT VALUE // intensity[side][lightCounter[side]++] = color.getRawLightValue(); // if (lightCounter[side] == intensity[side].length) // lightCounter[side] = 0; // for (int i = 0; i < intensity[side].length; i++) // sortedIntensity[i] = intensity[side][i]; // Arrays.sort(sortedIntensity); // // COMPUTE AVERAGE MEDIAN // int sum = 0; // for (int i = 3; i < sortedIntensity.length - 3; i++) // sum += sortedIntensity[i]; // int median = sum / (sortedIntensity.length - 6); // LCD.drawString(format(median), 0, 6 + side); // // ANALYZE // if (median <= threshold[side]) { // for (int i = 0; i < intensity[side].length; i++) // intensity[side][i] = 600; // return true; // } if (color.getRawLightValue() < threshold[side]) return true; return false; } /** * Returns a fixed width formatted string to fit the display nicely * * @param x integer to format * * @return the formatted number */ private String format(int x) { if (x / 100 > 0) return String.valueOf(x); else if (x / 10 > 0) return "0" + String.valueOf(x); else return "00" + String.valueOf(x); } }
anassinator/turpis-lobortis
Localizer.java
Java
mit
22,054
version https://git-lfs.github.com/spec/v1 oid sha256:0680588e6712ebab3160ef2c9e5754716d6d2d05b09790964fe828cba5abf8e2 size 2189
yogeshsaroya/new-cdnjs
ajax/libs/openlayers/2.12/lib/OpenLayers/Format/WMSCapabilities/v1_3.min.js
JavaScript
mit
129
/* * Encog(tm) Core v3.2 - Java Version * http://www.heatonresearch.com/encog/ * https://github.com/encog/encog-java-core * Copyright 2008-2013 Heaton Research, 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. * * For more information on Heaton Research copyrights, licenses * and trademarks visit: * http://www.heatonresearch.com/copyright */ package org.encog.ml; import java.util.Map; /** * Defines a Machine Learning Method that holds properties. */ public interface MLProperties extends MLMethod { /** * @return A map of all properties. */ Map<String, String> getProperties(); /** * Get the specified property as a double. * <p/> * @param name * The name of the property. * <p/> * @return The property as a double. */ double getPropertyDouble(final String name); /** * Get the specified property as a long. * <p/> * @param name * The name of the specified property. * <p/> * @return The value of the specified property. */ long getPropertyLong(final String name); /** * Get the specified property as a string. * <p/> * @param name * The name of the property. * <p/> * @return The value of the property. */ String getPropertyString(final String name); /** * Set a property as a double. * <p/> * @param name * The name of the property. * @param d * The value of the property. */ void setProperty(final String name, final double d); /** * Set a property as a long. * <p/> * @param name * The name of the property. * @param l * The value of the property. */ void setProperty(final String name, final long l); /** * Set a property as a double. * <p/> * @param name * The name of the property. * @param value * The value of the property. */ void setProperty(final String name, final String value); /** * Update any objeccts when a property changes. */ void updateProperties(); }
ladygagapowerbot/bachelor-thesis-implementation
lib/Encog/src/main/java/org/encog/ml/MLProperties.java
Java
mit
2,718
package com.hundsun.jresplus.web.cache; import java.io.Serializable; import javax.servlet.http.Cookie; public class PageCookie implements Serializable { private static final long serialVersionUID = 8628587700329421486L; private String name; private String value; private String comment; private String domain; private int maxAge; private String path; private boolean secure; private int version; private boolean httpOnly = false; private boolean isNosession = false; public PageCookie(Cookie cookie) { this.name = cookie.getName(); this.value = cookie.getValue(); this.comment = cookie.getComment(); this.domain = cookie.getDomain(); this.maxAge = cookie.getMaxAge(); this.path = cookie.getPath(); this.secure = cookie.getSecure(); this.version = cookie.getVersion(); if (cookie instanceof com.hundsun.jresplus.web.nosession.cookie.Cookie) { com.hundsun.jresplus.web.nosession.cookie.Cookie nosessionCookie = (com.hundsun.jresplus.web.nosession.cookie.Cookie) cookie; httpOnly = nosessionCookie.isHttpOnly(); isNosession = true; } } public Cookie toCookie() { Cookie cookie; if (isNosession) { com.hundsun.jresplus.web.nosession.cookie.Cookie nosessionCookie = new com.hundsun.jresplus.web.nosession.cookie.Cookie( this.name, this.value); nosessionCookie.setHttpOnly(httpOnly); cookie = nosessionCookie; } else { cookie = new Cookie(this.name, this.value); } cookie.setComment(this.comment); if (this.domain != null) { cookie.setDomain(this.domain); } cookie.setMaxAge(this.maxAge); cookie.setPath(this.path); cookie.setSecure(this.secure); cookie.setVersion(this.version); return cookie; } }
sdgdsffdsfff/jresplus
jresplus-mvc/src/main/java/com/hundsun/jresplus/web/cache/PageCookie.java
Java
mit
1,688
<?php /* * The MIT License * * Copyright (c) 2010 Johannes Mueller <circus2(at)web.de> * Copyright (c) 2012-2013 Toha <tohenk@yahoo.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ namespace MwbExporter\Model; use MwbExporter\Writer\WriterInterface; class Schema extends Base { /** * @var \MwbExporter\Model\Tables */ protected $tables = null; /** * @var \MwbExporter\Model\Views */ protected $views = null; /** * @var string */ protected $name = null; protected function init() { $elems = $this->node->xpath("value[@key='name']"); $this->name = (string) $elems[0]; $elems = $this->node->xpath("value[@key='tables']"); $this->tables = $this->getDocument()->getFormatter()->createTables($this, $elems[0]); $elems = $this->node->xpath("value[@key='views']"); $this->views = $this->getDocument()->getFormatter()->createViews($this, $elems[0]); } /** * Get tables model. * * @return \MwbExporter\Model\Tables */ public function getTables() { return $this->tables; } /** * Get views model. * * @return \MwbExporter\Model\Views */ public function getViews() { return $this->views; } /** * Get schema name. * * @return string */ public function getName() { return $this->name; } /** * (non-PHPdoc). * * @see \MwbExporter\Model\Base::write() */ public function write(WriterInterface $writer) { $this->writeSchema($writer); return $this; } /** * Write schema entity as code. * * @param \MwbExporter\Writer\WriterInterface $writer * * @return \MwbExporter\Model\Schema */ public function writeSchema(WriterInterface $writer) { $this->getDocument()->addLog(sprintf('Processing schema %s:', $this->name)); $this->getDocument()->addLog('Processing tables:'); $this->getTables()->write($writer); $this->getDocument()->addLog('Processing views:'); $this->getViews()->write($writer); return $this; } /** * (non-PHPdoc). * * @see \MwbExporter\Model\Base::getVars() */ protected function getVars() { return array('%schema%' => $this->getName()); } }
turnaev/mysql-workbench-schema-exporter
lib/MwbExporter/Model/Schema.php
PHP
mit
3,426
Aliasify is a [transform](https://github.com/substack/node-browserify#btransformtr) for [browserify](https://github.com/substack/node-browserify) which lets you rewrite calls to `require`. Installation ============ Install with `npm install --save-dev aliasify`. Usage ===== To use, add a section to your package.json: { "aliasify": { "aliases": { "d3": "./shims/d3.js", "underscore": "lodash" } } } Now if you have a file in src/browserify/index.js which looks like: d3 = require('d3') _ = require('underscore') ... This will automatically be transformed to: d3 = require('../../shims/d3.js') _ = require('lodash') ... Any replacement that starts with a "." will be resolved as a relative path (as "d3" above.) Replacements that start with any other character will be replaced verbatim (as with "underscore" above.) Configuration ============= Configuration can be loaded in multiple ways; You can put your configuration directly in package.json, as in the example above, or you can use an external json or js file. In your package.json: { "aliasify": "./aliasifyConfig.js" } Then in aliasifyConfig.js: module.exports = { aliases: { "d3": "./shims/d3.js" }, verbose: false }; Note that using a js file means you can change your configuration based on environment variables. Alternatively, if you're using the Browserify API, you can configure your aliasify programatically: aliasifyConfig = { aliases: { "d3": "./shims/d3.js" }, verbose: false } var b = browserify(); b.transform(aliasify, aliasifyConfig); note that using the browserify API, './shims/d3.js' will be resolved against the current working directory. Configuration options: * `aliases` - An object mapping aliases to their replacements. * `verbose` - If true, then aliasify will print modificiations it is making to stdout. * `configDir` - An absolute path to resolve relative paths against. If you're using package.json, this will automatically be filled in for you with the directory containing package.json. If you're using a .js file for configuration, set this to `__dirname`. * `appliesTo` - Controls which files will be transformed. By default, only JS type files will be transformed ('.js', '.coffee', etc...). See [browserify-trasnform-tools documentation](https://github.com/benbria/browserify-transform-tools/wiki/Transform-Configuration#common-configuration) for details. Relative Requires ================= When you specify: aliases: { "d3": "./shims/d3.js" } The "./" means this will be resolved relative to the current working directory (or relative to the configuration file which contains the line, in the case where configuration is loaded from package.json.) Sometimes it is desirable to literally replace an alias; to resolve the alias relative to the file which is doing the `require` call. In this case you can do: aliases: { "d3": {"relative": "./shims/d3.js"} } This will cause all occurences of `require("d3")` to be replaced with `require("./shims/d3.js")`, regardless of where those files are in the directory tree. Alternatives ============ `aliasify` is essentially a fancy version of the [`browser` field](https://gist.github.com/defunctzombie/4339901#replace-specific-files---advanced) from package.json, which is [interpreted](https://github.com/substack/node-browserify#packagejson) by browserify. Using the `browser` field is probably going to be faster, as it doesn't involve running a transform on each of your files. On the other hand, `aliasify` gives you a finer degree of control and can be run before other transforms (for example, you can run `aliasify` before [debowerify](https://github.com/eugeneware/debowerify), which will let you replace certain components that debowerify would otherwise replace.)
Tearund/stories
node_modules/cordova/node_modules/cordova-lib/node_modules/aliasify/README.md
Markdown
mit
4,002
import { LoginForm } from "v2/Components/Authentication/Desktop/LoginForm" import { ModalType } from "v2/Components/Authentication/Types" import { mount, ReactWrapper } from "enzyme" import React from "react" import { Intent, ContextModule } from "@artsy/cohesion" import { ModalManager, ModalManagerProps, } from "v2/Components/Authentication/Desktop/ModalManager" const getWrapper = ( props?: ModalManagerProps ): ReactWrapper<ModalManagerProps> => { const wrapper = mount( <ModalManager submitUrls={{ apple: "/users/auth/apple", facebook: "/users/auth/facebook", login: "/login", signup: "/signup", forgot: "/forgot", }} csrf="CSRF_TOKEN" {...props} /> ) return wrapper } describe("ModalManager", () => { it("renders the right form when a type is passed in", () => { const wrapper = getWrapper() expect(wrapper.find(LoginForm).exists).toBeTruthy() }) it("sets the currentType if openModal is called", () => { const wrapper = getWrapper() const manager = wrapper.instance() as ModalManager manager.openModal({ mode: ModalType.login, intent: Intent.login, contextModule: ContextModule.header, }) expect(manager.state.currentType).toEqual("login") }) it("sets the currentType to null if closeModal is called", () => { const wrapper = getWrapper() const manager = wrapper.instance() as ModalManager manager.closeModal() expect(manager.state.currentType).toEqual(null) }) it("prevents scrolling when opened", () => { const wrapper = getWrapper() const manager = wrapper.instance() as ModalManager expect(document.body.style.overflowY).toEqual("visible") manager.openModal({ mode: ModalType.login, intent: Intent.login, contextModule: ContextModule.header, }) expect(document.body.style.overflowY).toEqual("hidden") }) it("handles type changes", () => { const wrapper = getWrapper() const manager = wrapper.instance() as ModalManager manager.openModal({ mode: ModalType.login, intent: Intent.login, contextModule: ContextModule.header, }) manager.handleTypeChange("signup") expect(manager.state.currentType).toEqual("signup") expect(manager.state.switchedForms).toEqual(true) expect(manager.state.options.mode).toEqual("signup") }) it("returns the right subtitle", () => { const wrapper = getWrapper() const manager = wrapper.instance() as ModalManager manager.openModal({ mode: ModalType.login, intent: Intent.signup, copy: "Foobar", contextModule: ContextModule.header, }) expect(manager.getSubtitle()).toEqual("Foobar") manager.handleTypeChange("signup") expect(manager.getSubtitle()).toEqual("Sign up") manager.handleTypeChange("forgot") expect(manager.getSubtitle()).toEqual("Reset your password") }) })
erikdstock/force
src/v2/Components/Authentication/__tests__/Desktop/ModalManager.jest.tsx
TypeScript
mit
2,951
<!doctype html> <html> <head> <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon"> <title>ellipseelement.js (Closure Library API Documentation - JavaScript)</title> <link rel="stylesheet" href="static/css/base.css"> <link rel="stylesheet" href="static/css/doc.css"> <link rel="stylesheet" href="static/css/sidetree.css"> <link rel="stylesheet" href="static/css/prettify.css"> <script> var _staticFilePath = "static/"; </script> <script src="static/js/doc.js"> </script> <meta charset="utf8"> </head> <body onload="prettyPrint()"> <div id="header"> <div class="g-section g-tpl-50-50 g-split"> <div class="g-unit g-first"> <a id="logo" href="index.html">Closure Library API Documentation</a> </div> <div class="g-unit"> <div class="g-c"> <strong>Go to class or file:</strong> <input type="text" id="ac"> </div> </div> </div> </div> <div class="clear"></div> <h2><a href="closure_goog_graphics_ellipseelement.js.html">ellipseelement.js</a></h2> <pre class="prettyprint lang-js"> <a name="line1"></a>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); <a name="line2"></a>// you may not use this file except in compliance with the License. <a name="line3"></a>// You may obtain a copy of the License at <a name="line4"></a>// <a name="line5"></a>// http://www.apache.org/licenses/LICENSE-2.0 <a name="line6"></a>// <a name="line7"></a>// Unless required by applicable law or agreed to in writing, software <a name="line8"></a>// distributed under the License is distributed on an &quot;AS IS&quot; BASIS, <a name="line9"></a>// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <a name="line10"></a>// See the License for the specific language governing permissions and <a name="line11"></a>// limitations under the License. <a name="line12"></a> <a name="line13"></a>// Copyright 2007 Google Inc. All Rights Reserved. <a name="line14"></a> <a name="line15"></a> <a name="line16"></a>/** <a name="line17"></a> * @fileoverview A thin wrapper around the DOM element for ellipses. <a name="line18"></a> */ <a name="line19"></a> <a name="line20"></a> <a name="line21"></a>goog.provide(&#39;goog.graphics.EllipseElement&#39;); <a name="line22"></a> <a name="line23"></a>goog.require(&#39;goog.graphics.StrokeAndFillElement&#39;); <a name="line24"></a> <a name="line25"></a> <a name="line26"></a>/** <a name="line27"></a> * Interface for a graphics ellipse element. <a name="line28"></a> * You should not construct objects from this constructor. The graphics <a name="line29"></a> * will return an implementation of this interface for you. <a name="line30"></a> * @param {Element} element The DOM element to wrap. <a name="line31"></a> * @param {goog.graphics.AbstractGraphics} graphics The graphics creating <a name="line32"></a> * this element. <a name="line33"></a> * @param {goog.graphics.Stroke?} stroke The stroke to use for this element. <a name="line34"></a> * @param {goog.graphics.Fill?} fill The fill to use for this element. <a name="line35"></a> * @constructor <a name="line36"></a> * @extends {goog.graphics.StrokeAndFillElement} <a name="line37"></a> */ <a name="line38"></a>goog.graphics.EllipseElement = function(element, graphics, stroke, fill) { <a name="line39"></a> goog.graphics.StrokeAndFillElement.call(this, element, graphics, stroke, <a name="line40"></a> fill); <a name="line41"></a>}; <a name="line42"></a>goog.inherits(goog.graphics.EllipseElement, goog.graphics.StrokeAndFillElement); <a name="line43"></a> <a name="line44"></a> <a name="line45"></a>/** <a name="line46"></a> * Update the center point of the ellipse. <a name="line47"></a> * @param {number} cx Center X coordinate. <a name="line48"></a> * @param {number} cy Center Y coordinate. <a name="line49"></a> */ <a name="line50"></a>goog.graphics.EllipseElement.prototype.setCenter = goog.abstractMethod; <a name="line51"></a> <a name="line52"></a> <a name="line53"></a>/** <a name="line54"></a> * Update the radius of the ellipse. <a name="line55"></a> * @param {number} rx Radius length for the x-axis. <a name="line56"></a> * @param {number} ry Radius length for the y-axis. <a name="line57"></a> */ <a name="line58"></a>goog.graphics.EllipseElement.prototype.setRadius = goog.abstractMethod; </pre> </body> </html>
yesudeep/puppy
tools/google-closure-library/closure/goog/docs/closure_goog_graphics_ellipseelement.js.source.html
HTML
mit
4,384
// Copyright (c) 2013-2015 Sandstorm Development Group, Inc. and contributors // Licensed under the MIT License: // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #![crate_name="calculator"] #![crate_type="bin"] extern crate capnp; extern crate capnp_rpc; pub mod calculator_capnp { include!(concat!(env!("OUT_DIR"), "/calculator_capnp.rs")); } pub mod client; pub mod server; pub fn main() { let args : Vec<String> = ::std::env::args().collect(); if args.len() >= 2 { match &args[1][..] { "client" => return client::main(), "server" => return server::main(), _ => (), } } println!("usage: {} [client | server] ADDRESS", args[0]); }
tempbottle/capnp-rpc-rust
examples/calculator/main.rs
Rust
mit
1,734
/** * @module Joy */ /** * This class is used on SpriteSheet's `animations` attribute. * * @class SpriteAnimation * @constructor */ var SpriteAnimation = function (options) { /** * @attribute parent * @type {SpriteSheet} */ this.parent = options.parent; /** * @attribute name * @type {String} */ this.name = options.name; /** * @attribute framesPerSecond * @type {Number} */ this.framesPerSecond = options.framesPerSecond; /** * @attribute frames * @type {Array} */ this.frames = options.frames; /** * @attribute firstFrame * @type {Number} */ this.firstFrame = this.frames[0]; /** * @attribute lastFrame * @type {Number} */ this.lastFrame = lastFrame = this.frames[1] || this.frames[0]; /** * @attribute currentFrame * @type {Number} */ this.currentFrame = 0; }; /** * Start the animation * @method start */ SpriteAnimation.prototype.start = function () { this.currentFrame = this.firstFrame; // Create the interval to change through frames var self = this; this._interval = setInterval(function(){ self.update(); }, 1000 / this.framesPerSecond); }; /** * Stops the animation * @method stop */ SpriteAnimation.prototype.stop = function () { if (this._interval) { clearInterval(this._interval); } return this; }; /** * Update frame animation * @method update */ SpriteAnimation.prototype.update = function () { if (this.currentFrame == this.lastFrame) { this.currentFrame = this.firstFrame; // Reached the first frame, trigger animation start callback. this.parent.trigger('animationStart'); } else { this.currentFrame = this.currentFrame + 1; // Reached the last frame, trigger animation end callback. if (this.currentFrame == this.lastFrame) { this.parent.trigger('animationEnd'); } } }; module.exports = SpriteAnimation;
royquintanar/joy.js
lib/render/sprite_animation.js
JavaScript
mit
1,903
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 'use strict'; module.metadata = { 'stability': 'experimental', 'engines': { 'Firefox': '> 28' } }; const { Class } = require('../../core/heritage'); const { merge } = require('../../util/object'); const { Disposable } = require('../../core/disposable'); const { on, off, emit, setListeners } = require('../../event/core'); const { EventTarget } = require('../../event/target'); const { getNodeView } = require('../../view/core'); const view = require('./view'); const { toggleButtonContract, toggleStateContract } = require('./contract'); const { properties, render, state, register, unregister, setStateFor, getStateFor, getDerivedStateFor } = require('../state'); const { events: stateEvents } = require('../state/events'); const { events: viewEvents } = require('./view/events'); const events = require('../../event/utils'); const { getActiveTab } = require('../../tabs/utils'); const { id: addonID } = require('../../self'); const { identify } = require('../id'); const buttons = new Map(); const toWidgetId = id => ('toggle-button--' + addonID.toLowerCase()+ '-' + id). replace(/[^a-z0-9_-]/g, ''); const ToggleButton = Class({ extends: EventTarget, implements: [ properties(toggleStateContract), state(toggleStateContract), Disposable ], setup: function setup(options) { let state = merge({ disabled: false, checked: false }, toggleButtonContract(options)); let id = toWidgetId(options.id); register(this, state); // Setup listeners. setListeners(this, options); buttons.set(id, this); view.create(merge({ type: 'checkbox' }, state, { id: id })); }, dispose: function dispose() { let id = toWidgetId(this.id); buttons.delete(id); off(this); view.dispose(id); unregister(this); }, get id() { return this.state().id; }, click: function click() { return view.click(toWidgetId(this.id)); } }); exports.ToggleButton = ToggleButton; identify.define(ToggleButton, ({id}) => toWidgetId(id)); getNodeView.define(ToggleButton, button => view.nodeFor(toWidgetId(button.id)) ); var toggleButtonStateEvents = events.filter(stateEvents, e => e.target instanceof ToggleButton); var toggleButtonViewEvents = events.filter(viewEvents, e => buttons.has(e.target)); var clickEvents = events.filter(toggleButtonViewEvents, e => e.type === 'click'); var updateEvents = events.filter(toggleButtonViewEvents, e => e.type === 'update'); on(toggleButtonStateEvents, 'data', ({target, window, state}) => { let id = toWidgetId(target.id); view.setIcon(id, window, state.icon); view.setLabel(id, window, state.label); view.setDisabled(id, window, state.disabled); view.setChecked(id, window, state.checked); view.setBadge(id, window, state.badge, state.badgeColor); }); on(clickEvents, 'data', ({target: id, window, checked }) => { let button = buttons.get(id); let windowState = getStateFor(button, window); let newWindowState = merge({}, windowState, { checked: checked }); setStateFor(button, window, newWindowState); let state = getDerivedStateFor(button, getActiveTab(window)); emit(button, 'click', state); emit(button, 'change', state); }); on(updateEvents, 'data', ({target: id, window}) => { render(buttons.get(id), window); });
freesamael/npu-moboapp-programming-fall-2015
b2g-dist-win32-20151125/modules/commonjs/sdk/ui/button/toggle.js
JavaScript
mit
3,512
{ matrix_id: '1962', name: 'Franz9', group: 'JGD_Franz', description: 'Cohomology of various rings, from Matthias Franz, Univ. Konstanz, Germany', author: 'M. Franz', editor: 'J.-G. Dumas', date: '2008', kind: 'combinatorial problem', problem_2D_or_3D: '0', num_rows: '19588', num_cols: '4164', nonzeros: '97508', num_explicit_zeros: '0', num_strongly_connected_components: '1', num_dmperm_blocks: '1', structural_full_rank: 'true', structural_rank: '4164', pattern_symmetry: '0.000', numeric_symmetry: '0.000', rb_type: 'integer', structure: 'rectangular', cholesky_candidate: 'no', positive_definite: 'no', notes: 'Cohomology of various rings, from Matthias Franz, Univ. Konstanz, Germany From Jean-Guillaume Dumas\' Sparse Integer Matrix Collection, http://ljk.imag.fr/membres/Jean-Guillaume.Dumas/simc.html Filename in JGD collection: Franz/19588x4164 ', norm: '1.743560e+01', min_singular_value: '1.192942e-15', condition_number: '14615626275866188', svd_rank: '3545', sprank_minus_rank: '619', null_space_dimension: '619', full_numerical_rank: 'no', svd_gap: '10448823754832.097656', image_files: 'Franz9.png,Franz9_svd.png,Franz9_graph.gif,', }
ScottKolo/UFSMC-Web
db/collection_data/matrices/JGD_Franz/Franz9.rb
Ruby
mit
1,416
"""Representation of Z-Wave binary_sensors.""" from openzwavemqtt.const import CommandClass, ValueIndex, ValueType from homeassistant.components.binary_sensor import ( DOMAIN as BINARY_SENSOR_DOMAIN, BinarySensorDeviceClass, BinarySensorEntity, ) from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity_platform import AddEntitiesCallback from .const import DATA_UNSUBSCRIBE, DOMAIN from .entity import ZWaveDeviceEntity NOTIFICATION_TYPE = "index" NOTIFICATION_VALUES = "values" NOTIFICATION_DEVICE_CLASS = "device_class" NOTIFICATION_SENSOR_ENABLED = "enabled" NOTIFICATION_OFF_VALUE = "off_value" NOTIFICATION_VALUE_CLEAR = 0 # Translation from values in Notification CC to binary sensors # https://github.com/OpenZWave/open-zwave/blob/master/config/NotificationCCTypes.xml NOTIFICATION_SENSORS = [ { # Index 1: Smoke Alarm - Value Id's 1 and 2 # Assuming here that Value 1 and 2 are not present at the same time NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_SMOKE_ALARM, NOTIFICATION_VALUES: [1, 2], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.SMOKE, }, { # Index 1: Smoke Alarm - All other Value Id's # Create as disabled sensors NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_SMOKE_ALARM, NOTIFICATION_VALUES: [3, 4, 5, 6, 7, 8], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.SMOKE, NOTIFICATION_SENSOR_ENABLED: False, }, { # Index 2: Carbon Monoxide - Value Id's 1 and 2 NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_CARBON_MONOOXIDE, NOTIFICATION_VALUES: [1, 2], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.GAS, }, { # Index 2: Carbon Monoxide - All other Value Id's NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_CARBON_MONOOXIDE, NOTIFICATION_VALUES: [4, 5, 7], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.GAS, NOTIFICATION_SENSOR_ENABLED: False, }, { # Index 3: Carbon Dioxide - Value Id's 1 and 2 NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_CARBON_DIOXIDE, NOTIFICATION_VALUES: [1, 2], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.GAS, }, { # Index 3: Carbon Dioxide - All other Value Id's NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_CARBON_DIOXIDE, NOTIFICATION_VALUES: [4, 5, 7], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.GAS, NOTIFICATION_SENSOR_ENABLED: False, }, { # Index 4: Heat - Value Id's 1, 2, 5, 6 (heat/underheat) NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_HEAT, NOTIFICATION_VALUES: [1, 2, 5, 6], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.HEAT, }, { # Index 4: Heat - All other Value Id's NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_HEAT, NOTIFICATION_VALUES: [3, 4, 8, 10, 11], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.HEAT, NOTIFICATION_SENSOR_ENABLED: False, }, { # Index 5: Water - Value Id's 1, 2, 3, 4 NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_WATER, NOTIFICATION_VALUES: [1, 2, 3, 4], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.MOISTURE, }, { # Index 5: Water - All other Value Id's NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_WATER, NOTIFICATION_VALUES: [5], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.MOISTURE, NOTIFICATION_SENSOR_ENABLED: False, }, { # Index 6: Access Control - Value Id's 1, 2, 3, 4 (Lock) NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_ACCESS_CONTROL, NOTIFICATION_VALUES: [1, 2, 3, 4], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.LOCK, }, { # Index 6: Access Control - Value Id 22 (door/window open) NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_ACCESS_CONTROL, NOTIFICATION_VALUES: [22], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.DOOR, NOTIFICATION_OFF_VALUE: 23, }, { # Index 7: Home Security - Value Id's 1, 2 (intrusion) # Assuming that value 1 and 2 are not present at the same time NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_HOME_SECURITY, NOTIFICATION_VALUES: [1, 2], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.SAFETY, }, { # Index 7: Home Security - Value Id's 3, 4, 9 (tampering) NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_HOME_SECURITY, NOTIFICATION_VALUES: [3, 4, 9], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.SAFETY, }, { # Index 7: Home Security - Value Id's 5, 6 (glass breakage) # Assuming that value 5 and 6 are not present at the same time NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_HOME_SECURITY, NOTIFICATION_VALUES: [5, 6], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.SAFETY, }, { # Index 7: Home Security - Value Id's 7, 8 (motion) NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_HOME_SECURITY, NOTIFICATION_VALUES: [7, 8], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.MOTION, }, { # Index 8: Power management - Values 1...9 NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_POWER_MANAGEMENT, NOTIFICATION_VALUES: [1, 2, 3, 4, 5, 6, 7, 8, 9], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.POWER, NOTIFICATION_SENSOR_ENABLED: False, }, { # Index 8: Power management - Values 10...15 # Battery values (mutually exclusive) NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_POWER_MANAGEMENT, NOTIFICATION_VALUES: [10, 11, 12, 13, 14, 15], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.POWER, NOTIFICATION_SENSOR_ENABLED: False, NOTIFICATION_OFF_VALUE: None, }, { # Index 9: System - Value Id's 1, 2, 6, 7 NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_SYSTEM, NOTIFICATION_VALUES: [1, 2, 6, 7], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.PROBLEM, NOTIFICATION_SENSOR_ENABLED: False, }, { # Index 10: Emergency - Value Id's 1, 2, 3 NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_EMERGENCY, NOTIFICATION_VALUES: [1, 2, 3], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.PROBLEM, }, { # Index 11: Clock - Value Id's 1, 2 NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_CLOCK, NOTIFICATION_VALUES: [1, 2], NOTIFICATION_DEVICE_CLASS: None, NOTIFICATION_SENSOR_ENABLED: False, }, { # Index 12: Appliance - All Value Id's NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_APPLIANCE, NOTIFICATION_VALUES: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, ], NOTIFICATION_DEVICE_CLASS: None, }, { # Index 13: Home Health - Value Id's 1,2,3,4,5 NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_APPLIANCE, NOTIFICATION_VALUES: [1, 2, 3, 4, 5], NOTIFICATION_DEVICE_CLASS: None, }, { # Index 14: Siren NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_SIREN, NOTIFICATION_VALUES: [1], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.SOUND, }, { # Index 15: Water valve # ignore non-boolean values NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_WATER_VALVE, NOTIFICATION_VALUES: [3, 4], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.PROBLEM, }, { # Index 16: Weather NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_WEATHER, NOTIFICATION_VALUES: [1, 2], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.PROBLEM, }, { # Index 17: Irrigation # ignore non-boolean values NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_IRRIGATION, NOTIFICATION_VALUES: [1, 2, 3, 4, 5], NOTIFICATION_DEVICE_CLASS: None, }, { # Index 18: Gas NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_GAS, NOTIFICATION_VALUES: [1, 2, 3, 4], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.GAS, }, { # Index 18: Gas NOTIFICATION_TYPE: ValueIndex.NOTIFICATION_GAS, NOTIFICATION_VALUES: [6], NOTIFICATION_DEVICE_CLASS: BinarySensorDeviceClass.PROBLEM, }, ] async def async_setup_entry( hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: AddEntitiesCallback, ) -> None: """Set up Z-Wave binary_sensor from config entry.""" @callback def async_add_binary_sensor(values): """Add Z-Wave Binary Sensor(s).""" async_add_entities(VALUE_TYPE_SENSORS[values.primary.type](values)) hass.data[DOMAIN][config_entry.entry_id][DATA_UNSUBSCRIBE].append( async_dispatcher_connect( hass, f"{DOMAIN}_new_{BINARY_SENSOR_DOMAIN}", async_add_binary_sensor ) ) @callback def async_get_legacy_binary_sensors(values): """Add Legacy/classic Z-Wave Binary Sensor.""" return [ZWaveBinarySensor(values)] @callback def async_get_notification_sensors(values): """Convert Notification values into binary sensors.""" sensors_to_add = [] for list_value in values.primary.value["List"]: # check if we have a mapping for this value for item in NOTIFICATION_SENSORS: if item[NOTIFICATION_TYPE] != values.primary.index: continue if list_value["Value"] not in item[NOTIFICATION_VALUES]: continue sensors_to_add.append( ZWaveListValueSensor( # required values values, list_value["Value"], item[NOTIFICATION_DEVICE_CLASS], # optional values item.get(NOTIFICATION_SENSOR_ENABLED, True), item.get(NOTIFICATION_OFF_VALUE, NOTIFICATION_VALUE_CLEAR), ) ) return sensors_to_add VALUE_TYPE_SENSORS = { ValueType.BOOL: async_get_legacy_binary_sensors, ValueType.LIST: async_get_notification_sensors, } class ZWaveBinarySensor(ZWaveDeviceEntity, BinarySensorEntity): """Representation of a Z-Wave binary_sensor.""" @property def is_on(self): """Return if the sensor is on or off.""" return self.values.primary.value @property def entity_registry_enabled_default(self) -> bool: """Return if the entity should be enabled when first added to the entity registry.""" # Legacy binary sensors are phased out (replaced by notification sensors) # Disable by default to not confuse users for item in self.values.primary.node.values(): if item.command_class == CommandClass.NOTIFICATION: # This device properly implements the Notification CC, legacy sensor can be disabled return False return True class ZWaveListValueSensor(ZWaveDeviceEntity, BinarySensorEntity): """Representation of a binary_sensor from values in the Z-Wave Notification CommandClass.""" def __init__( self, values, on_value, device_class=None, default_enabled=True, off_value=NOTIFICATION_VALUE_CLEAR, ): """Initialize a ZWaveListValueSensor entity.""" super().__init__(values) self._on_value = on_value self._device_class = device_class self._default_enabled = default_enabled self._off_value = off_value # make sure the correct value is selected at startup self._state = False self.on_value_update() @callback def on_value_update(self): """Call when a value is added/updated in the underlying EntityValues Collection.""" if self.values.primary.value["Selected_id"] == self._on_value: # Only when the active ID exactly matches our watched ON value, set sensor state to ON self._state = True elif self.values.primary.value["Selected_id"] == self._off_value: # Only when the active ID exactly matches our watched OFF value, set sensor state to OFF self._state = False elif ( self._off_value is None and self.values.primary.value["Selected_id"] != self._on_value ): # Off value not explicitly specified # Some values are reset by the simple fact they're overruled by another value coming in # For example the battery charging values in Power Management Index self._state = False @property def name(self): """Return the name of the entity.""" # Append value label to base name base_name = super().name value_label = "" for item in self.values.primary.value["List"]: if item["Value"] == self._on_value: value_label = item["Label"] break # Strip "on location" / "at location" from name # Note: We're assuming that we don't retrieve 2 values with different location value_label = value_label.split(" on ")[0] value_label = value_label.split(" at ")[0] return f"{base_name}: {value_label}" @property def unique_id(self): """Return the unique_id of the entity.""" unique_id = super().unique_id return f"{unique_id}.{self._on_value}" @property def is_on(self): """Return if the sensor is on or off.""" return self._state @property def device_class(self): """Return the class of this device, from component DEVICE_CLASSES.""" return self._device_class @property def entity_registry_enabled_default(self) -> bool: """Return if the entity should be enabled when first added to the entity registry.""" # We hide the more advanced sensors by default to not overwhelm users return self._default_enabled
rohitranjan1991/home-assistant
homeassistant/components/ozw/binary_sensor.py
Python
mit
14,428
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage * @package Mage_Core * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Store model * * @method Mage_Core_Model_Resource_Store _getResource() * @method Mage_Core_Model_Resource_Store getResource() * @method Mage_Core_Model_Store setCode(string $value) * @method Mage_Core_Model_Store setWebsiteId(int $value) * @method Mage_Core_Model_Store setGroupId(int $value) * @method Mage_Core_Model_Store setName(string $value) * @method int getSortOrder() * @method Mage_Core_Model_Store setSortOrder(int $value) * @method Mage_Core_Model_Store setIsActive(int $value) * * @category Mage * @package Mage_Core * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Core_Model_Store extends Mage_Core_Model_Abstract { /** * Entity name */ const ENTITY = 'core_store'; /** * Configuration pathes */ const XML_PATH_STORE_STORE_NAME = 'general/store_information/name'; /** * */ const XML_PATH_STORE_STORE_PHONE = 'general/store_information/phone'; /** * */ const XML_PATH_STORE_IN_URL = 'web/url/use_store'; /** * */ const XML_PATH_USE_REWRITES = 'web/seo/use_rewrites'; /** * */ const XML_PATH_UNSECURE_BASE_URL = 'web/unsecure/base_url'; /** * */ const XML_PATH_SECURE_BASE_URL = 'web/secure/base_url'; /** * */ const XML_PATH_SECURE_IN_FRONTEND = 'web/secure/use_in_frontend'; /** * */ const XML_PATH_SECURE_IN_ADMINHTML = 'web/secure/use_in_adminhtml'; /** * */ const XML_PATH_SECURE_BASE_LINK_URL = 'web/secure/base_link_url'; /** * */ const XML_PATH_UNSECURE_BASE_LINK_URL = 'web/unsecure/base_link_url'; /** * */ const XML_PATH_OFFLOADER_HEADER = 'web/secure/offloader_header'; /** * */ const XML_PATH_PRICE_SCOPE = 'catalog/price/scope'; /** * Price scope constants */ const PRICE_SCOPE_GLOBAL = 0; /** * */ const PRICE_SCOPE_WEBSITE = 1; /** * Possible URL types */ const URL_TYPE_LINK = 'link'; /** * */ const URL_TYPE_DIRECT_LINK = 'direct_link'; /** * */ const URL_TYPE_WEB = 'web'; /** * */ const URL_TYPE_SKIN = 'skin'; /** * */ const URL_TYPE_JS = 'js'; /** * */ const URL_TYPE_MEDIA = 'media'; /** * Code constants */ const DEFAULT_CODE = 'default'; /** * */ const ADMIN_CODE = 'admin'; /** * Cache tag */ const CACHE_TAG = 'store'; /** * Cookie name */ const COOKIE_NAME = 'store'; /** * Cookie currency key */ const COOKIE_CURRENCY = 'currency'; /** * Script name, which returns all the images */ const MEDIA_REWRITE_SCRIPT = 'get.php/'; /** * Cache flag * * @var boolean */ protected $_cacheTag = true; /** * Event prefix for model events * * @var string */ protected $_eventPrefix = 'store'; /** * Event object name * * @var string */ protected $_eventObject = 'store'; /** * Price filter * * @var Mage_Directory_Model_Currency_Filter */ protected $_priceFilter; /** * Website model * * @var Mage_Core_Model_Website */ protected $_website; /** * Group model * * @var Mage_Core_Model_Store_Group */ protected $_group; /** * Store configuration cache * * @var array|null */ protected $_configCache = null; /** * Base nodes of store configuration cache * * @var array */ protected $_configCacheBaseNodes = array(); /** * Directory cache * * @var array */ protected $_dirCache = array(); /** * URL cache * * @var array */ protected $_urlCache = array(); /** * Base URL cache * * @var array */ protected $_baseUrlCache = array(); /** * Session entity * * @var Mage_Core_Model_Session_Abstract */ protected $_session; /** * Flag that shows that backend URLs are secure * * @var boolean|null */ protected $_isAdminSecure = null; /** * Flag that shows that frontend URLs are secure * * @var boolean|null */ protected $_isFrontSecure = null; /** * Store frontend name * * @var string|null */ protected $_frontendName = null; /** * Readonly flag * * @var bool */ private $_isReadOnly = false; /** * Initialize object */ protected function _construct() { $this->_init('core/store'); $this->_configCacheBaseNodes = array( self::XML_PATH_PRICE_SCOPE, self::XML_PATH_SECURE_BASE_URL, self::XML_PATH_SECURE_IN_ADMINHTML, self::XML_PATH_SECURE_IN_FRONTEND, self::XML_PATH_STORE_IN_URL, self::XML_PATH_UNSECURE_BASE_URL, self::XML_PATH_USE_REWRITES, self::XML_PATH_UNSECURE_BASE_LINK_URL, self::XML_PATH_SECURE_BASE_LINK_URL, 'general/locale/code' ); } /** * Retrieve store session object * * @return Mage_Core_Model_Session_Abstract */ protected function _getSession() { if (!$this->_session) { $this->_session = Mage::getModel('core/session') ->init('store_'.$this->getCode()); } return $this->_session; } /** * Loading store data * * @param mixed $id * @param string $field * @return Mage_Core_Model_Store */ public function load($id, $field = null) { if (!is_numeric($id) && is_null($field)) { $this->_getResource()->load($this, $id, 'code'); return $this; } return parent::load($id, $field); } /** * Loading store configuration data * * @param string $code * @return Mage_Core_Model_Store */ public function loadConfig($code) { if (is_numeric($code)) { foreach (Mage::getConfig()->getNode()->stores->children() as $storeCode => $store) { if ((int) $store->system->store->id == $code) { $code = $storeCode; break; } } } else { $store = Mage::getConfig()->getNode()->stores->{$code}; } if (!empty($store)) { $this->setCode($code); $id = (int) $store->system->store->id; $this->setId($id)->setStoreId($id); $this->setWebsiteId((int) $store->system->website->id); } return $this; } /** * Retrieve Store code * * @return string */ public function getCode() { return $this->_getData('code'); } /** * Retrieve store configuration data * * @param string $path * @return string|null */ public function getConfig($path) { if (isset($this->_configCache[$path])) { return $this->_configCache[$path]; } $config = Mage::getConfig(); $fullPath = 'stores/' . $this->getCode() . '/' . $path; $data = $config->getNode($fullPath); if (!$data && !Mage::isInstalled()) { $data = $config->getNode('default/' . $path); } if (!$data) { return null; } return $this->_processConfigValue($fullPath, $path, $data); } /** * Initialize base store configuration data * * Method provide cache configuration data without loading store config XML * * @return Mage_Core_Model_Config */ public function initConfigCache() { /** * Funtionality related with config separation */ if ($this->_configCache === null) { $code = $this->getCode(); if ($code) { if (Mage::app()->useCache('config')) { $cacheId = 'store_' . $code . '_config_cache'; $data = Mage::app()->loadCache($cacheId); if ($data) { $data = unserialize($data); } else { $data = array(); foreach ($this->_configCacheBaseNodes as $node) { $data[$node] = $this->getConfig($node); } Mage::app()->saveCache(serialize($data), $cacheId, array( self::CACHE_TAG, Mage_Core_Model_Config::CACHE_TAG )); } $this->_configCache = $data; } } } return $this; } /** * Set config value for CURRENT model * * This value don't save in config * * @param string $path * @param mixed $value * @return Mage_Core_Model_Store */ public function setConfig($path, $value) { if (isset($this->_configCache[$path])) { $this->_configCache[$path] = $value; } $fullPath = 'stores/' . $this->getCode() . '/' . $path; Mage::getConfig()->setNode($fullPath, $value); return $this; } /** * Set website model * * @param Mage_Core_Model_Website $website */ public function setWebsite(Mage_Core_Model_Website $website) { $this->_website = $website; } /** * Retrieve store website * * @return Mage_Core_Model_Website */ public function getWebsite() { if (is_null($this->getWebsiteId())) { return false; } if (is_null($this->_website)) { $this->_website = Mage::app()->getWebsite($this->getWebsiteId()); } return $this->_website; } /** * Process config value * * @param string $fullPath * @param string $path * @param Varien_Simplexml_Element $node * @return string */ protected function _processConfigValue($fullPath, $path, $node) { if (isset($this->_configCache[$path])) { return $this->_configCache[$path]; } if ($node->hasChildren()) { $aValue = array(); foreach ($node->children() as $k => $v) { $aValue[$k] = $this->_processConfigValue($fullPath . '/' . $k, $path . '/' . $k, $v); } $this->_configCache[$path] = $aValue; return $aValue; } $sValue = (string) $node; if (!empty($node['backend_model']) && !empty($sValue)) { $backend = Mage::getModel((string) $node['backend_model']); $backend->setPath($path)->setValue($sValue)->afterLoad(); $sValue = $backend->getValue(); } if (is_string($sValue) && strpos($sValue, '{{') !== false) { if (strpos($sValue, '{{unsecure_base_url}}') !== false) { $unsecureBaseUrl = $this->getConfig(self::XML_PATH_UNSECURE_BASE_URL); $sValue = str_replace('{{unsecure_base_url}}', $unsecureBaseUrl, $sValue); } elseif (strpos($sValue, '{{secure_base_url}}') !== false) { $secureBaseUrl = $this->getConfig(self::XML_PATH_SECURE_BASE_URL); $sValue = str_replace('{{secure_base_url}}', $secureBaseUrl, $sValue); } elseif (strpos($sValue, '{{base_url}}') !== false) { $sValue = Mage::getConfig()->substDistroServerVars($sValue); } } $this->_configCache[$path] = $sValue; return $sValue; } /** * Convert config values for url pathes * * @deprecated after 1.4.2.0 * @param string $value * @return string */ public function processSubst($value) { if (!is_string($value)) { return $value; } if (strpos($value, '{{unsecure_base_url}}') !== false) { $unsecureBaseUrl = $this->getConfig(self::XML_PATH_UNSECURE_BASE_URL); $value = str_replace('{{unsecure_base_url}}', $unsecureBaseUrl, $value); } elseif (strpos($value, '{{secure_base_url}}') !== false) { $secureBaseUrl = $this->getConfig(self::XML_PATH_SECURE_BASE_URL); $value = str_replace('{{secure_base_url}}', $secureBaseUrl, $value); } elseif (strpos($value, '{{') !== false && strpos($value, '{{base_url}}') === false) { $value = Mage::getConfig()->substDistroServerVars($value); } return $value; } /** * Retrieve default base path * * @return string */ public function getDefaultBasePath() { if (!isset($_SERVER['SCRIPT_NAME'])) { return '/'; } return rtrim(Mage::app()->getRequest()->getBasePath() . '/') . '/'; } /** * Retrieve url using store configuration specific * * @param string $route * @param array $params * @return string */ public function getUrl($route = '', $params = array()) { /** @var $url Mage_Core_Model_Url */ $url = Mage::getModel('core/url') ->setStore($this); if (Mage::app()->getStore()->getId() != $this->getId()) { $params['_store_to_url'] = true; } return $url->getUrl($route, $params); } /** * Retrieve base URL * * @param string $type * @param boolean|null $secure * @return string */ public function getBaseUrl($type = self::URL_TYPE_LINK, $secure = null) { $cacheKey = $type . '/' . (is_null($secure) ? 'null' : ($secure ? 'true' : 'false')); if (!isset($this->_baseUrlCache[$cacheKey])) { switch ($type) { case self::URL_TYPE_WEB: $secure = is_null($secure) ? $this->isCurrentlySecure() : (bool)$secure; $url = $this->getConfig('web/' . ($secure ? 'secure' : 'unsecure') . '/base_url'); break; case self::URL_TYPE_LINK: $secure = (bool) $secure; $url = $this->getConfig('web/' . ($secure ? 'secure' : 'unsecure') . '/base_link_url'); $url = $this->_updatePathUseRewrites($url); $url = $this->_updatePathUseStoreView($url); break; case self::URL_TYPE_DIRECT_LINK: $secure = (bool) $secure; $url = $this->getConfig('web/' . ($secure ? 'secure' : 'unsecure') . '/base_link_url'); $url = $this->_updatePathUseRewrites($url); break; case self::URL_TYPE_SKIN: case self::URL_TYPE_JS: $secure = is_null($secure) ? $this->isCurrentlySecure() : (bool) $secure; $url = $this->getConfig('web/' . ($secure ? 'secure' : 'unsecure') . '/base_' . $type . '_url'); break; case self::URL_TYPE_MEDIA: $url = $this->_updateMediaPathUseRewrites($secure); break; default: throw Mage::exception('Mage_Core', Mage::helper('core')->__('Invalid base url type')); } if (false !== strpos($url, '{{base_url}}')) { $baseUrl = Mage::getConfig()->substDistroServerVars('{{base_url}}'); $url = str_replace('{{base_url}}', $baseUrl, $url); } $this->_baseUrlCache[$cacheKey] = rtrim($url, '/') . '/'; } return $this->_baseUrlCache[$cacheKey]; } /** * Remove script file name from url in case when server rewrites are enabled * * @param string $url * @return string */ protected function _updatePathUseRewrites($url) { if ($this->isAdmin() || !$this->getConfig(self::XML_PATH_USE_REWRITES) || !Mage::isInstalled()) { $indexFileName = $this->_isCustomEntryPoint() ? 'index.php' : basename($_SERVER['SCRIPT_FILENAME']); $url .= $indexFileName . '/'; } return $url; } /** * Check if used entry point is custom * * @return bool */ protected function _isCustomEntryPoint() { return (bool)Mage::registry('custom_entry_point'); } /** * Retrieve URL for media catalog * * If we use Database file storage and server doesn't support rewrites (.htaccess in media folder) * we have to put name of fetching media script exactly into URL * * @param null|boolean $secure * @param string $type * @return string */ protected function _updateMediaPathUseRewrites($secure = null, $type = self::URL_TYPE_MEDIA) { $secure = is_null($secure) ? $this->isCurrentlySecure() : (bool) $secure; $secureStringFlag = $secure ? 'secure' : 'unsecure'; $url = $this->getConfig('web/' . $secureStringFlag . '/base_' . $type . '_url'); if (!$this->getConfig(self::XML_PATH_USE_REWRITES) && Mage::helper('core/file_storage_database')->checkDbUsage() ) { $urlStart = $this->getConfig('web/' . $secureStringFlag . '/base_url'); $url = str_replace($urlStart, $urlStart . self::MEDIA_REWRITE_SCRIPT, $url); } return $url; } /** * Add store code to url in case if it is enabled in configuration * * @param string $url * @return string */ protected function _updatePathUseStoreView($url) { if ($this->getStoreInUrl()) { $url .= $this->getCode() . '/'; } return $url; } /** * Returns whether url forming scheme prepends url path with store view code * * @return bool */ public function getStoreInUrl() { return Mage::isInstalled() && $this->getConfig(self::XML_PATH_STORE_IN_URL); } /** * Get store identifier * * @return int */ public function getId() { return $this->_getData('store_id'); } /** * Check if store is admin store * * @return unknown */ public function isAdmin() { return $this->getId() == Mage_Core_Model_App::ADMIN_STORE_ID; } /** * Check if backend URLs should be secure * * @return boolean */ public function isAdminUrlSecure() { if ($this->_isAdminSecure === null) { $this->_isAdminSecure = (boolean) (int) (string) Mage::getConfig() ->getNode(Mage_Core_Model_Url::XML_PATH_SECURE_IN_ADMIN); } return $this->_isAdminSecure; } /** * Check if frontend URLs should be secure * * @return boolean */ public function isFrontUrlSecure() { if ($this->_isFrontSecure === null) { $this->_isFrontSecure = Mage::getStoreConfigFlag(Mage_Core_Model_Url::XML_PATH_SECURE_IN_FRONT, $this->getId()); } return $this->_isFrontSecure; } /** * Check if request was secure * * @return boolean */ public function isCurrentlySecure() { $standardRule = !empty($_SERVER['HTTPS']) && ('off' != $_SERVER['HTTPS']); $offloaderHeader = trim((string) Mage::getConfig()->getNode(self::XML_PATH_OFFLOADER_HEADER, 'default')); if ((!empty($offloaderHeader) && !empty($_SERVER[$offloaderHeader])) || $standardRule) { return true; } if (Mage::isInstalled()) { $secureBaseUrl = Mage::getStoreConfig(Mage_Core_Model_Url::XML_PATH_SECURE_URL); if (!$secureBaseUrl) { return false; } $uri = Zend_Uri::factory($secureBaseUrl); $port = $uri->getPort(); $isSecure = ($uri->getScheme() == 'https') && isset($_SERVER['SERVER_PORT']) && ($port == $_SERVER['SERVER_PORT']); return $isSecure; } else { $isSecure = isset($_SERVER['SERVER_PORT']) && (443 == $_SERVER['SERVER_PORT']); return $isSecure; } } /************************************************************************************* * Store currency interface */ /** * Retrieve store base currency code * * @return string */ public function getBaseCurrencyCode() { $configValue = $this->getConfig(Mage_Core_Model_Store::XML_PATH_PRICE_SCOPE); if ($configValue == Mage_Core_Model_Store::PRICE_SCOPE_GLOBAL) { return Mage::app()->getBaseCurrencyCode(); } else { return $this->getConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE); } } /** * Retrieve store base currency * * @return Mage_Directory_Model_Currency */ public function getBaseCurrency() { $currency = $this->getData('base_currency'); if (is_null($currency)) { $currency = Mage::getModel('directory/currency')->load($this->getBaseCurrencyCode()); $this->setData('base_currency', $currency); } return $currency; } /** * Get default store currency code * * @return string */ public function getDefaultCurrencyCode() { $result = $this->getConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_DEFAULT); return $result; } /** * Retrieve store default currency * * @return Mage_Directory_Model_Currency */ public function getDefaultCurrency() { $currency = $this->getData('default_currency'); if (is_null($currency)) { $currency = Mage::getModel('directory/currency')->load($this->getDefaultCurrencyCode()); $this->setData('default_currency', $currency); } return $currency; } /** * Set current store currency code * * @param string $code * @return string */ public function setCurrentCurrencyCode($code) { $code = strtoupper($code); if (in_array($code, $this->getAvailableCurrencyCodes())) { $this->_getSession()->setCurrencyCode($code); if ($code == $this->getDefaultCurrency()) { Mage::app()->getCookie()->delete(self::COOKIE_CURRENCY, $code); } else { Mage::app()->getCookie()->set(self::COOKIE_CURRENCY, $code); } } return $this; } /** * Get current store currency code * * @return string */ public function getCurrentCurrencyCode() { // try to get currently set code among allowed $code = $this->_getSession()->getCurrencyCode(); if (empty($code)) { $code = $this->getDefaultCurrencyCode(); } if (in_array($code, $this->getAvailableCurrencyCodes(true))) { return $code; } // take first one of allowed codes $codes = array_values($this->getAvailableCurrencyCodes(true)); if (empty($codes)) { // return default code, if no codes specified at all return $this->getDefaultCurrencyCode(); } return array_shift($codes); } /** * Get allowed store currency codes * * If base currency is not allowed in current website config scope, * then it can be disabled with $skipBaseNotAllowed * * @param bool $skipBaseNotAllowed * @return array */ public function getAvailableCurrencyCodes($skipBaseNotAllowed = false) { $codes = $this->getData('available_currency_codes'); if (is_null($codes)) { $codes = explode(',', $this->getConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_ALLOW)); // add base currency, if it is not in allowed currencies $baseCurrencyCode = $this->getBaseCurrencyCode(); if (!in_array($baseCurrencyCode, $codes)) { $codes[] = $baseCurrencyCode; // save base currency code index for further usage $disallowedBaseCodeIndex = array_keys($codes); $disallowedBaseCodeIndex = array_pop($disallowedBaseCodeIndex); $this->setData('disallowed_base_currency_code_index', $disallowedBaseCodeIndex); } $this->setData('available_currency_codes', $codes); } // remove base currency code, if it is not allowed by config (optional) if ($skipBaseNotAllowed) { $disallowedBaseCodeIndex = $this->getData('disallowed_base_currency_code_index'); if (null !== $disallowedBaseCodeIndex) { unset($codes[$disallowedBaseCodeIndex]); } } return $codes; } /** * Retrieve store current currency * * @return Mage_Directory_Model_Currency */ public function getCurrentCurrency() { $currency = $this->getData('current_currency'); if (is_null($currency)) { $currency = Mage::getModel('directory/currency')->load($this->getCurrentCurrencyCode()); $baseCurrency = $this->getBaseCurrency(); if (! $baseCurrency->getRate($currency)) { $currency = $baseCurrency; $this->setCurrentCurrencyCode($baseCurrency->getCode()); } $this->setData('current_currency', $currency); } return $currency; } /** * Retrieve current currency rate * * @return float */ public function getCurrentCurrencyRate() { return $this->getBaseCurrency()->getRate($this->getCurrentCurrency()); } /** * Convert price from default currency to current currency * * @param double $price * @param boolean $format Format price to currency format * @param boolean $includeContainer Enclose into <span class="price"><span> * @return double */ public function convertPrice($price, $format = false, $includeContainer = true) { if ($this->getCurrentCurrency() && $this->getBaseCurrency()) { $value = $this->getBaseCurrency()->convert($price, $this->getCurrentCurrency()); } else { $value = $price; } if ($this->getCurrentCurrency() && $format) { $value = $this->formatPrice($value, $includeContainer); } return $value; } /** * Round price * * @param mixed $price * @return double */ public function roundPrice($price) { return round($price, 2); } /** * Format price with currency filter (taking rate into consideration) * * @param double $price * @param bool $includeContainer * @return string */ public function formatPrice($price, $includeContainer = true) { if ($this->getCurrentCurrency()) { return $this->getCurrentCurrency()->format($price, array(), $includeContainer); } return $price; } /** * Get store price filter * * @return Varien_Filter_Sprintf */ public function getPriceFilter() { if (!$this->_priceFilter) { if ($this->getBaseCurrency() && $this->getCurrentCurrency()) { $this->_priceFilter = $this->getCurrentCurrency()->getFilter(); $this->_priceFilter->setRate($this->getBaseCurrency()->getRate($this->getCurrentCurrency())); } } elseif ($this->getDefaultCurrency()) { $this->_priceFilter = $this->getDefaultCurrency()->getFilter(); } else { $this->_priceFilter = new Varien_Filter_Sprintf('%s', 2); } return $this->_priceFilter; } /** * Retrieve root category identifier * * @return int */ public function getRootCategoryId() { if (!$this->getGroup()) { return 0; } return $this->getGroup()->getRootCategoryId(); } /** * Set group model for store * * @param Mage_Core_Model_Store_Group $group */ public function setGroup($group) { $this->_group = $group; } /** * Retrieve group model * * @return Mage_Core_Model_Store_Group */ public function getGroup() { if (is_null($this->getGroupId())) { return false; } if (is_null($this->_group)) { $this->_group = Mage::getModel('core/store_group')->load($this->getGroupId()); } return $this->_group; } /** * Retrieve website identifier * * @return string|int|null */ public function getWebsiteId() { return $this->_getData('website_id'); } /** * Retrieve group identifier * * @return string|int|null */ public function getGroupId() { return $this->_getData('group_id'); } /** * Retrieve default group identifier * * @return string|int|null */ public function getDefaultGroupId() { return $this->_getData('default_group_id'); } /** * Check if store can be deleted * * @return boolean */ public function isCanDelete() { if (!$this->getId()) { return false; } return $this->getGroup()->getDefaultStoreId() != $this->getId(); } /** * Retrieve current url for store * * @param bool|string $fromStore * @return string */ public function getCurrentUrl($fromStore = true) { $sidQueryParam = $this->_getSession()->getSessionIdQueryParam(); $requestString = Mage::getSingleton('core/url')->escape( ltrim(Mage::app()->getRequest()->getRequestString(), '/')); $storeUrl = Mage::app()->getStore()->isCurrentlySecure() ? $this->getUrl('', array('_secure' => true)) : $this->getUrl(''); $storeParsedUrl = parse_url($storeUrl); $storeParsedQuery = array(); if (isset($storeParsedUrl['query'])) { parse_str($storeParsedUrl['query'], $storeParsedQuery); } $currQuery = Mage::app()->getRequest()->getQuery(); if (isset($currQuery[$sidQueryParam]) && !empty($currQuery[$sidQueryParam]) && $this->_getSession()->getSessionIdForHost($storeUrl) != $currQuery[$sidQueryParam] ) { unset($currQuery[$sidQueryParam]); } foreach ($currQuery as $k => $v) { $storeParsedQuery[$k] = $v; } if (!Mage::getStoreConfigFlag(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL, $this->getCode())) { $storeParsedQuery['___store'] = $this->getCode(); } if ($fromStore !== false) { $storeParsedQuery['___from_store'] = $fromStore === true ? Mage::app()->getStore()->getCode() : $fromStore; } return $storeParsedUrl['scheme'] . '://' . $storeParsedUrl['host'] . (isset($storeParsedUrl['port']) ? ':' . $storeParsedUrl['port'] : '') . $storeParsedUrl['path'] . $requestString . ($storeParsedQuery ? '?'.http_build_query($storeParsedQuery, '', '&amp;') : ''); } /** * Check if store is active * * @return boolean|null */ public function getIsActive() { return $this->_getData('is_active'); } /** * Retrieve store name * * @return string|null */ public function getName() { return $this->_getData('name'); } /** * Protect delete from non admin area * * Register indexing event before delete store * * @return Mage_Core_Model_Store */ protected function _beforeDelete() { $this->_protectFromNonAdmin(); Mage::getSingleton('index/indexer')->logEvent($this, self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE); return parent::_beforeDelete(); } /** * rewrite in order to clear configuration cache * * @return Mage_Core_Model_Store */ protected function _afterDelete() { parent::_afterDelete(); Mage::getConfig()->removeCache(); return $this; } /** * Init indexing process after store delete commit * * @return Mage_Core_Model_Store */ protected function _afterDeleteCommit() { parent::_afterDeleteCommit(); Mage::getSingleton('index/indexer')->indexEvents(self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE); return $this; } /** * Reinit and reset Config Data * * @return Mage_Core_Model_Store */ public function resetConfig() { Mage::getConfig()->reinit(); $this->_dirCache = array(); $this->_configCache = array(); $this->_baseUrlCache = array(); $this->_urlCache = array(); return $this; } /** * Get/Set isReadOnly flag * * @param bool $value * @return bool */ public function isReadOnly($value = null) { if (null !== $value) { $this->_isReadOnly = (bool) $value; } return $this->_isReadOnly; } /** * Retrieve storegroup name * * @return string */ public function getFrontendName() { if (is_null($this->_frontendName)) { $storeGroupName = (string) Mage::getStoreConfig('general/store_information/name', $this); $this->_frontendName = (!empty($storeGroupName)) ? $storeGroupName : $this->getGroup()->getName(); } return $this->_frontendName; } }
almadaocta/lordbike-production
errors/includes/src/Mage_Core_Model_Store.php
PHP
mit
36,521
<HTML> <HEAD> <meta charset="UTF-8"> <title>CrosswordWriter.write - library</title> <link rel="stylesheet" href="../../../style.css"> </HEAD> <BODY> <a href="../../index.html">library</a>&nbsp;/&nbsp;<a href="../index.html">org.akop.ararat.core</a>&nbsp;/&nbsp;<a href="index.html">CrosswordWriter</a>&nbsp;/&nbsp;<a href="./write.html">write</a><br/> <br/> <h1>write</h1> <a name="org.akop.ararat.core.CrosswordWriter$write(org.akop.ararat.core.Crossword)"></a> <code><span class="keyword">fun </span><span class="identifier">write</span><span class="symbol">(</span><span class="identifier" id="org.akop.ararat.core.CrosswordWriter$write(org.akop.ararat.core.Crossword)/crossword">crossword</span><span class="symbol">:</span>&nbsp;<a href="../-crossword/index.html"><span class="identifier">Crossword</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html"><span class="identifier">Unit</span></a></code> </BODY> </HTML>
alpha-cross/ararat
docs/library/org.akop.ararat.core/-crossword-writer/write.html
HTML
mit
1,016
package fr.bouyguestelecom.bboxapi.bboxapi.callback; import okhttp3.Request; public interface IBboxGetLogoChannel { void onResponse(String sessionId, String logoUrl); void onFailure(Request request, int errorCode); }
Pierretag/bboxtv-pfe-android-master
bboxapi/src/main/java/fr/bouyguestelecom/bboxapi/bboxapi/callback/IBboxGetLogoChannel.java
Java
mit
230
<?php /** * * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\User\Controller\Adminhtml\Locks; /** * Locks Index action */ class Index extends \Magento\User\Controller\Adminhtml\Locks { /** * Render page with grid * * @return void */ public function execute() { $this->_view->loadLayout(); $this->_setActiveMenu('Magento_User::system_acl_locks'); $this->_view->getPage()->getConfig()->getTitle()->prepend(__('Locked Users')); $this->_view->renderLayout(); } }
j-froehlich/magento2_wk
vendor/magento/module-user/Controller/Adminhtml/Locks/Index.php
PHP
mit
605
<?php namespace FOSOpenScouting\Keeo; use FOSOpenScouting\Keeo\Exception\ConfigIntegrityException; class Config { protected $apiUrl = 'https://keeo.fos.be/api'; protected $apiUsername; protected $apiPassword; protected $userLoginSalt; protected $curlUserAgent = ''; public function __construct(array $configArray) { $this->parseArray($configArray); } /** * @return string */ public function getApiUrl() { return $this->apiUrl; } /** * @return string */ public function getApiUsername() { return $this->apiUsername; } /** * @return string */ public function getApiPassword() { return $this->apiPassword; } /** * @return string */ public function getUserLoginSalt() { return $this->userLoginSalt; } /** * @return string */ public function getCurlUserAgent() { return $this->curlUserAgent; } /** * @param array $configArray */ protected function parseArray(array $configArray) { foreach ($configArray as $key => $value) { $this->{'set' . ucfirst($key)}($value); } $this->testIntegrity(); } /** * @param string $apiUrl */ protected function setApiUrl($apiUrl) { $this->apiUrl = $apiUrl; } /** * @param string $apiUsername */ protected function setApiUsername($apiUsername) { $this->apiUsername = $apiUsername; } /** * @param string $apiPassword */ protected function setApiPassword($apiPassword) { $this->apiPassword = $apiPassword; } /** * @param string $userLoginSalt */ protected function setUserLoginSalt($userLoginSalt) { $this->userLoginSalt = $userLoginSalt; } /** * @param string $curlUserAgent */ protected function setCurlUserAgent($curlUserAgent) { $this->curlUserAgent = $curlUserAgent; } /** * Test if every config variable has a value, throws an error if not * * @throws ConfigIntegrityException */ protected function testIntegrity() { // get var names $vars = array_keys(get_class_vars(get_class($this))); // check every variable if it is filled in foreach ($vars as $var) { if (is_null($this->{$var})) { throw new ConfigIntegrityException('There is no config value set for \'' . $var . '\''); } } } }
jonasdekeukelaere/keeo-api-wrapper
src/Config.php
PHP
mit
2,584
import {CssAnimator} from '../src/animator'; import {animationEvent} from 'aurelia-templating'; jasmine.getFixtures().fixturesPath = 'base/test/fixtures/'; describe('animator-css', () => { var sut; beforeEach(() => { sut = new CssAnimator(); }); describe('runSequence function', () => { var elems; beforeEach(() => { loadFixtures('run-sequence.html'); elems = $('.sequenced-items li'); }); it('should run multiple animations one after another', (done) => { var testClass = 'animate-test'; sut.runSequence([ { element: elems.eq(0)[0], className: testClass }, { element: elems.eq(1)[0], className: testClass }, { element: elems.eq(2)[0], className: testClass } ]).then( () => { expect(elems.eq(0).css('opacity')).toBe('1'); expect(elems.eq(1).css('opacity')).toBe('1'); expect(elems.eq(2).css('opacity')).toBe('1'); done(); }); }); it('should fire sequence DOM events', () => { var beginFired = false , doneFired = false , listenerBegin = document.addEventListener(animationEvent.sequenceBegin, () => beginFired = true) , listenerDone = document.addEventListener(animationEvent.sequenceDone, () => doneFired = true); var testClass = 'animate-test'; sut.runSequence([ { element: elems.eq(0)[0], className: testClass }, { element: elems.eq(1)[0], className: testClass }, { element: elems.eq(2)[0], className: testClass } ]).then( () => { document.removeEventListener(animationEvent.sequenceBegin, listenerBegin); document.removeEventListener(animationEvent.sequenceDone, listenerDone); expect(beginFired).toBe(true); expect(doneFired).toBe(true); }); }); }); });
hitesh97/animator-css
test/run-sequence.spec.js
JavaScript
mit
1,815
Specify a filename for the ZAP Report.</br></br> The file extension is not necessary, only enter e.g. "myReport".</br></br> The report will be saved into the 'Jenkins Job's Workspace'.</br></br><hr/></br> Accepts <b>System Environment Variables</b>, <b>Build Variables</b> as well as <b>Environment Inject Plugin Variables</b>(cannot be used during pre-build).
tlenaic/zap-plugin
src/main/resources/org/jenkinsci/plugins/zap/ZAPDriver/help-reportFilename.html
HTML
mit
361
declare module 'redux-starter-kit' { declare export type PayloadAction<P: any, T: string = string> = { type: T, payload: P, ... } }
splodingsocks/FlowTyped
definitions/npm/redux-starter-kit_v0.x.x/flow_v0.104.x-/redux-starter-kit_v0.x.x.js
JavaScript
mit
148
// Check whether a object is an instance of the given type, respecting model // factory injections export default function isInstanceOfType(type, obj) { return obj instanceof type; }
lytics/ember-data.model-fragments
addon/util/instance-of-type.js
JavaScript
mit
186
<?php /** * sfSympalComment filter form base class. * * @package sympal * @subpackage filter * @author Your name here * @version SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $ */ abstract class BasesfSympalCommentFormFilter extends BaseFormFilterDoctrine { public function setup() { $this->setWidgets(array( 'status' => new sfWidgetFormChoice(array('choices' => array('' => '', 'Pending' => 'Pending', 'Approved' => 'Approved', 'Denied' => 'Denied'))), 'user_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Author'), 'add_empty' => true)), 'name' => new sfWidgetFormFilterInput(), 'email_address' => new sfWidgetFormFilterInput(), 'website' => new sfWidgetFormFilterInput(), 'body' => new sfWidgetFormFilterInput(array('with_empty' => false)), 'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)), 'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)), 'content_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfSympalContent')), )); $this->setValidators(array( 'status' => new sfValidatorChoice(array('required' => false, 'choices' => array('Pending' => 'Pending', 'Approved' => 'Approved', 'Denied' => 'Denied'))), 'user_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Author'), 'column' => 'id')), 'name' => new sfValidatorPass(array('required' => false)), 'email_address' => new sfValidatorPass(array('required' => false)), 'website' => new sfValidatorPass(array('required' => false)), 'body' => new sfValidatorPass(array('required' => false)), 'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))), 'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))), 'content_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfSympalContent', 'required' => false)), )); $this->widgetSchema->setNameFormat('sf_sympal_comment_filters[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); $this->setupInheritance(); parent::setup(); } public function addContentListColumnQuery(Doctrine_Query $query, $field, $values) { if (!is_array($values)) { $values = array($values); } if (!count($values)) { return; } $query->leftJoin('r.sfSympalContentComment sfSympalContentComment') ->andWhereIn('sfSympalContentComment.content_id', $values); } public function getModelName() { return 'sfSympalComment'; } public function getFields() { return array( 'id' => 'Number', 'status' => 'Enum', 'user_id' => 'ForeignKey', 'name' => 'Text', 'email_address' => 'Text', 'website' => 'Text', 'body' => 'Text', 'created_at' => 'Date', 'updated_at' => 'Date', 'content_list' => 'ManyKey', ); } }
sympal/sympal
test/fixtures/project/lib/filter/doctrine/sfSympalCommentsPlugin/base/BasesfSympalCommentFormFilter.class.php
PHP
mit
3,788
#include <boost/test/unit_test.hpp> #include "init.h" #include "main.h" #include "uint256.h" #include "util.h" #include "miner.h" #include "wallet.h" extern void SHA256Transform(void* pstate, void* pinput, const void* pinit); BOOST_AUTO_TEST_SUITE(miner_tests) static struct { unsigned char extranonce; unsigned int nonce; } blockinfo[] = { {4, 0xa4a3e223}, {2, 0x15c32f9e}, {1, 0x0375b547}, {1, 0x7004a8a5}, {2, 0xce440296}, {2, 0x52cfe198}, {1, 0x77a72cd0}, {2, 0xbb5d6f84}, {2, 0x83f30c2c}, {1, 0x48a73d5b}, {1, 0xef7dcd01}, {2, 0x6809c6c4}, {2, 0x0883ab3c}, {1, 0x087bbbe2}, {2, 0x2104a814}, {2, 0xdffb6daa}, {1, 0xee8a0a08}, {2, 0xba4237c1}, {1, 0xa70349dc}, {1, 0x344722bb}, {3, 0xd6294733}, {2, 0xec9f5c94}, {2, 0xca2fbc28}, {1, 0x6ba4f406}, {2, 0x015d4532}, {1, 0x6e119b7c}, {2, 0x43e8f314}, {2, 0x27962f38}, {2, 0xb571b51b}, {2, 0xb36bee23}, {2, 0xd17924a8}, {2, 0x6bc212d9}, {1, 0x630d4948}, {2, 0x9a4c4ebb}, {2, 0x554be537}, {1, 0xd63ddfc7}, {2, 0xa10acc11}, {1, 0x759a8363}, {2, 0xfb73090d}, {1, 0xe82c6a34}, {1, 0xe33e92d7}, {3, 0x658ef5cb}, {2, 0xba32ff22}, {5, 0x0227a10c}, {1, 0xa9a70155}, {5, 0xd096d809}, {1, 0x37176174}, {1, 0x830b8d0f}, {1, 0xc6e3910e}, {2, 0x823f3ca8}, {1, 0x99850849}, {1, 0x7521fb81}, {1, 0xaacaabab}, {1, 0xd645a2eb}, {5, 0x7aea1781}, {5, 0x9d6e4b78}, {1, 0x4ce90fd8}, {1, 0xabdc832d}, {6, 0x4a34f32a}, {2, 0xf2524c1c}, {2, 0x1bbeb08a}, {1, 0xad47f480}, {1, 0x9f026aeb}, {1, 0x15a95049}, {2, 0xd1cb95b2}, {2, 0xf84bbda5}, {1, 0x0fa62cd1}, {1, 0xe05f9169}, {1, 0x78d194a9}, {5, 0x3e38147b}, {5, 0x737ba0d4}, {1, 0x63378e10}, {1, 0x6d5f91cf}, {2, 0x88612eb8}, {2, 0xe9639484}, {1, 0xb7fabc9d}, {2, 0x19b01592}, {1, 0x5a90dd31}, {2, 0x5bd7e028}, {2, 0x94d00323}, {1, 0xa9b9c01a}, {1, 0x3a40de61}, {1, 0x56e7eec7}, {5, 0x859f7ef6}, {1, 0xfd8e5630}, {1, 0x2b0c9f7f}, {1, 0xba700e26}, {1, 0x7170a408}, {1, 0x70de86a8}, {1, 0x74d64cd5}, {1, 0x49e738a1}, {2, 0x6910b602}, {0, 0x643c565f}, {1, 0x54264b3f}, {2, 0x97ea6396}, {2, 0x55174459}, {2, 0x03e8779a}, {1, 0x98f34d8f}, {1, 0xc07b2b07}, {1, 0xdfe29668}, {1, 0x3141c7c1}, {1, 0xb3b595f4}, {1, 0x735abf08}, {5, 0x623bfbce}, {2, 0xd351e722}, {1, 0xf4ca48c9}, {1, 0x5b19c670}, {1, 0xa164bf0e}, {2, 0xbbbeb305}, {2, 0xfe1c810a}, }; // NOTE: These tests rely on CreateNewBlock doing its own self-validation! BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) { CReserveKey reservekey(pwalletMain); CBlockTemplate *pblocktemplate; CTransaction tx; CScript script; uint256 hash; // Simple block creation, nothing special yet: BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey)); // We can't make transactions until we have inputs // Therefore, load 100 blocks :) std::vector<CTransaction*>txFirst; for (unsigned int i = 0; i < sizeof(blockinfo)/sizeof(*blockinfo); ++i) { CBlock *pblock = &pblocktemplate->block; // pointer for convenience pblock->nVersion = 1; pblock->nTime = pindexBest->GetMedianTimePast()+1; pblock->vtx[0].vin[0].scriptSig = CScript(); pblock->vtx[0].vin[0].scriptSig.push_back(blockinfo[i].extranonce); pblock->vtx[0].vin[0].scriptSig.push_back(pindexBest->nHeight); pblock->vtx[0].vout[0].scriptPubKey = CScript(); if (txFirst.size() < 2) txFirst.push_back(new CTransaction(pblock->vtx[0])); pblock->hashMerkleRoot = pblock->BuildMerkleTree(); pblock->nNonce = blockinfo[i].nonce; CValidationState state; BOOST_CHECK(ProcessBlock(state, NULL, pblock)); BOOST_CHECK(state.IsValid()); pblock->hashPrevBlock = pblock->GetHash(); } delete pblocktemplate; // Just to make sure we can still make simple blocks BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey)); // block sigops > limit: 1000 CHECKMULTISIG + 1 tx.vin.resize(1); // NOTE: OP_NOP is used to force 20 SigOps for the CHECKMULTISIG tx.vin[0].scriptSig = CScript() << OP_0 << OP_0 << OP_0 << OP_NOP << OP_CHECKMULTISIG << OP_1; tx.vin[0].prevout.hash = txFirst[0]->GetHash(); tx.vin[0].prevout.n = 0; tx.vout.resize(1); tx.vout[0].nValue = 5000000000LL; for (unsigned int i = 0; i < 1001; ++i) { tx.vout[0].nValue -= 1000000; hash = tx.GetHash(); mempool.addUnchecked(hash, tx); tx.vin[0].prevout.hash = hash; } BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey)); delete pblocktemplate; mempool.clear(); // block size > limit tx.vin[0].scriptSig = CScript(); // 18 * (520char + DROP) + OP_1 = 9433 bytes std::vector<unsigned char> vchData(520); for (unsigned int i = 0; i < 18; ++i) tx.vin[0].scriptSig << vchData << OP_DROP; tx.vin[0].scriptSig << OP_1; tx.vin[0].prevout.hash = txFirst[0]->GetHash(); tx.vout[0].nValue = 5000000000LL; for (unsigned int i = 0; i < 128; ++i) { tx.vout[0].nValue -= 10000000; hash = tx.GetHash(); mempool.addUnchecked(hash, tx); tx.vin[0].prevout.hash = hash; } BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey)); delete pblocktemplate; mempool.clear(); // orphan in mempool hash = tx.GetHash(); mempool.addUnchecked(hash, tx); BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey)); delete pblocktemplate; mempool.clear(); // child with higher priority than parent tx.vin[0].scriptSig = CScript() << OP_1; tx.vin[0].prevout.hash = txFirst[1]->GetHash(); tx.vout[0].nValue = 4900000000LL; hash = tx.GetHash(); mempool.addUnchecked(hash, tx); tx.vin[0].prevout.hash = hash; tx.vin.resize(2); tx.vin[1].scriptSig = CScript() << OP_1; tx.vin[1].prevout.hash = txFirst[0]->GetHash(); tx.vin[1].prevout.n = 0; tx.vout[0].nValue = 5900000000LL; hash = tx.GetHash(); mempool.addUnchecked(hash, tx); BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey)); delete pblocktemplate; mempool.clear(); // coinbase in mempool tx.vin.resize(1); tx.vin[0].prevout.SetNull(); tx.vin[0].scriptSig = CScript() << OP_0 << OP_1; tx.vout[0].nValue = 0; hash = tx.GetHash(); mempool.addUnchecked(hash, tx); BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey)); delete pblocktemplate; mempool.clear(); // invalid (pre-p2sh) txn in mempool tx.vin[0].prevout.hash = txFirst[0]->GetHash(); tx.vin[0].prevout.n = 0; tx.vin[0].scriptSig = CScript() << OP_1; tx.vout[0].nValue = 4900000000LL; script = CScript() << OP_0; tx.vout[0].scriptPubKey.SetDestination(script.GetID()); hash = tx.GetHash(); mempool.addUnchecked(hash, tx); tx.vin[0].prevout.hash = hash; tx.vin[0].scriptSig = CScript() << (std::vector<unsigned char>)script; tx.vout[0].nValue -= 1000000; hash = tx.GetHash(); mempool.addUnchecked(hash,tx); BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey)); delete pblocktemplate; mempool.clear(); // double spend txn pair in mempool tx.vin[0].prevout.hash = txFirst[0]->GetHash(); tx.vin[0].scriptSig = CScript() << OP_1; tx.vout[0].nValue = 4900000000LL; tx.vout[0].scriptPubKey = CScript() << OP_1; hash = tx.GetHash(); mempool.addUnchecked(hash, tx); tx.vout[0].scriptPubKey = CScript() << OP_2; hash = tx.GetHash(); mempool.addUnchecked(hash, tx); BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey)); delete pblocktemplate; mempool.clear(); // subsidy changing int nHeight = pindexBest->nHeight; pindexBest->nHeight = 209999; BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey)); delete pblocktemplate; pindexBest->nHeight = 210000; BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey)); delete pblocktemplate; pindexBest->nHeight = nHeight; } BOOST_AUTO_TEST_CASE(sha256transform_equality) { unsigned int pSHA256InitState[8] = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19}; // unsigned char pstate[32]; unsigned char pinput[64]; int i; for (i = 0; i < 32; i++) { pinput[i] = i; pinput[i+32] = 0; } uint256 hash; SHA256Transform(&hash, pinput, pSHA256InitState); BOOST_TEST_MESSAGE(hash.GetHex()); uint256 hash_reference("0x2df5e1c65ef9f8cde240d23cae2ec036d31a15ec64bc68f64be242b1da6631f3"); BOOST_CHECK(hash == hash_reference); } BOOST_AUTO_TEST_SUITE_END()
pangubi/pangubi
src/test/miner_tests.cpp
C++
mit
8,670
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace Microsoft.Azure.Management.WebSites { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; /// <summary> /// CertificatesOperations operations. /// </summary> internal partial class CertificatesOperations : IServiceOperations<WebSiteManagementClient>, ICertificatesOperations { /// <summary> /// Initializes a new instance of the CertificatesOperations class. /// </summary> /// <param name='client'> /// Reference to the service client. /// </param> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> internal CertificatesOperations(WebSiteManagementClient client) { if (client == null) { throw new System.ArgumentNullException("client"); } Client = client; } /// <summary> /// Gets a reference to the WebSiteManagementClient /// </summary> public WebSiteManagementClient Client { get; private set; } /// <summary> /// Get all certificates for a subscription. /// </summary> /// <remarks> /// Get all certificates for a subscription. /// </remarks> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="DefaultErrorResponseException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IPage<Certificate>>> ListWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<DefaultErrorResponse>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IPage<Certificate>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<Certificate>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Get all certificates in a resource group. /// </summary> /// <remarks> /// Get all certificates in a resource group. /// </remarks> /// <param name='resourceGroupName'> /// Name of the resource group to which the resource belongs. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="DefaultErrorResponseException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IPage<Certificate>>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) { throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); } } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<DefaultErrorResponse>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IPage<Certificate>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<Certificate>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Get a certificate. /// </summary> /// <remarks> /// Get a certificate. /// </remarks> /// <param name='resourceGroupName'> /// Name of the resource group to which the resource belongs. /// </param> /// <param name='name'> /// Name of the certificate. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="DefaultErrorResponseException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<Certificate>> GetWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) { throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); } } if (name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<DefaultErrorResponse>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<Certificate>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Certificate>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Create or update a certificate. /// </summary> /// <remarks> /// Create or update a certificate. /// </remarks> /// <param name='resourceGroupName'> /// Name of the resource group to which the resource belongs. /// </param> /// <param name='name'> /// Name of the certificate. /// </param> /// <param name='certificateEnvelope'> /// Details of certificate, if it exists already. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="DefaultErrorResponseException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<Certificate>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string name, Certificate certificateEnvelope, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) { throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); } } if (name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } if (certificateEnvelope == null) { throw new ValidationException(ValidationRules.CannotBeNull, "certificateEnvelope"); } if (certificateEnvelope != null) { certificateEnvelope.Validate(); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("certificateEnvelope", certificateEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; if(certificateEnvelope != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(certificateEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<DefaultErrorResponse>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<Certificate>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Certificate>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Delete a certificate. /// </summary> /// <remarks> /// Delete a certificate. /// </remarks> /// <param name='resourceGroupName'> /// Name of the resource group to which the resource belongs. /// </param> /// <param name='name'> /// Name of the certificate. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string name, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) { throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); } } if (name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Create or update a certificate. /// </summary> /// <remarks> /// Create or update a certificate. /// </remarks> /// <param name='resourceGroupName'> /// Name of the resource group to which the resource belongs. /// </param> /// <param name='name'> /// Name of the certificate. /// </param> /// <param name='certificateEnvelope'> /// Details of certificate, if it exists already. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="DefaultErrorResponseException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<Certificate>> UpdateWithHttpMessagesAsync(string resourceGroupName, string name, CertificatePatchResource certificateEnvelope, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+[^\\.]$")) { throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+[^\\.]$"); } } if (name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "name"); } if (certificateEnvelope == null) { throw new ValidationException(ValidationRules.CannotBeNull, "certificateEnvelope"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("name", name); tracingParameters.Add("certificateEnvelope", certificateEnvelope); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; if(certificateEnvelope != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(certificateEnvelope, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<DefaultErrorResponse>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<Certificate>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Certificate>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Get all certificates for a subscription. /// </summary> /// <remarks> /// Get all certificates for a subscription. /// </remarks> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="DefaultErrorResponseException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IPage<Certificate>>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); List<string> _queryParameters = new List<string>(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<DefaultErrorResponse>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IPage<Certificate>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<Certificate>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Get all certificates in a resource group. /// </summary> /// <remarks> /// Get all certificates in a resource group. /// </remarks> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="DefaultErrorResponseException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IPage<Certificate>>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); List<string> _queryParameters = new List<string>(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new DefaultErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); DefaultErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<DefaultErrorResponse>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IPage<Certificate>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<Certificate>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } }
shahabhijeet/azure-sdk-for-net
src/SDKs/WebSites/Management.Websites/Generated/CertificatesOperations.cs
C#
mit
74,279
# Writing a PostCSS Plugin ## Getting Started * [Writing Your First PostCSS Plugin](https://dockyard.com/blog/2018/02/01/writing-your-first-postcss-plugin) * [Create Your Own Plugin tutorial](http://webdesign.tutsplus.com/tutorials/postcss-deep-dive-create-your-own-plugin--cms-24605) * [Plugin Boilerplate](https://github.com/postcss/postcss-plugin-boilerplate) * [Plugin Guidelines](https://github.com/postcss/postcss/blob/master/docs/guidelines/plugin.md) * [AST explorer with playground](http://astexplorer.net/#/2uBU1BLuJ1) ## Documentation and Support * [PostCSS API](http://api.postcss.org/) * [Ask questions](https://gitter.im/postcss/postcss) * [PostCSS twitter](https://twitter.com/postcss) with latest updates. ## Tools * [Selector parser](https://github.com/postcss/postcss-selector-parser) * [Value parser](https://github.com/TrySound/postcss-value-parser) * [Property resolver](https://github.com/jedmao/postcss-resolve-prop) * [Function resolver](https://github.com/andyjansson/postcss-functions) * [Font parser](https://github.com/jedmao/parse-css-font) * [Dimension parser](https://github.com/jedmao/parse-css-dimension) for `number`, `length` and `percentage`. * [Sides parser](https://github.com/jedmao/parse-css-sides) for `margin`, `padding` and `border` properties. * [Font helpers](https://github.com/jedmao/postcss-font-helpers) * [Margin helpers](https://github.com/jedmao/postcss-margin-helpers) * [Media query parser](https://github.com/dryoma/postcss-media-query-parser)
bezoerb/postcss
docs/writing-a-plugin.md
Markdown
mit
1,509
using System.Collections.Generic; using MsgPack; using MsgPack.Serialization; namespace Tarantool.Client.Models { public class Space { public Space() { Format = new List<Field>(); } [MessagePackMember(1)] public uint OwnerId { get; set; } [MessagePackMember(0)] public uint SpaceId { get; set; } [MessagePackMember(2)] public string Name { get; set; } [MessagePackMember(3)] public StorageEngine Engine { get; set; } [MessagePackMember(4)] public uint FieldCount { get; set; } [MessagePackMember(5)] public MessagePackObject Flags { get; set; } [MessagePackMember(6)] public List<Field> Format { get; set; } } }
asukhodko/dotnet-tarantool-client
Tarantool.Client/Models/Space.cs
C#
mit
815
require 'rails_helper' RSpec.describe Course::Forum::TopicsController, type: :controller do let!(:instance) { create(:instance) } with_tenant(:instance) do let(:user) { create(:administrator) } let(:course) { create(:course) } let(:forum) { create(:forum, course: course) } let!(:topic_stub) do stub = build_stubbed(:forum_topic, forum: forum) allow(stub).to receive(:save).and_return(false) allow(stub).to receive(:destroy).and_return(false) allow(stub.subscriptions).to receive(:create).and_return(false) allow(stub.subscriptions).to receive_message_chain(:where, destroy_all: false) stub end before { sign_in(user) } describe '#destroy' do subject { delete :destroy, course_id: course, forum_id: forum, id: topic_stub } context 'when destroy fails' do before do controller.instance_variable_set(:@topic, topic_stub) subject end it 'redirects with a flash message' do it { is_expected.to redirect_to(course_forum_topic_path(course, forum, topic_stub)) } expect(flash[:danger]).to eq(I18n.t('course.forum.topics.destroy.failure', error: topic_stub.errors.full_messages.to_sentence)) end end end describe '#subscribe' do before do controller.instance_variable_set(:@topic, topic_stub) subject end context 'when subscribe fails' do subject do post :subscribe, course_id: course, forum_id: forum, id: topic_stub, subscribe: 'true' end it 'redirects with a flash message' do it { is_expected.to redirect_to(course_forum_topic_path(course, forum, topic_stub)) } expect(flash[:danger]).to eq(I18n.t('course.forum.topics.subscribe.failure')) end end context 'when unsubscribe fails' do subject do post :subscribe, course_id: course, forum_id: forum, id: topic_stub, subscribe: 'false' end it 'redirects with a flash message' do it { is_expected.to redirect_to(course_forum_topic_path(course, forum, topic_stub)) } expect(flash[:danger]).to eq(I18n.t('course.forum.topics.unsubscribe.failure')) end end end describe '#locked' do before do controller.instance_variable_set(:@topic, topic_stub) subject end context 'when set locked fails' do subject do put :set_locked, course_id: course, forum_id: forum, id: topic_stub, locked: true end it 'redirects with a flash message' do it { is_expected.to redirect_to(course_forum_topic_path(course, forum, topic_stub)) } expect(flash[:danger]).to eq(I18n.t('course.forum.topics.locked.failure')) end end context 'when set unlocked fails' do subject do put :set_locked, course_id: course, forum_id: forum, id: topic_stub, locked: false end it 'redirects with a flash message' do it { is_expected.to redirect_to(course_forum_topic_path(course, forum, topic_stub)) } expect(flash[:danger]).to eq(I18n.t('course.forum.topics.unlocked.failure')) end end end describe '#hidden' do before do controller.instance_variable_set(:@topic, topic_stub) subject end context 'when set hidden fails' do subject do put :set_hidden, course_id: course, forum_id: forum, id: topic_stub, hidden: true end it 'redirects with a flash message' do it { is_expected.to redirect_to(course_forum_topic_path(course, forum, topic_stub)) } expect(flash[:danger]).to eq(I18n.t('course.forum.topics.hidden.failure')) end end context 'when set shown fails' do subject do put :set_hidden, course_id: course, forum_id: forum, id: topic_stub, hidden: false end it 'redirects with a flash message' do it { is_expected.to redirect_to(course_forum_topic_path(course, forum, topic_stub)) } expect(flash[:danger]).to eq(I18n.t('course.forum.topics.shown.failure')) end end end end end
BenMQ/coursemology2
spec/controllers/course/forum/topics_controller_spec.rb
Ruby
mit
4,259
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"/><!-- using block title in layout.dt--><!-- using block ddox.defs in ddox.layout.dt--><!-- using block ddox.title in ddox.layout.dt--> <title>AssetAnimation.numberOfBones - multiple declarations</title> <link rel="stylesheet" type="text/css" href="../../../styles/ddox.css"/> <link rel="stylesheet" href="../../../prettify/prettify.css" type="text/css"/> <script type="text/javascript" src="../../../scripts/jquery.js">/**/</script> <script type="text/javascript" src="../../../prettify/prettify.js">/**/</script> <script type="text/javascript" src="../../../scripts/ddox.js">/**/</script> </head> <body onload="prettyPrint(); setupDdox();"> <nav id="main-nav"><!-- using block navigation in layout.dt--> <ul class="tree-view"> <li class=" tree-view"> <a href="#" class="package">dash</a> <ul class="tree-view"> <li class=" tree-view"> <a href="#" class="package">components</a> <ul class="tree-view"> <li> <a href="../../../dash/components/animation.html" class="selected module">animation</a> </li> <li> <a href="../../../dash/components/assets.html" class=" module">assets</a> </li> <li> <a href="../../../dash/components/camera.html" class=" module">camera</a> </li> <li> <a href="../../../dash/components/component.html" class=" module">component</a> </li> <li> <a href="../../../dash/components/lights.html" class=" module">lights</a> </li> <li> <a href="../../../dash/components/material.html" class=" module">material</a> </li> <li> <a href="../../../dash/components/mesh.html" class=" module">mesh</a> </li> <li> <a href="../../../dash/components/userinterface.html" class=" module">userinterface</a> </li> </ul> </li> <li class="collapsed tree-view"> <a href="#" class="package">core</a> <ul class="tree-view"> <li> <a href="../../../dash/core/dgame.html" class=" module">dgame</a> </li> <li> <a href="../../../dash/core/gameobject.html" class=" module">gameobject</a> </li> <li> <a href="../../../dash/core/prefabs.html" class=" module">prefabs</a> </li> <li> <a href="../../../dash/core/properties.html" class=" module">properties</a> </li> <li> <a href="../../../dash/core/scene.html" class=" module">scene</a> </li> </ul> </li> <li class="collapsed tree-view"> <a href="#" class="package">editor</a> <ul class="tree-view"> <li> <a href="../../../dash/editor/editor.html" class=" module">editor</a> </li> <li> <a href="../../../dash/editor/websockets.html" class=" module">websockets</a> </li> </ul> </li> <li class="collapsed tree-view"> <a href="#" class="package">graphics</a> <ul class="tree-view"> <li class="collapsed tree-view"> <a href="#" class="package">adapters</a> <ul class="tree-view"> <li> <a href="../../../dash/graphics/adapters/adapter.html" class=" module">adapter</a> </li> <li> <a href="../../../dash/graphics/adapters/gl.html" class=" module">gl</a> </li> <li> <a href="../../../dash/graphics/adapters/linux.html" class=" module">linux</a> </li> <li> <a href="../../../dash/graphics/adapters/win32gl.html" class=" module">win32gl</a> </li> </ul> </li> <li class="collapsed tree-view"> <a href="#" class="package">shaders</a> <ul class="tree-view"> <li class="collapsed tree-view"> <a href="#" class="package">glsl</a> <ul class="tree-view"> <li> <a href="../../../dash/graphics/shaders/glsl/ambientlight.html" class=" module">ambientlight</a> </li> <li> <a href="../../../dash/graphics/shaders/glsl/animatedgeometry.html" class=" module">animatedgeometry</a> </li> <li> <a href="../../../dash/graphics/shaders/glsl/directionallight.html" class=" module">directionallight</a> </li> <li> <a href="../../../dash/graphics/shaders/glsl/geometry.html" class=" module">geometry</a> </li> <li> <a href="../../../dash/graphics/shaders/glsl/pointlight.html" class=" module">pointlight</a> </li> <li> <a href="../../../dash/graphics/shaders/glsl/shadowmap.html" class=" module">shadowmap</a> </li> <li> <a href="../../../dash/graphics/shaders/glsl/userinterface.html" class=" module">userinterface</a> </li> </ul> </li> <li> <a href="../../../dash/graphics/shaders/glsl.html" class=" module">glsl</a> </li> <li> <a href="../../../dash/graphics/shaders/shaders.html" class=" module">shaders</a> </li> </ul> </li> <li> <a href="../../../dash/graphics/adapters.html" class=" module">adapters</a> </li> <li> <a href="../../../dash/graphics/graphics.html" class=" module">graphics</a> </li> <li> <a href="../../../dash/graphics/shaders.html" class=" module">shaders</a> </li> </ul> </li> <li class="collapsed tree-view"> <a href="#" class="package">net</a> <ul class="tree-view"> <li> <a href="../../../dash/net/connection.html" class=" module">connection</a> </li> <li> <a href="../../../dash/net/connectionmanager.html" class=" module">connectionmanager</a> </li> <li> <a href="../../../dash/net/packets.html" class=" module">packets</a> </li> <li> <a href="../../../dash/net/webconnection.html" class=" module">webconnection</a> </li> </ul> </li> <li class="collapsed tree-view"> <a href="#" class="package">utility</a> <ul class="tree-view"> <li> <a href="../../../dash/utility/awesomium.html" class=" module">awesomium</a> </li> <li> <a href="../../../dash/utility/concurrency.html" class=" module">concurrency</a> </li> <li> <a href="../../../dash/utility/config.html" class=" module">config</a> </li> <li> <a href="../../../dash/utility/input.html" class=" module">input</a> </li> <li> <a href="../../../dash/utility/output.html" class=" module">output</a> </li> <li> <a href="../../../dash/utility/resources.html" class=" module">resources</a> </li> <li> <a href="../../../dash/utility/soloud.html" class=" module">soloud</a> </li> <li> <a href="../../../dash/utility/string.html" class=" module">string</a> </li> <li> <a href="../../../dash/utility/tasks.html" class=" module">tasks</a> </li> <li> <a href="../../../dash/utility/time.html" class=" module">time</a> </li> </ul> </li> <li> <a href="../../../dash/components.html" class=" module">components</a> </li> <li> <a href="../../../dash/core.html" class=" module">core</a> </li> <li> <a href="../../../dash/editor.html" class=" module">editor</a> </li> <li> <a href="../../../dash/graphics.html" class=" module">graphics</a> </li> <li> <a href="../../../dash/net.html" class=" module">net</a> </li> <li> <a href="../../../dash/utility.html" class=" module">utility</a> </li> </ul> </li> <li> <a href="../../../dash.html" class=" module">dash</a> </li> </ul> <noscript> <p style="color: red">The search functionality needs JavaScript enabled</p> </noscript> <div id="symbolSearchPane" style="display: none"> <p> <input id="symbolSearch" type="text" placeholder="Search for symbols" onchange="performSymbolSearch(24);" onkeypress="this.onchange();" onpaste="this.onchange();" oninput="this.onchange();"/> </p> <ul id="symbolSearchResults" style="display: none"></ul> <script type="application/javascript" src="../../../symbols.js"></script> <script type="application/javascript"> //<![CDATA[ var symbolSearchRootDir = "../../../"; $('#symbolSearchPane').show(); //]]> </script> </div> <script type="text/javascript" src="../../../scripts/mousetrap.js"></script> <script type="text/javascript"> //<![CDATA[ $(document).ready(function() { Mousetrap.bind('s', function(e) { $("#symbolSearch").focus(); return false; }); }); //]]> </script> </nav> <div id="main-contents"> <h1>AssetAnimation.numberOfBones - multiple declarations</h1><!-- using block body in layout.dt--><!-- Default block ddox.description in ddox.layout.dt--><!-- Default block ddox.sections in ddox.layout.dt--><!-- using block ddox.members in ddox.layout.dt--> <ul> <li>Function AssetAnimation.numberOfBones</li> <li>Function AssetAnimation.numberOfBones</li> </ul> <section> <h2>Function AssetAnimation.numberOfBones</h2> <p></p> <section> <h3>Prototype</h3> <pre class="code prettyprint lang-d prototype"> int numberOfBones() pure nothrow @property @safe auto final;</pre> </section> </section> <section> <h2>Function AssetAnimation.numberOfBones</h2> <p></p> <section> <h3>Prototype</h3> <pre class="code prettyprint lang-d prototype"> void numberOfBones( &nbsp;&nbsp;int newVal ) pure nothrow @property @safe final;</pre> </section> </section> <section> <h2>Authors</h2><!-- using block ddox.authors in ddox.layout.dt--> </section> <section> <h2>Copyright</h2><!-- using block ddox.copyright in ddox.layout.dt--> </section> <section> <h2>License</h2><!-- using block ddox.license in ddox.layout.dt--> </section> </div> </body> </html>
Circular-Studios/Dash-Docs
api/v0.10.0/dash/components/animation/AssetAnimation.numberOfBones.html
HTML
mit
10,193
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>awaitable::awaitable (1 of 2 overloads)</title> <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="../../../../boost_asio.html" title="Boost.Asio"> <link rel="up" href="../awaitable.html" title="awaitable::awaitable"> <link rel="prev" href="../awaitable.html" title="awaitable::awaitable"> <link rel="next" href="overload2.html" title="awaitable::awaitable (2 of 2 overloads)"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> <td align="center"><a href="../../../../../../index.html">Home</a></td> <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="../awaitable.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../awaitable.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload2.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h5 class="title"> <a name="boost_asio.reference.awaitable.awaitable.overload1"></a><a class="link" href="overload1.html" title="awaitable::awaitable (1 of 2 overloads)">awaitable::awaitable (1 of 2 overloads)</a> </h5></div></div></div> <p> Default constructor. </p> <pre class="programlisting">constexpr awaitable(); </pre> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright © 2003-2021 Christopher M. Kohlhoff<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="../awaitable.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../awaitable.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload2.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
davehorton/drachtio-server
deps/boost_1_77_0/doc/html/boost_asio/reference/awaitable/awaitable/overload1.html
HTML
mit
3,127
import { BasicSnackBarModule } from './basic-snack-bar.module'; describe('BasicSnackBarModule', () => { let basicSnackBarModule: BasicSnackBarModule; beforeEach(() => { basicSnackBarModule = new BasicSnackBarModule(); }); it('should create an instance', () => { expect(basicSnackBarModule).toBeTruthy(); }); });
A-l-y-l-e/Alyle-UI
src/app/docs/components/snack-bar-demo/basic-snack-bar/basic-snack-bar.module.spec.ts
TypeScript
mit
333
--- title: 唯独耶和华 date: 29/11/2020 --- 上帝又真又活的证据,就在祂一切创造之物中。这句话经常不断覆述,以至于听来有些老套。但是,当我们思想上帝原先创造世界的意旨,是如何遭人践踏、破坏时,我们才有可能更明白如何有效的教导艺术与科学。 以人类的妊娠期为例。生物学告诉我们,具有智慧的人类,其新生命是从一个受精卵中诞生,到九个月后发育成熟的。慈爱创造主的印记由始至终贯穿了这整个周期。上帝的慈爱可以从胎儿生长之处看出,那地方就在母亲规律跳动的心脏之下。胎儿越大,母亲的腹部就越大。准妈妈在怀胎时常和孩子互有感应,就像我们的天父总是知道祂的儿女一样。 `请阅读罗1:18–21;诗19:1–6和尼9:6。这些经文如何向我们叙述上帝作为创造主的工作?` 即使这个世界受罪恶污染六千年,来到了被洪水毁灭几千年后的今天,无数至今仍然尚存的有力证据不仅能够证明上帝是我们的创造主,还能见证我们创造主上帝的能力、仁爱和恩慈。事实上这些例证历历在目,以至于保罗在罗1:18-21中说,那些拒绝上帝的人在审判日将「无可推诿」,因为我们可以从祂创造的事物中学到的实在太多!换句话说,他们不能以无知作为推诿的借口! 特别是在现今这个多人不敬创造主、反倒膜拜受造之物的时代,基督教在艺术与科学教育上始终奠基于上帝是万物的创造者和维持者,这其中意义是多么重大啊!一切否定或排斥上帝的思想体系和假设终必导致错误。世俗的教育几乎都是在没有上帝的假设下推行的;基督化教育绝不可落入这个陷阱,也不能在假定上帝不存在的前提下,悄悄偏离原则,这两种状况都会使人误入歧途。 `想想即使是在人类犯罪以后,我们这个世界仍有不可思议的奇观和美丽。我们怎样才能从中获得希望和安慰,尤其是在个人经历试验和苦难的时候?`
imasaru/sabbath-school-lessons
src/zh/2020-04/10/02.md
Markdown
mit
2,143
<?php /** * Default class to resolve urls */ namespace Embed\RequestResolvers; class Curl implements RequestResolverInterface { protected $isBinary; protected $content; protected $result; protected $url; protected $config = [ CURLOPT_MAXREDIRS => 20, CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => 10, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_ENCODING => '', CURLOPT_AUTOREFERER => true, CURLOPT_USERAGENT => 'Embed PHP Library', CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4, ]; public static $binaryContentTypes = [ '#image/.*#', '#application/(pdf|x-download|zip|pdf|msword|vnd\\.ms|postscript|octet-stream|ogg)#', '#application/x-zip.*#', ]; /** * {@inheritdoc} */ public function __construct($url) { $this->url = $url; } /** * {@inheritdoc} */ public function setConfig(array $config) { $this->config = $config + $this->config; } /** * {@inheritdoc} */ public function setUrl($url) { $this->result = $this->content = null; $this->url = $url; } /** * {@inheritdoc} */ public function getUrl() { return $this->getResult('url'); } /** * {@inheritdoc} */ public function getHttpCode() { return intval($this->getResult('http_code')); } /** * {@inheritdoc} */ public function getMimeType() { return $this->getResult('mime_type'); } /** * {@inheritdoc} */ public function getContent() { if ($this->content === null) { $this->resolve(); } return $this->content; } /** * {@inheritdoc} */ public function getRequestInfo() { if ($this->result === null) { $this->resolve(); } return $this->result; } /** * Get the result of the http request * * @param string $name Parameter name * * @return null|string The result info */ protected function getResult($name) { if ($this->result === null) { $this->resolve(); } return isset($this->result[$name]) ? $this->result[$name] : null; } /** * Resolves the current url and get the content and other data */ protected function resolve() { $this->content = ''; $this->isBinary = null; $tmpCookies = str_replace('//', '/', sys_get_temp_dir().'/embed-cookies.txt'); $connection = curl_init(); curl_setopt_array($connection, [ CURLOPT_RETURNTRANSFER => false, CURLOPT_FOLLOWLOCATION => true, CURLOPT_URL => $this->url, CURLOPT_COOKIEJAR => $tmpCookies, CURLOPT_COOKIEFILE => $tmpCookies, CURLOPT_HEADERFUNCTION => [$this, 'headerCallback'], CURLOPT_WRITEFUNCTION => [$this, 'writeCallback'], ] + $this->config); $result = curl_exec($connection); $this->result = curl_getinfo($connection) ?: []; if (!$result) { $this->result['error'] = curl_error($connection); $this->result['error_number'] = curl_errno($connection); } curl_close($connection); if (($content_type = $this->getResult('content_type'))) { if (strpos($content_type, ';') !== false) { list($mimeType, $charset) = explode(';', $content_type); $this->result['mime_type'] = $mimeType; $charset = substr(strtoupper(strstr($charset, '=')), 1); if (!empty($charset) && !empty($this->content) && ($charset !== 'UTF-8')) { $this->content = @mb_convert_encoding($this->content, 'UTF-8', $charset); } } elseif (strpos($content_type, '/') !== false) { $this->result['mime_type'] = $content_type; } } } protected function headerCallback($connection, $string) { if (($this->isBinary === null) && strpos($string, ':')) { list($name, $value) = array_map('trim', explode(':', $string, 2)); if (strtolower($name) === 'content-type') { $this->isBinary = false; foreach (self::$binaryContentTypes as $regex) { if (preg_match($regex, strtolower($value))) { $this->isBinary = true; break; } } } } return strlen($string); } protected function writeCallback($connection, $string) { if ($this->isBinary) { return 0; } $this->content .= $string; return strlen($string); } }
philrennie/Embed
src/RequestResolvers/Curl.php
PHP
mit
4,903
# frozen_string_literal: true require_relative '../test_helper' class TestFakerDragonBall < Test::Unit::TestCase def setup @tester = Faker::DragonBall end def test_character assert @tester.character.match(/\w+/) end end
irfanah/faker
test/deprecate/test_deprecate_dragon_ball.rb
Ruby
mit
239
<?php namespace Expert\AdministrationBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class DefaultController extends Controller { public function indexAction($name) { return $this->render('ExpertAdministrationBundle:Default:index.html.twig', array('name' => $name)); } }
equipelesexperts/new-expert
src/Expert/AdministrationBundle/Controller/DefaultController.php
PHP
mit
323
package io.rtr.alchemy.identities; import org.apache.commons.math3.stat.inference.ChiSquareTest; import org.junit.Test; import org.mockito.Mockito; import java.util.Set; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyInt; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.junit.Assert.assertEquals; public class IdentityBuilderTest { @Test public void testHashAll() { final Identity identity = mock(Identity.class); doReturn(1L).when(identity).computeHash(anyInt(), Mockito.<Set<String>>any(), any(AttributesMap.class)); final long hash = IdentityBuilder .seed(0) .putBoolean(true) .putByte((byte) 1) .putBytes(new byte[]{1, 2, 3}) .putChar('a') .putDouble(1.0) .putFloat(1.0f) .putInt(1) .putLong(1L) .putShort((short) 1) .putString("foo") .putNull() .hash(); assertEquals(-3880933330945736271L, hash); } @Test public void testHashNulls() { final long hash = IdentityBuilder .seed(0) .putBoolean(null) .putByte(null) .putBytes(null) .putChar(null) .putDouble(null) .putFloat(null) .putInt(null) .putLong(null) .putShort(null) .putString(null) .putNull() .hash(); assertEquals(7075199957211664123L, hash); final long hash1 = IdentityBuilder.seed(0).putBoolean(null).hash(); final long hash2 = IdentityBuilder.seed(0).putNull().hash(); assertEquals("hashing null value should be same as hashing null", hash1, hash2); } @Test public void testHashDifferentSeeds() { final long hash1 = IdentityBuilder.seed(1).putBoolean(true).hash(); final long hash2 = IdentityBuilder.seed(2).putBoolean(true).hash(); assertNotEquals("hashes generated with different seeds should be different most of the time", hash1, hash2); } @Test public void testHashSameSeed() { final long hash1 = IdentityBuilder.seed(0).putBoolean(true).hash(); final long hash2 = IdentityBuilder.seed(0).putBoolean(true).hash(); assertEquals("hashes generated with same seeds should be same", hash1, hash2); } private static final int SAMPLE_SIZE = 1000000; private static final int NUMBER_SEEDS = 3; private static final double EXPECTED_SIGNIFICANCE = 0.05; private static final int MIN_NUM_BINS = 2; private static final int MAX_NUM_BINS = 10; @Test public void testDistribution() { final ChiSquareTest chiSquareTest = new ChiSquareTest(); for (int numBins=MIN_NUM_BINS; numBins <= MAX_NUM_BINS; numBins++) { final double[] expectedFrequencies = new double[numBins]; final long[] actualFrequencies = new long[numBins]; for (int i=0; i<numBins; i++) { expectedFrequencies[i] = SAMPLE_SIZE / numBins; } for (int seed = 0; seed < NUMBER_SEEDS; seed++) { for (int sample = 0; sample < SAMPLE_SIZE; sample++) { final int bin = (int) (Math.abs(IdentityBuilder.seed(seed).putInt(sample).hash()) % numBins); actualFrequencies[bin]++; } final double significance = chiSquareTest.chiSquareTest(expectedFrequencies, actualFrequencies); assertTrue( String.format( "distribution was not uniform, significance was %.4f for %d bins", significance, numBins ), significance > EXPECTED_SIGNIFICANCE ); } } } }
RentTheRunway/alchemy
alchemy-core/src/test/java/io/rtr/alchemy/identities/IdentityBuilderTest.java
Java
mit
4,147
Xflow.registerOperator("xflow.selectBool", { outputs: [ {type: 'bool', name : 'result', customAlloc: true} ], params: [ {type: 'int', source : 'index'}, {type: 'bool', source: 'value'} ], alloc: function(sizes, index, value) { sizes['result'] = 1; }, evaluate: function(result, index, value) { var i = index[0]; if (i < value.length) { result[0] = value[i]; } else { result[0] = false; } } });
Huii/develop_with_vr
src/xflow/operator/default/selectBool.js
JavaScript
mit
498
import shell from 'shelljs'; import path from 'path'; import tmp from 'tmp'; import helpers from './helpers'; const { isWindows, isOSX } = helpers; tmp.setGracefulCleanup(); const SCRIPT_PATHS = { singleIco: path.join(__dirname, '../..', 'bin/singleIco'), convertToPng: path.join(__dirname, '../..', 'bin/convertToPng'), convertToIco: path.join(__dirname, '../..', 'bin/convertToIco'), convertToIcns: path.join(__dirname, '../..', 'bin/convertToIcns'), }; /** * Executes a shell script with the form "./pathToScript param1 param2" * @param {string} shellScriptPath * @param {string} icoSrc input .ico * @param {string} dest has to be a .ico path */ function iconShellHelper(shellScriptPath, icoSrc, dest) { return new Promise((resolve, reject) => { if (isWindows()) { reject('OSX or Linux is required'); return; } shell.exec(`${shellScriptPath} ${icoSrc} ${dest}`, { silent: true }, (exitCode, stdOut, stdError) => { if (exitCode) { reject({ stdOut, stdError, }); return; } resolve(dest); }); }); } function getTmpDirPath() { const tempIconDirObj = tmp.dirSync({ unsafeCleanup: true }); return tempIconDirObj.name; } /** * Converts the ico to a temporary directory which will be cleaned up on process exit * @param {string} icoSrc path to a .ico file * @return {Promise} */ function singleIco(icoSrc) { return iconShellHelper(SCRIPT_PATHS.singleIco, icoSrc, `${getTmpDirPath()}/icon.ico`); } function convertToPng(icoSrc) { return iconShellHelper(SCRIPT_PATHS.convertToPng, icoSrc, `${getTmpDirPath()}/icon.png`); } function convertToIco(icoSrc) { return iconShellHelper(SCRIPT_PATHS.convertToIco, icoSrc, `${getTmpDirPath()}/icon.ico`); } function convertToIcns(icoSrc) { if (!isOSX()) { return new Promise((resolve, reject) => reject('OSX is required to convert to a .icns icon')); } return iconShellHelper(SCRIPT_PATHS.convertToIcns, icoSrc, `${getTmpDirPath()}/icon.icns`); } export default { singleIco, convertToPng, convertToIco, convertToIcns, };
zucher/nativefier
src/helpers/iconShellHelpers.js
JavaScript
mit
2,106
namespace BashSoft.Contracts { public interface IFilteredTaker { void FilterAndTake(string courseName, string givenFilther, int? studentsToTake = null); } }
VaskoViktorov/SoftUni-Homework
05. Advanced C# - 23.05.2017/BashSoft a.k.a spaghetti code/StoryMode/StoryMode/BashSoft/Contracts/IFilteredTaker.cs
C#
mit
180
/* * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, 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. */ #include <config.h> #include <errno.h> #include <getopt.h> #include <limits.h> #include <signal.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include "command-line.h" #include "compiler.h" #include "daemon.h" #include "fatal-signal.h" #include "learning-switch.h" #include "ofp-parse.h" #include "ofp-version-opt.h" #include "ofpbuf.h" #include "openflow/openflow.h" #include "poll-loop.h" #include "rconn.h" #include "simap.h" #include "stream-ssl.h" #include "timeval.h" #include "unixctl.h" #include "util.h" #include "openvswitch/vconn.h" #include "openvswitch/vlog.h" #include "socket-util.h" #include "ofp-util.h" VLOG_DEFINE_THIS_MODULE(controller); #define MAX_SWITCHES 16 #define MAX_LISTENERS 16 struct switch_ { struct lswitch *lswitch; }; /* -H, --hub: Learn the ports on which MAC addresses appear? */ static bool learn_macs = true; /* -n, --noflow: Set up flows? (If not, every packet is processed at the * controller.) */ static bool set_up_flows = true; /* -N, --normal: Use "NORMAL" action instead of explicit port? */ static bool action_normal = false; /* -w, --wildcard: 0 to disable wildcard flow entries, an OFPFW10_* bitmask to * enable specific wildcards, or UINT32_MAX to use the default wildcards. */ static uint32_t wildcards = 0; /* --max-idle: Maximum idle time, in seconds, before flows expire. */ static int max_idle = 60; /* --mute: If true, accept connections from switches but do not reply to any * of their messages (for debugging fail-open mode). */ static bool mute = false; /* -q, --queue: default OpenFlow queue, none if UINT32_MAX. */ static uint32_t default_queue = UINT32_MAX; /* -Q, --port-queue: map from port name to port number. */ static struct simap port_queues = SIMAP_INITIALIZER(&port_queues); /* --with-flows: Flows to send to switch. */ static struct ofputil_flow_mod *default_flows; static size_t n_default_flows; static enum ofputil_protocol usable_protocols; /* --unixctl: Name of unixctl socket, or null to use the default. */ static char *unixctl_path = NULL; static void new_switch(struct switch_ *, struct vconn *); static void parse_options(int argc, char *argv[]); OVS_NO_RETURN static void usage(void); int main(int argc, char *argv[]) { struct unixctl_server *unixctl; struct switch_ switches[MAX_SWITCHES]; struct pvconn *listeners[MAX_LISTENERS]; int n_switches, n_listeners; int retval; int i; proctitle_init(argc, argv); set_program_name(argv[0]); parse_options(argc, argv); fatal_ignore_sigpipe(); if (argc - optind < 1) { ovs_fatal(0, "at least one vconn argument required; " "use --help for usage"); } n_switches = n_listeners = 0; for (i = optind; i < argc; i++) { const char *name = argv[i]; struct vconn *vconn; retval = vconn_open(name, get_allowed_ofp_versions(), DSCP_DEFAULT, &vconn); if (!retval) { if (n_switches >= MAX_SWITCHES) { ovs_fatal(0, "max %d switch connections", n_switches); } new_switch(&switches[n_switches++], vconn); continue; } else if (retval == EAFNOSUPPORT) { struct pvconn *pvconn; retval = pvconn_open(name, get_allowed_ofp_versions(), DSCP_DEFAULT, &pvconn); if (!retval) { if (n_listeners >= MAX_LISTENERS) { ovs_fatal(0, "max %d passive connections", n_listeners); } listeners[n_listeners++] = pvconn; } } if (retval) { VLOG_ERR("%s: connect: %s", name, ovs_strerror(retval)); } } if (n_switches == 0 && n_listeners == 0) { ovs_fatal(0, "no active or passive switch connections"); } daemonize_start(); retval = unixctl_server_create(unixctl_path, &unixctl); if (retval) { exit(EXIT_FAILURE); } daemonize_complete(); while (n_switches > 0 || n_listeners > 0) { /* Accept connections on listening vconns. */ for (i = 0; i < n_listeners && n_switches < MAX_SWITCHES; ) { struct vconn *new_vconn; retval = pvconn_accept(listeners[i], &new_vconn); if (!retval || retval == EAGAIN) { if (!retval) { new_switch(&switches[n_switches++], new_vconn); } i++; } else { pvconn_close(listeners[i]); listeners[i] = listeners[--n_listeners]; } } /* Do some switching work. . */ for (i = 0; i < n_switches; ) { struct switch_ *this = &switches[i]; lswitch_run(this->lswitch); if (lswitch_is_alive(this->lswitch)) { i++; } else { lswitch_destroy(this->lswitch); switches[i] = switches[--n_switches]; } } unixctl_server_run(unixctl); /* Wait for something to happen. */ if (n_switches < MAX_SWITCHES) { for (i = 0; i < n_listeners; i++) { pvconn_wait(listeners[i]); } } for (i = 0; i < n_switches; i++) { struct switch_ *sw = &switches[i]; lswitch_wait(sw->lswitch); } unixctl_server_wait(unixctl); poll_block(); } return 0; } static void new_switch(struct switch_ *sw, struct vconn *vconn) { struct lswitch_config cfg; struct rconn *rconn; rconn = rconn_create(60, 0, DSCP_DEFAULT, get_allowed_ofp_versions()); rconn_connect_unreliably(rconn, vconn, NULL); cfg.mode = (action_normal ? LSW_NORMAL : learn_macs ? LSW_LEARN : LSW_FLOOD); cfg.wildcards = wildcards; cfg.max_idle = set_up_flows ? max_idle : -1; cfg.default_flows = default_flows; cfg.n_default_flows = n_default_flows; cfg.usable_protocols = usable_protocols; cfg.default_queue = default_queue; cfg.port_queues = &port_queues; cfg.mute = mute; sw->lswitch = lswitch_create(rconn, &cfg); } static void add_port_queue(char *s) { char *save_ptr = NULL; char *port_name; char *queue_id; port_name = strtok_r(s, ":", &save_ptr); queue_id = strtok_r(NULL, "", &save_ptr); if (!queue_id) { ovs_fatal(0, "argument to -Q or --port-queue should take the form " "\"<port-name>:<queue-id>\""); } if (!simap_put(&port_queues, port_name, atoi(queue_id))) { ovs_fatal(0, "<port-name> arguments for -Q or --port-queue must " "be unique"); } } static void parse_options(int argc, char *argv[]) { enum { OPT_MAX_IDLE = UCHAR_MAX + 1, OPT_PEER_CA_CERT, OPT_MUTE, OPT_WITH_FLOWS, OPT_UNIXCTL, VLOG_OPTION_ENUMS, DAEMON_OPTION_ENUMS, OFP_VERSION_OPTION_ENUMS }; static const struct option long_options[] = { {"hub", no_argument, NULL, 'H'}, {"noflow", no_argument, NULL, 'n'}, {"normal", no_argument, NULL, 'N'}, {"wildcards", optional_argument, NULL, 'w'}, {"max-idle", required_argument, NULL, OPT_MAX_IDLE}, {"mute", no_argument, NULL, OPT_MUTE}, {"queue", required_argument, NULL, 'q'}, {"port-queue", required_argument, NULL, 'Q'}, {"with-flows", required_argument, NULL, OPT_WITH_FLOWS}, {"unixctl", required_argument, NULL, OPT_UNIXCTL}, {"help", no_argument, NULL, 'h'}, DAEMON_LONG_OPTIONS, OFP_VERSION_LONG_OPTIONS, VLOG_LONG_OPTIONS, STREAM_SSL_LONG_OPTIONS, {"peer-ca-cert", required_argument, NULL, OPT_PEER_CA_CERT}, {NULL, 0, NULL, 0}, }; char *short_options = long_options_to_short_options(long_options); for (;;) { int indexptr; char *error; int c; c = getopt_long(argc, argv, short_options, long_options, &indexptr); if (c == -1) { break; } switch (c) { case 'H': learn_macs = false; break; case 'n': set_up_flows = false; break; case OPT_MUTE: mute = true; break; case 'N': action_normal = true; break; case 'w': wildcards = optarg ? strtol(optarg, NULL, 16) : UINT32_MAX; break; case OPT_MAX_IDLE: if (!strcmp(optarg, "permanent")) { max_idle = OFP_FLOW_PERMANENT; } else { max_idle = atoi(optarg); if (max_idle < 1 || max_idle > 65535) { ovs_fatal(0, "--max-idle argument must be between 1 and " "65535 or the word 'permanent'"); } } break; case 'q': default_queue = atoi(optarg); break; case 'Q': add_port_queue(optarg); break; case OPT_WITH_FLOWS: error = parse_ofp_flow_mod_file(optarg, OFPFC_ADD, &default_flows, &n_default_flows, &usable_protocols); if (error) { ovs_fatal(0, "%s", error); } break; case OPT_UNIXCTL: unixctl_path = optarg; break; case 'h': usage(); VLOG_OPTION_HANDLERS OFP_VERSION_OPTION_HANDLERS DAEMON_OPTION_HANDLERS STREAM_SSL_OPTION_HANDLERS case OPT_PEER_CA_CERT: stream_ssl_set_peer_ca_cert_file(optarg); break; case '?': exit(EXIT_FAILURE); default: abort(); } } free(short_options); if (!simap_is_empty(&port_queues) || default_queue != UINT32_MAX) { if (action_normal) { ovs_error(0, "queue IDs are incompatible with -N or --normal; " "not using OFPP_NORMAL"); action_normal = false; } if (!learn_macs) { ovs_error(0, "queue IDs are incompatible with -H or --hub; " "not acting as hub"); learn_macs = true; } } } static void usage(void) { printf("%s: OpenFlow controller\n" "usage: %s [OPTIONS] METHOD\n" "where METHOD is any OpenFlow connection method.\n", program_name, program_name); vconn_usage(true, true, false); daemon_usage(); ofp_version_usage(); vlog_usage(); printf("\nOther options:\n" " -H, --hub act as hub instead of learning switch\n" " -n, --noflow pass traffic, but don't add flows\n" " --max-idle=SECS max idle time for new flows\n" " -N, --normal use OFPP_NORMAL action\n" " -w, --wildcards[=MASK] wildcard (specified) bits in flows\n" " -q, --queue=QUEUE-ID OpenFlow queue ID to use for output\n" " -Q PORT-NAME:QUEUE-ID use QUEUE-ID for frames from PORT-NAME\n" " --with-flows FILE use the flows from FILE\n" " --unixctl=SOCKET override default control socket name\n" " -h, --help display this help message\n" " -V, --version display version information\n"); exit(EXIT_SUCCESS); }
kspviswa/dpi-enabled-ovs
ovs/utilities/ovs-testcontroller.c
C
mit
12,257
<?php namespace Ilios\Migrations; use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; /** * Changes program titles to be not nullable, and program short titles to be nullable. * * @link https://github.com/ilios/ilios/issues/1083 */ class Version20151106022409 extends AbstractMigration { /** * @inheritdoc */ public function up(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('UPDATE program SET title = short_title WHERE title IS NULL'); $this->addSql('ALTER TABLE program CHANGE title title VARCHAR(200) NOT NULL, CHANGE short_title short_title VARCHAR(10) DEFAULT NULL'); } /** * @inheritdoc */ public function down(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE program CHANGE title title VARCHAR(200) DEFAULT NULL COLLATE utf8_unicode_ci, CHANGE short_title short_title VARCHAR(10) NOT NULL COLLATE utf8_unicode_ci'); } }
justinchu17/ilios
app/Resources/DoctrineMigrations/Version20151106022409.php
PHP
mit
1,210
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>RSpec results</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Expires" content="-1" /> <meta http-equiv="Pragma" content="no-cache" /> <style type="text/css"> body { margin: 0; padding: 0; background: #fff; font-size: 80%; } </style> <script type="text/javascript"> // <![CDATA[ function addClass(element_id, classname) { document.getElementById(element_id).className += (" " + classname); } function removeClass(element_id, classname) { var elem = document.getElementById(element_id); var classlist = elem.className.replace(classname,''); elem.className = classlist; } function moveProgressBar(percentDone) { document.getElementById("rspec-header").style.width = percentDone +"%"; } function makeRed(element_id) { removeClass(element_id, 'passed'); removeClass(element_id, 'not_implemented'); addClass(element_id,'failed'); } function makeYellow(element_id) { var elem = document.getElementById(element_id); if (elem.className.indexOf("failed") == -1) { // class doesn't includes failed if (elem.className.indexOf("not_implemented") == -1) { // class doesn't include not_implemented removeClass(element_id, 'passed'); addClass(element_id,'not_implemented'); } } } function apply_filters() { var passed_filter = document.getElementById('passed_checkbox').checked; var failed_filter = document.getElementById('failed_checkbox').checked; var pending_filter = document.getElementById('pending_checkbox').checked; assign_display_style("example passed", passed_filter); assign_display_style("example failed", failed_filter); assign_display_style("example not_implemented", pending_filter); assign_display_style_for_group("example_group passed", passed_filter); assign_display_style_for_group("example_group not_implemented", pending_filter, pending_filter || passed_filter); assign_display_style_for_group("example_group failed", failed_filter, failed_filter || pending_filter || passed_filter); } function get_display_style(display_flag) { var style_mode = 'none'; if (display_flag == true) { style_mode = 'block'; } return style_mode; } function assign_display_style(classname, display_flag) { var style_mode = get_display_style(display_flag); var elems = document.getElementsByClassName(classname) for (var i=0; i<elems.length;i++) { elems[i].style.display = style_mode; } } function assign_display_style_for_group(classname, display_flag, subgroup_flag) { var display_style_mode = get_display_style(display_flag); var subgroup_style_mode = get_display_style(subgroup_flag); var elems = document.getElementsByClassName(classname) for (var i=0; i<elems.length;i++) { var style_mode = display_style_mode; if ((display_flag != subgroup_flag) && (elems[i].getElementsByTagName('dt')[0].innerHTML.indexOf(", ") != -1)) { elems[i].style.display = subgroup_style_mode; } else { elems[i].style.display = display_style_mode; } } } // ]]> </script> <style type="text/css"> #rspec-header { background: #65C400; color: #fff; height: 4em; } .rspec-report h1 { margin: 0px 10px 0px 10px; padding: 10px; font-family: "Lucida Grande", Helvetica, sans-serif; font-size: 1.8em; position: absolute; } #label { float:left; } #display-filters { float:left; padding: 28px 0 0 40%; font-family: "Lucida Grande", Helvetica, sans-serif; } #summary { float:right; padding: 5px 10px; font-family: "Lucida Grande", Helvetica, sans-serif; text-align: right; } #summary p { margin: 0 0 0 2px; } #summary #totals { font-size: 1.2em; } .example_group { margin: 0 10px 5px; background: #fff; } dl { margin: 0; padding: 0 0 5px; font: normal 11px "Lucida Grande", Helvetica, sans-serif; } dt { padding: 3px; background: #65C400; color: #fff; font-weight: bold; } dd { margin: 5px 0 5px 5px; padding: 3px 3px 3px 18px; } dd.example.passed { border-left: 5px solid #65C400; border-bottom: 1px solid #65C400; background: #DBFFB4; color: #3D7700; } dd.example.not_implemented { border-left: 5px solid #FAF834; border-bottom: 1px solid #FAF834; background: #FCFB98; color: #131313; } dd.example.pending_fixed { border-left: 5px solid #0000C2; border-bottom: 1px solid #0000C2; color: #0000C2; background: #D3FBFF; } dd.example.failed { border-left: 5px solid #C20000; border-bottom: 1px solid #C20000; color: #C20000; background: #FFFBD3; } dt.not_implemented { color: #000000; background: #FAF834; } dt.pending_fixed { color: #FFFFFF; background: #C40D0D; } dt.failed { color: #FFFFFF; background: #C40D0D; } #rspec-header.not_implemented { color: #000000; background: #FAF834; } #rspec-header.pending_fixed { color: #FFFFFF; background: #C40D0D; } #rspec-header.failed { color: #FFFFFF; background: #C40D0D; } .backtrace { color: #000; font-size: 12px; } a { color: #BE5C00; } /* Ruby code, style similar to vibrant ink */ .ruby { font-size: 12px; font-family: monospace; color: white; background-color: black; padding: 0.1em 0 0.2em 0; } .ruby .keyword { color: #FF6600; } .ruby .constant { color: #339999; } .ruby .attribute { color: white; } .ruby .global { color: white; } .ruby .module { color: white; } .ruby .class { color: white; } .ruby .string { color: #66FF00; } .ruby .ident { color: white; } .ruby .method { color: #FFCC00; } .ruby .number { color: white; } .ruby .char { color: white; } .ruby .comment { color: #9933CC; } .ruby .symbol { color: white; } .ruby .regex { color: #44B4CC; } .ruby .punct { color: white; } .ruby .escape { color: white; } .ruby .interp { color: white; } .ruby .expr { color: white; } .ruby .offending { background-color: gray; } .ruby .linenum { width: 75px; padding: 0.1em 1em 0.2em 0; color: #000000; background-color: #FFFBD3; } </style> </head> <body> <div class="rspec-report"> <div id="rspec-header"> <div id="label"> <h1>RSpec Code Examples</h1> </div> <div id="display-filters"> <input id="passed_checkbox" name="passed_checkbox" type="checkbox" checked onchange="apply_filters()" value="1"> <label for="passed_checkbox">Passed</label> <input id="failed_checkbox" name="failed_checkbox" type="checkbox" checked onchange="apply_filters()" value="2"> <label for="failed_checkbox">Failed</label> <input id="pending_checkbox" name="pending_checkbox" type="checkbox" checked onchange="apply_filters()" value="3"> <label for="pending_checkbox">Pending</label> </div> <div id="summary"> <p id="totals">&nbsp;</p> <p id="duration">&nbsp;</p> </div> </div> <div class="results"> <div id="div_group_1" class="example_group passed"> <dl style="margin-left: 0px;"> <dt id="example_group_1" class="passed">pending spec with no implementation</dt> <script type="text/javascript">makeYellow('rspec-header');</script> <script type="text/javascript">makeYellow('div_group_1');</script> <script type="text/javascript">makeYellow('example_group_1');</script> <script type="text/javascript">moveProgressBar('14.2');</script> <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not Yet Implemented)</span></dd> </dl> </div> <div id="div_group_2" class="example_group passed"> <dl style="margin-left: 0px;"> <dt id="example_group_2" class="passed">pending command with block format</dt> </dl> </div> <div id="div_group_3" class="example_group passed"> <dl style="margin-left: 15px;"> <dt id="example_group_3" class="passed">with content that would fail</dt> <script type="text/javascript">makeYellow('rspec-header');</script> <script type="text/javascript">makeYellow('div_group_3');</script> <script type="text/javascript">makeYellow('example_group_3');</script> <script type="text/javascript">moveProgressBar('28.5');</script> <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd> </dl> </div> <div id="div_group_4" class="example_group passed"> <dl style="margin-left: 15px;"> <dt id="example_group_4" class="passed">with content that would pass</dt> <script type="text/javascript">makeRed('rspec-header');</script> <script type="text/javascript">makeRed('div_group_4');</script> <script type="text/javascript">makeRed('example_group_4');</script> <script type="text/javascript">moveProgressBar('42.8');</script> <dd class="example pending_fixed"> <span class="failed_spec_name">fails</span> <div class="failure" id="failure_1"> <div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div> <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:18 ./spec/rspec/core/formatters/html_formatter_spec.rb:24 ./spec/rspec/core/formatters/html_formatter_spec.rb:46 ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open' ./spec/rspec/core/formatters/html_formatter_spec.rb:46 ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir' ./spec/rspec/core/formatters/html_formatter_spec.rb:45</pre></div> <pre class="ruby"><code><span class="linenum">29</span> <span class="ident">teardown_mocks_for_rspec</span> <span class="linenum">30</span> <span class="keyword">end</span> <span class="offending"><span class="linenum">31</span> <span class="keyword">raise</span> <span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Core</span><span class="punct">::</span><span class="constant">PendingExampleFixedError</span><span class="punct">.</span><span class="ident">new</span> <span class="keyword">if</span> <span class="ident">result</span></span> <span class="linenum">32</span> <span class="keyword">end</span> <span class="linenum">33</span> <span class="keyword">raise</span> <span class="constant">PendingDeclaredInExample</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="ident">message</span><span class="punct">)</span></code></pre> </div> </dd> </dl> </div> <div id="div_group_5" class="example_group passed"> <dl style="margin-left: 0px;"> <dt id="example_group_5" class="passed">passing spec</dt> <script type="text/javascript">moveProgressBar('57.1');</script> <dd class="example passed"><span class="passed_spec_name">passes</span></dd> </dl> </div> <div id="div_group_6" class="example_group passed"> <dl style="margin-left: 0px;"> <dt id="example_group_6" class="passed">failing spec</dt> <script type="text/javascript">makeRed('div_group_6');</script> <script type="text/javascript">makeRed('example_group_6');</script> <script type="text/javascript">moveProgressBar('71.4');</script> <dd class="example failed"> <span class="failed_spec_name">fails</span> <div class="failure" id="failure_2"> <div class="message"><pre> expected 2 got 1 (compared using ==) </pre></div> <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:33 ./spec/rspec/core/formatters/html_formatter_spec.rb:24 ./spec/rspec/core/formatters/html_formatter_spec.rb:46 ./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open' ./spec/rspec/core/formatters/html_formatter_spec.rb:46 ./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir' ./spec/rspec/core/formatters/html_formatter_spec.rb:45</pre></div> <pre class="ruby"><code><span class="linenum">27</span> <span class="keyword">end</span> <span class="linenum">28</span> <span class="offending"><span class="linenum">29</span> <span class="keyword">raise</span><span class="punct">(</span><span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Expectations</span><span class="punct">::</span><span class="constant">ExpectationNotMetError</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="ident">message</span><span class="punct">))</span></span> <span class="linenum">30</span> <span class="keyword">end</span></code></pre> </div> </dd> </dl> </div> <div id="div_group_7" class="example_group passed"> <dl style="margin-left: 0px;"> <dt id="example_group_7" class="passed">a failing spec with odd backtraces</dt> <script type="text/javascript">makeRed('div_group_7');</script> <script type="text/javascript">makeRed('example_group_7');</script> <script type="text/javascript">moveProgressBar('85.7');</script> <dd class="example failed"> <span class="failed_spec_name">fails with a backtrace that has no file</span> <div class="failure" id="failure_3"> <div class="message"><pre>foo</pre></div> <div class="backtrace"><pre>(erb):1</pre></div> <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre> </div> </dd> <script type="text/javascript">moveProgressBar('100.0');</script> <dd class="example failed"> <span class="failed_spec_name">fails with a backtrace containing an erb file</span> <div class="failure" id="failure_4"> <div class="message"><pre>Exception</pre></div> <div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div> <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre> </div> </dd> </dl> </div> <script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script> <script type="text/javascript">document.getElementById('totals').innerHTML = "7 examples, 4 failures, 2 pending";</script> </div> </div> </body> </html>
jbenjore/JPs-love-project
annotate-models/ruby/1.9.1/gems/rspec-core-2.6.3/spec/rspec/core/formatters/html_formatted-1.8.7.html
HTML
mit
14,123
(function(D,j){D.execute(function(){(function(j){document.createElement("header");var e=function(a){function b(a,b,e){a[e]=function(){d._replay.push(b.concat({m:e,a:[].slice.call(arguments)}))}}var d={};d._sourceName=a;d._replay=[];d.getNow=function(a,b){return b};d.when=function(){var a=[{m:"when",a:[].slice.call(arguments)}],d={};b(d,a,"run");b(d,a,"declare");b(d,a,"publish");b(d,a,"build");return d};b(d,[],"declare");b(d,[],"build");b(d,[],"publish");b(d,[],"importEvent");e._shims.push(d);return d}; e._shims=[];if(!j.$Nav)j.$Nav=e("rcx-nav");if(!j.$Nav.make)j.$Nav.make=e})(j)})})(function(){var D=window.AmazonUIPageJS||window.P,j=D._namespace||D.attributeErrors;return j?j("NavAuiShim"):D}(),window); /* ******** */ (function(D,j,z){D.execute(function(){(function(e){if(!e.$Nav||e.$Nav._replay){document.createElement("header");var a=function(){this.data={}};a.arrayAdder=function(a){return function(){this.data[a]=(this.data[a]||[]).concat([].slice.call(arguments));return this}};a.prototype={build:function(a,c){this.data.name=a;this.data.value=c;this.data.immediate=!1;this.data.process=!0;b.manager.add(this.data)},run:function(a,c){if(c)this.data.name=a;this.data.value=c||a;this.data.process=!0;b.manager.add(this.data)}, publish:function(a,c){this.data.name=a;this.data.value=c;b.manager.publish(this.data)},declare:function(a,c){this.data.name=a;this.data.value=c;b.manager.add(this.data)},when:a.arrayAdder("when"),iff:a.arrayAdder("iff"),filter:a.arrayAdder("filter"),observe:a.arrayAdder("observe")};var b=function(a){b.manager.add(a)},d=function(c){b[c]=function(){var b=new a;return b[c].apply(b,arguments)}},c;for(c in a.prototype)a.prototype.hasOwnProperty(c)&&d(c);b.make=function(){return b};b.getNow=function(a, c){return b.manager.get(a,c)};b.stats=function(a){return b.manager.stats(a)};b.importEvent=function(a,c){c=c||{};c.name=a;b.manager.importEvent(c)};b.manager={pending:[],add:function(a){this.pending.push({m:"add",data:a})},publish:function(a){this.pending.push({m:"publish",data:a})},importEvent:function(a){this.pending.push({m:"importEvent",data:a})},get:function(a,b){return b},stats:function(){return{}}};if(e.$Nav&&e.$Nav.make&&e.$Nav.make._shims){d=function(c){for(var d=new a,g=0;g<c.length;g++){var f= c[g];if(f.m==="importEvent"){c=f.a[1]||{};c.name=f.a[0];b.manager.importEvent(c);break}else if(!d[f.m])break;d[f.m].apply(d,f.a)}};c=e.$Nav.make._shims;for(var f=0;f<c.length;f++){for(var i=0;i<c[f]._replay.length;i++)d(c[f]._replay[i]);for(var k in c[f])c[f].hasOwnProperty(k)&&b.hasOwnProperty(k)&&(c[f][k]=b[k])}}e.$Nav=b}})(j);(function(e,a,b){if((a=e.$Nav)&&a.manager&&a.manager.pending){var d=b.now||function(){return+new b},c=function(a){return typeof a==="function"},f=typeof e.P==="object"&&typeof e.P.when=== "function"&&typeof e.P.register==="function"&&typeof e.P.execute==="function",i=typeof e.AmazonUIPageJS==="object"&&typeof e.AmazonUIPageJS.when==="function"&&typeof e.AmazonUIPageJS.register==="function"&&typeof e.AmazonUIPageJS.execute==="function",k=function(a,b){var b=b||{},c=b.start||50,d=function(){if(c<=(b.max||2E4)&&!a())setTimeout(d,c),c*=b.factor||2};return d},h=function(a,b){try{return a()}catch(c){if(typeof b==="object")b.message=b.message||c.message,b.message="rcx-nav: "+b.message;l(c, b)}},l=function(a,b){if(arguments.length===1&&typeof a==="string")l({message:"rcx-nav: "+a});else if(e.console&&e.console.error&&e.console.error(a,b),e.ueLogError)e.ueLogError(a,b);else throw a;},g=function(){function a(){return setTimeout(b,0)}function b(){for(var f=a(),h=d();c.length;)if(c.shift()(),d()-h>50)return;clearTimeout(f);g=!1}var c=[],g=!1;try{/OS 6_[0-9]+ like Mac OS X/i.test(navigator.userAgent)&&e.addEventListener&&e.addEventListener("scroll",a,!1)}catch(f){}return function(b){c.push(b); g||(a(),g=!0)}}(),p=function(){var a={};return{run:function(b){if(a[b]instanceof Array)for(var c=0;c<a[b].length;c++)a[b][c]();a[b]=!0},add:function(b,c){for(var d=1,f=function(){--d<=0&&g(c)},h=b.length;h--;)a[b[h]]!==!0&&((a[b[h]]=a[b[h]]||[]).push(f),d++);f()}}},m=function(a){a=a||{};this.context=a.context||e;this.once=a.once||!1;this.async=a.async||!1;this.observers=[];this.notifyCount=0;this.notifyArgs=[]};m.prototype={notify:function(){this.notifyCount++;if(!(this.once&&this.notifyCount>1)){this.notifyArgs= [].slice.call(arguments);for(var a=0;a<this.observers.length;a++)this._run(this.observers[a])}},observe:function(a){if(c(a))if(this.once&&this.isNotified())this._run(a);else return this.observers.push(a),this.observers.length-1},remove:function(a){return a>-1&&a<this.observers.length?(this.observers[a]=function(){},!0):!1},boundObserve:function(){var a=this;return function(){a.observe.apply(a,arguments)}},isNotified:function(){return this.notifyCount>0},_run:function(a){var b=this.notifyArgs,c=this.context; this.async?g(function(){a.apply(c,b)}):a.apply(c,b)}};var r=function(){var a={},b=0,l={},r=p(),q={},j=function(a){this.data={name:"nav:"+b++,group:"rcx-nav",value:null,result:null,immediate:!0,process:!1,override:!1,resolved:!1,watched:!1,context:l,when:[],iff:[],filter:[],observe:[],stats:{defined:d(),resolved:-1,buildStarted:-1,buildCompleted:-1,callCount:0,executionTime:0}};for(var c in a)a.hasOwnProperty(c)&&(this.data[c]=a[c]);if(this.data.name.indexOf("]")>-1&&(a=this.data.name.split("]"),a.length=== 2&&a[0].length>1&&a[1].length>0))this.data.name=a[1],this.data.group=a[0].replace("[","")};j.prototype={getDependencyNames:function(){for(var a=[].concat(this.data.when,this.data.filter),b=0;b<this.data.iff.length;b++)typeof this.data.iff[b]==="string"?a.push(this.data.iff[b]):this.data.iff[b].name&&a.push(this.data.iff[b].name);return a},checkIff:function(){for(var b=function(b){var b=typeof b==="string"?{name:b}:b,c=a[b.name];if(!c||!c.data.resolved)return!1;var c=c.getResult(),c=b.prop&&c?c[b.prop]: c,d=b.value||!0;switch(b.op||"truthy"){case "truthy":return!!c;case "falsey":return!c;case "eq":return c===d;case "ne":return c!==d;case "gt":return c>d;case "lt":return c<d;case "gte":return c>=d;case "lte":return c<=d}return!1},c=0;c<this.data.iff.length;c++)if(!b(this.data.iff[c]))return!1;return!0},watchModule:function(b){var d=this;q[b]||(q[b]=new m);q[b].observe(function(){var a=d.getResult();if(c(a))return a.apply(d.data.context,arguments)});a[b]&&a[b].applyObserverWrapper()},applyObserverWrapper:function(){var a= this;if(q[this.data.name]&&!this.data.watched&&this.data.resolved&&this.data.result){if(c(this.data.result)){var b=this.data.result;this.data.result=function(){var c=b.apply(a.data.context,arguments);q[a.data.name].notify(c)};for(var d in b)b.hasOwnProperty(d)&&(this.data.result[d]=b[d])}this.data.watched=!0}},applyFilterWrapper:function(){var b=this;if(this.data.filter.length!==0&&c(this.data.result)){for(var d=[],g=[],f=0;f<this.data.filter.length;f++)if(a.hasOwnProperty(this.data.filter[f])){var h= a[this.data.filter[f]].getResult();c(h.request)&&d.push(h.request);c(h.response)&&g.push(h.response)}var i=function(a,c){for(var d=0;d<a.length;d++)if(c=a[d].call(b.data.context,c),c===!1)return!1;return c},k=this.data.result;this.data.result=function(a){if((a=i(d,a))!==!1)return a=k.call(l,a),(a=i(g,a))===!1?void 0:a}}},execute:function(){if(this.checkIff()){for(var a=0;a<this.data.observe.length;a++)this.watchModule(this.data.observe[a]);r.run(this.data.name);this.data.resolved=!0;this.data.stats.resolved= d();this.data.immediate&&this.getResult()}},getResult:function(){var b=this,g=d();this.data.stats.callCount++;if(this.data.result!==null||!this.data.resolved)return this.data.result;this.data.stats.buildStarted=d();if(this.data.process){for(var f=[],i=0;i<this.data.when.length;i++)f.push(a.hasOwnProperty(this.data.when[i])?a[this.data.when[i]].getResult():null);var k=this.data.group+":"+this.data.name;if(typeof this.data.value==="string"){for(var l=this.data.when,i=0;i<l.length;i++){var m=l[i].indexOf("."); m>-1&&m<l[i].length&&(l[i]=l[i].substr(m+1));l[i]=l[i].replace(/[^0-9a-zA-Z_$]/g,"");l[i].length||(l[i]=String.fromCharCode(97+i))}this.data.value=h(new Function("return function ("+l.join(", ")+") { "+this.data.value+"};"),{attribution:k,logLevel:"ERROR",message:"$Nav module eval failed: "+k})}if(c(this.data.value))this.data.result=h(function(){return b.data.value.apply(b.data.context,f)},{attribution:k,logLevel:"ERROR",message:"$Nav module execution failed: "+k})}else this.data.result=this.data.value; this.applyFilterWrapper();this.applyObserverWrapper();this.data.stats.buildCompleted=d();this.data.stats.executionTime+=d()-g;return this.data.result}};return{add:function(b){if(!a.hasOwnProperty(b.name)||b.override){var c=new j(b);a[c.data.name]=c;var b=function(){c.execute()},d=c.getDependencyNames();d.length===0?g(b):r.add(d,b)}},publish:function(a){this.add(a);f?e.P.register(a.name,function(){return a.value}):i&&e.AmazonUIPageJS.register(a.name,function(){return a.value});e.amznJQ&&e.amznJQ.declareAvailable(a.name)}, importEvent:function(a){var b=this,a=a||{};f&&e.P.when(a.name).execute(function(c){c=c===void 0||c===null?a.otherwise:c;b.add({name:a.as||a.name,value:c})});if(e.amznJQ)e.amznJQ[a.useOnCompletion?"onCompletion":"available"](a.amznJQ||a.name,k(function(){var c;if(a.global){c=e;for(var d=(a.global||"").split("."),g=0,f=d.length;g<f;g++)c&&d[g]&&(c=c[d[g]])}else c=a.otherwise;if(a.retry&&(c===void 0||c===null))return!1;b.add({name:a.as||a.name,value:c});return!0}))},get:function(b,c){return a[b]&&a[b].data.resolved? a[b].getResult():c},stats:function(b){var c={},d;for(d in a)if(a.hasOwnProperty(d)&&(!b||!a[d].data.resolved)){c[d]=a[d].data;c[d].blocked=[];for(var g=a[d].getDependencyNames(),f=0;f<g.length;f++)(!a[g[f]]||!a[g[f]].data.resolved)&&c[d].blocked.push(g[f])}return c}}}();if(a&&a.manager&&a.manager.pending)for(var q=0;q<a.manager.pending.length;q++)r[a.manager.pending[q].m](a.manager.pending[q].data);a.manager=r;a.declare("now",d);a.declare("async",g);a.declare("eventGraph",p);a.declare("logError", function(a,b){var c=a,b="rcx-nav: "+(b||"");c&&c.message?c.message=b+c.message:typeof c==="object"?c.message=b:c={message:b+c};e.console&&e.console.error&&e.console.error(c);if(e.ueLogError)e.ueLogError(c);else throw c;});a.declare("logUeError",l);a.declare("Observer",m);a.declare("isAuiP",f);a.declare("isAuiPJS",i)}})(j,document,Date);j.$Nav.declare("sharedconstants",{ADVANCED_PREFIX:"aj:",TIME_UP_TO:"NavJS:TimeUpTo:",CSM_LATENCY:"NavJS:CSM:Latency",CSM_LATENCY_V2:"Nav:CSM:Latency",TOTAL_CALL_COUNT:"NavJS:TotalCallCount:", DWELLTIME_MIN:200});(function(e){e.when("sharedconstants").build("constants",function(a){a.CAROUSEL_WIDTH_BUFFER=45;a.PINNED_NAV_SEARCH_SPACING=140;a.REMOVE_COVER_SCROLL_HEIGHT=200;return a})})(j.$Nav);(function(e){e.run("ewc.before.ajax",function(){typeof j.uet==="function"&&j.uet("be","ewc",{wb:1})});e.when("$","config").run("ewc.ajax",function(a,b){if(b.ewc&&!b.ewc.debugInlineJS&&b.ewc.prefireAjax){var d=a("#nav-flyout-ewc .nav-ewc-content"),c=function(){d.html(b.ewc.errorContent.html).addClass("nav-tpl-flyoutError")}, f=/\$Nav/g;a.ajax({url:b.ewc.url,data:{},type:"GET",dataType:"json",cache:!1,timeout:b.ewc.timeout||3E4,beforeSend:function(){d.addClass("nav-spinner");typeof j.uet==="function"&&j.uet("af","ewc",{wb:1})},error:function(){c()},success:function(a){var b;a:{if(b=a.js)if(b="var P = window.AmazonUIPageJS; "+b,f.test(b)){c();b=!1;break a}else e.when("ewc.flyout","ewc.cartCount").run("[rcx-nav-cart]ewc",b);b=!0}b&&d.html(a.html)},complete:function(){d.removeClass("nav-spinner");typeof j.uet==="function"&& j.uet("cf","ewc",{wb:1});typeof j.uex==="function"&&j.uex("ld","ewc",{wb:1})}})}})})(j.$Nav);(function(e){e.when("$","config","provider.ajax").iff({name:"config",prop:"searchapiEndpoint"}).run("searchApiAjax",function(a,b,d){d({url:b.searchapiEndpoint,dataKey:"searchAjaxContent",success:function(a){a&&a.searchAjaxContent&&a.searchAjaxContent.js&&(a="var P = window.AmazonUIPageJS || window.P; "+a.searchAjaxContent.js,e.when("$","iss.flyout","searchApi","util.templates").run("[sx]iss",a))},error:function(){throw"ISS failed to load."; }}).fetch()})})(j.$Nav);(function(e){e.build("$F",function(){function a(a,b){this.up=a;this.action=b}function b(b){return function(){var c=[].slice.call(arguments);return new a(this,function(a){return b.apply(this,[a].concat(c))})}}a.prototype.noOp=function(){};a.prototype.on=function(a){a=typeof a==="function"?a:function(){return a};return this.up?this.up.on(this.action(a)):a};a.prototype.run=function(a){return this.on(a)()};a.prototype.bind=b(function(a,b){return function(){return a.apply(b,arguments)}}); a.prototype.memoize=b(function(a){var b,f=!1;return function(){f||(f=!0,b=a.apply(this,arguments),a=null);return b}});a.prototype.once=b(function(a){var b=!1;return function(){if(!b){b=!0;var f=a.apply(this,arguments);a=null;return f}}});a.prototype.debounce=b(function(a,b,f){var i;return function(){var k,h=arguments,l=this;f&&!i&&(k=a.apply(l,h));i&&clearTimeout(i);i=setTimeout(function(){i=null;f||a.apply(l,h)},b);return k}});a.prototype.after=b(function(a,b,f){return function(){(f&&b>0||!f&&b<= 0)&&a();b--}});a.prototype.delay=b(function(a,b){var f=b===void 0?0:b;return function(){return setTimeout(a,f)}});a.prototype.partial=b(function(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(this,b.concat([].slice.call(arguments)))}});a.prototype.rpartial=b(function(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(this,[].slice.call(arguments).concat(b))}});a.prototype.throttle=b(function(a,b){function f(){k?(k=!1,setTimeout(f,b), a()):i=!1}var i=!1,k=!1;return function(){i?k=!0:(i=!0,setTimeout(f,b),a())}});a.prototype.iff=b(function(a,b){return typeof b==="function"?function(){if(b())return a.apply(this,arguments)}:b?a:this.noOp});a.prototype.tap=b(function(a,b){var f=Array.prototype.slice.call(arguments,2);return function(){b.apply(this,f.concat([].slice.call(arguments)));return a.apply(this,arguments)}});return new a})})(j.$Nav);(function(e){e.when("$","now","async","Observer","debugStream","debug.param").build("data", function(a,b,d,c,f,i){var k={},h=i.value("navDisableDataKey"),l={},g=null,p=null,m=new c({async:!0}),e=function(){f("Data Batch",l);m.notify(l);g=p=null;for(var a in l)l.hasOwnProperty(a)&&(k[a]=l[a]);l={}},c=function(c){h&&h in c&&delete c[h];f("Data Added",c);l=a.extend(l,c);p&&clearTimeout(p);g||(g=b());g-b()>50?e():p=setTimeout(e,10);return c};c.get=function(a){return k[a]};c.getCache=function(){return k};c.observe=function(a,b,c){var g=-1;b&&typeof b==="function"?(g=m.observe(function(c){a in c&&(f("Data Observed",{name:a,data:c[a]}),b(c[a]))}),!c&&a in k&&d(function(){b(k[a])})):g=m.observe(a);return g};c.remove=function(a){return m.remove(a)};return c})})(j.$Nav);(function(e,a){a.importEvent("jQuery",{as:"$",global:"jQuery"});a.importEvent("jQuery",{global:"jQuery"});a.when("$").run("PageEventSetup",function(b){var d=function(){a.declare("page.domReady");a.declare("page.ATF");a.declare("page.CF");a.declare("page.loaded");a.declare("btf.full")};b(function(){a.declare("page.domReady")}); b(e).load(d);document.readyState==="complete"?d():document.readyState==="interactive"&&a.declare("page.domReady")});a.when("log","Observer","$F").run("setupPageReady",function(b,d,c){function f(){return document.readyState!=="complete"}var i=new d;i.observe(function(c){b("page.ready triggered by: "+c);a.declare("page.ready")});d=function(a){i.notify(a)};document.readyState==="complete"?d("immediate"):(a.when("page.ATF").run("page.TriggerATF",c.partial("Event: page.ATF").tap(b).iff(f).iff(function(){return!!a.getNow("config.readyOnATF")}).on(d)), a.when("page.CF").run("page.TriggerCF",c.partial("Event: page.CF").tap(b).iff(f).on(d)),a.when("page.domReady").run("page.TriggerDom+",c.delay(1E4).partial("Event: page.domReady+").tap(b).iff(f).on(d)),a.when("page.loaded").run("page.TriggerLoaded",c.delay(100).partial("Event: page.loaded+").tap(b).on(d)))});a.declare("noOp",function(){});a.when("$","img.sprite","util.preload","config","util.addCssRule","page.ready").run("ApplyHighResImage",function(a,d,c,f,i){a=e.devicePixelRatio||1;f.navDebugHighres&& (a=2);if(!(a<=1)){var k=f.upnavHighResImgInfo,h=f.upnav2xAiryPreloadImgInfo,l=f.upnav2xAiryPostSlateImgInfo;d["png32-2x"]&&c(d["png32-2x"],function(a){a.width>1&&i("#navbar .nav-sprite","background-image: url("+d["png32-2x"]+"); background-size: "+Math.floor(a.width/2)+"px;")});if(k&&k.upnav2xImagePath&&k.upnav2xImageHeight){var g=k.upnav2xImagePath;c(g,function(a){a.width>1&&i("#nav-upnav","background-image: url("+g+") !important;"+k.upnav2xImageHeight+" !important;")})}if(h&&h.preloadImgPath&&h.preloadImgHeight){var p= h.preloadImgPath;c(p,function(a){a.width>1&&i("#nav-airy-preload-slate-image","background-image: url("+p+") !important;height:"+h.preloadImgHeight+" !important;")})}if(l&&l.postslateImgPath&&l.postslateImgHeight){var m=l.postslateImgPath;c(m,function(a){a.width>1&&i("#nav-airy-post-media-slate-image","background-image: url("+m+") !important;height:"+l.postslateImgHeight+" !important;")})}}});a.when("config","now","Observer","noOp").build("debugStream",function(a,d,c,f){if(!a.isInternal)return a=function(){}, a.observe=f,a.getHistory=f,a;var i=[],k=new c,f=function(a,b){var c={data:b,msg:a,timestamp:d()};i.push(c);k.notify(c)};f.observe=k.boundObserve();f.getHistory=function(){return i};return f});a.when("debug.param","debugStream").build("log",function(a,d){return e.console&&e.console.log&&a("navDebug")?function(a){d("Log",a);e.console.log(a)}:function(){}});a.when("config").build("debug.param",function(a){if(!a.isInternal)return a=function(){return!1},a.value=function(){return null},a;var d=function(){for(var a= {},b=e.location.search.substring(1).split("&"),d=0;d<b.length;d++){var k=b[d].split("=");try{a[decodeURIComponent(k[0])]=decodeURIComponent(k[1])}catch(h){}}return a}(),a=function(a,b){return arguments.length===1?a in d:d[a]===b};a.value=function(a){return a in d?d[a]:null};return a});a.when("$").iff({name:"config",prop:"isInternal"},{name:"agent",prop:"quirks"}).run(function(a){a("#nav-debug-quirks-warning").show();a("#nav-debug-quirks-warning-close").click(function(){a("#nav-debug-quirks-warning").hide()})}); a.when("$","$F","config").iff({name:"config",prop:"windowWidths"}).run("windowResizeHandler",function(a,d,c){var f=a("#navbar").parent("header"),i=a(e),k=c.windowWidths,a=d.throttle(300).on(function(){for(var a=i.width(),b=0;b<k.length;b++){var c=k[b],d="nav-w"+c;a>=c?f.addClass(d):f.removeClass(d)}});i.resize(a);a()});a.when("$","$F","config.fixedBarBeacon","fixedBar","flyouts","page.ready","nav.inline").run("fixedBarResize",function(a,d,c,f,i){if(c){var k=a(e),h=0;a.each(i.getAll(),function(a,b){b.elem().height()> h&&(h=b.elem().height())});a=d.throttle(300).on(function(){var a=k.width(),b=k.height();a>=1E3&&b>=h+30?f.enable():f.disable()});k.resize(a);a()}});a.when("$","$F","config","pinnedNav","flyouts","page.ready","nav.inline").run("pinnedNavResize",function(a,d,c,f,i){if(c.pinnedNav){var k=a(e),h=0,l=1E3;a.each(i.getAll(),function(a,b){b.elem().height()>h&&(h=b.elem().height())});c.pinnedNavMinHeight?h=c.pinnedNavMinHeight:h+=30;if(c.pinnedNavMinWidth)l=c.pinnedNavMinWidth;a=d.throttle(300).on(function(){var a= k.width(),b=k.height();a>=l&&b>=h?f.enable():f.disable()});k.resize(a);a()}});a.when("PublishAPIs").publish("navbarJSInteraction")})(j,j.$Nav);(function(e,a){a.when("$","img.sprite","img.gifting","img.prime","util.preload","config","util.addCssRule","page.ready").run("ApplyHighResImageDesktop",function(a,d,c,f,i,k,h){d=e.devicePixelRatio||1;k.navDebugHighres&&(d=2);if(!(d<=1)){var d=k.fullWidthCoreFlyout,l=k.fullWidthPrime,g=k.transientMenuImage2xHover,p=k.transientMenuImage2x;p&&i(p,function(a){a.width> 1&&h("#nav-transient-flyout-trigger","background: url("+p+") no-repeat !important;background-size: "+Math.floor(a.width/2)+"px !important;")});g&&i(p,function(a){a.width>1&&(h("#nav-transient-flyout-trigger:focus","background: url("+g+") no-repeat !important; background-size: "+Math.floor(a.width/2)+"px !important;"),h("#nav-transient-flyout-trigger:hover","background: url("+g+") no-repeat !important; background-size: "+Math.floor(a.width/2)+"px !important;"))});d&&i(c["gifting-image-2x"],function(d){d.width> 1&&a("#nav-flyout-gifting img").attr("src",c["gifting-image-2x"])});l&&(k=function(a,b){var c=f[b];c&&i(c,function(b){b.width>1&&a.attr("src",c)})},k(a("#nav-prime-music-image"),"prime_music_image_2x"),k(a("#nav-prime-shipping-image"),"prime_shipping_image_2x"),k(a("#nav-prime-video-image"),"prime_video_image_2x"),k(a("#nav-prime-rec-left-image"),"prime_rec_left_image_2x"))}})})(j,j.$Nav);(function(e){e.when("logEvent.enabled","$F").build("logEvent",function(a,b){var d={};return function(c,f){var i= [],k;for(k in c)c.hasOwnProperty(k)&&i.push(k+":"+c[k]);i.sort();i=i.join("|");d[i]||(d[i]=!0,e.getNow("log",b.noOp)("logEv:"+i),a&&j.ue&&j.ue.log&&j.ue.log(c,"navigation",f))}});e.when("agent","logEvent","btf.lite").run("logQuirks",function(a,b){b({quirks:a.quirks?1:0})});e.when("$F","log").build("phoneHome",function(a,b){function d(){f={t:[],e:[]};i={t:{},e:{}};k=!0}function c(a,c){c&&!(c in i[a])&&(f[a].push(c),b("PhoneHome: "+a+" "+c),i[a][c]=!0,k=!1)}var f,i,k;e.when("$","config.recordEvUrl", "config.recordEvInterval","config.sessionId","config.requestId","eventing.onunload").run("recordEvLoop",function(a,b,c,i,m,e){function q(a,b){var c=f[a].join(b);return j.encodeURIComponent(c)}function o(a){s++;if(!k){var a=a||s,c=q("t",":"),g=q("e",":"),a="trigger="+c+"&exposure="+g+"&when="+a+"&sid="+(j.ue&&j.ue.sid||i||"")+"&rid="+(j.ue&&j.ue.rid||m||""),c=b.indexOf("?")>0?"&":"?";(new Image).src=b+c+a;d()}}if(b){var s=0;j.setInterval(o,c);e(function(){o("beforeunload")})}});d();return{trigger:a.partial("t").on(c), exposure:a.partial("e").on(c)}})})(j.$Nav);(function(e){e.when("log").build("metrics",function(a){return new function(){var b=this;this.count=function(b,c){if(j.ue&&j.ue.count){var f=j.ue.count(b);f||(f=0);f+=c;j.ue.count(b,f);a("Nav-Metrics: Incremented "+b+" to "+f);return f}else a("Nav-Metrics: UE not setup. Unable to send Metrics")};this.increment=function(a){return b.count(a,1)};this.decrement=function(a){return b.count(a,-1)}}});e.build("managerStats",function(){return function(){var a={totalCallCount:0, totalExecutionTime:0},b=e.stats(),d;for(d in b)if(b.hasOwnProperty(d)){var c=b[d].stats;a.totalCallCount+=c.callCount;a.totalExecutionTime+=c.executionTime}return a}});e.when("metrics","managerStats","config","sharedconstants","page.ATF").run("jsMetrics.ATF",function(a,b,d,c){b=b();a.count(c.TIME_UP_TO+"ATF:"+d.navDeviceType,b.totalExecutionTime)});e.when("metrics","managerStats","config","sharedconstants","page.CF").run("jsMetrics.CF",function(a,b,d,c){b=b();a.count(c.TIME_UP_TO+"CF:"+d.navDeviceType, b.totalExecutionTime)});e.when("metrics","managerStats","config","sharedconstants","page.loaded").run("jsMetrics.PageLoaded",function(a,b,d,c){b=b();d=d.navDeviceType;a.count(c.TIME_UP_TO+"PageLoaded:"+d,b.totalExecutionTime);a.count(c.TOTAL_CALL_COUNT+"PageLoaded:"+d,b.totalCallCount)});e.when("metrics","config","sharedconstants","page.loaded").run("jsMetrics.collector",function(a,b,d){var c=j.navmet;if(!(c===z||c.length===z))if(b=b.navDeviceType,j.ue_t0!==z){var f={},i=[],k,h;for(k=0;k<c.length;++k)h= c[k],f[h.key]!==z?(f[h.key].key=h.key,f[h.key].delta+=h.end-h.begin,f[h.key].completed=h.end-j.ue_t0,i[f[h.key].index]=z,f[h.key].index=k):f[h.key]={key:h.key,delta:h.end-h.begin,completed:h.end-j.ue_t0,index:k},i.push(h.key);for(k=0;k<i.length;++k)i[k]!==z&&(h=f[i[k]],a.count(d.CSM_LATENCY_V2+":"+h.key+":D:"+b,h.delta),a.count(d.CSM_LATENCY_V2+":"+h.key+":C:"+b,h.completed))}});e.when("metrics","sharedconstants","config").run("metrics.csm",function(a,b,d){if(d=d.navDeviceType){var c={UpNavBanner:{since:"ue_t0", by:"nav_t_upnav_begin"},BeginNav:{since:"ue_t0",by:"nav_t_begin_nav"},InlineCSS:{since:"ue_t0",by:"nav_t_after_inline_CSS"},PreloadJS:{since:"ue_t0",by:"nav_t_after_preload_JS"},PreloadSprite:{since:"ue_t0",by:"nav_t_after_preload_sprite"},ANI:{since:"ue_t0",by:"nav_t_after_ANI"},Config:{since:"ue_t0",by:"nav_t_after_config_declaration"},NavBar:{since:"ue_t0",by:"nav_t_after_navbar"},SearchBar:{since:"ue_t0",by:"nav_t_after_searchbar"},EndNav:{since:"ue_t0",by:"nav_t_end_nav"}},f=function(d,f){var i= c[f];if(i){var g=j[i.by],i=j[i.since];g&&i&&a.count(b.CSM_LATENCY+":"+f+":"+d,g-i)}},i;for(i in c)c.hasOwnProperty(i)&&f(d,i)}})})(j.$Nav);(function(e){e.when("$","debugStream","util.checkedObserver","util.node","util.randomString").build("panels",function(a,b,d,c,f){var i={},k=0,h=function(a){return function(b){for(var c in i)i.hasOwnProperty(c)&&a.call(i[c],b||{})}},l={create:function(g){var h={name:"panel-"+k++,visible:!1,sidePanelCallback:[],locked:!1,rendered:!1,interactionDelay:750,elem:null, groups:[],locks:[]},g=a.extend({},h,g);if(i[g.name])return i[g.name];var m={},e=!0;m.elem=function(b){if(b||e)g.elem=a(c.create(b||g.elem)),e=!1;return g.elem};var j=!1;m.interact=d({context:m,observe:function(){b("Panel Interact",m);j=!0}});m.hasInteracted=function(){return j};var o=null,s=function(){o&&(clearTimeout(o),o=null)},n=function(){s();g.rendered&&g.visible&&(o=setTimeout(m.interact,g.interactionDelay))};m.render=d({context:m,check:function(){if(g.rendered)return!1},observe:function(){g.rendered= !0;n();b("Panel Render",m)}});m.reset=d({context:m,observe:function(){g.rendered=!1;s();b("Panel Reset",m)}});m.show=d({context:m,check:function(a){if(g.visible||g.locked||!m.groups.has(a.group))return!1},observe:function(a){if(g.groups.length>0)for(var c=0;c<g.groups.length;c++)l.hideAll({group:g.groups[c]});g.rendered||m.render(a);g.visible=!0;n();b("Panel Show",m)}});m.hide=d({context:m,check:function(a){if(!g.visible||g.locked||!m.groups.has(a.group))return!1},observe:function(){g.visible=!1; s();b("Panel Hide",m)}});m.lockRequest=d({context:m});m.lock=d({context:m,check:function(a){var b=g.locked;m.locks.add(a.lockKey||"global");m.lockRequest();if(b)return!1},observe:function(){b("Panel Lock",m)}});m.unlockRequest=d({context:m});m.unlock=d({context:m,check:function(a){m.unlockRequest();m.locks.remove(a.lockKey||"global");if(g.locked)return!1},observe:function(){b("Panel Unlock",m)}});m.groups={add:function(a){g.groups.push(a)},remove:function(b){b=a.inArray(b,g.groups);b>-1&&g.groups.splice(b, 1)},has:function(b){return!b||a.inArray(b,g.groups)>-1?!0:!1},clear:function(){g.groups=[]}};m.locks={add:function(a){g.locks.push(a||f());g.locked=!0},remove:function(b){b=a.inArray(b,g.locks);b>-1&&g.locks.splice(b,1);if(g.locks.length===0)g.locked=!1},has:function(b){return!b||a.inArray(b,g.locks)>-1?!0:!1},clear:function(){g.locked=!1;g.locks=[]}};m.isVisible=function(){return g.visible};m.isSideCallbackSet=function(){return g.sidePanelCallback!==null};m.setSidePanelCallback=function(a){g.sidePanelCallback.push(a)}; m.initiateSidePanel=function(){if(g.sidePanelCallback!==null)for(var a=0;a<g.sidePanelCallback.length;a++)g.sidePanelCallback[a]()};m.isLocked=function(){return g.locks.length>0};m.isRendered=function(){return g.rendered};m.isGrouped=function(){return g.groups.length>0};m.getName=function(){return g.name};m.destroy=d({context:m,observe:function(){s();var a=m.elem();a&&a.remove();b("Panel destroy",m)}});m.onReset=m.reset.observe;m.onRender=m.render.observe;m.onInteract=m.interact.observe;m.onShow= m.show.observe;m.onHide=m.hide.observe;m.onLock=m.lock.observe;m.onUnlock=m.unlock.observe;m.onLockRequest=m.lockRequest.observe;m.onUnlockRequest=m.unlockRequest.observe;m.onDestroy=m.destroy.observe;a.each(g,function(a,b){!(a in h)&&!(a in m)&&(m[a]=b)});b("Panel Create",m);return i[g.name]=m},destroy:function(a){return i[a]?(i[a].destroy(),delete i[a],!0):!1},hideAll:h(function(a){this.hide(a)}),showAll:h(function(a){this.show(a)}),lockAll:h(function(a){this.lock(a)}),unlockAll:h(function(a){this.unlock(a)}), getAll:function(a){var a=a||{},b=[],c;for(c in i)(!("locked"in a)||i[c].isLocked()===a.locked)&&(!("visible"in a)||i[c].isVisible()===a.visible)&&(!("rendered"in a)||i[c].isRendered()===a.rendered)&&(!("group"in a)||i[c].groups.has(a.group))&&(!("lockKey"in a)||i[c].locks.has(a.lockKey))&&b.push(i[c]);return b},get:function(a){return i[a]}};return l})})(j.$Nav);(function(e){e.when("$","data","debugStream","panels","util.templates","metrics","util.checkedObserver").build("dataPanel",function(a,b,d, c,f,i,k){var h=0;return function(l){var g=c.create(a.extend({id:"dataPanel-"+l.dataKey+"-"+h++,className:null,dataKey:null,groups:[],spinner:!1,visible:!0,timeoutDataKey:null,timeoutDelay:5E3,elem:function(){var b=a("<div class='nav-template'></div>");l.id&&b.attr("id",l.id);l.className&&b.addClass(l.className);l.spinner&&b.addClass("nav-spinner");return b}},l)),p=f.renderer();p.onRender(function(a){g.reset();g.render({html:a,templateName:p.templateName,data:p.data})});var m=null;g.timeout=k({context:g, check:function(){if(g.isRendered())return!1},observe:function(){if(l.timeoutDataKey){var a=b.get(l.timeoutDataKey);if(a){a.isTimeout=!0;var c={};c[l.dataKey]=a;b(c)}i.increment("nav-panel-"+l.timeoutDataKey);d("Panel Timeout",g)}}});g.onTimeout=g.timeout.observe;g.startTimeout=function(){m&&clearTimeout(m);g.isRendered()||(m=setTimeout(g.timeout,g.timeoutDelay))};g.render.check(function(a){if(!a.html)return!1});g.onRender(function(a){var b=this.elem();b[0].className="nav-template"+(l.className?" "+ l.className:"")+(a.templateName?" nav-tpl-"+a.templateName:"")+(a.noTemplate?" nav-tpl-itemList":"");b.html(a.html||"")});g.onReset(function(){var a=this.elem();a[0].className="nav-template"+(l.className?" "+l.className:"")+(l.spinner?" nav-spinner":"");a.html("")});g.data=k({context:g});g.onData=g.data.observe;g.onShow(function(){this.elem().show()});g.onHide(function(){this.elem().hide()});var e=function(c){if(c){if(c.css)g.styleSheet&&g.styleSheet.attr("disabled","disabled").remove(),g.styleSheet= a("<style type='text/css' />").appendTo("head"),g.styleSheet[0].styleSheet?g.styleSheet[0].styleSheet.cssText=c.css:g.styleSheet[0].appendChild(document.createTextNode(c.css));c.event&&typeof c.event==="string"&&a.isFunction(g[c.event])?g[c.event].call(g):c.event&&typeof c.event.name==="string"&&a.isFunction(g[c.event.name])?g[c.event.name].apply(g,Object.prototype.toString.call(c.event.args)==="[object Array]"?c.event.args:[]):c.template?(p.templateName=c.template.name,p.data=c.template.data,p.render()): c.html?(g.reset(),g.render({html:c.html,noTemplate:c.noTemplate})):c.dataKey&&b.get(c.dataKey)&&e(b.get(c.dataKey));g.data(c)}},j=b.observe(l.dataKey,e);g.onDestroy(function(){b.remove(j)});return g}})})(j.$Nav);(function(e){e.when("$","$F","util.parseQueryString","config.isInternal","log","metrics","onOptionClick","eventing.onunload").build("searchMetrics",function(a,b,d,c,f,i,k,h){return function(l){var g=this;this.elements=l;this.debug=!1;this.trigger="TN";this.scopeChanged=!1;this.setTrigger= b.once().on(function(a){g.trigger=a});this.queryFirst="N";this.setQueryFirst=b.once().on(function(a){g.queryFirst=a?0:1});this.TRIGGERS={BUTTON:"TB",ENTER_KEY:"TE",ISS_KEYBOARD:"ISSK",ISS_MOUSE:"ISSM"};this._getState=function(){var a=g.elements.scopeSelect[0].selectedIndex||null,b=g.elements.inputTextfield.val();b===""&&(b=null);return{scope:a,query:b}};this._computeAction=function(a,b,c){var d="N";a?(d="R",b&&(d="NC",a!==b&&(d="M"))):b&&(d="A");return c+d};this._computeKey=function(){var a=g._getState(), b=g._computeAction(g.initial.scope,a.scope,"S"),a=g._computeAction(g.initial.query,a.query,"Q");return["QF-"+g.queryFirst,b,a,g.trigger].join(":")};this.log=function(a){g.debug&&f(a)};this.printKey=function(){if(g.debug){var a=g._computeKey();g.log("SM: key is: "+a);return a}};this._sendMetric=b.once().on(function(){var a=g._computeKey();i.increment(a)});this.init=function(){this.debug=c&&d().navTestSearchMetrics==="1";this.initial=this._getState();this.log("SM: initial state");this.log(this.initial); k(this.elements.scopeSelect,function(){g.log("SM: scope changed");g.scopeChanged=!0});this.elements.inputTextfield.keypress(function(a){a.which===13?g.setTrigger(g.TRIGGERS.ENTER_KEY):(g.scopeChanged&&g.setQueryFirst(!0),g.setQueryFirst(!1))});this.elements.submitButton.click(function(){g.setTrigger(g.TRIGGERS.BUTTON)});e.when("flyoutAPI.SearchSuggest").run(function(b){b.onShow(function(){a(".srch_sggst_flyout").one("mousedown",function(){g.setTrigger(g.TRIGGERS.ISS_MOUSE)})})});h(function(a){if(g.debug)return g.printKey(), a.preventDefault(),a.stopPropagation(),!1;g._sendMetric()})}}})})(j.$Nav);(function(e){e.when("log","sharedconstants").build("flyoutMetrics",function(a,b){function d(a){var d=0,k=!1,h;a.elem().click(function(){var b=!h?void 0:new Date-h;c("nav-flyout-"+a.getName()+"-dwellTime",b);k=!1});a.onShow(function(){h=new Date;k=!0});a.onHide(function(){if(k){var l=!h?void 0:new Date-h;l>b.DWELLTIME_MIN&&(d++,c("nav-flyout-"+a.getName()+"-dwellTime",l),c("nav-flyout-"+a.getName()+"-bounceCount",d))}k=!1})} function c(b,c){j.ue&&j.ue.count&&(j.ue.count(b,c),a("Nav-Flyout-Metrics: "+b+" to "+c))}a("flyout metrics");return{attachTo:function(a){d(a)}}})})(j.$Nav);(function(e){e.build("util.addCssRule",function(){var a=null;return function(b,d,c){if(!a){var f=document.getElementsByTagName("head")[0];if(!f)return;var i=document.createElement("style");i.appendChild(document.createTextNode(""));f.appendChild(i);a=i.sheet||{}}a.insertRule?a.insertRule(b+"{"+d+"}",c):a.addRule&&a.addRule(b,d,c)}})})(j.$Nav); (function(e){e.when("$","Observer").build("util.ajax",function(a){return function(b){var b=a.extend({url:null,data:{},type:"GET",dataType:"json",cache:!1,timeout:5E3,retryLimit:3},b),d=b.error;b.error=function(){--this.retryLimit>=0?(a.ajax(this),b.retry&&b.retry(this)):d&&d(this,arguments)};return a.ajax(b)}})})(j.$Nav);(function(e){e.when("$").build("agent",function(a){var b=function(){var a=Array.prototype.slice.call(arguments,0);return RegExp("("+a.join("|")+")","i").test(navigator.userAgent)}, d=!!("ontouchstart"in j)||b("\\bTouch\\b")||j.navigator.msMaxTouchPoints>0,c={iPhone:b("iPhone"),iPad:b("iPad"),kindleFire:b("Kindle Fire","Silk/"),android:b("Android"),windowsPhone:b("Windows Phone"),webkit:b("WebKit"),ie11:b("Trident/7"),ie10:b("MSIE 10"),ie7:b("MSIE 7"),ie6:a.browser?a.browser.msie&&parseInt(a.browser.version,10)<=6:b("MSIE 6"),opera:b("Opera"),firefox:b("Firefox"),mac:b("Macintosh"),iOS:b("iPhone")||b("iPad")};c.ie=a.browser?a.browser.msie:c.ie11||b("MSIE");c.touch=c.iPhone|| c.iPad||c.android||c.kindleFire||d;c.quirks=c.ie&&document&&document.compatMode!=="CSS1Compat";return c})})(j.$Nav);(function(e){e.when("$","$F","agent","util.bean","util.class").build("util.Aligner",function(a,b,d,c,f){var i={top:{direction:"vert",size:0},middle:{direction:"vert",size:0.5},bottom:{direction:"vert",size:1},left:{direction:"horiz",size:0},center:{direction:"horiz",size:0.5},right:{direction:"horiz",size:1}},k={top:"vert",bottom:"vert",left:"horiz",right:"horiz"},h=function(a,b,c){try{return a[b? "outerHeight":"outerWidth"](c)||0}catch(d){return 0}},l=function(a,b){var c=b?"top":"left";try{var d=a.offset();return d?d[c]:0}catch(f){return 0}},d=f();d.prototype.alignTo=c({value:a.fn});d.prototype.offsetTo=c({value:a.fn});d.prototype.base=c({value:a.fn});d.prototype.target=c({value:a.fn});d.prototype.fullWidth=c({value:!1});d.prototype.constrainTo=c({value:a.fn});d.prototype.constrainBuffer=c({value:[0,0,0,0]});d.prototype.constrainChecks=c({value:[!0,!0,!0,!0]});d.prototype.fullWidthCss=c({get:function(b){return a.extend({left:"0px", right:"0px",width:"auto"},b)},value:function(){return{}}});d.prototype.anchor=c({value:{vert:"top",horiz:"left"},set:function(a){for(var a=a.split(" "),b={vert:"top",horiz:"left"},c=0;c<a.length;c++)k[a[c]]&&(b[k[a[c]]]=a[c]);return b}});d.prototype.getAlignment=function(a){var c=i[a];if(c){var d=c.direction==="vert"?!0:!1,f=d?"top":"left",k=d?"bottom":"right";return{offset:b.bind(this).on(function(){return l(this.base(),d)-l(this.offsetTo(),d)+h(this.base(),d)*c.size}),align:b.bind(this).on(function(){var a= this.from()[c.direction].offset()+this.nudgeFrom()[f],b=l(this.alignTo(),d),g=b-l(this.offsetTo(),d)+this.nudgeTo()[f],i=h(this.target(),d),a=a-g-i*c.size,e=this.constrainTo();if(e.length===1){var g=this.constrainChecks(),j=this.constrainBuffer(),x=h(e,d)-(d?j[0]+j[2]:j[1]+j[3]),e=l(e,d)+(d?j[0]:j[3]);if((d&&g[0]||!d&&g[3])&&a+b<e)a=e-b;else if((d&&g[2]||!d&&g[1])&&a+b+i>e+x)a=e+x-i-b}b={};this.anchor()[c.direction]===f?b[f]=a:(g=h(this.alignTo(),d),b[k]=g-a-i);return b})}}else return{offset:function(){return 0}, align:function(){return{}}}};d.prototype.from=c({set:function(a){for(var a=a.split(" "),b={vert:this.getAlignment(),horiz:this.getAlignment()},c=0;c<a.length;c++){var d=i[a[c]];d&&(b[d.direction==="vert"?"vert":"horiz"]=this.getAlignment(a[c]))}return b},value:function(){return{vert:this.getAlignment(),horiz:this.getAlignment()}}});d.prototype.to=c({set:function(a){for(var a=a.split(" "),b={vert:this.getAlignment(),horiz:this.getAlignment()},c=0;c<a.length;c++){var d=i[a[c]];d&&(b[d.direction==="vert"? "vert":"horiz"]=this.getAlignment(a[c]))}return b},value:function(){return{vert:this.getAlignment(),horiz:this.getAlignment()}}});d.prototype.nudgeFrom=c({set:function(a){return{top:a.top||0,left:a.left||0}},value:{top:0,left:0}});d.prototype.nudgeTo=c({set:function(a){return{top:a.top||0,left:a.left||0}},value:{top:0,left:0}});d.prototype.align=function(b){b&&this.target(b);this.target().css("position","absolute");b=this.to();this.target().css(a.extend({},b.vert.align(),this.fullWidth()?this.fullWidthCss(): b.horiz.align()));return this};return d})})(j.$Nav);(function(e){e.when("$","$F").build("util.bean",function(a,b){var d=0;return function(c){c=a.extend({name:"__bean_storage_"+d++,set:function(a){return a},get:function(a){return a}},c);return function(a){var d=c.context||this;if(!d[c.name]&&(d[c.name]={},typeof c.value!=="undefined"))d[c.name].value=c.value instanceof Function?b.bind(d).on(c.value)():c.value;var k=d[c.name].value;if(typeof a!=="undefined"){if(!d[c.name].set)d[c.name].set=b.bind(d).on(c.set); d[c.name].value=d[c.name].set(a,k);return d}if(typeof k==="undefined"&&typeof c.empty!=="undefined"){if(!d[c.name].empty)d[c.name].empty=c.empty instanceof Function?b.bind(d).on(c.empty):function(){return c.empty};k=d[c.name].empty()}if(!d[c.name].get)d[c.name].get=b.bind(d).on(c.get);return d[c.name].get(k)}}})})(j.$Nav);(function(e){e.declare("util.checkedObserver",function(a){function b(a){a=a||{};b.check(a)!==!1&&(d++,b.observe(a))}var d=0,c={},f=[],i=[];b.observe=function(a){a=a||{};if(typeof a=== "function")return f.push(a),b;else for(var d=0;d<f.length;d++)f[d].call(c,a)};b.check=function(a){a=a||{};if(typeof a==="function")return i.push(a),b;else{for(var d=0;d<i.length;d++)if(i[d].call(c,a)===!1)return!1;return!0}};b.context=function(a){return a?(c=a,b):c};b.count=function(a){return a?(d=a,b):d};if(a)for(var k in a)if(a.hasOwnProperty(k)&&b[k])b[k](a[k]);return b})})(j.$Nav);(function(e){e.when("$","$F").build("util.class",function(a,b){return function(d){var d=a.extend({construct:b.noOp}, d),c=function(a){for(var b in a)this[b](a[b]);d.construct.apply(this,arguments)};c.newInstance=function(){var a=Array.prototype.slice.call(arguments),b=function(){return c.apply(this,a)};b.prototype=c.prototype;return new b};c.isInstance=function(a){return a instanceof this};return c}})})(j.$Nav);(function(e){e.when("$","$F","util.bean","util.class").build("util.Ellipsis",function(a,b,d,c){b=c();b.prototype._storage=[];b.prototype.elem=function(b){var c=this;b instanceof a&&b.get&&(b=b.get());var d= function(b){b=a(b);c._storage.push({$elem:b,text:b.text(),isTruncated:!1})};if(b instanceof Array)for(var h=0;h<b.length;h++)d(b[h]);else d(b);return this};b.prototype.lines=d({value:!1});b.prototype.external=d({value:!1});b.prototype.lastCharacter=d({value:"..."});b.prototype.dimensions=d({empty:function(){var a=this.lines();return function(b){return{width:b.innerWidth(),height:a?parseInt(b.css("line-height"),10)*a:b.parent().height()}}},set:function(a){var b=this;return function(c){c=a.call(b,c); return{width:c.width||0,height:c.height||0}}}});b.prototype.refresh=function(){this.reset();this.truncate();return this};b.prototype.truncate=function(){var b=this.lastCharacter(),c=this.external(),d=this.dimensions(),h;c&&(h=a("<div></div>").css({position:"absolute",left:"-10000px",visibility:"hidden"}).appendTo(document.body));a.each(this._storage,function(a,g){if(!g.isTruncated){g.isTruncated=!0;var p=d(g.$elem);c&&h.css({width:p.width+"px",lineHeight:g.$elem.css("line-height")});var m=c?h:g.$elem; m.text("");for(var e=m.height(),j=g.text.split(" "),o=0,s="";e<=p.height;){var n=j.slice(0,++o).join(" ");if(j[o]!==""){if(n.length===s.length){g.$elem.text(g.text);return}else m.text(n+b),e=m.height();s=n}}g.$elem.text(j.slice(0,o-1).join(" ")+b)}});c&&h.remove();return this};b.prototype.reset=function(){a.each(this._storage,function(a,b){if(b.isTruncated)b.isTruncated=!1,b.$elem.text(b.text)});return this};return b})})(j.$Nav);(function(e){e.when("$").build("eventing.onunload",function(a){var b= e.getNow("config.pageHideEnabled");return function(d){b&&j.addEventListener&&(j.onpagehide||j.onpagehide===null)?j.addEventListener("pagehide",d,!1):a(j).bind("beforeunload",d)}})})(j.$Nav);(function(e){e.build("util.getComputedStyle",function(){return j.getComputedStyle||function(a){return{el:a,getPropertyValue:function(b){var d=/(\-([a-z]){1})/g;b==="float"&&(b="styleFloat");d.test(b)&&(b=b.replace(d,function(a,b,d){return d.toUpperCase()}));return a.currentStyle&&a.currentStyle[b]?a.currentStyle[b]: null}}}})})(j.$Nav);(function(e){e.when("$","img.pixel","util.getComputedStyle").build("util.highContrast",function(a,b,d){var c=document.createElement("div");c.style.cssText="position:absolute; left:-1000px; height:10px; width:10px; border-left:1px solid black; border-right:1px solid white; background-image: url('"+b+"')";document.body.appendChild(c);b=d(c,"backgroundImage");d=b==="none"||b==="url(invalid-url:)"||d(c,"borderLeftColor")===d(c,"borderRightColor");a.browser&&a.browser.msie&&parseInt(a.browser.version, 10)<=7?c.outerHTML="":document.body.removeChild(c);return d})})(j.$Nav);(function(e){e.build("util.highRes",function(){return j.devicePixelRatio>1?!0:!1})})(j.$Nav);(function(e){e.when("agent").build("util.inlineBlock",function(a){return function(b){a.ie6||a.quirks?b.css({display:"inline",zoom:"1"}):b.css({display:"inline-block"})}})})(j.$Nav);(function(e){e.when("$F","util.Keycode").build("util.onKey",function(a,b){return function(d,c,f,i){if(!d||!c)return{bind:a.noOp,unbind:a.noOp};var f=f||"keydown", i=i===!1?!1:!0,k=function(a){var d=new b(a);return c.call(d,a)};i&&d.bind(f,k);return{bind:function(){i||(d.bind(f,k),i=!0)},unbind:function(){i&&(d.unbind(f,k),i=!1)}}}});e.when("$").build("util.Keycode",function(a){function b(a){this.evt=a;this.code=a.keyCode||a.which}b.prototype.isAugmented=function(){return this.evt.altKey||this.evt.ctrlKey||this.evt.metaKey};b.prototype.isAugmentor=function(){return 0<=a.inArray(this.code,[0,16,20,17,18,224,91,93])};b.prototype.isTextFieldControl=function(){return 0<= a.inArray(this.code,[8,9,13,32,35,36,37,38,39,40,45,46])};b.prototype.isControl=function(){if(this.code<=46)return!0;else if(this.code>=91&&this.code<=95)return!0;else if(this.code>=112&&this.code<=145)return!0;return!1};b.prototype.isShiftTab=function(){return this.code===9&&this.evt.shiftKey};b.prototype.isTab=function(){return this.code===9};b.prototype.isEnter=function(){return this.code===13};b.prototype.isBackspace=function(){return this.code===8};b.prototype.isSpace=function(){return this.code=== 32};b.prototype.isEscape=function(){return this.code===27};return b})})(j.$Nav);(function(e){e.when("$","now","agent").build("util.MouseTracker",function(a,b,d){function c(a){var c=k.length;if(c&&(c=k[c-1],c.x===a.pageX&&c.y===a.pageY))return;k.push({x:a.pageX,y:a.pageY,when:h?a.timeStamp:b()});k.length>100&&(k=k.slice(-i))}function f(){this.active=!0;l===0&&a(document).mousemove(c);l++}var i=10,k=[],h=!d.firefox,l=0;f.prototype.stop=function(){if(this.active&&(l--,l===0))a(document).unbind("mousemove", c),this.active=!1,k=[]};f.prototype.position=function(){var b=k.length;return!b?null:a.extend(!0,{},k[b-1])};f.prototype.velocity=function(){var a=k.length;if(a>1&&b()-k[a-1].when<=75)for(var c=k[a-1],d=2;d<=a;d++){var f=k[a-d],h=c.when-f.when,f=Math.abs(c.x-f.x)+Math.abs(c.y-f.y);if(f>0&&h>0)return f/h*1E3}return 0};f.prototype.history=function(b){var c=k.length;if(c===0)return[];var d=Math.min(c,i);arguments.length>0&&(d=Math.min(d,b));var f=[],h=c-1;for(c-=d;h>=c;h--)f.push(a.extend(!0,{},k[h])); return f};return{start:function(){return new f}}});e.when("$","$F","util.MouseTracker","debug.param").build("util.Proximity",function(a,b,d,c){function f(b,c){var d=[],g=[],f=[],i=[];b.each(function(b,c){var c=a(c),h=c.offset();d.push(h.left);f.push(h.top);g.push(h.left+c.width());i.push(h.top+c.height())});return{left:Math.min.apply(Math,d)-c[3],top:Math.min.apply(Math,f)-c[0],right:Math.max.apply(Math,g)+c[1],bottom:Math.max.apply(Math,i)+c[2]}}var i=c("navDebugProximity");return{onEnter:function(c, h,l,g){function p(){i&&q.show().css({background:"rgba(255,0,0,0.1)"});s&&(j.clearInterval(s),s=null);m&&(m.stop(),m=null);e=null}var m=d.start(),e=f(c,h);if(i){var q=a("<div></div>").css({position:"absolute",top:e.top,left:e.left,width:e.right-e.left,height:e.bottom-e.top,background:"rgba(0,255,0,0.1)",zIndex:1E3,clickEvents:"none"});q.click(function(){q.hide().remove()});q.show();a("body").append(q)}var o;o=g?b.throttle(g).on(l):b.once().on(function(){p();l()});var s=j.setInterval(function(){var a= m.position();a&&a.x>=e.left&&a.x<=e.right&&a.y>=e.top&&a.y<=e.bottom&&o()},100);return{unbind:function(){p()}}}}});e.when("$","$F","Observer","util.MouseTracker").build("util.MouseIntent",function(a,b,d,c){function f(a,b,c,d){var f=(c.x-b.x)*(d.y-b.y)-(d.x-b.x)*(c.y-b.y),i=((d.x-a.x)*(b.y-a.y)-(b.x-a.x)*(d.y-a.y))/f,b=((b.x-a.x)*(c.y-a.y)-(c.x-a.x)*(b.y-a.y))/f;return((c.x-a.x)*(d.y-a.y)-(d.x-a.x)*(c.y-a.y))/f>0&&i>0&&b>0}function i(f,h){var i,g,f=a(f),h=a.extend({slop:25,minorDelay:200,majorDelay:100}, h);this._onStrayEvent=new d({once:!0,async:!0});this._onArriveEvent=new d({once:!0,async:!0});this._tracker=c.start();this.onArrive(b.bind(this._tracker).on(this._tracker.stop));this.onStray(b.bind(this._tracker).on(this._tracker.stop));this._minorDelay=h.minorDelay;this._majorDelay=h.majorDelay;g=f;var p=h.slop,m=g.offset();i={x:m.left,y:m.top-p};g={x:m.left+g.outerWidth(),y:m.top+g.outerHeight()+p};this._upperLeft=i;this._lowerRight=g;this._minor=0;this._tick()}i.prototype.onArrive=function(a){this._onArriveEvent.observe(a); return this};i.prototype.onStray=function(a){this._onStrayEvent.observe(a);return this};i.prototype._scheduleTick=function(a){this._timer=b.delay(a).bind(this).run(this._tick)};i.prototype.cancel=function(){this._timer&&j.clearTimeout(this._timer)};i.prototype._tick=function(){if(!this._onStrayEvent.isNotified()&&!this._onArriveEvent.isNotified()){var a=this._tracker.history(10);if(a.length<2)this._scheduleTick(this._minorDelay);else{for(var b=a.shift(),c=null;a.length;)if(c=a.shift(),!(Math.abs(c.x- b.x)<2&&Math.abs(c.y-b.y)<2))break;c?b.x>=this._upperLeft.x&&b.x<=this._lowerRight.x&&b.y>=this._upperLeft.y&&b.y<=this._lowerRight.y?this._onArriveEvent.notify():f(b,c,this._upperLeft,this._lowerRight)||f(b,c,{x:this._lowerRight.x,y:this._upperLeft.y},{x:this._upperLeft.x,y:this._lowerRight.y})?Math.abs(b.x-c.x)<2&&Math.abs(b.y-c.y)<2?this._minor>=2?this._onStrayEvent.notify():(this._minor++,this._scheduleTick(this._minorDelay)):(this._minor=0,this._scheduleTick(this._majorDelay)):this._onStrayEvent.notify(): this._scheduleTick(this._minorDelay)}}};return i});e.when("$","agent","Observer","util.bean","util.class").build("util.ClickOut",function(a,b,d,c,f){b=f({construct:function(){var b=this;this._isEnabled=!1;this._clickHandler=function(c){var d=b.ignore(),f=d.length,c=c.target;a(c).parents().add(c).filter(function(){for(var a=0;a<f;a++)if(this===d[a])return!0;return!1}).length===0&&b.action()}}});b.prototype.attachTo=c({value:function(){return a(document.body)}});b.prototype.ignore=c({value:function(){return[]}, set:function(b,c){c.push(b instanceof a?b.get(0):b);return c}});b.prototype.action=c({value:function(){return new d},set:function(a,b){b.observe(a);return b},get:function(a){a.notify()}});b.prototype.enable=function(){if(!this._isEnabled)return this.attachTo().bind("click touchstart",this._clickHandler),this._isEnabled=!0,this};b.prototype.disable=function(){if(this._isEnabled)return this.attachTo().unbind("click touchstart",this._clickHandler),this._isEnabled=!1,this};return b});e.when("$","Observer").build("util.mouseOut", function(a,b){return function(a){var a=a||10,c=new b,f=c.boundObserve(),i=new b,k=[],h=!1,l=null,g=!1,p=function(){l&&(clearTimeout(l),l=null)},m=function(){p();l=setTimeout(function(){c.notify();p();g=!1},a)},e=function(){g||i.notify();g=!0;p()};return{add:function(a){h&&a.hover(p,m);k.push(a)},enable:function(){if(!h){for(var a=0;a<k.length;a++)k[a].hover(e,m);h=!0}},changeTimeout:function(b){a=b},disable:function(){if(h){p();for(var a=0;a<k.length;a++)k[a].unbind("mouseenter mouseleave");g=h=!1}}, onEnter:i.boundObserve(),onLeave:f,action:f}}});e.when("$","Observer","util.MouseTracker").build("util.velocityTracker",function(a,b,d){return function(){var a={},f=null,i=!1,k=null,h=new b({context:a});a.enable=function(){i||(f=d.start(),k=j.setInterval(function(){h.notify(f.velocity())},25),i=!0)};a.disable=function(){i&&(j.clearInterval(k),k=null,f.stop(),f=null,i=!1)};a.addThreshold=function(b,d){b&&d&&h.observe(function(f){(!b.above||f>b.above)&&(!b.below||f<b.below)&&d.call(a,f)})};return a}})})(j.$Nav); (function(e){e.when("$").build("util.node",function(a){function b(a){return typeof j.Node==="object"?a instanceof j.Node:a&&typeof a==="object"&&typeof a.nodeType==="number"&&typeof a.nodeName==="string"}function d(c){if(b(c))return c;else if(c instanceof a)return c[0];else if(typeof c==="function")return d(c());else if(typeof c==="string"){var f=document.createElement("div");f.innerHTML=c;return f.firstChild}else if(c&&typeof c.jquery==="string")return c[0];return null}return{is:b,create:d}})})(j.$Nav); (function(e){e.build("util.parseQueryString",function(){return function(a){a=a||{};if(j.location.search)for(var b=j.location.search.substring(1).split("&"),d=0;d<b.length;d++){var c=b[d].split("=");c.length>1&&(a[c[0]]=c[1])}return a}})})(j.$Nav);(function(e){e.build("util.preload",function(){return function(a,b){var d=new Image;if(b)d.onload=function(){b(d)};d.src=a;return d}})})(j.$Nav);(function(e){e.declare("util.randomString",function(a){for(var a=a||{},b="",d=a.charset||"1234567890abcdefghijklmnopqurstuvwxyz", a=a.length||10,c=0;c<a;c++)b+=d.substr(Math.floor(Math.random()*d.length),1);return b})})(j.$Nav);(function(e){e.when("$","Observer","debugStream").build("util.templates",function(a,b,d){var c={},f=[],i=function(b){var c=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+b.replace(/[\r\t\n]/g," ").replace(/'(?=[^#]*#>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<#=(.+?)#>/g,"',$1,'").split("<#").join("');").split("#>").join("p.push('")+ "');}return p.join('');");return function(b){try{return b.jQuery=a,c(b)}catch(d){return""}}};return{add:function(a,b){if(a&&b&&!c[a]){c[a]=i(b);d("Template Added",{name:a,template:c[a]});for(var l=0;l<f.length;l++)f[l].templateName===a&&f[l].render();a==="cart"&&e.declare("cartTemplateAvailable");return c[a]}},use:function(a,b){if(c[a])return c[a](b)},get:function(a){return c[a]},getAll:function(){return c},build:i,renderer:function(a){var a=a||{},h={data:a.data||{},templateName:a.templateName||null, disabled:!1},i=new b({context:h});h.onRender=i.boundObserve();h.render=function(){if(c[h.templateName]&&h.data&&!h.disabled){var a=c[h.templateName](h.data);a&&(d("Renderer Rendered",{html:a,renderer:h}),i.notify(a))}};if(a.onRender)h.onRender(a.onRender);d("Renderer Created",h);h.render();f.push(h);return h}}})})(j.$Nav);(function(e){e.when("$","$F").build("util.tabbing",function(a,b){var d={isEnabled:b.noOp,enable:b.noOp,disable:b.noOp,focus:b.noOp,destroy:b.noOp,bind:b.noOp,unbind:b.noOp,tailAction:b.noOp}, c=[];return function(b){if(!b||b.length<1)return d;b.attr("tabindex",1);var i=".navTabbing"+c.length,k=-1,h="natural",l=!1,g=function(c){var d=k;k=-1;d>-1&&(c||b.eq(d).blur());a(document).unbind(i)},p=function(a){var c=a.keyCode||a.which;if(!(k===-1||c!==9)){c=k;g();if(a.shiftKey&&c===0)if(h==="loop")b.eq(b.length-1).focus();else{if(h==="natural")return}else if(a.shiftKey)b.eq(c-1).focus();else if(c===b.length-1)if(h==="loop")b.eq(0).focus();else{if(h==="natural"){b.attr("tabindex",-1);setTimeout(function(){b.attr("tabindex", 1)},1);return}}else b.eq(c+1).focus();a.preventDefault();return!1}},m={isEnabled:function(){return l},bind:function(b){for(var d=0;d<c.length;d++)c[d].unbind();k=b;a(document).bind("keydown"+i,p)},unbind:g,focus:function(){if(l){for(var a=!1,c=0;c<b.length;c++)if(b.get(c)===document.activeElement){a=!0;break}a||b.eq(0).focus()}},enable:function(){if(!l)return a.each(b,function(b){a(this).bind("focus"+i+" focusin"+i,function(){b!==k&&m.bind(b)}).bind("blur"+i+" focusout"+i,function(){m.unbind(!0)})}), l=!0,m},disable:function(){if(l)return a.each(b,function(){a(this).unbind(i)}),m.unbind(),l=!1,m},destroy:function(){m.disable();b=null;m=d},tailAction:function(a){h=a==="block"?"block":a==="loop"?"loop":"natural";return m}};c.push(m);return m}})})(j.$Nav);(function(e){e.build("util.cleanUrl",function(){return function(a,b){b.https&&(a=a.replace(/^http:\/\//i,"https://"));b.ref&&(a.match(/ref=/g)?a=a.replace(/(ref=)[^\&\?]+/g,"ref="+b.ref):(a+=a.match(/\?/g)?"&":"?",a+="ref_="+b.ref));b.encode&&(a= encodeURIComponent(a));return a}})})(j.$Nav);(function(e){e.when("$").run("util.session.builder",function(){if(j.sessionStorage){try{j.sessionStorage.setItem("testKey",1),j.sessionStorage.removeItem("testKey")}catch(a){return}e.declare("util.session",{get:function(a){return j.JSON.parse(j.sessionStorage.getItem(a))},set:function(a,d){j.sessionStorage.setItem(a,j.JSON.stringify(d))},getString:function(a){return j.sessionStorage.getItem(a)},setString:function(a,d){j.sessionStorage.setItem(a,d)}})}})})(j.$Nav); (function(e){j.navbar={};e.build("api.publish",function(){j.navbar.use=function(a,b){e.when("api."+a).run(b)};return function(a,b){j.navbar[a]=b;e.publish("nav."+a,b);e.declare("api."+a,b)}});e.when("$","$F","config","agent","data","async","api.publish","util.node","util.Proximity","util.Aligner","util.ajax","phoneHome","flyouts","flyouts.anchor","subnav.builder","searchBar","provider.dynamicMenu","util.ClickOut","SignInRedirect","fixedBar","pinnedNav","constants","flyouts.cover","nav.inline").run("PublishAPIs", function(a,b,d,c,f,i,k,h,l,g,p,m,r,q,o,s,n,w,v,u,x,t,A){var B=a("#navbar"),y=a(j),C={getFlyout:r.get,lockFlyouts:function(a){a&&r.hideAll();r.lockAll()},unlockFlyouts:r.unlockAll,toggleFlyout:function(a,b,c){if(a=r.get(a))a.unlock(),b===!0?a.show():b===!1?a.hide():a.isVisible()?a.hide():a.show(),c&&a.lock()},exposeSBD:function(a){e.when("flyout.shopall").run(function(){C.toggleFlyout.apply(null,a?["shopAll",!0,!0]:["shopAll",!1])})},setCartCount:function(a){f({cartCount:a});n.reset();n.fetch({data:{cartItems:"cart"}}); d.ewc&&e.when("ewc.flyout").run(function(b){if(b)d.ewc.cartCount=parseInt(a,10),b.ableToPersist()&&b.persist({noAnimation:!0})})},overrideCartButtonClick:function(b){d.ewc||(a("#nav-cart").click(b),a("#nav-cart-menu-button").click(b))},getLightningDealsData:function(){return d.lightningDeals||{}},unHideSWM:function(){var b=a("#navHiddenSwm"),c=d.swmStyleData;if(b.length&&c){var g=a("#nav-swmslot");g.parent().attr("style",c.style||"");g.children().css("display","none");b.css("display","");m.exposure(b.attr("data-selection-id"))}}, navDimensions:function(){var b=B.offset();b.height=B.height();b.bottom=b.top+b.height;b.fixedBottom=B.hasClass("nav-fixed")?Math.max(y.scrollTop()+a("#nav-belt").height(),b.bottom):b.bottom;return b},fixedBar:function(a){u&&(a===!1?u.disable():u.enable())},pinnedNav:function(a){x&&(a===!1?x.disable():x.enable())},sidePanel:function(c){if(!d.primeDay){var c=a.extend({flyoutName:null,data:null,dataAjaxUrl:null},c),g=c.flyoutName;g==="yourAccount"&&d.fullWidthCoreFlyout&&(g="profile");var h=r.get(g), i=function(a){if(a){var b={};b[h.sidePanel.dataKey]=a;f(b)}};if(h&&h.sidePanel&&h.sidePanel.dataKey)if(c.data)return i(c.data),!0;else if(c.dataAjaxUrl&&h.link)return g=b.once().on(function(){p({url:c.dataAjaxUrl,dataType:"json",success:function(a){i(a)}})}),h.isVisible()?g():(l.onEnter(h.link,[20,100,60,100],g),h.onShow(g),h.link.focus(g)),!0;return!1}},createTooltip:function(b){var b=a.extend({arrow:"top",timeout:1E4,cover:!1,addCloseX:!1,disableCoverPinned:!0,clickCallback:null},b),c=C.createFlyout(b); if(c){var d=a.extend(c,{addCloseX:function(){d.elem().append('<div class="nav-tooltip-close nav-timeline-icon"></div>')},fadeIn:function(a,b){d.isVisible()||(d.show(),d.elem().css("opacity",0).fadeTo(a||400,1,b))},fadeOut:function(a,b){if(d.isVisible()){d.hide();var c=d.elem();c.show();c.css("opacity",1).fadeTo(a||400,0,function(){b&&b();c.hide().css("opacity",1)})}}});b.addCloseX&&d.addCloseX();b.cover&&A(d,b.disableCoverPinned);b.clickCallback&&d.elem().click(function(c){a(c.target).hasClass("nav-tooltip-close")? d.hide():b.clickCallback()});var g=null,f=b.timeout,h=w.newInstance(),i=function(){clearTimeout(g);d.fadeOut(400,function(){h.disable()})};d.elem().hover(function(){d.elem().stop().css("opacity",1);clearTimeout(g)},function(){f!=="none"&&(g=setTimeout(i,f))});h.ignore(d.elem()).action(i).enable();d.onShow(function(){if(f!=="none")g=setTimeout(i,f);else{var b=a(document);b.scroll(function(){b.scrollTop()>t.REMOVE_COVER_SCROLL_HEIGHT&&i()})}});e.when("navDismissTooltip").run(function(){d.hide();d.lock()}); return d}},createFlyout:function(c){c=a.extend(!0,{name:null,content:"<div></div>",arrow:null,className:"",align:{from:"bottom center",to:"top center",base:"#navbar",alignTo:null,offsetTo:"#navbar"},onAlign:b.noOp},c);if(c.name&&c.content){var d=r.create({name:c.name,buildNode:function(){var b=a("<div class='"+c.className+"'></div>");c.arrow==="top"&&b.append("<div class='nav-arrow'><div class='nav-arrow-inner'></div></div>");b.append(h.create(c.content));return b}}),f=null;d.onAlign(function(){if(!f){c.align.target= d.elem();c.align.base=a(c.align.base);c.align.alignTo=a(c.align.alignTo||q());c.align.offsetTo=a(c.align.offsetTo);var b=new g(c.align);f=function(){b.align();c.onAlign.apply(d,arguments)}}f()});e.declare("flyoutAPI."+c.name.replace(" ",""),d);return d}},update:function(b){if(v){var c=a('#navbar [data-nav-role="signin"]');a.each(c,function(b,c){v.setRedirectUrl(a(c),null,null)})}if(b instanceof Object){b.cart&&b.cart.data&&b.cart.type==="count"&&C.setCartCount(b.cart.data.count);b.catsubnav&&o(b.catsubnav); b.searchbar&&b.searchbar.type==="searchbar"&&f({searchbar:b.searchbar.data});if(b.swmSlot)b=b.swmSlot.swmContent,c=a("#nav-swmslot"),b.data&&b.type==="html"&&c.length===1&&c.html(b.data);return!0}return!1},showSubnav:function(){B.addClass("nav-subnav")},hideSubnav:function(){B.removeClass("nav-subnav")},hasSubnav:function(){return B.hasClass("nav-subnav")},getSearchBackState:function(){return d.searchBackState||{}},removePrimeExperience:function(){f({isPrime:!1})}},G;for(G in C)C.hasOwnProperty(G)&& k(G,C[G]);e.publish("navbarJSLoaded")});e.when("$","data").run("setupRefreshPrime",function(a,b){b.observe("isPrime",function(b){b||(a("#nav-logo").removeClass("nav-prime-1"),a(".nav-logo-tagline").text("Try Prime"),a(".nav-logo-tagline").attr("href","/gp/prime/ref=nav_logo_prime_join"),a("#nav-link-prime .nav-line-1").text("Try"))})})})(j.$Nav);(function(e){e.when("$","subnav.initFlyouts","nav.inline").run("subnav.init",function(a,b){var d=a("#nav-subnav");d.length>0&&b();var c=location.href.toLowerCase().split("?"); a("a[data-nav-link-highlight]",d).each(function(){var b=this.href.toLowerCase().split("?"),d=0;c.length===2&&b.length===2?c[0].indexOf(b[0])>-1&&c[1]===b[1]&&(d=1):c.length===1&&b.length===1&&c[0].indexOf(b[0])>-1&&(d=1);d&&(b=a(this),b.attr("data-nav-link-bold")&&b.css({"font-weight":"bold"}),b.attr("data-nav-link-color")&&b.css({color:b.attr("data-nav-link-color")}),b.attr("data-nav-link-bottom-style")&&b.css({"border-bottom":b.attr("data-nav-link-bottom-style")}))})});e.when("$","subnav.initFlyouts", "constants","nav.inline").build("subnav.builder",function(a,b,d){var c=a("#navbar");return function(f){var i=a("#nav-subnav");i.length===0&&(i=a("<div id='nav-subnav'></div>").appendTo("#navbar"));var k=location.href.toLowerCase().split("?");i.html("");c.removeClass("nav-subnav");if(f.categoryKey&&f.digest){i.attr("data-category",f.categoryKey).attr("data-digest",f.digest).attr("class",f.category.data.categoryStyle);f.style?i.attr("style",f.style):i.attr("style")&&i.removeAttr("style");var h=function(b){if(b&& b.href){var c="nav-a",f=b.text,h=b.dataKey;if(!f&&!b.image)if(h&&h.indexOf(d.ADVANCED_PREFIX)===0)f="",c+=" nav-aText";else return;var f=b.image?"<img src='"+b.image+"'class='nav-categ-image' ></a>":f,l=a("<a href='"+b.href+"' class='"+c+"'></a>"),c=a("<span class='nav-a-content'>"+f+"</span>");if(b.type==="image")c.html(""),l.addClass("nav-hasImage"),b.rightText="";b.bold&&!b.image&&l.addClass("nav-b");b.floatRight&&l.addClass("nav-right");b.flyoutFullWidth&&b.flyoutFullWidth!=="0"&&l.attr("data-nav-flyout-full-width", "1");b.src&&(f=["nav-image"],b["absolute-right"]&&f.push("nav-image-abs-right"),b["absolute-right"]&&f.push("nav-image-abs-right"),a("<img src='"+b.src+"' class='"+f.join(" ")+"' alt='"+(b.alt||"")+"' />").appendTo(c));b.rightText&&c.append(b.rightText);c.appendTo(l);h&&(a("<span class='nav-arrow'></span>").appendTo(l),l.attr("data-nav-key",h).addClass("nav-hasArrow"));h=function(a){a.highlightLinkBold&&l.css({"font-weight":"bold"});a.highlightLinkColor&&l.css({color:a.highlightLinkColor});a.highlightLinkBottomStyle&& l.css({"border-bottom":a.highlightLinkBottomStyle})};b.highlightLink&&(l.attr("data-nav-link-highlight",b.highlightLink),c=b.href.toLowerCase().split("?"),f=0,k.length===2&&c.length===2?k[0].indexOf(c[0])>-1&&k[1]===c[1]&&(f=1):k.length===1&&c.length===1&&k[0].indexOf(c[0])>-1&&(f=1),f&&h(b));l.appendTo(i);i.append(document.createTextNode(" "))}};if(f.category&&f.category.data)f.category.data.bold=!0,h(f.category.data);if(f.subnav&&f.subnav.type==="linkSequence")for(var l=0;l<f.subnav.data.length;l++)h(f.subnav.data[l]); c.addClass("nav-subnav");b()}}});e.when("$","$F","panels","debugStream","util.Proximity","provider.subnavFlyouts","util.mouseOut","flyouts.create","cover","flyouts.accessibility","provider.advancedSubnavFlyouts","advKeyDecoder","constants","util.Aligner","flyouts.anchor","flyouts").build("subnav.initFlyouts",function(a,b,d,c,f,i,k,h,l,g,p,m,j,q,o,s){var n=null,w=k(),v=!1,u=null,x=j.ADVANCED_PREFIX,t=a("#navbar"),A=function(){i.fetch();p.fetchLazy()},B={},y=function(c){var d=c.attr("data-nav-key"), f=c.attr("data-event"),i=c.attr("data-nav-flyout-full-width"),k=c.attr("data-nav-asinsubnav-flyout");if(d){k=i&&k?"nav-fullWidthSubnavFlyout nav-asinsubnav-flyout":i?"nav-fullWidthSubnavFlyout":"nav-subnavFlyout";s.destroy(d);var p=m(d),j=h({key:d,panelDataKey:p?x+p.jsonkey+"Content":d,link:c,event:{t:"subnav",id:f},fullWidth:!!i,className:k,arrow:"top",suspendTabbing:!0,aligner:i?z:function(b){var c=b.$link.find(".nav-arrow, .nav-icon"),d=new q({base:c,target:b.$flyout,from:"bottom center",to:"top center", anchor:"top",alignTo:o(),constrainTo:t,constrainBuffer:[3,0,0,3],constrainChecks:[!0,!1,!1,!0],offsetTo:t}),g=new q({base:c,target:a(".nav-arrow",b.$flyout),offsetTo:t,alignTo:b.$flyout,anchor:"top center",from:"center",to:"center"});return function(){d.align();g.align();b.$flyout.addClass("nav-subnavFlyout-nudged")}}});if(p){d=p.jsonkey;c.setSubnavText=function(a){var b=c.find(".nav-arrow");c.html(a).removeClass("nav-hasAtext").append(b)};var n=x+d;B[n]={flyout:j,link:c};e.declare(x+d+".flyout", function(){return B[n].flyout});e.declare(x+d+".toplink",function(){return B[n].link})}var r=g({link:c,onEscape:function(){j.hide();c.focus()}});j.groups.add("subnavFlyoutGroup");w.add(c);w.add(j.elem());j.getPanel().onData(function(a){a.flyoutWidth&&j.elem().css({width:a.flyoutWidth})});j.getPanel().onRender(b.once().on(function(){r.elems(a(".nav-hasPanel, a",j.elem()))}));j.onHide(function(){r.disable()});j.hide.check(function(){if(v&&u===this)return!1});j.onShow(function(){var a=u;u=this;a&&a!== this&&a.hide();l.hide()});j.onShow(A)}};return function(){p.refresh();p.fetchOnload();var b=a("#nav-subnav");n&&n.unbind();n=f.onEnter(b,[20,40,40,40],A);a("a[data-nav-key]",b).each(function(){y(a(this))});w.onEnter(function(){v=!0});w.onLeave(function(){v=!1;u&&u.hide();u=null});w.enable()}})})(j.$Nav);(function(e){e.when("constants").build("advKeyDecoder",function(a){return function(b){if(!b||b.indexOf(a.ADVANCED_PREFIX)!==0)return!1;var b=b.split(":"),d=b.length;return d<4?!1:{jsonkey:b[d-2],endpoint:b.slice(1, -2).join(":"),onload:b[d-1]==="1"}}})})(j.$Nav);(function(e){e.when("Observer").build("searchBar.observers",function(a){return{scopeChanged:new a}});e.when("$","$F","agent","config","onOptionClick","async","searchMetrics","searchBar.observers","nav.inline").run("searchBar",function(a,b,d,c,f,i,k,h){c=b.noOp;if(d.ie6)return{active:c,inactive:c,clearBlur:c,focus:c,blur:c,keyListener:c,form:a(),input:{hasValue:c,val:c,el:a()},scope:{prevIndex:null,init:c,hasTextChanged:c,text:c,value:c,digest:c,selectedIndex:c, set:c,getOptions:function(){return a()},appendOption:c},facade:{init:c,resize:c,text:c,update:c}};var l,g,p,c=a(j);a("#nav-main");var m=a("#nav-search"),e=a(".nav-searchbar",m),q=a(".nav-search-scope",m),o=a(".nav-search-facade",m),s=a(".nav-search-label",o),n=a(".nav-search-dropdown",m),w=a(".nav-search-submit",m),v=a(".nav-search-submit .nav-input",m);a(".nav-search-field",m);var u=a("#twotabsearchtextbox"),m=a(".srch_sggst_flyout");(new k({scopeSelect:n,inputTextfield:u,submitButton:v,issContainer:m})).init(); var x=null,k={hasValue:function(){var a=!!u.val();e[a?"addClass":"removeClass"]("nav-hasTerm");return a},val:function(a){if(a)u.val(a);else return u.val()},el:u};g={prevIndex:null,init:b.once().on(function(){g.prevIndex=n[0].selectedIndex}),hasTextChanged:function(){return g.prevIndex!==n[0].selectedIndex},text:function(){g.prevIndex=n[0].selectedIndex;var b=a("option:selected",n);return b.length===0?null:b.html()},value:function(){var b=a("option:selected",n);return b.length===0?null:b.val()},digest:function(a){return a? (n.attr("data-nav-digest",a),a):n.attr("data-nav-digest")},selectedIndex:function(b){return b>0||b===0?(n.attr("data-nav-selected",b),a("option",n).eq(b).attr("selected","selected"),b):n.attr("data-nav-selected")},set:function(b,c,d){g.prevIndex=null;if(!c||c!==g.digest()){n.blur().empty();for(var f=0;f<b.length;f++){var h=b[f],i=h._display||"";delete h._display;a("<option />").html(i).attr(h).appendTo(n)}g.digest(c||" ");g.selectedIndex(d||0)}else d!==g.selectedIndex()&&g.selectedIndex(d||0)},getOptions:function(){return a("option", n)},appendOption:function(a){a.appendTo(n);l.update()}};l={init:b.once().on(function(){o.attr("data-value")!==g.value()&&l.update();g.init()}),resize:function(){if(q.is(":visible")){var a=q.outerHeight(),b=n.outerHeight();n.css({top:(a-b)/2});s.css({width:"auto"});u.width()<200&&o.width()>150&&s.css({width:"125px"});a=q.width();(d.iOS||n.width()<a)&&n.width(a)}},text:function(a){if(!a)return s.text();s.html(a);h.scopeChanged.notify(a);l.resize()},update:function(){g.hasTextChanged()&&l.text(g.text())}}; p={active:function(){e.addClass("nav-active")},inactive:function(){e.removeClass("nav-active")},clearBlur:function(){x&&(clearTimeout(x),x=null)},focus:function(){p.active();p.clearBlur()},blur:function(){x&&(clearTimeout(x),x=null);x=setTimeout(function(){p.inactive();p.clearBlur()},300)},keyListener:function(a){a.which===13&&u.focus();a.which!==9&&a.which!==16&&l.update()},form:e,input:k,scope:g,facade:l};f(n,function(){p.clearBlur();l.update();u.focus()});n.change(l.update).keyup(p.keyListener).focus(p.clearBlur).blur(p.blur); n.focus(function(){q.addClass("nav-focus")}).blur(function(){q.removeClass("nav-focus")});o.click(function(){u.focus();return!1});u.focus(p.focus).blur(p.blur);v.focus(p.clearBlur).blur(p.blur);v.focus(function(){w.addClass("nav-focus")}).blur(function(){w.removeClass("nav-focus")});c.resize(b.throttle(300).on(l.resize));u[0]===document.activeElement&&p.focus();i(l.init);return p});e.when("data","searchBar").run("searchBarUpdater",function(a,b){a.observe("searchbar",function(a){var c=a["nav-metadata"]|| {};a.options&&(b.scope.set(a.options,c.digest,c.selected),b.facade.update(),b.facade.resize())})});e.when("searchBar","search-js-autocomplete").run("SddIss",function(a,b){b.keydown(function(b){setTimeout(function(){a.keyListener(b)},10)});e.declare("SddIssComplete")});e.when("$","agent").build("onOptionClick",function(a,b){return function(d,c){var f=a(d);if(b.mac&&b.webkit||b.touch&&!b.ie10)f.change(function(){c.apply(f)});else{var i={click:0,change:0},k=function(a,b){return function(){i[a]=(new Date).getTime(); i[a]-i[b]<=100&&c.apply(f)}};f.click(k("click","change")).change(k("change","click"))}}});e.when("$","searchBar","iss.flyout","searchBar.observers").build("searchApi",function(a,b,d,c){var f={};f.val=b.input.val;f.on=function(a,f){if(a&&f&&typeof f==="function")switch(a){case "scopeChanged":c.scopeChanged.observe(f);break;case "issShown":d.onShow(f);break;case "issHidden":d.onHide(f);break;default:b.input.el.bind(a,f)}};f.scope=function(a){if(a)b.facade.text(a);else return b.facade.text()};f.options= function(c,d){c&&(c=a(c),d&&c.attr("selected","selected"),b.scope.appendOption(c));return b.scope.getOptions()};f.action=function(a){if(a)b.form.attr("action",a);else return b.form.attr("action")};f.submit=function(a){a&&typeof a!=="function"?b.form.submit(a):b.form.submit()};f.flyout=d;return f})})(j.$Nav);(function(e){e.when("$","flyoutAPI.SearchSuggest","config","cover","nav.inline").run("issHackery",function(a,b,d,c){var f=a("#nav-iss-attach"),i=a("#nav-search .nav-searchbar"),k=!!d.beaconbeltCover; b.onAlign(function(){a("div:first-child",this.elem()).css({width:f.width()})});b.onShow(function(){k&&c.show();i.addClass("nav-issOpen")});b.onHide(function(){k&&c.hide();i.removeClass("nav-issOpen")})})})(j.$Nav);(function(e){e.when("$","$F","panels","config","debugStream","nav.inline").build("cover",function(a,b,d,c,f){var i=a(document),k=a(j),h=a("#navbar"),l=function(){},g=d.create({name:"cover",visible:!1,rendered:!0,elem:function(){return a("<div id='nav-cover'></div>").click(function(){return l.apply(this, arguments)}).appendTo(h)}});g.LAYERS={ALL:6,BELT:5,MAIN:2,SUB:1,NONE:"auto"};g.setLayer=function(a){if(!a||!(a in g.LAYERS))a="NONE";g.elem().css({zIndex:g.LAYERS[a]})};g.setClick=function(a){if(!a||typeof a!=="function")a=b.noOp;l=a};var e=function(){g.elem().css({height:Math.max(i.height(),k.height())-h.offset().top})};g.onShow(function(a){a=a||{};f("Cover: Show");g.setLayer(a.layer);g.setClick(a.click);e();a=100;if(c.fullWidthCoreFlyout||c.flyoutAnimation)a=550;g.elem().fadeIn(a,function(){var a= g.elem().get(0);a.style.removeAttribute&&a.style.removeAttribute("filter")});k.resize(e)});g.onHide(function(){f("Cover: Hide");g.elem().stop().fadeOut(100,function(){g.elem().css("opacity","0.6")});k.unbind("resize",e)});return g})})(j.$Nav);(function(e){e.when("$","$F","data","config","flyout.yourAccount","provider.ajax","util.Proximity","logEvent","sidepanel.yaNotis").iff({name:"sidepanel.yaNotis",op:"falsey"}).run("sidepanel.csYourAccount",function(a,b,d,c,f,i,k,h){if(!c.primeDay){var l=!0,g= !1,e,m,j=function(){g||(l=!1,e&&(e(m),g=!0))},b=function(){return{register:function(a,b){g||(e=a,m=b,l||j())}}}(),q={count:0,decrement:function(){q.count=Math.max(q.count-1,0)}},o=function(){var b=a("#csr-hcb-wrapper"),g=a(".csr-hcb-content",b);b.remove();if(g.length!==1)return j(),!1;h({t:"hcb"});if(c.fullWidthCoreFlyout&&(b=a(".csr-hcb-blurb",g),b.length)){var f=a(".csr-hcb-learn-more",b);if(f.length){f.remove();var i=b[0].innerHTML;if(i.length>160)b[0].innerHTML=i.substring(0,160).concat("..."); b[0].innerHTML+=f[0].outerHTML}}d({"yourAccount-sidePanel":{html:g[0].outerHTML}});return!0};if(!c.csYourAccount||!c.csYourAccount.url)return l=o(),b;var s=i({url:c.csYourAccount.url,data:{rid:c.requestId},success:function(b){if(b)if((((b.template||{}).data||{}).items||[]).length<1)o();else{var g=b.template.name;if(g){b={"yourAccount-sidePanel":b};g==="notificationsList"?h({t:"csnoti"}):(g==="discoveryPanelList"||g==="discoveryPanelSummary")&&h({t:"discoverypanel"});if(g==="notificationsList")f.sidePanel.onRender(function(){var b= this.elem(),d=a(".nav-item",b).not(".nav-title");q.count=d.length;var g=function(){var c=b.height();a(".nav-item",b).each(function(){var b=a(this);c-=b.outerHeight(!0);b[c>=0?"show":"hide"]()})},h=function(b){a.ajax({url:c.csYourAccount.url,type:"POST",data:{dismiss:b.attr("data-noti-id"),rid:c.requestId},cache:!1,timeout:500});var d=b.parent();d.slideUp(300,function(){d.remove();g()});q.decrement();q.count===0&&(f.sidePanel.hide(),o()||(b=a("#nav-flyout-profile").find(".nav-column"),b=b.eq(3),b.removeClass("nav-column-break")))}; b.bind("click",function(b){var c=a(b.target);if(c.is(".nav-noti-list-x"))return h(c),b.preventDefault(),!1})});d(b)}else o()}else o()},error:o}),i=function(){s.fetch()};f.onShow(i);f.link.focus(i);k.onEnter(f.link,[20,40,40,40],i);return b}})})(j.$Nav);(function(e){e.when("$","$F","agent","flyouts","flyout.shopall","nav.inline").build("fixedBar",function(a,b,d,c){var f=!1,i=!1,k,h,l,g,e,m,r,q,o=b.once().on(function(){k=a(j);h=a("#navbar");l=a("#nav-main");e=a("#nav-search");m=a("#nav-xshop-container"); r=a("#nav-main .nav-left");q=a("#nav-main .nav-right");g=a("<div></div>").css({position:"relative",display:"none",width:"100%",height:l.height()+"px"}).insertBefore(l)}),s=function(){h.removeClass("nav-fixed");e.removeClass("nav-fixed");e.css({left:0,right:0});m.removeClass("nav-fixed");a("#nav-belt > .nav-left").css({width:a("#nav-logo").outerWidth()});g.hide();i=!1},n=function(){var a=k.scrollTop();c.hideAll();i&&g.offset().top>=a?s():!i&&l.offset().top<a&&(h.addClass("nav-fixed"),e.addClass("nav-fixed"), e.css({left:r.width(),right:q.width()}),m.addClass("nav-fixed"),g.show(),i=!0)};return{enable:function(){!f&&!d.ie6&&!d.quirks&&(o(),k.bind("scroll.navFixed",n),n(),f=!0)},disable:function(){f&&(k.unbind("scroll.navFixed"),s(),f=!1)}}})})(j.$Nav);(function(e){e.when("$","$F","constants","metrics","config","agent","page.domReady").build("carousel",function(a,b,d,c,f,i){function k(a){for(var a=a.children(),b=a.length,c=0,g=0;g<b;g++)c+=a.eq(g).width();return c+d.CAROUSEL_WIDTH_BUFFER}function h(){o.css({width:t, "float":"left"})}function l(c){s.hover(function(){n.fadeIn()},function(){n.fadeOut()});y.resize(b.throttle(300).on(function(){A=a("#navbar").width();o.css("left","0");v.removeClass("nav-feed-control-disabled");w.addClass("nav-feed-control-disabled");h()}));w.click(function(a){a.preventDefault();r(c);return!1});v.click(function(a){a.preventDefault();m(c);return!1});i.touch&&j.addEventListener("touchstart",q,!1)}function g(a){u.bind("mouseenter",function(){a.mouseOutUtility.changeTimeout(600)});s.bind("mouseenter", function(){a.mouseOutUtility.changeTimeout(0)})}function e(a,b){c.increment("nav-"+a.getName()+"-"+b+"-arrow-clicked");f.pageType&&c.increment("nav-"+a.getName()+"-"+b+"-arrow-clicked-"+f.pageType.toLowerCase())}function m(a){w.removeClass("nav-feed-control-disabled");var b=parseInt(o.css("left"),10);if(isNaN(b)||b===null)b=0;var c=A-t;b-=B;b<c&&(b=c);o.animate({left:b},300,function(){b===c&&v.addClass("nav-feed-control-disabled")});e(a,"right")}function r(a){v.removeClass("nav-feed-control-disabled"); var b=o.css("left"),b=parseInt(b,10)+B;b>0&&(b=0);o.animate({left:b},300,function(){b===0&&w.addClass("nav-feed-control-disabled")});e(a,"left")}function q(){s.addClass("nav-carousel-swipe");n.remove()}var o,s,n,w,v,u,x,t,A,B,y;return{create:function(b,c){var d=k(b);b.parent(".nav-carousel-container").length===0&&d>=a(j).width()&&a(".nav-timeline-item").length>0&&(o=b,o.wrap('<div class="nav-carousel-container"></div>'),o.after('<div class="nav-control-hidden"><a class="nav-feed-carousel-control nav-feed-left nav-feed-control-disabled " href="#"><span class="nav-timeline-icon nav-feed-arrow"></span></a></div><div class="nav-control-hidden nav-control-hidden-right"><a class="nav-feed-carousel-control nav-feed-right" href="#"><span class="nav-timeline-icon nav-feed-arrow"></span></a></div>'), s=o.parent(".nav-carousel-container"),n=s.find(".nav-feed-carousel-control"),w=s.find(".nav-feed-left"),v=s.find(".nav-feed-right"),u=s.find(".nav-control-hidden"),x=o.children(":first").width(),t=k(o),A=s.width(),B=A-x,y=a(j),h(),l(c),g(c))},readjust:function(a){o=a;t=k(o);t<=A&&(a=s.parent(),a.append(o),a.css("width","100%"),s.remove(),o.css("left",0))}}})})(j.$Nav);(function(e){e.when("$","metrics","page.domReady").run("navbackToTopCounter",function(a,b){a("#navBackToTop").click(function(){b.increment("nav-backToTop")})})})(j.$Nav); (function(e){e.when("configComplete").run("buildConfigObject",function(){if(!e.getNow("config")){var a={},b=e.stats(),d;for(d in b)if(b.hasOwnProperty(d)){var c=d.split("config.");if(c.length===2)a[c[1]]=b[d].value}e.declare("config",a)}});e.when("$","data","debug.param","page.domReady").build("dataProviders.primeTooltip",function(a,b,d){var c=!1,f={load:function(){if(!c){var d=a("#nav-prime-tooltip").html();return d?(b({primeTooltipContent:{html:d}}),c=!0):!1}}};d("navDisablePrimeTooltipData")|| f.load();return f});e.when("$","now","debugStream","data","util.ajax","debug.param","metrics").build("provider.ajax",function(a,b,d,c,f,i,k){var h=function(a){var c={},d=function(a){var a=a||{},b="";try{b=j.JSON.stringify(a)}catch(c){var b=a.url+"?",a=a.data||{},d;for(d in a)a.hasOwnProperty(d)&&typeof a[d]==="string"&&(b+=d+":"+a[d]+";")}return b};return{add:function(a){c[d(a)]=b()},ok:function(f){return(f=c[d(f)])?f<b()-a:!0},reset:function(){c={}}}};return function(b){var b=a.extend({throttle:24E4}, b),g=null,e=h(b.throttle);b.dataType="json";var m={fetch:function(h){h=a.extend(!0,{},h||{},b);if(g)setTimeout(function(){m.fetch(h)},250);else if(e.ok(h)){var j=h.success;h.success=function(a){if(i("navDisableAjax"))h.error&&typeof h.error==="function"&&h.error();else{g=null;e.add(h);if(a){if(h.dataKey){var b={};b[h.dataKey]=a;a=b}h.data&&(b=h.data.metricKey||"")&&k.increment(b+"-AjaxCallCount");c(a)}j&&j(a)}};d("Ajax Data Provider Fired",h);g=f(h)}},boundFetch:function(a){return function(){m.fetch(a)}}, reset:function(){g&&(g.abort(),g=null);e.reset()}};return m}});e.when("$","config","provider.ajax","constants").build("provider.subnavFlyouts",function(a,b,d,c){var b=d({url:b.subnavFlyoutUrl}),f=b.fetch;b.fetch=function(b){var d=a("#nav-subnav");if(d.length!==0){var h=d.attr("data-category");if(h){var l=[];a("a[data-nav-key]",d).each(function(){var b=a(this).attr("data-nav-key");b.indexOf(c.ADVANCED_PREFIX)!==0&&l.push(b)});l.length!==0&&(b=a.extend(!0,b||{},{data:{subnavCategory:h,keys:l.join(";")}}), f(b))}}};return b});e.when("$","$F","data","provider.ajax","constants","advKeyDecoder").build("provider.advancedSubnavFlyouts",function(a,b,d,c,f,i){var k=f.ADVANCED_PREFIX,h,l,g,p=function(){h=[];l=[];g=[];a("a[data-nav-key]",a("#nav-subnav")).each(function(){var b=a(this).attr("data-nav-key");if(b=i(b)){var f=b.endpoint,m={jsonkey:b.jsonkey};g[f]?g[f].push(m):(g[f]=[m],m=c({url:f,timeout:1E4,error:function(){for(var a=g[f],b=0;b<a.length;b++){var c={};c[k+a[b].jsonkey+"Content"]=d.get("genericError"); d(c)}},success:function(a){if(a&&typeof a==="object")for(var b in a)if(a.hasOwnProperty(b)){var c=k+b+".flyout",g=k+b+".toplink",f={};f[k+b+"Content"]=a[b];d(f);a&&a[b]&&a[b].js&&e.when("$",c,g).run("[rcx-nav] adv-panel-"+c,a[b].js)}}}),b.onload?l.push(m):h.push(m))}})},m={refresh:function(){p()},fetchOnload:function(){for(var a=0;a<l.length;a++)l[a].fetch()},fetchLazy:function(){for(var a=0;a<h.length;a++)h[a].fetch()},fetchAll:function(){m.fetchOnload();m.fetchLazy()}};return m});e.when("util.templates", "data").run("provider.templates",function(a,b){b.observe("templates",function(b){for(var c in b)b.hasOwnProperty(c)&&b[c]&&a.add(c,b[c])})});e.when("config","provider.ajax").build("provider.dynamicMenu",function(a,b){return b({url:a.dynamicMenuUrl,data:a.dynamicMenuArgs})})})(j.$Nav);(function(e){e.when("$","$F","config","dataPanel","flyout.yourAccount","provider.ajax","util.Proximity").iff({name:"config",prop:"carnac"}).run("carnac",function(a,b,d,c,f,i,k){if(d.carnac.url){var h=c({id:"nav-carnac-panel", dataKey:"yourAccountCarnacContent",className:"nav-flyout-content",spinner:!0,visible:!0});f.elem().append(h.elem());var l=f.getPanel();l.elem().remove();f.getPanel=function(){return h};var g=i({url:d.carnac.url,dataKey:"yourAccountCarnacContent",data:{rid:d.requestId}}),e=b.once().delay(5E3).on(function(){if(!h.isRendered())h.elem().remove(),f.elem().append(l.elem()),f.getPanel=function(){return l}}),a=function(){g.fetch();e()};f.onShow(a);f.link.focus(a);k.onEnter(f.link,[20,40,40,40],a)}})})(j.$Nav); (function(e){e.when("config.flyoutURL","debug.param","btf.full").run("provider.remote",function(a,b){if(a&&!b("navDisableJsonp")){var d=document.createElement("script");d.setAttribute("type","text/javascript");d.setAttribute("src",a);(document.head||document.getElementsByTagName("head")[0]).appendChild(d)}});e.when("$","$F","provider.dynamicMenu","util.Proximity","config","flyout.cart","flyout.prime","flyout.wishlist","flyout.yourAccount","flyout.timeline","flyout.fresh").run("bindProvidersToEvents", function(a,b,d,c,f,i,k,h,l,g,p){if(!f.primeDay){var m={prefetchGatewayHero:b.once().on(function(){f.prefetchGatewayHero&&typeof f.prefetchGatewayHero==="function"&&f.prefetchGatewayHero()}),setupCartFlyout:function(){if(i){var b=d.boundFetch({data:{cartItems:"cart",metricKey:"cartMetric"}});i.onShow(b);a("nav-cart nav-a").focus(b)}},_getWishlistFetch:function(){var a={wishlistItems:"wishlist",metricKey:"wishlistMetric"};f.alexaListEnabled&&(a={wishlistItems:"wishlist",alexaItems:"alexa",metricKey:"alexaMetric"}); return d.boundFetch({data:a})},setupTimeline:function(){var a=[100,100,100,100];f.timelineAsinPriceEnabled&&(a=[20,50,30,30]);var b=d.boundFetch({data:{timelineContent:"timeline",pageType:f.pageType,subPageType:f.subPageType,metricKey:"timelineMetric"}});m._bindProviderToEvents(g,g.link,b);c.onEnter(g.link,a,function(){b();m.prefetchGatewayHero()})},setupTimelineTooltip:function(){var a=d.boundFetch({data:{timelineTooltipContent:"timelinetooltip",metricKey:"timelineTooltipMetric"}});e.when("page.domReady").run("timelineTooltipAjaxData", function(){f.pageType==="Detail"&&a()})},setupWishlistFlyout:function(){var a=m._getWishlistFetch(),b=[20,20,40,100];h||(h=l,b=[100,100,100,100]);m._bindProviderToEvents(h,h.link,a);c.onEnter(h.link,b,function(){a();m.prefetchGatewayHero()})},setupPrimeFlyout:function(){var a;if(f.fullWidthPrime)if(f.dynamicFullWidthPrime)a=function(a){e.when("data").run("fullWidthPrimeAjaxData",function(b){(a||a.primeContent)&&b({dynamicFullWidthPrime:a.primeContent})})};else return;var b=d.boundFetch({data:{primeContent:"prime", metricKey:"primeMetric"},success:a});m._bindProviderToEvents(k,k.link,b);c.onEnter(k.link,[20,40,40,40],function(){b();m.prefetchGatewayHero()})},setupFreshFlyout:function(){if(p){var a=d.boundFetch({data:{freshContent:"fresh",metricKey:"freshMetric"}});m._bindProviderToEvents(p,p.link,a);c.onEnter(p.link,[20,40,40,40],function(){a();m.prefetchGatewayHero()})}},setupYourAccountNotification:function(){f.orderNotificationEnabled&&e.declare("yourAccountNotificationAjaxProvider",function(){var a=(new Date).getTime(); d.fetch({data:{tick:a,yourAccountNotificationContent:"yourAccountNotification",metricKey:"yourAccountNotificationMetric"}})})},_bindProviderToEvents:function(a,b,c){a.onShow(c);b.focus(c)},init:function(){m.setupCartFlyout();m.setupPrimeFlyout();m.setupFreshFlyout();m.setupWishlistFlyout();m.setupYourAccountNotification();f.timeline&&(m.setupTimeline(),m.setupTimelineTooltip())}};m.init()}})})(j.$Nav);(function(e){e.when("$","$F","panels","util.checkedObserver","flyouts.anchor","flyouts.fixers","metrics", "config","nav.inline").run("flyouts",function(a,b,d,c,f,i,k,h){var l={};a(j).bind("resize",function(){for(var a in l)l.hasOwnProperty(a)&&l[a].align()});return{create:function(b){var b=a.extend({elem:function(){var c=b.buildNode?b.buildNode():a("<div></div>");c.addClass("nav-flyout").appendTo(b.anchor||f());return c},groups:["flyouts"],transition:{show:function(){e.elem().show();e.flyoutFullyAnimated=!1;if(e.animateDown){a.extend(a.easing,{easeOutCubic:function(a,b,c,d,g){return d*((b=b/g-1)*b*b+ 1)+c},easeInCubic:function(a,b,c,d,g){return d*(b/=g)*b*b+c}});var b=e.elem().height();e.elem().stop(!0,!0).css({height:"10px"}).animate({height:b},250,"easeOutCubic",function(){a(this).css("height","auto");e.initiateSidePanel();e.flyoutFullyAnimated=!0});e.elem().find(".nav-flyout-content, #nav-flyout-wl-items, #nav-profile-bottom-bia-wrapper").hide().addClass("nav-add-filter").stop(!0,!0).fadeIn({duration:300,easing:"easeInCubic"},function(){a(this).removeClass("nav-add-filter")})}e.align();k.increment("nav-flyout-"+ e.getName()+"-show");h.pageType&&k.increment("nav-flyout-"+e.getName()+"-"+h.pageType.toLowerCase()+"-show")},hide:function(){e.elem().stop(!0,!0).hide()}}},b),e=d.create(b);e.align=c({context:e,check:function(){if(!e.isVisible())return!1}});e.onAlign=e.align.observe;e.show.observe(function(){b.transition.show.apply(e,arguments)});e.hide.observe(function(){b.transition.hide.apply(e,arguments)});e.lock.observe(function(){e.elem().addClass("nav-locked")});e.unlock.observe(function(){e.elem().removeClass("nav-locked")}); i(e);return l[b.name]=e},destroy:function(a){return l[a]?(l[a].destroy(),delete l[a],d.destroy(a),!0):!1},hideAll:function(){d.hideAll({group:"flyouts"})},lockAll:function(){d.lockAll({group:"flyouts",lockKey:"global-flyout-lock-key"})},unlockAll:function(){d.unlockAll({group:"flyouts",lockKey:"global-flyout-lock-key"})},get:function(a){return l[a]},getAll:function(){return l}}});e.when("$","$F").build("flyouts.anchor",function(a,b){return b.memoize().on(function(){return a("<div id='nav-flyout-anchor' />").appendTo("#nav-belt")})}); e.when("$","$F","cover","debugStream").build("flyouts.cover",function(a,b,d){var c=null,f=!1,i=function(){c&&(clearTimeout(c),c=null)},k=function(){i();f||(c=setTimeout(function(){f||(i(),d.hide(),f=!1);c=null},10))},h=function(){i();d.show({layer:"SUB",click:function(){k();f=!1}})};return function(b,c){b.onShow(function(){a("#navbar.nav-pinned").length>0&&c||h()});b.onHide(k)}});e.when("$","$F","agent").build("flyouts.fixers",function(a,b,d){return function(c){if(d.kindleFire){var f=a([]);c.onShow(function(){var b= this.elem(),c=a("img[usemap]").filter(function(){return a(this).parents(b).length===0});f=f.add(c);c.each(function(){this.disabledUseMap=a(this).attr("usemap");a(this).attr("usemap","")})});c.onHide(function(){f.each(function(){a(this).attr("usemap",this.disabledUseMap)});f=a([])})}if(d.touch)c.onShow(function(){var c=a("video");c.css("visibility","hidden");b.delay(10).run(function(){c.css("visibility","")})})}});e.when("$","$F","config","util.ClickOut","util.mouseOut","util.velocityTracker","util.MouseIntent", "debug.param","util.onKey").build("flyouts.linkTrigger",function(a,b,d,c,f,i,k,h,l){var g=h("navFlyoutClick");return function(d,h,e,j,o,s,n){var s=g||s,w=new c,v=i(),u=n?f(n):f(),x=null,t=!1,A=function(){x&&(x.cancel(),x=null,t=!1)};a(h).bind("mouseleave",function(){A();d.isVisible()&&(x=(new k(d.elem(),{slop:0})).onArrive(function(){A()}).onStray(function(){t&&d.hide();A()}))});e?u.add(e):u.add(h);u.action(function(){x?t=!0:d.hide()});w.action(function(){d.hide()});d.onShow(b.once().on(function(){var a= d.elem();w.ignore(a);w.ignore(h);u.add(a);s||u.enable()}));d.onShow(function(){h.addClass("nav-active");w.enable();v.disable()});d.onHide(function(){h.removeClass("nav-active");w.disable();A()});d.onLock(function(){d.isVisible()||a(".nav-icon, .nav-arrow",h).css({visibility:"hidden"})});d.onUnlock(function(){a(".nav-icon, .nav-arrow",h).css({visibility:"visible"})});var B=!1,y=b.debounce(500,!0).on(function(){if(!d.isVisible()&&!d.isLocked())d.show();else if(!o&&!d.isLocked())d.hide();else{B=!1;return}B= !0}),C=function(a){y();if(B||!o)return a.stopPropagation(),a.preventDefault(),!1};h.bind("touchstart",C);l(h,function(){if(this.isEnter())return C(this.evt)},"keydown");h.hover(function(){s||v.enable();j&&j()},function(){v.disable()});var G=b.debounce(500,!0).on(function(){d.show()});v.addThreshold({below:40},function(){d.isVisible()||setTimeout(function(){G()},1);v.disable()});a(".nav-icon",h).show().css({visibility:"visible"});return u}});e.when("noOp","util.MouseIntent","debug.param","config").build("flyouts.sloppyTrigger", function(a,b,d,c){var f=d("navFlyoutClick");return function(d){if(f)return{disable:a,register:a};var k=null,h=null,l=null,g=function(){l||(l=(new b(d)).onArrive(function(){l=k=null}).onStray(function(){k&&(k.show(),k=null);l=null}));return l};return{disable:function(){g().cancel();h=k=l=null},register:function(a,b){b.onShow(function(){h=b});a.mouseover(function(){h?h.getName()!==b.getName()&&(k=b,g()):(b.show(),c.isSidePanelRegistered=!0)})}}}});e.when("$","$F","noOp","Observer","util.tabbing","util.onKey").build("flyouts.accessibility", function(a,b,d,c,f,i){var k=b.memoize().on(function(){var b=new c;i(a(document),function(){this.isEscape()&&b.notify()},"keydown");return b.boundObserve()});return function(b){var b=a.extend({link:null,onEscape:d},b),c={},g=!1,e=!1,m=null,j=!1,q=a([]);k()(function(){g&&e&&(b.onEscape(),c.disable())});i(b.link,function(){(this.isEnter()||this.isSpace())&&c.enable()},"keyup");var o=null,s=function(){m&&(clearTimeout(m),m=null);e=!0},n=function(){m&&(clearTimeout(m),m=null);m=setTimeout(function(){e= !1},10)},w=function(){!j&&g&&(o=f(q),o.tailAction("loop"),o.enable(),q.focus(s),q.blur(n),o.focus(),j=!0)};c.elems=function(a){j=!1;q.unbind("focus blur");o&&(o.destroy(),o=null);q=a;w()};c.disable=function(){g=!1;o&&o.disable()};c.enable=function(){g=!0;w();o&&!o.isEnabled()&&(o.enable(),o.focus())};return c}});e.when("$","$F","agent","dataPanel","config").build("flyouts.sidePanel",function(a,b,d,c,f){return function(i){var k=i.getName(),h=f.fullWidthCoreFlyout;k==="profile"&&h&&(k="yourAccount"); var l=c({dataKey:k+"-sidePanel",className:"nav-flyout-sidePanel-content",spinner:!1,visible:!1}),g=b.memoize().on(function(){return a("<div class='nav-flyout-sidePanel' />").append(l.elem()).appendTo(i.elem())}),e=function(){if(l.isVisible()&&i.isVisible()){var b=function(){var b=l.elem().height();a(".nav-item",l.elem()).each(function(){var c=a(this);b-=c.outerHeight(!0);c[b>=0?"show":"hide"]()})};f.flyoutAnimation?i.setSidePanelCallback(b):b()}};i.onShow(e);i.onRender(e);l.onShow(function(){h?e(): g().css({width:"0px",display:"block"}).animate({width:"240px"},300,"swing",e)});l.onHide(function(){h?i.elem().find(".nav-flyout-sidePanel").css({width:"0px",display:"none"}).hide():g().animate({width:"0px"},300,function(){a(this).hide()})});l.onRender(l.show);l.onReset(l.hide);if(d.quirks)i.onShow(function(){h?i.elem().find(".nav-column-first > .nav-flyout-sidePanel").css("z-index","1"):g().css({height:i.elem().outerHeight()})});i.sidePanel=l}});e.when("$","$F","config","logEvent","panels","phoneHome", "dataPanel","flyouts.renderPromo","flyouts.sloppyTrigger","flyouts.accessibility","util.mouseOut","util.onKey","debug.param").build("flyouts.buildSubPanels",function(a,b,d,c,f,i,k,h,l,g,e,m,j){var q=j("navFlyoutClick");return function(o,j){var n=[];a(".nav-item",o.elem()).each(function(){var b=a(this);n.push({link:b,panelKey:b.attr("data-nav-panelkey")})});if(n.length!==0){var r=!1,v=a("<div class='nav-subcats'></div>").appendTo(o.elem()),u=o.getName()+"SubCats",x=null,t=l(v),A=function(){x&&(clearTimeout(x), x=null);if(!r){var b=function(){var b=a("#nav-flyout-shopAll").height();v.animate({width:"show"},{duration:200,complete:function(){v.css({overflow:"visible",height:b})}})};d.flyoutAnimation&&d.isSidePanelRegistered&&!o.flyoutFullyAnimated?o.setSidePanelCallback(b):b();r=!0}},B=function(){v.stop().css({overflow:"hidden",display:"none",width:"auto",height:"auto"});f.hideAll({group:u});r=!1;x&&(clearTimeout(x),x=null)},y=function(){r&&(x&&(clearTimeout(x),x=null),x=setTimeout(B,10))};o.onHide(function(){t.disable(); B();this.elem().hide()});for(var C=function(f,l){var n=k({className:"nav-subcat",dataKey:l,groups:[u],spinner:!1,visible:!1});if(!q){var x=e();x.add(o.elem());x.action(function(){n.hide()});x.enable()}var r=g({link:f,onEscape:function(){n.hide();f.focus()}}),B=function(g,f){var h=b.once().on(function(){var b=a.extend({},j,{id:g});if(d.browsePromos&&d.browsePromos[g])b.bp=1;c(b);i.trigger(f)});if(n.isVisible()&&n.hasInteracted())h();else n.onInteract(h)};n.onData(function(a){h(a.promoID,n.elem()); B(a.promoID,a.wlTriggers)});n.onShow(function(){var b=a(".nav-column",n.elem()).length;n.elem().addClass("nav-colcount-"+b);A();var b=a(".nav-subcat-links > a",n.elem()),c=b.length;if(c>0){for(var d=b.eq(0).offset().left,g=1;g<c;g++)d===b.eq(g).offset().left&&b.eq(g).addClass("nav_linestart");a("span.nav-title.nav-item",n.elem()).length===0&&(b=a.trim(f.html()),b=b.replace(/ref=sa_menu_top/g,"ref=sa_menu"),b=a("<span class='nav-title nav-item'>"+b+"</span>"),n.elem().prepend(b))}f.addClass("nav-active")}); n.onHide(function(){f.removeClass("nav-active");y();r.disable()});n.onShow(function(){r.elems(a("a, area",n.elem()))});x=function(){t.register(f,n)};d.flyoutAnimation?o.setSidePanelCallback(x):x();q&&f.click(function(){n.isVisible()?n.hide():n.show()});var w=m(f,function(){(this.isEnter()||this.isSpace())&&n.show()},"keydown",!1);f.focus(function(){w.bind()}).blur(function(){w.unbind()});n.elem().appendTo(v)},G=function(){y();t.disable()},E=0;E<n.length;E++){var F=n[E];F.panelKey?C(F.link,F.panelKey): F.link.mouseover(G)}}}});e.when("$","$F","data","dataPanel","logEvent","phoneHome","flyouts","flyouts.cover","flyouts.linkTrigger","flyouts.aligner","flyouts.buildSubPanels","flyouts.accessibility","flyouts.sidePanel","debugStream","panels","flyoutMetrics","btf.exists").build("flyouts.create",function(a,b,d,c,f,i,k,h,l,g,e,m,j,q,o,s){return function(n){n=a.extend({key:null,panelDataKey:null,event:{},elem:null,link:null,altMouseoutElem:null,mouseEnterCallback:null,arrow:null,fullWidth:!1,animateDown:!1, cover:!1,aligner:null,sidePanel:!1,linkCounter:!1,clickThrough:!0,clickTrigger:!1,spinner:!0,className:"nav-coreFlyout",suspendTabbing:!1,disableCoverPinned:!1,timeoutDelay:5E3,mouseoutTimeOut:0},n);(!n.key||!n.link||n.link.length===0)&&q("Bad Flyout Config (key: "+n.key+")");if(typeof n.event==="string")n.event={t:n.event};var w=c({dataKey:n.panelDataKey||n.key+"Content",className:"nav-flyout-content",spinner:n.spinner,visible:!0,timeoutDataKey:n.key+"Timeout",timeoutDelay:n.timeoutDelay}),v=k.create({name:n.key, link:n.link,buildNode:function(){var b=n.elem||a("<div id='nav-flyout-"+n.key+"'></div>");b.addClass(n.className);n.arrow&&b.append("<div class='nav-arrow'><div class='nav-arrow-inner'></div></div>");b.append(w.elem());return b},anchor:n.anchor,transition:n.transition}),u=null;v.onAlign(function(){u||(u=(n.aligner||g)({$flyout:v.elem(),$link:n.link,arrow:n.arrow,fullWidth:n.fullWidth}));u()});if(n.link){var x=m({link:n.link,onEscape:function(){v.hide();n.link.focus()}});s.attachTo(v);v.onShow(b.once().on(function(){if(!n.suspendTabbing){var b= a(v.elem().find(".nav-flyout-content").children("span, a"));b.length>0?x.elems(b):x.elems(a(v.elem().find("a")))}}));v.onShow(function(){n.link.addClass("nav-active")});v.onHide(function(){n.link.removeClass("nav-active");x.disable()})}v.onShow(function(){w.startTimeout()});v.onInteract(b.once().on(function(){f(n.event)}));w.onData(function(a){if("wlTriggers"in a)if(v.hasInteracted()&&v.isVisible())i.trigger(a.wlTriggers);else v.onInteract(b.once().on(function(){i.trigger(a.wlTriggers)}))});w.onRender(function(){e(v, n.event)});v.getPanel=function(){return w};n.sidePanel&&j(v);if(n.link){n.cover&&h(v,n.disableCoverPinned);if(n.linkCounter){var t=b.memoize().on(function(){return a("<span class='nav-counter'></span>").insertBefore(a(".nav-icon",n.link))});d.observe(n.key+"-counter",function(a){a<=0?(t().hide(),n.link.removeClass("nav-hasCounter")):(t().show().text(a),n.link.addClass("nav-hasCounter"))})}var A=l(v,n.link,n.altMouseoutElem,n.mouseEnterCallback,n.clickThrough,n.clickTrigger,n.mouseoutTimeOut);v.mouseOutUtility= A;v.animateDown=n.animateDown}v.onDestroy(function(){o.destroy(w.getName())});return v}})})(j.$Nav);(function(e){e.when("$","agent","config","img.pixel").build("flyouts.renderPromo",function(a,b,d,c){return function(f,i){if(f&&d.browsePromos&&d.browsePromos[f]){var k=d.browsePromos[f],h="#nav_imgmap_"+f,l=parseInt(k.vertOffset,10)-14,g=parseInt(k.horizOffset,10),e=b.ie6&&/\.png$/i.test(k.image),m=e?c:k.image;if(m&&(l=a("<img>").attr({src:m,alt:k.altText,useMap:h,hidefocus:!0}).addClass("nav-promo").css({bottom:l, right:g,width:k.width,height:k.height}),i.prepend(a(h)),i.prepend(l),e))l.get(0).style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+k.image+"',sizingMethod='scale')";k.promoType==="wide"&&!i.hasClass("nav-tpl-itemListCNDeepBrowse")&&i.addClass("nav-colcount-2")}}});e.when("$","flyouts.anchor","util.Aligner").build("flyouts.aligner",function(a,b,d){var c=a("#navbar");return function(f){var f=a.extend({$flyout:null,$link:null,arrow:null,fullWidth:!1},f),i=new d({base:f.$link,target:f.$flyout, offsetTo:c,constrainTo:c,constrainBuffer:[3,3,0,3],constrainChecks:[!0,!0,!1,!0],alignTo:b(),anchor:"top left",from:"bottom left",to:"top left",fullWidth:f.fullWidth,fullWidthCss:{"border-radius":"0px","border-right":"0px","border-left":"0px","padding-left":"0px","padding-right":"0px","min-width":"1000px"}}),k=null;f.arrow==="top"&&(k=new d({base:a(".nav-arrow, .nav-icon",f.$link),target:a(".nav-arrow",f.$flyout),offsetTo:c,alignTo:f.$flyout,anchor:"top left",from:"center",to:"center"}));return function(){i.align(); k&&k.align()}}})})(j.$Nav);(function(e){e.when("$","data","config","nav.createTooltip","SignInRedirect").iff({name:"config",prop:"signInTooltip"}).run("tooltip.signin",function(a,b,d,c,f){b.observe("signinContent",function(b){if(b.html&&!d.primeDay){var k=a("#navbar"),h=a("#nav-link-yourAccount"),l=c({name:"signinTT",content:b.html,className:"nav-signin-tt",timeout:1E4,align:{base:h,from:"bottom center",to:"top center",constrainTo:k,constrainBuffer:[3,3,0,3],constrainChecks:[!0,!0,!1,!0]},arrow:"top"}); if(f)l.onRender(function(){var b=a('[data-nav-role="signin"]',l.elem());a.each(b,function(b,c){f.setRedirectUrl(a(c),null,null)})});l.fadeIn()}})})})(j.$Nav);(function(e){e.when("$","$F","config","flyouts.create","SignInRedirect","dataPanel","util.addCssRule").run("flyout.yourAccount",function(a,b,d,c,f){var i=function(){var b={t:"ya"};if(a("#nav-noti-wrapper .nav-noti-content").length===1)b.noti=1;var g=!1,h=!1;d.beaconbeltCover&&!d.primeDay&&(h=g=!0);var i=c({key:"yourAccount",link:a("#nav-link-yourAccount"), event:b,sidePanel:!0,linkCounter:!0,arrow:"top",cover:g,disableCoverPinned:h,animateDown:d.flyoutAnimation}),k=!1;i.getPanel().onData(function(b){b.signInHtml&&!k&&(i.elem().prepend(b.signInHtml),k=!0,f&&(b=a('[data-nav-role="signin"]',i.elem()),a.each(b,function(b,c){f.setRedirectUrl(a(c),null,null)})))});if(d.signOutText)i.getPanel().onRender(function(){var b=a("#nav-item-signout .nav-text",this.elem());b.length===1&&b.html(d.signOutText)});return i},k=function(){a("#nav-cart").bind("mouseenter", function(){h.flyout.hide()})},h={createFlyout:function(){var b={t:"ya"};if(a("#nav-noti-wrapper .nav-noti-content").length===1)b.noti=1;var g=!1,f=!1;d.beaconbeltCover&&(f=g=!0);return c({key:"profile",className:"nav-coreFlyout nav-fullWidthFlyout",link:a("#nav-link-yourAccount"),altMouseoutElem:a("#nav-tools"),mouseEnterCallback:k,event:b,sidePanel:!0,linkCounter:!0,arrow:"top",cover:g,fullWidth:1,disableCoverPinned:f,animateDown:d.flyoutAnimation})},createProfile:function(){h.flyout.getPanel().onRender(function(){h.buildProfileAvatarContainer()})}, setSignInOutHtml:function(){var b=!1;h.flyout.getPanel().onData(function(c){c.signInHtml&&!b&&(h.flyout.elem().find(".nav-column:nth-child(3)").append(c.signInHtml),b=!0,f&&(c=a('[data-nav-role="signin"]',h.flyout.elem()),a.each(c,function(b,c){f.setRedirectUrl(a(c),null,null)})))});if(d.signOutText)h.flyout.getPanel().onRender(function(){var b=a("#nav-item-signout .nav-text",this.elem());b.length===1&&b.html(d.signOutText)})},handleNotifications:function(){h.flyout.onShow(function(){var b=h.flyout.elem().find(".nav-column-first"); a(".nav-flyout-sidePanel").css({height:b.height()})})},buildProfileAvatarContainer:b.once().on(function(){h.flyout.elem().find(".nav-column:nth-child(4)").find(".nav-panel").find(".nav-item").wrapAll("<div class='nav-profile-greeting'></div>");a(".nav-avatar-image-link").append("<span class='nav-image'></span>")}),setUserNameHtml:function(){var b;b=d.customerName?", "+d.customerName:".";h.flyout.getPanel().onRender(function(){var c=a("#nav-item-customer-name .nav-text",this.elem());c.length===1&& c.html(b)})},init:function(){h.flyout=h.createFlyout();h.setSignInOutHtml();h.setUserNameHtml();h.createProfile();h.handleNotifications();return h}};return d.fullWidthCoreFlyout?h.init().flyout:i()});e.when("$","agent","$F","data","flyout.yourAccount","config.dismissNotificationUrl","config","page.domReady").run("sidepanel.yaNotis",function(a,b,d,c,f,i,k){if(!k.primeDay){var h=a("#nav-noti-wrapper"),l=a(".nav-noti-content",h),g=k.fullWidthCoreFlyout,e={count:parseInt(l.attr("data-noti-count")||"0", 10),render:function(){var a=e.count;a<1&&(a=0);a>9&&(a="9+");g?c({"profile-counter":a}):c({"yourAccount-counter":a})},decrement:function(){e.count=Math.max(e.count-1,0);e.render()}};h.remove();if(l.length!==1||e.count<1)return!1;f.sidePanel.onRender(function(){var c=this.elem(),h=a(".nav-noti-item",c).not("#nav-noti-empty"),l=function(){var b=function(){var b=a("#nav-noti-all",c),d=a(".nav-noti-title"),f=a("#nav-flyout-profile .nav-column-first"),i=g?f.height()-d.height()-b.outerHeight(!0):c.height()- b.outerHeight(!0),k=!1;h.each(function(){var b=a(this);k?b.hide():(i-=a(this).outerHeight(),i>0?b.show():(k=!0,b.hide()))})};k.flyoutAnimation?f.setSidePanelCallback(b):b()};if(g)f.sidePanel.onShow(function(){l()});h.each(function(){var c=a(this);b.touch?c.addClass("nav-noti-touch"):c.hover(function(){a(this).addClass("nav-noti-hover")},function(){a(this).removeClass("nav-noti-hover")});a(".nav-noti-x",c).click(function(b){a.ajax({url:i,type:"POST",data:{id:c.attr("data-noti-id")},cache:!1,timeout:500}); c.slideUp(300,function(){c.remove();l()});e.decrement();if(e.count===0){f.sidePanel.hide();var d=a("#nav-flyout-profile").find(".nav-column"),d=d.eq(3);d.removeClass("nav-column-break")}b.preventDefault();return!1}).hover(function(){a(this).addClass("nav-noti-x-hover")},function(){a(this).removeClass("nav-noti-x-hover")})});if(f.isVisible())l();else f.onShow(d.once().on(l))});c({"yourAccount-sidePanel":{html:l[0].outerHTML}});e.render();return!0}});e.when("$","data","logEvent","sidepanel.csYourAccount", "page.domReady").iff({name:"sidepanel.csYourAccount",op:"falsey"}).run("sidepanel.yaHighConf",function(a,b,d){var c=a("#csr-hcb-wrapper"),a=a(".csr-hcb-content",c);c.remove();if(a.length!==1)return!1;d({t:"hcb"});b({"yourAccount-sidePanel":{html:a[0].outerHTML}});return!0});e.when("$","$F","config","flyout.yourAccount").run(function(a,b,d,c){if(d.yourAccountPrimeURL){var f=b.once().on(function(){(new Image).src=d.yourAccountPrimeURL});c.onRender(function(){a("#nav_prefetch_yourorders").mousedown(function(){f()}); if(d.yourAccountPrimeHover){var b=null;a("#nav_prefetch_yourorders").hover(function(){b=j.setTimeout(function(){f()},75)},function(){b&&(j.clearTimeout(b),b=null)})}})}})})(j.$Nav);(function(e){e.when("$","flyout.yourAccount","config","util.session","yourAccountNotificationAjaxProvider").build("util.ordernotification",function(a,b,d,c,f){if(d.orderNotificationEnabled)return c=a.extend(c,{KEY:{STAT:"orderNotificationStatus",DATA:"order"},INIT:{toString:function(){return"init"},transition:function(a){a|| f();return a!==c.CHECKED.toString()}},TRYING_TO_CHECK:{toString:function(){return"userIsTryingToCheck"},transition:function(a){if(a===c.INIT.toString()){a=c.getData();if(!a||!a.count)return!1;f();return!0}return!1}},CHECKED:{toString:function(){return"userChecked"},transition:function(a){return a===c.TRYING_TO_CHECK.toString()?(a=c.getData(),!a||!a.count?!1:!0):!1}},getStatus:function(){return c.getString(this.KEY.STAT)},setStatus:function(a){var b=c.getStatus();return a.transition(b)?(c.setString(this.KEY.STAT, a),!0):!1},getData:function(){return c.get(this.KEY.DATA)},setData:function(a){c.set(this.KEY.DATA,a)}})});e.when("$","flyout.yourAccount","data","config","util.ordernotification").run("flyout.yourAccount.orderNotification",function(a,b,d,c,f){if(c.orderNotificationEnabled){var i={shouldBeInFlyout:function(a){a=a||f.getData();return!a||!a.count?!1:f.getStatus()===f.CHECKED.toString()?!1:!0},showOrangeDot:function(){var b=a("#nav-link-yourAccount #nav-avatar"),c=a("#nav-link-yourAccount .notification-mark"); b.length?c.addClass("notification-mark-with-avatar"):c.addClass("notification-mark-without-avatar");b=a("#nav_prefetch_yourorders");b.length&&b.find(".nav-item-notification-mark").show()},showNumber:function(b){var c=a("#nav_prefetch_yourorders");if(c.length){var d=c.find(".nav-item-notification-text");d.length&&(c.find(".nav-text").css("display","inline"),d.text(b.count+" "+b.notificationText),d.show());c.click(function(){f.setStatus(f.CHECKED);return!0})}},displayOrangeDotAndNumber:function(a){if((a= a||f.getData())&&a.count&&!(a.count<=0))this.showOrangeDot(),this.showNumber(a)},hide:function(){a("#nav-link-yourAccount .notification-mark").hide();a("#nav_prefetch_yourorders .nav-item-notification-mark").hide()}};b.onShow(function(){f.setStatus(f.TRYING_TO_CHECK)});b.onHide(function(){f.setStatus(f.CHECKED);i.hide()});d.observe("yourAccountNotificationContent",function(a){if((a=a.orderStatistics)&&a.count&&!(a.count<=0))f.setData(a),i.shouldBeInFlyout(a)&&(b.getPanel().onRender(function(){i.displayOrangeDotAndNumber(a)}), i.displayOrangeDotAndNumber(a))});f.setStatus(f.INIT);i.shouldBeInFlyout()&&(b.getPanel().onRender(function(){i.displayOrangeDotAndNumber()}),i.displayOrangeDotAndNumber())}})})(j.$Nav);(function(e){e.when("$","config").build("prime.presentation",function(a){var b={};return function(d,c,f){var d={id:d,pt:c,et:(new Date).getTime()},d=a.extend(d,f),i,f=d,c=[];for(i in f)f.hasOwnProperty(i)&&i!=="et"&&c.push(i+":"+f[i]);c.sort();i=c.join("|");b[i]||(b[i]=!0,j.ue&&j.ue.log&&j.ue.log(d,"prime-presentation-metrics"))}}); e.when("$","config").build("prime.metadata",function(a,b){return function(d){var c={};if(b.requestId)c.r=b.requestId;if(b.sessionId)c.s=b.sessionId;a(d).each(function(){var b=a(this).attr("data-metadata");typeof b==="string"&&j.hasOwnProperty("JSON")&&(b=j.JSON.parse(b));var d={};if(b&&b.hasOwnProperty("customerID"))d.cid=b.customerID;if(b&&b.hasOwnProperty("marketplaceID"))d.mid=b.marketplaceID;if(b&&b.hasOwnProperty("containerRequestID"))d.mgid=b.containerRequestID;c=a.extend(c,d);return!1});return c}}); e.when("$","$F","config","data","prime.presentation","prime.metadata","flyouts.create","flyouts.accessibility","util.checkedObserver").run("flyout.prime",function(a,b,d,c,f,i,k,h,l){var g=a("#nav-link-prime"),e=function(c){var k=h({link:g,onEscape:function(){c.hide();g.focus()}}),m=0,e=l({check:function(){return m===2},observe:function(){f(1,"PrimeNavigationMenu",i("div#prime-ms3-nav-metadata"))}});c.getPanel().onRender(b.once().on(function(){d.dynamicMenuArgs&&d.dynamicMenuArgs.primeMenuWidth&&c.elem().css({width:d.dynamicMenuArgs.primeMenuWidth+ "px"});k.elems(a(".nav-hasPanel, a",c.elem()));c.align();m++;e()}));c.onInteract(b.once().on(function(){m++;e()}));c.onShow(b.once().on(function(){k.elems(a(".nav-hasPanel, a",c.elem()))}))},m=function(){var a=!!d.beaconbeltCover;c.observe("primeMenu",function(a){c({primeContent:{html:a}})});a=k({key:"prime",link:g,clickThrough:!0,event:"prime",arrow:"top",suspendTabbing:!0,cover:a,animateDown:d.flyoutAnimation});e(a);return a},j=function(){a("#nav-cart").bind("mouseenter",function(){q.flyout.hide()})}, q={createFlyout:function(){var b=!1,f=!1;d.beaconbeltCover&&(f=b=!0);var h;if(d.dynamicFullWidthPrime){h="dynamicFullWidthPrime";var i=c.observe("primeContent",function(a){c({primeTimeout:a});c.remove(i)});c.observe("primeMenu",function(a){c({dynamicFullWidthPrime:{html:a}})})}b=k({key:"prime",panelDataKey:h,className:"nav-coreFlyout nav-fullWidthFlyout",link:g,altMouseoutElem:a("#nav-tools"),mouseEnterCallback:j,event:"prime",arrow:"top",cover:b,fullWidth:1,animateDown:d.flyoutAnimation,disableCoverPinned:f}); d.dynamicFullWidthPrime&&e(b);return b},init:function(){q.flyout=q.createFlyout();return q}};return d.fullWidthPrime?q.init().flyout:m()});e.when("$","$F","flyouts.create","util.Aligner","flyouts.anchor","dataProviders.primeTooltip").run("flyout.primeTooltip",function(a,b,d,c,f,i){if(a("#nav-logo .nav-prime-try").html()){var k=d({key:"primeTooltip",link:a("#nav-logo .nav-logo-tagline"),event:"prime-tt",arrow:"top",className:"",aligner:function(b){var d=new c({base:b.$link,target:b.$flyout,from:"middle right", to:"middle left",anchor:"top left",alignTo:f(),constrainTo:a("#navbar"),constrainBuffer:[3,0,0,3],constrainChecks:[!0,!1,!1,!0],offsetTo:a("#navbar")});return function(){d.align()}}});k.getPanel().onRender(b.once().on(function(){k.getPanel().elem().attr("id","nav-prime-tooltip")}));k.show.check(function(){if(!this.getPanel().isRendered())return i.load()&&setTimeout(function(){k.show()},10),!1});return k}})})(j.$Nav);(function(e){e.when("$","$F","flyouts.create","util.Aligner","config","cover").build("iss.flyout", function(a,b,d,c,f,i){var k=a("#nav-search"),h=a("#twotabsearchtextbox"),l=a(".nav-search-field",k),g=a(j),p=!!f.beaconbeltCover&&!f.primeDay,m=b.memoize().on(function(){return a("<div id='nav-flyout-iss-anchor' />").appendTo("#nav-belt")}),r=d({key:"searchAjax",className:"nav-issFlyout",event:"searchAjax",spinner:!1,anchor:m(),aligner:function(a){var b=new c({base:h,target:a.$flyout,from:"bottom left",to:"top left",anchor:"top left",alignTo:m()});return function(){b.align()}}}),q=function(){a(r.elem()).width(l.width())}; r.onShow(function(){g.bind("resize",q);q();p&&i.show()});r.onHide(function(){g.unbind("resize",q);p&&i.hide()});e.declare("search.flyout",r);return r})})(j.$Nav);(function(e){e.when("$","$F","config","nav.createTooltip","util.ajax","data","logUeError","now","util.Aligner","metrics","page.domReady").iff({name:"config",prop:"primeTooltip"}).run("tooltip.prime",function(a,b,d,c,f,i,k,h,l,g){var i={type:"load",isPrime:d.isPrimeMember,referrer:document.referrer,height:a(j).height(),width:a(j).width()}, d=d.primeTooltip.url,e=a("#navbar"),m=a("#nav-link-prime"),r=null,q=b.memoize().on(function(b){var c=a(".nav-arrow",b);return c.length>0?new l({base:m,target:c,offsetTo:e,alignTo:b,anchor:"top left",from:"center",to:"center"}):{align:function(){}}});f({url:d,data:i,error:function(){g.increment("nav-tooltip-Prime-errorCount")},success:function(b){b&&b.content&&(r=c({key:"primeFlyoutTT",event:"primeFlyoutTT",content:a("<div></div>").html(b.content),name:"primeFlyoutTT",className:"nav-prime-tt",timeout:1E4, align:{base:m,from:"bottom center",to:"top center",constrainTo:e,constrainBuffer:[3,3,0,3],constrainChecks:[!0,!0,!1,!0]},arrow:"top",onAlign:function(){q(this.elem()).align()}}),r.fadeIn())}});return r})})(j.$Nav);(function(e){e.when("$","$F","config","nav.createFlyout","util.ajax","util.Aligner","metrics","page.domReady").iff({name:"config",prop:"pseudoPrimeFirstBrowse"}).run("tooltip.pseudoPrime",function(a,b,d,c,f,i,k){var h={triggerType:"load",referrer:document.referrer,height:a(j).height(), width:a(j).width()},d=d.pseudoPrimeFirstBrowse.url,l=a("#navbar"),g=a("#nav-cart"),e=null,m=b.memoize().on(function(b){var c=a(".nav-arrow",b);return c.length>0?new i({base:g,target:c,offsetTo:l,alignTo:b,anchor:"top left",from:"center",to:"center"}):{align:function(){}}});f({url:d,data:h,error:function(){k.increment("nav-pseudo-prime-first-browse-errorCount")},success:function(b){b&&b.content&&(e=c({key:"pseudoPrimeFirstBrowseMessage",event:"pseudoPrimeFirstBrowseMessage",content:a("<div></div>").html(b.content), name:"pseudoPrimeFirstBrowseMessage",className:"nav-pseudo-prime-first-browse-message",align:{base:g,from:"bottom center",to:"top center",constrainTo:l,constrainBuffer:[3,3,0,3],constrainChecks:[!0,!0,!1,!0]},arrow:"top",onAlign:function(){m(this.elem()).align()}}),e.show())}});return e})})(j.$Nav);(function(e){e.when("$","$F","data","config","flyouts.create","flyouts.accessibility","debug.param").run("flyout.cart",function(a,b,d,c,f,i,k){if(!k("navShowCart")&&(c.cartFlyoutDisabled||c.ewc))return!1; var h=a("#nav-cart"),l=k=!1;c.beaconbeltCover&&(l=k=!0);var g=f({key:"cart",link:h,event:"cart",className:"nav-cartFlyout",arrow:"top",suspendTabbing:!0,cover:k,disableCoverPinned:l}),p=i({link:h,onEscape:function(){g.hide();h.focus()}});g.getPanel().onRender(function(){a("#nav-cart-flyout").removeClass("nav-empty");a(".nav-dynamic-full",g.elem()).addClass("nav-spinner");e.when("CartContent").run("CartContentApply",function(b){d.observe("cartItems",function(c){b.render(c);c=parseInt(c.count,10)+parseInt(c.fresh.count, 10);d({cartCount:c});a(".nav-dynamic-full",g.elem()).removeClass("nav-spinner");p.elems(a(".nav-hasPanel, a",g.elem()));g.isVisible()&&g.align()})})});g.onShow(b.once().on(function(){p.elems(a(".nav-hasPanel, a",g.elem()))}));g.onShow(function(){a("#navbar.nav-pinned").length>0&&g.hide()});return g});e.when("$","data","nav.inline").run("setupCartCount",function(a,b){b.observe("cartCount",function(b){var c=a("#nav-cart-menu-button-count .nav-cart-count, #nav-cart .nav-cart-count"),f=a("#nav-cart .nav-cart-count"); b+="";b.match(/^(|0|[1-9][0-9]*|99\+)$/)||(b=0);b=parseInt(b,10)||0;f.removeClass("nav-cart-0 nav-cart-1 nav-cart-10 nav-cart-20 nav-cart-100");var i="",i=b===0?"nav-cart-0":b<10?"nav-cart-1":b<20?"nav-cart-10":b<100?"nav-cart-20":"nav-cart-100";c.html(b>=100?"99+":b.toString());f.addClass(i);b===0?(a("#nav-cart-one, #nav-cart-many").hide(),a("#nav-cart-zero").show()):b<=1?(a("#nav-cart-zero, #nav-cart-many").hide(),a("#nav-cart-one").show()):(a("#nav-cart-zero, #nav-cart-one").hide(),a("#nav-cart-many").show())})}); e.when("$","$F","util.templates","util.Ellipsis","util.inlineBlock","nav.inline","cartTemplateAvailable").build("CartContent",function(a,b,d,c,f){var i=e.getNow("config.doubleCart"),k=a("#nav-cart-flyout"),h={content:a("#nav-cart-standard")};h.title=a(".nav-cart-title",h.content);h.subtitle=a(".nav-cart-subtitle",h.content);h.items=a(".nav-cart-items",h.content);var l={content:a("#nav-cart-pantry")};l.title=a(".nav-cart-title",l.content);l.subtitle=a(".nav-cart-subtitle",l.content);l.items=a(".nav-cart-items", l.content);var g={content:a("#nav-cart-fresh")};g.title=a(".nav-cart-title",g.content);g.subtitle=a(".nav-cart-subtitle",g.content);g.items=a(".nav-cart-items",g.content);var p=k.attr("data-one"),m=k.attr("data-many"),j=l.content.attr("data-box"),q=l.content.attr("data-boxes"),o=l.content.attr("data-box-filled"),s=l.content.attr("data-boxes-filled"),n=function(b){var b=a.extend(!0,{title:!0,subtitle:!0,boxes:0,items:[],count:0,$parent:null,doubleWide:!1},b),g=b.$parent;b.title&&b.doubleWide?f(g.title): b.title?g.title.css({display:"block"}):g.title.hide();g.subtitle.html("").hide();if(b.subtitle){var h=[],i="";if(b.boxes>0){var k=Math.ceil(b.boxes);k===1?h.push(j.replace("{count}",k)):h.push(q.replace("{count}",k))}b.count===1?h.push(p.replace("{count}",b.count)):b.count>1&&h.push(m.replace("{count}",b.count));if(b.boxes>0){var k=Math.floor(b.boxes),l=Math.round((b.boxes-k)*1E3)/10;k===0||l===0?h.push(o.replace("{pct}",l===0?100:l)):h.push(s.replace("{pct}",l))}for(k=0;k<h.length;k++)i+="<span class='nav-cart-subtitle-item "+ (k===0?"nav-firstChild ":"")+(k===h.length-1?"nav-lastChild ":"")+"'>"+h[k]+"</span>";g.subtitle.html(i);b.doubleWide?f(g.subtitle):g.subtitle.css({display:"block"})}b.items.length>0&&g.items&&g.items.html(d.use("cart",{items:b.items}));c.newInstance().elem(a(".nav-cart-item-title",g.content)).external(!0).dimensions(function(a){return{width:parseInt(a.css("width"),10),height:parseInt(a.css("line-height"),10)*2}}).truncate();g.content.show()},w=b.once().on(function(){k.addClass("nav-cart-double")}), v=b.once().on(function(){k.addClass("nav-cart-dividers")});return{render:function(b){b=a.extend(!0,{status:!1,count:0,items:[],pantry:{status:!1,count:0,weight:{unit:"",value:-1},boxes:0,items:[]},fresh:{status:!1,count:0,items:[]}},b);k.removeClass("nav-cart-double nav-cart-dividers");var c={title:!1,subtitle:!1,count:b.count-b.pantry.count,items:b.items,$parent:h},d={count:b.pantry.count,boxes:parseFloat(b.pantry.boxes,10),items:b.pantry.items,$parent:l},f={count:b.fresh.count,items:b.fresh.items, $parent:g};if(b.status)k.addClass("nav-ajax-success");else return k.addClass("nav-ajax-error"),!1;if(b.items.length===0&&b.pantry.items.length===0&&b.fresh.items.length===0)return k.addClass("nav-empty").removeClass("nav-full"),!0;else k.removeClass("nav-empty").addClass("nav-full");if(b.items.length>0&&b.pantry.items.length===0&&b.fresh.items.length===0)b.items.length<=5?n(c):i?(w(),n(a.extend(c,{items:b.items.slice(0,10),doubleWide:!0}))):n(a.extend(c,{items:b.items.slice(0,5)}));else if(b.items.length=== 0&&b.pantry.items.length>0&&b.fresh.items.length===0)b.pantry.items.length<=5?n(d):(w(),n(a.extend(d,{items:b.pantry.items.slice(0,10),doubleWide:!0})));else if(b.items.length===0&&b.pantry.items.length===0&&b.fresh.items.length>0)n(a.extend(f,{items:b.fresh.items.slice(0,5),doubleWide:!0}));else if(b.fresh.items.length>0&&b.items.length>0&&b.pantry.items.length===0)v(),n(a.extend(c,{items:b.items.slice(0,4),title:!0,subtitle:!0,doubleWide:!0})),n(a.extend(f,{items:b.fresh.items.slice(0,4),doubleWide:!0})); else if(b.fresh.items.length>0&&b.items.length===0&&b.pantry.items.length>0)v(),n(a.extend(d,{items:b.pantry.items.slice(0,4),doubleWide:!0})),n(a.extend(f,{items:b.fresh.items.slice(0,4),doubleWide:!0}));else if(b.items.length>0&&b.pantry.items.length>0&&b.fresh.items.length===0)if(v(),b.items.length+b.pantry.items.length<=4)n(a.extend(c,{title:!0,subtitle:!0})),n(d);else{w();var f=Math.ceil(b.items.length/2),m=Math.ceil(b.pantry.items.length/2);f<=2||m<=1&&f===3?n(a.extend(c,{title:!0,subtitle:!0, doubleWide:!0})):n(a.extend(c,{items:b.items.slice(0,m<=1?6:4),title:!0,subtitle:!0,doubleWide:!0}));m<=2||f<=1&&m===3?n(a.extend(d,{doubleWide:!0})):n(a.extend(d,{items:b.pantry.items.slice(0,f<=1?6:4),doubleWide:!0}))}else b.fresh.items.length>0&&b.items.length>0&&b.pantry.items.length>0&&(v(),n(a.extend(c,{items:b.items.slice(0,4),title:!0,subtitle:!0,doubleWide:!0})),n(a.extend(d,{items:b.pantry.items.slice(0,4),doubleWide:!0})),n(a.extend(f,{items:b.fresh.items.slice(0,4),doubleWide:!0})));return!0}}})})(j.$Nav); (function(e){e.when("$","config","flyouts.create","dataPanel").run("flyout.wishlist",function(a,b,d,c){var f=!!b.beaconbeltCover,i=function(){a("#nav-cart").bind("mouseenter",function(){k.flyout.hide()})},k={createFlyout:function(){return b.fullWidthCoreFlyout?d({key:"wishlist",className:"nav-coreFlyout nav-fullWidthFlyout",link:a("#nav-link-wishlist"),altMouseoutElem:a("#nav-tools"),mouseEnterCallback:i,event:"wishlist",arrow:"top",fullWidth:1,cover:f,animateDown:b.flyoutAnimation}):d({key:"wishlist", link:a("#nav-link-wishlist"),event:"wishlist",arrow:"top",cover:f,animateDown:b.flyoutAnimation})},createWishlistDataPanel:function(){return c({id:"nav-flyout-wl-items",dataKey:"wishlistItems",spinner:!0,visible:!1})},createAlexaListDataPanel:function(){return c({id:"nav-flyout-wl-alexa",dataKey:"alexaItems",spinner:!1,visible:!1})},setPanelVisibilityRules:function(a){a.onData(function(a){a.count===0?this.hide():this.show()});a.onTimeout(function(){this.hide()})},onFlyoutPanelRender:function(a){k.flyout.getPanel().onRender(function(c){if(!c.data|| !c.data.isTimeout){var d=k.flyout.elem(),c=d;b.fullWidthCoreFlyout&&(c=d.find(".nav-column:first-child .nav-panel"));for(d=0;d<a.length;d++){var f=a[d];f.elem().prependTo(c).show();f.startTimeout()}}})},init:function(){var a=[];k.flyout=k.createFlyout();if(b.isRecognized){var c=k.createWishlistDataPanel();k.setPanelVisibilityRules(c);a.push(c);b.alexaListEnabled&&(c=k.createAlexaListDataPanel(),k.setPanelVisibilityRules(c),a.push(c))}k.onFlyoutPanelRender(a)}};k.init();return k.flyout})})(j.$Nav); (function(e){e.when("$","config","util.cleanUrl").run("SignInRedirect",function(a,b,d){if(!b.signInOverride)return!1;var c={setRedirectUrl:function(a,c,f){var l=a.attr("href");if(!l)return!0;c=c?c:j.location.href;c=d(c,{https:!0,encode:!0,ref:a.attr("data-nav-ref")||!1});l=l.replace(/(currentPageURL(\%3D|\=))[^\&\?]+/g,"currentPageURL="+c);l=l.replace(/(pageType(\%3D|\=))[^\&\?]*/g,"pageType="+b.pageType);a.attr("href",l);f&&f(l)}},f=a('#navbar [data-nav-role="signin"]');a.each(f,function(b,d){c.setRedirectUrl(a(d), null,null)});return c})})(j.$Nav);(function(e){e.when("$","data","config","page.domReady").run("timelineContent",function(a,b,d){if(d.timeline){var d=a("#nav-timeline-wrapper"),c=a("#nav-timeline",d);b.observe("flyoutErrorContent",function(d){var d=a("#nav-timeline-error",a(d)[0]),i="<div id='nav-timeline'><div id='nav-timeline-data' class='nav-center'>"+d[0].outerHTML+"</div></div>";c.length===0&&d.length===1&&b({timelineContent:{html:i}})});c.length<1||(d.remove(),b({timelineContent:{html:c[0].outerHTML}}))}}); e.when("$","$F","flyouts.create","config","util.Aligner","flyouts.anchor","carousel","util.Ellipsis","data","provider.dynamicMenu","agent","log").run("flyout.timeline",function(a,b,d,c,f,i,k,h,l,g,e,m){if(c.timeline){var b=a("#nav-recently-viewed"),j=d({key:"timeline",className:"nav-coreFlyout nav-fullWidthFlyout",link:b,cover:!!c.beaconbeltCover,clickThrough:!1,event:"timeline",arrow:"top",fullWidth:1,mouseoutTimeOut:0,animateDown:c.flyoutAnimation}),q=!1;b.hover(function(){q=!0},function(){q=!1}); b.click(function(){a(this).blur();q&&(j.show(),q=!1)});var o=function(){h.newInstance().elem(a(".nav-timeline-asin-title",".nav-timeline-asin")).external(!0).dimensions(function(a){return{width:parseInt(a.css("width"),10),height:parseInt(a.css("line-height"),10)*2}}).truncate()},s=function(){l.observe("timelineContent",function(){k.create(a("#nav-timeline-data"),j);c.timelineAsinPriceEnabled||o()})},n=function(){var b=function(b){var c=a(this),d=a(b.target),g=c.find(".nav-timeline-remove-item"),f= c.find(".nav-timeline-remove-error-msg"),h=c.find(".nav-timeline-date");b.type==="mouseover"?(c.addClass("nav-change-dot"),b=f.css("display"),(d.hasClass("nav-timeline-remove-container")||d.parents(".nav-timeline-remove-container").length>0)&&b==="none"?(g.show(),h.hide()):b==="block"?(g.hide(),h.hide()):(g.hide(),h.show())):(c.removeClass("nav-change-dot"),g.hide(),f.hide(),h.show())},d=0;if(c.dynamicTimelineDeleteArgs)d=c.dynamicTimelineDeleteArgs;var f=function(a,b,d){b={lastItemTimeStamp:b,isCalledFromTimelineDelete:1, fetchEmptyContent:d,pageType:c.pageType,subPageType:c.subPageType,metricKey:"timelineRefillMetric"};b[a]="timeline";g.boundFetch({data:b})()},h=function(a,b){var f={asin:b,navDebugTimelineDeleteError:d,metricKey:"timelineDeleteMetric",pageType:c.pageType};m("Timeline delete on page: "+c.pageType);f[a]="timelineDelete";g.boundFetch({data:f})()},i=function(){var c=a(this),d=c.parents(".nav-timeline-item"),g=c.find(".nav-timeline-remove-error-msg"),m=c.find(".nav-timeline-remove-item"),e=d.attr("data-nav-timeline-item"), o=a("#nav-timeline-data"),p=o.attr("data-nav-timeline-length"),j=o.attr("data-nav-timeline-max-items-shown"),n=a(".nav-timeline-item:last"),s=n.prev().attr("data-nav-timeline-item-timestamp"),q=a(".nav-timeline-item > .nav-timeline-dummy").length,r="timelineRefillContent"+e,v="timelineDeleteContent"+e,K=a(".nav-timeline-item"),L=K.length,O=a("#nav-timeline"),z=0;L===3?z=q>0?1:0:L===2&&(z=1);var P=a(".nav-carousel-container").length,M=function(){h(v,e);l.observe(v,function(b){if(parseInt(b.html,10)){var b= a(".nav-timeline-item"),f=b.length,h=d.find(".nav-start").length,l=d.find(".nav-timeline-date"),e=d.next(),p=e.find(".nav-timeline-date"),j=e.find(".nav-timeline-line"),n=a(".nav-timeline-hidden-item"),x=n.length;if(x>0&&(q>0||f===2)&&f<=3)b.remove(),o.addClass("nav-center"),o.css({width:"auto","float":"none"}),O.removeClass("nav-timeline-delete-enabled"),n.removeClass("nav-timeline-hidden-item");else{if(h>0)d.hide(),x>0&&n.removeClass("nav-timeline-hidden-item");else{d.addClass("nav-timeline-shift"); for(var s=!1,r,w=0;w<f;w++)r=K.eq(w),!s&&r.hasClass("nav-timeline-shift")&&(s=!0),s&&r.css({left:"-165px"})}x>0&&(f=n.attr("data-nav-timeline-length"),x=n.attr("data-nav-timeline-max-items-shown"),o.attr("data-nav-timeline-length",f-1),o.attr("data-nav-timeline-max-items-shown",x),n.removeAttr("data-nav-timeline-length"),n.removeAttr("data-nav-timeline-max-items-shown"),n.removeClass("nav-timeline-hidden-item"));d.remove();b.css({left:"0"});P>0&&k.readjust(o)}l.length>0&&p.length===0&&e.find(".nav-timeline-remove-container").append('<div class="nav-timeline-date">'+ l.text()+"</div>");h>0&&j.addClass("nav-start nav-edge")}else b=a(".nav-timeline-hidden-item"),b.length>0&&b.remove(),m.hide(),g.show(),c.bind("click",i)})};(function(){c.unbind("click");parseInt(p,10)>parseInt(j,10)||z>0?(f(r,s,z),l.observe(r,function(c){a(c.html).insertBefore(n);z===0&&(c=n.prev(),c.bind("mouseover mouseleave",b),c.find(".nav-timeline-remove-container").bind("click",i));M()})):M()})()};a(".nav-timeline-item").bind("mouseover mouseleave",b);a(".nav-timeline-remove-container").bind("click", i)};j.getPanel().onRender(function(){c.timelineDeleteEnabled&&!e.touch&&n()});j.onShow(function(){s()});return j}});e.when("$","nav.createTooltip","config","flyout.timeline","data","page.domReady").run("timelineTooltipDynamic",function(a,b,d,c,f){d.timeline&&f.observe("timelineTooltipContent",function(c){if(c.html){var f=a("#navbar"),h=a("#nav-recently-viewed"),l=b({name:"timelineTT",content:c.html,className:"nav-timeline-tt",timeout:"none",cover:!!d.beaconbeltCover,addCloseX:!0,align:{base:h,from:"bottom center", to:"top center",constrainTo:f,constrainBuffer:[3,3,0,3],constrainChecks:[!0,!0,!1,!0]},arrow:"top",clickCallback:function(){l.hide();h.trigger("mouseover")}});l.fadeIn()}})})})(j.$Nav);(function(e){e.when("$","util.tabbing","nav.inline").run("enableNavbarTabbing",function(a){var b=a("#navbar [tabindex]").get(),d=b.length;if(!(d<2)){var c=Number.MIN_VALUE,f=0,i=a("#nav-logo a:first").attr("tabindex");a("#nav-upnav").find("map area, a").each(function(){a(this).attr("tabindex",i-1)});var k=a("#nav-supra > a").length; if(k>0){var h=a("#nav-xshop a:first-child"),f=parseInt(h.attr("tabindex"),10)-k;a("#nav-supra").find("a").each(function(){a(this).attr("tabindex",f);f++})}k=a(".nav-search-submit .nav-input");f=parseInt(k.attr("tabindex"),10);a("#nav-swmslot").find("map area, a").each(function(){f+=1;a(this).attr("tabindex",f)}).focus(function(){a("#navSwmHoliday").addClass("nav-focus")}).blur(function(){a("#navSwmHoliday").removeClass("nav-focus")});for(k=0;k<d;k++)f=parseInt(b[k].getAttribute("tabindex"),10),c< f&&(c=f);k=a("#nav-subnav");b=k.children(".nav-a");d=b.length;if(k.length!==0&&d>=2){k=c+d;for(h=0;h<d;h++)b.eq(h).hasClass("nav-right")?(b.eq(h).attr("tabindex",k),k-=1):(c+=1,b.eq(h).attr("tabindex",c))}c=a("#navbar [tabindex]").get();c=a(c.sort(function(b,c){return parseInt(a(b).attr("tabindex"),10)-parseInt(a(c).attr("tabindex"),10)}))}});e.when("$","$F","config","now","logEvent","util.Proximity").run("setupSslTriggering",function(a,b,d,c,f,i){var k=d.sslTriggerType,h=d.sslTriggerRetry;if(!(k!== "pageReady"&&k!=="flyoutProximityLarge")){var l="https://"+j.location.hostname+"/empty.gif",g=0,d=b.after(h+1,!0).on(function(){(new Image).src=l+"?"+c();g++;f({t:"ssl",id:g+"-"+k})}),p;p=h?b.debounce(45E3,!0).on(d):b.once().on(d);k==="pageReady"&&e.when("btf.full").run("NavbarSSLPageReadyTrigger",function(){if(h){var a=h,b=function(){p();a>0&&(a--,setTimeout(function(){b()},45100))};b()}else p()});if(k==="flyoutProximityLarge")var m=i.onEnter(a("#navbar"),[0,0,250,0],function(){m.unbind();p()},h? 45E3:0)}})})(j.$Nav);(function(e){e.when("$","flyouts.create","config","nav.inline").run("flyout.shopall",function(a,b,d){var c=!!d.beaconbeltCover&&!d.primeDay,f=b({key:"shopAll",className:"nav-catFlyout",link:a("#nav-link-shopall"),cover:c,clickThrough:!0,event:{t:"sa",id:"main"},arrow:"top",animateDown:d.flyoutAnimation});f.onShow(function(){if(a("#navbar.nav-primeDay").length>0||a("#navbar.nav-pinned").length>0){var b=a("#nav-sbd-pinned, #nav-hamburger");f.elem().find(".nav-arrow").css({position:"absolute", left:b.width()/2})}});return f})})(j.$Nav);(function(e){e.when("$").run("ewc.before.flyout",function(){typeof j.uet==="function"&&j.uet("x3","ewc",{wb:1})});e.when("$","$F","config","flyouts.create","provider.ajax","data","logUeError","now","cover","metrics","util.checkedObserver").run("ewc.flyout",function(a,b,d,c,f,i,k,h,l,g,p){if(d.ewc&&!d.ewc.debugInlineJS){typeof j.uet==="function"&&j.uet("x4","ewc",{wb:1});var m=d.ewc.flyout,r=h=!1;d.beaconbeltCover&&!d.ewc.enablePersistent&&(r=h=!0);var q= a(j);a(document.documentElement);a("#nav-belt");a("#nav-cart");var o=d.ewc.timeout||3E4,s=d.ewc.url,n=/\$Nav/g,w=function(){var a=j.document.documentElement.clientHeight,b=j.document.body;return j.document.compatMode==="CSS1Compat"&&a||b&&b.clientHeight||a},v=function(){var a=i.get("ewcTimeout");if(a){var b={};b.ewcContent=a;i(b)}g.increment("nav-flyout-ewc-error")};if(d.ewc.isEWCLogging){var u="&isPersistent=";u+=m.ableToPersist()?1:0;var x=j.innerWidth||document.documentElement.clientWidth||document.body.clientWidth|| "0",t=w()||"0";u+="&width="+x+"&height="+t;s+=u}var A=f({url:s,timeout:o,retryLimit:0,dataKey:"ewcContent",error:v,beforeSend:function(){typeof j.uet==="function"&&j.uet("af","ewc",{wb:1})},success:function(a){a&&a.ewcContent&&a.ewcContent.js&&(a="var P = window.AmazonUIPageJS; "+a.ewcContent.js,n.test(a)?(k({message:"Illegal use of $Nav",attribution:"rcx-nav-cart:ewc.ajax",logLevel:"ERROR"}),v()):e.when("ewc.flyout","ewc.cartCount").run("[rcx-nav-cart]ewc",a))},complete:function(){typeof j.uet=== "function"&&j.uet("cf","ewc",{wb:1})}}),B=b.once().on(function(){d.ewc.prefireAjax||A.fetch()});e.declare("ewc.cartCount",function(a){i.observe("cartCount",a)});var y=c({elem:a("#nav-flyout-ewc"),key:"ewc",link:d.ewc.isTriggerEnabled?a("#nav-cart"):null,event:"ewc",className:"nav-ewcFlyout",cover:h,disableCoverPinned:r,anchor:a("#navbar"),timeoutDelay:o,aligner:function(b){var c=b.$flyout,d=a(".nav-flyout-head",c),g=a(".nav-flyout-body",c),f=a("#nav-belt"),b=a("#nav-main"),h=f.outerHeight(),i=b.outerHeight(); return function(){var a=f.offset().top,b=q.scrollTop(),k=w(),l=0,m=0,e=8,o=h+i;b<a?(l=a-b,e+=h):b<=a+h?(m=a-b,e+=h):o=i;c.css({top:l+"px",height:k-l+"px"});d.css({top:m+"px","padding-top":e+"px",height:o+"px"});g.css({top:m+"px",height:c.height()-d.outerHeight()-m+"px"})}}});y.getPanel().onRender(function(){d.ewc.prefireAjax||typeof j.uex==="function"&&j.uex("ld","ewc",{wb:1})});var C;d.ewc.pinnable&&(C=function(b){var c=b.elem(),g=c.find(".nav-ewc-pin-tail"),f=g.find(".nav-ewc-pin-button"),h=function(c){var d= "/ref=";d+=b.isPersistent()?"crt_ewc_pin":"crt_ewc_unpin";a.ajax({type:"GET",cache:!1,url:"/gp/navigation/ajax/save-ewc-status.html"+d+c})},i=function(a){d.ewc.enablePersistentByCust=a==="1";h("?persistent="+a)},k=function(){var a="?ttDisplayed=1";d.ewc.ewcDebugTTP&&(a+="&ewcDebugTTP="+d.ewc.ewcDebugTTP);h(a)},l=function(a){a?g.removeClass("nav-ewc-unpin").addClass("nav-ewc-pin"):g.removeClass("nav-ewc-pin").addClass("nav-ewc-unpin")},m=c.find(".nav-ewc-pin-tt"),e=function(){return{fadeIn:function(){m.stop(!0, !0).css({top:f.position().top+f.height()/2-m.outerHeight(!0)/2+"px"}).fadeIn(200)},fadeOut:function(){m.stop(!0,!0).fadeOut(200)},hide:function(){m.stop(!0,!0).hide()}}}();f.bind("mouseenter",function(){e.fadeIn()});f.bind("mouseleave",function(){e.fadeOut()});f.bind("click",function(){e.hide();g.hasClass("nav-ewc-pin")?(b.persist({noAnimation:!0}),i("1")):(b.unpersist({noAnimation:!0}),i("0"))});return{align:function(){var a=c.find(".nav-flyout-head");f.css({top:a.outerHeight()-a.height()+(parseInt(a.css("top"), 10)||0)+250+"px"})},tryToShowTrainingTip:function(){g.hasClass("nav-ewc-pin")||(e.fadeIn(),setTimeout(function(){e.fadeOut()},2E3),k())},resetVisibility:function(){(j.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>=d.ewc.viewportWidthForPersistent?(c.find(".nav-flyout-body").addClass("nav-ewc-unpinbody"),g.show()):(g.hide(),c.find(".nav-flyout-body").removeClass("nav-ewc-unpinbody"))},isVisible:function(){return g.is(":visible")},collapse:function(){l(!0)},expand:function(){l(!1)}}}(y)); y.onAlign(function(){d.ewc.pinnable&&C.align()});y.onShow(function(){B();y.lock()});y.onRender(b.once().on(function(){typeof j.uet==="function"&&j.uet("x5","ewc",{wb:1});var b=y.elem(),c=y.getPanel().elem(),g=a("#nav-cart"),f=b.find(".nav-cart");d.ewc.prefireAjax?(c.hide(),y.getPanel().render({html:" "})):b.find(".nav-flyout-body").append(c);i.observe("cartCount",function(){f.html(g.html())});d.ewc.pinnable&&(C.resetVisibility(),q.resize(function(){C.resetVisibility()}))}));y.ableToPersist=m.ableToPersist; y.hasQualifiedViewportForPersistent=function(){return m.hasQualifiedViewportForPersistent?m.hasQualifiedViewportForPersistent():!1};var G=function(){e.getNow("isAuiP")&&j.P.when("A").execute(function(a){a.trigger("resize",j,{width:1,height:1})})};y.applyPageLayoutForPersistent=function(){m.applyPageLayoutForPersistent();typeof j.maintainHeight==="function"&&j.maintainHeight();G()};y.unapplyPageLayoutForPersistent=function(){m.unapplyPageLayoutForPersistent();G()};(function(){var b,c=function(a){a.stop(!1, !0).animate({left:"-"+a.width()+"px"},400,function(){b=setTimeout(function(){g(a)},2E3)})},g=function(a){a.stop(!0,!0).fadeOut(400,function(){a.css({left:"",display:""})});clearTimeout(b)},f=function(b,d){var g={right:"-"+b.width()+"px"};d?b.css(g):(b.animate(g,400,function(){a(this).css("right","")}),c(a(".nav-flyout-tail",b)))},h=!1;d.ewc.pinnable&&(h?C.expand():C.collapse());y.isSlidedIn=function(){return h};y.slideIn=p({context:y,check:function(){if(h)return!1},observe:function(b){y.isVisible()|| y.show();var c=this.elem(),d={right:"0"};b.noAnimation?c.stop().css(d):(c.stop().animate(d,400),g(a(".nav-flyout-tail",c)));h=!0}});y.onSlideIn=y.slideIn.observe;y.onSlideIn(function(){d.ewc.pinnable&&C.expand()});y.slideOut=p({context:y,check:function(){if(!h)return!1},observe:function(a){y.isVisible()||y.show();f(this.elem(),a.noAnimation);h=!1}});y.onSlideOut=y.slideOut.observe;y.onSlideOut(function(){d.ewc.pinnable&&C.collapse()})})();(function(){var a=!1;y.persist=p({context:y,check:function(){if(a)return!1}, observe:function(b){a=!0;y.applyPageLayoutForPersistent();y.slideIn({noAnimation:b.noAnimation});y.lock()}});y.onPersist=y.persist.observe;y.unpersist=p({context:y,check:function(){if(!a)return!1},observe:function(b){a=!1;y.unlock();y.slideOut({noAnimation:b.noAnimation});y.unapplyPageLayoutForPersistent()}});y.onUnpersist=y.unpersist.observe;y.isPersistent=function(){return a}})();l.onShow(function(){var a=y.elem();y.isPersistent()&&a.css({zIndex:l.LAYERS.SUB})});l.onHide(function(){var a=y.elem(); y.isPersistent()&&a.css({zIndex:""})});d.ewc.prefetch&&setTimeout(B,1E3);var E=function(){y.ableToPersist()?y.persist({noAnimation:!0}):y.unpersist({noAnimation:!0})},F=function(b){a("#navbar").is(":hidden")?setTimeout(function(){F(b)},1E3):b()};F(function(){y.show();q.scroll(function(){y.align()});q.resize(function(){y.align()});m.unbindEvents();E();d.ewc.pinnable&&d.ewc.enableTrainingTip&&C.tryToShowTrainingTip();q.resize(function(){E()})});return y}});e.when("$","$F","config","util.mouseOut","util.velocityTracker", "ewc.flyout").run("ewc.hoverTrigger",function(a,b,d,c,f,i){if(d.ewc.enableHover){var k=a("#nav-cart"),h=f(),d=c(500);d.add(k);d.add(i.elem());d.enable();k.hover(function(){h.enable()},function(){h.disable()});d.action(function(){i.hasQualifiedViewportForPersistent()||i.slideOut()});var l=b.debounce(500,!0).on(function(){i.hasQualifiedViewportForPersistent()||i.slideIn()});h.addThreshold({below:40},function(){l();h.disable()});var g=function(){var b=a(".nav-icon",k);i.hasQualifiedViewportForPersistent()? b.hide().css({visibility:"hidden"}):b.show().css({visibility:"visible"})};g();a(j).resize(function(){g()})}})})(j.$Nav);(function(e){e.when("$","metrics","page.domReady").run("upnavMetrics",function(a,b){var d=a("#nav-upnav");if(d.length!==0){var c=d.find("a"),d=d.find("map area"),f=c.length,i=d.length;if(!(f===0&&i===0)&&(c=f>0?c.attr("href"):d.attr("href")))c=c.split("/"),c.length>1&&((c=c[c.length-1].split("?")[0].split("="))&&c.length>1&&c[0]==="ref"?b.increment("upnav-"+c[1]+"-show"):b.increment("upnav show"))}}); e.when("$","config.upnavAiryVideoPlayerAlignment","page.domReady","Airy.PlayerReady").run("upnavAiryVideoAlignment",function(a,b){if(b){var d=a("#nav-airy-player-container .airy-renderer-container");if(d.length!==0){var c=a(".nav-airy-widget-wrapper"),f=function(){var a=c.width()/2,b=d.width()/2;d.css("left",Math.floor(a-b))};a(j).resize(function(){f()});f()}}})})(j.$Nav);(function(e){e.when("$","$F","config").iff({name:"config",prop:"newTabClick"}).run("newTabClick",function(a,b,d){var c=d.newTabClick.targetUrlPatterns; if(c&&c.length!==0){for(b=0;b<c.length;b++)c[b]=RegExp(c[b]);var f=document.location.href.split(/#/)[0];a(document).click(function(b){var d=b.target||b.srcElement;if(!(b.which&&b.which!==1)&&(d=a(d).parents("a:first, area:first").andSelf().filter("a:first, area:first").eq(0),d.length!==0)){var b=d.attr("href"),h;if(!(h=(d.attr("target")||"").length!==0))if(!(h=!b))if(!(h=b.match(/^javascript\:/i)))if(h=b.split(/#/)[0],!(h=f.indexOf(h)>=0?1:0))if(!(h=d.parents("#navbar").length)){a:{b=b.split("?")[0]; for(h=0;h<c.length;h++)if(b.match(c[h])){b=1;break a}b=0}h=!b}h||d.attr("target","_blank")}})}})})(j.$Nav);(function(e){e.when("$","$F","data","flyouts.create","flyouts.anchor","util.Aligner","config.transientFlyoutTrigger").iff({name:"config",prop:"transientFlyoutTrigger"}).run("flyout.transient",function(a,b,d,c,f,i,k){var h=a("#navbar"),l=a(k),g=function(){var a=l.offset().left,b=a+l.innerWidth(),a=(a+b)/2;e.elem().find(".nav-arrow").css({position:"absolute",left:a-e.elem().offset().left});e.align()}, e=c({key:"transientFlyout",link:l,arrow:"top",aligner:function(a){var b=new i({base:a.$link,target:a.$flyout,from:"bottom right",to:"top center",anchor:"top",alignTo:f(),constrainTo:h,constrainBuffer:[3,0,0,3],constrainChecks:[!0,!1,!1,!0],offsetTo:h});return function(){b.align()}}});e.onRender(b.once().on(function(){d.observe("transientFlyoutContent",function(){g()})}));e.onShow(function(){g()});return e})})(j.$Nav);(function(e){e.when("$","$F","agent","flyouts","config","constants","metrics","flyout.yourAccount", "nav.inline").build("pinnedNav",function(a,b,d,c,f,i,k,h){if(f.pinnedNav){var l=!1,g=!1,e="nav-pinned",m,r,q,o,s,n=700,w,v,u,x,t,A,B,y,C;if(f.pinnedNavStart)n=f.pinnedNavStart;if(f.iPadTablet)A=f.iPadTablet;f.pinnedNavWithEWC&&(e="nav-pinned nav-pinned-ewc");var G=b.once().on(function(){m=a(j);r=a("#navbar");u=a("#nav-belt");a("#nav-main");o=a("#nav-subnav");q=a("#nav-tools");v=a("#nav-shop");x=a("#nav-search");t=a("#nav-logo");w="<div class='nav-divider'></div>";s="<div id='nav-sbd-pinned'><span class='nav-line1'></span><span class='nav-line2'></span><span class='nav-line3'></span></div>"; B=a(".nav-search-field > input");y=a("#searchDropdownBox");C=c.get("cart")||H}),E=function(){o.show();r.removeClass(e);u.css("width","100%");a("div",v).remove("#nav-sbd-pinned");a("div",q).remove(".nav-divider");A&&(B.unbind("focus"),y.unbind("click"));a("#nav-belt > .nav-left").css({width:a("#nav-logo").outerWidth()});h.unlock();C.unlock();g=!1},F=function(){A&&(document.activeElement.id==="twotabsearchtextbox"&&B.blur(),B.bind("focus",function(){m.scrollTop(0,0)}),y.bind("click",function(){m.scrollTop(0, 0);y.blur()}));o.hide();r.addClass(e);u.css("width",I());r.css({top:"-55px"});t.css({top:"-55px"});x.css({top:"-55px"});r.animate({top:"0"},300);x.animate({top:"0"},300);t.animate({top:"0"},300);a("a",v).append(s);a(w).insertBefore("#nav-cart");h.lock();if(C.isVisible())C.onHide(b.once().on(function(){!C.isVisible()&&!C.isLocked()&&g&&C.lock()}));else C.lock();g=!0;a("#nav-search, #nav-link-yourAccount, #nav-cart").click(function(){var b=a(this).attr("id");k.increment("nav-pinned-"+b+"-clicked")}); a("#nav-link-shopall").hover(function(){var b=a(this).attr("id");k.increment("nav-pinned-"+b+"-hovered")},function(){})},H={lock:b.noOp,unlock:b.noOp,isVisible:b.noOp,onHide:b.noOp},z=function(){var b=a("#nav-flyout-ewc");b.length>0?b.css("right")!=="0px"&&c.hideAll():c.hideAll()},I=function(){var a=q.width(),b=v.width();return m.width()-a-b+i.PINNED_NAV_SEARCH_SPACING},D=function(){var a=m.scrollTop();g&&a<n?(z(),E()):!g&&a>=n&&(z(),F())};return{enable:function(){!l&&!d.ie6&&!d.quirks&&(G(),m.bind("scroll.navFixed", D),m.resize(b.throttle(300).on(function(){r.hasClass(e)&&u.css("width",I())})),D(),l=!0)},disable:function(){l&&(m.unbind("scroll.navFixed"),E(),l=!1)}}}})})(j.$Nav);(function(e){var a=function(a,d){var c=d.elem(),f=c.find(".nav-column"),i=f,f=f.eq(2),i=i.eq(3);if(c.find(".nav-flyout-sidePanel").length>0)d.sidePanel.onShow();else{var k=d.sidePanel.elem();if(k.children().length===0)c.find("#nav-flyout-ya-signin").length===0&&i.removeClass("nav-column-break");else{var k=a("<div class='nav-flyout-sidePanel' />").append(k), h=c.find(".nav-flyout-content"),l=h.height();l===0&&(h=h.outerHeight(!0),l=c.height()-h);k.css({height:l,display:"none"});i.addClass("nav-column-break");f.prepend(k);k.fadeIn(200);d.sidePanel.onShow()}}};e.when("$","$F","config","flyout.yourAccount","flyouts.sidePanel","sidepanel.yaNotis").run("flyouts.fullWidthSidePanel",function(b,d,c,f,i,k){if(!c.fullWidthCoreFlyout||!k)return!1;f.onShow(function(){a(b,f)});f.sidePanel.onData(function(){a(b,f)})});e.when("$","$F","config","flyout.yourAccount", "flyouts.sidePanel","sidepanel.csYourAccount").iff({name:"sidepanel.yaNotis",op:"falsey"}).run("flyouts.fullWidthSidePanelCsNotifications",function(b,d,c,f){if(!c.fullWidthCoreFlyout)return!1;f.onShow(function(){a(b,f)});f.sidePanel.onRender(function(){a(b,f)});f.sidePanel.onData(function(){a(b,f)})})})(j.$Nav);(function(e){e.when("$","$F","config","flyouts.create","flyouts.accessibility").run("flyout.fresh",function(a,b,d,c,f){if(!d.navfresh)return!1;var i=a("#nav-link-fresh"),k=c({key:"fresh",link:i, clickThrough:!0,event:"fresh",arrow:"top",suspendTabbing:!0,cover:!!d.beaconbeltCover,animateDown:d.flyoutAnimation}),h=f({link:i,onEscape:function(){k.hide();i.focus()}});k.getPanel().onRender(b.once().on(function(){h.elems(a(".nav-hasPanel, a",k.elem()));k.align()}));k.onShow(b.once().on(function(){h.elems(a(".nav-hasPanel, a",k.elem()))}));return k})})(j.$Nav);(function(e){e.when("page.loaded","$").run("registerMoment",function(a,b){document.getElementById("countdown")&&b.getScript("https://images-na.ssl-images-amazon.com/images/G/01/poppin/JavaScript/moment.min._TTD_.js", function(){b.getScript("https://images-na.ssl-images-amazon.com/images/G/01/poppin/JavaScript/moment-timezone-with-data.min._TTD_.js",function(){e.declare("moment",j.moment)})})});e.when("page.loaded","moment").run("countdowntimer",function(a,b){var d={log:function(){},warn:function(){}},c=document.getElementById("countdown"),f=c.getAttribute("data-server-time-str"),i=c.getAttribute("data-timer-start-at"),k=c.getAttribute("data-live-start-at"),h=c.getAttribute("data-live-end-at"),l=c.getAttribute("data-live-days"), g=c.getAttribute("data-standby-text"),e=c.getAttribute("data-countdown-text-prefix"),c=c.getAttribute("data-live-text");(function(a,c,g,f,h,i,k,l){var e="Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),p=new Date(a);d.log("[poppinCountDown] loadServerTime: "+p);var j=new Date,A=function(a,c){for(var d=a.split(" "),g=d[0].split(":"),f=p.getFullYear(),h=parseInt(p.getMonth(),10)+1,i=p.getDate(),k=d[1].toLowerCase()==="pm"?parseInt(g[0],10)%12+12:parseInt(g[0],10)%12,g=g[1],d=d[2],l=b.tz(""+ f+"-01-01T12:00:00","America/Los_Angeles").format("Z"),h=b.tz(""+f+"-"+(h<10?"0":"")+h+"-"+(i<10?"0":"")+i+"T12:00:00","America/Los_Angeles").format("Z"),d=l!==h?d[0]+"D"+d[1]:d[0]+"S"+d[1],f=new Date(""+e[parseInt(p.getMonth(),10)]+" "+i+" "+f+" "+k+":"+g+":0 "+d),i=0;c&&f.getTime()<=c.getTime();)f=new Date(f.getTime()+864E5),i+=1;return f},a=A(c),B=A(g,a),A=A(f,B);d.log("[csTimeStrTimerStartAt] csTimeStrTimerStartAt: "+c);d.log("[countdownStart] countdownStart: "+a);d.log("[csTimeStrLiveStartAt] csTimeStrLiveStartAt: "+ g);d.log("[liveStart] liveStart: "+B);d.log("[csTimeStrLiveEndAt] csTimeStrLiveEndAt: "+f);d.log("[liveEnd] liveEnd: "+A);var y=a.getTime(),C=B.getTime(),G=A.getTime(),E=function(){var a=function(a){document.getElementById("countdown-text").innerHTML=a},b=function(a){document.getElementById("countdown-timer").innerHTML=a},c=(new Date).getTime()-j.getTime(),d=function(a){var a="UMTWRFS".charAt(a.getDay()),b;for(b=0;b<h.length;b++)if(h.charAt(b)===a)return!0;return!1},g=new Date(p.getTime()+c),c=g.getTime(); if(c<y||h&&!d(g))setTimeout(E,y-c),a(i),b("");else if(c<C){var d=Math.round((C-c)/1E3),g=Math.floor(d/3600),f=Math.floor(d%3600/60),f=f<10?"0"+f:f;d%=60;d=d<10?"0"+d:d;a(k);b(" "+g+":"+f+":"+d);setTimeout(E,(Math.floor((c-y)/1E3)+1)*1E3-(c-y))}else c<G?(setTimeout(E,G-c),a(l)):a(i),b("")};E()})(f,i,k,h,l,g,e,c)})})(j.$Nav);(function(e){e.when("$","config","flyout.yourAccount","flyout.prime","flyout.wishlist","nav.inline").run("primeDayNav",function(a,b,d,c,f){b.primeDay&&(c.lock(),f.lock())})})(j.$Nav); (function(){typeof j.P==="object"&&typeof j.P.when==="function"&&typeof j.P.register==="function"&&typeof j.P.execute==="function"&&j.P.when("A","a-modal","packardGlowIngressJsEnabled").execute(function(e,a,b){if(b){var d=e.$;e.on("packard:glow:destinationChangeNav",function(){d.ajax({type:"POST",url:"/gp/glow/get-location-label.html",success:function(b){b=j.JSON.parse(b);b.deliveryLine1&&d("#glow-ingress-line1").html(b.deliveryLine1);b.deliveryLine2&&d("#glow-ingress-line2").html(b.deliveryLine2); if(b.selectedDestination&&(b.selectedDestination.destinationObfuscatedAddressId&&d("#unifiedLocation1ClickAddress").val(b.selectedDestination.destinationObfuscatedAddressId),b.selectedDestination.destinationType&&b.selectedDestination.destinationValue)){var f=a.get("glow-modal");f&&f.attrs("url","/gp/glow/get-address-selections.html?selectedLocationType="+b.selectedDestination.destinationType+"&selectedLocationValue="+b.selectedDestination.destinationValue+"&deviceType=desktop")}e.trigger("packard:glow:destinationChangeNavAck")}})})}})})(j.$Nav); j.$Nav.declare("version-js","1.0.3728.0 2016-09-14 22:57:28 +0000")})})(function(){var D=window.AmazonUIPageJS||window.P,j=D._namespace||D.attributeErrors;return j?j("NavAuiBeaconbeltAssets"):D}(),window); /* ******** */ (function(C,h,r){C.execute(function(){function u(d){function a(){var a=Date.now();return{uid:a,suggestionsReadyForDisplay:{name:"suggestionsReadyForDisplay-"+a},suggestionsReady:{name:"suggestionsReady-"+a},suggestionsRendered:{name:"suggestionsRendered-"+a},updateSearchBox:{name:"updateSearchBox-"+a},selectionChange:{name:"selectionChange-"+a},dropdownHidden:{name:"dropdownHidden-"+a},updateSearchTerm:{name:"updateSearchTerm-"+a},suggestionClicked:{name:"suggestionClicked-"+a},suggestionsNeeded:{name:"suggestionsNeeded-"+ a},a9SuggestionsNeeded:{name:"a9-suggestionsNeeded-"+a},noSuggestions:{name:"nosuggestions-"+a},searchBoxFocusIn:{name:"searchBoxFocusIn-"+a},searchBoxFocusOut:{name:"searchBoxFocusOut-"+a},keydown:{name:"keydown-"+a},hideDropdown:{name:"hidedropdown-"+a},focusOnParent:{name:"focusOnParent-"+a},parentFocused:{name:"parentFocused-"+a},parentLostFocus:{name:"parentLostFocus-"+a},searchTermChanged:{name:"searchTermChanged-"+a},suggestionsDisplayed:{name:"suggestionsDisplayed-"+a},upArrowPressed:{name:"upArrowPressed-"+ a},downArrowPressed:{name:"downArrowPressed-"+a}}}return{globals:{issLoaded:{name:"issLoaded"},suggestionsRendered:{name:"suggestionsRendered"},initializeNavSearchBox:{name:"initializeSearchBox"}},createInstance:function(){return new a},createEvent:function(a,c){var e=c;c.hasOwnProperty("name")?e=c.name:"string"===typeof c?e=c:d.logDebug('Format of "event" parameter is not a string or an event object',c);return a+"-"+e}}}h.$Nav.when("$","nav.inline").run(function(d){h.$Nav.declare("config.blackbelt", 0<d("#nav-belt").length)});h.$Nav.when("config.blackbelt").run(function(d){d?h.$Nav.when("searchApi").run(function(a){h.$Nav.declare("sxSearchApi",a)}):h.$Nav.declare("sxSearchApi")});h.$Nav.when("$","sxSearchApi","sx.iss.DomUtils").build("NavDomApi",function(d,a,b){function c(){if(l)return g().find('input[type="text"]');"undefined"===typeof p&&(p=d(n.searchBox));return p}function e(){if(l)return a.flyout.elem();"undefined"===typeof t&&(t=d(D),g().after(t));return t}function m(){if(l)return a.options().parents("select"); "undefined"===typeof q&&(q=d(n.aliasDropdown));return q}function g(){return l?a.options().parents("form"):d(n.form)}function f(){var a=k(),b=e();!e().is(":visible")||1>b.html().length||b.css({left:a.offset().left,width:a.width()})}function k(){x===r&&(x=d("#nav-iss-attach"));return x}var l=a!==r,n={searchBox:"#twotabsearchtextbox",searchSuggestions:"#srch_sggst",navBar:"#navbar",aliasDropdown:"#searchDropdownBox",dropdownId:"search-dropdown",form:"#nav-searchbar",issPrefixEl:"#issprefix",suggestion:".s-suggestion"}, p,y,t,q,x,D='<div id="'+n.dropdownId+'" class="search-dropdown"></div>',z=/search-alias\s*=\s*([\w-]+)/;a===r&&d(h).resize(f);return{getAliasDropdown:m,getSearchBox:c,getSearchBoxId:function(){return n.searchBox},getSearchSuggestions:function(){"undefined"===typeof y&&(y=d(n.searchSuggestions));return y},getKeyword:function(){var e;e=a!==r?a:c();return b.getKeyword(e)},setKeyword:function(b){if(a!==r)a.val(b);else return c().val(b)},getAliasFromDropdown:function(){var a=m().val();return(a=a&&a.match(z))? a[1]:r},getCategoryNameFromDropdown:function(a){var b="";a?(a=m().find('option[value$="search-alias='+a+'"]'),b=0<a.length?d(a[0]).text():b):b=m().find("option:selected").text();return d.trim(b)},getDropdown:e,showDropdown:function(b){l?("undefined"!==typeof b&&a.flyout.elem().html(b),a.flyout.show()):("undefined"!==typeof b&&e().hide().html(b),b=k(),e().css({left:b.offset().left,width:b.width()}).show())},hideDropdown:function(){l?a.flyout.hide():e().hide()},getOption:function(a){if(!a)return m().find("option:selected"); a=m().find('option[value$="search-alias='+a+'"]');return 0<a.length?d(a[0]):d()},getForm:g,getIssPrefixElem:function(){return d(n.issPrefixEl)},getSuggestions:function(){return d(n.suggestion)},submitForm:function(){g().submit()},getOriginalSearchTerm:function(){return g().data("originalSearchTerm")},getOriginalAlias:function(){return g().data("originalAlias")},isSearchBoxFocused:function(){return c().get(0)===document.activeElement},activateSearchBox:function(){g().addClass("nav-active")},deactivateSearchBox:function(){g().removeClass("nav-active")}, getSearchApi:function(){return a}}});h.$Nav.build("sx.iss.TemplateEngine",function(){var d={};return function b(c,e){var m=/^[a-zA-Z0-9_-]+$/.test(c)?d[c]=d[c]||b(document.getElementById(c).innerHTML):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+c.replace(/[\r\t\n]/g," ").replace(/'(?=[^#]*#>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<#=(.+?)#>/g,"',$1,'").split("<#").join("');").split("#>").join("p.push('")+"');}return p.join('');"); return e?m(e):m}});h.$Nav.when("$").build("sx.iss.TemplateInstaller",function(d){function a(a,c){var e=document.createElement("script");e.setAttribute("type","text/html");e.setAttribute("id",a);e.text=c;return e}d("body");return{init:function(b){var c=document.createDocumentFragment();b="undefined"!==typeof b&&"undefined"!==typeof b.emphasizeSuggestionsTreatment?b.emphasizeSuggestionsTreatment:"C";"T1"===b?(c.appendChild(a("s-suggestion",'<div id="<#= suggestionId #>"class="s-suggestion"data-alias="<#= alias #>"data-keyword="<#= keyword #>"data-store="<#= store #>"data-isSc="<#= isSpellCorrected #>"data-isFb="<#= isFallback #>"data-type="<#= type #>"><span class="s-heavy"><#= bprefix #></span><#= prefix #><span class="s-heavy"><#= suffix #></span><# if (typeof storeHtml === "string") { #> <#= storeHtml #><# } #></div>')), c.appendChild(a("suggestions-template",'<div id="suggestions-template"><div id="suggestions"><# if (typeof suggestions !== "undefined") {for(var i=0; i < suggestions.length; i++) {var displayString = suggestions[i].display; #><#= displayString #><# }} #></div></div>'))):"T2"===b?(c.appendChild(a("s-suggestion",'<div id="<#= suggestionId #>"class="s-suggestion"data-alias="<#= alias #>"data-keyword="<#= keyword #>"data-store="<#= store #>"data-isSc="<#= isSpellCorrected #>"data-isFb="<#= isFallback #>"data-type="<#= type #>"><#= bprefix #><span class="s-known"><#= prefix #></span><#= suffix #><# if (typeof storeHtml === "string") { #> <#= storeHtml #><# } #></div>')), c.appendChild(a("suggestions-template",'<div id="suggestions-template"><div id="suggestions"><# if (typeof suggestions !== "undefined") {for(var i=0; i < suggestions.length; i++) {var displayString = suggestions[i].display; #><#= displayString #><# }} #></div></div>'))):(c.appendChild(a("s-suggestion",'<div id="<#= suggestionId #>"class="s-suggestion"data-alias="<#= alias #>"data-keyword="<#= keyword #>"data-store="<#= store #>"data-isSc="<#= isSpellCorrected #>"data-isFb="<#= isFallback #>"data-type="<#= type #>"><#= bprefix #><span class="s-heavy"><#= prefix #></span><#= suffix #><# if (typeof storeHtml === "string") { #> <#= storeHtml #><# } #></div>')), c.appendChild(a("suggestions-template",'<div id="suggestions-template"><# if (typeof suggestionTitle !== "undefined") { #><div id="suggestion-title"><#= suggestionTitle #></div><# } #><div id="suggestions"><# if (typeof suggestions !== "undefined") {for(var i=0; i < suggestions.length; i++) {var displayString = suggestions[i].display; #><#= displayString #><# }} #></div></div>')));c.appendChild(a("s-separator",'<div id="s-separator"><div class="s-separator"></div></div>'));c.appendChild(a("s-department", '<div id="<#= suggestionId #>" class="s-suggestion s-highlight-primary"data-alias="<#= alias #>"data-keyword="<#= keyword #>"data-store="<#= store #>"data-type="<#= type #>">Shop the <#= beforePrefix #><span class="s-heavy"><#= prefix #></span><#= suffix #> store</div>'));c.appendChild(a("s-option",'<option value="<#= value #>"><#= store #></option>'));c.appendChild(a("s-minimal",'<div class="s-suggestion s-custom" data-url="<#= url #>"><#= bprefix #><span class="s-heavy"><#= prefix #></span><#= suffix #></div>')); c.appendChild(a("s-storeText",'<span class="<#= cssClasses #>"><#= store #></span>'));c.appendChild(a("s-corpus",'<div class="s-suggestion" id="<#= suggestionId #>"data-alias="<#= alias #>"data-url="<#= url #>"data-type="<#= type #>"data-keyword="<#= keyword #>"><# if (typeof primeText !== "undefined") { #><span class="s-highlight-primary">[<#= primeText #>] </span><# } #><#= bprefix #><span class="s-heavy"><#= prefix #></span><#= suffix #></div>'));document.body.appendChild(c)}}});h.$Nav.when("sx.iss.DebugUtils", "sx.iss.DomUtils").build("sx.iss.EventBus.instance",function(d,a){return new function(){function b(a){var b=typeof a,c="";"object"===b&&a.hasOwnProperty("name")?c=a.name:"string"===b&&(c=a);return c}var c={},e={};this.listen=function(e,g,f){var k,l="";if(a.isArray(e)){for(k=0;k<e.length;k++)l=e[k],this.listen(l,g,f),d.logDebug("Listening for: "+l);return this}l=b(e);c[l]||(c[l]=[]);c[l].push({f:g,o:f});d.logDebug("Listening for: "+l);return this};this.trigger=function(a,e){var f=b(a);d.logDebugWithTrace("Trigger: "+ f,e);var f=c[f],k;if(f){for(k=0;k<f.length;k++)f[k].f.call(f[k].o,e);return this}};this.triggerThrottledEvent=function(a,g,f){var k=b(a);d.logDebugWithTrace("Trigger (throttled): "+k,g);var l=c[k];a=e[k];if(l)return f===r&&(f=100),a&&(clearTimeout(a),delete e[k]),a=setTimeout(function(){var a;for(a=0;a<l.length;a++)l[a].f.call(l[a].o,g);delete e[k]},f),e[k]=a,this}}});h.$Nav.when("$","sx.iss.utils","sx.iss.Events","NavDomApi","sx.iss.DebugUtils","sx.iss.IssContext").build("sx.iss.PublicApi", function(d,a,b,c,e,m){function g(a){c.getSearchBox().focus(a)}function f(a){a===r?c.getSearchBox().blur():c.getSearchBox().blur(a)}var k=/node\s*=\s*([\d]+)/,l=/bbn\s*=\s*([\d]+)/,n=/^me=([0-9A-Z]*)/,p=/^\s+/,y=/\s+/g;return{searchAlias:function(){return c.getAliasFromDropdown()},searchNode:function(){var a=c.getAliasDropdown().val().match(k);return a?a[1]:null},bbn:function(){var a=c.getAliasDropdown().val().match(l);return a?a[1]:null},merchant:function(){var a=c.getAliasDropdown().val().match(n); return a?a[1]:null},encoding:function(){var a=c.getForm().find('input[name^="__mk_"]');if(a.length)return[a.attr("name"),a.val()]},keyword:function(a){return a!==r?c.setKeyword(a):c.getKeyword().replace(p,"").replace(y," ")},submit:function(a){e.logDebugWithTrace("Attaching the submit event handler to the form...");c.getForm().submit(a)},suggest:function(c){a.eventBus.listen(b.globals.suggestionsRendered,function(a){var b=[];d.each(a.suggestions,function(a,c){"separator"!==c.type&&b.push(c)});c(a.searchTerm, b)})},onFocus:g,onBlur:f,focus:g,blur:f,keydown:function(a){var b="#"+c.getSearchBox().attr("id");c.getForm().delegate(b,"keydown",a)},setupFastLab:function(a){e.logDebugWithTrace("Fastlab",a);m.setFastlabs(a)}}});h.$Nav.when("$","NavDomApi","sx.iss.utils","sx.iss.DebugUtils","sx.iss.IssContext").build("sx.iss.Weblab",function(d,a,b,c,e){return function(a,d){function f(f,d){var g={keywords:d?d.searchTerm:r,alias:b.suggestionUtils.getAliasWithDeepNodeAliasBacked(a.deepNodeISS),fastlabs:e.getTriggeredFastlabs().join("|")}; e.clearTriggeredFastlabs();a.hasOwnProperty(f)&&(a[f](g),c.logDebug("Triggering: "+f+" weblabs"))}b.eventBus.listen(d.keydown,function(a){f("doCTWKeydown",a)});b.eventBus.listen(d.suggestionsRendered,function(a){f("doCTWDisplay",a)})}});h.$Nav.when("sx.iss.DebugUtils","sx.iss.DomUtils").build("sx.iss.IssContext",function(d,a){var b,c,e=[];return{getFastlabs:function(){return c},setFastlabs:function(a){c=a},getTriggeredFastlabs:function(){return e},clearTriggeredFastlabs:function(){e= []},addTriggeredFastlabs:function(a){e=e.concat(a)},getConfiguration:function(){return b},setConfiguration:function(a){b=a}}});h.$Nav.when("$","sx.iss.utils","sx.iss.SuggestionTypes","NavDomApi","sx.iss.ReftagBuilder","sx.iss.DebugUtils").build("sx.iss.Reftag",function(d,a,b,c,e,m){return function(b,f,d){function l(a){return(new e).build(a,d.hasOwnProperty("shouldAddImeTag")&&d.shouldAddImeTag())}function n(a){if(a.suggestions===r||a.searchTerm===r)m.logDebug('"suggestions" or "searchTerm" is undefined', a);else{var b=e.CONSTANTS.noSearchTermMatchInResults,c=a.searchTerm;a=a.suggestions;for(var f=0;f<a.length;f++)if(c===a[f].keyword){b=e.CONSTANTS.searchTermMatchInResults;break}t(b)}}function p(){t(e.CONSTANTS.noResults)}function y(a){a.suggestion===r||a.searchTerm===r?m.logDebug('"suggestion" or "searchTerm" is undefined',a):t(l(a))}function t(a){var b=/(ref=[\-\w]+)/,f=/(dd_[a-z]{3,4})(_|$)[\w]*/,d=c.getForm(),k=d.attr("action");b.test(k)?k=f.test(k)?k.replace(f,"$1_"+a):k.replace(b,e.CONSTANTS.reftagBase+ a):("/"!==k.charAt(k.length-1)&&(k+="/"),k+=a);d.attr("action",k)}f===r&&(f={});d===r&&(d={});a.eventBus.listen(b.selectionChange,y);a.eventBus.listen(b.suggestionsRendered,n);a.eventBus.listen(b.noSuggestions,p);return{create:l,updateReftagAfterRender:n,updateReftagAfterSelection:y,updateReftagAfterNoSuggestions:p,updateFormActionWithReftag:t}}});h.$Nav.when("$","sx.iss.SuggestionTypes","sx.iss.DataAttributes","NavDomApi","sx.iss.DebugUtils").build("sx.iss.ReftagBuilder",function(d, a,b,c,e){function m(){function f(a){a!==r&&p.push(a);return this}function k(a){a=c.getOption(a.data("alias")).val();var b=a.indexOf("=");if(-1===b)return"";a=a.substr(b+1);var b=a.indexOf("-"),e=a.substr(0,3);return b?e:e+a.charAt(b+1)}function m(d,l){var q=d.suggestion,x=d.searchTerm,h=d.previousSearchTerm;e.isDebugModeOn()&&e.logDebugWithTrace("Build reftag for search term: "+x+" pre term:"+h,q);var z=n(q).reftag;f(g.base);l&&f(g.ime);var v;!0===q.data(b.fallback.name)?v=g.fallback:!0===q.data(b.spellCorrected.name)&& (v=g.spellCorrected);v!==r?f(v):(q.data("type")===a.department.name&&(f(a.a9Xcat.reftag),f(q.data("alias"))),f(z));z=c.getDropdown().find(".s-suggestion");v=z.index(q)+1;e.isDebugModeOn()&&e.logDebugWithTrace("Display position of suggestion is: "+v,{suggestion:q,suggestions:z,suggestionsIndex:z.index(q),suggestionsPrevAll:q.prevAll().length,suggestionsPrevAllWithSelector:q.prevAll(".s-suggestion").length});f(v);q===r?(f(g.undefinedSugg),q=k(q),f(q)):f(h?h.length:x.length);return p.join(g.separator)} function n(b){var c=a.a9;d.each(a,function(a,e){if(b.attr("data-type")===e.name)return c=e,!1});return c}function k(a){a=a.val();var b=a.indexOf("=");if(""!==a||-1===b)return"";a=a.substr(b+1);var b=a.indexOf("-")+1,c=a.substr(0,3);return b?c:c+a.charAt(b)}var p=[];return{build:m,buildFull:function(a,b){return g.reftagBase+m(a,b)}}}var g={base:"ss",fallback:"fb",spellCorrected:"sc",undefinedSugg:"dd",reftagBase:"ref=nb_sb_",noResults:"noss",searchTermMatchInResults:"noss_1",noSearchTermMatchInResults:"noss_2", ime:"ime",separator:"_"};m.CONSTANTS=g;return m});h.$Nav.when("$","NavDomApi","sx.iss.DebugUtils").build("sx.iss.suggestionUtils",function(d,a,b){function c(a,b){return a.toLowerCase().indexOf(b.toLowerCase())}function e(a,b,c){return{bprefix:a.substr(0,b),prefix:a.substr(b,c),suffix:a.substr(b+c)}}function m(a){return a?a.replace(k,""):r}function g(b){var c;"undefined"===typeof a.getAliasFromDropdown()&&b&&(c=b.searchAliasAccessor(d));return c}var f=/\s/,k=/#(S|E)#/g;return{getPrefixPos:c, getPrefixPosMultiWord:function(a,b){var c=a.toLowerCase().indexOf(b.toLowerCase()),e;if(-1===c)return-1;if(0===c)return 0;e=a[c-1];return" "===e||"\t"===e||e.match(f)?c:-1},splitStringForDisplay:e,markHighlight:function(a,b){var f=c(b,a);return-1<f?(f=e(b,f,a.length),f.bprefix+"#S#"+f.prefix+"#E#"+f.suffix):b},removeHighlightMark:m,splitHighlightedString:function(a){if(a&&6<a.length){var b=a.indexOf("#S#"),c=a.indexOf("#E#");if(-1<b&&-1<c&&b+3<c)return{bprefix:m(a.substr(0,b)),prefix:m(a.substr(b+ 3,c-b-3)),suffix:m(a.substr(c+3))}}return r},getAliasWithDeepNodeAliasBacked:function(b){var c=a.getAliasFromDropdown();return c?c:g(b)},getDeepNodeAlias:g,getDeepNodeCategoryName:function(b,c){var e;b&&(e=a.getCategoryNameFromDropdown(b)||c.searchAliasDisplayNameAccessor());return e},shouldRequestSuggestions:function(c,e){var f;if(("department"===c||"a9"===c)&&e.hasOwnProperty("aliases")){var d=a.getAliasFromDropdown()||g(e.deepNodeISS);f="*"===e.aliases||-1<e.aliases.indexOf(d);b.logDebug("Should we request suggestions for: alias : "+ d+" provider : "+c+"? "+f);return f}return!0}}});h.$Nav.when("sx.iss.TimingProvider.instance","sx.iss.EventBus.instance","sx.iss.suggestionUtils","sx.iss.DependenciesMet").build("sx.iss.utils",function(d,a,b){return{timingProvider:d,eventBus:a,suggestionUtils:b,now:function(){return(new Date).getTime()},escapeRegExp:function(a){return a.replace(/([.*+?\^${}()|\[\]\/\\])/g,"\\$1")}}});h.$Nav.when("$").build("sx.iss.DomUtils",function(d){var a=/\+/g,b=/^\s+/;(function(){Array.prototype.indexOf|| (Array.prototype.indexOf=function(a,b){var d=this.length>>>0,g=Number(b)||0,g=0>g?Math.ceil(g):Math.floor(g);for(0>g&&(g+=d);g<d;g++)if(g in this&&this[g]===a)return g;return-1})})();return{isHoveredClass:"is-hovered",getKeyword:function(a){return(a=a.val())?a.replace(b,""):a},isElHoveredOver:function(a){return a.hasClass("is-hovered")},hoverOverEl:function(a){return a.addClass("is-hovered")},hoverOutEl:function(a){return a.removeClass("is-hovered")},isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)}, getFormParams:function(b){b=b.split("?");for(var e=1<b.length?b[1]:r,e=e?e.split("&"):[],d=e.length,g;0<d--;)g=e[d].split("="),e[d]={name:g[0],value:g[1].replace(a," ")};return{uri:b[0],formParams:e}},suggestionClass:".s-suggestion",hiddenInputValue:"frmDynamic",hiddenInputClass:".frmDynamic",areAnySuggestionsHoveredOver:function(a){return 0<a.find(".is-hovered").length},getCursorPosition:function(a){a=a.get(0);if("selectionStart"in a)return a.selectionStart;if(document.selection){a.focus();var b= document.selection.createRange(),d=b.text.length;b.moveStart("character",-a.value.length);return b.text.length-d}return-1}}});h.$Nav.build("sx.iss.DebugUtils",function(){function d(a){if(a&&0<a.length){a=a.substring(1).split("&");for(var b=0;b<a.length;b++){var c=a[b].split("=");if("debug"===c[0]){for(var d in e)e.hasOwnProperty(d)&&(e[d]=-1!==c[1].indexOf(d)?!0:!1);break}}}}function a(){return e.iss||e.isstrace}function b(){return e.isstrace}function c(b,c){a()&&h.console&&(c!==r?console.debug(b, c):console.debug(b))}var e={iss:!1,isstrace:!1,noiss:!1,isspolyfill:!1,isscf:!1};d(h.location.search);return{init:d,logDebug:c,logDebugWithTrace:function(a,e){c(a,e);b()&&console.trace()},isDebugModeOn:a,isDebugModeOnWithTrace:b,isDisableISS:function(){return e.noiss},isUsingPolyFill:function(){return e.isspolyfill},isQIAEnabled:function(){return e.isscf}}});h.$Nav.build("sx.iss.ObjectUtils",function(){return{freeze:function(d){Object.freeze&&d&&Object.freeze(d)}}});h.$Nav.when("$", "sx.iss.DebugUtils").run(function(d,a){a.isDisableISS()||(d.fn.delegate&&!a.isUsingPolyFill()||d.extend(d.fn,{delegate:function(b,c,e){return this.bind(c,function(c){var g=d(c.target);if(g.is(b)||0<g.parents(b).length)return a.logDebug("delegate ",{selector:b,target:g,event:c}),e.apply(g,arguments)})}}),h.$Nav.declare("sx.iss.DependenciesMet"))});h.$Nav.when("sx.iss.DepartmentDataFormatter").build("sx.iss.DepartmentData",function(d){var a=[["instant-video","Amazon Video",["Amazon","Instant", "Video","movies","rentals"]],["appliances","Appliances",["Appliances"]],["mobile-apps","Apps for Android",["Apps","Android","mobile"]],["arts-crafts","Arts, Crafts & Sewing",["arts","crafts","sewing"]],["automotive","Automotive",["automotive","cars"]],["baby-products","Baby Products",["baby","products"]],["beauty","Beauty",["beauty","makeup","hair"]],["stripbooks","Books",["books","textbooks","rentals"]],["mobile","Cell Phones & Accessories","cell phones mobile cases iphone galaxy nexus".split(" ")], ["collectibles","Collectibles & Fine Art",["collectibles","fine","art"]],["computers","Computers",["computers","pc","laptop","desktop"]],["electronics","Electronics",["electronics"]],["financial","Credit Cards",["credit","cards"]],["gift-cards","Gift Cards Store",["gift","cards"]],["grocery","Grocery & Gourmet Food",["grocery","gourmet","food"]],["hpc","Health & Personal Care",["health","personal","care"]],["garden","Home & Kitchen",["home","kitchen","furniture","art"]],["industrial","Industrial & Scientific", ["Industrial","Scientific"]],["digital-text","Kindle Store",["kindle","store","ebooks"]],["magazines","Magazine Subscriptions",["magazines","subscriptions"]],["movies-tv","Movies & TV","movies;tv;dvds;vhs;video;blu ray;bluray;blu-ray".split(";")],["digital-music","MP3 Music",["mp3","music"]],["popular","Music",["music","cds","autorip","vinyl"]],["mi","Musical Instruments",["musical","instruments","guitars","dj"]],["office-products","Office Products",["office","products","school","toner"]],["lawngarden", "Patio, Lawn & Garden",["patio","lawn","garden"]],["pets","Pet Supplies","pet supplies dogs cats birds fish".split(" ")],["software","Software",["software"]],["sporting","Sporting & Outdoors",["sporting","outdoors","sports"]],["tools","Tools & Home Improvement",["tools","home","improvement"]],["toys-and-games","Toys & Games",["toys","games"]],["videogames","Video Games","video games xbox ps3 ps4 wii playstation".split(" ")],["wine","Wine",["wine"]],["pantry","Prime Pantry",["prime","pantry"]]],b= [["fashion","Clothing, Shoes & Jewelry","clothing clothes luggage hats shirts jacket wallets sunglasses jewelry shoes handbags sandals boots watches".split(" ")],["fashion-mens","Men's Clothing, Shoes & Jewelry","mens;clothing;clothes;shoes;jewelry;mens clothing;mens shoes;mens jewelry;watches;mens watches".split(";")],["fashion-womens","Women's Clothing, Shoes & Jewelry","womens;clothing;clothes;shoes;jewelry;womens clothing;womens shoes;womens jewelry;watches;womens watches".split(";")],["fashion-baby", "Baby Clothing, Shoes & Jewelry","baby;clothing;clothes;shoes;jewelry;baby clothing;baby shoes;baby jewelry".split(";")],["fashion-boys","Boys Clothing, Shoes & Jewelry","boys;clothing;clothes;shoes;jewelry;boys clothing;boys shoes;boys jewelry".split(";")],["fashion-girls","Girls' Clothing, Shoes & Jewelry","girls;clothing;clothes;shoes;jewelry;girls clothing;girls shoes;girls jewelry".split(";")]],c=[["jewelry","Jewelry",["jewelry"]],["shoes","Shoes",["shoes","handbags","sandals","boots"]],["apparel", "Clothing & Accessories","clothing clothes hats shirts jacket wallets sunglasses".split(" ")]];return{getData:function(e){var m=a;e="undefined"!==typeof e&&e.hasOwnProperty("isWayfindingEnabled")&&1===e.isWayfindingEnabled?b:c;m=m.concat(e);return d.format(m)}}});h.$Nav.build("sx.iss.DepartmentDataFormatter",function(){return{format:function(d){for(var a=[],b=0;b<d.length;b++){var c=d[b];a.push({id:c[0],alias:c[0],keyword:"",type:"department",store:c[1],name:"",triggerWords:c[2],sn:!1})}return a}}}); h.$Nav.when("sx.iss.ObjectUtils").build("sx.iss.SuggestionTypes",function(d){var a={a9:{name:"a9",reftag:"i",templateId:"s-suggestion"},a9Xcat:{name:"a9-xcat",reftag:"c",templateId:"s-suggestion"},a9XOnly:{name:"a9-xcat-only",reftag:"xo",source:"xo",templateId:"s-suggestion"},a9Corpus:{name:"a9-corpus",reftag:"cp",reftagTemplate:"REF_TAG",templateId:"s-corpus"},department:{name:"department",reftag:"deptiss",templateId:"s-department"}};d.freeze(a);return a});h.$Nav.when("sx.iss.ObjectUtils").build("sx.iss.InfoTypes", function(d){var a={actor:"actor",author:"author",director:"director",seasonTitle:"season_title",title:"title"};d.freeze(a);return a});h.$Nav.build("sx.iss.DataAttributes",function(){return{fallback:{name:"isfb"},spellCorrected:{name:"issc"}}});h.$Nav.build("sx.iss.TimingEvents",function(){return{latency:{group:"Latency",events:{timeToDisplay:"timeToDisplay"}}}});h.$Nav.when("sx.iss.DebugUtils").build("sx.iss.Events",u);h.$Nav.when("sx.iss.ObjectUtils").build("sx.iss.Platform", function(d){var a={name:"desktop",cid:"amazon-search-ui",callback:"String",needExtraParams:!0};d.freeze(a);return a});h.$Nav.when("$").build("sx.iss.TimingProvider.instance",function(d){return new function(){var a={};this.startTimer=function(b,c){a[b]||(a[b]={});a[b][c]={start:+new Date}};this.stopTimer=function(b,c){var e=a[b]&&a[b][c];if(!e)return-1;e.end=+new Date;return e.end-e.start};this.getTimings=function(b){return a[b]};this.getTimingStats=function(b){var c={name:b},e=0,m=0,g=r,f=r,k=0,l= 0,n=[],p=0,h=0;if(!a[b])return r;d.each(a[b],function(a,b){if(b.start&&b.end){l=b.end-b.start;n.push(l);k++;m+=l;if(!g||l<g)g=l;if(!f||l>f)f=l}});n.sort();c.n=k;c.avg=m/k;c.min=g;c.max=f;c.med=1===k?n[0]:k%2?(n[Math.floor(k/2)]+n[Math.ceil(k/2)])/2:n[k/2];for(e=0;e<k;e++)p=n[e]-c.avg,p*=p,h+=p;c.stddev=Math.sqrt(h/k);return c};this.getTimingWithDisplayLatency=function(b,c){var e=a[b]&&a[b][c];return e?e.end-e.start+100:-1}}});h.$Nav.when("$","sx.iss.utils","NavDomApi","sx.iss.Events", "sx.iss.SuggestionTypes","sx.iss.A9SuggestionQueryConstructors","sx.iss.A9SuggestionResultsProcessors","sx.iss.DebugUtils","sx.iss.FilterIss").build("sx.iss.A9SuggestionProvider",function(d,a,b,c,e,m,g,f,k){var l=e.a9;return function(b,p,h){function t(b,k){var g=++x,m,l;D=document.getElementsByTagName("head").item(0);z="JscriptId"+g;v=document.createElement("script");v.setAttribute("type","text/javascript");v.setAttribute("charset","utf-8");v.setAttribute("src",k);v.setAttribute("id",z);v.onload= v.onreadystatechange=function(){if(!(m||this.readyState!==r&&"loaded"!==this.readyState&&"complete"!==this.readyState)){m=!0;if("undefined"!==typeof completion){var k=q(),t=k&&-1!==d.inArray(k,A)?e.a9Corpus:e.a9;l=w.getResultsProcessor(t.name).processResults(b,k,completion);u.removeFilteredAliases(l)}this.onload=this.onreadystatechange=null;try{D.removeChild(v)}catch(n){f.logDebug(n)}a.timingProvider.stopTimer("a9",g);k={searchTerm:b,suggestionSets:l};t=c.createEvent("a9",h.suggestionsReady);a.eventBus.trigger(t, k)}};a.timingProvider.startTimer("a9",g);D.appendChild(v)}function q(){var b="aps",b=[],b=p.aliases;return b=(b=p.implicitAlias?[p.implicitAlias]:"string"===typeof b?b.split(","):b)&&1===b.length?b[0]:a.suggestionUtils.getAliasWithDeepNodeAliasBacked(p.deepNodeISS)}var x=0,D,z,v,B=new m(p),w=new g(p),u=new k(p),A=p.issCorpus||[];a.eventBus.listen(h.a9SuggestionsNeeded,function(b){if(a.suggestionUtils.shouldRequestSuggestions("a9",p))if(b&&b.length){var f=q(),k=f&&-1!==d.inArray(f,A)?e.a9Corpus:e.a9; (f=B.getUrlConstructor(k.name).constructUrl(b,f))&&t.call(this,b,f)}else b={searchTerm:b,suggestions:[]},f=c.createEvent("a9",h.suggestionsReady),a.eventBus.trigger(f,b)},this);return{getName:function(){return"a9"},processResults:w.getResultsProcessor(l.name).processResults}}});h.$Nav.when("$","sx.iss.utils","NavDomApi","sx.iss.DomUtils","sx.iss.SuggestionTypes","sx.iss.Platform","sx.iss.DebugUtils","sx.iss.IssContext").build("sx.iss.A9SuggestionQueryConstructors",function(d,a,b,c,e, m,g,f){return function(a){function l(a){return{constructUrl:function(){g.logDebugWithTrace("Invalid suggestion type provided: "+a+" when asking for query constructors");return""}}}function n(a){var e=c.getCursorPosition(b.getSearchBox());return-1<e?{q:encodeURIComponent(a.substring(0,e).replace(/^\s+/,"").replace(/\s+/g," ")),qs:encodeURIComponent(a.substring(e))}:{q:encodeURIComponent(a)}}function p(a){var b="?";d.each(a,function(a,c){b+=a+"="+c+"&"});return b}function y(b){var c={xcat:a.xcat,cf:a.cf}; a.fb!==r&&(c.fb=a.fb);a.np!==r&&(c.np=a.np);a.issPrimeEligible&&-1!==d.inArray(b,a.issPrimeEligible)&&(c.pf=1,c.fb=0);c.sc=1;return c}var t=a.protocol||h.parent.document.location.protocol||"http:";"file:"===t&&(t="http:");var q={};q[e.a9.name]=new function(){var b=t+"//"+a.src,c={method:"completion",mkt:a.mkt,r:a.requestId,s:a.sessionId,p:a.pageType,l:a.language,sv:m.name,client:m.cid,x:m.callback};return{constructUrl:function(a,e){var k=d.extend({},c,{"search-alias":e},n(a));m.needExtraParams&&d.extend(k, y(e));f.getFastlabs()&&d.extend(k,{w:f.getFastlabs()});return b+p(k)}}};q[e.a9Corpus.name]=new function(){var b=t+"//"+a.src.replace("/search","/v2.0"),c={"num-corpus":10,"num-query":5,client:m.cid,m:a.obfMkt,fb:1,xcat:1,method:"completion",cf:0,sc:1,conf:1,x:m.callback};return{constructUrl:function(a,e){var f=d.extend({},c,{"search-alias":e},n(a));return b+p(f)}}};return{getUrlConstructor:function(a){return q.hasOwnProperty(a)?q[a]:new l(a)}}}});h.$Nav.when("$","sx.iss.utils","NavDomApi", "sx.iss.DomUtils","sx.iss.SuggestionTypes","sx.iss.InfoTypes","sx.iss.DebugUtils","sx.iss.IssContext").build("sx.iss.A9SuggestionResultsProcessors",function(d,a,b,c,e,m,g,f){return function(d){function l(a){return{processResults:function(b,c,e){g.logDebugWithTrace("Invalid suggestion type provided: "+a+" when asking for result processing");return""}}}function n(b,c,e,f,d,k,g){var m=a.suggestionUtils.getPrefixPos(f,e),l;d||-1===m?(e=f,m=l=""):(l=a.suggestionUtils.splitStringForDisplay(f,m,e.length), e=l.bprefix,m=l.prefix,l=l.suffix);return{type:k,isSpellCorrected:d,bprefix:e,prefix:m,suffix:l,keyword:f,isFirst:0===g,alias:b,store:c,isDeepNode:b!==r&&c!==r}}function p(a,b,c,f){a.store=b.name;a.alias=b.alias;a.type=c?e.a9XOnly.name:e.a9Xcat.name;a.isFallback=f;return a}function h(a,c,f){c.isFirst=!1;f?c.type=e.a9XOnly.name:(c.type=e.a9Xcat.name,f=b.getAliasFromDropdown(),"aps"!==f&&(c.store=b.getCategoryNameFromDropdown(f),c.alias=f,a.push(t(c))));c.store=b.getCategoryNameFromDropdown("aps"); c.alias="aps";a.push(t(c))}function t(a,c){var f={type:a.type,bprefix:a.bprefix,prefix:a.prefix,suffix:a.suffix,keyword:a.keyword,alias:a.alias||c,isSpellCorrected:a.isSpellCorrected,isFallback:a.isFallback,isDeepNode:a.isDeepNode},g;if(f.type===e.a9Xcat.name||f.type===e.a9XOnly.name||!0===f.isDeepNode){if(a.isFirst||!d.noXcats)a.store?g=a.store:a.isFirst&&(g=b.getCategoryNameFromDropdown())}else g=r;f.store=g;g=f.alias;var m="/s?k="+encodeURIComponent(a.keyword);typeof g!==r&&(m+="&i="+encodeURIComponent(g)); f.url=m;return f}var q={};q[e.a9.name]=new function(){var b=e.a9.name;return{processResults:function(g,m,l){var B=l[1],w=l[2]||[];l=l[3]||[];var q=0,u=[],Q=[],N,H,r;r=!1;for(var K=0;K<w.length;K++){var F=w[K];if(F.hasOwnProperty("source"))for(var F=F.source,G=0;G<F.length;G++)if("fb"===F[G]){r=!0;break}}K=!1;for(F=0;F<w.length;F++)if(G=w[F],G.hasOwnProperty("nodes")&&0<G.nodes.length){K=!0;break}if(F=d.hasOwnProperty("cf")&&d.cf)for(F=!1,G=0;G<w.length;G++){var E=w[G];if(E.hasOwnProperty("nodes")&& 0<E.nodes.length&&E.hasOwnProperty("source")&&c.isArray(E.source)&&"xo"===E.source[0]){F=!0;break}}d.deepNodeISS&&(N=a.suggestionUtils.getDeepNodeAlias(d.deepNodeISS),H=a.suggestionUtils.getDeepNodeCategoryName(N,d.deepNodeISS));G="undefined"!==typeof N;for(E=0;E<B.length;E++){var R=n(N,H,g,B[E],w&&w[E]&&"1"===w[E].sc,b,E);r||u.push(t(R,m));if(!d.noXcats&&K){r||0!==E||(G||h(Q,R,F),!F&&G||u.shift());for(var C=w[E],T=C&&C.source&&"fb"===C.source[0],C=C.nodes||[],I=0;I<C.length&&4>q;I++)R=p(R,C[I],F, T),Q.push(t(R,m)),q++}}g={};g[e.a9.name]=u;g[F?e.a9XOnly.name:e.a9Xcat.name]=Q;0<l.length&&l[0].hasOwnProperty("t")&&f.addTriggeredFastlabs(l[0].t);return g}}};q[e.a9Corpus.name]=new function(){function b(c,f,g,m,l,t,x){f=n(f,r,g,m,l,e.a9Corpus.name,x);if(g=a.suggestionUtils.splitHighlightedString(m))f.bprefix=g.bprefix,f.prefix=g.prefix,f.suffix=g.suffix;m=a.suggestionUtils.removeHighlightMark(m);f.keyword=m;f.text=m;f.url="/dp/"+c+"/"+e.a9Corpus.reftagTemplate+"?ie=utf8&keywords="+encodeURIComponent(m); t&&(f.primeText=d.primeText);return f}function c(a){for(var b=[],e=0;e<a.length;e++)b.push(a[e].field);return b}return{processResults:function(f,g,l){var q=[],u=[];l=l.suggs;var A,r;if(0===l.length)return[];for(var N=l.length,H=0;H<l.length;H++)if(l[H].hasOwnProperty("corpus")){var J=c(l[H].source);(0<=J.indexOf(m.title)||0<=J.indexOf(m.seasonTitle))&&1<l[H].corpus.length&&(l[H].alwaysShowDirector=!0)}else{N=H;break}d.deepNodeISS&&(A=a.suggestionUtils.getDeepNodeAlias(d.deepNodeISS),r=a.suggestionUtils.getDeepNodeCategoryName(A, d.deepNodeISS));for(H=N;H<l.length&&4>u.length;H++){var K=l[H];if(J=K.xcats)for(var F=J.hasOwnProperty("sc")&&0!==J.sc,G=K.hasOwnProperty("fb")&&0!==K.fb,E=0;E<J.length&&4>u.length;E++){var C=u,O=A,T=J[E],I=G,S=H-N+E,M=n(O,r,f,K.sugg,F,e.a9Xcat.name,S),M=p(M,T,!1,I);0!==S||I||"undefined"!==typeof O?C.push(t(M)):h(C,M)}}A=10-u.length;for(H=0;H<N&&q.length<A;H++)for(K=l[H],r=K.corpus,J=c(K.source),E=0;E<r.length&&10>q.length;E++){F=r[E];G=K;C=F.asin_info;O=J;T=f;I="";for(S=0;S<C.length;S++){var P=C[S], M=P.type,P=P.value;if(M===m.title||M===m.seasonTitle)I+=a.suggestionUtils.markHighlight(T,P[0]);G.alwaysShowDirector&&M===m.director?I+=d.directedByText.replace("{director}",P[0]):0<=O.indexOf(M)&&0<=P.indexOf(G.sugg)&&(P=a.suggestionUtils.markHighlight(T,G.sugg),M===m.actor?I+=d.starringText.replace("{actor}",P):M===m.director&&(I+=d.directedByText.replace("{director}",P)))}G=I;C=F.hasOwnProperty("is_prime")&&1===F.is_prime;q.push(b(F.asin,g,f,G,!1,C,E))}f={};f[e.a9Corpus.name]=q;f[e.a9Xcat.name]= u;return f}}};return{getResultsProcessor:function(a){return q.hasOwnProperty(a)?q[a]:new l(a)}}}});h.$Nav.when("$","sx.iss.utils","sx.iss.DepartmentData","NavDomApi","sx.iss.Events").build("sx.iss.DepartmentSuggestionProvider",function(d,a,b,c,e){function m(g,f){function k(c){if(a.suggestionUtils.shouldRequestSuggestions("department",g)){var k={searchTerm:c,suggestionSets:{}},y=[],t=new RegExp("\\b"+a.escapeRegExp(c)+"(.*)","i");if(3<=c.length&&m(c)){var q,x,u,z;d.each(b.getData(g),function(b, e){z=u=x="";if(t.test(e.triggerWords)||t.test(e.store)){e.position=0===y.length?0:y.length+1;var f=a.suggestionUtils.getPrefixPos(e.store,c);-1===f?z=e.store:(q=a.suggestionUtils.splitStringForDisplay(e.store,f,c.length),x=q.bprefix,u=q.prefix,z=q.suffix);e.beforePrefix=x;e.prefix=u;e.suffix=z;y.push(e);if((f=h.ue)&&f.count){var d="department"+e.alias.replace("-","");f.count(d,f.count(d)+1)}}if(3===y.length)return!1})}k.suggestionSets.department=y;var v=e.createEvent("department",f.suggestionsReady); a.eventBus.trigger(v,k)}}function m(a){return c.getKeyword().length===a.length}(function(){var b=e.createEvent("department",f.suggestionsNeeded);a.eventBus.listen(b,k)})()}m.prototype.getName=function(){return"department"};return m});h.$Nav.when("sx.iss.utils").build("sx.iss.HelpSuggestionProvider",function(d){var a=[{type:"help",pat:/^return/i,text:"Looking for help with returns? Try this.",url:""},{type:"help",pat:/^track/i,text:"Looking for help with tracking? Try this.",url:""},{type:"help",pat:/^gift[\s*]w/i, text:"Looking for help with gift wrapping? Try this.",url:""},{type:"help",pat:/^canc/i,text:"Looking for help with order cancellation? Try this.",url:""},{type:"help",pat:/^refu[\s*]/i,text:"Looking for help with refund? Try this.",url:""},{type:"help",pat:/^passw[\s*]/i,text:"Looking for help with passwords? Try this.",url:""},{type:"help",pat:/^log(ging\s*)?o/i,text:"Looking for help with logging out? Try this.",url:""}];return function(){this.getName=function(){return"help"};d.eventBus.listen("help-suggestionsNeeded", function(b){var c,e=[];for(c=0;c<a.length;c++)b.match(a[c].pat)&&e.push(a[c]);d.eventBus.trigger("help-suggestionsReady",{searchTerm:b,suggestions:e})},this)}});h.$Nav.when("$","sx.iss.utils").build("sx.iss.RecentSearchSuggestionProvider",function(d,a){return function(b){var c=/[^\w]/;this.getName=function(){return"recent"};var e=u.createEvent("recent",b.suggestionsNeeded);a.eventBus.listen(e,function(e){var g=[];if(h.sx&&h.sx.searchsuggest&&h.sx.searchsuggest.searchedText){var f=h.sx.searchsuggest.searchedText, k={},l,n,p,y,t,q,x;x=e&&c.test(e)?d("<div></div>").text(e).html():e;for(y=0;y<f.length;y++)n=f[y].keywords,l=(l=n)&&c.test(l)?d("<div></div>").html(l).text():l,p=a.suggestionUtils.getPrefixPosMultiWord(n,x),k[n]||-1===a.suggestionUtils.getPrefixPosMultiWord(l,e)||(-1===p?(p=n,q=t=""):(t=a.suggestionUtils.splitStringForDisplay(n,p,x.length),p=t.bprefix,q=t.prefix,t=t.suffix),g.push({type:"recent",spellCor:!1,bprefix:p,prefix:q,suffix:t,keyword:l,originalKeywords:n,deleteUrl:f[y].deleteUrl}),k[n]=1)}f= u.createEvent("recent",b.suggestionsReady);a.eventBus.trigger(f,{searchTerm:e,suggestions:g})},this)}});h.$Nav.when("$","sx.iss.utils","sx.iss.TemplateEngine").build("sx.iss.SuggestionDisplayProvider",function(d,a,b){return function(a,e,m){var g,f;this.getDisplay=function(a){if(!g(a))return r;d.extend(a,m);return f(a)};g="string"===typeof a?function(b){return b.type===a}:a;f=b(e)}});h.$Nav.when("$","sx.iss.utils").build("sx.iss.SuggestionHighlightingProvider",function(d,a){return function(b){function c(a){a= a.currentTarget.id;k&&k.removeClass(k.attr("data-selected-class"));k=d("#"+a);f=parseInt(a.substr(6));k.addClass(k.attr("data-selected-class"))}function e(a){a=a.currentTarget.id;k&&k.attr("id")===a&&(k.removeClass(k.attr("data-selected-class")),k=r,f=-1)}var m=this,g,f=-1,k;a.eventBus.listen(b.suggestionsDisplayed,function(a){var b;g=a;f=-1;k=r;for(a=0;a<g.suggestions.length;a++)b=d("#"+g.suggestions[a].suggestionId),b.bind("mouseover",m,c).bind("mouseout",m,e)},this).listen(b.upArrowPressed,function(){g&& (k&&k.removeClass(k.attr("data-selected-class")),f--,-1===f?a.eventBus.trigger(b.suggestionSelected,{keyword:g.searchTerm}):(-2===f&&(f=g.suggestions.length-1),k=d("#issDiv"+f),k.addClass(k.attr("data-selected-class")),a.eventBus.trigger(b.suggestionSelected,g.suggestions[f])))},this).listen(b.downArrowPressed,function(){g&&(k&&k.removeClass(k.attr("data-selected-class")),f++,f===g.suggestions.length?(f=-1,a.eventBus.trigger(b.suggestionSelected,{keyword:g.searchTerm})):(k=d("#issDiv"+f),k.addClass(k.attr("data-selected-class")), a.eventBus.trigger(b.suggestionSelected,g.suggestions[f])))},this)}});h.$Nav.when("sx.iss.utils","sx.iss.SuggestionTypes","sx.iss.TemplateEngine").build("sx.iss.IssDisplayProvider",function(d,a,b){return function(c,e,m,g,f){function k(a){d.eventBus.trigger(g.suggestionsNeeded,a)}function l(b){var c=e.sequence(b);b=b.searchTerm;var k=h++;d.timingProvider.startTimer("IssDisplayProvider",k);if(0===c.length)d.eventBus.trigger(g.noSuggestions,b);else{for(var l=0,u=0;u<c.length;u++){var v= c[u];"separator"!==v.type&&(v.suggestionId="issDiv"+l,l++);var B=v,w="",w=!0===v.isDeepNode?w+"s-highlight-secondary":w+"s-highlight-primary";B.cssClasses=w;for(var L,B=0;B<m.length&&!(L=m[B],L=n(L,v),L=L.getDisplay(v));B++);v.display=L}l=c&&0<c.length&&c[0].type===a.a9Corpus.name&&f.hasOwnProperty("issCorpusSugText");l=p({suggestions:c,suggestionTitle:l?f.issCorpusSugText:f.hasOwnProperty("sugText")?f.sugText:""});d.timingProvider.stopTimer("IssDisplayProvider",k);d.eventBus.trigger(g.suggestionsReadyForDisplay, {searchTerm:b,display:l,suggestions:c})}}function n(a,b){var c=a;if(a.hasOwnProperty("provider")&&a.hasOwnProperty("partials")){for(c=0;c<a.partials.length;c++){var e=a.partials[c],f=e.provider.getDisplay(b);e.hasOwnProperty("formatter")&&(f=e.formatter.string.replace(e.formatter.toReplace,f));b[e.key]=f}c=a.provider}return c}var p=b(c),h=0;(function(){d.eventBus.listen(g.suggestionsReady,l,this);d.eventBus.listen(["parentFocused","searchTermChanged"],k,this)})();return{processPartials:n}}});h.$Nav.when("sx.iss.utils", "sx.iss.Events").build("sx.iss.ArraySuggestionProvider",function(d,a){return function(b,c){function e(b){for(var e=[],l=b.toLowerCase(),n=0;n<m.length;n++){var p=m[n];if(-1!==p.toLowerCase().indexOf(l)&&10>e.length){var p={term:p,searchTerm:b,url:g[n]},h=d.suggestionUtils.getPrefixPos(p.term,p.searchTerm),h=d.suggestionUtils.splitStringForDisplay(p.term,h,p.searchTerm.length),p={type:"array",bprefix:h.bprefix,prefix:h.prefix,suffix:h.suffix,keyword:p.searchTerm,url:p.url,isExactMatch:p.term===p.searchTerm}; e.push(p)}}b={searchTerm:b,suggestionSets:{array:e}};e=a.createEvent("array",c.suggestionsReady);d.eventBus.trigger(e,b)}var m=b[0],g=b[1];(function(){var b=a.createEvent("array",c.suggestionsNeeded);d.eventBus.listen(b,e,this)})();return{name:"array"}}});h.$Nav.when("$","sx.iss.utils","sx.iss.TimingEvents","sx.iss.TemplateEngine","NavDomApi","sx.iss.SuggestionTypes","sx.iss.ReftagBuilder").build("sx.iss.DesktopSearchBoxEventHandler",function(d,a,b,c,e,m,g){var f=e.getSearchApi();return function(k, l){function n(){u=!0;v||(v=!0)}function p(){z=!0}function y(a){e.activateSearchBox()}function t(a){e.deactivateSearchBox()}a.eventBus.listen(k.selectionChange,function(f){q===r&&(q=e.getAliasFromDropdown());if(!0===f.isScrollIntoSearchBox)f=f.previousSearchTerm,e.getIssPrefixElem().remove(),x.val(f),e.getAliasDropdown().val("search-alias="+q).trigger("change");else{var k=f.previousSearchTerm,g=a.timingProvider.getTimingWithDisplayLatency(b.latency.group,b.latency.events.timeToDisplay);k===r&&(k=e.getKeyword()); g=k+","+e.getOriginalAlias()+","+g;k=e.getIssPrefixElem();0<k.length?k.attr("value",g):(g=d('<input type="hidden"/>').attr("id","issprefix").attr("name","sprefix").attr("value",g),e.getForm().append(g));f=f.suggestion;var m=f.attr("data-alias"),k=e.getOption(m),g=e.getAliasDropdown(),m="search-alias="+m;0===k.length?(k=f.data("store"),k!==r&&""!==k&&g.append(c("s-option",{value:m,store:k}))):m=k.val();g.val(m).trigger("change");e.setKeyword(f.attr("data-keyword"))}});a.eventBus.listen(k.hideDropdown, function(b){!0!==u||!0!==z||27!==b.keyCode&&13!==b.keyCode?(e.hideDropdown(),e.getIssPrefixElem().remove(),q=r):(u=z=!1,a.eventBus.triggerThrottledEvent(k.suggestionsNeeded,e.getKeyword()))});a.eventBus.listen(k.suggestionClicked,function(b){var c=b.suggestion;a.eventBus.trigger(k.updateSearchBox,c);b={suggestion:c,searchTerm:e.getKeyword(),previousSearchTerm:b.previousSearchTerm};a.eventBus.trigger(k.selectionChange,b);e.hideDropdown();c.attr("data-type")===m.a9Corpus.name?(c=c.attr("data-url"), h.location=c.replace(m.a9Corpus.reftagTemplate,(new g).buildFull(b,v))):e.submitForm()});a.eventBus.listen(k.noSuggestions,function(){e.hideDropdown()});a.eventBus.listen(k.suggestionsNeeded,function(a){q=e.getAliasFromDropdown()});f===r&&(a.eventBus.listen(k.searchBoxFocusIn,y),a.eventBus.listen(k.searchBoxFocusOut,t));f!==r?(f.on("compositionstart",n),f.on("compositionend",p)):d("#navbar").delegate("#twotabsearchtextbox","compositionstart",n).delegate("#twotabsearchtextbox","compositionend",p); var q,x=e.getSearchBox(),u=!1,z=!1,v=!1;return{getWasCompositionUsed:function(){return v}}}});h.$Nav.when("sx.iss.utils").build("sx.iss.A9SearchSuggestionEventHandler",function(d){return function(a){var b;this.getDelegateReqs=function(){return{selectors:".a9_suggestion,.suggestion_with_query_builder",events:"click"}};this.handleEvent=function(c){var e=c.target||c.srcElement;c=parseInt(c.currentTarget.id.substr(6),10);e.className&&-1!=e.className.indexOf("suggest_builder")?d.eventBus.trigger(a.updateSearchTerm, b.suggestions[c].keyword):d.eventBus.trigger(a.suggestionClicked,{suggestion:b.suggestions[c]})};d.eventBus.listen(a.suggestionsDisplayed,function(a){b=a},this)}});h.$Nav.when("sx.iss.utils").build("sx.iss.RecentSearchSuggestionEventHandler",function(d){return function(a){function b(b){var c,e,k,l;c=location.protocol+"//"+location.host+b.deleteUrl;e=h.sx.searchsuggest.searchedText;for(k=0;k<e.length;k++)if(e[k].keywords===b.originalKeywords){l=k;break}-1!==l&&e.splice(l,1);d.eventBus.trigger(a.focusOnParent); var n;h.XMLHttpRequest?n=new XMLHttpRequest:h.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLHTTP"));if(n&&c)try{n.open("GET",c,!0),n.send(null)}catch(p){}}var c=this,e;this.getDelegateReqs=function(){return{selectors:".recent_search_suggestion",events:"click"}};this.handleEvent=function(m){var g=m.target||m.srcElement;m=parseInt(m.currentTarget.id.substr(6),10);g.className&&-1!=g.className.indexOf("iss_sh_delete")?b.call(c,e.suggestions[m]):d.eventBus.trigger(a.suggestionClicked,{suggestion:e.suggestions[m]})}; d.eventBus.listen(a.suggestionsDisplayed,function(a){e=a},this)}});h.$Nav.when("$","sx.iss.utils","sx.iss.DomUtils","sx.iss.TimingEvents","sx.iss.TemplateEngine","sx.iss.DebugUtils").build("sx.iss.SearchBoxEventHandler",function(d,a,b,c,e,m){var g=[37,38,39,40,91,92,93,192];return function(c,e,l){function n(c){a.eventBus.trigger(l.keydown);var e=c.keyCode,f=40===e,k=38===e,g;if(z.find("#suggestions-template").is(":visible")){if(f||k){B===r&&(B=b.getKeyword(v));var t=z.find(".s-suggestion"), n=t.index(d(".s-selected"));(k=0===n&&k||n+1===t.length&&f)?z.find(".s-suggestion").removeClass("s-selected"):(m.logDebug("highlighting suggestion"),g=z.find(".s-suggestion"),t=g.index(x()),n=g.length,f?(f=-1,-1===t||t===n-1?f=0:t<n&&(f=t+1)):(f=-1,1>t?f=n-1:t<=n&&(f=t-1)),g.eq(t).removeClass("s-selected"),f=g.eq(f),f.addClass("s-selected"),g=f);a.eventBus.trigger(l.selectionChange,{suggestion:g,isScrollIntoSearchBox:k,searchTerm:B,previousSearchTerm:w});""!==v.val()&&c.preventDefault()}13===e&&(e= x(),0<e.length&&(a.eventBus.trigger(l.suggestionClicked,{suggestion:e,searchTerm:B,previousSearchTerm:w}),c.preventDefault()))}}function p(c){c=c.keyCode;13===c?q(c):27===c?q(c):(B=b.getKeyword(v),B!==w&&-1===g.indexOf(c)&&(B===r||""===B?(q(),w=""):(a.eventBus.triggerThrottledEvent(l.suggestionsNeeded,B),w=B)))}function h(b){setTimeout(function(){return function(){q();a.eventBus.trigger(l.searchBoxFocusOut)}}(),300)}function t(b){a.eventBus.trigger(l.searchBoxFocusIn)}function q(b){B=r;a.eventBus.trigger(l.hideDropdown, {keyCode:b})}function x(){return z.find(".s-suggestion.s-selected")}var u,z,v,B,w;(function(){if(e!==r){u=e.$form;z=e.$dropdown;v=e.$searchbox;var a="#"+v.attr("id");u.delegate(a,"focusin",t).delegate(a,"focusout",h).delegate(a,"keydown",n).delegate(a,"keyup",p);w=v.val()}})()}});h.$Nav.when("$","sx.iss.utils","NavDomApi","sx.iss.DomUtils","sx.iss.DebugUtils").build("sx.iss.SuggestionEventHandler",function(d,a,b,c,e){return function(b,g){g.delegate(".s-suggestion","click",function(c){var k=d(this); e.logDebug("Suggestion clicked",k);a.eventBus.trigger(b.suggestionClicked,{suggestion:k});c.preventDefault()}).delegate(".s-suggestion","mouseover",function(a){c.hoverOverEl(d(a.currentTarget))}).delegate(".s-suggestion","mouseout",function(a){c.hoverOutEl(d(a.currentTarget))})}});h.$Nav.when("$","sx.iss.utils","sx.iss.DebugUtils","sx.iss.DomUtils").build("sx.iss.CustomSearchBoxEventHandler",function(d,a,b,c){return function(e,m,g){function f(a){n.hide();"function"===typeof g.manualOverride&& (a=g.manualOverride(a),null!==a&&0<a.length&&k(a));d(g.submitId).removeAttr("disabled")}function k(a){l.find(c.hiddenInputClass).remove();a=c.getFormParams(a);b.logDebug("Updating form with params.",a);l.attr("action",a.uri);var e="";a=a.formParams;for(var f=0;f<a.length;f++)var d=a[f],k=decodeURIComponent(d.value),e=e+('<input type="hidden" class="'+c.hiddenInputValue+'" name="'+d.name+'" value="'+k+'"/>');l.append(e)}var l,n;l=e.$form;n=e.$dropdown;a.eventBus.listen(m.suggestionClicked,function(a){b.logDebug("Suggestion clicked", a);k(a.suggestion.data("url"));l.submit()});a.eventBus.listen(m.noSuggestions,function(a){f(a)});a.eventBus.listen(m.suggestionsReadyForDisplay,function(a){2===a.suggestions.length&&"separator"===a.suggestions[1].type&&!0===a.suggestions[0].isExactMatch?(a=n.find(c.suggestionClass).eq(0),k(a.data("url"))):4<=a.searchTerm.length?f(a.searchTerm):d(g.submitId).attr("disabled","disabled")});a.eventBus.listen(m.hideDropdown,function(){n.hide()})}});h.$Nav.when("sx.iss.utils","sx.iss.Events", "sx.iss.TimingEvents","sx.iss.MetricsLogger").build("sx.iss.SuggestionAggregator",function(d,a,b,c){return function(e,m){function g(f){d.timingProvider.startTimer(b.latency.group,b.latency.events.timeToDisplay);c.startEndToEndLogging();if(!k[f]){k[f]={remainingProviders:e.length,searchTerm:f,suggestionSets:{}};for(var g=0;g<e.length;g++){var p=a.createEvent(e[g],m.suggestionsNeeded);d.eventBus.trigger(p,f)}}}function f(a){var b=k[a.searchTerm];a=a.suggestionSets;for(var c in a)a.hasOwnProperty(c)&& (b.suggestionSets[c]=a[c]);--b.remainingProviders||(delete k[b.searchTerm],d.eventBus.trigger(m.suggestionsReady,b))}var k={};(function(){for(var b=0;b<e.length;b++){var c=a.createEvent(e[b],m.suggestionsReady);d.eventBus.listen(c,f,this)}d.eventBus.listen(m.suggestionsNeeded,g,this)})()}});h.$Nav.when("$","sx.iss.utils","sx.iss.SuggestionTypes").build("sx.iss.SuggestionSequencer",function(d,a,b){return function(c){var e=[b.department.name,b.a9Corpus.name,b.a9XOnly.name,b.a9Xcat.name, b.a9.name,"array"],d={type:"separator"};this.sequence=function(a){var b=a.suggestionSets;a=[];for(var k=0,l=this.isDeepNode(c),n=0;n<e.length;n++){var p=b[e[n]];if("undefined"!==typeof p&&0!==p.length){for(var h=0;h<p.length&&10>k;h++){var t=p[h];t.dispIdx=a.length;a.push(t);k++}0<k&&!l&&a.push(d)}}l&&(a=this.sequenceDeepNodeResults(a));b=a.length;0<b&&"separator"===a[b-1].type&&a.splice(-1,1);return a};this.isDeepNode=function(b){var c,e;b.deepNodeISS&&(c=a.suggestionUtils.getDeepNodeAlias(b.deepNodeISS), e=a.suggestionUtils.getDeepNodeCategoryName(c,b.deepNodeISS));return c!==r&&e!==r};this.sequenceDeepNodeResults=function(a){for(var c,e,d=[],m=0;m<a.length;m++)e=a[m],c!==b.a9Xcat.name&&c!==b.a9XOnly.name||e.type!==b.a9.name?d.push(e):d.unshift(e),c=e.type;return d}}});h.$Nav.when("$","sx.iss.utils","sx.iss.Events","NavDomApi").build("sx.iss.MetricsLogger",function(d,a,b,c){function e(){var a=c.isSearchBoxFocused()?"iss-late":"iss-on-time";ue.tag(a)}function m(){uet("cf","iss-init-pc",f);uet("be", "iss-init-pc",f);uex("ld","iss-init-pc",f)}function g(){return"function"===typeof uet&&"function"===typeof uex}var f={wb:1};g()&&(a.eventBus.listen(b.globals.initializeNavSearchBox,e),a.eventBus.listen(b.globals.issLoaded,m));return{startEndToEndLogging:function(){g()&&uet("bb","iss-end-to-end-a9",f)},stopEndToEndLogging:function(){g()&&(uet("cf","iss-end-to-end-a9",f),uet("be","iss-end-to-end-a9",f),uex("ld","iss-end-to-end-a9",f))}}});h.$Nav.when("$","sx.iss.utils","sx.iss.TimingEvents", "sx.iss.SuggestionTypes","sx.iss.SearchBoxEventHandler","sx.iss.A9SuggestionProvider","sx.iss.DepartmentSuggestionProvider","sx.iss.SuggestionAggregator","sx.iss.SuggestionDisplayProvider","sx.iss.SuggestionSequencer","sx.iss.IssDisplayProvider","sx.iss.TemplateInstaller","sx.iss.SuggestionEventHandler","sx.iss.DesktopSearchBoxEventHandler","NavDomApi","sx.iss.Events","sx.iss.Reftag","sx.iss.Weblab","sx.iss.DebugUtils","sx.iss.MetricsLogger").build("sx.iss.IssParentCoordinator",function(d,a,b,c,e, m,g,f,k,l,n,p,h,t,q,x,u,z,v,B){return function(w){function L(a){var b={provider:new k(a.name,a.templateId)};return a===c.a9Xcat||a===c.a9XOnly?d.extend(b,{partials:[{key:"storeHtml",provider:new k(a.name,"s-storeText"),formatter:{string:w.deptText,toReplace:"{department}"}}]}):b.provider}var A,r,N=!1;v.isQIAEnabled()&&d.extend(w,{cf:1});r={$form:q.getForm(),$dropdown:q.getDropdown(),$searchbox:q.getSearchBox()};A=x.createInstance();q.getForm().data("originalSearchTerm",q.getKeyword());q.getForm().data("originalAlias", q.getAliasFromDropdown());(function(){new e(w,r,A);p.init(w);var b=[(new m("desktop",w,A)).getName()],d=[L(c.a9),L(c.a9Corpus),new k("separator","s-separator"),L(c.a9Xcat),L(c.a9XOnly)];if(w.hasOwnProperty("isDigitalFeaturesEnabled")&&1===w.isDigitalFeaturesEnabled){d.push(new k(c.department.name,c.department.templateId));var v=new g(w,A);b.push(v.getName())}new n("suggestions-template",new l(w),d,A,w);new f(b,A);a.eventBus.trigger(x.globals.initializeNavSearchBox);b=new t(A,w);new u(A,w,{shouldAddImeTag:b.getWasCompositionUsed}); new h(A,q.getDropdown());new z(w,A)})();a.eventBus.listen(A.suggestionsReadyForDisplay,function(c){N&&(0===r.$searchbox.val().length?v.logDebug('Search term is empty, abort rendering for the search term "'+c.searchTerm+'"'):(q.showDropdown(c.display),a.timingProvider.stopTimer(b.latency.group,b.latency.events.timeToDisplay),B.stopEndToEndLogging(),a.eventBus.trigger(A.suggestionsRendered,c),a.eventBus.trigger(x.globals.suggestionsRendered,c)))});a.eventBus.listen(A.hideDropdown,function(){N=!1}); a.eventBus.listen(A.suggestionsNeeded,function(){N=!0})}});h.$Nav.when("$","sx.iss.utils","sx.iss.SearchBoxEventHandler","sx.iss.SuggestionAggregator","sx.iss.SuggestionDisplayProvider","sx.iss.SuggestionSequencer","sx.iss.IssDisplayProvider","sx.iss.TemplateInstaller","sx.iss.SuggestionEventHandler","sx.iss.Events","sx.iss.DomUtils","sx.iss.ArraySuggestionProvider","sx.iss.CustomSearchBoxEventHandler").build("sx.iss.CustomParentCoordinator",function(d,a,b,c,e,m,g,f,k,l,n,p,h){return function(t){var q, x;(function(){f.init();q=l.createInstance();var a=t.searchboxId,u=d(t.formId),v=d('<div id="search-dropdown-custom" class="search-dropdown"></div>');u.after(v);x={$form:u,$dropdown:v,$searchbox:d(a)};x.$dropdown.css({width:x.$searchbox.outerWidth()});new b(t,x,q);new k(q,x.$dropdown);new h(x,q,t);t.hasOwnProperty("src")&&n.isArray(t.src)&&(a=new p(t.src,q),new c([a.name],q));a=[new e("array","s-minimal")];new g("suggestions-template",new m(t),a,q,t)})();a.eventBus.listen(q.suggestionsReadyForDisplay, function(b){x.$dropdown.html(b.display);x.$dropdown.show();a.eventBus.trigger(q.suggestionsRendered,b)});return{dropdownId:"search-dropdown-custom"}}});h.$Nav.importEvent("jQuery",{as:"$",global:"jQuery"});h.$Nav.when("$","sx.iss.utils","sx.iss.Events","sx.iss.A9SuggestionProvider","sx.iss.DepartmentSuggestionProvider","sx.iss.A9SearchSuggestionEventHandler","sx.iss.HelpSuggestionProvider","sx.iss.RecentSearchSuggestionProvider","sx.iss.RecentSearchSuggestionEventHandler","sx.iss.SuggestionHighlightingProvider", "sx.iss.SuggestionAggregator","sx.iss.SuggestionSequencer","sx.iss.SuggestionDisplayProvider","sx.iss.IssDisplayProvider","sx.iss.IssParentCoordinator","sx.iss.PublicApi","sx.iss.MetricsLogger","sx.iss.CustomParentCoordinator").build("sx.iss",function(d,a,b,c,e,m,g,f,k,l,n,p,h,t,q,x,u,z){c={Events:b,A9SuggestionProvider:c,DepartmentSuggestionProvider:e,A9SearchSuggestionEventHandler:m,HelpSuggestionProvider:g,RecentSearchSuggestionProvider:f,RecentSearchSuggestionEventHandler:k,SuggestionHighlightingProvider:l, SuggestionAggregator:n,SuggestionSequencer:p,SuggestionDisplayProvider:h,IssDisplayProvider:t,IssParentCoordinator:q,CustomParentCoordinator:z,IssParentCoordinatorMobile:q,SuggestionSequencerMobile:p,isNewIss:!0};d.extend(c,c,x);a.eventBus.trigger(b.globals.issLoaded);return c});h.$Nav.when("sx.iss").run(function(d){h.$Nav.publish("sx.iss",d);h.$Nav.publish("search-js-autocomplete",d)});h.$Nav.when("$","sx.iss.SuggestionTypes").build("sx.iss.FilterIss",function(d,a){return function(b){return{removeFilteredAliases:function(c){b.filterAliases&& c[a.a9Xcat.name]&&(c[a.a9Xcat.name]=d.grep(c[a.a9Xcat.name],function(a){return-1===d.inArray(a.alias,b.filterAliases)}));return c}}}})})})(function(){var C=window.AmazonUIPageJS||window.P,h=C._namespace||C.attributeErrors;return h?h("RetailSearchAutocompleteAssets"):C}(),window); /* ******** */ (function(b,e,k){b.execute(function(){function q(d){d.searchCSL=new function(){var c=this,b=[],f=[],l,m,n,g,h=20,p;c.init=function(a,b,d){a&&b&&!l&&(l=a,c.updateRid(b),d&&(h=d))};c.updateRid=function(a){a&&m!=a&&(c.tx(),m=a,n={})};c.addWlt=function(a){if(a){if(a.call&&(a=a(),!a))return;n[a]||(b.push(a),n[a]=1,c.scheduleTx())}};c.addAmabotPrerendered=function(a){a&&a.rid&&a.selections&&a.selections.length&&(f.push(a),c.scheduleTx())};c.scheduleTx=function(){if(0==h)c.tx();else{if(!p){var a=e.onbeforeunload; e.onbeforeunload=function(b){g&&(e.clearInterval(g),g=k);c.tx();p=!1;return a&&a.call?a(b):k};p=!0}!g&&0<h&&(g=e.setTimeout(function(){g=k;c.tx()},h))}};c.tx=function(){if(b.length||f.length){var a="/mn/search/csl?";b.length&&(a+="rrid="+m+"&cpt="+l+"&ctw="+b.join("|"),b=[]);if(f.length){var c="";d.each(f,function(a,b){c+=b.rid+":";d.each(b.selections,function(a,d){d&&(c+=d+(a!=b.selections.length-1?",":""))});c+=a!=f.length-1?".":""});f=[];c&&(a+="?"==a.charAt(a.length-1)?"":"&",a+="amabotSelections="+ c)}(new Image).src=a}}};return d.searchCSL}e.$Nav?(e.$SearchJS||(e.$SearchJS=$Nav.make("sx")),$SearchJS.importEvent("jQuery",{as:"$",global:"jQuery"}),$SearchJS.importEvent("jQuery",{global:"jQuery"}),$SearchJS.when("jQuery").run("searchCSL-lib",function(b){b.searchCSL=b.searchCSL||q(b);$SearchJS.publish("search-csl",b.searchCSL)})):b&&b.when("jQuery").execute(function(d){try{b.register("search-csl",function(){return q(d)})}catch(c){}})})})(function(){var b=window.AmazonUIPageJS||window.P,e=b._namespace|| b.attributeErrors;return e?e("RetailSearchClientSideLoggingAuiAssets"):b}(),window); /* ******** */ (function(k){var n=window.AmazonUIPageJS||window.P,r=n._namespace||n.attributeErrors,b=r?r("P13NSharedSitewideJS"):n;b.guardFatal?b.guardFatal(k)(b,window):b.execute(function(){k(b,window)})})(function(k,n,r){(function(){k.register("p13n-sc-math",function(){return Math});k.register("p13n-sc-document",function(){return document});k.register("p13n-sc-window",function(){return n});k.register("p13n-sc-undefined",function(){});var b=function(){return n.P&&n.P.AUI_BUILD_DATE};b()?(k.when("jQuery").register("p13n-sc-jQuery", function(b){return b}),k.when("ready").register("p13n-sc-ready",function(){})):n.amznJQ&&(n.amznJQ.available("jQuery",function(){k.register("p13n-sc-jQuery",function(){return n.amznJQ.jQuery})}),n.amznJQ.onReady("jQuery",function(){k.register("p13n-sc-ready",function(){})}),n.amznJQ.available("amazonShoveler",function(){k.register("p13n-sc-amznJQ-shoveler",function(){})}));k.when("p13n-sc-window").register("p13n-sc-util",function(e){var h=e.ueLogError;"function"!==typeof h&&(h=function(b,e){if(e&& e.message)throw Error(e.message);if(b&&b.message)throw Error(b.message);});var g=function(b,e){h({logLevel:b,attribution:"P13NSharedSitewideJS",message:"[p13n-sc] "+e})};return{constants:{DATA_ATTR_P13N_FEATURE_NAME:"p13nFeatureName"},count:e.ue&&e.ue.count||function(){},isAUI:b,log:{warn:function(b){g("WARN",b)},error:function(b){g("ERROR",b)}},parseInt:function(b){return parseInt(b,10)}}})})();k.when("p13n-sc-jQuery","p13n-sc-window","p13n-sc-undefined").register("p13n-sc-heartbeat",function(b, e,h){var g=e.clearInterval,f={},p,m,a=function(){if(!p){var c=e.setInterval(function(){var a=c,b=(new Date).getTime();a!==p?g(a):((!m||200<b-m)&&l(),m=(new Date).getTime())},200);p=c}},l=function(){b.each(f,function(c,a){a.call(e)})};return{subscribe:function(c,b){f[c]||(f[c]=b,a())},unsubscribe:function(c){f[c]&&delete f[c];c=!0;for(var a in f)f.hasOwnProperty(a)&&(c=!1);c&&(g(p),p=h)}}});k.when("p13n-sc-jQuery","p13n-sc-heartbeat").register("p13n-sc-call-on-visible",function(b,e){var h=[],g=b(n), f=function(){for(var b=g.scrollTop()+g.height(),f=g.scrollLeft()+g.width(),a=h.length-1;0<=a;a--){var l=h[a],c=l.callback,d=l.$element,q=l.distanceY,l=l.distanceX;if(0===d.parents("body").size())h.splice(a,1);else if(!d.is(":hidden")){var k=d.offset();b-q>k.top&&f-l>k.left&&(h.splice(a,1),c.call(null,d[0]))}}0===h.length&&e.unsubscribe("p13n-sc-call-on-visible")};return{register:function(g,m,a){var l=a&&"undefined"!==typeof a.distance?a.distance:0,c=a&&"undefined"!==typeof a.distanceY?a.distanceY: l,d=a&&"undefined"!==typeof a.distanceX?a.distanceX:0;b(g).each(function(){h.push({$element:b(this),callback:m,distanceY:c,distanceX:d})});e.subscribe("p13n-sc-call-on-visible",f)}}});k.when("A","jQuery","p13n-sc-call-on-visible","p13n-sc-util","p13n-sc-math").register("p13n-sc-view-trigger",function(b,e,h,g,f){var p=function(a){var l=e(a);a=l.attr("data-params");var c=l.attr("data-url");if(a&&c){a=b.parseJSON(a);var d=l.offset(),l=[d.top,d.left,l.height(),e(n).width()];a.elementRect=l.join(","); var g=0,p={cache:!0,crossDomain:!1,data:e.param(a,!1),error:function(c){c=c.status||0;3<=g||400<=c&&500>c||setTimeout(h,200*f.pow(2,g))},global:!1,url:c},h=function(){g+=1;e.ajax(p)};h()}},m=function(a){var f=e(a);if(1===f.size()){var c=f.attr("data-params"),c=c?b.parseJSON(c):{};if(!0===c.allowEmpty||0!==e.trim(f.text()).length){var d=f.height();!0!==c.allowEmpty&&5>d||(d=0,"number"===typeof c.distance&&(d=c.distance),f.attr("data-p13n-sc-vt-initialized")||(f.attr("data-p13n-sc-vt-initialized",!0), h.register(a,function(){p(a)},{distance:d})))}}};g=function(){b.each(e(".p13n-sc-vt:not([data-p13n-sc-vt-initialized])"),function(a){m(a)})};k.execute(g);k.when("afterReady").execute("p13n-sc-view-trigger:init",g);return{initializeElement:m}});k.when("p13n-sc-jQuery","p13n-sc-util","p13n-sc-window","p13n-sc-document","p13n-sc-ready").register("p13n-sc-logger",function(b,e,h,g){function f(c){return c.join("")}function p(c,a){var d=c.attr(a),f={};d!==r&&null!==d&&(f="undefined"!==typeof b.parseJSON? b.parseJSON(d):eval("("+d+")"));return f}function m(c,a){for(var d=[c.widget,":"],l=0;l<c.asins.length;l++){var e=c.asins[l];d.push(e.asin,"@");b.each(e,function(c,a){"asin"!==c&&d.push(c,"=",a,"|")});d.splice(d.length-1,1);d.push(",")}0<c.asins.length&&d.splice(d.length-1,1);a&&(d.push(":","action=",c.action),b.each(c.meta,function(c,a){d.push(",",c,"=",a)}));return f(d)}function a(c,a){var d=p(b(a),"data-p13n-asin-metadata");if(d&&d.asin){var f=d.asin,l=p(b(c),"data-p13n-asin-metadata");l&&b.extend(!0, d,l[f]);return d}}function l(c,a){var l=new Image;e.count("p13n:logger:attempt",1);l.onerror=function(){d++;e.count("p13n:logger:error",1)};l.src=f(["https:"===g.location.protocol?"https://":"http://",h.ue_furl||"fls-na.amazon.com","/1/","p13n-shared-components","/1/OP/p13n/",a,f(["?",b.param(p(b(c.featureElement),"data-p13n-global"))])])}function c(){return 3<d?(q||(e.count("p13n:logger:abort",1),q=!0),!0):!1}var d=0,q=!1,k={},n={},u={logAction:function(d){if(!c())if("featureElement"in d)if("action"in d){var g=b(d.featureElement);d.asins=b.map(b(d.featureElement).find(".p13n-asin").filter(":visible"),function(c){return a(g,c)});d.meta=d.meta||{};var q=p(g,"data-p13n-feature-metadata");b.extend(!0,d.meta,q);d.widget=g.attr("data-p13n-feature-name");d.widget in k||(k[d.widget]={});if(0!==d.asins.length){for(var q=[],h=0;h<d.asins.length;h++)d.asins[h].asin in k[d.widget]||(k[d.widget][d.asins[h].asin]=!0,q.push(d.asins[h]));d.logOnlyOnNew&&0===q.length||(d.logOnlyNew&&0<q.length&&(d.asins=q),q=f(["action/", f([d.widget,"_:",d.action,"@v=",d.eventtime||0,",impressed@v=",d.asins.length]),"/",m(d,!0)]),d.replicateAsinImpressions&&(h=f(["asin/",m(d,!1)]),q=f(["batch/",q,"$",h])),l(d,q))}}else e.log.warn("action missing in eventData for logAction");else e.log.warn("featureElement missing in eventData for logAction")},logAsyncAction:function(c){var a=(new Date).getTime(),d="number"===typeof c.initialDelay?c.initialDelay:400,f="number"===typeof c.timeout?c.timeout:5E3,l=b(c.featureElement);c.widget=l.attr("data-p13n-feature-name"); c.widget in n&&h.clearTimeout(n[c.widget]);var e=function(){var d=c.isEventComplete(),b=(new Date).getTime();b-a<f&&!d?n[c.widget]=h.setTimeout(e,150):(d||("meta"in c||(c.meta={}),c.meta.err="notfinished"),c.eventtime=b-a,delete n[c.widget],u.logAction(c))};n[c.widget]=h.setTimeout(e,d)},eventPending:function(c){return b(c).attr("data-p13n-feature-name")in n},impressAsin:function(d){if(!c())if("featureElement"in d)if("faceoutElement"in d){var g=b(d.faceoutElement),p=b(d.featureElement);d.widget=p.attr("data-p13n-feature-name"); d.asins=[a(p,g)];g=f(["asin/",m(d,!1)]);l(d,g)}else e.log.warn("faceoutElement missing in eventData for logAction");else e.log.warn("featureElement missing in eventData for logAction")}};return u});k.when("jQuery","A","p13n-sc-call-on-visible","p13n-sc-logger","ready").register("p13n-sc-faceout-logger",function(b,e,h,g){var f=function(f,e){var a=b(f),l=b(e);1!==a.length||a.attr("data-p13n-sc-fl-initialized")||(a.attr("data-p13n-sc-fl-initialized",!0),h.register(a,function(){g.impressAsin({featureElement:l, faceoutElement:a})}))};e.on("p13n:faceoutsloaded",function(e){b(e).find(".p13n-asin:not([data-p13n-sc-fl-initialized])").each(function(b,a){f(a,e)})})});k.when("A","jQuery").register("p13n-sc-lazy-image-loader",function(b,e){return{loadImages:function(h){b.executeDeferred();h.find(".p13n-sc-lazy-loaded-img").each(function(g,f){var p=e(f),h=p.find(".a-dynamic-image");h.load(function(){p.removeClass("p13n-sc-lazy-loaded-img")});b.loadDynamicImage(h)})}}});k.when("p13n-sc-jQuery","p13n-sc-util","p13n-sc-math").register("p13n-sc-line-truncator", function(b,e,h){function g(a){this.$element=a;this.$experimentElement=b("<div>").addClass("p13n-sc-offscreen-truncate");this.maxRows=a.attr("data-rows");this.lineHeight=this.getLineHeight();this.maxRows?this.lineHeight||e.log.error("Truncation element does not have a line height or it is zero"):e.log.error("Truncation element missing necessary line number data")}var f=/(?=[ \-\/])/,p=/[^\/\-\[\]():\s]/;g.prototype.truncate=function(){var a=this.$element.html(),a=b.trim(a);this.$element.append(this.$experimentElement); if(!this.checkLineFit(a)){var f=this.truncateByToken(a);f?(this.$element.html(f),this.$element.attr({title:a})):e.log.error("Unable to successfully truncate line "+a)}this.$experimentElement.remove()};g.prototype.getLineHeight=function(){var a=this.$element.html();this.$element.html("&hellip;");var b=this.$element.innerHeight();this.$element.html(a);return b};g.prototype.checkLineFit=function(a){this.$experimentElement.html(a);a=this.$experimentElement.get(0).clientHeight/this.lineHeight;return h.round(a)<= this.maxRows};g.prototype.truncateByToken=function(a){a=a.split(this.getTokenSeparatorRegex());for(var b=1,c=a.length,d,f,e=0;b!==c;)if(d=h.floor((c+b)/2),f=a.slice(0,d).join("")+"&hellip;",this.checkLineFit(f)){if(1>=c-d){for(e=d;0<e&&!p.test(a[e-1]);)e--;break}b=d}else c=d;if(0!==e)return a.slice(0,e).join("")+"&hellip;"};g.prototype.getTokenSeparatorRegex=function(){return this.$element.attr("data-truncate-by-character")?"":f};var m=function(){};k.when("A").execute("trigger-linestruncated",function(a){m= function(){a.trigger("p13n:linestruncated")}});return{truncateLines:function(a){a.find(".p13n-sc-truncate:visible, .p13n-sc-truncate-medium:visible").each(function(){var a=new g(b(this));a&&(a.truncate(),b(this).addClass("p13n-sc-truncated").removeClass("p13n-sc-truncate p13n-sc-truncate-medium"),b(this).removeClass(function(c,a){return(a.match(/p13n-sc-line-clamp-\d/g)||[]).join(" ")}))});m()}}});k.when("jQuery","A","p13n-sc-line-truncator","a-carousel-framework").register("p13n-sc-carousel",function(b, e,h,g){k.when("afterReady","a-carousel-framework").execute("p13n-sc-carousel-add-truncation",function(){function f(b){h.truncateLines(b.carousel.dom.$container)}b(".p13n-sc-carousel").each(function(b,m){var a=g.getCarousel(m),l=a.dom.$container.data("aCarouselOptions");if(!l.name){var c="p13n-sc-carousel-"+b;l.name=c;a.setAttr("name",c)}h.truncateLines(a.dom.$container);e.on("a:carousel:"+l.name+":change:animating",f);e.on("a:carousel:"+l.name+":change:loading",f);e.on("a:carousel:"+l.name+":change:pageSize", f)})})});k.when("A","jQuery","a-carousel-framework","p13n-sc-call-on-visible","p13n-sc-logger","p13n-sc-util","ready").register("p13n-sc-carousel-logger",function(b,e,h,g,f,p){function m(c,a){var b=c.getAttr("pageNumber"),l=c.dom.$container;l.data("p13nPreviousPage",b);f.logAsyncAction(e.extend(!0,{},{featureElement:l,isEventComplete:function(){return 0===l.find(".a-carousel-card-empty").size()&&!c.getAttr("animating")},meta:{p:b},replicateAsinImpressions:!0},a))}function a(c){l(c)&&g.register(c.dom.$container, function(){m(c,{action:"view"})})}var l=function(c){return"undefined"===typeof c?!1:c.dom.$container.data(p.constants.DATA_ATTR_P13N_FEATURE_NAME)?!0:!1};b.each(h.getAllCarousels(),function(c){c.dom.$container.hasClass("a-carousel-initialized")&&a(c)});b.on("a:carousel:init",function(c){a(c.carousel)});e(document).delegate(".a-carousel-container[data-p13n-feature-name] .a-carousel-goto-nextpage","click",function(c){c=h.getCarousel(c.target);m(c,{action:"shovel_right"})});e(document).delegate(".a-carousel-container[data-p13n-feature-name] .a-carousel-goto-prevpage", "click",function(c){c=h.getCarousel(c.target);m(c,{action:"shovel_left"})});e(document).delegate(".a-carousel-container[data-p13n-feature-name] .a-carousel-restart","click",function(c){c=h.getCarousel(c.target);m(c,{action:"start_over",meta:{op:c.dom.$container.data("p13nPreviousPage")}})});b.on("a:carousel:change:pageSize",function(c){c=c.carousel;l(c)&&c.dom.$container.hasClass("a-carousel-initialized")&&m(c,{action:"resize",logOnlyOnNew:!0})})});k.when("p13n-sc-jQuery","p13n-sc-window","p13n-sc-document", "p13n-sc-call-on-visible","p13n-sc-logger","p13n-sc-util","p13n-sc-amznJQ-shoveler").register("p13n-sc-non-aui-carousel",function(b,e,h,g,f,p){var m=function(c){p.count("p13n-sc-non-aui-carousel:init",1);var a=c.attr("data-widgetname"),l=b("#"+a+"Data");if(1!==l.length||c.attr("data-p13n-sc-carousel-initialized"))return!1;c.attr("data-p13n-sc-carousel-initialized",!0);var g=l.text().split(","),h=c.find(".shoveler-content > ul"),m="input#"+a+"ShvlState",z=function(){},k=200,A=!1,n=function(){var a= k;c.find(".p13nimp, .p13n-asin").each(function(){var c=b(this).outerHeight(!0);c>a&&(a=c)});a>k&&(k=a,h.animate({height:a},200,"linear"));A||C()},C=function(){var a=k/2;c.find("a.next-button, a.back-button").css("top",a);A=!0},w=c.find(".shoveler").shoveler(function(c,a){var d="",d="undefined"!==typeof e.JSON?JSON.parse(l.attr("data-ajax")):eval("("+l.attr("data-ajax")+")");d.asins=g.slice(c,c+a).join(",");d.count=a;d.offset=c;d=b.param(d);return l.attr("data-url")+"?"+d},g.length,{cellTransformer:function(c){return null=== c?"":c},cellChangeSpeedInMs:30,preloadNextPage:!0,prevButtonSelector:"a.back-button",nextButtonSelector:"a.next-button",startOverSelector:"span.start-over",startOverLinkSelector:"a",horizPadding:14,state:{ready:function(){return 0<b(m).val().length},get:function(){return parseInt(b(m).val(),10)},set:function(c){b(m).val(c)}},onUpdateUIHandler:function(){n();z()}}),B=0,r=function(){var c=b(e).width();B!==c&&(w.updateUI(),B=c)},y=null;c.resize(function(){y&&e.clearTimeout(y);y=e.setTimeout(r,100)}); var x=function(a){f.logAsyncAction(b.extend(!0,{},{featureElement:c,isEventComplete:function(){return 0===c.find("li.shoveler-cell.shoveler-progress").size()},replicateAsinImpressions:!0},a))};x({action:"view",meta:{p:w.getCurrentPage()+1}});c.find(".back-button").click(function(){x({action:"shovel_left",meta:{p:w.getCurrentPage()+1}})});c.find(".next-button").click(function(){x({action:"shovel_right",meta:{p:w.getCurrentPage()+1}})});c.find(".start-over-link").mousedown(function(){x({action:"start_over", meta:{p:1,op:w.getCurrentPage()+1}})});z=function(){f.eventPending(c)||x({action:"resize",page:w.getCurrentPage()+1,logOnlyOnNew:!0,initialDelay:2E3})}},a=function(c){var a={distanceY:-250,distanceX:0};b(c).find(".p13n-sc-nonAUI-carousel").andSelf().filter(".p13n-sc-nonAUI-carousel").each(function(c,f){g.register(f,function(){m(b(f))},a)})},l=function(){a(h)};l();k.when("p13n-sc-ready").execute("p13n-sc-non-aui-carousel:readyInit",l);return{init:a}});k.when("p13n-sc-jQuery","p13n-sc-util").execute("p13n-sc-carousel-initialization-setup", function(b,e){e.isAUI()?k.when("a-carousel-framework").register("p13n-sc-carousel-init",function(b){return{init:function(){b.createAll()}}}):k.when("p13n-sc-non-aui-carousel").register("p13n-sc-carousel-init",function(b){return{init:function(e){b.init(e)}}})});k.when("A","jQuery","p13n-sc-util").execute("updateDpLink",function(b,e,h){var g=/([?&]preST=)([^&]*)/;b.on("a:image:load:p13nImage",function(b){var p=b.$imageElement[0];if("undefined"!==typeof p&&(h.count("p13n:dynImgCallback",(h.count("p13n:dynImgCallback")|| 0)+1),p=e(p).closest("a"),0<p.length)){var m=e(p).attr("href"),a=m.match(g);b=b.url.split("/").pop().split(".");e.isArray(b)&&3===b.length&&(b=encodeURIComponent(b[1]),null!==a&&e.isArray(a)&&3===a.length&&a[2]!==b&&(b=m.replace(g,"$1"+b),e(p).attr("href",b)))}})})}); /* ******** */ (function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("RecentHistoryFooterJS"):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){c.when("p13n-sc-jQuery","p13n-sc-call-on-visible","p13n-sc-carousel-init","p13n-sc-ready").execute(function(a,q,r){var e,f,h,k,l,g=!1,u=function(){q.register(l,m,{distance:"-400"});c.when("A").execute(function(a){a.on("clickstream-changed",t)})},t=function(){g&&m()},m=function(){g||k.show(); var n=e.rhfHandlerParams;n.isAUI=b.P&&b.P.AUI_BUILD_DATE?1:0;a.ajax({url:"/gp/recent-history-footer/external/rhf-handler.html",timeout:5E3,type:"POST",dataType:"json",data:n,success:v,error:p})},v=function(a){a.success&&"object"===typeof a&&"string"===typeof a.html||p();f.html(a.html);r.init(f);w();g=!0},p=function(){g||(f.hide(),h.show())},w=function(){a("#ybh-link").click(function(){a.ajax({url:"/gp/recent-history-footer/external/ybh-handler.html",timeout:2E3,type:"POST",dataType:"text",data:e.ybhHandlerParams, success:x})})},x=function(){a("#ybh-link").hide();a("#ybh-text-off").hide();a("#ybh-text-on").show()};e=function(b){try{return"undefined"===typeof a.parseJSON?eval("("+b+")"):a.parseJSON(b)}catch(c){return d}}(a("#rhf-context script").html());f=a("#rhf-container");h=a("#rhf-error");k=a(".rhf-frame");l=a("#rhf");(function(){if("object"!==typeof e||null===e)return!1;for(var a=[f,h,k,l],b=0;b<a.length;b++){var c=a[b];if("undefined"===typeof c||"undefined"===typeof c.size||0===c.size())return!1}return!0})()&& u()})}); /* ******** */ (function(c){c.execute(function(){c.when("jQuery","afterLoad","socratesEnabled").register("socr-nav-bootstrap",function(d){function e(a){d.ajax({url:"//"+a+"/gp/socrates/assets/bootstrap-digest",dataType:"json"}).done(function(b){if(b&&b.digest&&d.type(b.digest)==="string"&&(b=b.digest.trim(),b.match(f))){var e="//"+a+"/gp/socrates/assets/bootstrap";b.match(f)&&c.load.js(e+"-"+b+".js")}})}var f=/[a-z0-9]{32}/;c.execute(function(){d.ajax({url:"/gp/socrates/bootstrap/assetdomain",dataType:"json"}).done(function(a){a&& a.domain&&d.type(a.domain)==="string"&&(a=a.domain.trim(),e(a))})})})})})(function(){var c=window.AmazonUIPageJS||P,d=c.attributeErrors;return d?d("SocratesNavBootstrap"):c}()); /* ******** */ (function(k){var b=window.AmazonUIPageJS||window.P,l=b._namespace||b.attributeErrors,a=l?l("InternationalCustomerPreferencesNavDesktopAssets"):b;a.guardFatal?a.guardFatal(k)(a,window):a.execute(function(){k(a,window)})})(function(k,b,l){b.$Nav&&b.$Nav.when("$").run(function(a){function c(a){var c=a.attr("href");c&&(c=c.replace("preferencesReturnUrl=%2F","preferencesReturnUrl="+encodeURIComponent(b.location.pathname+b.location.search)),a.attr("href",c))}a("#icp-nav-dialog, #icp-nav-flyout").each(function(b, d){c(a(d))});b.$Nav.declare("icp.create",{replaceButton:function(c,d,h){var m=a("#"+c);a.get(d+"?aui="+(b.P&&b.P.AUI_BUILD_DATE?1:0)+"&p="+h+"&r="+encodeURIComponent(b.location.pathname+b.location.search),function(a){m.replaceWith(a)})},replaceLink:c})});b.$Nav&&(b.$Nav.when("$","data","flyouts.create","flyouts.accessibility").build("flyout.icp.language.builder",function(a,c,e,d){var h=function(){return{extractLanguage:function(a){return a.split("#switch-lang=")[1]},insertLanguage:function(a){return"#switch-lang="+ a}}}();c.observe("data",function(a){var b=a.languages;a=a.helpLink;for(var f=[],e=0;e<b.all.length;e++){var g;g=b.all[e];var d=g.current?'<i class="icp-radio icp-radio-active"></i>':'<i class="icp-radio"></i>',n=g.current?null:h.insertLanguage(g.code);g={text:d+g.name,url:n};1===e&&(g.dividerBefore=!0);f.push(g)}a.text&&a.href&&f.push({text:'<div class="icp-helplink">'+a.text+"</div>",url:a.href});c({icpContent:{template:{name:"itemList",data:{items:f}}}})});return function(c){var d=e({key:"icp", link:c,event:"icp",arrow:"top"}),f=a('<form method="post" style="display:none"><input type="hidden" name="_url" value="" /><input type="text" name="LOP" value="" /></form>');d.onRender(function(){f.appendTo(d.elem())});d.getPanel().onData(function(){d.elem().find('a[href*="#switch-lang"]').each(function(c,d){var e=a(d);e.click(function(a){a.preventDefault();a=b.location.pathname+b.location.search;var c=h.extractLanguage(e.attr("href")),d="topnav_lang_"+c.replace("_","-");f.attr("action","/gp/customer-preferences/save-settings/ref="+ d);f.find('input[name="_url"]').val(a);f.find('input[name="LOP"]').val(c);f.submit()})})});return d}}),b.$Nav.when("$","flyout.icp.language.builder").build("flyout.icp.language",function(a,c){var b=a("#icp-nav-flyout");return 0===b.length?null:c(b)}),b.$Nav.when("flyout.icp.language","config","provider.ajax","util.Proximity").run("flyout.icp.language.setup",function(a,b,e,d){a&&(b=e({url:"/gp/customer-preferences/ajax/available-languages.html",data:{icpContent:"icp"}}).boundFetch(),a.onShow(b),a.link.focus(b), d.onEnter(a.link,[20,40,40,40],b))}))}); /* ******** */ (function(h){var e=window.AmazonUIPageJS||window.P,k=e._namespace||e.attributeErrors,a=k?k("GLUXAssets"):e;a.guardFatal?a.guardFatal(h)(a,window):a.execute(function(){h(a,window)})})(function(h,e,k){h.when("A","GLUXConfig","GLUXWidget","GLUXWidgetController","GLUXRegionData","LocationTypes").execute(function(a,h,b,c,p,g){var k=a.$("#"+b.IDs.ADDRESS_LIST+" li").length,f=4,n=h.SIGNIN_URL,l=function(b,f){b.deviceType="web";b.pageType=e.ue_pty;c.resetErrors();a.post("/gp/delivery/ajax/address-change.html", {contentType:"application/x-www-form-urlencoded;charset=utf-8",params:b,success:function(a){c.handleLocationUpdateResponse(a.sembuUpdated,f)},error:function(a){c.handleLocationUpdateResponse(!1,f)}})};a.on("a:button-group:GLUXAddresses:toggle",function(d){var e=d.selectedButton.buttonName.split(":")[0],f=d.selectedButton.buttonName.split(":")[1],h=g.TYPE_ACCOUNT_ADDRESS;0===parseInt(f,10)&&a.$("#"+b.IDs.DEAFULT_ADDRESS_TEXT).length&&(h=g.TYPE_DEFAULT_ADDRESS);e={locationType:h,addressId:e};c.clearPostalSelection(); c.clearCountrySelection();f=a.$("#"+b.IDs.ADDRESS_LIST+" li:eq("+f+") span>span>span>span").prop("innerHTML");a.$("#"+b.IDs.ADDRESS_SUCCESS_PLACEHOLDER).html(f);a.$('input[name="'+String(d.selectedButton.buttonName)+'"]').blur();l(e,g.TYPE_ADDRESS_ID)});a.on("a:dropdown:GLUXCountryList:select",function(d){d=d.value;var e=a.$("#"+b.IDs.COUNTRY_VALUE).text(),f={};2<d.length?(f=p.mapRegionCodeToLocationData(d))||(f=f={locationType:g.TYPE_REGION,addressLabel:d,countryCode:b.COUNTRY_CODE}):f={locationType:g.TYPE_COUNTRY, district:d,countryCode:d};c.clearPostalSelection();c.clearAddressSelection();a.$("#"+b.IDs.ADDRESS_SUCCESS_PLACEHOLDER).html(e);l(f,g.TYPE_COUNTRY)});a.declarative(b.ACTIONS.MOBILE_BACK,"click",function(){c.restoreWidget(!0)});a.declarative(b.ACTIONS.MOBILE_CLOSE,"click",function(){c.hideWidget()});a.declarative(b.ACTIONS.LESS_LINK,"click",function(){var d=f-5;0>d&&(d=0);a.$("#"+b.IDs.ADDRESS_LIST+" li:gt("+d+"):lt(5)").hide();f-=5;4===f&&a.$("#"+b.IDs.LESS_LINK).hide();a.$("#"+b.IDs.MORE_LINK).show()}); a.declarative(b.ACTIONS.MORE_LINK,"click",function(){a.$("#"+b.IDs.ADDRESS_LIST+" li:gt("+f+"):lt(5)").show();f+=5;a.$("#"+b.IDs.LESS_LINK).show();f>=k-1&&a.$("#"+b.IDs.MORE_LINK).hide()});a.declarative(b.ACTIONS.MANAGE_ADDRESS_BOOK_LINK,"click",function(){e.location.href="/gp/css/account/address/view.html?ie=UTF8"});a.declarative(b.ACTIONS.POSTAL_UPDATE,"click",function(){var d=a.$("#"+b.IDs.ZIP_UPDATE_INPUT).val(),f={locationType:g.TYPE_LOCATION_INPUT,zipCode:d};c.clearAddressSelection();c.clearCountrySelection(); a.$("#"+b.IDs.ADDRESS_SUCCESS_PLACEHOLDER).html(d);a.$("#"+b.IDs.ZIP_BUTTON).removeClass("a-button-focus");l(f,g.TYPE_POSTAL_CODE)});a.declarative(b.ACTIONS.POSTAL_INPUT,"keypress",function(d){13===d.$event.which&&a.$("#"+b.IDs.ZIP_BUTTON).find("input").click()});a.declarative(b.ACTIONS.MOBILE_COUNTRY_SELECT,"click",function(d){var c=d.data.name;d={locationType:g.TYPE_COUNTRY,countryCode:d.data.value};a.$("#"+b.IDs.ADDRESS_SUCCESS_PLACEHOLDER).html(c);l(d,g.TYPE_COUNTRY)});a.on("a:popover:beforeHide:glow-modal", function(){c.restoreWidget()});a.declarative(b.IDs.MOBILE_POSTAL_CODE_LINK,"click",function(){c.showZipCodeInput()});a.declarative(b.IDs.MOBILE_COUNTRY_LINK,"click",function(){c.showCountrySelection()});a.declarative(b.ACTIONS.SIGNIN,"click",function(){var a=n+e.location.pathname;"Search"===e.ue_pty&&(a+=e.location.search);e.location.href=a})});h.declare("GLUXConfig",{SIGNIN_URL:"/gp/sign-in.html?ie=UTF8&useRedirectOnSuccess=1&path="});h.when("A","a-modal","GLUXWidget","GLUXRefreshController").register("GLUXWidgetController", function(a,e,b,c){function h(){e.get(a.$("#nav-global-location-slot")).hide()}return{handleLocationUpdateResponse:function(g,k){if(g){var f=e.get(a.$("#nav-global-location-slot")),n=f.getContent().prop("innerHTML"),l=f.attrs("header"),d=a.$("#"+b.IDs.SUCCESS_DIALOG).prop("innerHTML"),r=a.$("#"+b.IDs.SUCCESS_FOOTER).prop("innerHTML"),m=b.CONFIRM_HEADER;0<a.$(f.getContent()).find("#GLUXHiddenSuccessDialog").length&&(a.state.replace("GLUXInfo",{oldContent:n,oldHeader:l}),f.update({content:d,footer:r, width:375,header:m}),a.declarative("GLUXConfirmAction","click",h));c.subscribeAfterHidePopoverEvent()}else switch(k){case "ADDRESS_ID":a.$("#"+b.IDs.ADDRESS_SET_ERROR).show();break;case "POSTAL_CODE":a.$("#"+b.IDs.ZIP_ERROR).show();break;case "COUNTRY":a.$("#"+b.IDs.ADDRESS_SET_ERROR).show()}},resetErrors:function(){a.$("#"+b.IDs.ADDRESS_SET_ERROR).hide();a.$("#"+b.IDs.ZIP_ERROR).hide()},restoreWidget:function(){if(a.state("GLUXInfo")&&a.state("GLUXInfo").oldContent){var b=e.get(a.$("#nav-global-location-slot")), c=a.state("GLUXInfo").oldContent,f=a.state("GLUXInfo").oldHeader;b.update({content:c,footer:"",width:375,header:f})}},clearAddressSelection:function(){a.$("#"+b.IDs.ADDRESS_LIST+" li>span>span").removeClass("a-button-selected")},clearPostalSelection:function(){a.$("#"+b.IDs.ZIP_UPDATE_INPUT).val("")},clearCountrySelection:function(){var c=b.COUNTRY_LIST_PLACEHOLDER;a.$("#"+b.IDs.COUNTRY_VALUE).text(c);a.$("#"+b.IDs.COUNTRY_LIST_DROPDOWN).removeClass("a-button-focus")}}});h.when("A").register("GLUXRefreshController", function(a){function e(){a.trigger("packard:glow:destinationChangeNav")}a.on("packard:glow:destinationChangeNavAck",function(){a.trigger("packard:glow:destinationChangeAll")});return{notifyDestinationChangeNav:e,subscribeAfterHidePopoverEvent:function(){a.on("a:popover:afterHide:glow-modal",function(){e();a.off("a:popover:afterHide:glow-modal")})},getAfterHidePopoverEvent:"a:popover:afterHide:glow-modal"}});h.when("A","GLUXWidget").register("LocationTypes",function(a,e){return{TYPE_LOCATION_INPUT:"LOCATION_INPUT", TYPE_DEFAULT_ADDRESS:"DEFAULT_ADDRESS",TYPE_ACCOUNT_ADDRESS:"ACCOUNT_ADDRESS",TYPE_ADDRESS_ID:"ADDRESS_ID",TYPE_POSTAL_CODE:"POSTAL_CODE",TYPE_COUNTRY:"COUNTRY",TYPE_REGION:"REGION"}});h.when("A","GLUXWidget","LocationTypes").register("GLUXRegionData",function(a,e,b){var c={"FR-CH":{countryCode:"FR",zipCode:"20000"}};return{getRegions:function(){return c},mapRegionCodeToLocationData:function(a){a=c.hasOwnProperty(a)?{addressLabel:a,countryCode:c[a].countryCode,zipCode:c[a].zipCode,locationType:b.TYPE_REGION}: null;return a}}})}); /* ******** */
seagatesoft/webdext
test/amazon_sellers_files/01cTdrPCuSL._RC-71+AWq+0vpL.js,518IrEtjHjL.js,01A18a0oAWL.js,31SQxfpgU+L.js,01kfgaPO2JL.js,01wBjiz9OvL.js,11AmWwI7vaL.js,21o1hvT04xL.js_.js
JavaScript
mit
230,788
<? $form = Loader::helper('form'); ?> <? $attribs = array(); $allowedAKIDs = $assignment->getAttributesAllowedArray(); $requiredKeys = array(); $usedKeys = array(); if ($c->getCollectionTypeID() > 0 && !$c->isMasterCollection()) { $cto = CollectionType::getByID($c->getCollectionTypeID()); $aks = $cto->getAvailableAttributeKeys(); foreach($aks as $ak) { $requiredKeys[] = $ak->getAttributeKeyID(); } } $setAttribs = $c->getSetCollectionAttributes(); foreach($setAttribs as $ak) { $usedKeys[] = $ak->getAttributeKeyID(); } $usedKeysCombined = array_merge($requiredKeys, $usedKeys); ?> <div class="row"> <div id="ccm-attributes-column" class="span3"> <h6><?=t("All Attributes")?></h6> <div class="ccm-block-type-search-wrapper "> <div class="ccm-block-type-search"> <?=$form->text('ccmSearchAttributeListField', array('tabindex' => 1, 'autocomplete' => 'off', 'style' => 'width: 155px'))?> </div> </div> <? $category = AttributeKeyCategory::getByHandle('collection'); $sets = $category->getAttributeSets(); ?> <ul id="ccm-page-attribute-list" class="item-select-list"> <? foreach($sets as $as) { ?> <li class="item-select-list-header ccm-attribute-available"><span><?=$as->getAttributeSetDisplayName()?></span></li> <? $setattribs = $as->getAttributeKeys(); foreach($setattribs as $ak) { if (!in_array($ak->getAttributeKeyID(), $allowedAKIDs)) { continue; } ?> <li id="sak<?=$ak->getAttributeKeyID()?>" class="ccm-attribute-key ccm-attribute-available <? if (in_array($ak->getAttributeKeyID(), $usedKeysCombined)) { ?>ccm-attribute-added<? } ?>"><a style="background-image: url('<?=$ak->getAttributeKeyIconSRC()?>')" href="javascript:void(0)" onclick="ccmShowAttributeKey(<?=$ak->getAttributeKeyID()?>)"><?=$ak->getAttributeKeyDisplayName()?></a></li> <? } } $unsetattribs = $category->getUnassignedAttributeKeys(); if (count($sets) > 0 && count($unsetattribs) > 0) { ?> <li class="item-select-list-header ccm-attribute-available"><span><?=tc('AttributeSetName', 'Other')?></span></li> <? } foreach($unsetattribs as $ak) { if (!in_array($ak->getAttributeKeyID(), $allowedAKIDs)) { continue; } ?> <li id="sak<?=$ak->getAttributeKeyID()?>" class="ccm-attribute-key ccm-attribute-available <? if (in_array($ak->getAttributeKeyID(), $usedKeysCombined)) { ?>ccm-attribute-added<? } ?>"><a style="background-image: url('<?=$ak->getAttributeKeyIconSRC()?>')" href="javascript:void(0)" onclick="ccmShowAttributeKey(<?=$ak->getAttributeKeyID()?>)"><?=$ak->getAttributeKeyDisplayName()?></a></li> <? } ?> </ul> </div> <div class="span5" id="ccm-page-attributes-selected"> <h6><?=t("Selected Attributes")?></h6> <div id="ccm-page-attributes-none" <? if (count($usedKeysCombined) > 0) { ?>style="display: none"<? } ?>> <div style="padding-top: 140px; width: 400px; text-align: center"><h3> <? if ($c->isMasterCollection()) { ?> <?=t('No attributes assigned. Any attributes you set here will automatically be set on pages when they are created.')?> <? } else { ?> <?=t('No attributes assigned.')?> <? } ?></h3></div> </div> <? $attribs = CollectionAttributeKey::getList(); ob_start(); foreach($attribs as $ak) { if (!in_array($ak->getAttributeKeyID(), $allowedAKIDs)) { continue; } $caValue = $c->getAttributeValueObject($ak); ?> <div class="form-stacked"> <div class="well" id="ak<?=$ak->getAttributeKeyID()?>" <? if (!in_array($ak->getAttributeKeyID(), $usedKeysCombined)) { ?> style="display: none" <? } ?>> <? if (in_array($ak->getAttributeKeyID(), $allowedAKIDs)) { ?> <input type="hidden" class="ccm-meta-field-selected" id="ccm-meta-field-selected<?=$ak->getAttributeKeyID()?>" name="selectedAKIDs[]" value="<? if (!in_array($ak->getAttributeKeyID(), $usedKeysCombined)) { ?>0<? } else { ?><?=$ak->getAttributeKeyID()?><? } ?>" /> <a href="javascript:void(0)" class="ccm-meta-close" ccm-meta-name="<?=$ak->getAttributeKeyDisplayName()?>" id="ccm-remove-field-ak<?=$ak->getAttributeKeyID()?>" style="display:<?=(!in_array($ak->getAttributeKeyID(), $requiredKeys) && !$ak->isAttributeKeyInternal())?'block':'none'?>"><img src="<?=ASSETS_URL_IMAGES?>/icons/remove_minus.png" width="16" height="16" alt="<?=t('remove')?>" /></a> <label><?=$ak->getAttributeKeyDisplayName()?></label> <?=$ak->render('form', $caValue); ?> <? } else { ?> <label><?=$ak->getAttributeKeyDisplayName()?></label> <?=$c->getAttribute($ak->getAttributeKeyHandle())?> <? } ?> </div> </div> <? } $contents = ob_get_contents(); ob_end_clean(); ?> <script type="text/javascript"> <? $v = View::getInstance(); $headerItems = array_merge($v->getHeaderItems(), $v->getFooterItems()); foreach($headerItems as $item) { if ($item->file) { if ($item instanceof CSSOutputObject) { $type = 'CSS'; } else { $type = 'JAVASCRIPT'; } ?> ccm_addHeaderItem("<?=$item->file?>", '<?=$type?>'); <? } } ?> </script> <? print $contents; ?> </div> </div> <script type="text/javascript"> $('input[name=ccmSearchAttributeListField]').focus(function() { $(this).css('color', '#666'); if (!ccmLiveSearchActive) { $('#ccmSearchAttributeListField').liveUpdate('ccm-page-attribute-list', 'attributes'); ccmLiveSearchActive = true; } ccmMapUpAndDownArrows = true; }); var ccmLiveSearchActive = false; var ccmMapUpAndDownArrows = true; $('#ccm-page-attributes-selected').find('input,select,textarea').focus(function() { ccmMapUpAndDownArrows = false; }); ccmPageAttributesSearchResultsSelect = function(which, e) { e.preventDefault(); e.stopPropagation(); // $("input[name=ccmPageAttributesSearch]").blur(); // find the currently selected item var obj = $("li.ccm-item-selected"); var foundblock = false; if (obj.length == 0) { $($("#ccm-page-attribute-list li.ccm-attribute-available:not(.item-select-list-header)")[0]).addClass('ccm-item-selected'); } else { if (which == 'next') { var nextObj = obj.nextAll('li.ccm-attribute-available:not(.item-select-list-header)'); if (nextObj.length > 0) { obj.removeClass('ccm-item-selected'); $(nextObj[0]).addClass('ccm-item-selected'); } } else if (which == 'previous') { var prevObj = obj.prevAll('li.ccm-attribute-available:not(.item-select-list-header)'); if (prevObj.length > 0) { obj.removeClass('ccm-item-selected'); $(prevObj[0]).addClass('ccm-item-selected'); } } } var currObj = $("li.ccm-item-selected"); var currPos = currObj.position(); var currDialog = currObj.parents('div.ui-dialog-content'); var docViewTop = currDialog.scrollTop(); var docViewBottom = docViewTop + currDialog.innerHeight(); var elemTop = currObj.position().top; var elemBottom = elemTop + docViewTop + currObj.innerHeight(); if ((docViewBottom - elemBottom) < 0) { currDialog.get(0).scrollTop += currDialog.get(0).scrollTop + currObj.height(); } else if (elemTop < 0) { currDialog.get(0).scrollTop -= currDialog.get(0).scrollTop + currObj.height(); } return true; } ccmPageAttributesDoMapKeys = function(e) { if (ccmMapUpAndDownArrows) { if (e.keyCode == 40) { ccmPageAttributesSearchResultsSelect('next', e); } else if (e.keyCode == 38) { ccmPageAttributesSearchResultsSelect('previous', e); } else if (e.keyCode == 13) { var obj = $("li.ccm-item-selected"); if (obj.length > 0) { obj.find('a').click(); } } } } ccmPageAttributesMapKeys = function() { $(window).bind('keydown.attribs', ccmPageAttributesDoMapKeys); } ccmShowAttributeKey = function(akID) { $("#ccm-page-attributes-none").hide(); $("#sak" + akID).addClass('ccm-attribute-added'); $("#ak" + akID).find('.ccm-meta-field-selected').val(akID); $("#ak" + akID).fadeIn(300, 'easeOutExpo'); } var ccmPathHelper={ add:function(field){ var parent = $(field).parent(); var clone = parent.clone(); clone.children().each(function() { if (this.id != undefined && (i = this.id.search("-add-")) != -1) { this.id = this.id.substr(0, i) + "-add-" + (parseInt(this.id.substr(i+5)) + 1); } if (this.name != undefined && (i = this.name.search("-add-")) != -1) { this.name = this.name.substr(0, i) + "-add-" + (parseInt(this.name.substr(i+5)) + 1); } if (this.type == "text") { this.value = ""; } }); $(field).replaceWith('<a href="javascript:void(0)" class="ccm-meta-path-del"><?php echo t('Remove Path')?></a>'); clone.appendTo(parent.parent()); $("a.ccm-meta-path-add,a.ccm-meta-path.del").unbind('click'); $("a.ccm-meta-path-add").click(function(ev) { ccmPathHelper.add(ev.target) }); $("a.ccm-meta-path-del").click(function(ev) { ccmPathHelper.del(ev.target) }); }, del:function(field){ $(field).parent().remove(); } } $(function() { $(window).css('overflow', 'hidden'); $(window).unbind('keydown.attribs'); ccmPageAttributesMapKeys(); $("a.ccm-meta-close").click(function() { var thisField = $(this).attr('id').substring(19); var thisName = $(this).attr('ccm-meta-name'); $("#ccm-meta-field-selected" + thisField).val(0); // add it back to the select menu $("#sak" + thisField).removeClass('ccm-attribute-added'); $("#ak" + thisField).fadeOut(80, 'easeOutExpo', function() { if ($('li.ccm-attribute-added').length == 0) { $("#ccm-page-attributes-none").show(); } }); }); // hide any attribute set headers that don't have any attributes $('.item-select-list-header').each(function() { if (!($(this).next().hasClass('ccm-attribute-key'))) { $(this).remove(); } }); if ($('.ccm-attribute-key').length == 0) { $('#ccm-attributes-column').hide(); } $("a.ccm-meta-path-add").click(function(ev) { ccmPathHelper.add(ev.target) }); $("a.ccm-meta-path-del").click(function(ev) { ccmPathHelper.del(ev.target) }); $("#cHandle").blur(function() { $(".ccm-meta-path input").each(function() { if ($(this).val() == "") { $(this).val('<?=$c->getCollectionPath()?>'); } }); }); }); </script> <style type="text/css"> #ccm-properties-custom-tab input.ccm-input-text { width: 350px; } #ccm-properties-custom-tab textarea.ccm-input-textarea { width: 350px; } </style>
mrogelja/website-concrete5
concrete/elements/collection_metadata_fields.php
PHP
mit
10,161
<!DOCTYPE html> <html data-ng-app="app"> <head> <meta charset="utf8"> <base href="/"> <title>Mean Seed</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="build/css/index.css"> <link rel="shortcut icon" href="image/favicon.ico" type="image/x-icon"> </head> <body> <h1>Page Not Found | 404</h1> </body> </html>
Ibanheiz/mean-seed
front/js/test/templates/main/views/404.html
HTML
mit
401
return NOTESKIN:LoadActor("DownLeft", "Ready Receptor")..{ Frames = { { Frame = 0 }; { Frame = 1 }; { Frame = 2 }; }; --InitCommand=cmd(rotationy,180); };
Brenin/PJ-3100
Working Launchers/Games/Stepmania/StepMania 5/NoteSkins/pump/delta/DownRight Ready Receptor.lua
Lua
mit
163
<p> {{ partial "modules/page/summary.html" . }} </p>
opoyc/partiallyrandom
themes/hugo-bootstrap-premium/layouts/partials/bloc/content/summary.html
HTML
mit
55
using System; using System.Collections.Generic; using System.Linq; namespace Umbraco.Core.Scoping { public class ScopeContext : IInstanceIdentifiable { private Dictionary<string, IEnlistedObject> _enlisted; private bool _exiting; public void ScopeExit(bool completed) { if (_enlisted == null) return; _exiting = true; List<Exception> exceptions = null; foreach (var enlisted in _enlisted.Values.OrderBy(x => x.Priority)) { try { enlisted.Execute(completed); } catch (Exception e) { if (exceptions == null) exceptions = new List<Exception>(); exceptions.Add(e); } } if (exceptions != null) throw new AggregateException("Exceptions were thrown by listed actions.", exceptions); } private readonly Guid _instanceId = Guid.NewGuid(); public Guid InstanceId { get { return _instanceId; } } private IDictionary<string, IEnlistedObject> Enlisted { get { return _enlisted ?? (_enlisted = new Dictionary<string, IEnlistedObject>()); } } private interface IEnlistedObject { void Execute(bool completed); int Priority { get; } } private class EnlistedObject<T> : IEnlistedObject { private readonly Action<bool, T> _action; public EnlistedObject(T item, Action<bool, T> action, int priority) { Item = item; Priority = priority; _action = action; } public T Item { get; private set; } public int Priority { get; private set; } public void Execute(bool completed) { _action(completed, Item); } } // todo: replace with optional parameters when we can break things public T Enlist<T>(string key, Func<T> creator) { return Enlist(key, creator, null, 100); } // todo: replace with optional parameters when we can break things public T Enlist<T>(string key, Func<T> creator, Action<bool, T> action) { return Enlist(key, creator, action, 100); } // todo: replace with optional parameters when we can break things public void Enlist(string key, Action<bool> action) { Enlist<object>(key, null, (completed, item) => action(completed), 100); } public void Enlist(string key, Action<bool> action, int priority) { Enlist<object>(key, null, (completed, item) => action(completed), priority); } public T Enlist<T>(string key, Func<T> creator, Action<bool, T> action, int priority) { if (_exiting) throw new InvalidOperationException("Cannot enlist now, context is exiting."); var enlistedObjects = _enlisted ?? (_enlisted = new Dictionary<string, IEnlistedObject>()); IEnlistedObject enlisted; if (enlistedObjects.TryGetValue(key, out enlisted)) { var enlistedAs = enlisted as EnlistedObject<T>; if (enlistedAs == null) throw new InvalidOperationException("An item with the key already exists, but with a different type."); if (enlistedAs.Priority != priority) throw new InvalidOperationException("An item with the key already exits, but with a different priority."); return enlistedAs.Item; } var enlistedOfT = new EnlistedObject<T>(creator == null ? default(T) : creator(), action, priority); Enlisted[key] = enlistedOfT; return enlistedOfT.Item; } } }
kgiszewski/Umbraco-CMS
src/Umbraco.Core/Scoping/ScopeContext.cs
C#
mit
4,035
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue} * * @function Phaser.Utils.Objects.GetFastValue * @since 3.0.0 * * @param {object} source - The object to search * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods) * @param {*} [defaultValue] - The default value to use if the key does not exist. * * @return {*} The value if found; otherwise, defaultValue (null if none provided) */ var GetFastValue = function (source, key, defaultValue) { var t = typeof(source); if (!source || t === 'number' || t === 'string') { return defaultValue; } else if (source.hasOwnProperty(key) && source[key] !== undefined) { return source[key]; } else { return defaultValue; } }; module.exports = GetFastValue;
TukekeSoft/phaser
src/utils/object/GetFastValue.js
JavaScript
mit
1,070