UserIdCandidates | gclid | mobileDeviceId

                Include encryption information if using encryptedUserId or encryptedUserIdCandidates.

Details

              Open Source
              YES

              Age
              March 16, 2018 (2 years, 11 months)

              Authors
              kenjora@google.com

                  Shedule Days
                  Configured by user.

                  Shedule Hours
                  Configured by user.

[
    {
        "conversion_upload": {
            "auth": {
                "field": {
                    "name": "auth_read",
                    "kind": "authentication",
                    "order": 1,
                    "default": "user",
                    "description": "Credentials used for reading data."
                }
            },
            "account_id": {
                "field": {
                    "name": "dcm_account",
                    "kind": "string",
                    "order": 0,
                    "default": ""
                }
            },
            "activity_id": {
                "field": {
                    "name": "floodlight_activity_id",
                    "kind": "integer",
                    "order": 1,
                    "default": ""
                }
            },
            "conversion_type": {
                "field": {
                    "name": "floodlight_conversion_type",
                    "kind": "choice",
                    "order": 2,
                    "choices": [
                        "encryptedUserId",
                        "encryptedUserIdCandidates",
                        "gclid",
                        "mobileDeviceId"
                    ],
                    "default": "encryptedUserId"
                }
            },
            "encryptionInfo": {
                "encryptionEntityId": {
                    "field": {
                        "name": "encryption_entity_id",
                        "kind": "integer",
                        "order": 3,
                        "default": ""
                    }
                },
                "encryptionEntityType": {
                    "field": {
                        "name": "encryption_entity_type",
                        "kind": "choice",
                        "order": 4,
                        "choices": [
                            "ADWORDS_CUSTOMER",
                            "DBM_ADVERTISER",
                            "DBM_PARTNER",
                            "DCM_ACCOUNT",
                            "DCM_ADVERTISER",


-content {
    &:hover,
    &.is-active {
      @apply bg-transparent;
    }
  }

  /*.tree-branch:hover:not(.tree-placeholder) > .tree-node-back > .tree-node:hover:first-child > .tree-node-content:first-child {*/
  /*  background: #F9DFE3;*/
  /*  border: 1px solid #D83750;*/
  /*}*/

  .dragging > .tree-node-back > .tree-node > .tree-node-content {
    @apply bg-gray-100;
  }
}
/*
Name:   DuoTone-Light
Author: by Bram de Haan, adapted from DuoTone themes by Simurai (http://simurai.com/projects/2016/01/01/duotone-themes)

CodeMirror template by Jan T. Sott (https://github.com/idleberg), adapted by Bram de Haan (https://github.com/atelierbram/)
*/

.cm-s-duotone-light.CodeMirror { background: #faf8f5; color: #b29762; }
.cm-s-duotone-light div.CodeMirror-selected { background: #e3dcce !important; }
.cm-s-duotone-light .CodeMirror-gutters { background: #faf8f5; border-right: 0px; }
.cm-s-duotone-light .CodeMirror-linenumber { color: #cdc4b1; }

/* begin cursor */
.cm-s-duotone-light .CodeMirror-cursor { border-left: 1px solid #93abdc; /* border-left: 1px solid #93abdc80; */ border-right: .5em solid #93abdc; /* border-right: .5em solid #93abdc80; */ opacity: .5; }
.cm-s-duotone-light .CodeMirror-activeline-background { background: #e3dcce;  /* background: #e3dcce80; */ opacity: .5; }
.cm-s-duotone-light .cm-fat-cursor .CodeMirror-cursor { background: #93abdc; /* #93abdc80; */ opacity: .5; }
/* end cursor */

.cm-s-duotone-light span.cm-atom, .cm-s-duotone-light span.cm-number, .cm-s-duotone-light span.cm-keyword, .cm-s-duotone-light span.cm-variable, .cm-s-duotone-light span.cm-attribute, .cm-s-duotone-light span.cm-quote, .cm-s-duotone-light-light span.cm-hr, .cm-s-duotone-light-light span.cm-link { color: #063289; }

.cm-s-duotone-light span.cm-property { color: #b29762; }
.cm-s-duotone-light span.cm-punctuation, .cm-s-duotone-light span.cm-unit, .cm-s-duotone-light span.cm-negative { color: #063289; }
.cm-s-duotone-light span.cm-string, .cm-s-duotone-light span.cm-operator { color: #1659df; }
.cm-s-duotone-light span.cm-positive { color: #896724; }

.cm-s-duotone-light span.cm-variable-2, .cm-s-duotone-light span.cm-variable-3, .cm-s-duotone-light span.cm-type, .cm-s-duotone-light span.cm-string-2, .cm-s-duotone-light span.cm-url { color: #896724; }
.cm-s-duotone-light span.cm-def, .cm-s-duotone-light span.cm-tag, .cm-s-duotone-light span.cm-builtin, .cm-s-duotone-light span.cm-qualifier, .cm-s-duot


            for (let t = 0; t < e.length; t++) {
                const n = e[t], i = n && n.geometry;
                if (!i) continue;
                const {visElemts: r} = i.properties;
                i.setElements(r, r.count);
            }
        }
        isBoxCollides(t, e, n, i, r, o) {
            if (this.bs(t.geometry)) return Lh.call(this, 0, t, e, n, i, r, o);
            if (t.geometry.properties.isEmpty) return rd;
            const s = this.getMap(), {boxes: a, collision: l} = this.os(t, i);
            let u = 0, c = 0, h = 0;
            for (let n = i; n < r; n += 6) {
                const i = a[h] = a[h] || [];
                h++;
                const r = vh.call(this, i, t, e[n], o, s);
                if (!u) {
                    const t = this.isCollides(r);
                    1 === t ? u = 1 : -1 === t && c++;
                }
            }
            return c === n && (u = -1), l.collides = u, l;
        }
        deleteMesh(t, e) {
            t && (t instanceof Uc && (t = t.meshes), e && (Array.isArray(t) ? t.forEach(t => {
                t && t.material && delete t.material.uniforms.iconTex;
            }) : t.material && delete t.material.uniforms.iconTex), super.deleteMesh(t, e));
        }
        isBloom(t) {
            const e = t && t.material && !Vu(t.material.get("markerOpacity")), n = this.getSymbol(t.properties.symbolIndex);
            return !!(e ? n.markerBloom : n.textBloom);
        }
        init() {
            const t = this.regl, e = this.canvas;
            this.renderer = new n.reshader.Renderer(t);
            const i = {
                viewport: {
                    x: (t, e) => e.viewport ? e.viewport.x : 0,
                    y: (t, e) => e.viewport ? e.viewport.y : 0,
                    width: (t, n) => n.viewport ? n.viewport.width : e ? e.width : 1,
                    height: (t, n) => n.viewport ? n.viewport.height : e ? e.height : 1
                },
                blend: {
                    enable: !0,
                    func: this.getBlendFunc(),
                    equation: "add"
                },
                depth: {
                    enable: !0,
                    range: () => this.sceneConfig.depthRange || [ 0, 1 ],
                    func: () => this.sceneConfig.depthFunc || "always",
                    mask: !!Vu(this.sceneConfig.depthMask) || this.sceneConfig.depthMask
                },
                polygonOffset: {
                    enable: !0,
                    offset: this.getPolygonOffset()
                }
            };
            this.shader = new n.reshader.MeshShader({
                vert: Zc,
                frag: "#define SHADER_NAME MARKER\n#define HAS_HIGHLIGHT_COLOR_POINT 1\nprecision mediump float;\n#include <gl2_frag>\nuniform sampler2D iconTex;\nuniform lowp float markerOpacity;\nuniform lowp float blendSrcIsOne;\n#include <highlight_frag>\nvarying vec2 vTexCoord;\nvarying float vOpacity;\nvoid main() {\n  vec4 c = texture2D(iconTex, vTexCoord) * markerOpacity * vOpacity;\n  if(c.a < .05) {\n    discard;\n  }\n  glFragColor = c;\n  glFragColor = highlight_blendColor(


https://arxiv.org/html/2503.08619v1#bib.bib41" title="">41]
0.7B
50M
0.69
0.34
0.55
0.19
0.06
0.02
0.31

     </span


").toDataItemFullDate(),
                timeZone = TimeZone.of("Europe/Copenhagen")
            )
        )
        assertEquals(
            "1976-02-03",
            mdlNs.dataElements["birth_date"]?.renderValue(
                LocalDate.parse("1976-02-03").toDataItemFullDate(),
                timeZone = TimeZone.of("America/Los_Angeles")
            )
        )
        assertEquals(
            "1976-02-03",
            mdlNs.dataElements["birth_date"]?.renderValue(
                buildCborMap {
                    put(
                        "birth_date",
                        Instant.parse("1976-02-03T05:30:00Z").toDataItemDateTimeString()
                    )
                },
                timeZone = TimeZone.of("America/New_York")
            )
        )
        assertEquals(
            "1976-02-03",
            mdlNs.dataElements["birth_date"]?.renderValue(
                buildCborMap {
                    put("birth_date", LocalDate.parse("1976-02-03").toDataItemFullDate())
                },
                timeZone = TimeZone.of("America/New_York")
            )
        )

        // CredentialAttributeType.ComplexType
        val drivingPrivileges = buildCborArray {
            addCborMap {
                put("vehicle_category_code", "A")
                put("issue_date", Tagged(1004, Tstr("2018-08-09")))
                put("expiry_date", Tagged(1004, Tstr("2024-10-20")))
            }
            addCborMap {
                put("vehicle_category_code", "B")
                put("issue_date", Tagged(1004, Tstr("2017-02-23")))
                put("expiry_date", Tagged(1004, Tstr("2024-10-20")))
            }
        }
        // Note, this isn't very nice but it's not clear we can do any better at this point,
        // fitting complex stuff like this into a string is going to be a mess no matter how
        // you slice or dice it.
        //
        // We could add the ability to add dedicated renderers at credential type registration
        // time and those could return rich text, e.g. Markup. It's not clear that this would
        // be an advantage of the app doing this itself. Maybe...
        //
        assertEquals(
            "[{\"vehicle_category_code\": \"A\", \"issue_date\": 1004(\"2018-08-09\"), " +
                    "\"expiry_date\": 1004(\"2024-10-20\")}, {\"vehicle_category_code\": \"B\", " +
                    "\"issue_date\": 1004(\"2017-02-23\"), \"expiry_date\": 1004(\"2024-10-20\")}]",
            mdlNs.dataElements["driving_privileges"]?.renderValue(drivingPrivileges)
        )

        // Now check that it does the right thing if a value is passed which
        // isn't expected by the document type
        assertEquals(
            "3 bytes",
            mdlNs.dataElements["portrait"]?.renderValue(Bstr(byteArrayOf(1, 2, 3)))
        )

    }

}/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.multipaz.documenttype.knowntypes

import org.multipaz.cbor.Tagged
import org.multipaz.cbor.Tstr
import org.multipaz.cbor.toDataItem
import org.multipaz.cbor.toDataItemFullDate
import org.multipaz.documenttype.DocumentAttributeType
import org


r()
        scanner.basedir = searchDir.toFile()
        scanner.setIncludes(arrayOf(pattern))
        scanner.scan()

        val files = scanner.includedFiles.map { File(searchDir.toFile(), it) }
        println("Found ${files.size} files matching pattern $pattern in directory $searchDir")

        return files
    }

    private fun resolvePattern(basePath: Path, pattern: String): Pair<Path, String> {

        if (!pattern.contains('/')) return basePath to pattern

        val segments = pattern.split('/')
        val wildcard = checkForWildcard(segments)

        return if (wildcard.hasNone()) {
            val dirPath = segments.dropLast(1).joinToString("/")
            val fileName = segments.last()
            basePath.resolve(dirPath).normalize() to fileName
        } else if (wildcard.position == 0) {
            basePath to pattern
        } else {
            val dirPath = segments.take(wildcard.position).joinToString("/")
            val globPattern = segments.drop(wildcard.position).joinToString("/")
            basePath.resolve(dirPath).normalize() to globPattern
        }
    }

    private fun checkForWildcard(pathSegments: List<String>): WildcardCheckResult {
        val position = pathSegments.indexOfFirst { it.contains('*') }
        return if (position == -1) {
            WildcardCheckResult(position = position, isPresent = false)
        } else {
            WildcardCheckResult(position = position, isPresent = true)
        }
    }

    private data class WildcardCheckResult(
        val position: Int,
        val isPresent: Boolean
    ) {
        fun hasNone() = !isPresent
    }
}package com.gregghz.emacs

import java.util.*
import foo.Bar
import bar.Bar as bBar

// a single line comment

/**
 * a multiline comment
 */

/****************************************************************
 Multiline comment
 without leading "*"
****************************************************************/ // KNOWN_BUG

fun sum(a: Int, b: Int): Int {
    return a + b
}

fun sum(a: Int, b: Int) = a + b

fun printSum(a: Int, b: Int): Unit {
    print(a + b)
}

fun printSum(a: Int, b: Int) {
    val veryLongResultVariableName: Int
        = (a + b)
    print(veryLongResultVariableName)
}

fun functionMultiLineArgs(
    first: Int,
    second: Int,
    third: Int,
    fourth: Int
) {
    print("(${first}, ${second}, ${third}, ${fourth})")
}

val a: Int = 1
val b = 1
val c: Int
c = 1

var x = 5
x += 1

fun main(args: Array<String>) {
    if (args.size == 0) return

    print("First argument: ${args[0]}")
}

fun max(a: Int, b: Int): Int {
    if (a > b)
        return a
    else
        return b
}

fun max(a: Int, b: Int) = if (a > b) a else b

fun parseInt(str: String): Int? {

}

val x = parseInt(args[0])
val y = parseInt(args[1])
if (x != null && y != null) {
    print(x * y)
}

fun getStringLength(obj: Any): Int? {
    if (obj is String) {
        return obj.length
    }

    return null
}

fun main(args: Array<String>) {
    for (arg in args)
        print(arg)
}

for (i in args.indices)
    print(args[i])

fun main(args: Array<String>) {
    var i = 0
    while (


4.2 Basis types

	Real structure	 	4.2 Basis types

	recursive types	 	4.3 Recursive types

	rep	 	1.3 The QCheck structure

	result	 	5.2 Results

Jump to:   	=

A

B

C

D

E

F

G

I

L

M

N

O

P

Q

R

S

T

<a class="summary-letter" href="qcheck_10.html#index_split-0


x76e0
/* 0CADF8 8016A3B8 000B6080 */  sll   $t4, $t3, 2
/* 0CADFC 8016A3BC 022C6821 */  addu  $t5, $s1, $t4
/* 0CAE00 8016A3C0 240A0001 */  li    $t2, 1
/* 0CAE04 8016A3C4 3C04801D */  lui   $a0, %hi(D_801CA980) # $a0, 0x801d
/* 0CAE08 8016A3C8 ADAA0000 */  sw    $t2, ($t5)
/* 0CAE0C 8016A3CC 0C068CBB */  jal   func_801A32EC_ovl3
/* 0CAE10 8016A3D0 2484A980 */   addiu $a0, %lo(D_801CA980) # addiu $a0, $a0, -0x5680
/* 0CAE14 8016A3D4 8ECE0000 */  lw    $t6, ($s6)
/* 0CAE18 8016A3D8 3C0F800E */  lui   $t7, 0x800e
/* 0CAE1C 8016A3DC 3C01800E */  lui   $at, 0x800e
/* 0CAE20 8016A3E0 8DC60000 */  lw    $a2, ($t6)
/* 0CAE24 8016A3E4 44802000 */  mtc1  $zero, $f4
/* 0CAE28 8016A3E8 3C17800F */  lui   $s7, %hi(D_800E98E0) # $s7, 0x800f
/* 0CAE2C 8016A3EC 00063080 */  sll   $a2, $a2, 2
/* 0CAE30 8016A3F0 01E67821 */  addu  $t7, $t7, $a2
/* 0CAE34 8016A3F4 8DEF0D50 */  lw    $t7, 0xd50($t7)
/* 0CAE38 8016A3F8 26F798E0 */  addiu $s7, %lo(D_800E98E0) # addiu $s7, $s7, -0x6720
/* 0CAE3C 8016A3FC 02E66821 */  addu  $t5, $s7, $a2
/* 0CAE40 8016A400 000FC080 */  sll   $t8, $t7, 2
/* 0CAE44 8016A404 00380821 */  addu  $at, $at, $t8
/* 0CAE48 8016A408 C42064D0 */  lwc1  $f0, 0x64d0($at)
/* 0CAE4C 8016A40C 4604003C */  c.lt.s $f0, $f4
/* 0CAE50 8016A410 00000000 */  nop
/* 0CAE54 8016A414 45020007 */  bc1fl .L8016A434_ovl3
/* 0CAE58 8016A418 4600028D */   trunc.w.s $f10, $f0
/* 0CAE5C 8016A41C 46000187 */  neg.s $f6, $f0
/* 0CAE60 8016A420 4600320D */  trunc.w.s $f8, $f6
/* 0CAE64 8016A424 44194000 */  mfc1  $t9, $f8
/* 0CAE68 8016A428 10000005 */  b     .L8016A440_ovl3
/* 0CAE6C 8016A42C AFB90064 */   sw    $t9, 0x64($sp)
/* 0CAE70 8016A430 4600028D */  trunc.w.s $f10, $f0
.L8016A434_ovl3:
/* 0CAE74 8016A434 440B5000 */  mfc1  $t3, $f10
/* 0CAE78 8016A438 00000000 */  nop
/* 0CAE7C 8


aph coloring handle has not been created.");
    //}
    return this->gcHandle;
  }
  void create_graph_coloring_handle(KokkosGraph::ColoringAlgorithm coloring_type = KokkosGraph::COLORING_DEFAULT) {
    this->destroy_graph_coloring_handle();
    this->is_owner_of_the_gc_handle = true;
    this->gcHandle                  = new GraphColoringHandleType();
    this->gcHandle->set_algorithm(coloring_type, true);
    this->gcHandle->set_tictoc(KKVERBOSE);
  }
  void destroy_graph_coloring_handle() {
    if (is_owner_of_the_gc_handle && this->gcHandle != NULL) {
      delete this->gcHandle;
      this->gcHandle = NULL;
    }
  }

  // Distance-2 Graph Coloring
  GraphColorDistance2HandleType *get_distance2_graph_coloring_handle() {
    /* disabled for consistency with `get_graph_coloring_handle()`. See the
    comment there for reasons. if(!this->is_owner_of_the_d2_gc_handle)
    {
      throw std::runtime_error("D2 graph coloring handle has not been
    created.");
    }
    */
    return this->gcHandle_d2;
  }
  void create_distance2_graph_coloring_handle(
      KokkosGraph::GraphColoringAlgorithmDistance2 coloring_type = KokkosGraph::COLORING_D2_DEFAULT) {
    this->destroy_distance2_graph_coloring_handle();
    this->is_owner_of_the_d2_gc_handle = true;
    this->gcHandle_d2                  = new GraphColorDistance2HandleType();
    this->gcHandle_d2->set_algorithm(coloring_type, true);
    this->gcHandle_d2->set_tictoc(KKVERBOSE);
    this->gcHandle_d2->set_verbose(KKVERBOSE);
  }
  void destroy_distance2_graph_coloring_handle() {
    if (is_owner_of_the_d2_gc_handle && this->gcHandle_d2 != NULL) {
      delete this->gcHandle_d2;
      this->gcHandle_d2 = NULL;
    }
  }

  GaussSeidelHandleType *get_gs_handle() { return this->gsHandle; }
  PointGaussSeidelHandleType *get_point_gs_handle() {
    auto pgs = dynamic_cast<PointGaussSeidelHandleType *>(this->gsHandle);
    if (this->gsHandle && !pgs)
      throw std::runtime_error("GaussSeidelHandle exists but is not set up for point-coloring GS.");
    return pgs;
  }
  ClusterGaussSeidelHandleType *get_cluster_gs_handle() {
    auto cgs = dynamic_cast<ClusterGaussSeidelHandleType *>(this->gsHandle);
    if (this->gsHandle && !cgs)
      throw std::runtime_error(
          "GaussSeidelHandle exists but is not set up for cluster-coloring "
          "GS.");
    return cgs;
  }

  // clang-format off
  /**
   * @brief Create a gauss seidel handle object
   *
   * @param handle_exec_space The execution space instance to execute kernels on.
   * @param num_streams The number of streams to allocate memory for.
   * @param gs_algorithm Specifies which algorithm to use:
   *
   *                     KokkosSpace::GS_DEFAULT  PointGaussSeidel
   *                     KokkosSpace::GS_PERMUTED ??
   *                     KokkosSpace::GS_TEAM     ??
   *                     KokkosSpace::GS_CLUSTER  ??
   *                     KokkosSpace::GS_TWOSTAGE ??
   * @param coloring_algorithm Specifies which coloring algorithm to color the graph with:
   *
   *                           KokkosGraph::COLORING_DEFAULT  ??
   *                           KokkosGraph::COLORING_SERIAL


ch_key, env_getMaxTableMessageSwitch_defaultValue))) {
				_maxTableMessageSwitch = env.getProperty(env_getMaxTableMessageSwitch_key,
						env_getMaxTableMessageSwitch_defaultValue);
				maxTableMessageSwitch = _maxTableMessageSwitch.equals("on");
				onChange();
			}
		} catch (Exception e) {
			onChange();
			log.error("getMaxTableMessageSwitch_SoaConfig_error", e);
		}
		return maxTableMessageSwitch;
	}

	private volatile String _maxQueuePerTopic = "";
	private volatile int maxQueuePerTopic = 0;
	private String env_getMaxQueuePerTopic_key = "mq.max.queue.per.topic";
	private String env_getMaxQueuePerTopic_defaultValue = "3";
	private final String env_getMaxQueuePerTopic_des = "普通用户每个topic分配的队列的数量上限是3";

	// 普通用户每个topic分配的队列的数量上限是3
	public int getMaxQueuePerTopic() {
		try {
			if (!_maxQueuePerTopic
					.equals(env.getProperty(env_getMaxQueuePerTopic_key, env_getMaxQueuePerTopic_defaultValue))) {
				_maxQueuePerTopic = env.getProperty(env_getMaxQueuePerTopic_key, env_getMaxQueuePerTopic_defaultValue);
				maxQueuePerTopic = Integer
						.parseInt(env.getProperty(env_getMaxQueuePerTopic_key, env_getMaxQueuePerTopic_defaultValue));
				onChange();
			}
		} catch (Exception e) {
			onChange();
			log.error("getMaxQueuePerTopic_SoaConfig_error", e);
		}
		return maxQueuePerTopic;
	}

	private volatile String _expectDayCountOptions = "";
	private volatile List<Integer> expectDayCountOptions = new ArrayList<>();
	private String env_getExpectDayCountOptions_key = "mq.expect.day.count.select.option";
	private String env_getExpectDayCountOptions_defaultValue = "[200,300,400,500]";
	private final String env_getExpectDayCountOptions_des = "默认每个topic每天数量下拉列表";

	// 默认每个topic每天数量下拉列表
	public List<Integer> getExpectDayCountOptions() {
		try {
			if (!_expectDayCountOptions.equals(
					env.getProperty(env_getExpectDayCountOptions_key, env_getExpectDayCountOptions_defaultValue))) {
				_expectDayCountOptions = env.getProperty(env_getExpectDayCountOptions_key,
						env_getExpectDayCountOptions_defaultValue);
				expectDayCountOptions = JsonUtil.parseJson(
						env.getProperty(env_getExpectDayCountOptions_key, env_getExpectDayCountOptions_defaultValue),
						new TypeReference<List<Integer>>() {
						});
				onChange();
			}
		} catch (Exception e) {
			onChange();
			log.error("getMaxQueuePerTopic_SoaConfig_error", e);
		}
		return expectDayCountOptions;
	}

	private volatile String _logSaveDayNum = "";
	private volatile int logSaveDayNum = 0;
	private String env_getLogSaveDayNum_key = "mq.log.save.day.num";
	private String env_getLogSaveDayNum_defaultValue = "30";
	private final String env_getLogSaveDayNum_des = "审计日志保留天数";

	// 审计日志保留天数
	public int getLogSaveDayNum() {
		try {
			if (!_logSaveDayNum.equals(env.getProperty(env_getLogSaveDayNum_key, env_getLogSaveDayNum_defaultValue))) {
				_logSaveDayNum = env.getProperty(env


red_resources_event\x18\x1a \x01(\v26.prehog.v1alpha.UIDiscoverAutoDiscoveredResourcesEventH\x00R&uiDiscoverAutoDiscoveredResourcesEvent\x12\x9f\x01\n" +
	"/ui_discover_database_configure_iam_policy_event\x18\x1b \x01(\v29.prehog.v1alpha.UIDiscoverDatabaseConfigureIAMPolicyEventH\x00R)uiDiscoverDatabaseConfigureIamPolicyEvent\x12\x88\x01\n" +
	"&ui_discover_principals_configure_event\x18\x1c \x01(\v22.prehog.v1alpha.UIDiscoverPrincipalsConfigureEventH\x00R\"uiDiscoverPrincipalsConfigureEvent\x12y\n" +
	"!ui_discover_test_connection_event\x18\x1d \x01(\v2-.prehog.v1alpha.UIDiscoverTestConnectionEventH\x00R\x1duiDiscoverTestConnectionEvent\x12i\n" +
	"\x1bui_discover_completed_event\x18\x1e \x01(\v2(.prehog.v1alpha.UIDiscoverCompletedEventH\x00R\x18uiDiscoverCompletedEvent\x12B\n" +
	"\vrole_create\x18\x1f \x01(\v2\x1f.prehog.v1alpha.RoleCreateEventH\x00R\n" +
	"roleCreate\x12c\n" +
	"\x18ui_create_new_role_click\x18  \x01(\v2).prehog.v1alpha.UICreateNewRoleClickEventH\x00R\x14uiCreateNewRoleClick\x12p\n" +
	"\x1dui_create_new_role_save_click\x18! \x01(\v2-.prehog.v1alpha.UICreateNewRoleSaveClickEventH\x00R\x18uiCreateNewRoleSaveClick\x12v\n" +
	"\x1fui_create_new_role_cancel_click\x18\" \x01(\v2/.prehog.v1alpha.UICreateNewRoleCancelClickEventH\x00R\x1auiCreateNewRoleCancelClick\x12\x98\x01\n" +
	"+ui_create_new_role_view_documentation_click\x18# \x01(\v2:.prehog.v1alpha.UICreateNewRoleViewDocumentationClickEventH\x00R%uiCreateNewRoleViewDocumentationClick\x12E\n" +
	"\fkube_request\x18$ \x01(\v2 .prehog.v1alpha.KubeRequestEventH\x00R\vkubeRequest\x12/\n" +
	"\x04sftp\x18% \x01(\v2\x19.prehog.v1alpha.SFTPEventH\x00R\x04sftp\x12V\n" +
	"\x14agent_metadata_event\x18& \x01(\v2\".prehog.v1alpha.AgentMetadataEventH\x00R\x12agentMetadataEvent\x12W\n" +
	"\x12resource_heartbeat\x18' \x01(\v2&.prehog.v1alpha.ResourceHeartbeatEventH\x00R\x11resourceHeartbeat\x12\x9c\x01\n" +
	".ui_discover_integration_aws_oidc_connect_event\x18( \x01(\v28.prehog.v1alpha.UIDiscoverIntegrationAWSOIDCConnectEventH\x00R(uiDiscoverIntegrationAwsOidcConnectEvent\x12\x83\x01\n" +
	"%ui_discover_database_rds_enroll_event\x18) \x01(\v20.prehog.v1alpha.UIDiscoverDatabaseRDSEnrollEventH\x00R uiDiscoverDatabaseRdsEnrollEvent\x12k\n" +
	"\x1dui_call_to_action_click_event\x18* \x01(\v2(.prehog.


Yandere.PersonaID = 0;
				}
				UpdatePersona();
			}
		}
		else if (Prompt.Circle[1].fillAmount == 0f && Prompt.Yandere.Health > 0)
		{
			Prompt.Circle[1].fillAmount = 1f;
			Prompt.Yandere.PersonaID--;
			if (Prompt.Yandere.PersonaID < 0)
			{
				Prompt.Yandere.PersonaID = Limit - 1;
			}
			UpdatePersona();
		}
	}

	public void UpdatePersona()
	{
		if (!Started)
		{
			Start();
		}
		int personaID = Prompt.Yandere.PersonaID;
		if (!Prompt.Yandere.Carrying)
		{
			if (!Prompt.Yandere.Resting)
			{
				Prompt.Yandere.NotificationManager.PersonaName = Personas[personaID];
				Prompt.Yandere.NotificationManager.DisplayNotification(NotificationType.Persona);
			}
			Prompt.Yandere.IdleAnim = Idles[personaID];
			Prompt.Yandere.WalkAnim = Walks[personaID];
			Prompt.Yandere.UpdatePersona(personaID);
		}
		Prompt.Yandere.OriginalIdleAnim = Idles[personaID];
		Prompt.Yandere.OriginalWalkAnim = Walks[personaID];
		Prompt.Yandere.StudentManager.UpdatePerception();
	}
}


a1v.d[w15, 0]}, p5, [x9, x1, lsl #3]
// CHECK-ENCODING: [0x22,0xf5,0xe1,0xe0]
// CHECK-ERROR: instruction requires: sme
// CHECK-UNKNOWN: e0e1f522 <unknown>

st1d    za3v.d[w13, 1], p2, [x12, x11, lsl #3]
// CHECK-INST: st1d    {za3v.d[w13, 1]}, p2, [x12, x11, lsl #3]
// CHECK-ENCODING: [0x87,0xa9,0xeb,0xe0]
// CHECK-ERROR: instruction requires: sme
// CHECK-UNKNOWN: e0eba987 <unknown>


check for this interface and return the specific
// BlockMode if found.
type cbcEncAble interface {
	NewCBCEncrypter(iv []byte) BlockMode
}

// NewCBCEncrypter returns a BlockMode which encrypts in cipher block chaining
// mode, using the given Block. The length of iv must be the same as the
// Block's block size.
func NewCBCEncrypter(b Block, iv []byte) BlockMode {
	if len(iv) != b.BlockSize() {
		panic("cipher.NewCBCEncrypter: IV length must equal block size")
	}
	if cbc, ok := b.(cbcEncAble); ok {
		return cbc.NewCBCEncrypter(iv)
	}
	return (*cbcEncrypter)(newCBC(b, iv))
}

func (x *cbcEncrypter) BlockSize() int { return x.blockSize }

func (x *cbcEncrypter) CryptBlocks(dst, src []byte) {
	if len(src)%x.blockSize != 0 {
		panic("crypto/cipher: input not full blocks")
	}
	if len(dst) < len(src) {
		panic("crypto/cipher: output smaller than input")
	}
	if subtle.InexactOverlap(dst[:len(src)], src) {
		panic("crypto/cipher: invalid buffer overlap")
	}

	iv := x.iv

	for len(src) > 0 {
		// Write the xor to dst, then encrypt in place.
		xorBytes(dst[:x.blockSize], src[:x.blockSize], iv)
		x.b.Encrypt(dst[:x.blockSize], dst[:x.blockSize])

		// Move to the next block with this block as the next iv.
		iv = dst[:x.blockSize]
		src = src[x.blockSize:]
		dst = dst[x.blockSize:]
	}

	// Save the iv for the next CryptBlocks call.
	copy(x.iv, iv)
}

func (x *cbcEncrypter) SetIV(iv []byte) {
	if len(iv) != len(x.iv) {
		panic("cipher: incorrect length IV")
	}
	copy(x.iv, iv)
}

type cbcDecrypter cbc

// cbcDecAble is an interface implemented by ciphers that have a specific
// optimized implementation of CBC decryption, like crypto/aes.
// NewCBCDecrypter will check for this interface and return the specific
// BlockMode if found.
type cbcDecAble interface {
	NewCBCDecrypter(iv []byte) BlockMode
}

// NewCBCDecrypter returns a BlockMode which decrypts in cipher block chaining
// mode, using the given Block. The length of iv must be the same as the
// Block's block size and must match the iv used to encrypt the data.
func NewCBCDecrypter(b Block, iv []byte) BlockMode {
	if len(iv) != b.BlockSize() {
		panic("cipher.NewCBCDecrypter: IV length must equal block size")
	}
	if cbc, ok := b.(cbcDecAble); ok {
		return cbc.NewCBCDecrypter(iv)
	}
	return (*cbcDecrypter)(newCBC(b, iv))
}

func (x *cbcDecrypter) BlockSize() int { return x.blockSize }

func (x *cbcDecrypter) CryptBlocks(dst, src []byte) {
	if len(src)%x.blockSize != 0 {
		panic("crypto/cipher: input not full blocks")
	}
	if len(dst) < len(src) {
		panic("crypto/cipher: output smaller than input")
	}
	if subtle.InexactOverlap(dst[:len(src)], src) {
		panic("crypto/cipher: invalid buffer overlap")
	}
	if


from typing import List, Optional
from fastapi import APIRouter, Depends, HTTPException, UploadFile, File, Form, Query, Request
from sqlalchemy.orm import Session
from sqlalchemy import text
from pydantic import BaseModel
from datetime import datetime, timezone
import json

from app.api.deps import get_db, get_current_active_user
from app.models.user import User
from app.models.community_sharing import CommunitySharing
from app.models.common import CommonStatus
from app.schemas.community_common import (
    CommunityBaseRequest,
    StandardListResponse,
    StandardDetailResponse,
    StandardContactInfo,
    format_contact_info
)
from app.enums.community import CommunityStatus, CommunityCategory, map_sharing_status
from app.utils.community_helpers import (
    format_community_response,
    apply_pagination,
    create_standard_list_response,
    create_standard_detail_response,
    standardize_status_response
)

class SharingCreateRequest(CommunityBaseRequest):
    """무료 나눔 생성 요청 (공통 스키마 기반)"""
    category: str
    condition: Optional[str] = "good"
    images: Optional[List[str]] = []
    price: int = 0  # 무료 나눔은 항상 0원
    is_free: bool = True  # 무료 나눔은 항상 True

router = APIRouter()

def map_frontend_status_to_db(status: str) -> str:
    """프론트엔드 status 값을 DB 저장용 단순화된 상태값으로 매핑"""
    # 새로운 단순화된 상태값: sharing, completed
    status_mapping = {
        # 기존 상태값들 → 새로운 상태값
        "available": "sharing",
        "reserved": "sharing",
        "active": "sharing",
        "paused": "sharing",
        "sharing": "sharing",  # 새로운 상태값
        "completed": "completed",
        "cancelled": "completed",  # 취소도 완료로 처리
    }
    return status_mapping.get(status.lower(), "sharing")  # 기본값: sharing

def map_db_status_to_frontend(status: str) -> str:
    """DB 상태값을 프론트엔드가 기대하는 형태로 매핑 (호환성 유지)"""
    # DB의 단순화된 상태값 → 프론트엔드 호환 상태값
    status_mapping = {
        "sharing": "sharing",     # 나눔중
        "completed": "completed", # 나눔완료
        # 기존 상태값들 (마이그레이션 전 데이터 호환성)
        "available": "sharing",
        "reserved": "sharing",
        "active": "sharing",
        "paused": "sharing",
        "cancelled": "completed",
    }
    return status_mapping.get(status, "sharing")  # 기본값: sharing

# 프론트엔드에서 호출하는 나눔 제공 URL에 맞춰 추가 (실제 DB 조회)
@router.get("/sharing-offer", response_model=dict)
def get_sharing_offer_list(
    status: Optional[str] = Query(None, description="상태 필터: sharing, completed"),
    category: Optional[str] = Query(None, description="카테고리 필터"),
    location: Optional[str] = Query(None, description="지역 필터"),
    search: Optional[str] = Query(None, description="제목/내용 검색"),
    church_filter: Optional[int] = Query(None, description="교회 필터 (선택사항)"),
    page: int = Query(1, ge=1, description="페이지 번호"),
    limit: int = Query(20, ge=1, le=100, description="페이지당 항목 수"),
    db: Session = Depends(get_db),
    current_user: User = Depends(get_current_active_user)
):
    """나눔 제공 목록 조회 - 실제 데이터베이스에서 조회"""
    # /sharing-offer와 /sharing은 동일한 로직 사용
    return get_sharing_list(status, category, location, search, church_filter, None, page, limit, db, current_user)

@router.get("/sharing", response_model=dict)
def get_sharing_list(
    status: Optional[str] = Query(None, description="상태 필터: sharing, completed"),
    category: Optional[str] = Query(None, description="카테고리 필터"),
    location: Optional[str] = Query(None, description="지역 필터"),
    search: Optional[str] = Query(None, description="제목/내용 검색"),
    church_filter: Optional[int] = Query(None, description="교회 필터 (선택사항)"),
    increment_view: Optional[int] = Query(None, description="조회수를 증가시킬 아이템 ID (상세 조회 대체용)"),
    page: int = Query(1, ge=1, description="페이지 번호"),
    limit: int = Query(20, ge=1, le=100, description="페이지당 항목 수"),
    db: Session = Depends(get_db),
    current_user: User = Depends(get_current_active_user)
):
    """나눔 목록 조회 - 실제 데이터베이스에서 조회"""
    try:
        print(f"🚀 [DEBUG] 커뮤니티 나눔 API 호출됨 - 배포 버전 2024-09-11")
        print(f"🚀 [DEBUG] 현재 사용자: church_id={current_user.church_id}, user_id={current_user.id}")

        # 조회수 증가 기능 (상세 API 대신 사용)
        if increment_view:
            try:
                print(f"🔍 [VIEW_COUNT_FALLBACK] 목록 API에서 조회수 증가 시도 - ID: {increment_view}")
                increment_sql = """
                    UPDATE community_sharing
                    SET view_count = COALESCE(view_count, 0) + 1
                    WHERE id = :sharing_id
                    RETURNING view_count
                """
                result = db


the rank base
			// and the game type.  apparently we only support either above or below, not both
			// together, so I make a random choice
			rank = multi_start_game_rank_from_name( rank_str );
			if ( rank != -1 ) {
				Multi_sg_netgame->rank_base = Multi_sg_rank_select;

				// now an arbitrary decision
				if ( Cmdline_rank_above != NULL ) {
					Multi_sg_netgame->mode = NG_MODE_RANK_ABOVE;
				} else {
					Multi_sg_netgame->mode = NG_MODE_RANK_BELOW;
				}
			}
		}

		gameseq_post_event(GS_EVENT_MULTI_HOST_SETUP);
	}
}

void multi_start_game_do(bool API_Access)
{
	// return here since we will be moving to the next stage anyway -- I don't want to see the backgrounds of
	// all the screens for < 1 second for every screen we automatically move to.
	if ( Cmdline_start_netgame ) {
		Cmdline_start_netgame = 0; // DTP no quit fix; by using -startgame Quit was sort of out of function
		return;
	}

	if (!API_Access) {
		int k = Multi_sg_window.process();

		// process any keypresses
		switch (k) {
		case KEY_ESC:
			if (help_overlay_active(Multi_sg_overlay_id)) {
				help_overlay_set_state(Multi_sg_overlay_id, gr_screen.res, 0);
			} else {
				gamesnd_play_iface(InterfaceSounds::USER_SELECT);
				multi_quit_game(PROMPT_NONE);
			}
			break;

		// same as ACCEPT
		case KEY_LCTRL + KEY_ENTER:
		case KEY_RCTRL + KEY_ENTER:
			gamesnd_play_iface(InterfaceSounds::COMMIT_PRESSED);
			gameseq_post_event(GS_EVENT_MULTI_HOST_SETUP);
			break;
		}

		if (mouse_down(MOUSE_LEFT_BUTTON)) {
			help_overlay_set_state(Multi_sg_overlay_id, gr_screen.res, 0);
		}

		// check to see if the user has selected a different rank
		multi_sg_rank_process_select();

		// check any button presses
		multi_sg_check_buttons();

		// check to see if any of the input boxes have changed, and update the appropriate Netgame fields if necessary
		multi_sg_check_passwd();
		multi_sg_check_name();

		// draw the background, etc
		gr_reset_clip();
		GR_MAYBE_CLEAR_RES(Multi_sg_bitmap);
		if (Multi_sg_bitmap != -1) {
			gr_set_bitmap(Multi_sg_bitmap);
			gr_bitmap(0, 0, GR_RESIZE_MENU);
		}
		Multi_sg_window.draw();

		// display rank stuff
		multi_sg_rank_display_stuff();
	}

	// display any pending notification messages
	multi_common_notify_do();

	if (!API_Access) {
		// draw all radio button
		multi_sg_draw_radio_buttons();

		// draw the help overlay
		help_overlay_maybe_blit(Multi_sg_overlay_id, gr_screen.res);

		// flip the buffer
		gr_flip();
	}
}

void multi_start_game_close(bool API_Access)
{
	// if i'm the host on a standalone server, send him my start game options (passwd, mode, etc)
	if((Net_player->flags & NETINFO_FLAG_GAME_HOST) && !(Net_player->flags & NETINFO_FLAG_AM_MASTER)){
		multi_options_update_start_game(


      add.l   D4,D3           ;32*hi+ 11*med + 8*lo
                swap    D0              ;R*32
                swap    D1
                swap    D2              ;hold dx,dy,dz*65536
                divs    D3,D0
                divs    D3,D1
                divs    D3,D2
                move.w  D0,Ll           ;
                move.w  D1,Lm           ;answer * 2048
                move.w  D2,Ln           ;
                rts
;#####################################################
;maximum values in lightsource= -$400...$3ff !!
lightsource:    DC.W 50,100,0   ;this is a vector, not a point
Ll:             DS.W 1
Lm:             DS.W 1
Ln:             DS.W 1
                EVEN
shades:         lea     shpoly(PC),A4
                movem.w 2(A4),D0-D7     ;y1,z1,x2,y2,z2,x3,y3,z3
                sub.w   (A4),D2         ;x2-x1
                sub.w   (A4),D5         ;x3-x1
                sub.w   D0,D3           ;y2-y1
                sub.w   D0,D6           ;y3-y1
                sub.w   D1,D4           ;z2-z1
                sub.w   D1,D7           ;z3-z1
;Note only the first 3 point of the poly are used..
;This has translated the poly so that 1 point is at the origin
;Now to find the Surface normal involves 6 muls and 9 subs
;instead of 9 muls, 9 subs & 6 adds
;A=y'z"-z'y"
;B=z'x"-x'z"
;C=x'y"-y'x"
;only if x'"y'"z'" are 0,0,0 though!!
;HaHa I WORKED THIS OPTIMISATION OUT MYSELF !! ..and it works fine..
                move.w  D7,D0           ;move z" into spare reg.
                muls    D3,D0           ;d0 = y'z"
                muls    D5,D3           ;d3 = y'x"
                muls    D4,D5           ;d5 = z'x"
                muls    D6,D4           ;d4 = z'y"
                muls    D2,D6           ;d6 = x'y"
                muls    D7,D2           ;d2 = x'z"      ;1 move... (on form tonite)
                sub.l   D4,D0           ;A
                sub.l   D2,D5           ;B
                sub.l   D3,D6           ;C
;       blt     bface   ;yes.. backface removal (pre perspective, though)
                move.l  D5,D1
                move.l  D6,D2           ;ok.. 3 moves (sob)
;Surface normal coefficients A,B,C in d0-d2 respectively
;Now get absolutes for SQR(x^2+y^2+z^2)
                move.l  D0,D3
                bge.s   ok1j
                neg.l   D3
ok1j:           move.l  D1,D4
                bge.s   ok2j
                neg.l   D4
ok2j:           move.l  D2,D5
                bge.s   ok3j
                neg.l   D5
ok3j:
                cmp.l   D3,D4
                bge.s   ok4j
                exg     D3,D4           ; d3 is smallest, d4 is biggest..
ok4j:           cmp.l   D4,D5
                bge.s   ok5j
                exg     D4,D5


oords[8],grid[7],grid[8]);
    end
    if (bit.band(edgeTable[cubeindex], 128) ~= 0) then
        vertlist[8] = VertexInterp(isolevel,coords[8],coords[5],grid[8],grid[5]);
    end
    if (bit.band(edgeTable[cubeindex], 256) ~= 0) then
        vertlist[9] = VertexInterp(isolevel,coords[1],coords[5],grid[1],grid[5]);
    end
    if (bit.band(edgeTable[cubeindex], 512) ~= 0) then
        vertlist[10] = VertexInterp(isolevel,coords[2],coords[6],grid[2],grid[6]);
    end
    if (bit.band(edgeTable[cubeindex], 1024) ~= 0) then
        vertlist[11] = VertexInterp(isolevel,coords[3],coords[7],grid[3],grid[7]);
    end
    if (bit.band(edgeTable[cubeindex], 2048) ~= 0) then
        vertlist[12] = VertexInterp(isolevel,coords[4],coords[8],grid[4],grid[8]);
    end

    local ntriang = 0;
    for i=1,15,3 do
        if(triTable[cubeindex][i] ~= -1) then
            ntriang = ntriang + 1
            --print(cubeindex)
            --print(triTable[cubeindex][i  ], triTable[cubeindex][i+1], triTable[cubeindex][i+2])
            triangles[ntriang] = {vertlist[triTable[cubeindex][i  ] + 1], vertlist[triTable[cubeindex][i+1] + 1], vertlist[triTable[cubeindex][i+2] + 1]}
        end
    end
    return triangles
end

local function march(grid, coords, isolevel)
    local triangles = {}
    local ntri = 1
    local vertexOrder = {{0,0,0}, {0,0,1}, {0,1,1}, {0,1,0}, {1,0,0}, {1,0,1}, {1,1,1}, {1,1,0}}
    for ix=1,grid:size(1)-1 do
        for iy=1,grid:size(2)-1 do
            for iz=1,grid:size(3)-1 do
                --local subgrid = grid[{{ix,ix+1},{iy,iy+1},{iz,iz+1}}]
                --local subcoords = coords[{{ix,ix+1},{iy,iy+1},{iz,iz+1}, {}}]

                local subgrid = torch.Tensor(8)
                local subcoords = torch.Tensor(8,3)
                for vId = 1,8 do
                    subgrid[vId] = grid[ix+vertexOrder[vId][1]][iy+vertexOrder[vId][2]][iz+vertexOrder[vId][3]]
                    subcoords[vId] = coords[ix+vertexOrder[vId][1]][iy+vertexOrder[vId][2]][iz+vertexOrder[vId][3]]
                end

                local celltri = polygonize(subgrid, subcoords, isolevel)
                for t=1,#celltri do
                    triangles[ntri] = celltri[t]
                    ntri = ntri+1
                end
            end
        end
    end
    local trianglesTensor = torch.Tensor(#triangles,3,3)
    for ix=1,#triangles do
        for pt=1,3 do
            trianglesTensor[ix][pt] = triangles[ix][pt]
        end
    end


秃为首的现代修正主义集团对我们的围攻，取得了很大胜利。彭真在会上完全是一付投降主义面孔。在宴会祝酒时，赫秃指桑骂槐攻击我们伟大的领袖毛主席，攻击康生同志，彭真故意不作反击。会议期间彭贼同赫秃勾搭拥抱，还恬不知耻地说：“吵架是吵架，吵完还得拥抱。”

   彭真从布加勒斯特回来以后，到处作报告，不提毛主席和党中央对这次会议的正确领导，却突出个人，自我吹嘘，贪天之功，据为己有，大捞政治资本。

   8月20日，旧市委召开大学应届毕业生大会。彭真在会上作报告，大肆反对毛泽东思想。他抹杀教育战线上的阶级斗争，为资产阶级知识分子打掩护，胡说什么“是做无产阶级知识分子，还是作资产阶级知识分子，这在大多数人都已经解决了”。他还向学生灌输“和平共处”“和平过渡”的修正主义谬论，宣扬资产阶级个人主义和刘少奇的“吃小亏，占大便宜”的黑货，毒害青年。

   9月初，旧市委召开工作会议，抗拒中央北戴河会议关于全党大办农业，大办粮食，压缩城市人口，支援农业的决定。会上，不讨论压缩北京市所属单位的人员，却企图扭转目标，挤掉中央一些所属单位。郑天翔专门派人搜集材料，把中央各部所属企业、事业、学校和职工、学生人数列了统计表，在会上印发。并且策划哪些单位不应设在北京，可以搬走，起草一个向中央的报告。后来做贼心虚，未敢上报，就采取化整为零，分类列表，陆续在旧市委内部“简报”上登载，妄图达到不可告人的目的。

   10月1日，中国人民和世界革命人民盼望已久的、光辉灿烂的、光焰无际的《毛泽东选集》第四卷出版发行。一贯高举毛泽东思想伟大红旗的林彪同志指出：“�


                Modifier.weight(1f).height(3.dp),
                    progress,
                    downloadStateType,
                    downloadState,
                    downloadRequest,
                    screenNavigator,
                    cb
                )
            }
            Spacer(modifier = Modifier.height(24.dp))
        }
    }
}

@Composable
fun ProgressView(
    modifier: Modifier = Modifier,
    progress: State<Int>,
    downloadStateType: State<DownloadStateType>,
    downloadState: DownloadState,
    downloadRequest: DownloadRequest,
    screenNavigator: ScreenNavigator,
    cb: (DownloadRequest) -> Unit
) {
    LinearProgressIndicator(
        color = ColorResource.acRed,
        backgroundColor = Color.LightGray,
        modifier = modifier,
        progress = progress.value / 100f
    )
    Spacer(modifier = Modifier.width(24.dp))
    Text(
        text = "${progress.value}%", maxLines = 1, style = MaterialTheme.typography.body1
    )
    Spacer(modifier = Modifier.width(24.dp))
    Text(
        text = when (downloadStateType.value) {
            DownloadStateType.Starting, DownloadStateType.Downloading -> {
                "暂停"
            }

            DownloadStateType.Uninitialized, is DownloadStateType.Error, DownloadStateType.Pause -> {
                "继续"
            }

            DownloadStateType.Finish -> {
                "播放"
            }
        }, modifier = Modifier.noRippleClickable {
            when (downloadStateType.value) {
                DownloadStateType.Starting, DownloadStateType.Downloading -> {
                    FileDownLoader.instance().pause(downloadState)
                }

                DownloadStateType.Uninitialized, is DownloadStateType.Error, DownloadStateType.Pause -> {
                    FileDownLoader.instance().download(downloadState)
                }

                DownloadStateType.Finish -> {
                    screenNavigator.push(
                        Manifest.VideoPlayerScreen,
                        arguments = ScreenArgs.putValue("KEY_VIDEO_LOCAL_TITLE", downloadRequest.title).putValue(
                            "KEY_VIDEO_LOCAL_FILE", downloadRequest.m3u8FilePath
                        )
                    )
                }
            }
        }, maxLines = 1, style = MaterialTheme.typography.body1
    )
    Spacer(modifier = Modifier.width(24.dp))
    Text(text = "取消", maxLines = 1, style = MaterialTheme.typography.body1, modifier = Modifier.noRippleClickable {
        FileDownLoader.instance().stop(downloadState)
        cb.invoke(downloadRequest)
    })
}package org.succlz123.app.acfun.api.bean

import kotlinx.serialization.Serializable

@Serializable
data class LiveRoomList(
    val liveList: List<LiveX>? = null,
    val totalCount: Int? = null
)

@Serializable
data class LiveX(
    val action: Int? = null,
    val authorId: Int? = null,
    val bizCustomData: String? = null,
    val cdnAuthBiz: Int? = null,
    val coverUrls: List<String>? = null,
    val createTime: Long? = null,
    val disableDanmakuShow: Boolean? = null,
    val formatLikeCount: String? = null,
    val formatOnlineCount: String? = null,
    val groupId: String? = null,
    val hasFansClub: Boolean? = null,
    val href: String? = null,
    val likeCount: Int? = null,
    val liveId: String? = null,
    val onlineCount: Int? = null,
    val paidShowUserBuyStatus: Boolean? = null,
    val panoramic: Boolean? = null,
    val portrait: Boolean? = null,
    val requestId: String? = null,
    val streamName: String? = null,
    val title: String? = null,
    val type: TypeX? = null,
    val user: UserX? = null
)

@Serializable
data class TypeX(
    val categoryId: Int? = null, val categoryName: String? = null, val id: Int? = null,


)
	lfs	FZERO,144(SP)

#ifdef F_INTERFACE
	LDINT	N,    0(N)
	LDINT	INCX, 0(INCX)
#endif

	slwi	INCX, INCX, BASE_SHIFT

	sub	X, X, INCX

	cmpwi	cr0, N, 0
	ble-	LL(9999)
	cmpwi	cr0, INCX, 0
	ble-	LL(9999)

	LFDUX	f1, X, INCX

	fmr	f0, f1
	subi	N, N, 1
	fmr	f2, f1
	fmr	f3, f1
	fmr	f4, f1
	fmr	f5, f1
	srawi.	r0, N, 4
	fmr	f6, f1
	mtspr	CTR,  r0
	fmr	f7, f1
	beq-	LL(150)

	LFDUX	f16,   X, INCX
	LFDUX	f17,   X, INCX
	LFDUX	f18,   X, INCX
	LFDUX	f19,   X, INCX
	LFDUX	f20,   X, INCX
	LFDUX	f21,   X, INCX
	LFDUX	f22,   X, INCX
	LFDUX	f23,   X, INCX

	LFDUX	f24,   X, INCX
	fsub	f8,  f0,  f16
	LFDUX	f25,   X, INCX
	fsub	f9,  f1,  f17
	LFDUX	f26,   X, INCX
	fsub	f10, f2,  f18
	LFDUX	f27,   X, INCX
	fsub	f11, f3,  f19
	LFDUX	f28,   X, INCX
	fsub	f12, f4,  f20
	LFDUX	f29,   X, INCX
	fsub	f13, f5,  f21
	LFDUX	f30,   X, INCX
	fsub	f14, f6,  f22
	LFDUX	f31,   X, INCX
	fsub	f15, f7,  f23
	bdz	LL(120)
	.align 4

LL(110):
	fsel	f0,  f8,  f16,  f0
	LFDUX	f16,   X, INCX
	fsub	f8,  f0,  f24
	fsel	f1,  f9,  f17,  f1
	LFDUX	f17,   X, INCX
	fsub	f9,  f1,  f25
	fsel	f2,  f10, f18,  f2
	LFDUX	f18,   X, INCX
	fsub	f10, f2,  f26
	fsel	f3,  f11, f19,  f3
	LFDUX	f19,   X, INCX
	fsub	f11, f3,  f27

	fsel	f4,  f12, f20, f4
	LFDUX	f20,   X, INCX
	fsub	f12, f4,  f28
	fsel	f5,  f13, f21, f5
	LFDUX	f21,   X, INCX
	fsub	f13, f5,  f29
	fsel	f6,  f14, f22, f6
	LFDUX	f22,   X, INCX
	fsub	f14, f6,  f30
	fsel	f7,  f15, f23, f7
	LFDUX	f23,   X, INCX
	fsub	f15, f7,  f31

	fsel	f0,  f8,  f24, f0
	LFDUX	f24,   X, INCX
	fsub	f8,  f0,  f16
	fsel	f1,  f9,  f25, f1
	LFDUX	f25,   X, INCX
	fsub	f9,  f1,  f17
	fsel	f2,  f10, f26, f2
	LFDUX	f26,   X, INCX
	fsub	f10, f2,  f18
	fsel	f3,  f11, f27, f3
	LFDUX	f27,   X, INCX
	fsub	f11, f3,  f19

	fsel	f4,  f12, f28, f4
	LFDUX	f28,   X, INCX
	fsub	f12, f4,  f20
	fsel	f5,  f13, f29, f5
	LFDUX	f29,   X, INCX
	fsub	f13, f5,  f21
	fsel	f6,  f14, f30, f6
	LFDUX	f30,   X, INCX
	fsub	f14, f6,  f22
	fsel	f7,  f15, f31, f7
	LFDUX	f31,   X, INCX
	fsub	f15, f7,  f23
	bdnz	LL(110)
	.align 4

LL(120):
	fsel	f0,  f8


 */  lw      $v0, 0x002C($sp)
/* 01468 80B454B8 860203F4 */  lh      $v0, 0x03F4($s0)           ## 000003F4
/* 0146C 80B454BC 28611FFE */  slti    $at, $v1, 0x1FFE
/* 01470 80B454C0 8FA40034 */  lw      $a0, 0x0034($sp)
/* 01474 80B454C4 10400005 */  beq     $v0, $zero, .L80B454DC
/* 01478 80B454C8 244BFFFF */  addiu   $t3, $v0, 0xFFFF           ## $t3 = FFFFFFFF
/* 0147C 80B454CC 10200074 */  beq     $at, $zero, .L80B456A0
/* 01480 80B454D0 A60B03F4 */  sh      $t3, 0x03F4($s0)           ## 000003F4
/* 01484 80B454D4 10000005 */  beq     $zero, $zero, .L80B454EC
/* 01488 80B454D8 A60003F4 */  sh      $zero, 0x03F4($s0)         ## 000003F4
.L80B454DC:
/* 0148C 80B454DC 0C2D13A3 */  jal     func_80B44E8C
/* 01490 80B454E0 02002825 */  or      $a1, $s0, $zero            ## $a1 = 00000000
/* 01494 80B454E4 5440006F */  bnel    $v0, $zero, .L80B456A4
/* 01498 80B454E8 8FBF001C */  lw      $ra, 0x001C($sp)
.L80B454EC:
/* 0149C 80B454EC 8FA2002C */  lw      $v0, 0x002C($sp)
.L80B454F0:
/* 014A0 80B454F0 860D00B6 */  lh      $t5, 0x00B6($s0)           ## 000000B6
/* 014A4 80B454F4 3C0142C8 */  lui     $at, 0x42C8                ## $at = 42C80000
/* 014A8 80B454F8 844C00B6 */  lh      $t4, 0x00B6($v0)           ## 000000B6
/* 014AC 80B454FC 44813000 */  mtc1    $at, $f6                   ## $f6 = 100.00
/* 014B0 80B45500 018D1823 */  subu    $v1, $t4, $t5
/* 014B4 80B45504 00031C00 */  sll     $v1, $v1, 16
/* 014B8 80B45508 00031C03 */  sra     $v1, $v1, 16
/* 014BC 80B4550C 04630005 */  bgezl   $v1, .L80B45524
/* 014C0 80B45510 C6040090 */  lwc1    $f4, 0x0090($s0)           ## 00000090
/* 014C4 80B45514 00031823 */  subu    $v1, $zero, $v1
/* 014C8 80B45518 00031C00 */  sll     $v1, $v1, 16
/* 014CC 80B4551C 00031C03 */  sra     $v1, $v1, 16
/* 014D0 80B45520 C6040090 */  lwc1    $f4, 0x0090($s0)           ## 00000090
.L80B45524:
/* 014D4 80B45524 4606203C */  c.lt.s  $f4, $f6
/* 014D8 80B45528 00000000 */  nop
/* 014DC 80B4552C 45020010 */  bc1fl   .L80B45570


;
    type Push<'v> = Value<'v>;
    type Arg = (
        ArgPopsStack1,
        Symbol,
        KnownMethod,
        A,
        FrozenRef<'static, FrozenFileSpan>,
    );

    #[inline(always)]
    fn run_with_args<'v>(
        eval: &mut Evaluator<'v, '_>,
        stack: &mut BcStackPtr<'v, '_>,
        _ip: BcPtrAddr,
        (_pop1, symbol, known_method, args, span): &Self::Arg,
        _pops: (),
    ) -> anyhow::Result<Value<'v>> {
        let arguments = args.pop_from_stack(stack);
        let this = stack.pop();
        call_maybe_known_method_common(eval, this, symbol, known_method, &arguments, *span)
    }
}

pub(crate) struct InstrPossibleGcImpl;
pub(crate) struct InstrBeforeStmtImpl;
pub(crate) struct InstrProfileBcImpl;

pub(crate) type InstrPossibleGc = InstrNoFlow<InstrPossibleGcImpl>;
pub(crate) type InstrBeforeStmt = InstrNoFlow<InstrBeforeStmtImpl>;
pub(crate) type InstrProfileBc = InstrNoFlow<InstrProfileBcImpl>;

impl InstrNoFlowImpl for InstrPossibleGcImpl {
    type Pop<'v> = ();
    type Push<'v> = ();
    type Arg = ();

    fn run_with_args<'v>(
        eval: &mut Evaluator<'v, '_>,
        _stack: &mut BcStackPtr<'v, '_>,
        _ip: BcPtrAddr,
        (): &(),
        (): (),
    ) -> anyhow::Result<()> {
        possible_gc(eval);
        Ok(())
    }
}

impl InstrNoFlowImpl for InstrBeforeStmtImpl {
    type Pop<'v> = ();
    type Push<'v> = ();
    type Arg = FrozenFileSpan;

    fn run_with_args<'v>(
        eval: &mut Evaluator<'v, '_>,
        _stack: &mut BcStackPtr<'v, '_>,
        _: BcPtrAddr,
        span: &Self::Arg,
        (): (),
    ) -> anyhow::Result<()> {
        before_stmt(*span, eval);
        Ok(())
    }
}

impl InstrNoFlowImpl for InstrProfileBcImpl {
    type Pop<'v> = ();
    type Push<'v> = ();
    type Arg = BcOpcode;

    fn run_with_args<'v>(
        eval: &mut Evaluator<'v, '_>,
        _stack: &mut BcStackPtr<'v, '_>,
        _ip: BcPtrAddr,
        opcode: &BcOpcode,
        (): (),
    ) -> anyhow::Result<()> {
        eval.bc_profile.before_instr(*opcode);
        Ok(())
    }
}

/// Pseudo-instruction:
/// * to store bytecode metadata (i.e. spans): when bytecode is evaluated, we only have IP,
///   we don't have a pointer to bytecode object. To obtain spans by IP, we scroll
///   through the instruction until we encounter this pseudo-instruction.
/// * as a safety against memory overruns. Function block must terminate with return instruction,
///  but if return was missed, this instruction is executed and it panics.
pub(crate) struct InstrEnd;

impl BcInstr for InstrEnd {
    type Pop<'v> = ();
    type Push<'v> = ();
    /// Offset of current instruction and spans of all instructions.
    type Arg = (BcAddr, Vec<(BcAddr, BcInstrSlowArg)>);

    fn run<'v, 'b>(
        _eval: &mut Evaluator<'v, '_>,
        _stack: &mut BcStackPtr<'v, '_>,
        _ip: BcPtrAddr<'b>,
        (_this_instr_offset, _spans): &Self::Arg,


, -6], ['m_distance', 144, -5], ['m_pitch', 144, -4], ['m_yaw', 144, -3], ['m_reason', 145, -2], ['m_follow', 13, -1]]]],  //146
  ['_struct', [[['m_skipType', 127, -1]]]],  //147
  ['_int', [[0, 11]]],  //148
  ['_struct', [[['x', 148, -2], ['y', 148, -1]]]],  //149
  ['_struct', [[['m_button', 6, -5], ['m_down', 13, -4], ['m_posUI', 149, -3], ['m_posWorld', 87, -2], ['m_flags', 112, -1]]]],  //150
  ['_struct', [[['m_posUI', 149, -3], ['m_posWorld', 87, -2], ['m_flags', 112, -1]]]],  //151
  ['_struct', [[['m_achievementLink', 79, -1]]]],  //152
  ['_struct', [[['m_hotkey', 6, -2], ['m_down', 13, -1]]]],  //153
  ['_struct', [[['m_abilLink', 79, -3], ['m_abilCmdIndex', 2, -2], ['m_state', 112, -1]]]],  //154
  ['_struct', [[['m_soundtrack', 6, -1]]]],  //155
  ['_struct', [[['m_planetId', 86, -1]]]],  //156
  ['_struct', [[['m_key', 112, -2], ['m_flags', 112, -1]]]],  //157
  ['_struct', [[['m_resources', 109, -1]]]],  //158
  ['_struct', [[['m_fulfillRequestId', 86, -1]]]],  //159
  ['_struct', [[['m_cancelRequestId', 86, -1]]]],  //160
  ['_struct', [[['m_error', 86, -2], ['m_abil', 94, -1]]]],  //161
  ['_struct', [[['m_researchItemId', 86, -1]]]],  //162
  ['_struct', [[['m_mercenaryId', 86, -1]]]],  //163
  ['_struct', [[['m_battleReportId', 86, -2], ['m_difficultyLevel', 86, -1]]]],  //164
  ['_struct', [[['m_battleReportId', 86, -1]]]],  //165
  ['_int', [[0, 19]]],  //166
  ['_struct', [[['m_decrementMs', 166, -1]]]],  //167
  ['_struct', [[['m_portraitId', 86, -1]]]],  //168
  ['_struct', [[['m_functionName', 20, -1]]]],  //169
  ['_struct', [[['m_result', 86, -1]]]],  //170
  ['_struct', [[['m_gameMenuItemIndex', 86, -1]]]],  //171
  ['_int', [[-32768, 16]]],  //172
  ['_struct', [[['m_wheelSpin', 172, -2], ['m_flags', 112, -1]]]],  //173
  ['_struct', [[['m_purchaseCategoryId', 86, -1]]]],  //174
  ['_struct', [[['m_button', 79, -1]]]],  //175
  ['_struct', [[['m_cutsceneId', 86, -2], ['m_bookmarkName', 20, -1]]]],  //176
  ['_struct', [[['m_cutsceneId', 86, -1]]]],  //177
  ['_struct', [[['m_cutsceneId', 86, -3], ['m_conversationLine', 20, -2], ['m_altConversationLine', 20, -1]]]],  //178
  ['_struct', [[['m_cutsceneId', 86, -2], ['m_conversationLine', 20, -1]]]],  //179
  ['_struct', [[['m_leaveReason', 1, -1]]]],  //180
  ['_struct', [[['m_observe', 24, -7], ['m_name', 9, -6], ['m_toonHandle', 124, -5], ['m_clanTag', 41, -4], ['m_clanLogo', 42, -3], ['m_hijack', 13, -2], ['m_hijackCloneGame


self.parent.style.color = shape.getFontColor();
      self.parent.style.textAlign = shape.textAlign ? shape.textAlign : shape.hAlign;
      self.parent.style.lineHeight = shape.lineHeight;
      self.parent.style.fontStyle = shape.fontStyle;
      self.parent.style.paddingLeft = `${shape.getPadLeft()}px`;
      self.parent.style.paddingRight = `${shape.getPadRight()}px`;
      self.parent.style.paddingTop = `${shape.getPadTop()}px`;
      self.parent.style.paddingBottom = `${shape.getPadBottom()}px`;

      self.parent.style.whiteSpace = 'pre-wrap';
      self.parent.style.wordWrap = 'break-word';
    }
    // for animation
    self.animationResize(width, height);
    return {width: width, height: height};
  };
  return self;
};

const customizedDrawer = (elementName, preConstruct) => {
  return (shape, div, x, y) => {
    let self = drawer(shape, div, x, y);
    self.parent.innerHTML = ' ';
    self.offset = 2;

    // for element
    shape.element = self.element = self.createElement(elementName, `custom:${shape.id}`);
    if (preConstruct) {
      preConstruct(self.element, self);
    }
    self.element.style.position = 'absolute';
    self.parent.appendChild(self.element);
    // 用于显示线的text
    self.parent.appendChild(self.text);

    let resize = self.resize;
    self.resize = () => {
      resize.apply(self);
      self.element.style.top = `${self.offset}px`;
      self.element.style.left = `${self.offset}px`;
      self.element.style.width = `${shape.width - (2 * self.offset)}px`;
      self.element.style.height = `${shape.height - (2 * self.offset)}px`;
      self.element.style.border = '0px';
    };
    return self;
  };
};

export {drawer, simpleDrawer, customizedDrawer};

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved.
 *  This file is a part of the ModelEngine Project.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import {customizedDrawer} from './htmlDrawer.js';
import {LINEMODE} from '../../common/const.js';
import {isPointInRect} from '../../common/util.js';

/**
 * svg格式的线绘制器.
 *
 * @override
 */
const svgLineDrawer = (shape, div, x, y) => {
    let self = customizedDrawer("svg")(shape, div, x, y);
    self.offset = 0;
    self.element.style.overflow = "visible";
    self.markerBuilder = markerBuilder(self);

    self.getEditRect = () => {
        let x = shape.x + shape.textConnector.x - self.text.clientWidth / 2;
        let y = shape.y + shape.textConnector.y + self.text.clientHeight / 2;
        return {x, y, width: (self.text.clientWidth + 10), height: self.text.clientHeight};
    };

    const resize = self.resize;
    self.resize = () => {
        const lineWidth = shape.lineWidth * 2;
        resize.apply(self);
        self.parent.style.border = "";


, whereIn: list);

  Query whereNotIn(String field, List? list) => (list?.isEmpty ?? true)
      ? where(field, whereNotIn: null)
      : where(field, whereNotIn: list);

  Query whereArrayContainsAny(String field, List? list) =>
      (list?.isEmpty ?? true)
          ? where(field, arrayContainsAny: null)
          : where(field, arrayContainsAny: list);
}

class FFFirestorePage<T> {
  final List<T> data;
  final Stream<List<T>>? dataStream;
  final QueryDocumentSnapshot? nextPageMarker;

  FFFirestorePage(this.data, this.dataStream, this.nextPageMarker);
}

Future<FFFirestorePage<T>> queryCollectionPage<T>(
  Query collection,
  RecordBuilder<T> recordBuilder, {
  Query Function(Query)? queryBuilder,
  DocumentSnapshot? nextPageMarker,
  required int pageSize,
  required bool isStream,
}) async {
  final builder = queryBuilder ?? (q) => q;
  var query = builder(collection).limit(pageSize);
  if (nextPageMarker != null) {
    query = query.startAfterDocument(nextPageMarker);
  }
  Stream<QuerySnapshot>? docSnapshotStream;
  QuerySnapshot docSnapshot;
  if (isStream) {
    docSnapshotStream = query.snapshots();
    docSnapshot = await docSnapshotStream.first;
  } else {
    docSnapshot = await query.get();
  }
  final getDocs = (QuerySnapshot s) => s.docs
      .map(
        (d) => safeGet(
          () => recordBuilder(d),
          (e) => print('Error serializing doc ${d.reference.path}:\n$e'),
        ),
      )
      .where((d) => d != null)
      .map((d) => d!)
      .toList();
  final data = getDocs(docSnapshot);
  final dataStream = docSnapshotStream?.map(getDocs);
  final nextPageToken = docSnapshot.docs.isEmpty ? null : docSnapshot.docs.last;
  return FFFirestorePage(data, dataStream, nextPageToken);
}
import 'dart:io' show Platform;

import 'package:cloud_firestore/cloud_firestore.dart';

import 'serialization_util.dart';
import '../../auth/firebase_auth/auth_util.dart';
import '../cloud_functions/cloud_functions.dart';

import 'package:flutter/foundation.dart';
import 'package:stream_transform/stream_transform.dart';
import 'package:firebase_messaging/firebase_messaging.dart';

export 'push_notifications_handler.dart';
export 'serialization_util.dart';

class UserTokenInfo {
  const UserTokenInfo(this.userPath, this.fcmToken);
  final String userPath;
  final String fcmToken;
}

Stream<UserTokenInfo> getFcmTokenStream(String userPath) =>
    Stream.value(!kIsWeb && (Platform.isIOS || Platform.isAndroid))
        .where((shouldGetToken) => shouldGetToken)
        .asyncMap<String?>(
            (_) => FirebaseMessaging.instance.requestPermission().then(
                  (settings) => settings.authorizationStatus ==
                          AuthorizationStatus.authorized
                      ? FirebaseMessaging.instance.getToken()
                      : null,
                ))
        .switchMap((fcmToken) => Stream.value(fcmToken)
            .merge(FirebaseMessaging.instance.onTokenRefresh))
        .where((fcmToken) => fcmToken != null && fcmToken.isNotEmpty)
        .map((token) => UserTokenInfo(userPath, token!));

final fcmTokenUserStream = authenticatedUserStream
    .where((user) => user != null)
    .map((user) => user!.reference.path)
    .distinct()
    .switchMap(getFcmTokenStream)
    .map(
      (userToke


	if (!Patch_GetCache())
	{
		Patch_RecurseAndFind();

		// Tip : Disable this when working on oshle funcs, you save the time to delete hle cache everyttime you need to test :p
		Patch_FlushCache();
	}

	// Do this every time or just when originally patched
	/*result = */OS_Reset();
}

void Patch_PatchAll()
{
	gNumOfOSFunctions = 0;

	if (!gPatchesApplied)
	{
		Patch_ApplyPatches();
	}
#ifdef DUMPOSFUNCTIONS
	FILE *fp;
	IO::Filename path;
	Dump_GetDumpDirectory(path, "");
	IO::Path::Append(path, "n64.cfg");
	fp = fopen(path, "w");
#endif
	for (u32 i = 0; i < nPatchSymbols; i++)
	{
		if (g_PatchSymbols[i]->Found)
		{
#ifdef DUMPOSFUNCTIONS
			IO::Filename buf;
			PatchSymbol * ps = g_PatchSymbols[i];
			Dump_GetDumpDirectory(buf, "oshle");
			IO::Path::Append(buf, ps->Name);

			Dump_Disassemble(PHYS_TO_K0(ps->Location), PHYS_TO_K0(ps->Location) + ps->Signatures->NumOps * sizeof(OpCode),
				buf);

			fprintf(fp, "%s 0x%08x\n", ps->Name, PHYS_TO_K0(ps->Location));
#endif
			gNumOfOSFunctions++;
			Patch_ApplyPatch(i);
		}
	}
#ifdef DUMPOSFUNCTIONS
	fclose(fp);
#endif
}

void Patch_ApplyPatch(u32 i)
{
#ifdef DAEDALUS_ENABLE_DYNAREC
	u32 pc = g_PatchSymbols[i]->Location;

	CFragment *frag = new CFragment(gFragmentCache.GetCodeBufferManager(),
									PHYS_TO_K0(pc),
									g_PatchSymbols[i]->Signatures->NumOps,
									(void*)g_PatchSymbols[i]->Function);

	gFragmentCache.InsertFragment(frag);
#endif
}

#ifndef DAEDALUS_SILENT
// Return the location of a symbol
u32 Patch_GetSymbolAddress(const char * name)
{
	// Search new list
	for (u32 p = 0; p < nPatchSymbols; p++)
	{
		// Skip symbol if already found, or if it is a variable
		if (!g_PatchSymbols[p]->Found)
			continue;

		if (_strcmpi(g_PatchSymbols[p]->Name, name) == 0)
			return PHYS_TO_K0(g_PatchSymbols[p]->Location);

	}

	// The patch was not found
	return u32(~0);

}

// Given a location, this function returns the name of the matching
// symbol (if there is one)

const char * Patch_GetJumpAddressName(u32 jump)
{
	u32 * pdwOpBase;
	u32 * pdwPatchBase;

	if (!Memory_GetInternalReadAddress(jump, (void **)&pdwOpBase))
		return "??";

	// Search new list
	for (u32 p = 0; p < nPatchSymbols; p++)
	{
		// Skip symbol if already found, or if it is a variable
		if (!g_PatchSymbols[p]->Found)
			continue;

		pdwPatchBase = g_pu32RamBase + (g_PatchSymbols[p]->Location>>2);

		// Symbol not found, attempt to locate on this pass. This may
		// fail if all dependent symbols are not found
		if (pdwPatchBase == pdwOpBase)
		{
			return g_PatchSymbols[p]->Name;
		}


sition:transform .6s ease-in-out}@media(prefers-reduced-motion: reduce){.carousel-item{transition:none}}.carousel-item.active,.carousel-item-next,.carousel-item-prev{display:block}.carousel-item-next:not(.carousel-item-start),.active.carousel-item-end{transform:translateX(100%)}.carousel-item-prev:not(.carousel-item-end),.active.carousel-item-start{transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;transform:none}.carousel-fade .carousel-item.active,.carousel-fade .carousel-item-next.carousel-item-start,.carousel-fade .carousel-item-prev.carousel-item-end{z-index:1;opacity:1}.carousel-fade .active.carousel-item-start,.carousel-fade .active.carousel-item-end{z-index:0;opacity:0;transition:opacity 0s .6s}@media(prefers-reduced-motion: reduce){.carousel-fade .active.carousel-item-start,.carousel-fade .active.carousel-item-end{transition:none}}.carousel-control-prev,.carousel-control-next{position:absolute;top:0;bottom:0;z-index:1;display:flex;display:-webkit-flex;align-items:center;-webkit-align-items:center;justify-content:center;-webkit-justify-content:center;width:15%;padding:0;color:#fff;text-align:center;background:none;border:0;opacity:.5;transition:opacity .15s ease}@media(prefers-reduced-motion: reduce){.carousel-control-prev,.carousel-control-next{transition:none}}.carousel-control-prev:hover,.carousel-control-prev:focus,.carousel-control-next:hover,.carousel-control-next:focus{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-prev-icon,.carousel-control-next-icon{display:inline-block;width:2rem;height:2rem;background-repeat:no-repeat;background-position:50%;background-size:100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:2;display:flex;display:-webkit-flex;justify-content:center;-webkit-justify-content:center;padding:0;margin-right:15%;margin-bottom:1rem;margin-left:15%;list-style:none}.carousel-indicators [data-bs-target]{box-sizing:content-box;flex:0 1 auto;-


-color:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15)}.tox .tox-toolbar__group{align-items:center;display:flex;flex-wrap:wrap;margin:0 0;padding:0 4px 0 4px}.tox .tox-toolbar__group--pull-right{margin-left:auto}.tox .tox-toolbar--scrolling .tox-toolbar__group{flex-shrink:0;flex-wrap:nowrap}.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type){border-right:1px solid #ccc}.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type){border-left:1px solid #ccc}.tox .tox-tooltip{display:inline-block;padding:8px;position:relative}.tox .tox-tooltip__body{background-color:#222f3e;border-radius:3px;box-shadow:0 2px 4px rgba(34,47,62,.3);color:rgba(255,255,255,.75);font-size:14px;font-style:normal;font-weight:400;padding:4px 8px;text-transform:none}.tox .tox-tooltip__arrow{position:absolute}.tox .tox-tooltip--down .tox-tooltip__arrow{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #222f3e;bottom:0;left:50%;position:absolute;transform:translateX(-50%)}.tox .tox-tooltip--up .tox-tooltip__arrow{border-bottom:8px solid #222f3e;border-left:8px solid transparent;border-right:8px solid transparent;left:50%;position:absolute;top:0;transform:translateX(-50%)}.tox .tox-tooltip--right .tox-tooltip__arrow{border-bottom:8px solid transparent;border-left:8px solid #222f3e;border-top:8px solid transparent;position:absolute;right:0;top:50%;transform:translateY(-50%)}.tox .tox-tooltip--left .tox-tooltip__arrow{border-bottom:8px solid transparent;border-right:8px solid #222f3e;border-top:8px solid transparent;left:0;position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-well{border:1px solid #ccc;border-radius:3px;padding:8px;width:100%}.tox .tox-well>:first-child{margin-top:0}.tox .tox-well>:last-child{margin-bottom:0}.tox .tox-well>:only-child{margin:0}.tox .tox-custom-editor{border:1px solid #ccc;border-radius:3px;display:flex;flex:1;position:relative}.tox .tox-dialog-loading::before{background-color:rgba(0,0,0,.5);content:"";height:100%;position:absolute;width:100%;z-index:1000}.tox .tox-tab{cursor:pointer}.tox .tox-dialog__content-js{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-content .tox-collection{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-image-tools-edit-panel{height:60px}.tox .tox-image-tools__sidebar{height:60px}
.flexVertical-3EM43-{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.flexVertical-3EM43- > .flexSpacer-3j6d8P{min-height:1px}.flexHorizontal-1YWL8b{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row


shortcuts-id" data-toggle="tab">

	` (tilde)

	R

	A

	F

	Shift + F

	?, Shift + /

	Ctrl + A, ⌘ + A

	Z

	Delete, Shift + Delete, #

	T

	M

	Q

	U

	I

	/

	Enter

	Enter

	→, Tab


NamedType
  importPrefix: ImportPrefixReference
    name: T
    period: .
    element: #E0 T
  name: name
  typeArguments: TypeArgumentList
    leftBracket: <
    arguments
      NamedType
        name: int
        element: dart:core::@class::int
        type: int
    rightBracket: >
  element: <null>
  type: InvalidType
''');
  }

  test_multiplyDefined() async {
    newFile('$testPackageLibPath/a.dart', r'''
class A {}
''');

    newFile('$testPackageLibPath/b.dart', r'''
class A {}
''');

    await assertErrorsInCode(
      r'''
import 'a.dart';
import 'b.dart';

void f(A a) {}
''',
      [error(CompileTimeErrorCode.ambiguousImport, 42, 1)],
    );

    var node = findNode.namedType('A a');
    assertResolvedNodeText(node, r'''
NamedType
  name: A
  element: multiplyDefinedElement
    package:test/a.dart::@class::A
    package:test/b.dart::@class::A
  type: InvalidType
''');
  }

  test_never() async {
    await assertNoErrorsInCode(r'''
f(Never a) {}
''');

    var node = findNode.namedType('Never a');
    assertResolvedNodeText(node, r'''
NamedType
  name: Never
  element: Never
  type: Never
''');
  }

  test_typeAlias_asInstanceCreation_explicitNew_typeArguments_interfaceType_none() async {
    await assertNoErrorsInCode(r'''
class A<T> {}

typedef X<T> = A<T>;

void f() {
  new X<int>();
}
''');

    var node = findNode.namedType('X<int>()');
    assertResolvedNodeText(node, r'''
NamedType
  name: X
  typeArguments: TypeArgumentList
    leftBracket: <
    arguments
      NamedType
        name: int
        element: dart:core::@class::int
        type: int
    rightBracket: >
  element: <testLibrary>::@typeAlias::X
  type: A<int>
''');
  }

  test_typeAlias_asInstanceCreation_implicitNew_toBounds_noTypeParameters_interfaceType_none() async {
    await assertNoErrorsInCode(r'''
class A<T> {}

typedef X = A<int>;

void f() {
  X();
}
''');

    var node = findNode.namedType('X()');
    assertResolvedNodeText(node, r'''
NamedType
  name: X
  element: <testLibrary>::@typeAlias::X
  type: A<int>
''');
  }

  test_typeAlias_asInstanceCreation_implicitNew_typeArguments_interfaceType_none() async {
    await assertNoErrorsInCode(r'''
class A<T> {}

typedef X<T> = A<T>;

void f() {
  X<int>();
}
''');

    var node = findNode.namedType('X<int>()');
    assertResolvedNodeText(node, r'''
NamedType
  name: X
  typeArguments: TypeArgumentList
    leftBracket: <
    arguments
      NamedType
        name: int
        element: dart:core::@class::int
        type: int
    rightBracket: >
  element: <testLibrary>::@typeAlias::X
  type: A<int>
''');
  }

  test_typeAlias_asParameterType_interfaceType_none() async {
    await assertNoErrorsInCode(r'''
typedef X<T> = Map<int, T>;
void f(X<String> a, X<String?> b) {}
''');

    var node1 = findNode.namedType('X<String>');
    assertResolvedNodeText(node1, r'''
NamedType
  name: X
  typeArguments: TypeArgumentList
    leftBracket: <
    arguments


tch,
    formatting,
    forward,
    fullscreen,
    gift,
    hamburger,
    hamburger_sidebar,
    inbox,
    inbox_add,
    inbox_double,
    inbox_list,
    inbox_newsletter,
    info,
    inline_down,
    inline_left,
    inline_right,
    inline_up,
    jump,
    jump_alt,
    label,
    label_mini,
    link,
    link_out,
    list,
    loading_spin,
    lock,
    lock_window,
    mail,
    mail_list,
    mail_open,
    mail_plus,
    mail_subbed,
    mail_unsub,
    markdown,
    meatballs_h,
    meatballs_v,
    moon,
    mute,
    notifications,
    nuclear,
    off,
    outbox,
    paper,
    pause,
    phone,
    pin,
    play,
    print_alt,
    printer,
    queue,
    remind,
    reply,
    replyall,
    search,
    search_alt,
    send,
    send_cancelled,
    send_later,
    send_stop,
    share,
    sign,
    signature,
    skip,
    snooze_month,
    snooze_tomorrow,
    snooze_week,
    snooze_weekend,
    sort,
    sort_alt,
    sound,
    stack,
    stack_alt,
    star,
    stopwatch,
    sun,
    text_center,
    text_justify,
    text_left,
    text_right,
    todo,
    userhappy,
    userneutral,
    usersad,
    vip,
    warning,
    warning_alt,
  ];
}
///Discover all icons of this iconset at https://andronasef.github.io/iconify_flutter/collection/icomoon-free
class IcomoonFree {
  static const String i_500px =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"><path fill="currentColor" d="M3.953 10.512a5.24 5.24 0 006.996 3.141c.625-.262 1.184-.641 1.666-1.122s.859-1.041 1.122-1.666c.272-.647.412-1.331.412-2.037s-.137-1.394-.412-2.037c-.262-.625-.641-1.184-1.122-1.666s-1.041-.859-1.666-1.122a5.226 5.226 0 00-2.037-.413c-.716 0-1.431.144-2.066.413-.509.216-1.372.769-1.875 1.291l-.003.003V.984h7.241c.262-.003.262-.372.262-.491 0-.122 0-.487-.266-.491H4.377a.343.343 0 00-.344.341v6.066c0 .197.244.338.472.384.444.094.544-.047.653-.197l.016-.019c.166-.247.681-.766.688-.772a4.262 4.262 0 013.037-1.25c1.147 0 2.222.444 3.028 1.25a4.245 4.245 0 011.256 3.019 4.236 4.236 0 01-1.25 3.019 4.336 4.336 0 01-3.047 1.25 4.136 4.136 0 01-2.159-.597l.003-3.688c0-.491.213-1.028.572-1.431a2.09 2.09 0 011.588-.716c.594 0 1


arpShape_, GemmShape< 1, 1, 4 >, int8_t, layout::ColumnMajor, int8_t, layout::ColumnMajor, ElementC_, LayoutC_, arch::OpClassSimt, 2, Operator_ >::ElementA()'],['../structcutlass_1_1gemm_1_1threadblock_1_1DefaultMmaCore_3_01Shape___00_01WarpShape___00_01GemmSha46446d1e3871e31d2e728f710d78c8c1.html#ad64ceecf5cc6042ee1a3ae249e154ded',1,'cutlass::gemm::threadblock::DefaultMmaCore< Shape_, WarpShape_, GemmShape< 1, 1, 1 >, ElementA_, layout::ColumnMajor, ElementB_, layout::RowMajor, ElementC_, LayoutC_, arch::OpClassSimt, 2, Operator_, >::ElementA()'],['../structcutlass_1_1gemm_1_1threadblock_1_1DefaultMmaCore_3_01Shape___00_01WarpShape___00_01GemmSha69bef08ea63dd930f99d9788105873dd.html#a4bfead606719cb274810948e59621cb9',1,'cutlass::gemm::threadblock::DefaultMmaCore< Shape_, WarpShape_, GemmShape< 8, 8, 4 >, ElementA_, layout::ColumnMajor, ElementB_, layout::RowMajor, ElementC_, LayoutC_, arch::OpClassTensorOp, 2, Operator_ >::ElementA()'],['../structcutlass_1_1gemm_1_1threadblock_1_1DefaultMmaCore_3_01Shape___00_01WarpShape___00_01GemmSha3adf608332a8c9ee7014fced0da8a9ca.html#adca5ac03f52919316f326d18087f587b',1,'cutlass::gemm::threadblock::DefaultMmaCore< Shape_, WarpShape_, GemmShape< 8, 8, 4 >, ElementA_, layout::RowMajor, ElementB_, layout::ColumnMajor, ElementC_, LayoutC_, arch::OpClassTensorOp, 2, Operator_ >::ElementA()'],['../structcutlass_1_1gemm_1_1threadblock_1_1DefaultMmaCore_3_01Shape___00_01WarpShape___00_01GemmShab7edfba3cdf43a07e3c4d719d87565a4.html#a286bebb66fe28ce2c904bbb1d9946407',1,'cutlass::gemm::threadblock::DefaultMmaCore< Shape_, WarpShape_, GemmShape< 8, 8, 4 >, ElementA_, layout::RowMajor, ElementB_, layout::RowMajor, ElementC_, LayoutC_, arch::OpClassTensorOp, 2, Operator_ >::ElementA()'],['../structcutlass_1_1gemm_1_1threadblock_1_1DefaultMmaCore_3_01Shape___00_01WarpShape___00_01GemmShaf03a122202ad10acdc96f280106d678b.html#ae55f544c2b1f9a1b8eeae598840598f6',1,'cutlass::gemm::threadblock::DefaultMmaCore< Shape_, WarpShape_, GemmShape< 8, 8, 4 >, ElementA_, layout::ColumnMajor, ElementB_, layout::ColumnMajor, ElementC_, LayoutC_, arch::OpClassTensorOp, 2, Operator_ >::ElementA()'],['../structcutlass_1_1gemm_1_1threadblock_1_1DefaultMmaCore_3_01Shape___00_01WarpShape___00_01Instrucf60fe02fcdd80d28b7fd419133465dcc.html#a1f12837bdb011bd8a3f3e5ddfc839633


 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "video/task_queue_frame_decode_scheduler.h"

#include <algorithm>
#include <utility>

#include "api/sequence_checker.h"
#include "api/task_queue/task_queue_base.h"
#include "rtc_base/checks.h"

namespace webrtc {

TaskQueueFrameDecodeScheduler::TaskQueueFrameDecodeScheduler(
    Clock* clock,
    TaskQueueBase* const bookkeeping_queue)
    : clock_(clock), bookkeeping_queue_(bookkeeping_queue) {
  RTC_DCHECK(clock_);
  RTC_DCHECK(bookkeeping_queue_);
}

TaskQueueFrameDecodeScheduler::~TaskQueueFrameDecodeScheduler() {
  RTC_DCHECK(stopped_);
  RTC_DCHECK(!scheduled_rtp_) << "Outstanding scheduled rtp=" << *scheduled_rtp_
                              << ". Call CancelOutstanding before destruction.";
}

void TaskQueueFrameDecodeScheduler::ScheduleFrame(
    uint32_t rtp,
    FrameDecodeTiming::FrameSchedule schedule,
    FrameReleaseCallback cb) {
  RTC_DCHECK(!stopped_) << "Can not schedule frames after stopped.";
  RTC_DCHECK(!scheduled_rtp_.has_value())
      << "Can not schedule two frames for release at the same time.";
  RTC_DCHECK(cb);
  scheduled_rtp_ = rtp;

  TimeDelta wait = std::max(
      TimeDelta::Zero(), schedule.latest_decode_time - clock_->CurrentTime());
  bookkeeping_queue_->PostDelayedHighPrecisionTask(
      SafeTask(task_safety_.flag(),
               [this, rtp, schedule, cb = std::move(cb)]() mutable {
                 RTC_DCHECK_RUN_ON(bookkeeping_queue_);
                 // If the next frame rtp has changed since this task was
                 // this scheduled release should be skipped.
                 if (scheduled_rtp_ != rtp)
                   return;
                 scheduled_rtp_ = absl::nullopt;
                 std::move(cb)(rtp, schedule.render_time);
               }),
      wait);
}

void TaskQueueFrameDecodeScheduler::CancelOutstanding() {
  scheduled_rtp_ = absl::nullopt;
}

absl::optional<uint32_t>
TaskQueueFrameDecodeScheduler::ScheduledRtpTimestamp() {
  return scheduled_rtp_;
}

void TaskQueueFrameDecodeScheduler::Stop() {
  CancelOutstanding();
  stopped_ = true;
}

}  // namespace webrtc
/*
 *  Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "video/unique_timestamp_counter.h"

#include <cstdint>
#include <memory>
#include <set>

namespace webrtc {
namespace {

constexpr int kMaxHistory = 1000;

}  // namespace

UniqueTimestampCounter::UniqueTimestampCounter()
    : latest_(std::make_unique<uint32_t[]>(kMaxHistory)) {}

void UniqueTimestampCounter::Add(uint32_t value) {
  if (value == last_ || !search_index_.insert(value).second) {
    // Already known.
    return;
  }
  int index = unique_seen_ % kMaxHistory;
  if (unique_seen_ >= kMaxHistory) {
    search_index_.


与hts采用默认值，可直接从datasheet中查找。

**如果不期望应用程序去调节曝光、帧率时，可以不必要用到exp, hts, vts。**一般RAW格式的Sensor需要这三个参数。

### `link_freq`与`pixel_rate`值应该是多少

`link_freq`指的是MIPI clk的实际频率。**注意不是24M的mclk，而是MIPI dn/dp clk。**
优先通过原厂窗口查问，或查找datasheet是否有相关的参数。

一般情况下，`link_freq`实际值**不会小于**如下公式的计算结果，单位是(Hz)

```c
width * height * fps * bits_per_pixel / lanes / 2
```

如果实在不知道link_freq的实际值，可以用示波器测量。

`pixel_rate`指的是每秒传输的像素个数，在`link_freq`确定下之后，可用以下公式计算：

```c
link_freq * 2 * lanes / bits_per_pixel
```

### 怎么才算点亮Sensor

首先需要能认到Sensor id，即i2c的读写不能有异常。这时用`media-ctl -p -d /dev/media0`应该能够看到Sensor的具体信息如名称、分辨率等。
其次，上层抓图时，MIPI要能输出数据，且不报MIPI/ISP相关错误，应用层能接收到帧。

### Sensor AVL列表

RGB Sensor AVL 位于<https://redmine.rockchip.com.cn/projects/rockchip_camera_module_support_list/camera>支持列表中显示了sensor模组的详细信息。

如果是其它非RGB Sensor，如YUV Sensor，可以直接查看kernel源码的drivers/media/i2c/目录，其中驱动作者是Rockchip的，驱动都是有调试过的。

---

## MIPI/ISP异常相关

Sensor调试初期，比较经常碰到的几类问题是：

1. 没有收到帧数据，也没看到ISP/MIPI有报错
2. 看到log不停打印MIPI错误
3. ISP报PIC_SIZE_ERROR
4. 偶现MIPI错误
5. MIPI不停报错，直至死机

### MIPI需要设置哪些参数

在Sensor与ISP之间MIPI通讯需要设置4个参数，请**务必**确认4个MIPI参数的正确性。

- Sensor输出的分辨率大小
- Sensor输出的图像格式，是YUV或RGB RAW，8-bits、10-bits、或12-bits
- Sensor的MIPI实际输出`link_freq`
- Sensor使用了几个MIPI lane，这需要在dts中2个位置都配置正确

### 没有收到帧数据，也没有看到ISP/MIPI有报错

1. 确认kernel log中有没有关于MIPI的报错，比如用`dmesg | grep MIPI`看看有没有出错信息。
2. 确认kernel log中有没有出现Sensor 的i2c读写失败，如果Sensor 在配置寄存器时


 name: string;
  type: ClarityAbiType;
}

export const useTxToast = () => {
  const router = useRouter();
  const { addPositiveToast } = useToast();

  const showToast = (txid: string) =>
    addPositiveToast({
      // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
      message: `Transaction${txid ? `:  ${truncateMiddle(txid)}` : ''} submitted!`,
      description: `Transactions can take 60 or more seconds to confirm.`,
      action: {
        label: 'View transaction',
        onClick: () => {
          void router.push('/txid/[txid]', `/txid/${txid}`);
        },
      },
    });
  return showToast;
};

export const doGenerateIdentity = () => {
  const key = makeRandomPrivKey();
  const publicKey = pubKeyfromPrivKey(privateKeyToString(key));
  const address = addressFromPublicKeys(
    AddressVersion.TestnetSingleSig,
    AddressHashMode.SerializeP2PKH,
    1,
    [publicKey]
  );

  return {
    privateKey: privateKeyToString(key),
    publicKey: publicKeyToString(publicKey),
    address: addressToString(address),
  };
};

export const network = (apiServer: string): StacksNetwork => {
  const txNetwork = new StacksTestnet();
  txNetwork.coreApiUrl = withApiServer(apiServer)();
  return txNetwork;
};

export const fetchContractInterface = (apiServer: string) => async (
  contractAddress: string,
  contractName: string
) => {
  const res = await fetchFromSidecar(apiServer)(`/contract/${contractAddress}.${contractName}`);
  return res.json();
};

export function valueToClarityValue(answer: any, arg: ClarityFunctionArg): ClarityValue {
  const type = arg.type;
  const typeString = getTypeString(type);

  if (isClarityAbiPrimitive(type)) {
    if (type === 'uint128') {
      return uintCV(answer);
    } else if (type === 'int128') {
      return intCV(answer);
    } else if (type === 'bool') {
      return answer == 'True' ? trueCV() : falseCV();
    } else if (type === 'principal') {
      // TODO handle contract principals
      return standardPrincipalCV(answer);
    } else {
      throw new Error(`Contract function contains unsupported Clarity ABI type: ${typeString}`);
    }
  } else if (isClarityAbiBuffer(type)) {
    return bufferCVFromString(answer);
  } else if (isClarityAbiResponse(type)) {
    throw new Error(`Contract function contains unsupported Clarity ABI type: ${typeString}`);
  } else if (isClarityAbiOptional(type)) {
    throw new Error(`Contract function contains unsupported Clarity ABI type: ${typeString}`);
  } else if (isClarityAbiTuple(type)) {
    throw new Error(`Contract function contains unsupported Clarity ABI type: ${typeString}`);
  } else if (isClarityAbiList(type)) {
    throw new Error(`Contract function contains unsupported Clarity ABI type: ${typeString}`);
  } else {
    throw new Error(`Contract function contains unsupported Clarity ABI type: ${typeString}`);
  }
}

interface ReadOnlyResponse {
  okay: boolean;
  result: string;
}

interface ReadOnlyOptions {
  senderAddress: string;
  contractName: string;
  contractAddress: string;
  functionName: string;
  functionArgs: ClarityValue[];
  network: StacksNetwork;
}

const cvToHex = (cv: ClarityValue) => {
  const serialized = serializeCV(cv);
  return `0x${serialized.toString('hex')}`;
};

export const callReadOnlyFunction = async ({


:
                v = self.variables[-1]
            except IndexError:
                raise ValueError("cannot pop from an empty model")
        # set everything associated with `v` to 0
        for u, _ in self.iter_neighborhood(v):
            self.set_quadratic(u, v, 0)
        self.set_linear(v, 0)
        return self.data.remove_variable(v)

    def relabel_variables(self, mapping: Mapping[Variable, Variable]):
        self.data.relabel_variables(mapping)

    def relabel_variables_as_integers(self) -> Mapping[int, Variable]:
        return self.data.relabel_variables_as_integers()

    @view_method
    def set_linear(self, v: Variable, bias: Bias):
        self.add_linear(v, 0)  # make sure it exists
        self.add_linear(v, bias - self.get_linear(v))  # just add the delta

    def set_quadratic(self, u: Variable, v: Variable, bias: Bias):
        self.add_variable(u)
        self.add_variable(v)
        # just add the delta
        self.add_quadratic(u, v, 0)  # make sure it exists
        self.add_quadratic(u, v, bias - self.get_quadratic(u, v))

    def to_numpy_vectors(self, *args, **kwargs):
        raise NotImplementedError  # defer to the caller

    def update(self, *args, **kwargs):
        raise NotImplementedError  # defer to the caller

    def vartype(self, v: Optional[Variable] = None) -> Vartype:
        return self._vartype


case 'next':
						btnDisplay = lang.sNext;
						btnClass = button;
						disabled = page >= pages - 1;
						break;

					case 'last':
						btnDisplay = lang.sLast;
						btnClass = button;
						disabled = page >= pages - 1;
						break;

					default:
						btnDisplay = button + 1;
						btnClass = page === button ?
							'is-current' : '';
						break;
				}

				if ( btnDisplay ) {
					node = $('
', {
							'id': idx === 0 && typeof button === 'string' ?
								settings.sTableId +'_'+ button :
								null
						} )
						.append( $('<' + tag + '>', {
								'href': disabled ? null : '#',
								'aria-controls': settings.sTableId,
								'aria-disabled': disabled ? 'true' : null,
								'aria-label': aria[ button ],
								'aria-role': 'link',
								'aria-current': btnClass === 'is-current' ? 'page' : null,
								'data-dt-idx': button,
								'tabindex': settings.iTabIndex,
								'class': 'pagination-link ' + btnClass,
								'disabled': disabled
							} )
							.html( btnDisplay )
						)
						.appendTo( container );

					settings.oApi._fnBindAction(
						node, {action: button}, clickHandler
					);
				}
			}
		}
	};

	// IE9 throws an 'unknown error' if document.activeElement is used
	// inside an iframe or frame.
	var activeEl;

	try {
		// Because this approach is destroying and recreating the paging
		// elements, focus is lost on the select button which is bad for
		// accessibility. So we want to restore focus once the draw has
		// completed
		activeEl = $(host).find(document.activeElement).data('dt-idx');
	}
	catch (e) {}

	var nav = $('

');
	$(host).empty().append(nav);

	attach(nav.find('ul'), buttons);

	if ( activeEl !== undefined ) {
		$(host).find( '[data-dt-idx='+activeEl+']' ).trigger('focus');
	}
};

// Javascript enhancements on table initialisation
$(document).on( 'init.dt', function (e, ctx) {
	if ( e.namespace !== 'dt' ) {
		return;
	}

	var api = new $.fn.dataTable.Api( ctx );

	// Length menu drop down - needs to be wrapped with a div
	$( 'div.dataTables_length select', api.table().container() ).wrap('
');

	// Filtering input
	// $( 'div.dataTables_filter.ui.input', api.table().container() ).removeClass('input').addClass('form');
	// $( 'div.dataTables_filter input', api.table().container() ).wrap( '' );
} );

return DataTable;
}));
/*! DataTables styling wrapper for Responsive
 * © SpryMedia Ltd - datatables.net/license
 */

(function( factory ){
	if ( typeof define === 'function' && define.amd ) {
		// AMD
		define( ['jquery', 'datatables.net-dt', 'datatables.net-responsive'], function ( $ ) {
			return factory( $, window, document );
		} );
	}
	else if ( typeof exports === 'object' ) {
		// CommonJS
		var jq = require('jquery');
		var cjsRequires = function (root, $) {
			if ( ! $.fn.dataTable ) {
				require('datatables.net-dt')(root, $);
			}

			if ( ! $.fn.dataTable.Responsive ) {
				require('datatables.net-responsive'


file")) {
                signingConfig = signingConfigs.getByName("release")
            }
        }
    }
    //https://android.izzysoft.de/articles/named/iod-scan-apkchecks#blobs
    dependenciesInfo {
        // Disables dependency metadata when building APKs.
        includeInApk = false
        // Disables dependency metadata when building Android App Bundles.
        includeInBundle = false
    }
}

//https://developer.android.com/develop/ui/compose/testing#setup
dependencies {
    androidTestImplementation(libs.androidx.uitest.junit4)
    debugImplementation(libs.androidx.uitest.testManifest)
}

compose.desktop {
    application {
        mainClass = "MainKt"

        buildTypes.release.proguard {
            isEnabled = false
        }

        nativeDistributions {
            targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
            packageName = "WikWok"
            packageVersion = "1.0.3"

            linux {
                iconFile.set(project.file("desktopAppIcons/LinuxIcon.png"))
            }
            windows {
                iconFile.set(project.file("desktopAppIcons/WindowsIcon.ico"))
            }
            macOS {
                iconFile.set(project.file("desktopAppIcons/MacosIcon.icns"))
                bundleID = "com.github.terrakok.wikwok.desktopApp"
            }
        }
    }
}

tasks.withType<ComposeHotRun>().configureEach {
    mainClass.set("MainKt")
}
package com.gj.arcoredraw

import android.annotation.SuppressLint
import android.content.Intent
import android.icu.text.DecimalFormat
import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import android.view.WindowManager
import android.widget.TextView
import com.blankj.utilcode.util.ActivityUtils
import com.blankj.utilcode.util.LogUtils
import com.blankj.utilcode.util.ToastUtils
import com.google.ar.core.Anchor
import com.google.ar.sceneform.AnchorNode
import com.google.ar.sceneform.Node
import com.google.ar.sceneform.math.MathHelper
import com.google.ar.sceneform.math.Quaternion
import com.google.ar.sceneform.math.Vector3
import com.google.ar.sceneform.rendering.MaterialFactory
import com.google.ar.sceneform.rendering.ShapeFactory
import com.google.ar.sceneform.rendering.ViewRenderable
import com.google.gson.Gson
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN)// 设置全屏
        setContentView(R.layout.activity_main)
        initView()
    }

    private fun initView() {
        UI_Last.setOnClickListener {
            //上一步
            when (dataArray.size) {
                0 -> {
                    ToastUtils.showLong("没有操作记录")
                }
                1 -> {
                    dataArray.clear()
                    lineNodeArray.clear()
                    sphereNodeArray.clear()
                    startNodeArray.clear()
                    endNodeArray.clear()
                    (UI_ArSceneView as MyArFragment).arSceneView.scene.removeChild(startNode)
                }
                else -> {
                    dataArray.removeAt(dataArray.size - 1)
                    val index = startNodeArray.size - 1
                    startNodeArray[index].removeChild(lineNodeArray.removeAt(index))
                    endNodeArray[index].removeChild(sphereNodeArray.removeAt(index + 1))
                    (UI_ArSceneView as MyArFragment).arSceneView.scene.removeChild(startNodeArray.remov


t.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}o=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(o=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}hh.Composite=class{constructor(t,e,i){const n=i||hh.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},hh.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},hh.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},hh.prototype.GetterByBindingType=[hh.prototype._getValue_direct,hh.prototype._getValue_array,hh.prototype._getValue_arrayElement,hh.prototype._getValue_toArray],hh.prototype.SetterByBindingTypeAndVersioning=[[hh.prototype._setValue_direct,hh.prototype._setValue_direct_setNeedsUpdate,hh.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[hh.prototype._setValue_array,hh.prototype._setValue_array_setNeedsUpdate,hh.prototype._setValue_array_setMatrixWorldNeedsUpdate],[hh.prototype._setValue_arrayElement,hh.prototype._setValue_arrayElement_setNeedsUpdate,hh.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[hh.prototype._setValue_fromArray,hh.prototype._setValue_fromArray_setNeedsUpdate,hh.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class uh{constructor(t,e,i=null,n=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const r=e.tracks,s=r.length,a=new Array(s),o={endingStart:rt,endingEnd:rt};for(let t=0;t!==s;