			return nil, store.NewErrNotFound("Team", fmt.Sprintf("nameIn=%v", names))
		}
		return nil, errors.Wrap(err, "failed to find Teams")
	}
	if len(teams) != len(uniqueNames) {
		return nil, store.NewErrNotFound("Team", fmt.Sprintf("nameIn=%v", names))
	}
	return teams, nil
}

func (s SqlTeamStore) teamSearchQuery(opts *model.TeamSearch, countQuery bool) sq.SelectBuilder {
	var selectStr string
	if countQuery {
		selectStr = "count(*)"
	} else {
		selectStr = "t.*"
		if opts.IncludePolicyID != nil && *opts.IncludePolicyID {
			selectStr += ", RetentionPoliciesTeams.PolicyId as PolicyID"
		}
	}

	query := s.getQueryBuilder().
		Select(selectStr).
		From("Teams as t")

	// Don't order or limit if getting count
	if !countQuery {
		query = query.OrderBy("t.DisplayName")

		if opts.IsPaginated() {
			query = query.Limit(uint64(*opts.PerPage)).Offset(uint64(*opts.Page * *opts.PerPage))
		}
	}

	term := opts.Term
	if term != "" {
		term = sanitizeSearchTerm(term, "\\")
		term = wildcardSearchTerm(term)

		operatorKeyword := "ILIKE"

		query = query.Where(fmt.Sprintf("(Name %[1]s ? OR DisplayName %[1]s ?)", operatorKeyword), term, term)
	}

	if opts.PolicyID != nil && *opts.PolicyID != "" {
		query = query.
			InnerJoin("RetentionPoliciesTeams ON t.Id = RetentionPoliciesTeams.TeamId").
			Where(sq.Eq{"RetentionPoliciesTeams.PolicyId": *opts.PolicyID})
	} else if opts.ExcludePolicyConstrained != nil && *opts.ExcludePolicyConstrained {
		query = query.
			LeftJoin("RetentionPoliciesTeams ON t.Id = RetentionPoliciesTeams.TeamId").
			Where("RetentionPoliciesTeams.TeamId IS NULL")
	} else if opts.IncludePolicyID != nil && *opts.IncludePolicyID {
		query = query.
			LeftJoin("RetentionPoliciesTeams ON t.Id = RetentionPoliciesTeams.TeamId")
	}

	var teamFilters sq.Sqlizer
	var openInviteFilter sq.Sqlizer
	if opts.AllowOpenInvite != nil {
		if *opts.AllowOpenInvite {
			openInviteFilter = sq.Eq{"AllowOpenInvite": true}
		} else {
			openInviteFilter = sq.And{
				sq.Or{
					sq.NotEq{"AllowOpenInvite": true},
					sq.Eq{"AllowOpenInvite": nil},
				},
				sq.Or{
					sq.NotEq{"GroupConstrained": true},
					sq.Eq{"GroupConstrained": nil},
				},
			}
		}

		teamFilters = openInviteFilter
	}

	var groupConstrainedFilter sq.Sqlizer
	if opts.GroupConstrained != nil {
		if *opts.GroupConstrained {
			groupConstrainedFilter = sq.Eq{"GroupConstrained": true}
		} else {
			groupConstrainedFilter = sq.Or{
				sq.NotEq{"GroupConstrained": true},
				sq.Eq{"GroupConstrained": nil},
			}
		}

		if teamFilters == nil {
			teamFilters = groupConstrainedFilter
		} else {
			teamFilters = sq.Or{teamFilters, groupConstrainedFilter}
		}
	}

	if opts.TeamType != nil {
		teamTypeFilter := sq.Eq{"Type": *opts.TeamType}
		teamFilters = sq.And{teamFilters, teamTypeFilter}
	}

	query = query.Where(teamFilters)

	return query
}

// SearchAll returns from the database a list of teams that match the Name or DisplayName
// pas


/en.wikipedia.org/wiki/Luminous_intensity>
/// - <https://en.wikipedia.org/wiki/Candela>
#[derive(Clone, Copy, Debug)]
pub struct Intensity {
    pub m: Magnitude,
}

impl Intensity {
    /// New Intensity.
    #[inline]
    pub const fn new(m: Magnitude) -> Self {
        Self { m }
    }

    /// Returns the magnitude.
    #[inline]
    pub const fn m(&self) -> Magnitude {
        self.m
    }
}

impl_scalar_methods![Intensity, cd, candelas];
<gh_stars>0
// =======================================================================
//  Copyleft SnowFlakeOS Team 2018-∞.
//  Distributed under the terms of the 3-Clause BSD License.
//  (See accompanying file LICENSE or copy at
//   https://opensource.org/licenses/BSD-3-Clause)
// =======================================================================

// See also http://wiki.phoenix.com/wiki/index.php/EFI_GRAPHICS_OUTPUT_PROTOCOL

//* Use from external library *//
use core::{ptr, mem};

//* Use from local library *//
use super::Protocol;
use status::{Result, Status, Completion};
use utility::{Guid, PhysAddress};
use utility::guid::GRAPHICS_OUTPUT_PROTOCOL_GUID;

#[repr(C)]
pub struct GraphicsOutput {
    /// Returns information for an available graphics mode that the graphics device and the set of active video output devices supports.
    query_mode: efi_fcn! { fn(this: &GraphicsOutput, mode_number: u32, size_of_info: &mut usize, info: &mut *const ModeInfo) -> Status },
    /// Set the video device into the specified mode and clears the visible portions of the output display to black.
    set_mode: efi_fcn! { fn(this: &mut GraphicsOutput, mode_number: u32) -> Status },
    /// Blt a rectangle of pixels on the graphics screen. Blt stands for BLock Transfer.
    blt: efi_fcn! { fn(this: &mut GraphicsOutput, blt_buffer: *mut BltPixel, blt_operation: BltOperation, src_x: usize, src_y: usize, des_x: usize, des_y: usize, width: usize, height: usize, delta: usize) -> Status },
    mode: &'static Mode
}

impl Protocol for GraphicsOutput {
    const GUID: Guid = GRAPHICS_OUTPUT_PROTOCOL_GUID;
}

struct ModeIter<'a> {
    gop: &'a GraphicsOutput,
    current: u32,
    max: u32,
}

impl GraphicsOutput {
    pub unsafe fn query_mode(&self, index: u32) -> Result<SimpleMode> {
        let mut info_size = 0;
        let mut info = ptr::null();

        (self.query_mode)(self, index, &mut info_size, &mut info).into_with(|| {
                let info = &*info;
                SimpleMode {
                    index,
                    info_size,
                    info
                }
            }
        )
    }

    pub fn mode(&self) -> &'static Mode {
        (self.mode)
    }

    pub unsafe fn set_mode(&mut self, mode: &SimpleMode) -> Result<()> {
        (self.set_mode)(self, mode.index).into()
    }

	pub unsafe fn blt_fill(&mut self, px: BltPixel, w: usize, h: usize,  x: usize, y: usize) -> Result<()> {
		(self.blt)(self, &px as *const _ as *mut _, BltOperation::EfiBltVideoFill, x, y, 0,0, w, h, 0).into()
	}
	pub unsafe fn blt_to_video(&mut self, data: *mut BltPixel, w: usize, h: usize, x: usize, y: usize) -> Result<()> {
		(


 when data is null, maybe is raft non-data entry, check term and index indeed
			term := recordBinaryToTerm(headerBytes)
			index := recordBinaryToIndex(headerBytes)
			if term == 0 || index == 0 {
				glog.Fatalf("ReadRaftLogsByRindex, read data error: dateLen is 0,"+
					"segmentName:%s,term:%d,index:%d, readPosition:%d",
					s.Log.Name, term, index, readSegmentPosition)
			}
		}

		raftEntry, err := binaryToRaftEntry(s.Log.MapData[readSegmentPosition : readSegmentPosition+RecordHeaderSize+dateLen])
		if err != nil {
			glog.Fatalf("record Crc32 do not match,segmentName=%s,position=%d,length=%d,b=%v",
				s.Log.Name, readSegmentPosition, dateLen,
				s.Log.MapData[readSegmentPosition:readSegmentPosition+RecordHeaderSize+dateLen])
		}

		readSize += uint64(dateLen)
		raftLogs = append(raftLogs, raftEntry)

		//检查读取的raft log是否正确, 并检查连续性
		if raftEntry.Index != start+i {
			glog.Fatalf("[segment.go-ReadRaftLogsByRindex]: read entries are not continuous,"+
				"start+uint64(i)=%d,raftEntry.Index=%d,start=%d,end=%d,maxSize=%d",
				start+uint64(i), raftEntry.Index, start, end, maxSize)
		}

		if readSize >= maxSize {
			break
		}
		if raftEntry.Index+1 == end {
			break
		}
		if raftEntry.Index == s.LastRindex {
			break
		}
		readSegmentPosition = readSegmentPosition + RecordHeaderSize + dateLen
	}

	var leftSize uint64
	if readSize > maxSize {
		leftSize = 0
	} else {
		leftSize = maxSize - readSize
	}
	GetRecordDuration = time.Now().Sub(endGetIndex)
	//返回raftlog和还需要读取的size大小
	return raftLogs, leftSize, nil
}

//根据rindex读取对应的vindex
func (s *Segment) GetVindexByRindex(rindex uint64) (int64, error) {
	s.Mu.RLock()
	defer s.Mu.RUnlock()
	if s.Status == SegmentClosed {
		return -1, ErrSegmentClosed
	}
	ies, err := s.getIndexEntries(RaftIndexType, rindex, rindex+1, noLimit)
	if err != nil {
		glog.Errorf("[segment.go-GetVindexByRindex]:getIndexEntries error,err=%s,rindex=%d",
			err.Error(), rindex)
		return -1, err
	}
	return ies[0].Vindex, nil
}

//only delete record in the last segment, and must guarantee the rindex(start) in this segment.
func (s *Segment) DeleteRecordsByRindex(start uint64) error {
	s.Mu.Lock()
	defer s.Mu.Unlock()
	//检查Segment状态，只有最后一个segment(状态是可读写)才能被删除raft log
	if s.Status == SegmentClosed {
		glog.Infof("[segment.go-DeleteRecordsByRindex]:segment is closed,segmentName=%s",
			s.Log.Name)
		return nil
	}
	if s.Status == SegmentReadOnly {
		glog.Errorf("[segment.go-DeleteRecordsByRindex]:segment open with read, not allow to delete record,segmentName=%s",
			s.Log.Name)
		return ErrNotAllowDelete
	}

	firstRind


at float: x.xxxx
    struct DDFFloat4 { float f; };
    // get float1
    static inline auto Get2() noexcept ->DDFFloat2 { return{ 0.0f }; }
    // get float1
    static inline auto Get3() noexcept ->DDFFloat3 { return{ 0.0f }; }
    // get float1
    static inline auto Get4() noexcept ->DDFFloat4 { return{ 0.0f }; }
#endif
    // Ellipse
    struct Ellipse { Point2F point; float radius_x; float radius_y; };
    // transform point
    auto TransformPoint(const Matrix3X2F& matrix, Point2F point) noexcept->Point2F;
    // transform point - inverse
    auto TransformPointInverse(const Matrix3X2F& matrix, Point2F point) noexcept->Point2F;
    // is overlap?
    bool IsOverlap(const RectF& a, const RectF& b) noexcept;
    // is include?
    bool IsInclude(const RectF& a, const RectF& b) noexcept;
    // is include?
    bool IsInclude(const RectF& a, const Point2F& b) noexcept;
    // is same?
    bool IsSame(const RectF& a, const RectF& b) noexcept;
    // gui float same
    bool IsSameInGuiLevel(float a, float b) noexcept;
    // gui point same
    bool IsSameInGuiLevel(Point2F a, Point2F b) noexcept;
    // get area
    auto GetArea(const RectF& rect) noexcept -> float;
    // mix point
    auto Mix(Point2F from, Point2F to, float progress) noexcept ->Point2F;
    // mix rect
    auto Mix(const RectF& from, const RectF& to, float progress) noexcept;
    // round in gui level
    inline auto RoundInGuiLevel(float a) noexcept { return float(long(a + 0.5f)); }
    // round in gui level
    inline auto RoundInGuiLevel(double a) noexcept { return double(long(a + 0.5)); }
#if 0
    // a && b
    inline bool operator &&(const RectF& a, const RectF& b) noexcept {
        return LongUI::IsOverlap(a, b);
    }
    // a == b
    inline bool operator ==(const RectF& a, const RectF& b) noexcept {
        return LongUI::IsSame(a, b);
    }
    // a != b
    inline bool operator !=(const RectF& a, const RectF& b) noexcept {
        return LongUI::IsSame(a, b);
    }
#endif
    // gui size same
    inline bool IsSameInGuiLevel(const Size2F& a, const Size2F& b) noexcept {
        return IsSameInGuiLevel(
            reinterpret_cast<const Point2F&>(a),
            reinterpret_cast<const Point2F&>(b)
        );
    }
    // point + oparator
    template<typename T> auto operator +(Point<T> a, Point<T> b) noexcept {
        return Point<T>{ a.x + b.x, a.y + b.y };
    }
    // point - oparator
    template<typename T> auto operator -(Point<T> a, Point<T> b) noexcept {
        return Point<T>{ a.x - b.x, a.y - b.y };
    }
}


,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.5rem;margin-bottom:-.5rem;margin-left:-.5rem;border-bottom:0}.card-header-tabs .nav-link.active{background-color:#fff;border-bottom-color:#fff}.card-header-pills{margin-right:-.5rem;margin-left:-.5rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1rem;border-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom,.card-img-top{width:100%}.card-img,.card-img-top{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-group>.card{margin-bottom:.75rem}@media (min-width:576px){.card-group{display:flex;flex-flow:row wrap}.card-group>.card{flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.accordion-button{position:relative;display:flex;align-items:center;width:100%;padding:1rem 1.25rem;font-size:1rem;color:#212529;text-align:left;background-color:#e0e0e2;border:0;border-radius:0;overflow-anchor:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,border-radius .15s ease}@media (prefers-reduced-motion:reduce){.accordion-button{transition:none}}.accordion-button:not(.collapsed){color:#671615;background-color:#f1e8e8;box-shadow:inset 0 -1px 0 rgba(0,0,0,.125)}.accordion-button:not(.collapsed)::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23671615'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");transform:rotate(-180deg)}.accordion-button::after{


/*	$NetBSD: lshldi3.c,v 1.5 1995/10/07 09:26:29 mycroft Exp $	*/

/*-
 * Copyright (c) 1992, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * This software was developed by the Computer Systems Engineering group
 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
 * contributed to Berkeley.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)lshldi3.c	8.1 (Berkeley) 6/4/93";
#else
static char rcsid[] = "$NetBSD: lshldi3.c,v 1.5 1995/10/07 09:26:29 mycroft Exp $";
#endif
#endif /* LIBC_SCCS and not lint */

#include "quad.h"

/*
 * Shift an (unsigned) quad value left (logical shift left).
 * This is the same as arithmetic shift left!
 */
quad_t
__lshldi3(a, shift)
	quad_t a;
	qshift_t shift;
{
	union uu aa;

	aa.q = a;
	if (shift >= LONG_BITS) {
		aa.ul[H] = shift >= QUAD_BITS ? 0 :
		    aa.ul[L] << (shift - LONG_BITS);
		aa.ul[L] = 0;
	} else if (shift > 0) {
		aa.ul[H] = (aa.ul[H] << shift) |
		    (aa.ul[L] >> (LONG_BITS - shift));
		aa.ul[L] <<= shift;
	}
	return (aa.q);
}


tagNode = groovy.xml.QName(Constants.ANDROID_NAME_SPACE_URI, "tag", Constants.ATTR_PREFIX_ANDROID)
                dataBindingAttrResolveInfo.tagValue = attrValue
            }
            return null
        }
        if (attrFuncInfo == null) {
            //没有实现的attr方法, 但不放入invalidGenInfoMap中
            return null
        }

        val matchResult = attrMethodValueMatcher.match(viewClassName, viewFieldName, layoutName, layoutType
            , attrFuncInfo, attrValue, fieldInfo, contextName, usedReferenceRMap, idMap, usedTempVarMap)
        when (matchResult.matchType) {
            MatchType.FAILED -> {
                return matchResult.ignoreInfo
            }
            else -> codeBlockBuilder.addStatement(matchResult.result)
        }
        var viewTypeGenInfoMap = usedGenInfoMap[viewClassName]
        if (viewTypeGenInfoMap == null) {
            viewTypeGenInfoMap = hashMapOf()
            usedGenInfoMap[viewClassName] = viewTypeGenInfoMap
        }
        viewTypeGenInfoMap.putIfAbsent(attrFuncInfo.attrName, attrFuncInfo)
        attrFuncInfo.usedLocalVarMap?.forEach { (fullName, _) ->
            usedLocalVarMap.putIfAbsent(fullName, "")
        }
        finalUsedLocalVarMap.putAll(usedLocalVarMap)
        return null
    }

    fun makeViewGenResult(layoutName: String, reason: GenResult, info: String, noGenViewClassName: String = "") = ViewGenResultInfo(layoutName, reason, info, noGenViewClassName)

}package com.qxml.gen.tabLayout

import android.annotation.SuppressLint
import android.graphics.drawable.Drawable
import android.support.design.internal.ViewUtils
import android.support.design.widget.TabItem
import android.support.design.widget.TabLayout
import com.qxml.tools.ReflectUtils
import java.lang.reflect.Field

object TabLayoutHelper {

    private val contentInsetStartField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabLayout::class.java, "contentInsetStart")
    private val tabBackgroundResIdField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabLayout::class.java, "tabBackgroundResId")
    private val requestedTabMinWidthField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabLayout::class.java, "requestedTabMinWidth")
    private val requestedTabMaxWidthField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabLayout::class.java, "requestedTabMaxWidth")

    private val tabPaddingStartField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabLayout::class.java, "tabPaddingStart")
    private val tabPaddingTopField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabLayout::class.java, "tabPaddingTop")
    private val tabPaddingEndField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabLayout::class.java, "tabPaddingEnd")
    private val tabPaddingBottomField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabLayout::class.java, "tabPaddingBottom")

    private val tabTextSizeField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabLayout::class.java, "tabTextSize")
    private val tabIconTintModeField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabLayout::class.java, "tabIconTintMode")

    private val tabIndicatorAnimationDurationField = ReflectUtils.getDeclaredFieldOrNull(TabLayout::class.java, "tabIndicatorAnimationDuration")

    private val tabItemTextField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabItem::class.java, "text")
    private val tabItemIconField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabItem::class.java, "icon")
    private val tabItemCustomLayoutField: Field? = ReflectUtils.getDeclaredFieldOrNull(TabItem::class.java, "custom


, 16);
        const tokens = tokenize(params).concat(tokenize(extra));

        // Special case: "RST 10" really means 10 hex, so convert it to decimal.
        if (mnemonic === "rst") {
            tokens[0] = parseInt(tokens[0], 16).toString(10);
        }

        const fullOpcodes: OpcodeTemplate[] = opcodes.concat([opcode]);

        if (mnemonic === undefined) {
            // Fallthrough to next line. These are for different opcodes that map to the
            // same instruction. Just use the last one, any will do.
        } else {
            if (mnemonic === "shift") {
                // Recurse for shifted instructions.
                if (params === undefined) {
                    throw new Error("Shift must have params");
                }
                parseOpcodes(dirname, params, fullOpcodes, mnemonicMap, clr);
            } else {
                const fullOpcodesString = fullOpcodes.map(value => typeof(value) === "number" ? toHexByte(value) : "**").join("");
                const clrInst = findClrInstruction(clr, fullOpcodesString);
                if (clrInst === undefined) {
                    console.log("Didn't find " + fullOpcodesString + " in clr");
                } else {
                    // Fix up description to convert register names to upper case.
                    clrInst.description = fixClrDescription(clrInst.description);
                }

                // Add parameters.
                for (const token of tokens) {
                    if (token === "nn" || token === "nnnn" || token === "dd" || token === "offset") {
                        // For DDCB and FDCB instructions, the parameter is in the third position, not at the end.
                        if (fullOpcodes.length === 3 && (fullOpcodes[0] === 0xDD || fullOpcodes[0] === 0xFD) && fullOpcodes[1] === 0xCB) {
                            fullOpcodes.splice(2, 0, token);
                        } else {
                            fullOpcodes.push(token);
                        }
                    }
                }

                // Find mnemonic in map, adding if necessary.
                let mnemonicInfo = mnemonicMap[mnemonic] as any;
                if (mnemonicInfo === undefined) {
                    mnemonicInfo = {
                        variants: [],
                    };
                    mnemonicMap[mnemonic] = mnemonicInfo;
                }

                // Generate this variant.
                let variant: Variant = {
                    tokens: tokens,
                    opcode: fullOpcodes,
                    clr: clrInst ?? null,
                };
                mnemonicInfo.variants.push(variant);

                // For instructions like "ADD A,C", also produce "ADD C" with an implicit "A".
                if (tokens.length > 2 && tokens[0] === "a" && tokens[1] === ",") {
                    variant = Object.assign({}, variant, {
                        tokens: tokens.slice(2),
                    });
                    mnemonicInfo.variants.push(variant);
                }
            }
        }
    });
}

function addPseudoInstructions(mnemonics: Mnemonics) {
    mnemonics["ld"].variants.push({
        tokens: ["hl", ",", "bc"],
        opcode: [0x60, 0x69],
        clr: null,
    });
    mnemonics["ld"].


alid1 || !utf8Valid2:
		// Name and Comment definitely not UTF-8.
		f.NonUTF8 = true
	case !utf8Require1 && !utf8Require2:
		// Name and Comment use only single-byte runes that overlap with UTF-8.
		f.NonUTF8 = false
	default:
		// Might be UTF-8, might be some other encoding; preserve existing flag.
		// Some ZIP writers use UTF-8 encoding without setting the UTF-8 flag.
		// Since it is impossible to always distinguish valid UTF-8 from some
		// other encoding (e.g., GBK or Shift-JIS), we trust the flag.
		f.NonUTF8 = f.Flags&0x800 == 0
	}

	needUSize := f.UncompressedSize == ^uint32(0)
	needCSize := f.CompressedSize == ^uint32(0)
	needHeaderOffset := f.headerOffset == int64(^uint32(0))

	// Best effort to find what we need.
	// Other zip authors might not even follow the basic format,
	// and we'll just ignore the Extra content in that case.
	var modified time.Time
parseExtras:
	for extra := readBuf(f.Extra); len(extra) >= 4; { // need at least tag and size
		fieldTag := extra.uint16()
		fieldSize := int(extra.uint16())
		if len(extra) < fieldSize {
			break
		}
		fieldBuf := extra.sub(fieldSize)

		switch fieldTag {
		case zip64ExtraID:
			// update directory values from the zip64 extra block.
			// They should only be consulted if the sizes read earlier
			// are maxed out.
			// See golang.org/issue/13367.
			if needUSize {
				needUSize = false
				if len(fieldBuf) < 8 {
					return ErrFormat
				}
				f.UncompressedSize64 = fieldBuf.uint64()
			}
			if needCSize {
				needCSize = false
				if len(fieldBuf) < 8 {
					return ErrFormat
				}
				f.CompressedSize64 = fieldBuf.uint64()
			}
			if needHeaderOffset {
				needHeaderOffset = false
				if len(fieldBuf) < 8 {
					return ErrFormat
				}
				f.headerOffset = int64(fieldBuf.uint64())
			}
		case ntfsExtraID:
			if len(fieldBuf) < 4 {
				continue parseExtras
			}
			fieldBuf.uint32()        // reserved (ignored)
			for len(fieldBuf) >= 4 { // need at least tag and size
				attrTag := fieldBuf.uint16()
				attrSize := int(fieldBuf.uint16())
				if len(fieldBuf) < attrSize {
					continue parseExtras
				}
				attrBuf := fieldBuf.sub(attrSize)
				if attrTag != 1 || attrSize != 24 {
					continue // Ignore irrelevant attributes
				}

				const ticksPerSecond = 1e7    // Windows timestamp resolution
				ts := int64(attrBuf.uint64()) // ModTime since Windows epoch
				secs := int64(ts / ticksPerSecond)
				nsecs := (1e9 / ticksPerSecond) * int64(ts%ticksPerSecond)
				epoch := time.Date(1601, time.January, 1, 0, 0, 0, 0, time.UTC)
				modified = time.Unix(epoch.Unix()+secs, nsecs)
			}
		case unixExtraID, infoZipUnixExtraID:
			if len(fieldBuf) < 8 {
				continue parseExtras
			}
			fieldBuf.uint32()              // AcTime (ignored)
			ts := int64(fieldBuf.uint32()) // ModTime since Unix epoch
			modified = time.Unix(ts, 0)
		case extTimeExtraID:
			if


="text/javascript">var pathtoroot = "../../../../../../";
loadScripts(document, 'script');</script>

JavaScript is disabled on your browser.

<button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links">   </button>

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

SEARCH
<input type="text" id="search-input" disabled placeholder="Search">
<input type="reset" id="reset-button" disabled value="reset">

Uses of Class
se.michaelthelin.spotify.model_objects.specification.Context.JsonUtil

No usage of se.michaelthelin.spotify.model_objects.specification.Context.JsonUtil

Copyright © 2025. All rights reserved.

<!DOCTYPE HTML>

<title>Uses of Class se.michaelthelin.spotify.model_objects.specification.TrackLink.JsonUtil (Spotify Web API Java Client 9.3.0 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2025-07-24">
<meta name="description" content="use: package: se.michaelthelin.spotify.model_objects.specification, class: TrackLink, class: JsonUtil">
<meta name="generator" content="javadoc/ClassUseWriter">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../script-dir/jquery-ui.min.css" title="Style">


onJS")
        println("   const ImagePickerKMP = require('imagepickerkmp');")
        println("")
        println("   // Usage")
        println("   ImagePickerKMP.ImagePickerLauncher(onSuccess, onError, onCancel);")
        println("")
        println("Test: open ${packageDir.absolutePath}/test-zero-config.html")
    }
}

// Add clean dependencies
tasks.named("clean") {
    dependsOn("cleanNpmPackages")
}

// AUTOMATIC CONFIGURATION: Run buildNpmZeroConfig automatically
// Make 'assemble' always generate the NPM bundle
tasks.named("assemble") {
    finalizedBy("buildNpmZeroConfig")
}

// Make 'build' also generate the NPM bundle
tasks.named("build") {
    finalizedBy("buildNpmZeroConfig")
}

// Make 'publishToMavenLocal' generate the NPM bundle before publishing
tasks.withType<PublishToMavenLocal> {
    dependsOn("buildNpmZeroConfig")
}
/*
 * Copyright (C) 2016-2025 Álinson Santos Xavier <git@axavier.org>
 *
 * This file is part of Loop Habit Tracker.
 *
 * Loop Habit Tracker is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * Loop Habit Tracker is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */

package org.isoron.platform.gui

import org.isoron.platform.time.LocalDate
import org.junit.Assert.assertEquals
import org.junit.Test

class DatesTest {
    @Test
    fun testDatesBefore2000() {
        val date = LocalDate(-1)
        assertEquals(date.day, 31)
        assertEquals(date.month, 12)
        assertEquals(date.year, 1999)
    }
}
/*
 * Copyright (C) 2016-2025 Álinson Santos Xavier <git@axavier.org>
 *
 * This file is part of Loop Habit Tracker.
 *
 * Loop Habit Tracker is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * Loop Habit Tracker is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.isoron.uhabits.core.commands

import org.isoron.uhabits.core.BaseUnitTest
import org.isoron.uhabits.core.models.Habit
import org.junit.Before
import org.junit.Test
import kotlin.test.assertFalse
import kotlin.test.assertTrue

class ArchiveHabitsCommandTest : BaseUnitTest() {
    private lateinit var command: ArchiveHabitsCommand
    private lateinit var habit: Habit

    @Before
    @Throws(Exception::class)
    override fun setUp() {
        super.setUp()
        habit = fixtures.createShortHabit()
        habitList.add(habit)
        command = ArchiveHabitsCommand(habitList, listOf(habit))
    }

    @Test
    fun testExecute() {
        assertFalse(habit.isArchived)
        command.run()
        assertTrue(habit.isArchived)
    }
}
/*
 * Copyright (C) 2016-2025 Álinson Santos Xavier <git@axavier.org>
 *
 * This file is part of Loop Habit Tracker.
 *
 * Loop Habit Tracker is free software: you can redistribute it and/or modify


round(p2.y);

        let deltax = Math.abs(x2 - x1);
        let deltay = Math.abs(y2 - y1);
        let error = 0;
        let deltaerr = deltay;
        let y = y1;
        // let diry = Math.sign(y2 - y1);
        for (let x = x1; x < x2; x++){
            // console.log(`x = ${x}`);
            // console.log(`error raw = ${error}`);
            // console.log(`error = ${error / (deltax)}`);
            if (x > x1) {
                p = new Point(x, y)
                if (reflOyFlag) p = p.reflOy();
                if (reflOxFlag) p = p.reflOx();
                if (rotateFi) p = p.rotate(-rotateFi);
                result.push(p);
            }
            error += deltaerr;
            if (error * 2 > deltax){
                // y += diry;
                y--;
                error -= deltax;
            }
        }

        return result;
    }

    draw() {
        this.p1.draw();
        this.p2.draw();
        drawLine(this.p1, this.p2);
    }
}

class Circle {
    p: Point;
    r: number;

    constructor(p: Point, r: number) {
        this.p = p;
        this.r = r;
    }

    /*
    P(0,R)          E
    +-------------+
                  |
                  |
                 --- M(1, R - 1/2)
                  |
                  |
                  +
                    SE

    f(x,y) = x^2 + y^2 - R^2
    -- f > 0 - точка вне круга
    -- f = 0 - точка на окружности
    -- f < 0 - точка внутри круга
    F(M) = f(x+1, y - 1/2) = ... = x^2 + 2x + 1 + y^2 - y + 1/4 - R^2
    f(x+2, y - 1/2) = ... = F(M) + 2x + 3
    f(x+2, y - 3/2) = ... = F(M) + 2x - 2y + 5

    f(M0) = f(1, R-1/2) = ... = 5/4 - R

    incrE = 2x + 3
    incrSE = 2x - 2y + 5
    if (picked E) incrE += 2 incrSE += 2
    if (picked SE) incrE +=2 incrSE += 4
     */
    bresenham(): Point[] {
        let result: Point[] = [];
        let x = 0;
        let y = this.r;
        // 1 вместо 5/4 т.к. 1/4 не влияет на результат
        let error = 1 - this.r;
        let deltaE = 3;
        let deltaSE = 5 - 2*this.r
        while (y >= x) {
            result.push(new Point(x, y));
            if (error >= 0) {
                y--;
                error +=  deltaSE;
                deltaSE += 4;
            } else {
                error += deltaE;
                deltaSE += 2;
            }
            deltaE += 2;
            x++;
        }
        return result;
    }

    draw() {
        drawCircle(this.p, this.r, false, "#000000");
    }
}

function drawLine(p1: Point, p2: Point, color: string = "#000000") {
    var ctx = canvas.getContext("2d");
    ctx.strokeStyle = color;
    ctx.beginPath();
    ctx.moveTo(p1.toAbsolute().x, p1.toAbsolute().y);
    ctx.lineTo(p2.toAbsolute().x, p2.toAbsolute().y);
    ctx.stroke();
}

function drawCircle(p: Point, r: number, filled: boolean = false, color: string = "#000000") {
    var ctx = canvas.getContext("2d");
    ctx.beginPath();
    // ctx.moveTo(p.toAbsolute().x, p.toAbsol


  .then((response) => {
        if (!response.ok) {
          throw new Error('Network response was not OK')
        }
        return response.json()
      })
      .then((data) => data.contents)
      .catch((error) => {
        throw new Error(error)
      })
    // console.log(cmsData)
    // チャット画面のtoggle
    toggleChat()
    // チャットに未読があるかlsと比較してフラグ描画
    hasUnReadItem(cmsData)
    // チャット一覧の内容描画
    makeListHTML(cmsData)
    // チャット一覧-詳細の移動
    setListToDetail(cmsData)
  } catch (error) {
    console.error(error)
  }
}
init()

//pages
const reloadFunc = () => {
  const reloadBtn = document.getElementById('js-reload')
  if (!reloadBtn) return
  reloadBtn.addEventListener('click', () => {
    location.reload()
  })
}
reloadFunc()

// fullPage > floatBtn
const toggleModal = () => {
  const BtnDom = document.getElementById('js-modal-on')
  const BodyDom = document.getElementById('js-modal-body')
  if (!BtnDom || !BodyDom) return
  BtnDom.addEventListener('click', () => {
    BodyDom.classList.add('active')
  })

  const closeDom = document.getElementById('js-modal-off')
  closeDom?.addEventListener('click', () => {
    BodyDom.classList.remove('active')
  })
}
toggleModal()
export interface Task {
  id: number;
  title: string;
  status: TaskStatus;
  priority?: TaskPriority;
  create?: Date;
}

export enum TaskStatus {
  Uncompleted,
  Completed,
  putOff
}

export enum TaskPriority {
  Important,
  Unimportant,
  Idea
}
import { CfnInclude, IncludedNestedStack } from '@aws-cdk/cloudformation-include';
import * as cdk from '@aws-cdk/core';
import * as fs from 'fs-extra'
import * as uuid from 'uuid'
export interface AmplifyClIsynthCdkProps {
  /**
   * The Amplify CLI environment that you would like to incorporate
   * see https://docs.amplify.aws/cli/teams/overview
   */
  readonly env: string;

  /**
   * The path to the synthesized folder that contains the artifacts for the Amplify CLI backend
   * ex: ./amplify-synth-out/
   */
  readonly path: string;

  /**
   * Specify the bucket used to stage resources for the Cloudformation and code assets
   * AMPLIFY_CLI_DEPLOYMENT_BUCKET: deploys to the bucket provided by Amplify CLI
   * CDK_DEPLOYMENT_BUCKET: deploys to the bucket
   */
  readonly DeploymentBucketType: DeploymentBucketType;
}

export enum DeploymentBucketType {
  AMPLIFY_CLI_DEPLOYMENT_BUCKET = "AMPLIFY_CLI_DEPLOYMENT_BUCKET",
  CDK_DEPLOYMENT_BUCKET = "CDK_DEPLOYMENT_BUCKET"
}
export enum FrontendType {

}

export interface IAmplifyCLISynthCDK {
  getNestedStacksByCategory(
    category: String,
    categoryName: string
  ): IncludedNestedStack[];

  getNestedStacksOutPutByCategory(category: String, categoryName: string): cdk.CfnOutput[]

  generateExport(
    frontEndType: FrontendType,
    props: { objectKey: String }
  ): void;
}

export class AmplifyClIsynthCdk extends


# INFO ABOUT ALLOCATION OF GLOBAL VARIABLES
# 0x08000000  - address of the beginning of the statically allocated memory,
#               stored in r12
# r12 + 0x20  - address of the pointer to the frame buffer
# r12 + 0x40  - address of the x coordinate of the top left corner of the
#               currently falling piece
# r12 + 0x44  - address of the y coordinate of the top left corner of the
#               currently falling piece
# r12 + 0x48  - address of the shape of the currently falling piece
# r12 + 0x4c  - address of the rotation of the currently falling piece
# r12 + 0x50  - address of the shape of the next piece
# r12 + 0x54  - address of the x coordinate of the top left corner of the game
#               board including sentinel values
# r12 + 0x58  - address of the y coordinate of the top left corner of the game
#               board including sentinel values
# r12 + 0x5c  - address of the x coordinate of the bottom right corner of the
#               game board including sentinel values
# r12 + 0x60  - address of the y coordinate of the bottom right corner of the
#               game board including sentinel values
# r12 + 0x64  - address of the x coordinate of the top-left corner of tested
#               next position of the falling piece
# r12 + 0x68  - address of the y coordinate of the top-left corner of tested
#               next position of the falling piece
# r12 + 0x6c  - address of the tested rotation of the falling piece
# r12 + 0x70  - address of the number of last available row to the user
#               (needed for adding line in multi-player)
# r12 + 0x74  - address of the seed of the generator of pseudo random numbers
# r12 + 0x78  - address of the number of lines to send
# r12 + 0x7c  - address of the number of lines received
# r12 + 0x80  - address of the beginning of the array in which the rotations
#               are encoded
# r12 + 0x800 - address of the beginning of the game board array
# r12 + 0xe00 - address of the beginning of the character encoding
# r12 + 0x1600 - address of the second buffer

b main

# load game assets
assets:
	.incbin "welcome_screen.bin"
	.incbin "gamelost.bin"
	.incbin "gamewon.bin"
	.incbin "welcome_start.bin"

	.incbin "O_yellow.bin"
	.incbin "I_cyan.bin"
	.incbin "S_green.bin"
	.incbin "Z_red.bin"
	.incbin "L_orange.bin"
	.incbin "J_blue.bin"
	.incbin "T_purple.bin"
	.incbin "filled_grey.bin"

	.incbin "text_next.bin"

LoadScreenWelcome:
	push {lr}


: getExternalStorageDirectory,
      );

  static PathProviderDirectory get externalCacheDirectories => PathProviderDirectory(
        name: "externalCacheDirectories",
        desc: "外部存储缓存目录",
        func: getExternalCacheDirectories,
      );

  static PathProviderDirectory get externalStorageDirectories => PathProviderDirectory(
        name: "externalStorageDirectories",
        desc: "可根据类型获取外部存储目录，如SD卡、单独分区等，和外部存储目录不同在于他是获取一个目录数组。但iOS不支持外部存储目录，目前只有Android才支持。",
        func: getExternalStorageDirectories,
      );

  static PathProviderDirectory get downloadsDirectory => PathProviderDirectory(
        name: "downloadsDirectory",
        desc: "桌面程序下载目录,主要用于存储下载文件的目录，只适用于Linux、MacOS、Windows，Android和iOS平台无法使用。",
        func: getDownloadsDirectory,
      );

  static List<PathProviderDirectory> get values => [
        temporaryDirectory,
        applicationSupportDirectory,
        libraryDirectory,
        applicationDocumentsDirectory,
        applicationCacheDirectory,
        externalStorageDirectory,
        externalCacheDirectories,
        externalStorageDirectories,
        downloadsDirectory,
      ];

  PathProviderDirectory({
    required this.name,
    required this.func,
    required this.desc,
    this.custom,
  });

  final String name;
  final Function func;
  final String desc;

  /// 自定义
  Map<String, dynamic>? custom;

  /// 初始化目录路径
  static Future<List<PathProviderDirectory>> initail() async {
    var list = <PathProviderDirectory>[];
    for (final e in PathProviderDirectory.values) {
      e.custom ??= {};
      try {
        final result = await e.func();
        e.custom?["dir"] = result;
      } catch (exception) {
        debugPrint("获取目录失败 $exception");
        e.custom?["exception"] = exception.toString();
        continue;
      } finally {
        list.add(e);
      }
    }
    // debugPrint("list: ${list.length}");
    return list;
  }
}
//
//  TagChangeNotifier.dart
//  flutter_templet_project
//
//  Created by shang on 2024/4/4 10:26.
//  Copyright © 2024/4/4 shang. All rights reserved.
//

import 'package:flutter/cupertino.dart';
import 'package:flutter_templet_project/model/tag_detail_model.dart';
import 'package:flutter_templet_project/network/api/tag_clear_api.dart';
import 'package:flutter_templet_project/network/api/tag_list_api.dart';
import 'package:flutter_templet_project/network/api/tag_set_api.dart';
import 'package:flutter_templet_project/vendor/toast_util.dart';

/// 标签管理器
class TagViewModel extends ChangeNotifier {
  /// 标签列表
  List<TagDetailModel> _list = [];
  List<TagDetailModel> get list => _list;
  set list(List<TagDetailModel> value) {
    if (_list == value) {
      return;
    }
    _list = value;
    notifyListeners();
  }

  /// 新增或者编辑标签操作是否成功
  bool _isUpdate = false;
  bool get isUpdate => _isUpdate;
  set isUpdate(bool value) {
    if (_isUpdate == value) {
      return;
    }
    _isUpdate = value;
    notifyListeners();
  }

  /// 获取标签
  Future<({bool isSuccess, String message, List<TagDetailModel> result})>
      requestTagList({


:hover,
html .ui-bar-c a:hover,
html .ui-body-c a:hover,
html body .ui-group-theme-c a:hover {
	color: #005599 /*{c-link-hover}*/;
}
.ui-page-theme-c a:active,
html .ui-bar-c a:active,
html .ui-body-c a:active,
html body .ui-group-theme-c a:active {
	color: #005599 /*{c-link-active}*/;
}
/* Button up */
.ui-page-theme-c .ui-btn,
html .ui-bar-c .ui-btn,
html .ui-body-c .ui-btn,
html body .ui-group-theme-c .ui-btn,
html head + body .ui-btn.ui-btn-c,
/* Button visited */
.ui-page-theme-c .ui-btn:visited,
html .ui-bar-c .ui-btn:visited,
html .ui-body-c .ui-btn:visited,
html body .ui-group-theme-c .ui-btn:visited,
html head + body .ui-btn.ui-btn-c:visited {
	background: #BD362F /*{c-bup-background-color}*/;
	border-color: #d82c35 /*{c-bup-border}*/;
	color: #ffffff /*{c-bup-color}*/;
	text-shadow: undefined /*{c-bup-shadow-x}*/ undefined /*{c-bup-shadow-y}*/ undefined /*{c-bup-shadow-radius}*/ undefined /*{c-bup-shadow-color}*/;
}
/* Button hover */
.ui-page-theme-c .ui-btn:hover,
html .ui-bar-c .ui-btn:hover,
html .ui-body-c .ui-btn:hover,
html body .ui-group-theme-c .ui-btn:hover,
html head + body .ui-btn.ui-btn-c:hover {
	background: #DA4F49 /*{c-bhover-background-color}*/;
	border-color: #d82c35 /*{c-bhover-border}*/;
	color: #ffffff /*{c-bhover-color}*/;
	text-shadow: undefined /*{c-bhover-shadow-x}*/ undefined /*{c-bhover-shadow-y}*/ undefined /*{c-bhover-shadow-radius}*/ undefined /*{c-bhover-shadow-color}*/;
}
/* Button down */
.ui-page-theme-c .ui-btn:active,
html .ui-bar-c .ui-btn:active,
html .ui-body-c .ui-btn:active,
html body .ui-group-theme-c .ui-btn:active,
html head + body .ui-btn.ui-btn-c:active {
	background: #d2332d /*{c-bdown-background-color}*/;
	border-color: #d82c35 /*{c-bdown-border}*/;
	color: #ffffff /*{c-bdown-color}*/;
	text-shadow: undefined /*{c-bdown-shadow-x}*/ undefined /*{c-bdown-shadow-y}*/ undefined /*{c-bdown-shadow-radius}*/ undefined /*{c-bdown-shadow-color}*/;
}
/* Active button */
.ui-page-theme-c .ui-btn.ui-btn-active,
html .ui-bar-c .ui-btn.ui-btn-active,
html .ui-body-c .ui-btn.ui-btn-active,
html body .ui-group-theme-c .ui-btn.ui-btn-active,
html head + body .ui-btn.ui-btn-c.ui-btn-active,
/* Active checkbox icon */
.ui-page-theme-c .ui-checkbox-on:after,
html .ui-bar-c .ui-checkbox-on:after,
html .ui-body-c .ui-checkbox-on:after,
html body .ui-group-theme-c .ui-


this.subscriptions[topic] && (delete this.subscriptions[topic][token]);
    }
  }

  export default new PubSub();// Copyright (c) 2019 Denolibs authors. All rights reserved. MIT license.

import { runTests, test } from "https://deno.land/std/testing/mod.ts";
import {
  assertEquals,
  assertNotEquals
} from "https://deno.land/std/testing/asserts.ts";
import EventEmitter from "../mod.ts";

function hasListenerProp(cur: any): boolean {
  return cur.hasOwnProperty("listener");
}

function eventListener1(): void {
  console.log("First event occured!");
}

function eventListener2(): void {
  console.log("Second event occured!");
}

function eventListener3(): void {
  console.log("Third event occured!");
}

function eventListener4(): void {
  console.log("Fourth event occured!");
}

function StatusListener(code: number, msg: string): void {
  console.log(`Got ${code} and ${msg}`);
}

test(function registerListeners(): void {
  const myEmitter = new EventEmitter();

  myEmitter.on("eventName", eventListener1);
  myEmitter.on("eventName", eventListener2);

  assertEquals(myEmitter.listenerCount("eventName"), 2);
});

test(function removeListeners(): void {
  const myEmitter = new EventEmitter();

  myEmitter.on("eventName", eventListener1);
  myEmitter.on("eventName", eventListener2);
  myEmitter.on("eventName", eventListener3);
  myEmitter.on("eventName", eventListener4);
  myEmitter.off("eventName", eventListener2);

  assertEquals(myEmitter.listeners("eventName"), [
    eventListener1,
    eventListener3,
    eventListener4
  ]);
});

test(function removeAllListenersFromSpecifiedEvent(): void {
  const myEmitter = new EventEmitter();

  myEmitter.on("eventName1", eventListener1);
  myEmitter.on("eventName1", eventListener2);
  myEmitter.on("eventName2", eventListener3);
  myEmitter.on("eventName2", eventListener4);
  myEmitter.removeAllListeners("eventName1");

  assertEquals(myEmitter.listenerCount("eventName1"), 0);
});

test(function removeAllListenersFromAllEvents(): void {
  const myEmitter = new EventEmitter();

  myEmitter.on("eventName1", eventListener1);
  myEmitter.on("eventName1", eventListener2);
  myEmitter.on("eventName2", eventListener3);
  myEmitter.on("eventName2", eventListener4);
  myEmitter.removeAllListeners();

  const eventNames = myEmitter.eventNames();
  let nListener = 0;
  for (let i = 0; i < eventNames.length; i++) {
    nListener += myEmitter.listenerCount(eventNames[i]);
  }

  assertEquals(nListener, 0);
});

test(function emitRegisteredEvent(): void {
  const myEmitter = new EventEmitter();

  myEmitter.on("eventName", eventListener1);
  myEmitter.on("eventName", eventListener2);
  myEmitter.on("eventName", eventListener3);

  assertEquals(myEmitter.emit("eventName"), true);
});

test(function emitWithCallbackParameters(): void {
  const myEmitter = new EventEmitter();

  myEmitter.on("eventName", StatusListener);

  assertEquals(myEmitter.emit("eventName", 200, "OK"), true);
});

test(function emitOnce(): void {
  const myEmitter = new EventEmitter();

  myEmitter.once("eventNameOnce", eventListener1);
  myEmitter.once("eventNameOnce", eventListener2);
  myEmitter.once("eventNameOnce", eventListener3);
  myEmitter.once("eventNameOnce", eventListener4);
  myEmitter.emit("eventNameOnce");

  assertEquals(myEmitter.listenerCount("eventNameOnce"), 0);
});

test(function emitUnRegisteredEvent(


/*******************************************************************************
 *
 * Copyright (c) 1993 Intel Corporation
 *
 * Intel hereby grants you permission to copy, modify, and distribute this
 * software and its documentation.  Intel grants this permission provided
 * that the above copyright notice appears in all copies and that both the
 * copyright notice and this permission notice appear in supporting
 * documentation.  In addition, Intel grants this permission provided that
 * you prominently mark as "not part of the original" any modifications
 * made to this software or documentation, and that the name of Intel
 * Corporation not be used in advertising or publicity pertaining to
 * distribution of the software or the documentation without specific,
 * written prior permission.
 *
 * Intel Corporation provides this AS IS, WITHOUT ANY WARRANTY, EXPRESS OR
 * IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY
 * OR FITNESS FOR A PARTICULAR PURPOSE.  Intel makes no guarantee or
 * representations regarding the use of, or the results of the use of,
 * the software and documentation in terms of correctness, accuracy,
 * reliability, currentness, or otherwise; and you rely on the software,
 * documentation and results solely at your own risk.
 *
 * IN NO EVENT SHALL INTEL BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS,
 * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES
 * OF ANY KIND.  IN NO EVENT SHALL INTEL'S TOTAL LIABILITY EXCEED THE SUM
 * PAID TO INTEL FOR THE PRODUCT LICENSED HEREUNDER.
 *
 ******************************************************************************/

	.file "sncat_ca.s"
#ifdef	__PIC
	.pic
#endif
#ifdef	__PID
	.pid
#endif
/*
 * (c) copyright 1988,1993 Intel Corp., all rights reserved
 */

/*
	procedure strncat  (optimized assembler version for the CA)

	dest_addr = strncat (dest_addr, src_addr, max_bytes)

	append the null terminated string pointed to by src_addr to the null
	terminated string pointed to by dest_addr.  Return the original
	dest_addr.  If the source string is longer than max_bytes, then
	append only max_bytes bytes, and tack on a null byte on the end

	This routine will fail if the source and destination string
	overlap (in particular, if the end of the source is overlapped
	by the beginning of the destination).  The behavior is undefined.
	This is acceptable according to the draft C standard.

	Undefined behavior will also occur if the end of the source string
	(i.e. the terminating null byte) is in the last word of the program's
	allocated memory space.  This is so because, in several cases, strncat
	will fetch ahead one word.  Disallowing the fetch ahead would impose
	a severe performance penalty.

	This program handles five cases:

	1) both arguments start on a word boundary
	2) neither are word aligned, but they are offset by the same amount
	3) source is word aligned, destination is not
	4) destination is word aligned, source is not
	5) neither is word aligned, and they are offset by differing amounts

	At the time of this writing, only g0 thru g7 and g13 are available
	for use in


;
    labelContainer.appendChild(label);
  });

  return labelContainer;
}

exports.listen = listen;
exports.toggle = toggle;
exports.enable = enable;
exports.disable = disable;
exports.setColor = setColor;
exports.reset = reset;

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"spotify-cosmos-api":376}],127:[function(require,module,exports){
'use strict';

// This should be removed later when nothing is calling this method

exports.getVersion = function () {
  return 1;
};

},{}],128:[function(require,module,exports){
'use strict';

module.exports = {
  'de': require('../i18n/de.lang'),
  'el': require('../i18n/el.lang'),
  'en': require('../i18n/en.lang'),
  'es': require('../i18n/es.lang'),
  'es-419': require('../i18n/es-419.lang'),
  'fi': require('../i18n/fi.lang'),
  'fr': require('../i18n/fr.lang'),
  'fr-CA': require('../i18n/fr-CA.lang'),
  'hu': require('../i18n/hu.lang'),
  'id': require('../i18n/id.lang'),
  'it': require('../i18n/it.lang'),
  'ja': require('../i18n/ja.lang'),
  'nl': require('../i18n/nl.lang'),
  'pl': require('../i18n/pl.lang'),
  'pt-BR': require('../i18n/pt-BR.lang'),
  'sv': require('../i18n/sv.lang'),
  'tr': require('../i18n/tr.lang'),
  'zh-Hant': require('../i18n/zh-Hant.lang'),
  'zsm': require('../i18n/zsm.lang')
};

},{"../i18n/de.lang":106,"../i18n/el.lang":107,"../i18n/en.lang":108,"../i18n/es-419.lang":109,"../i18n/es.lang":110,"../i18n/fi.lang":111,"../i18n/fr-CA.lang":112,"../i18n/fr.lang":113,"../i18n/hu.lang":114,"../i18n/id.lang":115,"../i18n/it.lang":116,"../i18n/ja.lang":117,"../i18n/nl.lang":118,"../i18n/pl.lang":119,"../i18n/pt-BR.lang":120,"../i18n/sv.lang":121,"../i18n/tr.lang":122,"../i18n/zh-Hant.lang":123,"../i18n/zsm.lang":124}],129:[function(require,module,exports){
// hbsfy compiled Handlebars template
var HandlebarsCompiler = require('hbsfy/runtime');
module.exports = HandlebarsCompiler.template(function (Handlebars,depth0,helpers,partials,data) {
  this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
  var buffer = "", stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;

function program1(depth0,data) {

  var buffer = "", helper, options;
  buffer += "\n
"
    + escapeExpression((helper = helpers.loc || (depth0 && depth0.loc),options={hash:{},data:data},helper ? helper.call(depth0, "Save", options) : helperMissing.call(depth0, "loc", "Save", options)))
    + "
\n
"
    + escapeExpression((helper = helpers.loc || (depth0 && depth0.loc),options={hash:{},data:data},helper ? helper.call(depth0, "Saved", options) : helperMissing.call(depth0, "loc", "Saved", options)


# letters = ["a", "b", "c"]
# for letter in enumerate(letters):   # this enumerater object will give us a tuple.
#     # print(letter)
#     # print(letter[0])
#     print(letter[0], letter[1])

letters = ["a", "b", "c"]
items = (0, "a")
index, letter = items
for index, letter in enumerate(letters):
    print(index, letter)


ion)
            put(COL_GENRE, obj.genre)
            put(COL_TITLE, obj.originalTitle)
            put(COL_STATUS, obj.status)
            put(COL_THUMBNAIL_URL, obj.thumbnail_url)
            put(COL_FAVORITE, obj.favorite)
            put(COL_LAST_UPDATE, obj.last_update)
            put(COL_NEXT_UPDATE, obj.next_update)
            put(COL_INITIALIZED, obj.initialized)
            put(COL_VIEWER, obj.viewer_flags)
            put(COL_CHAPTER_FLAGS, obj.chapter_flags)
            put(COL_DATE_ADDED, obj.date_added)
            put(COL_LANG_FLAG, obj.lang_flag)
            put(COL_FOLLOW_STATUS, obj.follow_status?.int)
            put(COL_ANILIST_ID, obj.anilist_id)
            put(COL_KITSU_ID, obj.kitsu_id)
            put(COL_MY_ANIME_LIST_ID, obj.my_anime_list_id)
            put(COL_MANGA_UPDATES_ID, obj.manga_updates_id)
            put(COL_ANIME_PLANET_ID, obj.anime_planet_id)
            put(COL_OTHER_URLS, obj.other_urls)
            put(COL_SCANLATOR_FILTER_FLAG, obj.filtered_scanlators)
            put(COL_MISSING_CHAPTERS, obj.missing_chapters)
            put(COL_RATING, obj.rating)
            put(COL_USERS, obj.users)
            put(COL_THREAD_ID, obj.thread_id)
            put(COL_REPLIES_COUNT, obj.replies_count)
            put(COL_MERGE_MANGA_URL, obj.merge_manga_url)
            put(COL_MANGA_LAST_VOLUME, obj.last_volume_number)
            put(COL_MANGA_LAST_CHAPTER, obj.last_chapter_number)
            put(COL_MERGE_MANGA_IMAGE_URL, obj.merge_manga_image_url)
            put(COL_ALT_TITLE, obj.alt_titles)
            put(COL_USER_COVER, obj.user_cover)
            put(COL_USER_TITLE, obj.user_title)
            put(COL_LANGUAGE_FILTER_FLAG, obj.filtered_language)
        }
}

interface BaseMangaGetResolver {
    fun mapBaseFromCursor(manga: Manga, cursor: Cursor) =
        manga.apply {
            id = cursor.getLong(cursor.getColumnIndex(COL_ID))
            source = cursor.getLong(cursor.getColumnIndex(COL_SOURCE))
            url = cursor.getString(cursor.getColumnIndex(COL_URL))
            artist = cursor.getString(cursor.getColumnIndex(COL_ARTIST))
            author = cursor.getString(cursor.getColumnIndex(COL_AUTHOR))
            description = cursor.getString(cursor.getColumnIndex(COL_DESCRIPTION))
            genre = cursor.getString(cursor.getColumnIndex(COL_GENRE))
            title = cursor.getString(cursor.getColumnIndex(COL_TITLE))
            status = cursor.getInt(cursor.getColumnIndex(COL_STATUS))
            thumbnail_url = cursor.getString(cursor.getColumnIndex(COL_THUMBNAIL_URL))
            favorite = cursor.getInt(cursor.getColumnIndex(COL_FAVORITE)) == 1
            last_update = cursor.getLong(cursor.getColumnIndex(COL_LAST_UPDATE))
            next_update = cursor.getLong(cursor.getColumnIndex(COL_NEXT_UPDATE))
            initialized = cursor.getInt(cursor.getColumnIndex(COL_INITIALIZED)) == 1
            viewer_flags =


e("s1"); resumeCollecting(s1)
            val s2 = subscribe("s2"); resumeCollecting(s2)
            // now emit 0, make sure it is collected
            emitRightNow(0); expectReplayOf(0)
            awaitCollected(s1, 0)
            awaitCollected(s2, 0)
            // now emit 1, and only first subscriber continues and collects it
            emitRightNow(1); expectReplayOf(1)
            collect(s1, 1)
            // now emit 2, it suspend (s2 is blocking it)
            val e2 = emitSuspends(2)
            resumeCollecting(s1) // resume, but does not collect (e2 is still queued)
            collect(s2, 1) // resume + collect next --> resumes emitter, thus resumes s1
            awaitCollected(s1, 2) // <-- S1 collects value from the newly resumed emitter here !!!
            emitResumes(e2); expectReplayOf(2)
            // now emit 3, it suspends (s2 blocks it)
            val e3 = emitSuspends(3)
            collect(s2, 2)
            emitResumes(e3); expectReplayOf(3)
        }

    @Test
    fun testSuspendedConcurrentEmitAndCancelSubscriberReplay1() =
        testSharedFlow<Int>(MutableSharedFlow(1)) {
            val a = subscribe("a");
            emitRightNow(0); expectReplayOf(0)
            collect(a, 0)
            emitRightNow(1); expectReplayOf(1)
            val e2 = emitSuspends(2) // suspends until 1 is collected
            val e3 = emitSuspends(3) // suspends until 1 is collected, too
            cancel(a) // must resume emitters 2 & 3
            emitResumes(e2)
            emitResumes(e3)
            expectReplayOf(3) // but replay size is 1 so only 3 should be kept
            // Note: originally, SharedFlow was in a broken state here with 3 elements in the buffer
            val b = subscribe("b")
            collect(b, 3)
            emitRightNow(4); expectReplayOf(4)
            collect(b, 4)
        }

    @Test
    fun testSuspendedConcurrentEmitAndCancelSubscriberReplay1ExtraBuffer1() =
        testSharedFlow<Int>(MutableSharedFlow( replay = 1, extraBufferCapacity = 1)) {
            val a = subscribe("a");
            emitRightNow(0); expectReplayOf(0)
            collect(a, 0)
            emitRightNow(1); expectReplayOf(1)
            emitRightNow(2); expectReplayOf(2)
            val e3 = emitSuspends(3) // suspends until 1 is collected
            val e4 = emitSuspends(4) // suspends until 1 is collected, too
            val e5 = emitSuspends(5) // suspends until 1 is collected, too
            cancel(a) // must resume emitters 3, 4, 5
            emitResumes(e3)
            emitResumes(e4)
            emitResumes(e5)
            expectReplayOf(5)
            val b = subscribe("b")
            collect(b, 5)
            emitRightNow(6); expectReplayOf(6)
            collect(b, 6)
        }

    private fun <T> testSharedFlow(
        sharedFlow: MutableSharedFlow<T>,
        scenario: suspend ScenarioDsl<T>.() -> Unit
    ) = runTest {
        var dsl: ScenarioDsl<T>? = null
        try {
            coroutineScope {
                dsl = ScenarioDsl<T>(sharedFlow, coroutineContext)
                dsl!!.scenario()
                dsl!!.stop()
            }
        } catch (e: Throwable) {
            dsl?.printLog()
            throw e
        }
    }

    private data class TestJob(val job: Job, val name:


/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | foam-extend: Open Source CFD
   \\    /   O peration     | Version:     4.1
    \\  /    A nd           | Web:         http://www.foam-extend.org
     \\/     M anipulation  | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
    This file is part of foam-extend.

    foam-extend is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
    Free Software Foundation, either version 3 of the License, or (at your
    option) any later version.

    foam-extend is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.

Description

\*---------------------------------------------------------------------------*/

#include "octree.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

defineTypeNameAndDebug(Foam::octreeName, 0);

// ************************************************************************* //


	/* Stop the sound thread. */
	_waveout = nullptr;
	SetEvent(_event);
	WaitForSingleObject(_thread, INFINITE);

	/* Close the sound device. */
	waveOutReset(waveout);
	waveOutUnprepareHeader(waveout, &_wave_hdr[0], sizeof(WAVEHDR));
	waveOutUnprepareHeader(waveout, &_wave_hdr[1], sizeof(WAVEHDR));
	waveOutClose(waveout);

	CloseHandle(_thread);
	CloseHandle(_event);
}
/*
 * This file is part of OpenTTD.
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 */

/** @file xaudio2_s.cpp XAudio2 sound driver. */

#include "../stdafx.h"
#include "../openttd.h"
#include "../driver.h"
#include "../mixer.h"
#include "../debug.h"
#include "../core/alloc_func.hpp"
#include "../core/bitmath_func.hpp"
#include "../core/math_func.hpp"

// Windows 8 SDK required for XAudio2
#undef NTDDI_VERSION
#undef _WIN32_WINNT

#define NTDDI_VERSION    NTDDI_WIN8
#define _WIN32_WINNT     _WIN32_WINNT_WIN8

#include "xaudio2_s.h"

#include <windows.h>
#include <mmsystem.h>
#include <wrl\client.h>
#include <xaudio2.h>

using Microsoft::WRL::ComPtr;

#include "../os/windows/win32.h"
#include "../safeguards.h"

// Definition of the "XAudio2Create" call used to initialise XAudio2
typedef HRESULT(__stdcall *API_XAudio2Create)(_Outptr_ IXAudio2** ppXAudio2, UINT32 Flags, XAUDIO2_PROCESSOR XAudio2Processor);

static FSoundDriver_XAudio2 iFSoundDriver_XAudio2;

/**
* Implementation of the IXAudio2VoiceCallback interface.
* Provides buffered audio to XAudio2 from the OpenTTD mixer.
*/
class StreamingVoiceContext : public IXAudio2VoiceCallback
{
private:
	int bufferLength;
	char *buffer;

public:
	IXAudio2SourceVoice* SourceVoice;

	StreamingVoiceContext(int bufferLength)
	{
		this->bufferLength = bufferLength;
		this->buffer = MallocT<char>(bufferLength);
	}

	virtual ~StreamingVoiceContext()
	{
		free(this->buffer);
	}

	HRESULT SubmitBuffer()
	{
		// Ensure we do have a valid voice
		if (this->SourceVoice == nullptr)
		{
			return E_FAIL;
		}

		MxMixSamples(this->buffer, this->bufferLength / 4);

		XAUDIO2_BUFFER buf = { 0 };
		buf.AudioBytes = this->bufferLength;
		buf.pAudioData = (const BYTE *) this->buffer;

		return SourceVoice->SubmitSourceBuffer(&buf);
	}

	STDMETHOD_(void, OnVoiceProcessingPassStart)(UINT32) override
	{
	}

	STDMETHOD_(void, OnVoiceProcessingPassEnd)() override
	{
	}

	STDMETHOD_(void, OnStreamEnd)() override
	{
	}

	STDMETHOD_(void, OnBufferStart)(void*)


given parentchain block hash and the merkle executed extrinsics.
///
/// Calculates the merkle root of the extrinsics. In case no extrinsics are supplied, the root will be a hash filled with zeros.
fn create_processed_parentchain_block_call(block_hash: H256, extrinsics: Vec<H256>) -> OpaqueCall {
	let root: H256 = merkle_root::<Keccak256, _, _>(extrinsics).into();
	OpaqueCall::from_tuple(&([TEEREX_MODULE, PROCESSED_PARENTCHAIN_BLOCK], block_hash, root))
}

#[cfg(test)]
pub mod tests {
	use super::*;
	use codec::Encode;

	#[test]
	fn ensure_empty_extrinsic_vec_triggers_zero_filled_merkle_root() {
		// given
		let block_hash = H256::from([1; 32]);
		let extrinsics = Vec::new();
		let expected_call =
			([TEEREX_MODULE, PROCESSED_PARENTCHAIN_BLOCK], block_hash, H256::default()).encode();

		// when
		let call = create_processed_parentchain_block_call(block_hash, extrinsics);

		// then
		assert_eq!(call.0, expected_call);
	}

	#[test]
	fn ensure_non_empty_extrinsic_vec_triggers_non_zero_merkle_root() {
		// given
		let block_hash = H256::from([1; 32]);
		let extrinsics = vec![H256::from([4; 32]), H256::from([9; 32])];
		let zero_root_call =
			([TEEREX_MODULE, PROCESSED_PARENTCHAIN_BLOCK], block_hash, H256::default()).encode();

		// when
		let call = create_processed_parentchain_block_call(block_hash, extrinsics);

		// then
		assert_ne!(call.0, zero_root_call);
	}
}
#![allow(non_snake_case)]

use crate::{co, gdi};
use crate::kernel::decl::{GetLastError, WinResult};
use crate::prelude::{Handle, HandleGdi};
use crate::user::decl::{HRGN, RECT, SIZE};

impl HandleGdi for HRGN {}
impl GdiHrgn for HRGN {}

/// [`HRGN`](crate::HRGN) methods from `gdi` feature.
#[cfg_attr(docsrs, doc(cfg(feature = "gdi")))]
pub trait GdiHrgn: Handle {
	/// [`CreateRectRgn`](https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-createrectrgn)
	/// static method.
	///
	/// **Note:** Must be paired with an
	/// [`HRGN::DeleteObject`](crate::prelude::HandleGdi::DeleteObject) call.
	fn CreateRectRgn(bounds: RECT) -> WinResult<HRGN> {
		unsafe {
			gdi::ffi::CreateRectRgn(
				bounds.left, bounds.top, bounds.right, bounds.bottom,
			).as_mut()
		}
			.map(|ptr| HRGN(ptr))
			.ok_or_else(|| GetLastError())
	}

	/// [`CreateRectRgnIndirect`](https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-createrectrgnindirect)
	/// static method.
	///
	/// **Note:** Must be paired with an
	/// [`HRGN::DeleteObject`](crate::prelude::HandleGdi::DeleteObject) call.
	fn CreateRectRgnIndirect(rc: RECT) -> WinResult<HRGN> {
		unsafe { gdi::ffi::CreateRectRgnIndirect(&rc as *const _ as _).as_mut() }
			.map(|ptr| HRGN(ptr))
			.ok_or_else(|| GetLastError())
	}

	/// [`CreateRoundRectRgn`](https://docs.microsoft.com/en-us/windows/win32/api/


Fn$_invoke$arity$1(z) : p.call(null,z));
}
}
});
var cljs$core$sp1__4 = (function() {
var G__11318__delegate = function (x,y,z,args){
var or__7806__auto__ = cljs$core$sp1.cljs$core$IFn$_invoke$arity$3(x,y,z);
if(cljs.core.truth_(or__7806__auto__)){
return or__7806__auto__;
} else {
return cljs.core.some(p,args);
}
};
var G__11318 = function (x,y,z,var_args){
var args = null;
if (arguments.length > 3) {
var G__11319__i = 0, G__11319__a = new Array(arguments.length -  3);
while (G__11319__i < G__11319__a.length) {G__11319__a[G__11319__i] = arguments[G__11319__i + 3]; ++G__11319__i;}
  args = new cljs.core.IndexedSeq(G__11319__a,0,null);
}
return G__11318__delegate.call(this,x,y,z,args);};
G__11318.cljs$lang$maxFixedArity = 3;
G__11318.cljs$lang$applyTo = (function (arglist__11320){
var x = cljs.core.first(arglist__11320);
arglist__11320 = cljs.core.next(arglist__11320);
var y = cljs.core.first(arglist__11320);
arglist__11320 = cljs.core.next(arglist__11320);
var z = cljs.core.first(arglist__11320);
var args = cljs.core.rest(arglist__11320);
return G__11318__delegate(x,y,z,args);
});
G__11318.cljs$core$IFn$_invoke$arity$variadic = G__11318__delegate;
return G__11318;
})()
;
cljs$core$sp1 = function(x,y,z,var_args){
var args = var_args;
switch(arguments.length){
case 0:
return cljs$core$sp1__0.call(this);
case 1:
return cljs$core$sp1__1.call(this,x);
case 2:
return cljs$core$sp1__2.call(this,x,y);
case 3:
return cljs$core$sp1__3.call(this,x,y,z);
default:
var G__11321 = null;
if (arguments.length > 3) {
var G__11322__i = 0, G__11322__a = new Array(arguments.length -  3);
while (G__11322__i < G__11322__a.length) {G__11322__a[G__11322__i] = arguments[G__11322__i + 3]; ++G__11322__i;}
G__11321 = new cljs.core.IndexedSeq(G__11322__a,0,null);
}
return cljs$core$sp1__4.cljs$core$IFn$_invoke$arity$variadic(x,y,z, G__11321);
}
throw(new Error('Invalid arity: ' + arguments.length));
};
cljs$core$sp1.cljs$lang$maxFixedArity = 3;
cljs$core$sp1.cljs$lang$applyTo = cljs$core$sp1__4.cljs$lang$applyTo;
cljs$core$sp1.cljs$core$IFn$_invoke$arity$0 = cljs$core$sp1__0;
cljs$core$sp1.cljs$core$IFn$_invoke$arity$1 = cljs$core$sp1__1;
cljs$core$sp1.cljs$core$IFn$_invoke$arity$2 = cljs$core$sp1__2;
cljs$core$sp1.cljs$core$IFn$_invoke$arity$3 = cljs$core$sp1__3;
cljs


        "gSize": 3,
        "lgSize": 3,
        "maxFrac": 2,
        "minFrac": 2,
        "minInt": 1,
        "negPre": "-",
        "negSuf": "\u00a0\u00a4",
        "posPre": "",
        "posSuf": "\u00a0\u00a4"
      }
    ]
  },
  "id": "ca-ad",
  "localeID": "ca_AD",
  "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (i == 1 && vf.v == 0) {    return PLURAL_CATEGORY.ONE;  }  return PLURAL_CATEGORY.OTHER;}
});
}]);
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
  n = n + '';
  var i = n.indexOf('.');
  return (i == -1) ? 0 : n.length - i - 1;
}

function getVF(n, opt_precision) {
  var v = opt_precision;

  if (undefined === v) {
    v = Math.min(getDecimals(n), 3);
  }

  var base = Math.pow(10, v);
  var f = ((n * base) | 0) % base;
  return {v: v, f: f};
}

$provide.value("$locale", {
  "DATETIME_FORMATS": {
    "AMPMS": [
      "Kiroko",
      "Hwa\u0129-in\u0129"
    ],
    "DAY": [
      "Kiumia",
      "Njumatat\u0169",
      "Njumaine",
      "Njumatana",
      "Aramithi",
      "Njumaa",
      "Njumamothi"
    ],
    "ERANAMES": [
      "Mbere ya Kristo",
      "Thutha wa Kristo"
    ],
    "ERAS": [
      "MK",
      "TK"
    ],
    "FIRSTDAYOFWEEK": 0,
    "MONTH": [
      "Njenuar\u0129",
      "Mwere wa ker\u0129",
      "Mwere wa gatat\u0169",
      "Mwere wa kana",
      "Mwere wa gatano",
      "Mwere wa gatandat\u0169",
      "Mwere wa m\u0169gwanja",
      "Mwere wa kanana",
      "Mwere wa kenda",
      "Mwere wa ik\u0169mi",
      "Mwere wa ik\u0169mi na \u0169mwe",
      "Ndithemba"
    ],
    "SHORTDAY": [
      "KMA",
      "NTT",
      "NMN",
      "NMT",
      "ART",
      "NMA",
      "NMM"
    ],
    "SHORTMONTH": [
      "JEN",
      "WKR",
      "WGT",
      "WKN",
      "WTN",
      "WTD",
      "WMJ",
      "WNN",
      "WKD",
      "WIK",
      "WMW",
      "DIT"
    ],
    "STANDALONEMONTH": [
      "Njenuar\u0129",
      "Mwere wa ker\u0129",
      "Mwere wa gatat\u0169",
      "Mwere wa kana",
      "Mwere wa gatano",
      "Mwere wa gatandat\u0169",
      "Mwere wa m\u0169gwanja",
      "Mwere wa kanana",
      "Mwere wa ken


modules_vue_loader_lib_index_js_vue_loader_options_ParamFieldRange_vue_vue_type_style_index_0_id_140b9348_lang_stylus_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */
 /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_11_oneOf_1_0_node_modules_css_loader_index_js_ref_11_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_stylus_loader_index_js_ref_11_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ParamFieldRange_vue_vue_type_style_index_0_id_140b9348_lang_stylus_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);

/***/ }),

/***/ "5c08":
/***/ (function(module, exports) {

ace.define("ace/theme/dawn",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) {

exports.isDark = false;
exports.cssClass = "ace-dawn";
exports.cssText = ".ace-dawn .ace_gutter {\
background: #ebebeb;\
color: #333\
}\
.ace-dawn .ace_print-margin {\
width: 1px;\
background: #e8e8e8\
}\
.ace-dawn {\
background-color: #F9F9F9;\
color: #080808\
}\
.ace-dawn .ace_cursor {\
color: #000000\
}\
.ace-dawn .ace_marker-layer .ace_selection {\
background: rgba(39, 95, 255, 0.30)\
}\
.ace-dawn.ace_multiselect .ace_selection.ace_start {\
box-shadow: 0 0 3px 0px #F9F9F9;\
}\
.ace-dawn .ace_marker-layer .ace_step {\
background: rgb(255, 255, 0)\
}\
.ace-dawn .ace_marker-layer .ace_bracket {\
margin: -1px 0 0 -1px;\
border: 1px solid rgba(75, 75, 126, 0.50)\
}\
.ace-dawn .ace_marker-layer .ace_active-line {\
background: rgba(36, 99, 180, 0.12)\
}\
.ace-dawn .ace_gutter-active-line {\
background-color : #dcdcdc\
}\
.ace-dawn .ace_marker-layer .ace_selected-word {\
border: 1px solid rgba(39, 95, 255, 0.30)\
}\
.ace-dawn .ace_invisible {\
color: rgba(75, 75, 126, 0.50)\
}\
.ace-dawn .ace_keyword,\
.ace-dawn .ace_meta {\
color: #794938\
}\
.ace-dawn .ace_constant,\
.ace-dawn .ace_constant.ace_character,\
.ace-dawn .ace_constant.ace_character.ace_escape,\
.ace-dawn .ace_constant.ace_other {\
color: #811F24\
}\
.ace-dawn .ace_invalid.ace_illegal {\
text-decoration: underline;\
font-style: italic;\
color: #F8F8F8;\
background-color: #B52A1D\
}\
.ace-dawn .ace_invalid.ace_deprecated {\
text-decoration: underline;\
font-style: italic;\
color: #B52A1D\
}\
.ace-dawn .ace_support {\
color: #691C97\
}\
.ace-dawn .ace_support.ace_constant {\
color: #B4371F\
}\
.ace-dawn .ace_fold {\
background


Verbose {
			fmt.Println("*** unexpected refresh error ", err)
		}
		return nil, err
	}

	//check if token got refreshed?
	if cachedToken.AccessToken != tk.AccessToken {

		if utils.Verbose {
			fmt.Println("*** New access token retrieved.")
		}

		//update cachedToken and store the new one
		cachedToken.AccessToken = tk.AccessToken
		cachedToken.RefreshToken = tk.RefreshToken
		cachedToken.IDToken = fmt.Sprintf("%v", tk.Extra("id_token"))
		cachedToken.Scope = fmt.Sprintf("%v", tk.Extra("scope"))

		foci := tk.Extra("foci")
		if foci == nil {
			foci = ""
		}
		cachedToken.Foci = fmt.Sprintf("%s", foci)
		cachedToken.ExpiresIn, _ = strconv.Atoi(fmt.Sprintf("%v", tk.Extra("expires_in")))

		seconds := time.Duration(cachedToken.ExpiresIn - 60*5)
		cachedToken.Expiry = time.Now().Add(time.Second * seconds)

		fmt.Printf("Access token was refreshed\n")
		utils.PersistTokenToFile(cachedToken, tokenCacheFilename)

	} else {

		if utils.Verbose {
			fmt.Println("*** Not expired. Using cached token.")
		}

		tk.AccessToken = cachedToken.AccessToken
		tk.RefreshToken = cachedToken.RefreshToken
		tk.Expiry = cachedToken.Expiry
	}

	return c.Client(ctx, tk), nil
}
package integration

import (
	"context"
	"testing"
	"time"

	"github.com/stretchr/testify/require"
	"github.com/wundergraph/cosmo/router-tests/jwks"
	"github.com/wundergraph/cosmo/router/pkg/authentication"
	"go.opentelemetry.io/otel/attribute"
	"go.opentelemetry.io/otel/sdk/metric/metricdata"
	"go.opentelemetry.io/otel/sdk/trace"
	tracetest2 "go.opentelemetry.io/otel/sdk/trace/tracetest"
	"go.uber.org/zap"
)

const (
	JwksName = "my-jwks-server"
)

// NewContextWithCancel creates a new context with a cancel function that is called when the test is done.
func NewContextWithCancel(t *testing.T) context.Context {
	ctx, cancel := context.WithCancel(context.Background())
	t.Cleanup(cancel)
	return ctx
}

func RequireSpanWithName(t *testing.T, exporter *tracetest2.InMemoryExporter, name string) trace.ReadOnlySpan {
	require.NotNil(t, exporter)
	require.NotNil(t, exporter.GetSpans())
	require.NotNil(t, exporter.GetSpans().Snapshots())
	sn := exporter.GetSpans().Snapshots()
	var testSpan trace.ReadOnlySpan
	for _, span := range sn {
		if span.Name() == name {
			testSpan = span
			break
		}
	}
	require.NotNil(t, testSpan)
	return testSpan
}

func ConfigureAuth(t *testing.T) ([]authentication.Authenticator, *jwks.Server) {
	authServer, err := jwks.NewServer(t)
	require.NoError(t, err)
	t.Cleanup(authServer.Close)
	authenticators := ConfigureAuthWithJwksConfig(t, []authentication.JWKSConfig{
		{
			URL:             authServer.JWKSURL(),
			RefreshInterval: time.Second * 5,
		},
	})

	return authenticators, authServer
}

func ConfigureAuthWithJwksConfig(t *testing.T, jwksConfig []authentication.JWKSConfig) []authentication.Authenticator {
	tokenDecoder, err := authentication.NewJwksTokenDecoder(NewContextWithCancel(t), zap.NewNop(), jwksConfig


.05,-4.17 1.85,-9.14 2.71,-13.74 0.26,-3.07 0.84,-6.1 1.99,-8.91 0.22,-5.15 -3.62,-9.39 -5.25,-14.09 -0.63,-2.47 0.48,-5.37 -1.69,-7.4 -2.96,-2 -6.81,-2.81 -10.16,-4.16 -2.63,0.45 -5.28,-0.92 -5.64,-3.77 -0.41,-2.32 0.72,-4.39 -0.77,-0.54 -0.78,2.23 -4.07,1.99 -5.91,1.44 -0.89,-2.72 -3.76,-2.22 -5.89,-1.05 -2.43,0.03 -4.2,1.93 -3.78,3.04 -2.98,-1.35 -5.85,1.55 -8.48,2.42 -3.55,-1.67 -7.51,-1.35 -11.28,-1.56 -3.58,3.73 -3.22,9.41 -5.54,13.67 -1.24,3.16 -4.34,3.42 -7.26,3.89 -3.26,1.02 -6.88,-0.1 -9.67,2.35 -1.59,0.79 -4,-0.13 -5.49,-0.56 -4.01,0.9 -8.8,0.36 -12.18,-2.44 -2.57,-1.34 -4.55,-3.47 -6.76,-5.28 -2.23,1.37 -5.63,2.37 -6.56,4.87 -0.02,1.86 -4.09,1.87 -5.44,1.29 -1.42,-2.13 -2.64,-3.94 -1.26,-6.61 0.56,-3.54 0.3,-7.09 -1.63,-10.2 -0.72,-1.89 -2.32,-5.98 -4.72,-4.31 -2.79,1.33 -2.48,-5.48 -5.68,-3.53 -5.59,0.15 -11.31,0.77 -16.84,0.31 -1.25,-0.57 -2.44,-1.63 -3.94,-1.22z","name":"Sachsen"},"sl":{"path":"m63.72,553.88c-2.9,2.18 -6.1,2.82 -9.5,4.44 -3.47,4.51 -10,4.1 -15.06,5.38 -4.6,0.18 -8.97,-1.26 -13.22,-2.78 -2.47,1.73 -0.51,5.04 -0.84,7.5 1.8,0.96 4.08,-1.32 5.97,0.4 2.44,1.62 5.28,3.2 6.78,5.81 -3.49,0.44 0.05,4.79 -0.09,6.94 1.05,3.41 4.13,4.95 6.56,7.16 1.79,1.94 0.3,5.34 3.04,6.13 2.43,1.92 -2.53,4.66 1.39,5.86 2.37,0.12 6.25,2.27 7.13,-1.09 -0.35,-2.25 -3.03,-3.71 0.38,-4.78 4.42,0.26 10.1,1.27 11.81,5.94 0.51,1.58 -0.22,5.5 1.56,5.84 2.33,-0.7 1.95,-7.32 3.65,-3.1 1.02,1.94 2.67,2.87 4.44,1.6 2.61,-0.08 5.35,0.47 7.44,1.84 0.


    #[inline(always)]
    pub fn rx_buf_full(&self) -> RX_BUF_FULL_R {
        RX_BUF_FULL_R::new(((self.bits >> 22) & 0x01) != 0)
    }
    #[doc = "Bit 21 - 21:21\\]
Interrupt flag 21. BLE mode only: LL control packet received with CRC OK, not to be ignored, then acknowledgement sent. Write zero to clear flag. Write to one has no effect."]
    #[inline(always)]
    pub fn rx_ctrl_ack(&self) -> RX_CTRL_ACK_R {
        RX_CTRL_ACK_R::new(((self.bits >> 21) & 0x01) != 0)
    }
    #[doc = "Bit 20 - 20:20\\]
Interrupt flag 20. BLE mode only: LL control packet received with CRC OK, not to be ignored. Write zero to clear flag. Write to one has no effect."]
    #[inline(always)]
    pub fn rx_ctrl(&self) -> RX_CTRL_R {
        RX_CTRL_R::new(((self.bits >> 20) & 0x01) != 0)
    }
    #[doc = "Bit 19 - 19:19\\]
Interrupt flag 19. BLE mode only: Packet received with CRC OK, not to be ignored, no payload. Write zero to clear flag. Write to one has no effect."]
    #[inline(always)]
    pub fn rx_empty(&self) -> RX_EMPTY_R {
        RX_EMPTY_R::new(((self.bits >> 19) & 0x01) != 0)
    }
    #[doc = "Bit 18 - 18:18\\]
Interrupt flag 18. Packet received, but can be ignored. BLE mode: Packet received with CRC OK, but to be ignored. IEEE 802.15.4 mode: Frame received with ignore flag set. Write zero to clear flag. Write to one has no effect."]
    #[inline(always)]
    pub fn rx_ignored(&self) -> RX_IGNORED_R {
        RX_IGNORED_R::new(((self.bits >> 18) & 0x01) != 0)
    }
    #[doc = "Bit 17 - 17:17\\]
Interrupt flag 17. Packet received with CRC error. BLE mode: Packet received with CRC error. IEEE 802.15.4 mode: Frame received with CRC error. Write zero to clear flag. Write to one has no effect."]
    #[inline(always)]
    pub fn rx_nok(&self) -> RX_NOK_R {
        RX_NOK_R::new(((self.bits >> 17) & 0x01) != 0)
    }
    #[doc = "Bit 16 - 16:16\\]
Interrupt flag 16. Packet received correctly. BLE mode: Packet received with CRC OK, payload, and not to be ignored. IEEE 802.15.4 mode: Frame received with CRC OK. Write zero to clear flag. Write to one has no effect."]
    #[inline(always)]
    pub fn rx_ok(&self) -> RX_OK_R {
        RX_OK_R::new(((self.bits >> 16) & 0x01) != 0)
    }
    #[doc = "Bit 15 - 15:15\\]
Interrupt flag 15. Write zero to clear flag. Write to one has no effect."]
    #[inline(always)]
    pub fn irq15(&self) -> IRQ15_R {
        IRQ15_R::new(((self.bits >> 15) & 0x01) != 0)
    }
    #[doc = "Bit 14 - 14:14\\]
Interrupt flag 14. Write zero to clear flag. Write to one has no effect."]
    #[inline(always)]
    pub fn irq14(&self) -> IRQ14_R {
        IRQ14_R::new(((self.bits >> 14) & 0x01) != 0)
    }
    #[doc = "Bit 13 - 13:13\\]
Interrupt flag 13. IEEE 802.15.4 mode only: A foreground radio operation command has gone into active state."]
    #[inline(always)]
    pub fn fg_command_started(&self)


,intin+2
	move.w	\3,intin+4
	move.w	\4,intin+6
	move.w	\5,intin+8
	move.w	\6,intin+10
	call_aes
	ENDM

;--------------------------------------------------------------
; wind_new()
;--------------------------------------------------------------

wind_new	MACRO
	move.l	#aes_109,aespb
	call_aes
	ENDM

**********************
* AES resource calls *
**********************

;--------------------------------------------------------------
; rsrc_load()
;--------------------------------------------------------------

rsrc_load	MACRO
	move.l	#aes_110,aespb
	move.l	\1,addrin
	call_aes
	ENDM

;--------------------------------------------------------------
; rsrc_free()
;--------------------------------------------------------------

rsrc_free	MACRO
	move.l	#aes_111,aespb
	call_aes
	ENDM

;--------------------------------------------------------------
; rsrc_gaddr()
;--------------------------------------------------------------

rsrc_gaddr	MACRO
	move.l	#aes_112,aespb
	move.w	\1,intin
	move.w	\2,intin+2
	call_aes
	ENDM

;--------------------------------------------------------------
; rsrc_saddr()
;--------------------------------------------------------------

rsrc_saddr	MACRO
	move.l	#aes_113,aespb
	move.w	\1,intin
	move.w	\2,intin+2
	move.l	\3,addrin
	call_aes
	ENDM

;--------------------------------------------------------------
; rsrc_obfix()
;--------------------------------------------------------------

rsrc_obfix	MACRO
	move.l	#aes_114,aespb
	move.w	\1,intin
	move.l	\2,addrin
	call_aes
	ENDM

;--------------------------------------------------------------
; rsrc_rcfix()
;--------------------------------------------------------------

rsrc_rcfix	MACRO
	move.l	#aes_115,aespb
	move.l	\1,addrin
	call_aes
	ENDM

*******************
* AES shell calls *
*******************

;--------------------------------------------------------------
; shel_read()
;--------------------------------------------------------------

shel_read	MACRO
	move.l	#aes_120,aespb
	move.l	\1,addrin
	move.l	\2,addrin+4
	call_aes


r)?{endpoint:`/api/frigate/${t.frigate.client_id}/notifications/${r.getID()}/`+(h.isClip(r)?"clip.mp4":"snapshot.jpg")+"?download=true",sign:!0}:ne.isFrigateRecording(r)?{endpoint:`/api/frigate/${t.frigate.client_id}/recording/${t.frigate.camera_name}/start/${Math.floor(r.getStartTime().getTime()/1e3)}/end/${Math.floor(r.getEndTime().getTime()/1e3)}?download=true`,sign:!0}:null}generateDefaultEventQuery(e,t,r){const a=Array.from(t).map((t=>e.get(t))),n=N(a.map((e=>e?.frigate.zones)),g),i=N(a.map((e=>e?.frigate.labels)),g);if(1===n.length&&1===i.length)return[{type:_.Event,cameraIDs:t,...i[0]&&{what:new Set(i[0])},...n[0]&&{where:new Set(n[0])},...r}];const s=[];for(const a of t){const t=e.get(a);t&&s.push({type:_.Event,cameraIDs:new Set([a]),...t.frigate.labels&&{what:new Set(t.frigate.labels)},...t.frigate.zones&&{where:new Set(t.frigate.zones)},...r})}return s.length?s:null}generateDefaultRecordingQuery(e,t,r){return[{type:_.Recording,cameraIDs:t,...r}]}generateDefaultRecordingSegmentsQuery(e,t,r){return r.start&&r.end?[{type:_.RecordingSegments,cameraIDs:t,start:r.start,end:r.end,...r}]:null}async favoriteMedia(e,t,i,s){ne.isFrigateEvent(i)&&(await async function(e,t,i,s){const o={type:"frigate/event/retain",instance_id:t,event_id:i,retain:s},c=await r(e,P,o,!0);if(!c.success)throw new a(n("error.failed_retain"),{request:o,response:c})}(e,t.frigate.client_id,i.getID(),s),i.setFavorite(s))}_buildInstanceToCameraIDMapFromQuery(e,t){const r=new Map;for(const a of t){const t=this._getQueryableCameraConfig(e,a)?.frigate.client_id;t&&(r.has(t)||r.set(t,new Set),r.get(t)?.add(a))}return r}_getFrigateCameraNamesForCameraIDs(e,t){const r=new Set;for(const a of t){const t=this._getQueryableCameraConfig(e,a);t?.frigate.camera_name&&r.add(t.frigate.camera_name)}return r}async getEvents(e,t,r,a){const n=new Map,i=async(i,s)=>{if(!s||!s.size)return;const o={...r,cameraIDs:s},c=a?.useCache??1?this._requestCache.get(o):null;if(c)return void n.set(r,c);const u={instance_id:i,cameras:Array.from(this._getFrigateCameraNamesForCameraIDs(t,s)),...r.what&&{labels:Array.from(r.what)},...r.where&&{zones:Array.from(r.where)},...r.tags&&{sub_labels:Array.from(r.tags)},...r.end&&{before:Math.floor(r.end.getTime()/1e3)},...r.start&&{after:Math.floor(r.start.getTime()/1e3)},...r.limit&&{limit:r.limit},...r.hasClip&&{has_clip:r.hasClip}


pt);
        buffer.clear();
    }
}

fn run(script: &str) {
    eprintln!("running script [{}]", script);
}
use schemars::JsonSchema;

#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone)]
pub struct APIToken {
  pub id: u32,
  pub member_id: u32,
  pub token: Option<String>,
  pub purpose: String,
  pub exp_date: u64,
}//! Spending strategies
use super::LedgerError;

/// Simple strategy to spend from multiple increasing counters
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SpendingCounterIncreasing {
    nexts: Vec<SpendingCounter>,
}

// number of bits reserved for lanes
const LANES_BITS: usize = 3;
// number of bits reserved for counter (unrespective of the lane)
const UNLANES_BITS: usize = 32 - LANES_BITS;

impl SpendingCounterIncreasing {
    /// number of parallel lanes of increasing counters
    pub const LANES: usize = 1 << LANES_BITS;

    pub fn new_from_counter(set: SpendingCounter) -> Self {
        let mut x = Self::default();
        x.nexts[set.lane()] = set;
        x
    }

    pub fn new_from_counters(set: Vec<SpendingCounter>) -> Option<Self> {
        if set.len() == Self::LANES {
            for (i, i_set_value) in set.iter().enumerate() {
                if i_set_value.lane() != i {
                    return None;
                }
            }
            Some(SpendingCounterIncreasing { nexts: set })
        } else {
            None
        }
    }

    pub fn get_valid_counter(&self) -> SpendingCounter {
        self.nexts[0]
    }

    pub fn get_valid_counters(&self) -> Vec<SpendingCounter> {
        self.nexts.clone()
    }

    /// try to match the lane of the counter in argument, if it doesn't match
    /// a ledger error reported.
    ///
    /// If the counter match succesfully, then the counter at this lane is incremented by one.
    pub fn next_verify(&mut self, counter: SpendingCounter) -> Result<(), LedgerError> {
        let actual_counter = self.nexts[counter.lane()];

        if actual_counter != counter {
            Err(LedgerError::SpendingCredentialInvalid)
        } else {
            self.nexts[counter.lane()] = actual_counter.increment();
            Ok(())
        }
    }
}

// only used to print the account's ledger
impl std::fmt::Display for SpendingCounterIncreasing {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        for c in self.nexts.iter() {
            write!(f, "{},", c.0)?
        }
        Ok(())
    }
}

impl Default for SpendingCounterIncreasing {
    fn default() -> Self {
        let mut nexts = Vec::new();
        for i in 0..Self::LANES {
            nexts.push(SpendingCounter::new(i, 0));
        }
        SpendingCounterIncreasing { nexts }
    }
}

/// Spending counter associated to an account.
///
/// every time the owner is spending from an account,
/// the counter is incremented. A matching counter
/// needs to be used in the spending phase to make
/// sure we have non-replayability of a transaction.
///
/// Note that the leading LANES_BITS bits are used to codify the
/// implicit lane.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Sp


		if #splitted == 3 then
									fj[joint][prop_idx] = Vector3f.new(table.unpack(splitted))
									table.insert(undo_tbl.last, joint)
									table.insert(undo_tbl[joint].prev, joint["get"..key](joint))
									table.insert(poser.last_undo_idxs, prop_idx)
								end
							end
						end
					end
				end
			end
			poser.names = nil
		end
		imgui.tooltip("Load frozen joints from a json file to this skeleton")

		imgui.same_line()
		if imgui.same_line and imgui.button("Freeze All") then
			for i=1, #poser.prop_names do
				if (poser.load_all and (poser.load_scales or (key ~= "_LocalScale"))) or i == poser.prop_idx then
					for j, joint in ipairs((poser.save_only_this and (poser.body_joints or self.joints)) or poser.all_joints) do
						fj[joint] = fj[joint] or {false, false, false}
						fj[joint][i] = joint["get"..poser.prop_names[i] ](joint)
						table.insert(poser.undo[i].last, joint)
						table.insert(poser.undo[i][joint].prev, joint["get"..poser.prop_names[i] ](joint))
						table.insert(poser.last_undo_idxs, i)
					end
				end
			end
		end
		imgui.tooltip("Freeze all joints, depending on the checkboxes above")

		imgui.same_line()
		if imgui.button("Unfreeze All") then
			poser.last_undo_idxs = {}
			frozen_joints[self.xform] = {}
			for i=1, #poser.prop_names do
				poser.undo[i].last = {}
				for j, joint in ipairs((poser.save_only_this and (poser.body_joints or self.joints)) or poser.all_joints) do
					poser.undo[i][joint] = poser.undo[i][joint] or {}
					poser.undo[i][joint].prev = {}
				end
			end
		end
		imgui.tooltip("Unfreeze all joints and clear undo history, depending on the checkboxes above")

		imgui.same_line()
		local pressed_undo = imgui.button("Undo [" .. #poser.last_undo_idxs .. "]") or check_key_released(via.hid.KeyboardKey.Z)

		imgui.same_line()
		if imgui.button("Show Help") then
			poser.opened_help = not poser.opened_help
		end

		changed, poser.sensitivity = imgui.drag_float("Sensitivity", poser.sensitivity, 0.001, 0.0001, 1.0)

		changed, poser.search_text = imgui.input_text("Filter", poser.search_text)
		imgui.tooltip("Filter bones by name\nSeparate multiple terms with spaces")

		if changed or not poser.searched_joints or changed_alphanumeric then

			search_terms = split(poser.search_text:lower(), " ")
			search_terms[1] = search_terms[1] or ""

			poser.all_joints = {}

			local uniques = {}

			if self.same_joints_constraint and self.parent then
				for j, joint in ipairs(lua_get_system_array(self.parent:get_Joints())) do
					uniques[joint:get_Name()] = true
				end
			end

			for i, child in ipairs(merge_indexed_tables({self.xform}, self.children) or {}) do
				if i == 1 or child:get_SameJointsConstraint() then
					local is_body = ((i == 1) or (get_body_part(child:get_GameObject():get_Name()) == "Body"))
					for j, joint in ipairs(lua_get_system_array(child:


8E8E8;
	line-height: 80px;
}
.label-div .news-view .view-main.event-main table tr td ul {margin: 0 0 15px;border-bottom: 1px solid #E8E8E8;padding-bottom: 15px;}
.label-div .news-view .view-main.event-main table tr td ul li {margin: 0;line-height:26px;}
.label-div .news-view .view-main.event-main table tr td ul li input {padding: 0;margin: 0;height: 16px;line-height: 14px;padding: 5px 0 5px 5px;width: 30px;;}
.label-div .news-view .view-main.event-main table tr td .total {font-size: 22px;color: #666;line-height: 30px;}
/**************三库样式************/
.index-list .docu-top-left, .index-list-1 .docu-top-left {padding: 2px 0;width: 65px;}
.index-list .docu-top-right ul li, .index-list-1 .docu-top-right ul li, .index-list-1 .docu-top-right-1 ul li {float: left;padding: 3px 0 4px;}
.index-list .docu-top-right ul li a, .index-list-1 .docu-top-right ul li a, .index-list-1 .docu-top-right-1 ul li a {_line-height: 22px;_overflow: hidden;_height: 22px;}
.index-list .docu-top-right ul li.line-css, .index-list-1 .docu-top-right ul li.line-css, .index-list-1 .docu-top-right-1 ul li.line-css{padding: 3px 8px 4px;}
.docu-list{overflow: hidden;position: relative;}
.docu-list .list-li {float: left;position: relative;width: 122px;}
.docu-list .list-li .img i {position: absolute;right: 5px;top: 143px;}
.docu-list .list-li .img img {border: 1px solid #ECECEC;height: 165px;width: 120px;}
.docu-list .list-li .title {#font-weight: bold;font-weight: normal;height: 38px;line-height: 19px;overflow: hidden;}
.docu-div .docu-img {position: relative;}
.docu-div .docu-img img {border: 1px #E8E8E8 solid;vertical-align: bottom;}
.docu-div .docu-img i {position: absolute;bottom: 5px;}
.index-top .span6, .index-top .span3 {margin-left: 0;}
.pic-1 a, .pic-2 a, .pic-3 a {display: block;position: relative;}
.pic-3 {width: 50%;}
.pic-1 a img, .pic-2 a img, .pic-3 a img {display: block;width: 100%;}
.pic-1 a .pic-info, .pic-2 a .pic-info, .pic-3 a .pic-info {
    background: url(../images/pic_index_bg.png) repeat;
    color: #FFF;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: 30px;
    left: 0;
    line-height: 30px;
    overflow: hidden;
    position: absolute;
    z-index: 10;
    bottom: 0;
    width: 100%;
}
.images-list, .videos-list{overflow: hidden;position: relative;}
.images-list .list-li, .videos-list .list-li {float: left;position: relative;width: 150px;margin-bottom: 20px;}
.videos-list .list-li .img span {position: absolute;}
.images-list .list-li .img img {width: 150px;height: 120px;}
.vi


ing, dynamic>.from(item)).toList();

        // 自动加载上次使用的外部字幕
        final lastActiveIndex = prefs.getInt('last_active_subtitle_$videoHashKey');
        if (lastActiveIndex != null && lastActiveIndex >= 0) {
          if (lastActiveIndex < _externalSubtitles.length) {
            final subtitleInfo = _externalSubtitles[lastActiveIndex];
            final path = subtitleInfo['path'] as String;
            if (File(path).existsSync()) {
              // 延迟加载，避免初始化冲突
              Future.delayed(const Duration(milliseconds: 500), () {
                if (!mounted) return; // Add mounted check
                _applyExternalSubtitle(path, lastActiveIndex);
              });
            }
          }
        }
      }
    } catch (e) {
      // print('加载外部字幕失败: $e');
      debugPrint('加载外部字幕失败: $e');
    } finally {
      if (mounted) setState(() => _isLoading = false); // Add mounted check
    }
  }

  // 计算视频文件的唯一标识
  String _getVideoHashKey(String videoPath) {
    if (kIsWeb) return p.basename(videoPath);
    // 使用文件路径和大小作为标识
    final file = File(videoPath);
    if (file.existsSync()) {
      final size = file.lengthSync();
      final name = p.basename(videoPath);
      return '$name-$size';
    }
    return p.basename(videoPath);
  }

  // 保存外部字幕信息到SharedPreferences
  Future<void> _saveExternalSubtitles(BuildContext context) async {
    if (kIsWeb) return;
    try {
      final videoState = Provider.of<VideoPlayerState>(context, listen: false);
      if (videoState.currentVideoPath == null) return;

      final prefs = await SharedPreferences.getInstance();
      final videoHashKey = _getVideoHashKey(videoState.currentVideoPath!);

      await prefs.setString(
        'external_subtitles_$videoHashKey',
        json.encode(_externalSubtitles)
      );

      // 获取当前激活的字幕索引
      final activeTrackIndex = _getActiveExternalSubtitleIndex();
      if (activeTrackIndex >= 0) {
        await prefs.setInt('last_active_subtitle_$videoHashKey', activeTrackIndex);
      }
    } catch (e) {
      // print('保存外部字幕失败: $e');
      debugPrint('保存外部字幕失败: $e');
    }
  }

  // 获取当前激活的外部字幕索引
  int _getActiveExternalSubtitleIndex() {
    // 检查哪个外部字幕是激活的
    final videoState = Provider.of<VideoPlayerState>(context, listen: false);

    // 如果没有激活的字幕轨道，返回-1
    if (videoState.player.activeSubtitleTracks.isEmpty) {
      return -1;
    }

    // 检查当前激活的字幕是否是外部字幕
    for (int i = 0; i < _externalSubtitles.length; i++) {
      // 如果当前有激活的字幕轨道，并且是索引0（外部字幕总是索引0）
      if (videoState.player.activeSubtitleTracks.contains(0)) {
        final currentPath = _externalSubtitles[i]['path'];
        // 检查这个字幕是否已经被加载
        if (_externalSubtitles[i]['isActive'] == true) {
          return i;
        }
      }
    }

    return -1;
  }

  // 加载外部字幕文件
  Future<void>