{"sources":{"src/AnchorageTokenV2.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\nimport {IAccessControl} from \"@openzeppelin/contracts/access/IAccessControl.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {IERC20Permit} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\";\nimport {IERC5267} from \"@openzeppelin/contracts/interfaces/IERC5267.sol\";\nimport {IERC5313} from \"@openzeppelin/contracts/interfaces/IERC5313.sol\";\nimport {IERC3009, IERC3009Cancel} from \"@openzeppelin/contracts/interfaces/draft-IERC3009.sol\";\nimport {\n    ERC20PermitUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol\";\nimport {\n    ERC20PausableUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol\";\nimport {Initializable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {\n    AccessControlEnumerableUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/access/extensions/AccessControlEnumerableUpgradeable.sol\";\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {ERC20Upgradeable} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport {\n    AccessControlDefaultAdminRulesUpgradeable\n} from \"@openzeppelin/contracts-upgradeable/access/extensions/AccessControlDefaultAdminRulesUpgradeable.sol\";\nimport {AccessControlUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\";\nimport {\n    ERC3009Upgradeable\n} from \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC3009Upgradeable.sol\";\nimport {SignatureChecker} from \"@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol\";\nimport {ECDSA} from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport {EIP7702Utils} from \"@openzeppelin/contracts/account/utils/EIP7702Utils.sol\";\n\n/**\n * @title AnchorageTokenV2\n * @dev UUPS-upgradeable ERC20 token for regulated stablecoin issuance.\n * Implements access control, minting/burning, pausing, account blocking, permit support,\n * ERC-3009 transfer authorizations, per-minter mint and burn limits with optional\n * fixed-window rate limits, and a per-transaction maximum on mint and burn amounts.\n * @custom:security-contact security@anchorage.com\n */\ncontract AnchorageTokenV2 is\n    Initializable,\n    UUPSUpgradeable,\n    ERC20Upgradeable,\n    ERC20PermitUpgradeable,\n    ERC20PausableUpgradeable,\n    ERC3009Upgradeable,\n    AccessControlEnumerableUpgradeable,\n    AccessControlDefaultAdminRulesUpgradeable\n{\n    /**\n     * @dev Custom error thrown when attempting to interact with a blocked account\n     */\n    error AccountBlocked();\n\n    /**\n     * @dev Custom error thrown when attempting to block the zero address\n     */\n    error CannotBlockZeroAddress();\n\n    /**\n     * @dev Custom error thrown when a mint or burn exceeds the caller's available limit\n     * @param requested The amount the caller attempted to mint or burn\n     * @param available The limit available to the caller\n     */\n    error LimitExceeded(uint256 requested, uint256 available);\n\n    /**\n     * @dev Custom error thrown when a limit increment targets an account without MINTER_BURNER_ROLE\n     */\n    error TargetNotMinterBurner();\n\n    /**\n     * @dev Custom error thrown when a nonzero window length is outside [1 minutes, 30 days]\n     */\n    error InvalidWindow();\n\n    /**\n     * @dev Custom error thrown when a window change targets a limit whose cap is not zero\n     */\n    error LimitNotZero();\n\n    /**\n     * @dev Custom error thrown when a mint or burn exceeds the per-transaction maximum\n     * @param requested The amount the caller attempted to mint or burn\n     * @param max The per-transaction maximum, in base units\n     */\n    error MaxMintBurnExceeded(uint256 requested, uint256 max);\n\n    /**\n     * @dev Role identifier for accounts that can mint and burn tokens\n     */\n    bytes32 public constant MINTER_BURNER_ROLE = keccak256(\"MINTER_BURNER_ROLE\");\n\n    /**\n     * @dev Role identifier for accounts that can block and unblock other accounts\n     */\n    bytes32 public constant BLOCKLISTER_ROLE = keccak256(\"BLOCKLISTER_ROLE\");\n\n    /**\n     * @dev Role identifier for accounts that can upgrade the contract\n     */\n    bytes32 public constant UPGRADER_ROLE = keccak256(\"UPGRADER_ROLE\");\n\n    /**\n     * @dev Role identifier for accounts that can pause and unpause the contract\n     */\n    bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n    /**\n     * @dev Role identifier for accounts that can manage mint and burn limits\n     */\n    bytes32 public constant MINTER_MANAGER_ROLE = keccak256(\"MINTER_MANAGER_ROLE\");\n\n    /**\n     * @dev Mapping of blocked accounts. True if account is blocked, false otherwise\n     */\n    mapping(address account => bool isBlocked) private _blockedAccounts;\n\n    /**\n     * @dev Token decimals, set at initialization. {ERC20Upgradeable} has no storage for decimals\n     * (it is a constant 18), so a configurable value needs its own variable\n     */\n    uint8 private _decimals;\n\n    /**\n     * @dev Limit state for one account. `window` selects the mode:\n     * - `window == 0` (cumulative mode): `cap` is the remaining amount the account may use;\n     *   usage decrements it and increments replenish it. `used` and `windowId` stay 0.\n     * - `window != 0` (window mode): `cap` is a per-window limit that usage never changes;\n     *   `used` counts usage in window `windowId` (`block.timestamp / window` at the last\n     *   use). A stored `windowId` below the current one means that window has ended and\n     *   its counter no longer applies. A single mint or burn larger than `cap` cannot succeed\n     *   in any window.\n     * In both modes a `cap` of 0 halts the account, so a fresh account is halted by default.\n     * Increments and decrements change only `cap`; the window setters reset `used` and `windowId`\n     * to 0. `used` may exceed `cap` after a decrement lowered the cap below the counter; the\n     * account then admits nothing until the window ends or an increment raises the cap above it\n     */\n    struct Limit {\n        uint256 cap;\n        uint256 used;\n        uint256 windowId;\n        uint256 window;\n    }\n\n    /**\n     * @dev Per-minter mint limit; see {Limit}\n     */\n    mapping(address minter => Limit limit) private _mintLimit;\n\n    /**\n     * @dev Per-burner burn limit, independent of the mint limit; see {Limit}\n     */\n    mapping(address burner => Limit limit) private _burnLimit;\n\n    /**\n     * @dev Largest amount a single {mint} or {burn} may move, in base units; the same value\n     * applies to every minter. 0 admits nothing, so minting and burning are halted until the\n     * manager sets it\n     */\n    uint256 private _maxMintBurn;\n\n    /**\n     * @dev Emitted when accounts are blocked\n     */\n    event AccountsBlocked(address[] accounts);\n\n    /**\n     * @dev Emitted when accounts are unblocked\n     */\n    event AccountsUnblocked(address[] accounts);\n\n    /**\n     * @dev Emitted when a minter's mint limit cap is increased\n     */\n    event MintLimitIncremented(address indexed minter, uint256 amount, uint256 newCap);\n\n    /**\n     * @dev Emitted when a minter's mint limit cap is decreased; `applied` is less than\n     * `requested` when the decrement clamped at zero\n     */\n    event MintLimitDecremented(address indexed minter, uint256 requested, uint256 applied, uint256 newCap);\n\n    /**\n     * @dev Emitted when a burner's burn limit cap is increased\n     */\n    event BurnLimitIncremented(address indexed burner, uint256 amount, uint256 newCap);\n\n    /**\n     * @dev Emitted when a burner's burn limit cap is decreased; `applied` is less than\n     * `requested` when the decrement clamped at zero\n     */\n    event BurnLimitDecremented(address indexed burner, uint256 requested, uint256 applied, uint256 newCap);\n\n    /**\n     * @dev Emitted when a minter's mint window is set, which also resets its usage counters\n     */\n    event MintWindowSet(address indexed minter, uint256 oldWindow, uint256 newWindow);\n\n    /**\n     * @dev Emitted when a burner's burn window is set, which also resets its usage counters\n     */\n    event BurnWindowSet(address indexed burner, uint256 oldWindow, uint256 newWindow);\n\n    /**\n     * @dev Emitted on every successful mint; `available` is the mint limit left afterwards. In\n     * cumulative mode it is also the new cap; in window mode the cap is unchanged and `available`\n     * is the cap less the usage counted in the current window\n     */\n    event MintLimitUsed(address indexed minter, uint256 amount, uint256 available);\n\n    /**\n     * @dev Emitted on every successful burn; `available` is the burn limit left afterwards. In\n     * cumulative mode it is also the new cap; in window mode the cap is unchanged and `available`\n     * is the cap less the usage counted in the current window\n     */\n    event BurnLimitUsed(address indexed burner, uint256 amount, uint256 available);\n\n    /**\n     * @dev Emitted when the per-transaction maximum is set, with the previous and the new value\n     */\n    event MaxMintBurnSet(uint256 oldMax, uint256 newMax);\n\n    /**\n     * @dev Constructor that disables initializers to prevent implementation contract initialization\n     * @custom:oz-upgrades-unsafe-allow constructor\n     */\n    constructor() {\n        _disableInitializers();\n    }\n\n    /**\n     * @dev Initializes the contract with name, symbol, decimals, and admin address\n     * @param name The name of the token\n     * @param symbol The symbol of the token\n     * @param decimals_ The number of decimals of the token\n     * @param admin The address that will receive the default admin role; operational roles are\n     * granted by the admin after deployment\n     * @notice This function can only be called once during proxy deployment\n     */\n    function initialize(string memory name, string memory symbol, uint8 decimals_, address admin) public initializer {\n        __ERC20_init(name, symbol);\n        __ERC20Permit_init(name);\n        __ERC20Pausable_init();\n        __ERC3009_init();\n        __AccessControlEnumerable_init();\n        __AccessControlDefaultAdminRules_init(7 days, admin);\n        _decimals = decimals_;\n    }\n\n    /**\n     * @dev Mints new tokens to the specified address\n     * @param to The address that will receive the minted tokens\n     * @param amount The amount of tokens to mint\n     * @notice Only accounts with MINTER_BURNER_ROLE can call this function\n     * @notice Cannot mint to blocked accounts\n     * @notice Cannot mint when contract is paused\n     * @notice Cannot exceed the per-transaction maximum set by {setMaxMintBurn}\n     * @notice Requires the caller's mint limit to cover `amount`\n     */\n    function mint(address to, uint256 amount) public onlyRole(MINTER_BURNER_ROLE) whenNotPaused {\n        if (amount > _maxMintBurn) revert MaxMintBurnExceeded(amount, _maxMintBurn);\n        uint256 available = _useLimit(_mintLimit, amount);\n        emit MintLimitUsed(_msgSender(), amount, available);\n        _mint(to, amount);\n    }\n\n    /**\n     * @dev Burns tokens from the specified address\n     * @param from The address whose tokens will be burned\n     * @param amount The amount of tokens to burn\n     * @notice Only accounts with MINTER_BURNER_ROLE can call this function\n     * @notice Can burn from blocked accounts\n     * @notice Cannot burn when contract is paused\n     * @notice Cannot exceed the per-transaction maximum set by {setMaxMintBurn}\n     * @notice Requires the caller's burn limit to cover `amount`; burning does not refund the\n     * mint limit\n     */\n    function burn(address from, uint256 amount) public onlyRole(MINTER_BURNER_ROLE) whenNotPaused {\n        if (amount > _maxMintBurn) revert MaxMintBurnExceeded(amount, _maxMintBurn);\n        uint256 available = _useLimit(_burnLimit, amount);\n        emit BurnLimitUsed(_msgSender(), amount, available);\n        _burn(from, amount);\n    }\n\n    /**\n     * @dev Increases a minter's mint limit cap: the remaining limit in cumulative mode, the\n     * per-window limit in window mode\n     * @param minter The minter whose cap is increased; must hold MINTER_BURNER_ROLE\n     * @param amount The amount to add to the cap\n     * @notice Only accounts with MINTER_MANAGER_ROLE can call this function\n     */\n    function incrementMintLimit(address minter, uint256 amount) public onlyRole(MINTER_MANAGER_ROLE) {\n        uint256 newCap = _incrementLimit(_mintLimit, minter, amount);\n        emit MintLimitIncremented(minter, amount, newCap);\n    }\n\n    /**\n     * @dev Decreases a minter's mint limit cap, clamping at zero without reverting\n     * @param minter The minter whose cap is decreased; need not hold MINTER_BURNER_ROLE\n     * @param amount The amount to remove from the cap\n     * @notice Only accounts with MINTER_MANAGER_ROLE can call this function\n     */\n    function decrementMintLimit(address minter, uint256 amount) public onlyRole(MINTER_MANAGER_ROLE) {\n        (uint256 applied, uint256 newCap) = _decrementLimit(_mintLimit, minter, amount);\n        emit MintLimitDecremented(minter, amount, applied, newCap);\n    }\n\n    /**\n     * @dev Increases a burner's burn limit cap: the remaining limit in cumulative mode, the\n     * per-window limit in window mode\n     * @param burner The burner whose cap is increased; must hold MINTER_BURNER_ROLE\n     * @param amount The amount to add to the cap\n     * @notice Only accounts with MINTER_MANAGER_ROLE can call this function\n     */\n    function incrementBurnLimit(address burner, uint256 amount) public onlyRole(MINTER_MANAGER_ROLE) {\n        uint256 newCap = _incrementLimit(_burnLimit, burner, amount);\n        emit BurnLimitIncremented(burner, amount, newCap);\n    }\n\n    /**\n     * @dev Decreases a burner's burn limit cap, clamping at zero without reverting\n     * @param burner The burner whose cap is decreased; need not hold MINTER_BURNER_ROLE\n     * @param amount The amount to remove from the cap\n     * @notice Only accounts with MINTER_MANAGER_ROLE can call this function\n     */\n    function decrementBurnLimit(address burner, uint256 amount) public onlyRole(MINTER_MANAGER_ROLE) {\n        (uint256 applied, uint256 newCap) = _decrementLimit(_burnLimit, burner, amount);\n        emit BurnLimitDecremented(burner, amount, applied, newCap);\n    }\n\n    /**\n     * @dev Sets a minter's mint window and resets the usage counters\n     * @param minter The minter whose window is set\n     * @param window The window length in seconds: 0 for cumulative mode, within\n     * [1 minutes, 30 days] for window mode\n     * @notice Only accounts with MINTER_MANAGER_ROLE can call this function\n     * @notice Requires the minter's cap to be 0\n     */\n    function setMintWindow(address minter, uint256 window) public onlyRole(MINTER_MANAGER_ROLE) {\n        uint256 oldWindow = _setWindow(_mintLimit, minter, window);\n        emit MintWindowSet(minter, oldWindow, window);\n    }\n\n    /**\n     * @dev Sets a burner's burn window and resets the usage counters\n     * @param burner The burner whose window is set\n     * @param window The window length in seconds: 0 for cumulative mode, within\n     * [1 minutes, 30 days] for window mode\n     * @notice Only accounts with MINTER_MANAGER_ROLE can call this function\n     * @notice Requires the burner's cap to be 0\n     */\n    function setBurnWindow(address burner, uint256 window) public onlyRole(MINTER_MANAGER_ROLE) {\n        uint256 oldWindow = _setWindow(_burnLimit, burner, window);\n        emit BurnWindowSet(burner, oldWindow, window);\n    }\n\n    /**\n     * @dev Sets the largest amount a single {mint} or {burn} may move, for every minter\n     * @param max The new per-transaction maximum, in base units; 0 halts minting and burning\n     * @notice Only accounts with MINTER_MANAGER_ROLE can call this function\n     */\n    function setMaxMintBurn(uint256 max) public onlyRole(MINTER_MANAGER_ROLE) {\n        uint256 oldMax = _maxMintBurn;\n        _maxMintBurn = max;\n        emit MaxMintBurnSet(oldMax, max);\n    }\n\n    /**\n     * @dev Blocks multiple accounts from transferring or receiving tokens\n     * @param accounts Array of addresses to block\n     * @notice Only accounts with BLOCKLISTER_ROLE can call this function\n     * @notice Reverts on the zero address, leaving the whole batch unapplied: ERC-20 minting uses\n     * it as the synthetic sender, so blocking it would revert every mint\n     */\n    function blockAccounts(address[] calldata accounts) public onlyRole(BLOCKLISTER_ROLE) {\n        uint256 length = accounts.length;\n        for (uint256 i; i < length;) {\n            require(accounts[i] != address(0), CannotBlockZeroAddress());\n            _blockedAccounts[accounts[i]] = true;\n            unchecked {\n                ++i;\n            }\n        }\n        emit AccountsBlocked(accounts);\n    }\n\n    /**\n     * @dev Unblocks multiple accounts, allowing them to transfer and receive tokens\n     * @param accounts Array of addresses to unblock\n     * @notice Only accounts with BLOCKLISTER_ROLE can call this function\n     */\n    function unblockAccounts(address[] calldata accounts) public onlyRole(BLOCKLISTER_ROLE) {\n        uint256 length = accounts.length;\n        for (uint256 i; i < length;) {\n            _blockedAccounts[accounts[i]] = false;\n            unchecked {\n                ++i;\n            }\n        }\n        emit AccountsUnblocked(accounts);\n    }\n\n    /**\n     * @dev Pauses all token transfers, minting, and burning\n     * @notice Only accounts with PAUSER_ROLE can call this function\n     */\n    function pause() public onlyRole(PAUSER_ROLE) {\n        _pause();\n    }\n\n    /**\n     * @dev Unpauses all token transfers, minting, and burning\n     * @notice Only accounts with PAUSER_ROLE can call this function\n     */\n    function unpause() public onlyRole(PAUSER_ROLE) {\n        _unpause();\n    }\n\n    /**\n     * @dev Checks if an account is blocked\n     * @param account The address to check\n     * @return bool True if the account is blocked, false otherwise\n     */\n    function isBlocked(address account) public view returns (bool) {\n        return _blockedAccounts[account];\n    }\n\n    /**\n     * @dev Returns the decimals of the token\n     * @return uint8 The decimals set at initialization\n     */\n    function decimals() public view virtual override returns (uint8) {\n        return _decimals;\n    }\n\n    /**\n     * @dev Returns a minter's mint limit state\n     * @param minter The minter to query\n     * @return cap The limit cap: the remaining limit in cumulative mode, the per-window limit\n     * in window mode\n     * @return usedInCurrentWindow The usage counted in the current window, 0 in\n     * cumulative mode; may exceed `cap` after a decrement\n     * @return windowEnd The timestamp at which the current window ends and the next one starts,\n     * 0 in cumulative mode\n     * @return window The window length in seconds, 0 in cumulative mode\n     * @notice The remaining limit is `cap` in cumulative mode, otherwise `cap` less\n     * `usedInCurrentWindow`, floored at 0\n     */\n    function mintLimit(address minter)\n        public\n        view\n        returns (uint256 cap, uint256 usedInCurrentWindow, uint256 windowEnd, uint256 window)\n    {\n        return _limitView(_mintLimit[minter]);\n    }\n\n    /**\n     * @dev Returns a burner's burn limit state\n     * @param burner The burner to query\n     * @return cap The limit cap: the remaining limit in cumulative mode, the per-window limit\n     * in window mode\n     * @return usedInCurrentWindow The usage counted in the current window, 0 in\n     * cumulative mode; may exceed `cap` after a decrement\n     * @return windowEnd The timestamp at which the current window ends and the next one starts,\n     * 0 in cumulative mode\n     * @return window The window length in seconds, 0 in cumulative mode\n     * @notice The remaining limit is `cap` in cumulative mode, otherwise `cap` less\n     * `usedInCurrentWindow`, floored at 0\n     */\n    function burnLimit(address burner)\n        public\n        view\n        returns (uint256 cap, uint256 usedInCurrentWindow, uint256 windowEnd, uint256 window)\n    {\n        return _limitView(_burnLimit[burner]);\n    }\n\n    /**\n     * @dev Returns the largest amount a single {mint} or {burn} may move\n     * @return uint256 The per-transaction maximum, in base units; 0 halts minting and burning\n     */\n    function maxMintBurn() public view returns (uint256) {\n        return _maxMintBurn;\n    }\n\n    /**\n     * @dev Returns the EIP-712 signing domain version of the token\n     * @return string The domain version, read from the stored EIP-712 domain\n     * @notice x402 integrator tooling reads the signing domain from this getter; returning\n     * {EIP712Upgradeable-_EIP712Version} keeps it equal by construction to the version reported\n     * by {eip712Domain}, which {initialize} sets to \"1\" through {ERC20PermitUpgradeable}\n     */\n    function version() public view returns (string memory) {\n        return _EIP712Version();\n    }\n\n    /**\n     * @dev Same as {ERC3009Upgradeable-transferWithAuthorization} but with a bytes signature\n     * instead of separate (v,r,s) parameters\n     * @param from The address authorizing the transfer\n     * @param to The address receiving the tokens\n     * @param value The amount of tokens to transfer\n     * @param validAfter The time after which the authorization is valid: a unix timestamp, or a\n     * block number when both bounds carry the block-range flag (see {ERC3009Upgradeable})\n     * @param validBefore The time before which the authorization is valid, on the same clock\n     * @param nonce Unique random nonce chosen by the authorizer\n     * @param signature Signature over the EIP-712 authorization, as packed r,s,v bytes or an ERC-1271 contract signature\n     * @notice Accepts EOA signatures as packed r,s,v bytes and ERC-1271 contract signatures,\n     * matching the bytes signature ABI used by x402 facilitators and agent payment flows.\n     * EOA signatures are also accepted when `from` carries an EIP-7702 delegation designator, so the\n     * delegating EOA still validates with its own private key; any other code is verified through\n     * ERC-1271 only\n     */\n    function transferWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        bytes memory signature\n    ) public virtual {\n        bytes32 hash = _hashTypedDataV4(\n            keccak256(abi.encode(TRANSFER_WITH_AUTHORIZATION_TYPEHASH, from, to, value, validAfter, validBefore, nonce))\n        );\n        require(_isValidAuthorizationSignature(from, hash, signature), ERC3009InvalidSignature());\n        _transferWithAuthorization(from, to, value, validAfter, validBefore, nonce);\n    }\n\n    /**\n     * @dev Overrides {ERC3009Upgradeable-transferWithAuthorization} to forward to the bytes\n     * signature overload, so both entry points validate identically via\n     * {_isValidAuthorizationSignature}\n     * @param from The address authorizing the transfer\n     * @param to The address receiving the tokens\n     * @param value The amount of tokens to transfer\n     * @param validAfter The time after which the authorization is valid: a unix timestamp, or a\n     * block number when both bounds carry the block-range flag (see {ERC3009Upgradeable})\n     * @param validBefore The time before which the authorization is valid, on the same clock\n     * @param nonce Unique random nonce chosen by the authorizer\n     * @param v The recovery byte of the signature\n     * @param r The first 32 bytes of the signature\n     * @param s The second 32 bytes of the signature\n     * @notice Keeps smart contract wallets that produce 65-byte ERC-1271 signatures settleable\n     * through the r,s,v entry point that x402 facilitators use for 65-byte signatures\n     */\n    function transferWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public virtual override {\n        transferWithAuthorization(from, to, value, validAfter, validBefore, nonce, abi.encodePacked(r, s, v));\n    }\n\n    /**\n     * @dev Same as {ERC3009Upgradeable-receiveWithAuthorization} but with a bytes signature\n     * instead of separate (v,r,s) parameters\n     * @param from The address authorizing the transfer\n     * @param to The address receiving the tokens, which must be the caller\n     * @param value The amount of tokens to transfer\n     * @param validAfter The time after which the authorization is valid: a unix timestamp, or a\n     * block number when both bounds carry the block-range flag (see {ERC3009Upgradeable})\n     * @param validBefore The time before which the authorization is valid, on the same clock\n     * @param nonce Unique random nonce chosen by the authorizer\n     * @param signature Signature over the EIP-712 authorization, as packed r,s,v bytes or an ERC-1271 contract signature\n     * @notice Accepts EOA signatures as packed r,s,v bytes and ERC-1271 contract signatures,\n     * matching the bytes signature ABI used by x402 facilitators and agent payment flows.\n     * EOA signatures are also accepted when `from` carries an EIP-7702 delegation designator, so the\n     * delegating EOA still validates with its own private key; any other code is verified through\n     * ERC-1271 only\n     */\n    function receiveWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        bytes memory signature\n    ) public virtual {\n        bytes32 hash = _hashTypedDataV4(\n            keccak256(abi.encode(RECEIVE_WITH_AUTHORIZATION_TYPEHASH, from, to, value, validAfter, validBefore, nonce))\n        );\n        require(_isValidAuthorizationSignature(from, hash, signature), ERC3009InvalidSignature());\n        require(to == _msgSender(), ERC20InvalidReceiver(to));\n        _transferWithAuthorization(from, to, value, validAfter, validBefore, nonce);\n    }\n\n    /**\n     * @dev Overrides {ERC3009Upgradeable-receiveWithAuthorization} to forward to the bytes\n     * signature overload, so both entry points validate identically via\n     * {_isValidAuthorizationSignature}\n     * @param from The address authorizing the transfer\n     * @param to The address receiving the tokens, which must be the caller\n     * @param value The amount of tokens to transfer\n     * @param validAfter The time after which the authorization is valid: a unix timestamp, or a\n     * block number when both bounds carry the block-range flag (see {ERC3009Upgradeable})\n     * @param validBefore The time before which the authorization is valid, on the same clock\n     * @param nonce Unique random nonce chosen by the authorizer\n     * @param v The recovery byte of the signature\n     * @param r The first 32 bytes of the signature\n     * @param s The second 32 bytes of the signature\n     * @notice Keeps smart contract wallets that produce 65-byte ERC-1271 signatures settleable\n     * through the r,s,v entry point that x402 facilitators use for 65-byte signatures\n     */\n    function receiveWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public virtual override {\n        receiveWithAuthorization(from, to, value, validAfter, validBefore, nonce, abi.encodePacked(r, s, v));\n    }\n\n    /**\n     * @dev Same as {ERC3009Upgradeable-cancelAuthorization} but with a bytes signature\n     * instead of separate (v,r,s) parameters\n     * @param authorizer The address that signed the authorization being canceled\n     * @param nonce Nonce of the authorization to cancel\n     * @param signature Signature over the EIP-712 cancellation, as packed r,s,v bytes or an ERC-1271 contract signature\n     * @notice Accepts EOA signatures as packed r,s,v bytes and ERC-1271 contract signatures,\n     * matching the bytes signature ABI used by x402 facilitators and agent payment flows.\n     * EOA signatures are also accepted when `authorizer` carries an EIP-7702 delegation designator, so\n     * the delegating EOA still validates with its own private key; any other code is verified through\n     * ERC-1271 only\n     */\n    function cancelAuthorization(address authorizer, bytes32 nonce, bytes memory signature) public virtual {\n        bytes32 hash = _hashTypedDataV4(keccak256(abi.encode(CANCEL_AUTHORIZATION_TYPEHASH, authorizer, nonce)));\n        require(_isValidAuthorizationSignature(authorizer, hash, signature), ERC3009InvalidSignature());\n        _cancelAuthorization(authorizer, nonce);\n    }\n\n    /**\n     * @dev Overrides {ERC3009Upgradeable-cancelAuthorization} to forward to the bytes signature\n     * overload, so both entry points validate identically via {_isValidAuthorizationSignature}\n     * @param authorizer The address that signed the authorization being canceled\n     * @param nonce Nonce of the authorization to cancel\n     * @param v The recovery byte of the signature\n     * @param r The first 32 bytes of the signature\n     * @param s The second 32 bytes of the signature\n     * @notice Keeps smart contract wallets that produce 65-byte ERC-1271 signatures able to cancel\n     * through the r,s,v entry point\n     */\n    function cancelAuthorization(address authorizer, bytes32 nonce, uint8 v, bytes32 r, bytes32 s)\n        public\n        virtual\n        override\n    {\n        cancelAuthorization(authorizer, nonce, abi.encodePacked(r, s, v));\n    }\n\n    /**\n     * @dev Cancels an authorization nonce for the caller directly, without a signature\n     * @param nonce Nonce of the authorization to cancel\n     * @notice Extension beyond ERC-3009: lets an account retire its own unused nonces even when\n     * it can no longer produce a signature the token validates, for example an EIP-7702 delegated\n     * account operated through its delegate after the root key becomes unavailable, when the\n     * delegate does not answer {IERC1271-isValidSignature}. Any account that can still originate\n     * a call therefore always retains a revocation path\n     * @notice Like the signed cancellation entry points, this works while the contract is paused\n     * and for blocked accounts: cancellation moves no tokens and only retires the caller's own\n     * nonce, and a blocked account's authorizations cannot settle while it stays blocked\n     */\n    function cancelAuthorization(bytes32 nonce) public virtual {\n        _cancelAuthorization(_msgSender(), nonce);\n    }\n\n    /**\n     * @dev Validates an ERC-3009 authorization signature for the given signer\n     * @param signer The address expected to have authorized the operation\n     * @param hash The EIP-712 digest that was signed\n     * @param signature Signature over the digest, as packed r,s,v bytes or an ERC-1271 contract signature\n     * @return bool True if the signature is valid for the signer\n     * @notice Validates an authorization signature for `signer`, accepting ECDSA signatures and\n     * ERC-1271 contract signatures. ECDSA recovery is attempted only for a signer without code or\n     * with an EIP-7702 delegation designator (exactly 23 bytes: the `0xef0100` prefix followed by the\n     * 20-byte delegate address): a delegated account carries code, and its authority key must remain\n     * a valid signer regardless of what the installed delegate answers over {IERC1271-isValidSignature}.\n     * Any other code is verified exclusively through {SignatureChecker-isValidERC1271SignatureNow}, so\n     * an account whose code no longer stands behind its key is never honored by that key. Recovery only\n     * validates when the signature recovers to `signer` itself, which no contract deployed via CREATE\n     * or CREATE2 can produce\n     */\n    function _isValidAuthorizationSignature(address signer, bytes32 hash, bytes memory signature)\n        internal\n        view\n        returns (bool)\n    {\n        uint256 codeLength = signer.code.length;\n        if (codeLength == 0 || (codeLength == 23 && EIP7702Utils.fetchDelegate(signer) != address(0))) {\n            // slither-disable-next-line unused-return\n            (address recovered, ECDSA.RecoverError err,) = ECDSA.tryRecover(hash, signature);\n            if (err == ECDSA.RecoverError.NoError && recovered == signer) {\n                return true;\n            }\n        }\n        return codeLength > 0 && SignatureChecker.isValidERC1271SignatureNow(signer, hash, signature);\n    }\n\n    /**\n     * @dev Internal function implementing both limit increments\n     * @param limits The mint or burn limit mapping\n     * @param account The account whose cap is increased; must hold MINTER_BURNER_ROLE\n     * @param amount The amount to add to the cap\n     * @return newCap The cap after the increment\n     */\n    function _incrementLimit(mapping(address account => Limit limit) storage limits, address account, uint256 amount)\n        private\n        returns (uint256 newCap)\n    {\n        require(hasRole(MINTER_BURNER_ROLE, account), TargetNotMinterBurner());\n        Limit storage limit = limits[account];\n        newCap = limit.cap + amount;\n        limit.cap = newCap;\n    }\n\n    /**\n     * @dev Internal function implementing both limit decrements; clamps at zero and never reverts\n     * @param limits The mint or burn limit mapping\n     * @param account The account whose cap is decreased\n     * @param amount The amount requested to remove\n     * @return applied The amount actually removed; less than `amount` when clamped\n     * @return newCap The cap after the decrement\n     */\n    function _decrementLimit(mapping(address account => Limit limit) storage limits, address account, uint256 amount)\n        private\n        returns (uint256 applied, uint256 newCap)\n    {\n        Limit storage limit = limits[account];\n        uint256 current = limit.cap;\n        applied = amount < current ? amount : current;\n        newCap = current - applied;\n        limit.cap = newCap;\n    }\n\n    /**\n     * @dev Internal function implementing both window setters; requires the stored cap\n     * to be 0 and resets the usage counters. The target need not hold MINTER_BURNER_ROLE:\n     * at cap 0 the configuration is inert until {_incrementLimit} raises the cap\n     * @param limits The mint or burn limit mapping\n     * @param account The account whose window is set\n     * @param window The new window length: 0 for cumulative mode, within [1 minutes, 30 days] for\n     * window mode\n     * @return oldWindow The window length stored before the change\n     */\n    function _setWindow(mapping(address account => Limit limit) storage limits, address account, uint256 window)\n        private\n        returns (uint256 oldWindow)\n    {\n        Limit storage limit = limits[account];\n        require(limit.cap == 0, LimitNotZero());\n        if (window != 0) {\n            require(window >= 1 minutes && window <= 30 days, InvalidWindow());\n        }\n        oldWindow = limit.window;\n        limit.used = 0;\n        limit.windowId = 0;\n        limit.window = window;\n    }\n\n    /**\n     * @dev Internal function implementing the limit check and accounting shared by {mint} and\n     * {burn} for the caller\n     * @param limits The mint or burn limit mapping\n     * @param amount The amount being minted or burned\n     * @return available The limit left after this use\n     */\n    function _useLimit(mapping(address account => Limit limit) storage limits, uint256 amount)\n        private\n        returns (uint256 available)\n    {\n        Limit storage limit = limits[_msgSender()];\n        uint256 cap = limit.cap;\n        uint256 window = limit.window;\n\n        if (window == 0) {\n            // Cumulative mode: the cap is the remaining limit\n            require(amount <= cap, LimitExceeded(amount, cap));\n            available = cap - amount;\n            limit.cap = available;\n        } else {\n            uint256 currentWindowId = block.timestamp / window;\n            // A stored window id below the current one means that window has ended and its counter\n            // no longer applies. It never exceeds the current one: block timestamps do not decrease\n            // and the window setters zero it. Drift only shifts which window a mint or burn hits\n            // slither-disable-next-line timestamp\n            uint256 used = limit.windowId < currentWindowId ? 0 : limit.used;\n            // Remaining is the limit left to use in this window; it is 0 when a decrement\n            // lowered the cap below the counter\n            uint256 remaining = cap > used ? cap - used : 0;\n            // The amount must fit in the remaining limit; a counter above the cap leaves none\n            require(amount <= remaining, LimitExceeded(amount, remaining));\n            limit.used = used + amount;\n            limit.windowId = currentWindowId;\n            available = remaining - amount;\n        }\n    }\n\n    /**\n     * @dev Internal function implementing both limit getters\n     * @param limit The stored limit state\n     * @return cap The limit cap: remaining limit in cumulative mode, per-window limit in\n     * window mode\n     * @return usedInCurrentWindow The counter when it belongs to the current window, else 0\n     * @return windowEnd The end of the current window, 0 in cumulative mode; computed in checked\n     * arithmetic, so at timestamps within one window of the uint256 maximum the getter\n     * reverts rather than wraps\n     * @return window The stored window length, 0 in cumulative mode\n     */\n    function _limitView(Limit storage limit)\n        private\n        view\n        returns (uint256 cap, uint256 usedInCurrentWindow, uint256 windowEnd, uint256 window)\n    {\n        uint256 storedWindow = limit.window;\n        if (storedWindow == 0) {\n            return (limit.cap, 0, 0, 0);\n        }\n        uint256 currentWindowId = block.timestamp / storedWindow;\n        // The counter only applies while the stored window id is the current one (see _useLimit)\n        // slither-disable-next-line timestamp\n        uint256 used = limit.windowId < currentWindowId ? 0 : limit.used;\n        // Windows are aligned to multiples of the window length counted from timestamp 0, so the\n        // current window spans [currentWindowId * window, (currentWindowId + 1) * window) and\n        // ends where the next one starts\n        return (limit.cap, used, (currentWindowId + 1) * storedWindow, storedWindow);\n    }\n\n    /**\n     * @dev Internal function that handles token transfers\n     * @param from The address sending the tokens\n     * @param to The address receiving the tokens\n     * @param value The amount of tokens to transfer\n     * @notice Reverts if either the sender or receiver is blocked (except for burning)\n     */\n    function _update(address from, address to, uint256 value)\n        internal\n        override(ERC20Upgradeable, ERC20PausableUpgradeable)\n    {\n        require(to == address(0) || (!isBlocked(from) && !isBlocked(to)), AccountBlocked());\n\n        super._update(from, to, value);\n    }\n\n    /**\n     * @dev Internal function that authorizes contract upgrades\n     * @param newImplementation The address of the new implementation contract\n     * @notice Only accounts with UPGRADER_ROLE can upgrade the contract\n     */\n    function _authorizeUpgrade(address newImplementation) internal override onlyRole(UPGRADER_ROLE) {}\n\n    /**\n     * @dev See {AccessControlDefaultAdminRulesUpgradeable-_grantRole} and {AccessControlEnumerableUpgradeable-_grantRole}\n     */\n    function _grantRole(bytes32 role, address account)\n        internal\n        virtual\n        override(AccessControlDefaultAdminRulesUpgradeable, AccessControlEnumerableUpgradeable)\n        returns (bool)\n    {\n        return super._grantRole(role, account);\n    }\n\n    /**\n     * @dev See {AccessControlDefaultAdminRulesUpgradeable-_revokeRole} and {AccessControlEnumerableUpgradeable-_revokeRole}\n     */\n    function _revokeRole(bytes32 role, address account)\n        internal\n        virtual\n        override(AccessControlDefaultAdminRulesUpgradeable, AccessControlEnumerableUpgradeable)\n        returns (bool)\n    {\n        return super._revokeRole(role, account);\n    }\n\n    /**\n     * @dev See {AccessControlDefaultAdminRulesUpgradeable-_setRoleAdmin} and {AccessControlUpgradeable-_setRoleAdmin}\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole)\n        internal\n        virtual\n        override(AccessControlDefaultAdminRulesUpgradeable, AccessControlUpgradeable)\n    {\n        super._setRoleAdmin(role, adminRole);\n    }\n\n    /**\n     * @dev See {AccessControlDefaultAdminRulesUpgradeable-grantRole} and {AccessControlUpgradeable-grantRole}\n     */\n    function grantRole(bytes32 role, address account)\n        public\n        virtual\n        override(AccessControlDefaultAdminRulesUpgradeable, AccessControlUpgradeable, IAccessControl)\n    {\n        super.grantRole(role, account);\n    }\n\n    /**\n     * @dev See {AccessControlDefaultAdminRulesUpgradeable-revokeRole} and {AccessControlUpgradeable-revokeRole}\n     */\n    function revokeRole(bytes32 role, address account)\n        public\n        virtual\n        override(AccessControlDefaultAdminRulesUpgradeable, AccessControlUpgradeable, IAccessControl)\n    {\n        super.revokeRole(role, account);\n    }\n\n    /**\n     * @dev See {AccessControlDefaultAdminRulesUpgradeable-renounceRole} and {AccessControlUpgradeable-renounceRole}\n     */\n    function renounceRole(bytes32 role, address account)\n        public\n        virtual\n        override(AccessControlDefaultAdminRulesUpgradeable, AccessControlUpgradeable, IAccessControl)\n    {\n        super.renounceRole(role, account);\n    }\n\n    /**\n     * @dev Extends {AccessControlDefaultAdminRulesUpgradeable-supportsInterface} and\n     * {AccessControlEnumerableUpgradeable-supportsInterface} with the token interfaces\n     * @param interfaceId The ERC-165 interface identifier to query\n     * @return bool True if the contract implements the queried interface\n     * @notice Reports the ERC-20, metadata, permit, ERC-5267, ERC-3009 authorization, and ERC-5313\n     * owner interfaces the token implements on top of the ERC-165 and access control reports chained\n     * through the parent contracts, so feature-detecting integrators can discover the transfer,\n     * permit, signing-domain, authorization, and owner-lookup capabilities\n     */\n    function supportsInterface(bytes4 interfaceId)\n        public\n        view\n        virtual\n        override(AccessControlEnumerableUpgradeable, AccessControlDefaultAdminRulesUpgradeable)\n        returns (bool)\n    {\n        // This list must move in lockstep with the inheritance list: an interface may only be\n        // reported while every function composing its ID stays implemented\n        return interfaceId == type(IERC20).interfaceId || interfaceId == type(IERC20Metadata).interfaceId\n            || interfaceId == type(IERC20Permit).interfaceId || interfaceId == type(IERC5267).interfaceId\n            || interfaceId == type(IERC3009).interfaceId || interfaceId == type(IERC3009Cancel).interfaceId\n            || interfaceId == type(IERC5313).interfaceId || super.supportsInterface(interfaceId);\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/access/IAccessControl.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (access/IAccessControl.sol)\n\npragma solidity >=0.8.4;\n\n/**\n * @dev External interface of AccessControl declared to support ERC-165 detection.\n */\ninterface IAccessControl {\n    /**\n     * @dev The `account` is missing a role.\n     */\n    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n    /**\n     * @dev The caller of a function is not the expected one.\n     *\n     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n     */\n    error AccessControlBadConfirmation();\n\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted to signal this.\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role).\n     * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external view returns (bool);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `callerConfirmation`.\n     */\n    function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n"},"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"},"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity >=0.6.2;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"},"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n *     doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n *     token.safeTransferFrom(msg.sender, address(this), value);\n *     ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n    /**\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also applies here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     *\n     * CAUTION: See Security Considerations above.\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n\n    /**\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"},"lib/openzeppelin-contracts/contracts/interfaces/IERC5267.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC5267.sol)\n\npragma solidity >=0.4.16;\n\ninterface IERC5267 {\n    /**\n     * @dev MAY be emitted to signal that the domain could have changed.\n     */\n    event EIP712DomainChanged();\n\n    /**\n     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n     * signature.\n     */\n    function eip712Domain()\n        external\n        view\n        returns (\n            bytes1 fields,\n            string memory name,\n            string memory version,\n            uint256 chainId,\n            address verifyingContract,\n            bytes32 salt,\n            uint256[] memory extensions\n        );\n}\n"},"lib/openzeppelin-contracts/contracts/interfaces/IERC5313.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC5313.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface for the Light Contract Ownership Standard.\n *\n * A standardized minimal interface required to identify an account that controls a contract\n */\ninterface IERC5313 {\n    /**\n     * @dev Gets the address of the owner.\n     */\n    function owner() external view returns (address);\n}\n"},"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC3009.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (interfaces/draft-IERC3009.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-3009 standard as defined in https://eips.ethereum.org/EIPS/eip-3009[ERC-3009].\n */\ninterface IERC3009 {\n    /// @dev Emitted when an authorization is used.\n    event AuthorizationUsed(address indexed authorizer, bytes32 indexed nonce);\n\n    /**\n     * @dev Returns whether the `nonce` has been used by `authorizer`. A `true` value means the authorization\n     * has already been consumed (either transferred or canceled) and can no longer be used; a `false` value\n     * means the nonce is still available.\n     *\n     * Nonces are randomly generated 32-byte values unique to the authorizer's address.\n     */\n    function authorizationState(address authorizer, bytes32 nonce) external view returns (bool);\n\n    /**\n     * @dev Executes a transfer with a signed authorization.\n     *\n     * Requirements:\n     *\n     * * `validAfter` must be less than the current block timestamp.\n     * * `validBefore` must be greater than the current block timestamp.\n     * * `nonce` must not have been used by the `from` account.\n     * * the signature must be valid for the authorization.\n     */\n    function transferWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Receives a transfer with a signed authorization from the payer.\n     *\n     * Includes an additional check to ensure that the payee's address (`to`) matches the caller\n     * to prevent front-running attacks.\n     *\n     * Requirements:\n     *\n     * * `to` must be the caller of this function.\n     * * `validAfter` must be less than the current block timestamp.\n     * * `validBefore` must be greater than the current block timestamp.\n     * * `nonce` must not have been used by the `from` account.\n     * * the signature must be valid for the authorization.\n     */\n    function receiveWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n}\n\n/**\n * @dev Extension of {IERC3009} that adds the ability to cancel authorizations.\n */\ninterface IERC3009Cancel {\n    /// @dev Emitted when an authorization is canceled.\n    event AuthorizationCanceled(address indexed authorizer, bytes32 indexed nonce);\n\n    /**\n     * @dev Cancels an authorization.\n     *\n     * Requirements:\n     *\n     * * `nonce` must not have been used by the `authorizer` account.\n     * * the signature must be valid for the cancellation.\n     */\n    function cancelAuthorization(address authorizer, bytes32 nonce, uint8 v, bytes32 r, bytes32 s) external;\n}\n"},"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/ERC20PermitUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/extensions/ERC20Permit.sol)\n\npragma solidity ^0.8.24;\n\nimport {IERC20Permit} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\";\nimport {ERC20Upgradeable} from \"../ERC20Upgradeable.sol\";\nimport {ECDSA} from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport {EIP712Upgradeable} from \"../../../utils/cryptography/EIP712Upgradeable.sol\";\nimport {NoncesUpgradeable} from \"../../../utils/NoncesUpgradeable.sol\";\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20Permit, EIP712Upgradeable, NoncesUpgradeable {\n    bytes32 private constant PERMIT_TYPEHASH =\n        keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n\n    /**\n     * @dev Permit deadline has expired.\n     */\n    error ERC2612ExpiredSignature(uint256 deadline);\n\n    /**\n     * @dev Mismatched signature.\n     */\n    error ERC2612InvalidSigner(address signer, address owner);\n\n    /**\n     * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n     *\n     * It's a good idea to use the same `name` that is defined as the ERC-20 token name.\n     */\n    function __ERC20Permit_init(string memory name) internal onlyInitializing {\n        __EIP712_init_unchained(name, \"1\");\n    }\n\n    function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}\n\n    /// @inheritdoc IERC20Permit\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public virtual {\n        if (block.timestamp > deadline) {\n            revert ERC2612ExpiredSignature(deadline);\n        }\n\n        bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));\n\n        bytes32 hash = _hashTypedDataV4(structHash);\n\n        address signer = ECDSA.recover(hash, v, r, s);\n        if (signer != owner) {\n            revert ERC2612InvalidSigner(signer, owner);\n        }\n\n        _approve(owner, spender, value);\n    }\n\n    /// @inheritdoc IERC20Permit\n    function nonces(address owner) public view virtual override(IERC20Permit, NoncesUpgradeable) returns (uint256) {\n        return super.nonces(owner);\n    }\n\n    /// @inheritdoc IERC20Permit\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32) {\n        return _domainSeparatorV4();\n    }\n}\n"},"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/ERC20PausableUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/ERC20Pausable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC20Upgradeable} from \"../ERC20Upgradeable.sol\";\nimport {PausableUpgradeable} from \"../../../utils/PausableUpgradeable.sol\";\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @dev ERC-20 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * IMPORTANT: This contract does not include public pause and unpause functions. In\n * addition to inheriting this contract, you must define both functions, invoking the\n * {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate\n * access control, e.g. using {AccessControl} or {Ownable}. Not doing so will\n * make the contract pause mechanism of the contract unreachable, and thus unusable.\n */\nabstract contract ERC20PausableUpgradeable is Initializable, ERC20Upgradeable, PausableUpgradeable {\n    function __ERC20Pausable_init() internal onlyInitializing {\n    }\n\n    function __ERC20Pausable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev See {ERC20-_update}.\n     *\n     * Requirements:\n     *\n     * - the contract must not be paused.\n     */\n    function _update(address from, address to, uint256 value) internal virtual override whenNotPaused {\n        super._update(from, to, value);\n    }\n}\n"},"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n"},"lib/openzeppelin-contracts-upgradeable/contracts/access/extensions/AccessControlEnumerableUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (access/extensions/AccessControlEnumerable.sol)\n\npragma solidity ^0.8.24;\n\nimport {IAccessControlEnumerable} from \"@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\";\nimport {AccessControlUpgradeable} from \"../AccessControlUpgradeable.sol\";\nimport {EnumerableSet} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerable, AccessControlUpgradeable {\n    using EnumerableSet for EnumerableSet.AddressSet;\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.AccessControlEnumerable\n    struct AccessControlEnumerableStorage {\n        mapping(bytes32 role => EnumerableSet.AddressSet) _roleMembers;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.AccessControlEnumerable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant AccessControlEnumerableStorageLocation = 0xc1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000;\n\n    function _getAccessControlEnumerableStorage() private pure returns (AccessControlEnumerableStorage storage $) {\n        assembly {\n            $.slot := AccessControlEnumerableStorageLocation\n        }\n    }\n\n    function __AccessControlEnumerable_init() internal onlyInitializing {\n    }\n\n    function __AccessControlEnumerable_init_unchained() internal onlyInitializing {\n    }\n    /// @inheritdoc IERC165\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Returns one of the accounts that have `role`. `index` must be a\n     * value between 0 and {getRoleMemberCount}, non-inclusive.\n     *\n     * Role bearers are not sorted in any particular way, and their ordering may\n     * change at any point.\n     *\n     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n     * you perform all queries on the same block. See the following\n     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n     * for more information.\n     */\n    function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n        AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage();\n        return $._roleMembers[role].pos(index);\n    }\n\n    /**\n     * @dev Returns the number of accounts that have `role`. Can be used\n     * together with {getRoleMember} to enumerate all bearers of a role.\n     */\n    function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n        AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage();\n        return $._roleMembers[role].length();\n    }\n\n    /**\n     * @dev Return all accounts that have `role`\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function getRoleMembers(bytes32 role) public view virtual returns (address[] memory) {\n        AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage();\n        return $._roleMembers[role].values();\n    }\n\n    /**\n     * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n     */\n    function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n        AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage();\n        bool granted = super._grantRole(role, account);\n        if (granted) {\n            $._roleMembers[role].add(account);\n        }\n        return granted;\n    }\n\n    /**\n     * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n     */\n    function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n        AccessControlEnumerableStorage storage $ = _getAccessControlEnumerableStorage();\n        bool revoked = super._revokeRole(role, account);\n        if (revoked) {\n            $._roleMembers[role].remove(account);\n        }\n        return revoked;\n    }\n}\n"},"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.22;\n\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol\";\n"},"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {ContextUpgradeable} from \"../../utils/ContextUpgradeable.sol\";\nimport {IERC20Errors} from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC-20\n * applications.\n */\nabstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors {\n    /// @custom:storage-location erc7201:openzeppelin.storage.ERC20\n    struct ERC20Storage {\n        mapping(address account => uint256) _balances;\n\n        mapping(address account => mapping(address spender => uint256)) _allowances;\n\n        uint256 _totalSupply;\n\n        string _name;\n        string _symbol;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC20\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;\n\n    function _getERC20Storage() private pure returns (ERC20Storage storage $) {\n        assembly {\n            $.slot := ERC20StorageLocation\n        }\n    }\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * Both values are immutable: they can only be set once during construction.\n     */\n    function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n        __ERC20_init_unchained(name_, symbol_);\n    }\n\n    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n        ERC20Storage storage $ = _getERC20Storage();\n        $._name = name_;\n        $._symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual returns (string memory) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual returns (string memory) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    /// @inheritdoc IERC20\n    function totalSupply() public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._totalSupply;\n    }\n\n    /// @inheritdoc IERC20\n    function balanceOf(address account) public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /// @inheritdoc IERC20\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Skips emitting an {Approval} event indicating an allowance update. This is not\n     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        ERC20Storage storage $ = _getERC20Storage();\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            $._totalSupply += value;\n        } else {\n            uint256 fromBalance = $._balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                $._balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                $._totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                $._balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` as the allowance of `spender` over the `owner`'s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     *\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation sets the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the `transferFrom` operation can force the flag to\n     * true using the following override:\n     *\n     * ```solidity\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        ERC20Storage storage $ = _getERC20Storage();\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        $._allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner`'s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance < type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n"},"lib/openzeppelin-contracts-upgradeable/contracts/access/extensions/AccessControlDefaultAdminRulesUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.6.0) (access/extensions/AccessControlDefaultAdminRules.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControlDefaultAdminRules} from \"@openzeppelin/contracts/access/extensions/IAccessControlDefaultAdminRules.sol\";\nimport {AccessControlUpgradeable} from \"../AccessControlUpgradeable.sol\";\nimport {IAccessControl} from \"@openzeppelin/contracts/access/IAccessControl.sol\";\nimport {SafeCast} from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport {IERC5313} from \"@openzeppelin/contracts/interfaces/IERC5313.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Extension of {AccessControl} that allows specifying special rules to manage\n * the `DEFAULT_ADMIN_ROLE` holder, which is a sensitive role with special permissions\n * over other roles that may potentially have privileged rights in the system.\n *\n * If a specific role doesn't have an admin role assigned, the holder of the\n * `DEFAULT_ADMIN_ROLE` will have the ability to grant it and revoke it.\n *\n * This contract implements the following risk mitigations on top of {AccessControl}:\n *\n * * Only one account holds the `DEFAULT_ADMIN_ROLE` since deployment until it's potentially renounced.\n * * Enforces a 2-step process to transfer the `DEFAULT_ADMIN_ROLE` to another account.\n * * Enforces a configurable delay between the two steps, with the ability to cancel before the transfer is accepted.\n * * The delay can be changed by scheduling, see {changeDefaultAdminDelay}.\n * * Role transfers must wait at least one block after scheduling before it can be accepted.\n * * It is not possible to use another role to manage the `DEFAULT_ADMIN_ROLE`.\n *\n * Example usage:\n *\n * ```solidity\n * contract MyToken is AccessControlDefaultAdminRules {\n *   constructor() AccessControlDefaultAdminRules(\n *     3 days,\n *     msg.sender // Explicit initial `DEFAULT_ADMIN_ROLE` holder\n *    ) {}\n * }\n * ```\n */\nabstract contract AccessControlDefaultAdminRulesUpgradeable is Initializable, IAccessControlDefaultAdminRules, IERC5313, AccessControlUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.AccessControlDefaultAdminRules\n    struct AccessControlDefaultAdminRulesStorage {\n        // pending admin pair read/written together frequently\n        address _pendingDefaultAdmin;\n        uint48 _pendingDefaultAdminSchedule; // 0 == unset\n\n        uint48 _currentDelay;\n        address _currentDefaultAdmin;\n\n        // pending delay pair read/written together frequently\n        uint48 _pendingDelay;\n        uint48 _pendingDelaySchedule; // 0 == unset\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.AccessControlDefaultAdminRules\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant AccessControlDefaultAdminRulesStorageLocation = 0xeef3dac4538c82c8ace4063ab0acd2d15cdb5883aa1dff7c2673abb3d8698400;\n\n    function _getAccessControlDefaultAdminRulesStorage() private pure returns (AccessControlDefaultAdminRulesStorage storage $) {\n        assembly {\n            $.slot := AccessControlDefaultAdminRulesStorageLocation\n        }\n    }\n\n    /**\n     * @dev Sets the initial values for {defaultAdminDelay} and {defaultAdmin} address.\n     */\n    function __AccessControlDefaultAdminRules_init(uint48 initialDelay, address initialDefaultAdmin) internal onlyInitializing {\n        __AccessControlDefaultAdminRules_init_unchained(initialDelay, initialDefaultAdmin);\n    }\n\n    function __AccessControlDefaultAdminRules_init_unchained(uint48 initialDelay, address initialDefaultAdmin) internal onlyInitializing {\n        AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage();\n        if (initialDefaultAdmin == address(0)) {\n            revert AccessControlInvalidDefaultAdmin(address(0));\n        }\n        $._currentDelay = initialDelay;\n        _grantRole(DEFAULT_ADMIN_ROLE, initialDefaultAdmin);\n    }\n\n    /// @inheritdoc IERC165\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IAccessControlDefaultAdminRules).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /// @inheritdoc IERC5313\n    function owner() public view virtual returns (address) {\n        return defaultAdmin();\n    }\n\n    ///\n    /// Override AccessControl role management\n    ///\n\n    /**\n     * @dev See {AccessControl-grantRole}. Reverts for `DEFAULT_ADMIN_ROLE`.\n     */\n    function grantRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControl) {\n        if (role == DEFAULT_ADMIN_ROLE) {\n            revert AccessControlEnforcedDefaultAdminRules();\n        }\n        super.grantRole(role, account);\n    }\n\n    /**\n     * @dev See {AccessControl-revokeRole}. Reverts for `DEFAULT_ADMIN_ROLE`.\n     */\n    function revokeRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControl) {\n        if (role == DEFAULT_ADMIN_ROLE) {\n            revert AccessControlEnforcedDefaultAdminRules();\n        }\n        super.revokeRole(role, account);\n    }\n\n    /**\n     * @dev See {AccessControl-renounceRole}.\n     *\n     * For the `DEFAULT_ADMIN_ROLE`, it only allows renouncing in two steps by first calling\n     * {beginDefaultAdminTransfer} to the `address(0)`, so it's required that the {pendingDefaultAdmin} schedule\n     * has also passed when calling this function.\n     *\n     * After its execution, it will not be possible to call `onlyRole(DEFAULT_ADMIN_ROLE)` functions.\n     *\n     * NOTE: Renouncing `DEFAULT_ADMIN_ROLE` will leave the contract without a {defaultAdmin},\n     * thereby disabling any functionality that is only available for it, and the possibility of reassigning a\n     * non-administrated role.\n     */\n    function renounceRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControl) {\n        AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage();\n        if (role == DEFAULT_ADMIN_ROLE && account == defaultAdmin()) {\n            (address newDefaultAdmin, uint48 schedule) = pendingDefaultAdmin();\n            if (newDefaultAdmin != address(0) || !_isScheduleSet(schedule) || !_hasSchedulePassed(schedule)) {\n                revert AccessControlEnforcedDefaultAdminDelay(schedule);\n            }\n            delete $._pendingDefaultAdminSchedule;\n        }\n        super.renounceRole(role, account);\n    }\n\n    /**\n     * @dev See {AccessControl-_grantRole}.\n     *\n     * For `DEFAULT_ADMIN_ROLE`, it only allows granting if there isn't already a {defaultAdmin} or if the\n     * role has been previously renounced.\n     *\n     * NOTE: Exposing this function through another mechanism may make the `DEFAULT_ADMIN_ROLE`\n     * assignable again. Make sure to guarantee this is the expected behavior in your implementation.\n     */\n    function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n        AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage();\n        if (role == DEFAULT_ADMIN_ROLE) {\n            if (defaultAdmin() != address(0)) {\n                revert AccessControlEnforcedDefaultAdminRules();\n            }\n            $._currentDefaultAdmin = account;\n        }\n        return super._grantRole(role, account);\n    }\n\n    /// @inheritdoc AccessControlUpgradeable\n    function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n        AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage();\n        if (role == DEFAULT_ADMIN_ROLE && account == defaultAdmin()) {\n            delete $._currentDefaultAdmin;\n        }\n        return super._revokeRole(role, account);\n    }\n\n    /**\n     * @dev See {AccessControl-_setRoleAdmin}. Reverts for `DEFAULT_ADMIN_ROLE`.\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual override {\n        if (role == DEFAULT_ADMIN_ROLE) {\n            revert AccessControlEnforcedDefaultAdminRules();\n        }\n        super._setRoleAdmin(role, adminRole);\n    }\n\n    ///\n    /// AccessControlDefaultAdminRules accessors\n    ///\n\n    /// @inheritdoc IAccessControlDefaultAdminRules\n    function defaultAdmin() public view virtual returns (address) {\n        AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage();\n        return $._currentDefaultAdmin;\n    }\n\n    /// @inheritdoc IAccessControlDefaultAdminRules\n    function pendingDefaultAdmin() public view virtual returns (address newAdmin, uint48 schedule) {\n        AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage();\n        return ($._pendingDefaultAdmin, $._pendingDefaultAdminSchedule);\n    }\n\n    /// @inheritdoc IAccessControlDefaultAdminRules\n    function defaultAdminDelay() public view virtual returns (uint48) {\n        AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage();\n        uint48 schedule = $._pendingDelaySchedule;\n        return (_isScheduleSet(schedule) && _hasSchedulePassed(schedule)) ? $._pendingDelay : $._currentDelay;\n    }\n\n    /// @inheritdoc IAccessControlDefaultAdminRules\n    function pendingDefaultAdminDelay() public view virtual returns (uint48 newDelay, uint48 schedule) {\n        AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage();\n        schedule = $._pendingDelaySchedule;\n        return (_isScheduleSet(schedule) && !_hasSchedulePassed(schedule)) ? ($._pendingDelay, schedule) : (0, 0);\n    }\n\n    /// @inheritdoc IAccessControlDefaultAdminRules\n    function defaultAdminDelayIncreaseWait() public view virtual returns (uint48) {\n        return 5 days;\n    }\n\n    ///\n    /// AccessControlDefaultAdminRules public and internal setters for defaultAdmin/pendingDefaultAdmin\n    ///\n\n    /// @inheritdoc IAccessControlDefaultAdminRules\n    function beginDefaultAdminTransfer(address newAdmin) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {\n        _beginDefaultAdminTransfer(newAdmin);\n    }\n\n    /**\n     * @dev See {beginDefaultAdminTransfer}.\n     *\n     * Internal function without access restriction.\n     */\n    function _beginDefaultAdminTransfer(address newAdmin) internal virtual {\n        uint48 newSchedule = SafeCast.toUint48(block.timestamp) + defaultAdminDelay();\n        _setPendingDefaultAdmin(newAdmin, newSchedule);\n        emit DefaultAdminTransferScheduled(newAdmin, newSchedule);\n    }\n\n    /// @inheritdoc IAccessControlDefaultAdminRules\n    function cancelDefaultAdminTransfer() public virtual onlyRole(DEFAULT_ADMIN_ROLE) {\n        _cancelDefaultAdminTransfer();\n    }\n\n    /**\n     * @dev See {cancelDefaultAdminTransfer}.\n     *\n     * Internal function without access restriction.\n     */\n    function _cancelDefaultAdminTransfer() internal virtual {\n        _setPendingDefaultAdmin(address(0), 0);\n    }\n\n    /// @inheritdoc IAccessControlDefaultAdminRules\n    function acceptDefaultAdminTransfer() public virtual {\n        (address newDefaultAdmin, ) = pendingDefaultAdmin();\n        if (_msgSender() != newDefaultAdmin) {\n            // Enforce newDefaultAdmin explicit acceptance.\n            revert AccessControlInvalidDefaultAdmin(_msgSender());\n        }\n        _acceptDefaultAdminTransfer();\n    }\n\n    /**\n     * @dev See {acceptDefaultAdminTransfer}.\n     *\n     * Internal function without access restriction.\n     */\n    function _acceptDefaultAdminTransfer() internal virtual {\n        AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage();\n        (address newAdmin, uint48 schedule) = pendingDefaultAdmin();\n        if (!_isScheduleSet(schedule) || !_hasSchedulePassed(schedule)) {\n            revert AccessControlEnforcedDefaultAdminDelay(schedule);\n        }\n        _revokeRole(DEFAULT_ADMIN_ROLE, defaultAdmin());\n        _grantRole(DEFAULT_ADMIN_ROLE, newAdmin);\n        delete $._pendingDefaultAdmin;\n        delete $._pendingDefaultAdminSchedule;\n    }\n\n    ///\n    /// AccessControlDefaultAdminRules public and internal setters for defaultAdminDelay/pendingDefaultAdminDelay\n    ///\n\n    /// @inheritdoc IAccessControlDefaultAdminRules\n    function changeDefaultAdminDelay(uint48 newDelay) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {\n        _changeDefaultAdminDelay(newDelay);\n    }\n\n    /**\n     * @dev See {changeDefaultAdminDelay}.\n     *\n     * Internal function without access restriction.\n     */\n    function _changeDefaultAdminDelay(uint48 newDelay) internal virtual {\n        uint48 newSchedule = SafeCast.toUint48(block.timestamp) + _delayChangeWait(newDelay);\n        _setPendingDelay(newDelay, newSchedule);\n        emit DefaultAdminDelayChangeScheduled(newDelay, newSchedule);\n    }\n\n    /// @inheritdoc IAccessControlDefaultAdminRules\n    function rollbackDefaultAdminDelay() public virtual onlyRole(DEFAULT_ADMIN_ROLE) {\n        _rollbackDefaultAdminDelay();\n    }\n\n    /**\n     * @dev See {rollbackDefaultAdminDelay}.\n     *\n     * Internal function without access restriction.\n     */\n    function _rollbackDefaultAdminDelay() internal virtual {\n        _setPendingDelay(0, 0);\n    }\n\n    /**\n     * @dev Returns the amount of seconds to wait after the `newDelay` will\n     * become the new {defaultAdminDelay}.\n     *\n     * The value returned guarantees that if the delay is reduced, it will go into effect\n     * after a wait that honors the previously set delay.\n     *\n     * See {defaultAdminDelayIncreaseWait}.\n     */\n    function _delayChangeWait(uint48 newDelay) internal view virtual returns (uint48) {\n        uint48 currentDelay = defaultAdminDelay();\n\n        // When increasing the delay, we schedule the delay change to occur after a period of \"new delay\" has passed, up\n        // to a maximum given by defaultAdminDelayIncreaseWait, by default 5 days. For example, if increasing from 1 day\n        // to 3 days, the new delay will come into effect after 3 days. If increasing from 1 day to 10 days, the new\n        // delay will come into effect after 5 days. The 5 day wait period is intended to be able to fix an error like\n        // using milliseconds instead of seconds.\n        //\n        // When decreasing the delay, we wait the difference between \"current delay\" and \"new delay\". This guarantees\n        // that an admin transfer cannot be made faster than \"current delay\" at the time the delay change is scheduled.\n        // For example, if decreasing from 10 days to 3 days, the new delay will come into effect after 7 days.\n        return\n            newDelay > currentDelay\n                ? uint48(Math.min(newDelay, defaultAdminDelayIncreaseWait())) // no need to safecast, both inputs are uint48\n                : currentDelay - newDelay;\n    }\n\n    ///\n    /// Private setters\n    ///\n\n    /**\n     * @dev Setter of the tuple for pending admin and its schedule.\n     *\n     * May emit a {DefaultAdminTransferCanceled} event.\n     */\n    function _setPendingDefaultAdmin(address newAdmin, uint48 newSchedule) private {\n        AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage();\n        (, uint48 oldSchedule) = pendingDefaultAdmin();\n\n        $._pendingDefaultAdmin = newAdmin;\n        $._pendingDefaultAdminSchedule = newSchedule;\n\n        // An `oldSchedule` from `pendingDefaultAdmin()` is only set if it hasn't been accepted.\n        if (_isScheduleSet(oldSchedule)) {\n            // Emit for implicit cancellations when another default admin was scheduled.\n            emit DefaultAdminTransferCanceled();\n        }\n    }\n\n    /**\n     * @dev Setter of the tuple for pending delay and its schedule.\n     *\n     * May emit a {DefaultAdminDelayChangeCanceled} event.\n     */\n    function _setPendingDelay(uint48 newDelay, uint48 newSchedule) private {\n        AccessControlDefaultAdminRulesStorage storage $ = _getAccessControlDefaultAdminRulesStorage();\n        uint48 oldSchedule = $._pendingDelaySchedule;\n\n        if (_isScheduleSet(oldSchedule)) {\n            if (_hasSchedulePassed(oldSchedule)) {\n                // Materialize a virtual delay\n                $._currentDelay = $._pendingDelay;\n            } else {\n                // Emit for implicit cancellations when another delay was scheduled.\n                emit DefaultAdminDelayChangeCanceled();\n            }\n        }\n\n        $._pendingDelay = newDelay;\n        $._pendingDelaySchedule = newSchedule;\n    }\n\n    ///\n    /// Private helpers\n    ///\n\n    /**\n     * @dev Defines if a `schedule` is considered set. For consistency purposes.\n     */\n    function _isScheduleSet(uint48 schedule) private pure returns (bool) {\n        return schedule != 0;\n    }\n\n    /**\n     * @dev Defines if a `schedule` is considered passed. For consistency purposes.\n     */\n    function _hasSchedulePassed(uint48 schedule) private view returns (bool) {\n        return schedule < block.timestamp;\n    }\n}\n"},"lib/openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"@openzeppelin/contracts/access/IAccessControl.sol\";\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {ERC165Upgradeable} from \"../utils/introspection/ERC165Upgradeable.sol\";\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n *     require(hasRole(MY_ROLE, msg.sender));\n *     ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable {\n    struct RoleData {\n        mapping(address account => bool) hasRole;\n        bytes32 adminRole;\n    }\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.AccessControl\n    struct AccessControlStorage {\n        mapping(bytes32 role => RoleData) _roles;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.AccessControl\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800;\n\n    function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) {\n        assembly {\n            $.slot := AccessControlStorageLocation\n        }\n    }\n\n    /**\n     * @dev Modifier that checks that an account has a specific role. Reverts\n     * with an {AccessControlUnauthorizedAccount} error including the required role.\n     */\n    modifier onlyRole(bytes32 role) {\n        _checkRole(role);\n        _;\n    }\n\n    function __AccessControl_init() internal onlyInitializing {\n    }\n\n    function __AccessControl_init_unchained() internal onlyInitializing {\n    }\n    /// @inheritdoc ERC165Upgradeable\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        return $._roles[role].hasRole[account];\n    }\n\n    /**\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n     */\n    function _checkRole(bytes32 role) internal view virtual {\n        _checkRole(role, _msgSender());\n    }\n\n    /**\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n     * is missing `role`.\n     */\n    function _checkRole(bytes32 role, address account) internal view virtual {\n        if (!hasRole(role, account)) {\n            revert AccessControlUnauthorizedAccount(account, role);\n        }\n    }\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        return $._roles[role].adminRole;\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * Emits a {RoleRevoked} event if the calling account had `role` and this call successfully revoked it.\n     *\n     * Requirements:\n     *\n     * - the caller must be `callerConfirmation`.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n        if (callerConfirmation != _msgSender()) {\n            revert AccessControlBadConfirmation();\n        }\n\n        _revokeRole(role, callerConfirmation);\n    }\n\n    /**\n     * @dev Sets `adminRole` as ``role``'s admin role.\n     *\n     * Emits a {RoleAdminChanged} event.\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        bytes32 previousAdminRole = getRoleAdmin(role);\n        $._roles[role].adminRole = adminRole;\n        emit RoleAdminChanged(role, previousAdminRole, adminRole);\n    }\n\n    /**\n     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        if (!hasRole(role, account)) {\n            $._roles[role].hasRole[account] = true;\n            emit RoleGranted(role, account, _msgSender());\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Attempts to revoke `role` from `account` and returns a boolean indicating if `role` was revoked.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        if (hasRole(role, account)) {\n            $._roles[role].hasRole[account] = false;\n            emit RoleRevoked(role, account, _msgSender());\n            return true;\n        } else {\n            return false;\n        }\n    }\n}\n"},"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/draft-ERC3009Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (token/ERC20/extensions/draft-ERC3009.sol)\npragma solidity ^0.8.26;\n\nimport {ERC20Upgradeable} from \"../ERC20Upgradeable.sol\";\nimport {EIP712Upgradeable} from \"../../../utils/cryptography/EIP712Upgradeable.sol\";\nimport {ECDSA} from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport {IERC3009, IERC3009Cancel} from \"@openzeppelin/contracts/interfaces/draft-IERC3009.sol\";\nimport {Time} from \"@openzeppelin/contracts/utils/types/Time.sol\";\nimport {ERC4337Utils} from \"@openzeppelin/contracts/account/utils/ERC4337Utils.sol\";\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC-3009 Transfer With Authorization extension allowing\n * transfers to be made via signatures, as defined in https://eips.ethereum.org/EIPS/eip-3009[ERC-3009].\n *\n * Adds the {transferWithAuthorization} and {receiveWithAuthorization} methods, which\n * can be used to change an account's ERC-20 balance by presenting a message signed\n * by the account. By not relying on {IERC20-approve} and {IERC20-transferFrom}, the\n * token holder account doesn't need to send a transaction, and thus is not required\n * to hold native currency (e.g. ETH) at all.\n *\n * NOTE: To enable both timestamp-based and block-number-based validity windows, `validAfter` and\n * `validBefore` use a dual-clock encoding mirroring {ERC4337Utils}. Bit 47 ({BLOCK_RANGE_FLAG}) acts as a\n * clock selector: when *both* `validAfter` and `validBefore` have this bit set, the values are interpreted\n * as block numbers; otherwise they are interpreted as Unix timestamps (the default, matching the ERC-3009\n * specification). Since the current clock fits in 48 bits, any bit set at position 47 or above (other than\n * the active clock-mode flag) makes the value point to an unreachable future. See {_checkValidity}.\n */\nabstract contract ERC3009Upgradeable is Initializable, ERC20Upgradeable, EIP712Upgradeable, IERC3009, IERC3009Cancel {\n    /// @dev The signature is invalid\n    error ERC3009InvalidSignature();\n\n    /// @dev The authorization is not valid at the given time\n    error ERC3009InvalidAuthorizationTime(uint256 validAfter, uint256 validBefore);\n\n    /// @dev The authorization has already been used or canceled\n    error ERC3009UsedAuthorization(address authorizer, bytes32 nonce);\n\n    bytes32 internal constant TRANSFER_WITH_AUTHORIZATION_TYPEHASH =\n        keccak256(\n            \"TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)\"\n        );\n    bytes32 internal constant RECEIVE_WITH_AUTHORIZATION_TYPEHASH =\n        keccak256(\n            \"ReceiveWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)\"\n        );\n    bytes32 internal constant CANCEL_AUTHORIZATION_TYPEHASH =\n        keccak256(\"CancelAuthorization(address authorizer,bytes32 nonce)\");\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.ERC3009\n    struct ERC3009Storage {\n        mapping(address account => mapping(bytes32 nonce => bool used)) _usedNonces;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC3009\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ERC3009StorageLocation = 0x68a4e84d7293f1c72e58465b18bfb7c710b7fc94a92007a0f82a6a563831ff00;\n\n    function _getERC3009Storage() private pure returns (ERC3009Storage storage $) {\n        assembly {\n            $.slot := ERC3009StorageLocation\n        }\n    }\n\n    function __ERC3009_init() internal onlyInitializing {\n    }\n\n    function __ERC3009_init_unchained() internal onlyInitializing {\n    }\n    /// @inheritdoc IERC3009\n    function authorizationState(address authorizer, bytes32 nonce) public view virtual returns (bool) {\n        ERC3009Storage storage $ = _getERC3009Storage();\n        return $._usedNonces[authorizer][nonce];\n    }\n\n    /// @inheritdoc IERC3009\n    function transferWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public virtual {\n        bytes32 hash = _hashTypedDataV4(\n            keccak256(abi.encode(TRANSFER_WITH_AUTHORIZATION_TYPEHASH, from, to, value, validAfter, validBefore, nonce))\n        );\n        require(from == ECDSA.recover(hash, v, r, s), ERC3009InvalidSignature());\n        _transferWithAuthorization(from, to, value, validAfter, validBefore, nonce);\n    }\n\n    /// @inheritdoc IERC3009\n    function receiveWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) public virtual {\n        bytes32 hash = _hashTypedDataV4(\n            keccak256(abi.encode(RECEIVE_WITH_AUTHORIZATION_TYPEHASH, from, to, value, validAfter, validBefore, nonce))\n        );\n        require(from == ECDSA.recover(hash, v, r, s), ERC3009InvalidSignature());\n        require(to == _msgSender(), ERC20InvalidReceiver(to));\n        _transferWithAuthorization(from, to, value, validAfter, validBefore, nonce);\n    }\n\n    /// @inheritdoc IERC3009Cancel\n    function cancelAuthorization(address authorizer, bytes32 nonce, uint8 v, bytes32 r, bytes32 s) public virtual {\n        bytes32 hash = _hashTypedDataV4(keccak256(abi.encode(CANCEL_AUTHORIZATION_TYPEHASH, authorizer, nonce)));\n        require(authorizer == ECDSA.recover(hash, v, r, s), ERC3009InvalidSignature());\n        _cancelAuthorization(authorizer, nonce);\n    }\n\n    /// @dev Performs the time and nonce checks, then executes the transfer.\n    function _transferWithAuthorization(\n        address from,\n        address to,\n        uint256 value,\n        uint256 validAfter,\n        uint256 validBefore,\n        bytes32 nonce\n    ) internal virtual {\n        _checkValidity(validAfter, validBefore);\n        _consumeNonce(from, nonce);\n        emit AuthorizationUsed(from, nonce);\n        _transfer(from, to, value);\n    }\n\n    /// @dev Consumes the nonce and emits the cancellation event.\n    function _cancelAuthorization(address authorizer, bytes32 nonce) internal virtual {\n        _consumeNonce(authorizer, nonce);\n        emit AuthorizationCanceled(authorizer, nonce);\n    }\n\n    /// @dev Marks `nonce` as used for `authorizer`. Reverts with {ERC3009UsedAuthorization} if already consumed.\n    function _consumeNonce(address authorizer, bytes32 nonce) internal virtual {\n        ERC3009Storage storage $ = _getERC3009Storage();\n        require(!$._usedNonces[authorizer][nonce], ERC3009UsedAuthorization(authorizer, nonce));\n        $._usedNonces[authorizer][nonce] = true;\n    }\n\n    /**\n     * @dev Checks the validity of the authorization against the current clock.\n     *\n     * Following the ERC-4337-style dual-clock encoding, the clock is interpreted as block number only when\n     * *both* `validAfter` and `validBefore` carry the {BLOCK_RANGE_FLAG}; otherwise it falls back to\n     * timestamp (matching the ERC-3009 specification's default). Mixed-flag inputs therefore fall back to\n     * the timestamp clock rather than reverting, mirroring {ERC4337Utils-parseValidationData}. The flag bit\n     * is masked off the values only when block-mode is engaged; in timestamp mode the full 256-bit value\n     * participates in the comparison.\n     *\n     * NOTE: Any `validAfter` or `validBefore` with a bit set at position 47 or above (other than the active\n     * clock-mode flag) is interpreted as an unreachable point in the future (i.e. never valid after or\n     * always valid before, respectively).\n     */\n    function _checkValidity(uint256 validAfter, uint256 validBefore) internal view virtual {\n        uint256 flag = validAfter & validBefore & ERC4337Utils.BLOCK_RANGE_FLAG;\n        uint256 current = flag == 0 ? Time.timestamp() : Time.blockNumber();\n        require(\n            current > (validAfter & ~flag) && current < (validBefore & ~flag),\n            ERC3009InvalidAuthorizationTime(validAfter, validBefore)\n        );\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (utils/cryptography/SignatureChecker.sol)\n\npragma solidity ^0.8.24;\n\nimport {ECDSA} from \"./ECDSA.sol\";\nimport {IERC1271} from \"../../interfaces/IERC1271.sol\";\nimport {IERC7913SignatureVerifier} from \"../../interfaces/IERC7913.sol\";\nimport {Bytes} from \"../Bytes.sol\";\n\n/**\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support:\n *\n * * ECDSA signatures from externally owned accounts (EOAs)\n * * ERC-1271 signatures from smart contract wallets like Argent and Safe Wallet (previously Gnosis Safe)\n * * ERC-7913 signatures from keys that do not have an Ethereum address of their own\n *\n * See https://eips.ethereum.org/EIPS/eip-1271[ERC-1271] and https://eips.ethereum.org/EIPS/eip-7913[ERC-7913].\n */\nlibrary SignatureChecker {\n    using Bytes for bytes;\n\n    /**\n     * @dev Checks if a signature is valid for a given signer and data hash. If the signer has code, the\n     * signature is validated against it using ERC-1271, otherwise it's validated using `ECDSA.recover`.\n     *\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\n     *\n     * NOTE: For an extended version of this function that supports ERC-7913 signatures, see {isValidSignatureNow-bytes-bytes32-bytes-}.\n     */\n    function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\n        if (signer.code.length == 0) {\n            (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\n            return err == ECDSA.RecoverError.NoError && recovered == signer;\n        } else {\n            return isValidERC1271SignatureNow(signer, hash, signature);\n        }\n    }\n\n    /**\n     * @dev Variant of {isValidSignatureNow} that takes a signature in calldata\n     */\n    function isValidSignatureNowCalldata(\n        address signer,\n        bytes32 hash,\n        bytes calldata signature\n    ) internal view returns (bool) {\n        if (signer.code.length == 0) {\n            (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecoverCalldata(hash, signature);\n            return err == ECDSA.RecoverError.NoError && recovered == signer;\n        } else {\n            return isValidERC1271SignatureNowCalldata(signer, hash, signature);\n        }\n    }\n\n    /**\n     * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\n     * against the signer smart contract using ERC-1271.\n     *\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\n     */\n    function isValidERC1271SignatureNow(\n        address signer,\n        bytes32 hash,\n        bytes memory signature\n    ) internal view returns (bool result) {\n        bytes4 selector = IERC1271.isValidSignature.selector;\n        uint256 length = signature.length;\n\n        assembly (\"memory-safe\") {\n            // Encoded calldata following https://docs.soliditylang.org/en/v0.8.35/abi-spec.html:\n            // [ 0x00 - 0x03 ] <selector>\n            // [ 0x04 - 0x23 ] <hash>\n            // [ 0x24 - 0x43 ] <signature offset> (0x40)\n            // [ 0x44 - 0x63 ] <signature length>\n            // [ 0x64 - ...  ] <signature data> | <zero padding>\n            let ptr := mload(0x40)\n            mstore(ptr, selector)\n            mstore(add(ptr, 0x04), hash)\n            mstore(add(ptr, 0x24), 0x40)\n            mcopy(add(ptr, 0x44), signature, add(length, 0x20))\n            mstore(add(add(ptr, 0x64), length), 0)\n\n            // round up the length to the next multiple of 32 bytes to ensure that the calldata is properly padded\n            length := shl(5, shr(5, add(length, 0x1F)))\n\n            let success := staticcall(gas(), signer, ptr, add(length, 0x64), 0x00, 0x20)\n            result := and(success, and(gt(returndatasize(), 0x1f), eq(mload(0x00), selector)))\n        }\n    }\n\n    function isValidERC1271SignatureNowCalldata(\n        address signer,\n        bytes32 hash,\n        bytes calldata signature\n    ) internal view returns (bool result) {\n        bytes4 selector = IERC1271.isValidSignature.selector;\n        uint256 length = signature.length;\n\n        assembly (\"memory-safe\") {\n            // Encoded calldata following https://docs.soliditylang.org/en/v0.8.35/abi-spec.html:\n            // [ 0x00 - 0x03 ] <selector>\n            // [ 0x04 - 0x23 ] <hash>\n            // [ 0x24 - 0x43 ] <signature offset> (0x40)\n            // [ 0x44 - 0x63 ] <signature length>\n            // [ 0x64 - ...  ] <signature data> | <zero padding>\n            let ptr := mload(0x40)\n            mstore(ptr, selector)\n            mstore(add(ptr, 0x04), hash)\n            mstore(add(ptr, 0x24), 0x40)\n            mstore(add(ptr, 0x44), length)\n            calldatacopy(add(ptr, 0x64), signature.offset, length)\n            mstore(add(add(ptr, 0x64), length), 0)\n\n            // round up the length to the next multiple of 32 bytes to ensure that the calldata is properly padded\n            length := shl(5, shr(5, add(length, 0x1F)))\n\n            let success := staticcall(gas(), signer, ptr, add(length, 0x64), 0x00, 0x20)\n            result := and(success, and(gt(returndatasize(), 0x1f), eq(mload(0x00), selector)))\n        }\n    }\n\n    /**\n     * @dev Verifies a signature for a given ERC-7913 signer and hash.\n     *\n     * The signer is a `bytes` object that is the concatenation of an address and optionally a key:\n     * `verifier || key`. A signer must be at least 20 bytes long.\n     *\n     * Verification is done as follows:\n     *\n     * * If `signer.length < 20`: verification fails\n     * * If `signer.length == 20`: verification is done using {isValidSignatureNow}\n     * * Otherwise: verification is done using {IERC7913SignatureVerifier}\n     *\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\n     */\n    function isValidSignatureNow(\n        bytes memory signer,\n        bytes32 hash,\n        bytes memory signature\n    ) internal view returns (bool) {\n        if (signer.length < 20) {\n            return false;\n        } else if (signer.length == 20) {\n            return isValidSignatureNow(address(bytes20(signer)), hash, signature);\n        } else {\n            (bool success, bytes memory result) = address(bytes20(signer)).staticcall(\n                abi.encodeCall(IERC7913SignatureVerifier.verify, (signer.slice(20), hash, signature))\n            );\n            return (success &&\n                result.length >= 32 &&\n                abi.decode(result, (bytes32)) == bytes32(IERC7913SignatureVerifier.verify.selector));\n        }\n    }\n\n    /**\n     * @dev Verifies multiple ERC-7913 `signatures` for a given `hash` using a set of `signers`.\n     * Returns `false` if the number of signers and signatures is not the same.\n     *\n     * The signers should be ordered by their `keccak256` hash to ensure efficient duplication check. Unordered\n     * signers are supported, but the uniqueness check will be more expensive.\n     *\n     * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n     * change through time. It could return true at block N and false at block N+1 (or the opposite).\n     */\n    function areValidSignaturesNow(\n        bytes32 hash,\n        bytes[] memory signers,\n        bytes[] memory signatures\n    ) internal view returns (bool) {\n        if (signers.length != signatures.length) return false;\n\n        bytes32 lastId = bytes32(0);\n\n        for (uint256 i = 0; i < signers.length; ++i) {\n            bytes memory signer = signers[i];\n\n            // If one of the signatures is invalid, reject the batch\n            if (!isValidSignatureNow(signer, hash, signatures[i])) return false;\n\n            bytes32 id = keccak256(signer);\n            // If the current signer ID is greater than all previous IDs, then this is a new signer.\n            if (lastId < id) {\n                lastId = id;\n            } else {\n                // If this signer id is not greater than all the previous ones, verify that it is not a duplicate of a previous one\n                // This loop is never executed if the signers are ordered by id.\n                for (uint256 j = 0; j < i; ++j) {\n                    if (id == keccak256(signers[j])) return false;\n                }\n            }\n        }\n\n        return true;\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n    enum RecoverError {\n        NoError,\n        InvalidSignature,\n        InvalidSignatureLength,\n        InvalidSignatureS\n    }\n\n    /**\n     * @dev The signature is invalid.\n     */\n    error ECDSAInvalidSignature();\n\n    /**\n     * @dev The signature has an invalid length.\n     */\n    error ECDSAInvalidSignatureLength(uint256 length);\n\n    /**\n     * @dev The signature has an S value that is in the upper half order.\n     */\n    error ECDSAInvalidSignatureS(bytes32 s);\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n     * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n     * and a bytes32 providing additional information about the error.\n     *\n     * If no error is returned, then the address can be used for verification purposes.\n     *\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * NOTE: This function only supports 65-byte signatures. ERC-2098 short signatures are rejected. This restriction\n     * is DEPRECATED and will be removed in v6.0. Developers SHOULD NOT use signatures as unique identifiers; use hash\n     * invalidation or nonces for replay protection.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n     *\n     * Documentation for signature generation:\n     *\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n     */\n    function tryRecover(\n        bytes32 hash,\n        bytes memory signature\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            assembly (\"memory-safe\") {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            return tryRecover(hash, v, r, s);\n        } else {\n            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\n        }\n    }\n\n    /**\n     * @dev Variant of {tryRecover} that takes a signature in calldata\n     */\n    function tryRecoverCalldata(\n        bytes32 hash,\n        bytes calldata signature\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, calldata slices would work here, but are\n            // significantly more expensive (length check) than using calldataload in assembly.\n            assembly (\"memory-safe\") {\n                r := calldataload(signature.offset)\n                s := calldataload(add(signature.offset, 0x20))\n                v := byte(0, calldataload(add(signature.offset, 0x40)))\n            }\n            return tryRecover(hash, v, r, s);\n        } else {\n            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature`. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * NOTE: This function only supports 65-byte signatures. ERC-2098 short signatures are rejected. This restriction\n     * is DEPRECATED and will be removed in v6.0. Developers SHOULD NOT use signatures as unique identifiers; use hash\n     * invalidation or nonces for replay protection.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n     */\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n        (address recovered, RecoverError err, bytes32 errorArg) = tryRecover(hash, signature);\n        _throwError(err, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Variant of {recover} that takes a signature in calldata\n     */\n    function recoverCalldata(bytes32 hash, bytes calldata signature) internal pure returns (address) {\n        (address recovered, RecoverError err, bytes32 errorArg) = tryRecoverCalldata(hash, signature);\n        _throwError(err, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n     *\n     * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]\n     */\n    function tryRecover(\n        bytes32 hash,\n        bytes32 r,\n        bytes32 vs\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        unchecked {\n            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n            // We do not check for an overflow here since the shift operation results in 0 or 1.\n            uint8 v = uint8((uint256(vs) >> 255) + 27);\n            return tryRecover(hash, v, r, s);\n        }\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `r` and `vs` short-signature fields separately.\n     */\n    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n        (address recovered, RecoverError err, bytes32 errorArg) = tryRecover(hash, r, vs);\n        _throwError(err, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function tryRecover(\n        bytes32 hash,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n            return (address(0), RecoverError.InvalidSignatureS, s);\n        }\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(hash, v, r, s);\n        if (signer == address(0)) {\n            return (address(0), RecoverError.InvalidSignature, bytes32(0));\n        }\n\n        return (signer, RecoverError.NoError, bytes32(0));\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n        (address recovered, RecoverError err, bytes32 errorArg) = tryRecover(hash, v, r, s);\n        _throwError(err, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Parse a signature into its `v`, `r` and `s` components. Supports 65-byte and 64-byte (ERC-2098)\n     * formats. Returns (0,0,0) for invalid signatures.\n     *\n     * For 64-byte signatures, `v` is automatically normalized to 27 or 28.\n     * For 65-byte signatures, `v` is returned as-is and MUST already be 27 or 28 for use with ecrecover.\n     *\n     * Consider validating the result before use, or use {tryRecover}/{recover} which perform full validation.\n     */\n    function parse(bytes memory signature) internal pure returns (uint8 v, bytes32 r, bytes32 s) {\n        assembly (\"memory-safe\") {\n            // Check the signature length\n            switch mload(signature)\n            // - case 65: r,s,v signature (standard)\n            case 65 {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098)\n            case 64 {\n                let vs := mload(add(signature, 0x40))\n                r := mload(add(signature, 0x20))\n                s := and(vs, shr(1, not(0)))\n                v := add(shr(255, vs), 27)\n            }\n            default {\n                r := 0\n                s := 0\n                v := 0\n            }\n        }\n    }\n\n    /**\n     * @dev Variant of {parse} that takes a signature in calldata\n     */\n    function parseCalldata(bytes calldata signature) internal pure returns (uint8 v, bytes32 r, bytes32 s) {\n        assembly (\"memory-safe\") {\n            // Check the signature length\n            switch signature.length\n            // - case 65: r,s,v signature (standard)\n            case 65 {\n                r := calldataload(signature.offset)\n                s := calldataload(add(signature.offset, 0x20))\n                v := byte(0, calldataload(add(signature.offset, 0x40)))\n            }\n            // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098)\n            case 64 {\n                let vs := calldataload(add(signature.offset, 0x20))\n                r := calldataload(signature.offset)\n                s := and(vs, shr(1, not(0)))\n                v := add(shr(255, vs), 27)\n            }\n            default {\n                r := 0\n                s := 0\n                v := 0\n            }\n        }\n    }\n\n    /**\n     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n     */\n    function _throwError(RecoverError err, bytes32 errorArg) private pure {\n        if (err == RecoverError.NoError) {\n            return; // no error: do nothing\n        } else if (err == RecoverError.InvalidSignature) {\n            revert ECDSAInvalidSignature();\n        } else if (err == RecoverError.InvalidSignatureLength) {\n            revert ECDSAInvalidSignatureLength(uint256(errorArg));\n        } else if (err == RecoverError.InvalidSignatureS) {\n            revert ECDSAInvalidSignatureS(errorArg);\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/account/utils/EIP7702Utils.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.6.0) (account/utils/EIP7702Utils.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library with common EIP-7702 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-7702[EIP-7702].\n */\nlibrary EIP7702Utils {\n    bytes3 internal constant EIP7702_PREFIX = 0xef0100;\n\n    /**\n     * @dev Returns the address of the delegate if `account` has an EIP-7702 delegation setup, or address(0) otherwise.\n     */\n    function fetchDelegate(address account) internal view returns (address) {\n        bytes23 delegation = bytes23(account.code);\n        return bytes3(delegation) == EIP7702_PREFIX ? address(bytes20(delegation << 24)) : address(0);\n    }\n}\n"},"lib/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/EIP712Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.24;\n\nimport {MessageHashUtils} from \"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\";\nimport {IERC5267} from \"@openzeppelin/contracts/interfaces/IERC5267.sol\";\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: The upgradeable version of this contract does not use an immutable cache and recomputes the domain separator\n * each time {_domainSeparatorV4} is called. This is cheaper than accessing a cached version in cold storage.\n */\nabstract contract EIP712Upgradeable is Initializable, IERC5267 {\n    bytes32 private constant TYPE_HASH =\n        keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.EIP712\n    struct EIP712Storage {\n        bytes32 _hashedName;\n        bytes32 _hashedVersion;\n\n        string _name;\n        string _version;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.EIP712\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant EIP712StorageLocation = 0xa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100;\n\n    function _getEIP712Storage() private pure returns (EIP712Storage storage $) {\n        assembly {\n            $.slot := EIP712StorageLocation\n        }\n    }\n\n    /**\n     * @dev Initializes the domain separator and parameter caches.\n     *\n     * The meaning of `name` and `version` is specified in\n     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n     *\n     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n     * - `version`: the current major version of the signing domain.\n     *\n     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n     * contract upgrade].\n     */\n    function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n        __EIP712_init_unchained(name, version);\n    }\n\n    function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n        EIP712Storage storage $ = _getEIP712Storage();\n        $._name = name;\n        $._version = version;\n    }\n\n    /**\n     * @dev Returns the domain separator for the current chain.\n     */\n    function _domainSeparatorV4() internal view returns (bytes32) {\n        return _buildDomainSeparator();\n    }\n\n    function _buildDomainSeparator() private view returns (bytes32) {\n        return keccak256(abi.encode(TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this)));\n    }\n\n    /**\n     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n     * function returns the hash of the fully encoded EIP712 message for this domain.\n     *\n     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n     *\n     * ```solidity\n     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n     *     keccak256(\"Mail(address to,string contents)\"),\n     *     mailTo,\n     *     keccak256(bytes(mailContents))\n     * )));\n     * address signer = ECDSA.recover(digest, signature);\n     * ```\n     */\n    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n        return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n    }\n\n    /// @inheritdoc IERC5267\n    function eip712Domain()\n        public\n        view\n        virtual\n        returns (\n            bytes1 fields,\n            string memory name,\n            string memory version,\n            uint256 chainId,\n            address verifyingContract,\n            bytes32 salt,\n            uint256[] memory extensions\n        )\n    {\n        return (\n            hex\"0f\", // 01111\n            _EIP712Name(),\n            _EIP712Version(),\n            block.chainid,\n            address(this),\n            bytes32(0),\n            new uint256[](0)\n        );\n    }\n\n    /**\n     * @dev The name parameter for the EIP712 domain.\n     *\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n     * are a concern.\n     */\n    function _EIP712Name() internal view virtual returns (string memory) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        return $._name;\n    }\n\n    /**\n     * @dev The version parameter for the EIP712 domain.\n     *\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n     * are a concern.\n     */\n    function _EIP712Version() internal view virtual returns (string memory) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        return $._version;\n    }\n\n    /**\n     * @dev The hash of the name parameter for the EIP712 domain.\n     *\n     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead.\n     */\n    function _EIP712NameHash() internal view returns (bytes32) {\n        return keccak256(bytes(_EIP712Name()));\n    }\n\n    /**\n     * @dev The hash of the version parameter for the EIP712 domain.\n     *\n     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead.\n     */\n    function _EIP712VersionHash() internal view returns (bytes32) {\n        return keccak256(bytes(_EIP712Version()));\n    }\n}\n"},"lib/openzeppelin-contracts-upgradeable/contracts/utils/NoncesUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (utils/Nonces.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\n */\nabstract contract NoncesUpgradeable is Initializable {\n    /**\n     * @dev The nonce used for an `account` is not the expected current nonce.\n     */\n    error InvalidAccountNonce(address account, uint256 currentNonce);\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.Nonces\n    struct NoncesStorage {\n        mapping(address account => uint256) _nonces;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Nonces\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant NoncesStorageLocation = 0x5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb00;\n\n    function _getNoncesStorage() private pure returns (NoncesStorage storage $) {\n        assembly {\n            $.slot := NoncesStorageLocation\n        }\n    }\n\n    function __Nonces_init() internal onlyInitializing {\n    }\n\n    function __Nonces_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Returns the next unused nonce for an address.\n     */\n    function nonces(address owner) public view virtual returns (uint256) {\n        NoncesStorage storage $ = _getNoncesStorage();\n        return $._nonces[owner];\n    }\n\n    /**\n     * @dev Consumes a nonce.\n     *\n     * Returns the current value and increments nonce.\n     */\n    function _useNonce(address owner) internal virtual returns (uint256) {\n        NoncesStorage storage $ = _getNoncesStorage();\n        // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\n        // decremented or reset. This guarantees that the nonce never overflows.\n        unchecked {\n            // It is important to do x++ and not ++x here.\n            return $._nonces[owner]++;\n        }\n    }\n\n    /**\n     * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\n     */\n    function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\n        uint256 current = _useNonce(owner);\n        if (nonce != current) {\n            revert InvalidAccountNonce(owner, current);\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reinitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.\n     *\n     * NOTE: Consider following the ERC-7201 formula to derive storage locations.\n     */\n    function _initializableStorageSlot() internal pure virtual returns (bytes32) {\n        return INITIALIZABLE_STORAGE;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        bytes32 slot = _initializableStorageSlot();\n        assembly {\n            $.slot := slot\n        }\n    }\n}\n"},"lib/openzeppelin-contracts-upgradeable/contracts/utils/PausableUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Pausable\n    struct PausableStorage {\n        bool _paused;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Pausable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;\n\n    function _getPausableStorage() private pure returns (PausableStorage storage $) {\n        assembly {\n            $.slot := PausableStorageLocation\n        }\n    }\n\n    /**\n     * @dev Emitted when the pause is triggered by `account`.\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by `account`.\n     */\n    event Unpaused(address account);\n\n    /**\n     * @dev The operation failed because the contract is paused.\n     */\n    error EnforcedPause();\n\n    /**\n     * @dev The operation failed because the contract is not paused.\n     */\n    error ExpectedPause();\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    modifier whenNotPaused() {\n        _requireNotPaused();\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    modifier whenPaused() {\n        _requirePaused();\n        _;\n    }\n\n    function __Pausable_init() internal onlyInitializing {\n    }\n\n    function __Pausable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view virtual returns (bool) {\n        PausableStorage storage $ = _getPausableStorage();\n        return $._paused;\n    }\n\n    /**\n     * @dev Throws if the contract is paused.\n     */\n    function _requireNotPaused() internal view virtual {\n        if (paused()) {\n            revert EnforcedPause();\n        }\n    }\n\n    /**\n     * @dev Throws if the contract is not paused.\n     */\n    function _requirePaused() internal view virtual {\n        if (!paused()) {\n            revert ExpectedPause();\n        }\n    }\n\n    /**\n     * @dev Triggers stopped state.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    function _pause() internal virtual whenNotPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = true;\n        emit Paused(_msgSender());\n    }\n\n    /**\n     * @dev Returns to normal state.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    function _unpause() internal virtual whenPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = false;\n        emit Unpaused(_msgSender());\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/access/extensions/IAccessControlEnumerable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (access/extensions/IAccessControlEnumerable.sol)\n\npragma solidity >=0.8.4;\n\nimport {IAccessControl} from \"../IAccessControl.sol\";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC-165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n    /**\n     * @dev Returns one of the accounts that have `role`. `index` must be a\n     * value between 0 and {getRoleMemberCount}, non-inclusive.\n     *\n     * Role bearers are not sorted in any particular way, and their ordering may\n     * change at any point.\n     *\n     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n     * you perform all queries on the same block. See the following\n     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n     * for more information.\n     */\n    function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n    /**\n     * @dev Returns the number of accounts that have `role`. Can be used\n     * together with {getRoleMember} to enumerate all bearers of a role.\n     */\n    function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n"},"lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.24;\n\nimport {Arrays} from \"../Arrays.sol\";\nimport {Math} from \"../math/Math.sol\";\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n * - Set can be cleared (all elements removed) in O(n).\n *\n * ```solidity\n * contract Example {\n *     // Add the library methods\n *     using EnumerableSet for EnumerableSet.AddressSet;\n *\n *     // Declare a set state variable\n *     EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * The following types are supported:\n *\n * - `bytes32` (`Bytes32Set`) since v3.3.0\n * - `address` (`AddressSet`) since v3.3.0\n * - `uint256` (`UintSet`) since v3.3.0\n * - `string` (`StringSet`) since v5.4.0\n * - `bytes` (`BytesSet`) since v5.4.0\n * - `bytes4` (`Bytes4Set`) since v5.6.0\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n    // To implement this library for multiple types with as little code\n    // repetition as possible, we write it in terms of a generic Set type with\n    // bytes32 values.\n    // The Set implementation uses private functions, and user-facing\n    // implementations (such as AddressSet) are just wrappers around the\n    // underlying Set.\n    // This means that we can only create new EnumerableSets for types that fit\n    // in bytes32.\n\n    struct Set {\n        // Storage of set values\n        bytes32[] _values;\n        // Position is the index of the value in the `values` array plus 1.\n        // Position 0 is used to mean a value is not in the set.\n        mapping(bytes32 value => uint256) _positions;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function _add(Set storage set, bytes32 value) private returns (bool) {\n        if (!_contains(set, value)) {\n            set._values.push(value);\n            // The value is stored at length-1, but we add 1 to all indexes\n            // and use 0 as a sentinel value\n            set._positions[value] = set._values.length;\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function _remove(Set storage set, bytes32 value) private returns (bool) {\n        // We cache the value's position to prevent multiple reads from the same storage slot\n        uint256 position = set._positions[value];\n\n        if (position != 0) {\n            // Equivalent to contains(set, value)\n            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n            // the array, and then remove the last element (sometimes called as 'swap and pop').\n            // This modifies the order of the array, as noted in {at}.\n\n            uint256 valueIndex = position - 1;\n            uint256 lastIndex = set._values.length - 1;\n\n            if (valueIndex != lastIndex) {\n                bytes32 lastValue = set._values[lastIndex];\n\n                // Move the lastValue to the index where the value to delete is\n                set._values[valueIndex] = lastValue;\n                // Update the tracked position of the lastValue (that was just moved)\n                set._positions[lastValue] = position;\n            }\n\n            // Delete the slot where the moved value was stored\n            set._values.pop();\n\n            // Delete the tracked position for the deleted slot\n            delete set._positions[value];\n\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes all the values from a set. O(n).\n     *\n     * WARNING: This function has an unbounded cost that scales with set size. Developers should keep in mind that\n     * using it may render the function uncallable if the set grows to the point where clearing it consumes too much\n     * gas to fit in a block.\n     */\n    function _clear(Set storage set) private {\n        uint256 len = _length(set);\n        for (uint256 i = 0; i < len; ++i) {\n            delete set._positions[set._values[i]];\n        }\n        Arrays.unsafeSetLength(set._values, 0);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function _contains(Set storage set, bytes32 value) private view returns (bool) {\n        return set._positions[value] != 0;\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function _length(Set storage set) private view returns (uint256) {\n        return set._values.length;\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function _pos(Set storage set, uint256 index) private view returns (bytes32) {\n        return set._values[index];\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function _values(Set storage set) private view returns (bytes32[] memory) {\n        return set._values;\n    }\n\n    /**\n     * @dev Return a slice of the set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function _values(Set storage set, uint256 start, uint256 end) private view returns (bytes32[] memory) {\n        unchecked {\n            end = Math.min(end, _length(set));\n            start = Math.min(start, end);\n\n            uint256 len = end - start;\n            bytes32[] memory result = new bytes32[](len);\n            for (uint256 i = 0; i < len; ++i) {\n                result[i] = Arrays.unsafeAccess(set._values, start + i).value;\n            }\n            return result;\n        }\n    }\n\n    // Bytes32Set\n\n    struct Bytes32Set {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _add(set._inner, value);\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _remove(set._inner, value);\n    }\n\n    /**\n     * @dev Removes all the values from a set. O(n).\n     *\n     * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n     * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n     */\n    function clear(Bytes32Set storage set) internal {\n        _clear(set._inner);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n        return _contains(set._inner, value);\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(Bytes32Set storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     *\n     * IMPORTANT: Deprecated. This function's name clashes with a keyword scheduled for inclusion in Solidity. Developers\n     * should use {pos} instead.\n     */\n    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n        return pos(set, index);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     *\n     * Replacement of the deprecated {at} function.\n     */\n    function pos(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n        return _pos(set._inner, index);\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        bytes32[] memory result;\n\n        assembly (\"memory-safe\") {\n            result := store\n        }\n\n        return result;\n    }\n\n    /**\n     * @dev Return a slice of the set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(Bytes32Set storage set, uint256 start, uint256 end) internal view returns (bytes32[] memory) {\n        bytes32[] memory store = _values(set._inner, start, end);\n        bytes32[] memory result;\n\n        assembly (\"memory-safe\") {\n            result := store\n        }\n\n        return result;\n    }\n\n    // Bytes4Set\n\n    struct Bytes4Set {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(Bytes4Set storage set, bytes4 value) internal returns (bool) {\n        return _add(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(Bytes4Set storage set, bytes4 value) internal returns (bool) {\n        return _remove(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Removes all the values from a set. O(n).\n     *\n     * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n     * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n     */\n    function clear(Bytes4Set storage set) internal {\n        _clear(set._inner);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(Bytes4Set storage set, bytes4 value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(Bytes4Set storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     *\n     * IMPORTANT: Deprecated. This function's name clashes with a keyword scheduled for inclusion in Solidity. Developers\n     * should use {pos} instead.\n     */\n    function at(Bytes4Set storage set, uint256 index) internal view returns (bytes4) {\n        return pos(set, index);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     *\n     * Replacement of the deprecated {at} function.\n     */\n    function pos(Bytes4Set storage set, uint256 index) internal view returns (bytes4) {\n        return bytes4(_pos(set._inner, index));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(Bytes4Set storage set) internal view returns (bytes4[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        bytes4[] memory result;\n\n        assembly (\"memory-safe\") {\n            result := store\n        }\n\n        return result;\n    }\n\n    /**\n     * @dev Return a slice of the set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(Bytes4Set storage set, uint256 start, uint256 end) internal view returns (bytes4[] memory) {\n        bytes32[] memory store = _values(set._inner, start, end);\n        bytes4[] memory result;\n\n        assembly (\"memory-safe\") {\n            result := store\n        }\n\n        return result;\n    }\n\n    // AddressSet\n\n    struct AddressSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(AddressSet storage set, address value) internal returns (bool) {\n        return _add(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(AddressSet storage set, address value) internal returns (bool) {\n        return _remove(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Removes all the values from a set. O(n).\n     *\n     * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n     * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n     */\n    function clear(AddressSet storage set) internal {\n        _clear(set._inner);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(AddressSet storage set, address value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(AddressSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     *\n     * IMPORTANT: Deprecated. This function's name clashes with a keyword scheduled for inclusion in Solidity. Developers\n     * should use {pos} instead.\n     */\n    function at(AddressSet storage set, uint256 index) internal view returns (address) {\n        return pos(set, index);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     *\n     * Replacement of the deprecated {at} function.\n     */\n    function pos(AddressSet storage set, uint256 index) internal view returns (address) {\n        return address(uint160(uint256(_pos(set._inner, index))));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(AddressSet storage set) internal view returns (address[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        address[] memory result;\n\n        assembly (\"memory-safe\") {\n            result := store\n        }\n\n        return result;\n    }\n\n    /**\n     * @dev Return a slice of the set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(AddressSet storage set, uint256 start, uint256 end) internal view returns (address[] memory) {\n        bytes32[] memory store = _values(set._inner, start, end);\n        address[] memory result;\n\n        assembly (\"memory-safe\") {\n            result := store\n        }\n\n        return result;\n    }\n\n    // UintSet\n\n    struct UintSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(UintSet storage set, uint256 value) internal returns (bool) {\n        return _add(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(UintSet storage set, uint256 value) internal returns (bool) {\n        return _remove(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Removes all the values from a set. O(n).\n     *\n     * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n     * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n     */\n    function clear(UintSet storage set) internal {\n        _clear(set._inner);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(UintSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     *\n     * IMPORTANT: Deprecated. This function's name clashes with a keyword scheduled for inclusion in Solidity. Developers\n     * should use {pos} instead.\n     */\n    function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n        return pos(set, index);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     *\n     * Replacement of the deprecated {at} function.\n     */\n    function pos(UintSet storage set, uint256 index) internal view returns (uint256) {\n        return uint256(_pos(set._inner, index));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(UintSet storage set) internal view returns (uint256[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        uint256[] memory result;\n\n        assembly (\"memory-safe\") {\n            result := store\n        }\n\n        return result;\n    }\n\n    /**\n     * @dev Return a slice of the set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(UintSet storage set, uint256 start, uint256 end) internal view returns (uint256[] memory) {\n        bytes32[] memory store = _values(set._inner, start, end);\n        uint256[] memory result;\n\n        assembly (\"memory-safe\") {\n            result := store\n        }\n\n        return result;\n    }\n\n    struct StringSet {\n        // Storage of set values\n        string[] _values;\n        // Position is the index of the value in the `values` array plus 1.\n        // Position 0 is used to mean a value is not in the set.\n        mapping(string value => uint256) _positions;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(StringSet storage set, string memory value) internal returns (bool) {\n        if (!contains(set, value)) {\n            set._values.push(value);\n            // The value is stored at length-1, but we add 1 to all indexes\n            // and use 0 as a sentinel value\n            set._positions[value] = set._values.length;\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(StringSet storage set, string memory value) internal returns (bool) {\n        // We cache the value's position to prevent multiple reads from the same storage slot\n        uint256 position = set._positions[value];\n\n        if (position != 0) {\n            // Equivalent to contains(set, value)\n            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n            // the array, and then remove the last element (sometimes called as 'swap and pop').\n            // This modifies the order of the array, as noted in {at}.\n\n            uint256 valueIndex = position - 1;\n            uint256 lastIndex = set._values.length - 1;\n\n            if (valueIndex != lastIndex) {\n                string memory lastValue = set._values[lastIndex];\n\n                // Move the lastValue to the index where the value to delete is\n                set._values[valueIndex] = lastValue;\n                // Update the tracked position of the lastValue (that was just moved)\n                set._positions[lastValue] = position;\n            }\n\n            // Delete the slot where the moved value was stored\n            set._values.pop();\n\n            // Delete the tracked position for the deleted slot\n            delete set._positions[value];\n\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes all the values from a set. O(n).\n     *\n     * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n     * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n     */\n    function clear(StringSet storage set) internal {\n        uint256 len = length(set);\n        for (uint256 i = 0; i < len; ++i) {\n            delete set._positions[set._values[i]];\n        }\n        Arrays.unsafeSetLength(set._values, 0);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(StringSet storage set, string memory value) internal view returns (bool) {\n        return set._positions[value] != 0;\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function length(StringSet storage set) internal view returns (uint256) {\n        return set._values.length;\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     *\n     * IMPORTANT: Deprecated. This function's name clashes with a keyword scheduled for inclusion in Solidity. Developers\n     * should use {pos} instead.\n     */\n    function at(StringSet storage set, uint256 index) internal view returns (string memory) {\n        return pos(set, index);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     *\n     * Replacement of the deprecated {at} function.\n     */\n    function pos(StringSet storage set, uint256 index) internal view returns (string memory) {\n        return set._values[index];\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(StringSet storage set) internal view returns (string[] memory) {\n        return set._values;\n    }\n\n    /**\n     * @dev Return a slice of the set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(StringSet storage set, uint256 start, uint256 end) internal view returns (string[] memory) {\n        unchecked {\n            end = Math.min(end, length(set));\n            start = Math.min(start, end);\n\n            uint256 len = end - start;\n            string[] memory result = new string[](len);\n            for (uint256 i = 0; i < len; ++i) {\n                result[i] = Arrays.unsafeAccess(set._values, start + i).value;\n            }\n            return result;\n        }\n    }\n\n    struct BytesSet {\n        // Storage of set values\n        bytes[] _values;\n        // Position is the index of the value in the `values` array plus 1.\n        // Position 0 is used to mean a value is not in the set.\n        mapping(bytes value => uint256) _positions;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(BytesSet storage set, bytes memory value) internal returns (bool) {\n        if (!contains(set, value)) {\n            set._values.push(value);\n            // The value is stored at length-1, but we add 1 to all indexes\n            // and use 0 as a sentinel value\n            set._positions[value] = set._values.length;\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(BytesSet storage set, bytes memory value) internal returns (bool) {\n        // We cache the value's position to prevent multiple reads from the same storage slot\n        uint256 position = set._positions[value];\n\n        if (position != 0) {\n            // Equivalent to contains(set, value)\n            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n            // the array, and then remove the last element (sometimes called as 'swap and pop').\n            // This modifies the order of the array, as noted in {at}.\n\n            uint256 valueIndex = position - 1;\n            uint256 lastIndex = set._values.length - 1;\n\n            if (valueIndex != lastIndex) {\n                bytes memory lastValue = set._values[lastIndex];\n\n                // Move the lastValue to the index where the value to delete is\n                set._values[valueIndex] = lastValue;\n                // Update the tracked position of the lastValue (that was just moved)\n                set._positions[lastValue] = position;\n            }\n\n            // Delete the slot where the moved value was stored\n            set._values.pop();\n\n            // Delete the tracked position for the deleted slot\n            delete set._positions[value];\n\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes all the values from a set. O(n).\n     *\n     * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n     * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n     */\n    function clear(BytesSet storage set) internal {\n        uint256 len = length(set);\n        for (uint256 i = 0; i < len; ++i) {\n            delete set._positions[set._values[i]];\n        }\n        Arrays.unsafeSetLength(set._values, 0);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(BytesSet storage set, bytes memory value) internal view returns (bool) {\n        return set._positions[value] != 0;\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function length(BytesSet storage set) internal view returns (uint256) {\n        return set._values.length;\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     *\n     * IMPORTANT: Deprecated. This function's name clashes with a keyword scheduled for inclusion in Solidity. Developers\n     * should use {pos} instead.\n     */\n    function at(BytesSet storage set, uint256 index) internal view returns (bytes memory) {\n        return pos(set, index);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     *\n     * Replacement of the deprecated {at} function.\n     */\n    function pos(BytesSet storage set, uint256 index) internal view returns (bytes memory) {\n        return set._values[index];\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(BytesSet storage set) internal view returns (bytes[] memory) {\n        return set._values;\n    }\n\n    /**\n     * @dev Return a slice of the set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(BytesSet storage set, uint256 start, uint256 end) internal view returns (bytes[] memory) {\n        unchecked {\n            end = Math.min(end, length(set));\n            start = Math.min(start, end);\n\n            uint256 len = end - start;\n            bytes[] memory result = new bytes[](len);\n            for (uint256 i = 0; i < len; ++i) {\n                result[i] = Arrays.unsafeAccess(set._values, start + i).value;\n            }\n            return result;\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"},"lib/openzeppelin-contracts/contracts/proxy/utils/UUPSUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.22;\n\nimport {IERC1822Proxiable} from \"../../interfaces/draft-IERC1822.sol\";\nimport {ERC1967Utils} from \"../ERC1967/ERC1967Utils.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * @custom:stateless\n */\nabstract contract UUPSUpgradeable is IERC1822Proxiable {\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n    address private immutable __self = address(this);\n\n    /**\n     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\n     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\n     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\n     * If the getter returns `\"5.0.0\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\n     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\n     * during an upgrade.\n     */\n    string public constant UPGRADE_INTERFACE_VERSION = \"5.0.0\";\n\n    /**\n     * @dev The call is from an unauthorized context.\n     */\n    error UUPSUnauthorizedCallContext();\n\n    /**\n     * @dev The storage `slot` is unsupported as a UUID.\n     */\n    error UUPSUnsupportedProxiableUUID(bytes32 slot);\n\n    /**\n     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n     * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case\n     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n     * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n     * fail.\n     */\n    modifier onlyProxy() {\n        _checkProxy();\n        _;\n    }\n\n    /**\n     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n     * callable on the implementing contract but not through proxies.\n     */\n    modifier notDelegated() {\n        _checkNotDelegated();\n        _;\n    }\n\n    /**\n     * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the\n     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n     */\n    function proxiableUUID() external view notDelegated returns (bytes32) {\n        return ERC1967Utils.IMPLEMENTATION_SLOT;\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n     * encoded in `data`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     *\n     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, data);\n    }\n\n    /**\n     * @dev Reverts if the execution is not performed via delegatecall or the execution\n     * context is not of a proxy with an ERC-1967 compliant implementation pointing to self.\n     */\n    function _checkProxy() internal view virtual {\n        if (\n            address(this) == __self || // Must be called through delegatecall\n            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\n        ) {\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Reverts if the execution is performed via delegatecall.\n     * See {notDelegated}.\n     */\n    function _checkNotDelegated() internal view virtual {\n        if (address(this) != __self) {\n            // Must not be called through delegatecall\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeToAndCall}.\n     *\n     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n     *\n     * ```solidity\n     * function _authorizeUpgrade(address) internal onlyOwner {}\n     * ```\n     */\n    function _authorizeUpgrade(address newImplementation) internal virtual;\n\n    /**\n     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\n     *\n     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\n     * is expected to be the implementation slot in ERC-1967.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\n        try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n            if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\n                revert UUPSUnsupportedProxiableUUID(slot);\n            }\n            ERC1967Utils.upgradeToAndCall(newImplementation, data);\n        } catch {\n            // The implementation is not UUPS\n            revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\n        }\n    }\n}\n"},"lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (interfaces/draft-IERC6093.sol)\n\npragma solidity >=0.8.4;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-721.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"},"lib/openzeppelin-contracts/contracts/access/extensions/IAccessControlDefaultAdminRules.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.6.0) (access/extensions/IAccessControlDefaultAdminRules.sol)\n\npragma solidity >=0.8.4;\n\nimport {IAccessControl} from \"../IAccessControl.sol\";\n\n/**\n * @dev External interface of AccessControlDefaultAdminRules declared to support ERC-165 detection.\n */\ninterface IAccessControlDefaultAdminRules is IAccessControl {\n    /**\n     * @dev The new default admin is not a valid default admin.\n     */\n    error AccessControlInvalidDefaultAdmin(address defaultAdmin);\n\n    /**\n     * @dev At least one of the following rules was violated:\n     *\n     * - The `DEFAULT_ADMIN_ROLE` must only be managed by itself.\n     * - The `DEFAULT_ADMIN_ROLE` must only be held by one account at the time.\n     * - Any `DEFAULT_ADMIN_ROLE` transfer must be in two delayed steps.\n     */\n    error AccessControlEnforcedDefaultAdminRules();\n\n    /**\n     * @dev The delay for transferring the default admin delay is enforced and\n     * the operation must wait until `schedule`.\n     *\n     * NOTE: `schedule` can be 0 indicating there's no transfer scheduled.\n     */\n    error AccessControlEnforcedDefaultAdminDelay(uint48 schedule);\n\n    /**\n     * @dev Emitted when a {defaultAdmin} transfer is started, setting `newAdmin` as the next\n     * address to become the {defaultAdmin} by calling {acceptDefaultAdminTransfer} only after `acceptSchedule`\n     * passes.\n     */\n    event DefaultAdminTransferScheduled(address indexed newAdmin, uint48 acceptSchedule);\n\n    /**\n     * @dev Emitted when a {pendingDefaultAdmin} is reset if it was never accepted, regardless of its schedule.\n     */\n    event DefaultAdminTransferCanceled();\n\n    /**\n     * @dev Emitted when a {defaultAdminDelay} change is started, setting `newDelay` as the next\n     * delay to be applied between default admin transfer after `effectSchedule` has passed.\n     */\n    event DefaultAdminDelayChangeScheduled(uint48 newDelay, uint48 effectSchedule);\n\n    /**\n     * @dev Emitted when a {pendingDefaultAdminDelay} is reset if its schedule didn't pass.\n     */\n    event DefaultAdminDelayChangeCanceled();\n\n    /**\n     * @dev Returns the address of the current `DEFAULT_ADMIN_ROLE` holder.\n     */\n    function defaultAdmin() external view returns (address);\n\n    /**\n     * @dev Returns a tuple of a `newAdmin` and an accept schedule.\n     *\n     * After the `schedule` passes, the `newAdmin` will be able to accept the {defaultAdmin} role\n     * by calling {acceptDefaultAdminTransfer}, completing the role transfer.\n     *\n     * A zero value only in `acceptSchedule` indicates no pending admin transfer.\n     *\n     * NOTE: A zero address `newAdmin` means that {defaultAdmin} is being renounced.\n     */\n    function pendingDefaultAdmin() external view returns (address newAdmin, uint48 acceptSchedule);\n\n    /**\n     * @dev Returns the delay required to schedule the acceptance of a {defaultAdmin} transfer started.\n     *\n     * This delay will be added to the current timestamp when calling {beginDefaultAdminTransfer} to set\n     * the acceptance schedule.\n     *\n     * NOTE: If a delay change has been scheduled, it will take effect as soon as the schedule passes, making this\n     * function returns the new delay. See {changeDefaultAdminDelay}.\n     */\n    function defaultAdminDelay() external view returns (uint48);\n\n    /**\n     * @dev Returns a tuple of `newDelay` and an effect schedule.\n     *\n     * After the `schedule` passes, the `newDelay` will get into effect immediately for every\n     * new {defaultAdmin} transfer started with {beginDefaultAdminTransfer}.\n     *\n     * A zero value only in `effectSchedule` indicates no pending delay change.\n     *\n     * NOTE: A zero value only for `newDelay` means that the next {defaultAdminDelay}\n     * will be zero after the effect schedule.\n     */\n    function pendingDefaultAdminDelay() external view returns (uint48 newDelay, uint48 effectSchedule);\n\n    /**\n     * @dev Starts a {defaultAdmin} transfer by setting a {pendingDefaultAdmin} scheduled for acceptance\n     * after the current timestamp plus a {defaultAdminDelay}.\n     *\n     * Requirements:\n     *\n     * - Only can be called by the current {defaultAdmin}.\n     *\n     * Emits a {DefaultAdminTransferScheduled} event.\n     */\n    function beginDefaultAdminTransfer(address newAdmin) external;\n\n    /**\n     * @dev Cancels a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}.\n     *\n     * A {pendingDefaultAdmin} not yet accepted can also be cancelled with this function.\n     *\n     * Requirements:\n     *\n     * - Only can be called by the current {defaultAdmin}.\n     *\n     * May emit a {DefaultAdminTransferCanceled} event.\n     */\n    function cancelDefaultAdminTransfer() external;\n\n    /**\n     * @dev Completes a {defaultAdmin} transfer previously started with {beginDefaultAdminTransfer}.\n     *\n     * After calling the function:\n     *\n     * - `DEFAULT_ADMIN_ROLE` should be granted to the caller.\n     * - `DEFAULT_ADMIN_ROLE` should be revoked from the previous holder.\n     * - {pendingDefaultAdmin} should be reset to zero values.\n     *\n     * Requirements:\n     *\n     * - Only can be called by the {pendingDefaultAdmin}'s `newAdmin`.\n     * - The {pendingDefaultAdmin}'s `acceptSchedule` should've passed.\n     */\n    function acceptDefaultAdminTransfer() external;\n\n    /**\n     * @dev Initiates a {defaultAdminDelay} update by setting a {pendingDefaultAdminDelay} scheduled for getting\n     * into effect after the current timestamp plus a {defaultAdminDelay}.\n     *\n     * This function guarantees that any call to {beginDefaultAdminTransfer} done between the timestamp this\n     * method is called and the {pendingDefaultAdminDelay} effect schedule will use the current {defaultAdminDelay}\n     * set before calling.\n     *\n     * The {pendingDefaultAdminDelay}'s effect schedule is defined in a way that waiting until the schedule and then\n     * calling {beginDefaultAdminTransfer} with the new delay will take at least the same as another {defaultAdmin}\n     * complete transfer (including acceptance).\n     *\n     * The schedule is designed for two scenarios:\n     *\n     * - When the delay is changed for a larger one the schedule is `block.timestamp + newDelay` capped by\n     * {defaultAdminDelayIncreaseWait}.\n     * - When the delay is changed for a shorter one, the schedule is `block.timestamp + (current delay - new delay)`.\n     *\n     * A {pendingDefaultAdminDelay} that never got into effect will be canceled in favor of a new scheduled change.\n     *\n     * Requirements:\n     *\n     * - Only can be called by the current {defaultAdmin}.\n     *\n     * Emits a {DefaultAdminDelayChangeScheduled} event and may emit a {DefaultAdminDelayChangeCanceled} event.\n     */\n    function changeDefaultAdminDelay(uint48 newDelay) external;\n\n    /**\n     * @dev Cancels a scheduled {defaultAdminDelay} change.\n     *\n     * Requirements:\n     *\n     * - Only can be called by the current {defaultAdmin}.\n     *\n     * May emit a {DefaultAdminDelayChangeCanceled} event.\n     */\n    function rollbackDefaultAdminDelay() external;\n\n    /**\n     * @dev Maximum time in seconds for an increase to {defaultAdminDelay} (that is scheduled using {changeDefaultAdminDelay})\n     * to take effect. Default to 5 days.\n     *\n     * When the {defaultAdminDelay} is scheduled to be increased, it goes into effect after the new delay has passed with\n     * the purpose of giving enough time for reverting any accidental change (i.e. using milliseconds instead of seconds)\n     * that may lock the contract. However, to avoid excessive schedules, the wait is capped by this function and it can\n     * be overridden for a custom {defaultAdminDelay} increase scheduling.\n     *\n     * IMPORTANT: Make sure to add a reasonable amount of time while overriding this value, otherwise,\n     * there's a risk of setting a high new delay that goes into effect almost immediately without the\n     * possibility of human intervention in the case of an input error (eg. set milliseconds instead of seconds).\n     */\n    function defaultAdminDelayIncreaseWait() external view returns (uint48);\n}\n"},"lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.6.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n    /**\n     * @dev Value doesn't fit in a uint of `bits` size.\n     */\n    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n    /**\n     * @dev An int value doesn't fit in a uint of `bits` size.\n     */\n    error SafeCastOverflowedIntToUint(int256 value);\n\n    /**\n     * @dev Value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n    /**\n     * @dev A uint value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedUintToInt(uint256 value);\n\n    /**\n     * @dev Returns the downcasted uint248 from uint256, reverting on\n     * overflow (when the input is greater than largest uint248).\n     *\n     * Counterpart to Solidity's `uint248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toUint248(uint256 value) internal pure returns (uint248) {\n        if (value > type(uint248).max) {\n            revert SafeCastOverflowedUintDowncast(248, value);\n        }\n        return uint248(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint240 from uint256, reverting on\n     * overflow (when the input is greater than largest uint240).\n     *\n     * Counterpart to Solidity's `uint240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toUint240(uint256 value) internal pure returns (uint240) {\n        if (value > type(uint240).max) {\n            revert SafeCastOverflowedUintDowncast(240, value);\n        }\n        return uint240(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint232 from uint256, reverting on\n     * overflow (when the input is greater than largest uint232).\n     *\n     * Counterpart to Solidity's `uint232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toUint232(uint256 value) internal pure returns (uint232) {\n        if (value > type(uint232).max) {\n            revert SafeCastOverflowedUintDowncast(232, value);\n        }\n        return uint232(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint224 from uint256, reverting on\n     * overflow (when the input is greater than largest uint224).\n     *\n     * Counterpart to Solidity's `uint224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toUint224(uint256 value) internal pure returns (uint224) {\n        if (value > type(uint224).max) {\n            revert SafeCastOverflowedUintDowncast(224, value);\n        }\n        return uint224(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint216 from uint256, reverting on\n     * overflow (when the input is greater than largest uint216).\n     *\n     * Counterpart to Solidity's `uint216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toUint216(uint256 value) internal pure returns (uint216) {\n        if (value > type(uint216).max) {\n            revert SafeCastOverflowedUintDowncast(216, value);\n        }\n        return uint216(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint208 from uint256, reverting on\n     * overflow (when the input is greater than largest uint208).\n     *\n     * Counterpart to Solidity's `uint208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toUint208(uint256 value) internal pure returns (uint208) {\n        if (value > type(uint208).max) {\n            revert SafeCastOverflowedUintDowncast(208, value);\n        }\n        return uint208(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint200 from uint256, reverting on\n     * overflow (when the input is greater than largest uint200).\n     *\n     * Counterpart to Solidity's `uint200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toUint200(uint256 value) internal pure returns (uint200) {\n        if (value > type(uint200).max) {\n            revert SafeCastOverflowedUintDowncast(200, value);\n        }\n        return uint200(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint192 from uint256, reverting on\n     * overflow (when the input is greater than largest uint192).\n     *\n     * Counterpart to Solidity's `uint192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toUint192(uint256 value) internal pure returns (uint192) {\n        if (value > type(uint192).max) {\n            revert SafeCastOverflowedUintDowncast(192, value);\n        }\n        return uint192(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint184 from uint256, reverting on\n     * overflow (when the input is greater than largest uint184).\n     *\n     * Counterpart to Solidity's `uint184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toUint184(uint256 value) internal pure returns (uint184) {\n        if (value > type(uint184).max) {\n            revert SafeCastOverflowedUintDowncast(184, value);\n        }\n        return uint184(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint176 from uint256, reverting on\n     * overflow (when the input is greater than largest uint176).\n     *\n     * Counterpart to Solidity's `uint176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toUint176(uint256 value) internal pure returns (uint176) {\n        if (value > type(uint176).max) {\n            revert SafeCastOverflowedUintDowncast(176, value);\n        }\n        return uint176(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint168 from uint256, reverting on\n     * overflow (when the input is greater than largest uint168).\n     *\n     * Counterpart to Solidity's `uint168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toUint168(uint256 value) internal pure returns (uint168) {\n        if (value > type(uint168).max) {\n            revert SafeCastOverflowedUintDowncast(168, value);\n        }\n        return uint168(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint160 from uint256, reverting on\n     * overflow (when the input is greater than largest uint160).\n     *\n     * Counterpart to Solidity's `uint160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toUint160(uint256 value) internal pure returns (uint160) {\n        if (value > type(uint160).max) {\n            revert SafeCastOverflowedUintDowncast(160, value);\n        }\n        return uint160(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint152 from uint256, reverting on\n     * overflow (when the input is greater than largest uint152).\n     *\n     * Counterpart to Solidity's `uint152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toUint152(uint256 value) internal pure returns (uint152) {\n        if (value > type(uint152).max) {\n            revert SafeCastOverflowedUintDowncast(152, value);\n        }\n        return uint152(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint144 from uint256, reverting on\n     * overflow (when the input is greater than largest uint144).\n     *\n     * Counterpart to Solidity's `uint144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toUint144(uint256 value) internal pure returns (uint144) {\n        if (value > type(uint144).max) {\n            revert SafeCastOverflowedUintDowncast(144, value);\n        }\n        return uint144(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint136 from uint256, reverting on\n     * overflow (when the input is greater than largest uint136).\n     *\n     * Counterpart to Solidity's `uint136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toUint136(uint256 value) internal pure returns (uint136) {\n        if (value > type(uint136).max) {\n            revert SafeCastOverflowedUintDowncast(136, value);\n        }\n        return uint136(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint128 from uint256, reverting on\n     * overflow (when the input is greater than largest uint128).\n     *\n     * Counterpart to Solidity's `uint128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toUint128(uint256 value) internal pure returns (uint128) {\n        if (value > type(uint128).max) {\n            revert SafeCastOverflowedUintDowncast(128, value);\n        }\n        return uint128(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint120 from uint256, reverting on\n     * overflow (when the input is greater than largest uint120).\n     *\n     * Counterpart to Solidity's `uint120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toUint120(uint256 value) internal pure returns (uint120) {\n        if (value > type(uint120).max) {\n            revert SafeCastOverflowedUintDowncast(120, value);\n        }\n        return uint120(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint112 from uint256, reverting on\n     * overflow (when the input is greater than largest uint112).\n     *\n     * Counterpart to Solidity's `uint112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toUint112(uint256 value) internal pure returns (uint112) {\n        if (value > type(uint112).max) {\n            revert SafeCastOverflowedUintDowncast(112, value);\n        }\n        return uint112(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint104 from uint256, reverting on\n     * overflow (when the input is greater than largest uint104).\n     *\n     * Counterpart to Solidity's `uint104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toUint104(uint256 value) internal pure returns (uint104) {\n        if (value > type(uint104).max) {\n            revert SafeCastOverflowedUintDowncast(104, value);\n        }\n        return uint104(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint96 from uint256, reverting on\n     * overflow (when the input is greater than largest uint96).\n     *\n     * Counterpart to Solidity's `uint96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toUint96(uint256 value) internal pure returns (uint96) {\n        if (value > type(uint96).max) {\n            revert SafeCastOverflowedUintDowncast(96, value);\n        }\n        return uint96(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint88 from uint256, reverting on\n     * overflow (when the input is greater than largest uint88).\n     *\n     * Counterpart to Solidity's `uint88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toUint88(uint256 value) internal pure returns (uint88) {\n        if (value > type(uint88).max) {\n            revert SafeCastOverflowedUintDowncast(88, value);\n        }\n        return uint88(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint80 from uint256, reverting on\n     * overflow (when the input is greater than largest uint80).\n     *\n     * Counterpart to Solidity's `uint80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toUint80(uint256 value) internal pure returns (uint80) {\n        if (value > type(uint80).max) {\n            revert SafeCastOverflowedUintDowncast(80, value);\n        }\n        return uint80(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint72 from uint256, reverting on\n     * overflow (when the input is greater than largest uint72).\n     *\n     * Counterpart to Solidity's `uint72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toUint72(uint256 value) internal pure returns (uint72) {\n        if (value > type(uint72).max) {\n            revert SafeCastOverflowedUintDowncast(72, value);\n        }\n        return uint72(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint64 from uint256, reverting on\n     * overflow (when the input is greater than largest uint64).\n     *\n     * Counterpart to Solidity's `uint64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toUint64(uint256 value) internal pure returns (uint64) {\n        if (value > type(uint64).max) {\n            revert SafeCastOverflowedUintDowncast(64, value);\n        }\n        return uint64(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint56 from uint256, reverting on\n     * overflow (when the input is greater than largest uint56).\n     *\n     * Counterpart to Solidity's `uint56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toUint56(uint256 value) internal pure returns (uint56) {\n        if (value > type(uint56).max) {\n            revert SafeCastOverflowedUintDowncast(56, value);\n        }\n        return uint56(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint48 from uint256, reverting on\n     * overflow (when the input is greater than largest uint48).\n     *\n     * Counterpart to Solidity's `uint48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toUint48(uint256 value) internal pure returns (uint48) {\n        if (value > type(uint48).max) {\n            revert SafeCastOverflowedUintDowncast(48, value);\n        }\n        return uint48(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint40 from uint256, reverting on\n     * overflow (when the input is greater than largest uint40).\n     *\n     * Counterpart to Solidity's `uint40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toUint40(uint256 value) internal pure returns (uint40) {\n        if (value > type(uint40).max) {\n            revert SafeCastOverflowedUintDowncast(40, value);\n        }\n        return uint40(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint32 from uint256, reverting on\n     * overflow (when the input is greater than largest uint32).\n     *\n     * Counterpart to Solidity's `uint32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toUint32(uint256 value) internal pure returns (uint32) {\n        if (value > type(uint32).max) {\n            revert SafeCastOverflowedUintDowncast(32, value);\n        }\n        return uint32(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint24 from uint256, reverting on\n     * overflow (when the input is greater than largest uint24).\n     *\n     * Counterpart to Solidity's `uint24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toUint24(uint256 value) internal pure returns (uint24) {\n        if (value > type(uint24).max) {\n            revert SafeCastOverflowedUintDowncast(24, value);\n        }\n        return uint24(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint16 from uint256, reverting on\n     * overflow (when the input is greater than largest uint16).\n     *\n     * Counterpart to Solidity's `uint16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toUint16(uint256 value) internal pure returns (uint16) {\n        if (value > type(uint16).max) {\n            revert SafeCastOverflowedUintDowncast(16, value);\n        }\n        return uint16(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint8 from uint256, reverting on\n     * overflow (when the input is greater than largest uint8).\n     *\n     * Counterpart to Solidity's `uint8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toUint8(uint256 value) internal pure returns (uint8) {\n        if (value > type(uint8).max) {\n            revert SafeCastOverflowedUintDowncast(8, value);\n        }\n        return uint8(value);\n    }\n\n    /**\n     * @dev Converts a signed int256 into an unsigned uint256.\n     *\n     * Requirements:\n     *\n     * - input must be greater than or equal to 0.\n     */\n    function toUint256(int256 value) internal pure returns (uint256) {\n        if (value < 0) {\n            revert SafeCastOverflowedIntToUint(value);\n        }\n        return uint256(value);\n    }\n\n    /**\n     * @dev Returns the downcasted int248 from int256, reverting on\n     * overflow (when the input is less than smallest int248 or\n     * greater than largest int248).\n     *\n     * Counterpart to Solidity's `int248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\n        downcasted = int248(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(248, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int240 from int256, reverting on\n     * overflow (when the input is less than smallest int240 or\n     * greater than largest int240).\n     *\n     * Counterpart to Solidity's `int240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\n        downcasted = int240(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(240, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int232 from int256, reverting on\n     * overflow (when the input is less than smallest int232 or\n     * greater than largest int232).\n     *\n     * Counterpart to Solidity's `int232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\n        downcasted = int232(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(232, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int224 from int256, reverting on\n     * overflow (when the input is less than smallest int224 or\n     * greater than largest int224).\n     *\n     * Counterpart to Solidity's `int224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\n        downcasted = int224(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(224, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int216 from int256, reverting on\n     * overflow (when the input is less than smallest int216 or\n     * greater than largest int216).\n     *\n     * Counterpart to Solidity's `int216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\n        downcasted = int216(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(216, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int208 from int256, reverting on\n     * overflow (when the input is less than smallest int208 or\n     * greater than largest int208).\n     *\n     * Counterpart to Solidity's `int208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\n        downcasted = int208(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(208, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int200 from int256, reverting on\n     * overflow (when the input is less than smallest int200 or\n     * greater than largest int200).\n     *\n     * Counterpart to Solidity's `int200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\n        downcasted = int200(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(200, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int192 from int256, reverting on\n     * overflow (when the input is less than smallest int192 or\n     * greater than largest int192).\n     *\n     * Counterpart to Solidity's `int192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\n        downcasted = int192(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(192, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int184 from int256, reverting on\n     * overflow (when the input is less than smallest int184 or\n     * greater than largest int184).\n     *\n     * Counterpart to Solidity's `int184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\n        downcasted = int184(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(184, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int176 from int256, reverting on\n     * overflow (when the input is less than smallest int176 or\n     * greater than largest int176).\n     *\n     * Counterpart to Solidity's `int176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\n        downcasted = int176(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(176, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int168 from int256, reverting on\n     * overflow (when the input is less than smallest int168 or\n     * greater than largest int168).\n     *\n     * Counterpart to Solidity's `int168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\n        downcasted = int168(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(168, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int160 from int256, reverting on\n     * overflow (when the input is less than smallest int160 or\n     * greater than largest int160).\n     *\n     * Counterpart to Solidity's `int160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\n        downcasted = int160(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(160, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int152 from int256, reverting on\n     * overflow (when the input is less than smallest int152 or\n     * greater than largest int152).\n     *\n     * Counterpart to Solidity's `int152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\n        downcasted = int152(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(152, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int144 from int256, reverting on\n     * overflow (when the input is less than smallest int144 or\n     * greater than largest int144).\n     *\n     * Counterpart to Solidity's `int144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\n        downcasted = int144(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(144, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int136 from int256, reverting on\n     * overflow (when the input is less than smallest int136 or\n     * greater than largest int136).\n     *\n     * Counterpart to Solidity's `int136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\n        downcasted = int136(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(136, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int128 from int256, reverting on\n     * overflow (when the input is less than smallest int128 or\n     * greater than largest int128).\n     *\n     * Counterpart to Solidity's `int128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toInt128(int256 value) internal pure returns (int128 downcasted) {\n        downcasted = int128(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(128, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int120 from int256, reverting on\n     * overflow (when the input is less than smallest int120 or\n     * greater than largest int120).\n     *\n     * Counterpart to Solidity's `int120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\n        downcasted = int120(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(120, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int112 from int256, reverting on\n     * overflow (when the input is less than smallest int112 or\n     * greater than largest int112).\n     *\n     * Counterpart to Solidity's `int112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\n        downcasted = int112(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(112, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int104 from int256, reverting on\n     * overflow (when the input is less than smallest int104 or\n     * greater than largest int104).\n     *\n     * Counterpart to Solidity's `int104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\n        downcasted = int104(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(104, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int96 from int256, reverting on\n     * overflow (when the input is less than smallest int96 or\n     * greater than largest int96).\n     *\n     * Counterpart to Solidity's `int96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\n        downcasted = int96(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(96, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int88 from int256, reverting on\n     * overflow (when the input is less than smallest int88 or\n     * greater than largest int88).\n     *\n     * Counterpart to Solidity's `int88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\n        downcasted = int88(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(88, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int80 from int256, reverting on\n     * overflow (when the input is less than smallest int80 or\n     * greater than largest int80).\n     *\n     * Counterpart to Solidity's `int80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\n        downcasted = int80(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(80, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int72 from int256, reverting on\n     * overflow (when the input is less than smallest int72 or\n     * greater than largest int72).\n     *\n     * Counterpart to Solidity's `int72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\n        downcasted = int72(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(72, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int64 from int256, reverting on\n     * overflow (when the input is less than smallest int64 or\n     * greater than largest int64).\n     *\n     * Counterpart to Solidity's `int64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toInt64(int256 value) internal pure returns (int64 downcasted) {\n        downcasted = int64(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(64, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int56 from int256, reverting on\n     * overflow (when the input is less than smallest int56 or\n     * greater than largest int56).\n     *\n     * Counterpart to Solidity's `int56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\n        downcasted = int56(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(56, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int48 from int256, reverting on\n     * overflow (when the input is less than smallest int48 or\n     * greater than largest int48).\n     *\n     * Counterpart to Solidity's `int48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\n        downcasted = int48(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(48, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int40 from int256, reverting on\n     * overflow (when the input is less than smallest int40 or\n     * greater than largest int40).\n     *\n     * Counterpart to Solidity's `int40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\n        downcasted = int40(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(40, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int32 from int256, reverting on\n     * overflow (when the input is less than smallest int32 or\n     * greater than largest int32).\n     *\n     * Counterpart to Solidity's `int32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toInt32(int256 value) internal pure returns (int32 downcasted) {\n        downcasted = int32(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(32, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int24 from int256, reverting on\n     * overflow (when the input is less than smallest int24 or\n     * greater than largest int24).\n     *\n     * Counterpart to Solidity's `int24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\n        downcasted = int24(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(24, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int16 from int256, reverting on\n     * overflow (when the input is less than smallest int16 or\n     * greater than largest int16).\n     *\n     * Counterpart to Solidity's `int16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toInt16(int256 value) internal pure returns (int16 downcasted) {\n        downcasted = int16(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(16, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int8 from int256, reverting on\n     * overflow (when the input is less than smallest int8 or\n     * greater than largest int8).\n     *\n     * Counterpart to Solidity's `int8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toInt8(int256 value) internal pure returns (int8 downcasted) {\n        downcasted = int8(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(8, value);\n        }\n    }\n\n    /**\n     * @dev Converts an unsigned uint256 into a signed int256.\n     *\n     * Requirements:\n     *\n     * - input must be less than or equal to maxInt256.\n     */\n    function toInt256(uint256 value) internal pure returns (int256) {\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n        if (value > uint256(type(int256).max)) {\n            revert SafeCastOverflowedUintToInt(value);\n        }\n        return int256(value);\n    }\n\n    /**\n     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n     */\n    function toUint(bool b) internal pure returns (uint256 u) {\n        assembly (\"memory-safe\") {\n            u := iszero(iszero(b))\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/math/Math.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.6.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Floor, // Toward negative infinity\n        Ceil, // Toward positive infinity\n        Trunc, // Toward zero\n        Expand // Away from zero\n    }\n\n    /**\n     * @dev Return the 512-bit addition of two uint256.\n     *\n     * The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.\n     */\n    function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        assembly (\"memory-safe\") {\n            low := add(a, b)\n            high := lt(low, a)\n        }\n    }\n\n    /**\n     * @dev Return the 512-bit multiplication of two uint256.\n     *\n     * The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.\n     */\n    function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        // 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n        // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n        // variables such that product = high * 2²⁵⁶ + low.\n        assembly (\"memory-safe\") {\n            let mm := mulmod(a, b, not(0))\n            low := mul(a, b)\n            high := sub(sub(mm, low), lt(mm, low))\n        }\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a + b;\n            success = c >= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a - b;\n            success = c <= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a * b;\n            assembly (\"memory-safe\") {\n                // Only true when the multiplication doesn't overflow\n                // (c / a == b) || (a == 0)\n                success := or(eq(div(c, a), b), iszero(a))\n            }\n            // equivalent to: success ? c : 0\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `DIV` opcode returns zero when the denominator is 0.\n                result := div(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `MOD` opcode returns zero when the denominator is 0.\n                result := mod(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryAdd(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.\n     */\n    function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {\n        (, uint256 result) = trySub(a, b);\n        return result;\n    }\n\n    /**\n     * @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryMul(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Branchless ternary evaluation for `condition ? a : b`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `condition ? a : b`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * SafeCast.toUint(condition));\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return ternary(a > b, a, b);\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return ternary(a < b, a, b);\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        unchecked {\n            // (a + b) / 2 can overflow.\n            return (a & b) + (a ^ b) / 2;\n        }\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds towards infinity instead\n     * of rounding towards zero.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (b == 0) {\n            // Guarantee the same behavior as in a regular Solidity division.\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n\n        // The following calculation ensures accurate ceiling division without overflow.\n        // Since a is non-zero, (a - 1) / b will not overflow.\n        // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n        // but the largest value we can obtain is type(uint256).max - 1, which happens\n        // when a = type(uint256).max and b = 1.\n        unchecked {\n            return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n        }\n    }\n\n    /**\n     * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n     * denominator == 0.\n     *\n     * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n     * Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (high == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return low / denominator;\n            }\n\n            // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n            if (denominator <= high) {\n                Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n            }\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [high low].\n            uint256 remainder;\n            assembly (\"memory-safe\") {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                high := sub(high, gt(remainder, low))\n                low := sub(low, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n            uint256 twos = denominator & (0 - denominator);\n            assembly (\"memory-safe\") {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [high low] by twos.\n                low := div(low, twos)\n\n                // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from high into low.\n            low |= high * twos;\n\n            // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n            // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n            // works in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n            inverse *= 2 - denominator * inverse; // inverse mod 2³²\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is\n            // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high\n            // is no longer required.\n            result = low * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n    }\n\n    /**\n     * @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n            if (high >= 1 << n) {\n                Panic.panic(Panic.UNDER_OVERFLOW);\n            }\n            return (high << (256 - n)) | (low >> n);\n        }\n    }\n\n    /**\n     * @dev Calculates x * y >> n with full precision, following the selected rounding direction.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {\n        return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);\n    }\n\n    /**\n     * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n     *\n     * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n     * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n     *\n     * If the input value is not inversible, 0 is returned.\n     *\n     * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n     * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n     */\n    function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n        unchecked {\n            if (n == 0) return 0;\n\n            // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n            // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n            // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n            // ax + ny = 1\n            // ax = 1 + (-y)n\n            // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n            // If the remainder is 0 the gcd is n right away.\n            uint256 remainder = a % n;\n            uint256 gcd = n;\n\n            // Therefore the initial coefficients are:\n            // ax + ny = gcd(a, n) = n\n            // 0a + 1n = n\n            int256 x = 0;\n            int256 y = 1;\n\n            while (remainder != 0) {\n                uint256 quotient = gcd / remainder;\n\n                (gcd, remainder) = (\n                    // The old remainder is the next gcd to try.\n                    remainder,\n                    // Compute the next remainder.\n                    // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n                    // where gcd is at most n (capped to type(uint256).max)\n                    gcd - remainder * quotient\n                );\n\n                (x, y) = (\n                    // Increment the coefficient of a.\n                    y,\n                    // Decrement the coefficient of n.\n                    // Can overflow, but the result is casted to uint256 so that the\n                    // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n                    x - y * int256(quotient)\n                );\n            }\n\n            if (gcd != 1) return 0; // No inverse exists.\n            return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n        }\n    }\n\n    /**\n     * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n     *\n     * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n     * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n     * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n     *\n     * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n     */\n    function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n        unchecked {\n            return Math.modExp(a, p - 2, p);\n        }\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n     *\n     * Requirements:\n     * - modulus can't be zero\n     * - underlying staticcall to precompile must succeed\n     *\n     * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n     * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n     * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n     * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n     * interpreted as 0.\n     */\n    function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n        (bool success, uint256 result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n     * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n     * to operate modulo 0 or if the underlying precompile reverted.\n     *\n     * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n     * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n     * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n     * of a revert, but the result may be incorrectly interpreted as 0.\n     */\n    function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n        if (m == 0) return (false, 0);\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            // | Offset    | Content    | Content (Hex)                                                      |\n            // |-----------|------------|--------------------------------------------------------------------|\n            // | 0x00:0x1f | size of b  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x20:0x3f | size of e  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x40:0x5f | size of m  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n            // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n            // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n            mstore(ptr, 0x20)\n            mstore(add(ptr, 0x20), 0x20)\n            mstore(add(ptr, 0x40), 0x20)\n            mstore(add(ptr, 0x60), b)\n            mstore(add(ptr, 0x80), e)\n            mstore(add(ptr, 0xa0), m)\n\n            // Given the result < m, it's guaranteed to fit in 32 bytes,\n            // so we can use the memory scratch space located at offset 0.\n            success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n            result := mload(0x00)\n        }\n    }\n\n    /**\n     * @dev Variant of {modExp} that supports inputs of arbitrary length.\n     */\n    function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n        (bool success, bytes memory result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n     */\n    function tryModExp(\n        bytes memory b,\n        bytes memory e,\n        bytes memory m\n    ) internal view returns (bool success, bytes memory result) {\n        if (_zeroBytes(m)) return (false, new bytes(0));\n\n        uint256 mLen = m.length;\n\n        // Encode call args in result and move the free memory pointer\n        result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n        assembly (\"memory-safe\") {\n            let dataPtr := add(result, 0x20)\n            // Write result on top of args to avoid allocating extra memory.\n            success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n            // Overwrite the length.\n            // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n            mstore(result, mLen)\n            // Set the memory pointer after the returned data.\n            mstore(0x40, add(dataPtr, mLen))\n        }\n    }\n\n    /**\n     * @dev Returns whether the provided byte array is zero.\n     */\n    function _zeroBytes(bytes memory buffer) private pure returns (bool) {\n        uint256 chunk;\n        for (uint256 i = 0; i < buffer.length; i += 0x20) {\n            // See _unsafeReadBytesOffset from utils/Bytes.sol\n            assembly (\"memory-safe\") {\n                chunk := mload(add(add(buffer, 0x20), i))\n            }\n            if (chunk >> (8 * saturatingSub(i + 0x20, buffer.length)) != 0) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n     * towards zero.\n     *\n     * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n     * using integer operations.\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        unchecked {\n            // Take care of easy edge cases when a == 0 or a == 1\n            if (a <= 1) {\n                return a;\n            }\n\n            // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n            // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n            // the current value as `ε_n = | x_n - sqrt(a) |`.\n            //\n            // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n            // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n            // bigger than any uint256.\n            //\n            // By noticing that\n            // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n            // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n            // to the msb function.\n            uint256 aa = a;\n            uint256 xn = 1;\n\n            if (aa >= (1 << 128)) {\n                aa >>= 128;\n                xn <<= 64;\n            }\n            if (aa >= (1 << 64)) {\n                aa >>= 64;\n                xn <<= 32;\n            }\n            if (aa >= (1 << 32)) {\n                aa >>= 32;\n                xn <<= 16;\n            }\n            if (aa >= (1 << 16)) {\n                aa >>= 16;\n                xn <<= 8;\n            }\n            if (aa >= (1 << 8)) {\n                aa >>= 8;\n                xn <<= 4;\n            }\n            if (aa >= (1 << 4)) {\n                aa >>= 4;\n                xn <<= 2;\n            }\n            if (aa >= (1 << 2)) {\n                xn <<= 1;\n            }\n\n            // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n            //\n            // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n            // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n            // This is going to be our x_0 (and ε_0)\n            xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n            // From here, Newton's method give us:\n            // x_{n+1} = (x_n + a / x_n) / 2\n            //\n            // One should note that:\n            // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n            //              = ((x_n² + a) / (2 * x_n))² - a\n            //              = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n            //              = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n            //              = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n            //              = (x_n² - a)² / (2 * x_n)²\n            //              = ((x_n² - a) / (2 * x_n))²\n            //              ≥ 0\n            // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n            //\n            // This gives us the proof of quadratic convergence of the sequence:\n            // ε_{n+1} = | x_{n+1} - sqrt(a) |\n            //         = | (x_n + a / x_n) / 2 - sqrt(a) |\n            //         = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n            //         = | (x_n - sqrt(a))² / (2 * x_n) |\n            //         = | ε_n² / (2 * x_n) |\n            //         = ε_n² / | (2 * x_n) |\n            //\n            // For the first iteration, we have a special case where x_0 is known:\n            // ε_1 = ε_0² / | (2 * x_0) |\n            //     ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n            //     ≤ 2**(2*e-4) / (3 * 2**(e-1))\n            //     ≤ 2**(e-3) / 3\n            //     ≤ 2**(e-3-log2(3))\n            //     ≤ 2**(e-4.5)\n            //\n            // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n            // ε_{n+1} = ε_n² / | (2 * x_n) |\n            //         ≤ (2**(e-k))² / (2 * 2**(e-1))\n            //         ≤ 2**(2*e-2*k) / 2**e\n            //         ≤ 2**(e-2*k)\n            xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5)  -- special case, see above\n            xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9)    -- general case with k = 4.5\n            xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18)   -- general case with k = 9\n            xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36)   -- general case with k = 18\n            xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72)   -- general case with k = 36\n            xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144)  -- general case with k = 72\n\n            // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n            // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n            // sqrt(a) or sqrt(a) + 1.\n            return xn - SafeCast.toUint(xn > a / xn);\n        }\n    }\n\n    /**\n     * @dev Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // If upper 8 bits of 16-bit half set, add 8 to result\n        r |= SafeCast.toUint((x >> r) > 0xff) << 3;\n        // If upper 4 bits of 8-bit half set, add 4 to result\n        r |= SafeCast.toUint((x >> r) > 0xf) << 2;\n\n        // Shifts value right by the current result and use it as an index into this lookup table:\n        //\n        // | x (4 bits) |  index  | table[index] = MSB position |\n        // |------------|---------|-----------------------------|\n        // |    0000    |    0    |        table[0] = 0         |\n        // |    0001    |    1    |        table[1] = 0         |\n        // |    0010    |    2    |        table[2] = 1         |\n        // |    0011    |    3    |        table[3] = 1         |\n        // |    0100    |    4    |        table[4] = 2         |\n        // |    0101    |    5    |        table[5] = 2         |\n        // |    0110    |    6    |        table[6] = 2         |\n        // |    0111    |    7    |        table[7] = 2         |\n        // |    1000    |    8    |        table[8] = 3         |\n        // |    1001    |    9    |        table[9] = 3         |\n        // |    1010    |   10    |        table[10] = 3        |\n        // |    1011    |   11    |        table[11] = 3        |\n        // |    1100    |   12    |        table[12] = 3        |\n        // |    1101    |   13    |        table[13] = 3        |\n        // |    1110    |   14    |        table[14] = 3        |\n        // |    1111    |   15    |        table[15] = 3        |\n        //\n        // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the first 16 bytes (most significant half).\n        assembly (\"memory-safe\") {\n            r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8\n        return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n        }\n    }\n\n    /**\n     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n     */\n    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n        return uint8(rounding) % 2 == 1;\n    }\n\n    /**\n     * @dev Counts the number of leading zero bits in a uint256.\n     */\n    function clz(uint256 x) internal pure returns (uint256) {\n        return ternary(x == 0, 256, 255 - log2(x));\n    }\n}\n"},"lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {Initializable} from \"@openzeppelin/contracts/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165Upgradeable is Initializable, IERC165 {\n    function __ERC165_init() internal onlyInitializing {\n    }\n\n    function __ERC165_init_unchained() internal onlyInitializing {\n    }\n    /// @inheritdoc IERC165\n    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n        return interfaceId == type(IERC165).interfaceId;\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/types/Time.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n    using Time for *;\n\n    /**\n     * @dev Get the block timestamp as a Timepoint.\n     */\n    function timestamp() internal view returns (uint48) {\n        return SafeCast.toUint48(block.timestamp);\n    }\n\n    /**\n     * @dev Get the block number as a Timepoint.\n     */\n    function blockNumber() internal view returns (uint48) {\n        return SafeCast.toUint48(block.number);\n    }\n\n    // ==================================================== Delay =====================================================\n    /**\n     * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n     * future. The \"effect\" timepoint describes when the transition happens from the \"old\" value to the \"new\" value.\n     * This allows updating the delay applied to some operation while keeping some guarantees.\n     *\n     * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n     * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n     * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n     * still apply for some time.\n     *\n     *\n     * The `Delay` type is 112 bits long, and packs the following:\n     *\n     * ```\n     *   | [uint48]: effect date (timepoint)\n     *   |           | [uint32]: value before (duration)\n     *   ↓           ↓       ↓ [uint32]: value after (duration)\n     * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n     * ```\n     *\n     * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n     * supported.\n     */\n    type Delay is uint112;\n\n    /**\n     * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n     */\n    function toDelay(uint32 duration) internal pure returns (Delay) {\n        return Delay.wrap(duration);\n    }\n\n    /**\n     * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n     * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n     */\n    function _getFullAt(\n        Delay self,\n        uint48 timepoint\n    ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n        (valueBefore, valueAfter, effect) = self.unpack();\n        return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n    }\n\n    /**\n     * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n     * effect timepoint is 0, then the pending value should not be considered.\n     */\n    function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n        return _getFullAt(self, timestamp());\n    }\n\n    /**\n     * @dev Get the current value.\n     */\n    function get(Delay self) internal view returns (uint32) {\n        (uint32 delay, , ) = self.getFull();\n        return delay;\n    }\n\n    /**\n     * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n     * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n     * new delay becomes effective.\n     */\n    function withUpdate(\n        Delay self,\n        uint32 newValue,\n        uint32 minSetback\n    ) internal view returns (Delay updatedDelay, uint48 effect) {\n        uint32 value = self.get();\n        uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n        effect = timestamp() + setback;\n        return (pack(value, newValue, effect), effect);\n    }\n\n    /**\n     * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n     */\n    function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n        uint112 raw = Delay.unwrap(self);\n\n        valueAfter = uint32(raw);\n        valueBefore = uint32(raw >> 32);\n        effect = uint48(raw >> 64);\n\n        return (valueBefore, valueAfter, effect);\n    }\n\n    /**\n     * @dev pack the components into a Delay object.\n     */\n    function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n        return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/account/utils/ERC4337Utils.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (account/utils/ERC4337Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IEntryPoint, PackedUserOperation} from \"../../interfaces/IERC4337.sol\";\nimport {Math} from \"../../utils/math/Math.sol\";\nimport {Calldata} from \"../../utils/Calldata.sol\";\nimport {Packing} from \"../../utils/Packing.sol\";\n\n/// @dev This is available on all entrypoint since v0.4.0, but is not formally part of the ERC.\ninterface IEntryPointExtra {\n    function getUserOpHash(PackedUserOperation calldata userOp) external view returns (bytes32);\n}\n\n/**\n * @dev Library with common ERC-4337 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-4337[ERC-4337].\n */\nlibrary ERC4337Utils {\n    using Packing for *;\n\n    /// @dev Address of the entrypoint v0.7.0\n    IEntryPoint internal constant ENTRYPOINT_V07 = IEntryPoint(0x0000000071727De22E5E9d8BAf0edAc6f37da032);\n\n    /// @dev Address of the entrypoint v0.8.0\n    IEntryPoint internal constant ENTRYPOINT_V08 = IEntryPoint(0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108);\n\n    /// @dev Address of the entrypoint v0.9.0\n    IEntryPoint internal constant ENTRYPOINT_V09 = IEntryPoint(0x433709009B8330FDa32311DF1C2AFA402eD8D009);\n\n    /// @dev For simulation purposes, validateUserOp (and validatePaymasterUserOp) return this value on success.\n    uint256 internal constant SIG_VALIDATION_SUCCESS = 0;\n\n    /// @dev For simulation purposes, validateUserOp (and validatePaymasterUserOp) must return this value in case of signature failure, instead of revert.\n    uint256 internal constant SIG_VALIDATION_FAILED = 1;\n\n    /// @dev Magic value used in EntryPoint v0.9+ to detect the presence of a paymaster signature in `paymasterAndData`.\n    bytes8 internal constant PAYMASTER_SIG_MAGIC = 0x22e325a297439656; // keccak256(\"PaymasterSignature\")[:8]\n\n    /// @dev Highest bit set to 1 in a 6-bytes field.\n    uint48 internal constant BLOCK_RANGE_FLAG = 0x800000000000;\n\n    /// @dev Mask for the lower 47 bits of a 6-bytes field (equivalent to uint48(~BLOCK_RANGE_FLAG)).\n    uint48 internal constant BLOCK_RANGE_MASK = 0x7fffffffffff;\n\n    /// @dev Validity range of the validation data.\n    enum ValidationRange {\n        TIMESTAMP,\n        BLOCK\n    }\n\n    /**\n     * @dev Parses the validation data into its components and the validity range. See {packValidationData}.\n     * Strips away the highest bit flag from the `validAfter` and `validUntil` fields.\n     */\n    function parseValidationData(\n        uint256 validationData\n    ) internal pure returns (address aggregator, uint48 validAfter, uint48 validUntil, ValidationRange range) {\n        validAfter = uint48(bytes32(validationData).extract_32_6(0));\n        validUntil = uint48(bytes32(validationData).extract_32_6(6));\n        aggregator = address(bytes32(validationData).extract_32_20(12));\n        range = ((validAfter & validUntil & BLOCK_RANGE_FLAG) == 0) ? ValidationRange.TIMESTAMP : ValidationRange.BLOCK;\n\n        validAfter &= BLOCK_RANGE_MASK;\n        validUntil &= BLOCK_RANGE_MASK;\n\n        if (validUntil == 0) validUntil = BLOCK_RANGE_MASK;\n    }\n\n    /// @dev Packs the validation data into a single uint256. See {parseValidationData}.\n    function packValidationData(\n        address aggregator,\n        uint48 validAfter,\n        uint48 validUntil\n    ) internal pure returns (uint256) {\n        return\n            packValidationData(\n                aggregator,\n                validAfter,\n                validUntil,\n                (validAfter & validUntil & BLOCK_RANGE_FLAG) == 0 ? ValidationRange.TIMESTAMP : ValidationRange.BLOCK\n            );\n    }\n\n    /**\n     * @dev Variant of {packValidationData} that forces which validity range to use. This overwrites the presence of\n     * flags in `validAfter` and `validUntil`).\n     */\n    function packValidationData(\n        address aggregator,\n        uint48 validAfter,\n        uint48 validUntil,\n        ValidationRange range\n    ) internal pure returns (uint256) {\n        if (range == ValidationRange.TIMESTAMP) {\n            validAfter &= BLOCK_RANGE_MASK;\n            validUntil &= BLOCK_RANGE_MASK;\n        } else if (range == ValidationRange.BLOCK) {\n            validAfter |= BLOCK_RANGE_FLAG;\n            validUntil |= BLOCK_RANGE_FLAG;\n        }\n        return uint256(bytes6(validAfter).pack_6_6(bytes6(validUntil)).pack_12_20(bytes20(aggregator)));\n    }\n\n    /// @dev Variant of {packValidationData} that uses a boolean success flag instead of an aggregator address.\n    function packValidationData(bool sigSuccess, uint48 validAfter, uint48 validUntil) internal pure returns (uint256) {\n        return\n            packValidationData(\n                address(uint160(Math.ternary(sigSuccess, SIG_VALIDATION_SUCCESS, SIG_VALIDATION_FAILED))),\n                validAfter,\n                validUntil\n            );\n    }\n\n    /**\n     * @dev Variant of {packValidationData} that uses a boolean success flag instead of an aggregator address and that\n     * forces which validity range to use. This overwrites the presence of flags in `validAfter` and `validUntil`).\n     */\n    function packValidationData(\n        bool sigSuccess,\n        uint48 validAfter,\n        uint48 validUntil,\n        ValidationRange range\n    ) internal pure returns (uint256) {\n        return\n            packValidationData(\n                address(uint160(Math.ternary(sigSuccess, SIG_VALIDATION_SUCCESS, SIG_VALIDATION_FAILED))),\n                validAfter,\n                validUntil,\n                range\n            );\n    }\n\n    /**\n     * @dev Combines two validation data into a single one.\n     *\n     * The `aggregator` is set to {SIG_VALIDATION_SUCCESS} if both are successful, while\n     * the `validAfter` is the maximum and the `validUntil` is the minimum of both.\n     *\n     * NOTE: Returns `SIG_VALIDATION_FAILED` if the validation ranges differ.\n     */\n    function combineValidationData(uint256 validationData1, uint256 validationData2) internal pure returns (uint256) {\n        (address aggregator1, uint48 validAfter1, uint48 validUntil1, ValidationRange range1) = parseValidationData(\n            validationData1\n        );\n        (address aggregator2, uint48 validAfter2, uint48 validUntil2, ValidationRange range2) = parseValidationData(\n            validationData2\n        );\n\n        if (range1 == range2) {\n            bool success = aggregator1 == address(uint160(SIG_VALIDATION_SUCCESS)) &&\n                aggregator2 == address(uint160(SIG_VALIDATION_SUCCESS));\n            uint48 validAfter = uint48(Math.max(validAfter1, validAfter2));\n            uint48 validUntil = uint48(Math.min(validUntil1, validUntil2));\n            return packValidationData(success, validAfter, validUntil, range1);\n        } else {\n            return SIG_VALIDATION_FAILED;\n        }\n    }\n\n    /// @dev Returns the aggregator of the `validationData` and whether it is out of time range.\n    function getValidationData(uint256 validationData) internal view returns (address aggregator, bool outOfTimeRange) {\n        (address aggregator_, uint48 validAfter, uint48 validUntil, ValidationRange range) = parseValidationData(\n            validationData\n        );\n        uint256 current = Math.ternary(range == ValidationRange.TIMESTAMP, block.timestamp, block.number);\n        return (aggregator_, current <= validAfter || validUntil < current);\n    }\n\n    /// @dev Get the hash of a user operation for a given entrypoint\n    function hash(PackedUserOperation calldata self, address entrypoint) internal view returns (bytes32) {\n        // NOTE: getUserOpHash is available since v0.4.0\n        //\n        // Prior to v0.8.0, this was easy to replicate for any entrypoint and chainId. Since v0.8.0 of the\n        // entrypoint, this depends on the Entrypoint's domain separator, which cannot be hardcoded and is complex\n        // to recompute. Domain separator could be fetched using the `getDomainSeparatorV4` getter, or recomputed from\n        // the ERC-5267 getter, but both operation would require doing a view call to the entrypoint. Overall it feels\n        // simpler and less error prone to get that functionality from the entrypoint directly.\n        return IEntryPointExtra(entrypoint).getUserOpHash(self);\n    }\n\n    /// @dev Returns `factory` from the {PackedUserOperation}, or address(0) if the initCode is empty or not properly formatted.\n    function factory(PackedUserOperation calldata self) internal pure returns (address) {\n        return self.initCode.length < 20 ? address(0) : address(bytes20(self.initCode[0:20]));\n    }\n\n    /// @dev Returns `factoryData` from the {PackedUserOperation}, or empty bytes if the initCode is empty or not properly formatted.\n    function factoryData(PackedUserOperation calldata self) internal pure returns (bytes calldata) {\n        return self.initCode.length < 20 ? Calldata.emptyBytes() : self.initCode[20:];\n    }\n\n    /// @dev Returns `verificationGasLimit` from the {PackedUserOperation}.\n    function verificationGasLimit(PackedUserOperation calldata self) internal pure returns (uint256) {\n        return uint128(self.accountGasLimits.extract_32_16(0));\n    }\n\n    /// @dev Returns `callGasLimit` from the {PackedUserOperation}.\n    function callGasLimit(PackedUserOperation calldata self) internal pure returns (uint256) {\n        return uint128(self.accountGasLimits.extract_32_16(16));\n    }\n\n    /// @dev Returns the first section of `gasFees` from the {PackedUserOperation}.\n    function maxPriorityFeePerGas(PackedUserOperation calldata self) internal pure returns (uint256) {\n        return uint128(self.gasFees.extract_32_16(0));\n    }\n\n    /// @dev Returns the second section of `gasFees` from the {PackedUserOperation}.\n    function maxFeePerGas(PackedUserOperation calldata self) internal pure returns (uint256) {\n        return uint128(self.gasFees.extract_32_16(16));\n    }\n\n    /// @dev Returns the total gas price for the {PackedUserOperation} (ie. `maxFeePerGas` or `maxPriorityFeePerGas + basefee`).\n    function gasPrice(PackedUserOperation calldata self) internal view returns (uint256) {\n        unchecked {\n            // Following values are \"per gas\"\n            uint256 maxPriorityFee = maxPriorityFeePerGas(self);\n            uint256 maxFee = maxFeePerGas(self);\n            return Math.min(maxFee, maxPriorityFee + block.basefee);\n        }\n    }\n\n    /// @dev Returns the first section of `paymasterAndData` from the {PackedUserOperation}.\n    function paymaster(PackedUserOperation calldata self) internal pure returns (address) {\n        return self.paymasterAndData.length < 52 ? address(0) : address(bytes20(self.paymasterAndData[0:20]));\n    }\n\n    /// @dev Returns the second section of `paymasterAndData` from the {PackedUserOperation}.\n    function paymasterVerificationGasLimit(PackedUserOperation calldata self) internal pure returns (uint256) {\n        return self.paymasterAndData.length < 52 ? 0 : uint128(bytes16(self.paymasterAndData[20:36]));\n    }\n\n    /// @dev Returns the third section of `paymasterAndData` from the {PackedUserOperation}.\n    function paymasterPostOpGasLimit(PackedUserOperation calldata self) internal pure returns (uint256) {\n        return self.paymasterAndData.length < 52 ? 0 : uint128(bytes16(self.paymasterAndData[36:52]));\n    }\n\n    /**\n     * @dev Returns the fourth section of `paymasterAndData` from the {PackedUserOperation}.\n     * If a paymaster signature is present, it is excluded from the returned data.\n     */\n    function paymasterData(PackedUserOperation calldata self) internal pure returns (bytes calldata) {\n        bool hasSignature = self.paymasterAndData.length > 9 &&\n            bytes8(self.paymasterAndData[self.paymasterAndData.length - 8:]) == PAYMASTER_SIG_MAGIC;\n        uint256 suffixLength = hasSignature ? _paymasterSignatureSize(self) + 10 : 0;\n        return\n            self.paymasterAndData.length < 52 + suffixLength\n                ? Calldata.emptyBytes()\n                : self.paymasterAndData[52:self.paymasterAndData.length - suffixLength];\n    }\n\n    /**\n     * @dev Returns the paymaster signature from `paymasterAndData` (EntryPoint v0.9+).\n     * Returns empty bytes if no paymaster signature is present.\n     */\n    function paymasterSignature(PackedUserOperation calldata self) internal pure returns (bytes calldata) {\n        if (\n            self.paymasterAndData.length < 10 ||\n            bytes8(self.paymasterAndData[self.paymasterAndData.length - 8:]) != PAYMASTER_SIG_MAGIC\n        ) return Calldata.emptyBytes();\n\n        uint256 sigSize = _paymasterSignatureSize(self);\n        uint256 sigEnd = self.paymasterAndData.length - 10;\n        return\n            self.paymasterAndData.length < 62 + sigSize\n                ? Calldata.emptyBytes()\n                : self.paymasterAndData[sigEnd - sigSize:sigEnd];\n    }\n\n    /**\n     * @dev Returns the size of the paymaster signature in `paymasterAndData` (EntryPoint v0.9+).\n     * Does not check minimum length of `paymasterAndData`.\n     */\n    function _paymasterSignatureSize(PackedUserOperation calldata self) private pure returns (uint256) {\n        return\n            uint16(bytes2(self.paymasterAndData[self.paymasterAndData.length - 10:self.paymasterAndData.length - 8]));\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1271.sol)\n\npragma solidity >=0.5.0;\n\n/**\n * @dev Interface of the ERC-1271 standard signature validation method for\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\n */\ninterface IERC1271 {\n    /**\n     * @dev Should return whether the signature provided is valid for the provided data\n     * @param hash      Hash of the data to be signed\n     * @param signature Signature byte array associated with `hash`\n     */\n    function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4 magicValue);\n}\n"},"lib/openzeppelin-contracts/contracts/interfaces/IERC7913.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC7913.sol)\n\npragma solidity >=0.5.0;\n\n/**\n * @dev Signature verifier interface.\n */\ninterface IERC7913SignatureVerifier {\n    /**\n     * @dev Verifies `signature` as a valid signature of `hash` by `key`.\n     *\n     * MUST return the bytes4 magic value IERC7913SignatureVerifier.verify.selector if the signature is valid.\n     * SHOULD return 0xffffffff or revert if the signature is not valid.\n     * SHOULD return 0xffffffff or revert if the key is empty\n     */\n    function verify(bytes calldata key, bytes32 hash, bytes calldata signature) external view returns (bytes4);\n}\n"},"lib/openzeppelin-contracts/contracts/utils/Bytes.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (utils/Bytes.sol)\n\npragma solidity ^0.8.24;\n\nimport {Math} from \"./math/Math.sol\";\n\n/**\n * @dev Bytes operations.\n */\nlibrary Bytes {\n    /**\n     * @dev Forward search for `s` in `buffer`\n     * * If `s` is present in the buffer, returns the index of the first instance\n     * * If `s` is not present in the buffer, returns type(uint256).max\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf[Javascript's `Array.indexOf`]\n     */\n    function indexOf(bytes memory buffer, bytes1 s) internal pure returns (uint256) {\n        return indexOf(buffer, s, 0);\n    }\n\n    /**\n     * @dev Forward search for `s` in `buffer` starting at position `pos`\n     * * If `s` is present in the buffer (at or after `pos`), returns the index of the next instance\n     * * If `s` is not present in the buffer (at or after `pos`), returns type(uint256).max\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf[Javascript's `Array.indexOf`]\n     */\n    function indexOf(bytes memory buffer, bytes1 s, uint256 pos) internal pure returns (uint256) {\n        uint256 length = buffer.length;\n        for (uint256 i = pos; i < length; ++i) {\n            if (bytes1(_unsafeReadBytesOffset(buffer, i)) == s) {\n                return i;\n            }\n        }\n        return type(uint256).max;\n    }\n\n    /**\n     * @dev Backward search for `s` in `buffer`\n     * * If `s` is present in the buffer, returns the index of the last instance\n     * * If `s` is not present in the buffer, returns type(uint256).max\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf[Javascript's `Array.lastIndexOf`]\n     */\n    function lastIndexOf(bytes memory buffer, bytes1 s) internal pure returns (uint256) {\n        return lastIndexOf(buffer, s, type(uint256).max);\n    }\n\n    /**\n     * @dev Backward search for `s` in `buffer` starting at position `pos`\n     * * If `s` is present in the buffer (at or before `pos`), returns the index of the previous instance\n     * * If `s` is not present in the buffer (at or before `pos`), returns type(uint256).max\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf[Javascript's `Array.lastIndexOf`]\n     */\n    function lastIndexOf(bytes memory buffer, bytes1 s, uint256 pos) internal pure returns (uint256) {\n        unchecked {\n            uint256 length = buffer.length;\n            for (uint256 i = Math.min(Math.saturatingAdd(pos, 1), length); i > 0; --i) {\n                if (bytes1(_unsafeReadBytesOffset(buffer, i - 1)) == s) {\n                    return i - 1;\n                }\n            }\n            return type(uint256).max;\n        }\n    }\n\n    /**\n     * @dev Copies the content of `buffer`, from `start` (included) to the end of `buffer` into a new bytes object in\n     * memory.\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice[Javascript's `Array.slice`]\n     */\n    function slice(bytes memory buffer, uint256 start) internal pure returns (bytes memory) {\n        return slice(buffer, start, buffer.length);\n    }\n\n    /**\n     * @dev Copies the content of `buffer`, from `start` (included) to `end` (excluded) into a new bytes object in\n     * memory. The `end` argument is truncated to the length of the `buffer`.\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice[Javascript's `Array.slice`]\n     */\n    function slice(bytes memory buffer, uint256 start, uint256 end) internal pure returns (bytes memory) {\n        // sanitize\n        end = Math.min(end, buffer.length);\n        start = Math.min(start, end);\n\n        // allocate and copy\n        bytes memory result = new bytes(end - start);\n        assembly (\"memory-safe\") {\n            mcopy(add(result, 0x20), add(add(buffer, 0x20), start), sub(end, start))\n        }\n\n        return result;\n    }\n\n    /**\n     * @dev Moves the content of `buffer`, from `start` (included) to the end of `buffer` to the start of that buffer,\n     * and shrinks the buffer length accordingly, effectively overriding the content of buffer with buffer[start:].\n     *\n     * NOTE: This function modifies the provided buffer in place. If you need to preserve the original buffer, use {slice} instead\n     */\n    function splice(bytes memory buffer, uint256 start) internal pure returns (bytes memory) {\n        return splice(buffer, start, buffer.length);\n    }\n\n    /**\n     * @dev Moves the content of `buffer`, from `start` (included) to `end` (excluded) to the start of that buffer,\n     * and shrinks the buffer length accordingly, effectively overriding the content of buffer with buffer[start:end].\n     * The `end` argument is truncated to the length of the `buffer`.\n     *\n     * NOTE: This function modifies the provided buffer in place. If you need to preserve the original buffer, use {slice} instead\n     */\n    function splice(bytes memory buffer, uint256 start, uint256 end) internal pure returns (bytes memory) {\n        // sanitize\n        end = Math.min(end, buffer.length);\n        start = Math.min(start, end);\n\n        // move and resize\n        assembly (\"memory-safe\") {\n            mcopy(add(buffer, 0x20), add(add(buffer, 0x20), start), sub(end, start))\n            mstore(buffer, sub(end, start))\n        }\n\n        return buffer;\n    }\n\n    /**\n     * @dev Replaces bytes in `buffer` starting at `pos` with all bytes from `replacement`.\n     *\n     * Parameters are clamped to valid ranges (i.e. `pos` is clamped to `[0, buffer.length]`).\n     * If `pos >= buffer.length`, no replacement occurs and the buffer is returned unchanged.\n     *\n     * NOTE: This function modifies the provided buffer in place.\n     */\n    function replace(bytes memory buffer, uint256 pos, bytes memory replacement) internal pure returns (bytes memory) {\n        return replace(buffer, pos, replacement, 0, replacement.length);\n    }\n\n    /**\n     * @dev Replaces bytes in `buffer` starting at `pos` with bytes from `replacement` starting at `offset`.\n     * Copies at most `length` bytes from `replacement` to `buffer`.\n     *\n     * Parameters are clamped to valid ranges (i.e. `pos` is clamped to `[0, buffer.length]`, `offset` is\n     * clamped to `[0, replacement.length]`, and `length` is clamped to `min(length, replacement.length - offset,\n     * buffer.length - pos))`. If `pos >= buffer.length` or `offset >= replacement.length`, no replacement occurs\n     * and the buffer is returned unchanged.\n     *\n     * NOTE: This function modifies the provided buffer in place.\n     */\n    function replace(\n        bytes memory buffer,\n        uint256 pos,\n        bytes memory replacement,\n        uint256 offset,\n        uint256 length\n    ) internal pure returns (bytes memory) {\n        // sanitize\n        pos = Math.min(pos, buffer.length);\n        offset = Math.min(offset, replacement.length);\n        length = Math.min(length, Math.min(replacement.length - offset, buffer.length - pos));\n\n        // replace\n        assembly (\"memory-safe\") {\n            mcopy(add(add(buffer, 0x20), pos), add(add(replacement, 0x20), offset), length)\n        }\n\n        return buffer;\n    }\n\n    /**\n     * @dev Concatenate an array of bytes into a single bytes object.\n     *\n     * For fixed bytes types, we recommend using the solidity built-in `bytes.concat` or (equivalent)\n     * `abi.encodePacked`.\n     *\n     * NOTE: this could be done in assembly with a single loop that expands starting at the FMP, but that would be\n     * significantly less readable. It might be worth benchmarking the savings of the full-assembly approach.\n     */\n    function concat(bytes[] memory buffers) internal pure returns (bytes memory) {\n        uint256 length = 0;\n        for (uint256 i = 0; i < buffers.length; ++i) {\n            length += buffers[i].length;\n        }\n\n        bytes memory result = new bytes(length);\n\n        uint256 offset = 0x20;\n        for (uint256 i = 0; i < buffers.length; ++i) {\n            bytes memory input = buffers[i];\n            assembly (\"memory-safe\") {\n                mcopy(add(result, offset), add(input, 0x20), mload(input))\n            }\n            unchecked {\n                offset += input.length;\n            }\n        }\n\n        return result;\n    }\n\n    /**\n     * @dev Split each byte in `input` into two nibbles (4 bits each)\n     *\n     * Example: hex\"01234567\" → hex\"0001020304050607\"\n     */\n    function toNibbles(bytes memory input) internal pure returns (bytes memory output) {\n        assembly (\"memory-safe\") {\n            let length := mload(input)\n            output := mload(0x40)\n            mstore(0x40, add(add(output, 0x20), mul(length, 2)))\n            mstore(output, mul(length, 2))\n            for {\n                let i := 0\n            } lt(i, length) {\n                i := add(i, 0x10)\n            } {\n                let chunk := shr(128, mload(add(add(input, 0x20), i)))\n                chunk := and(\n                    0x0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff,\n                    or(shl(64, chunk), chunk)\n                )\n                chunk := and(\n                    0x00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff,\n                    or(shl(32, chunk), chunk)\n                )\n                chunk := and(\n                    0x0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff,\n                    or(shl(16, chunk), chunk)\n                )\n                chunk := and(\n                    0x00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff,\n                    or(shl(8, chunk), chunk)\n                )\n                chunk := and(\n                    0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f,\n                    or(shl(4, chunk), chunk)\n                )\n                mstore(add(add(output, 0x20), mul(i, 2)), chunk)\n            }\n        }\n    }\n\n    /**\n     * @dev Returns true if the two byte buffers are equal.\n     */\n    function equal(bytes memory a, bytes memory b) internal pure returns (bool) {\n        return a.length == b.length && keccak256(a) == keccak256(b);\n    }\n\n    /**\n     * @dev Reverses the byte order of a bytes32 value, converting between little-endian and big-endian.\n     * Inspired by https://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel[Reverse Parallel]\n     */\n    function reverseBytes32(bytes32 value) internal pure returns (bytes32) {\n        value = // swap bytes\n            ((value >> 8) & 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF) |\n            ((value & 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF) << 8);\n        value = // swap 2-byte long pairs\n            ((value >> 16) & 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) |\n            ((value & 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) << 16);\n        value = // swap 4-byte long pairs\n            ((value >> 32) & 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) |\n            ((value & 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) << 32);\n        value = // swap 8-byte long pairs\n            ((value >> 64) & 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) |\n            ((value & 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) << 64);\n        return (value >> 128) | (value << 128); // swap 16-byte long pairs\n    }\n\n    /// @dev Same as {reverseBytes32} but optimized for 128-bit values.\n    function reverseBytes16(bytes16 value) internal pure returns (bytes16) {\n        value = // swap bytes\n            ((value & 0xFF00FF00FF00FF00FF00FF00FF00FF00) >> 8) | ((value & 0x00FF00FF00FF00FF00FF00FF00FF00FF) << 8);\n        value = // swap 2-byte long pairs\n            ((value & 0xFFFF0000FFFF0000FFFF0000FFFF0000) >> 16) | ((value & 0x0000FFFF0000FFFF0000FFFF0000FFFF) << 16);\n        value = // swap 4-byte long pairs\n            ((value & 0xFFFFFFFF00000000FFFFFFFF00000000) >> 32) | ((value & 0x00000000FFFFFFFF00000000FFFFFFFF) << 32);\n        return (value >> 64) | (value << 64); // swap 8-byte long pairs\n    }\n\n    /// @dev Same as {reverseBytes32} but optimized for 64-bit values.\n    function reverseBytes8(bytes8 value) internal pure returns (bytes8) {\n        value = ((value & 0xFF00FF00FF00FF00) >> 8) | ((value & 0x00FF00FF00FF00FF) << 8); // swap bytes\n        value = ((value & 0xFFFF0000FFFF0000) >> 16) | ((value & 0x0000FFFF0000FFFF) << 16); // swap 2-byte long pairs\n        return (value >> 32) | (value << 32); // swap 4-byte long pairs\n    }\n\n    /// @dev Same as {reverseBytes32} but optimized for 32-bit values.\n    function reverseBytes4(bytes4 value) internal pure returns (bytes4) {\n        value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); // swap bytes\n        return (value >> 16) | (value << 16); // swap 2-byte long pairs\n    }\n\n    /// @dev Same as {reverseBytes32} but optimized for 16-bit values.\n    function reverseBytes2(bytes2 value) internal pure returns (bytes2) {\n        return (value >> 8) | (value << 8);\n    }\n\n    /**\n     * @dev Counts the number of leading zero bits a bytes array. Returns `8 * buffer.length`\n     * if the buffer is all zeros.\n     */\n    function clz(bytes memory buffer) internal pure returns (uint256) {\n        for (uint256 i = 0; i < buffer.length; i += 0x20) {\n            bytes32 chunk = _unsafeReadBytesOffset(buffer, i);\n            if (chunk != bytes32(0)) {\n                return Math.min(8 * i + Math.clz(uint256(chunk)), 8 * buffer.length);\n            }\n        }\n        return 8 * buffer.length;\n    }\n\n    /**\n     * @dev Reads a bytes32 from a bytes array without bounds checking.\n     *\n     * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the\n     * assembly block as such would prevent some optimizations.\n     */\n    function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {\n        // This is not memory safe in the general case, but all calls to this private function are within bounds.\n        assembly (\"memory-safe\") {\n            value := mload(add(add(buffer, 0x20), offset))\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/cryptography/MessageHashUtils.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.6.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.24;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n    error ERC5267ExtensionsNotSupported();\n\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x45` (`personal_sign` messages).\n     *\n     * The digest is calculated by prefixing a bytes32 `messageHash` with\n     * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n     * hash signed when using the https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign[`eth_sign`] JSON-RPC method.\n     *\n     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n     * keccak256, although any bytes32 value can be safely used because the final digest will\n     * be re-hashed.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n        }\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x45` (`personal_sign` messages).\n     *\n     * The digest is calculated by prefixing an arbitrary `message` with\n     * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n     * hash signed when using the https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign[`eth_sign`] JSON-RPC method.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n        return\n            keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x00` (data with intended validator).\n     *\n     * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n     * `validator` address. Then hashing the result.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n    }\n\n    /**\n     * @dev Variant of {toDataWithIntendedValidatorHash-address-bytes} optimized for cases where `data` is a bytes32.\n     */\n    function toDataWithIntendedValidatorHash(\n        address validator,\n        bytes32 messageHash\n    ) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, hex\"19_00\")\n            mstore(0x02, shl(96, validator))\n            mstore(0x16, messageHash)\n            digest := keccak256(0x00, 0x36)\n        }\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n     *\n     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n     * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            mstore(ptr, hex\"19_01\")\n            mstore(add(ptr, 0x02), domainSeparator)\n            mstore(add(ptr, 0x22), structHash)\n            digest := keccak256(ptr, 0x42)\n        }\n    }\n\n    /**\n     * @dev Returns the EIP-712 domain separator constructed from an `eip712Domain`. See {IERC5267-eip712Domain}\n     *\n     * This function dynamically constructs the domain separator based on which fields are present in the\n     * `fields` parameter. It contains flags that indicate which domain fields are present:\n     *\n     * * Bit 0 (0x01): name\n     * * Bit 1 (0x02): version\n     * * Bit 2 (0x04): chainId\n     * * Bit 3 (0x08): verifyingContract\n     * * Bit 4 (0x10): salt\n     *\n     * Arguments that correspond to fields which are not present in `fields` are ignored. For example, if `fields` is\n     * `0x0f` (`0b01111`), then the `salt` parameter is ignored.\n     */\n    function toDomainSeparator(\n        bytes1 fields,\n        string memory name,\n        string memory version,\n        uint256 chainId,\n        address verifyingContract,\n        bytes32 salt\n    ) internal pure returns (bytes32 hash) {\n        return\n            toDomainSeparator(\n                fields,\n                keccak256(bytes(name)),\n                keccak256(bytes(version)),\n                chainId,\n                verifyingContract,\n                salt\n            );\n    }\n\n    /// @dev Variant of {toDomainSeparator-bytes1-string-string-uint256-address-bytes32} that uses hashed name and version.\n    function toDomainSeparator(\n        bytes1 fields,\n        bytes32 nameHash,\n        bytes32 versionHash,\n        uint256 chainId,\n        address verifyingContract,\n        bytes32 salt\n    ) internal pure returns (bytes32 hash) {\n        bytes32 domainTypeHash = toDomainTypeHash(fields);\n\n        assembly (\"memory-safe\") {\n            // align fields to the right for easy processing\n            fields := shr(248, fields)\n\n            // FMP used as scratch space\n            let fmp := mload(0x40)\n            mstore(fmp, domainTypeHash)\n\n            let ptr := add(fmp, 0x20)\n            if and(fields, 0x01) {\n                mstore(ptr, nameHash)\n                ptr := add(ptr, 0x20)\n            }\n            if and(fields, 0x02) {\n                mstore(ptr, versionHash)\n                ptr := add(ptr, 0x20)\n            }\n            if and(fields, 0x04) {\n                mstore(ptr, chainId)\n                ptr := add(ptr, 0x20)\n            }\n            if and(fields, 0x08) {\n                mstore(ptr, verifyingContract)\n                ptr := add(ptr, 0x20)\n            }\n            if and(fields, 0x10) {\n                mstore(ptr, salt)\n                ptr := add(ptr, 0x20)\n            }\n\n            hash := keccak256(fmp, sub(ptr, fmp))\n        }\n    }\n\n    /// @dev Builds an EIP-712 domain type hash depending on the `fields` provided, following https://eips.ethereum.org/EIPS/eip-5267[ERC-5267]\n    function toDomainTypeHash(bytes1 fields) internal pure returns (bytes32 hash) {\n        if (fields & 0x20 == 0x20) revert ERC5267ExtensionsNotSupported();\n\n        assembly (\"memory-safe\") {\n            // align fields to the right for easy processing\n            fields := shr(248, fields)\n\n            // FMP used as scratch space\n            let fmp := mload(0x40)\n            mstore(fmp, \"EIP712Domain(\")\n\n            let ptr := add(fmp, 0x0d)\n            // name field\n            if and(fields, 0x01) {\n                mstore(ptr, \"string name,\")\n                ptr := add(ptr, 0x0c)\n            }\n            // version field\n            if and(fields, 0x02) {\n                mstore(ptr, \"string version,\")\n                ptr := add(ptr, 0x0f)\n            }\n            // chainId field\n            if and(fields, 0x04) {\n                mstore(ptr, \"uint256 chainId,\")\n                ptr := add(ptr, 0x10)\n            }\n            // verifyingContract field\n            if and(fields, 0x08) {\n                mstore(ptr, \"address verifyingContract,\")\n                ptr := add(ptr, 0x1a)\n            }\n            // salt field\n            if and(fields, 0x10) {\n                mstore(ptr, \"bytes32 salt,\")\n                ptr := add(ptr, 0x0d)\n            }\n            // if any field is enabled, remove the trailing comma\n            ptr := sub(ptr, iszero(iszero(and(fields, 0x1f))))\n            // add the closing brace\n            mstore8(ptr, 0x29) // add closing brace\n            ptr := add(ptr, 1)\n\n            hash := keccak256(fmp, sub(ptr, fmp))\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/Arrays.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (utils/Arrays.sol)\n// This file was procedurally generated from scripts/generate/templates/Arrays.js.\n\npragma solidity ^0.8.24;\n\nimport {Comparators} from \"./Comparators.sol\";\nimport {SlotDerivation} from \"./SlotDerivation.sol\";\nimport {StorageSlot} from \"./StorageSlot.sol\";\nimport {Math} from \"./math/Math.sol\";\n\n/**\n * @dev Collection of functions related to array types.\n */\nlibrary Arrays {\n    using SlotDerivation for bytes32;\n    using StorageSlot for bytes32;\n\n    /**\n     * @dev Sort an array of uint256 (in memory) following the provided comparator function.\n     *\n     * This function does the sorting \"in place\", meaning that it overrides the input. The object is returned for\n     * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array.\n     *\n     * NOTE: this function's cost is `O(n · log(n))` in average and `O(n²)` in the worst case, with n the length of the\n     * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful\n     * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may\n     * consume more gas than is available in a block, leading to potential DoS.\n     *\n     * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.\n     */\n    function sort(\n        uint256[] memory array,\n        function(uint256, uint256) pure returns (bool) comp\n    ) internal pure returns (uint256[] memory) {\n        _quickSort(_begin(array), _end(array), comp);\n        return array;\n    }\n\n    /**\n     * @dev Variant of {sort} that sorts an array of uint256 in increasing order.\n     */\n    function sort(uint256[] memory array) internal pure returns (uint256[] memory) {\n        sort(array, Comparators.lt);\n        return array;\n    }\n\n    /**\n     * @dev Sort an array of address (in memory) following the provided comparator function.\n     *\n     * This function does the sorting \"in place\", meaning that it overrides the input. The object is returned for\n     * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array.\n     *\n     * NOTE: this function's cost is `O(n · log(n))` in average and `O(n²)` in the worst case, with n the length of the\n     * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful\n     * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may\n     * consume more gas than is available in a block, leading to potential DoS.\n     *\n     * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.\n     */\n    function sort(\n        address[] memory array,\n        function(address, address) pure returns (bool) comp\n    ) internal pure returns (address[] memory) {\n        sort(_castToUint256Array(array), _castToUint256Comp(comp));\n        return array;\n    }\n\n    /**\n     * @dev Variant of {sort} that sorts an array of address in increasing order.\n     */\n    function sort(address[] memory array) internal pure returns (address[] memory) {\n        sort(_castToUint256Array(array), Comparators.lt);\n        return array;\n    }\n\n    /**\n     * @dev Sort an array of bytes32 (in memory) following the provided comparator function.\n     *\n     * This function does the sorting \"in place\", meaning that it overrides the input. The object is returned for\n     * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array.\n     *\n     * NOTE: this function's cost is `O(n · log(n))` in average and `O(n²)` in the worst case, with n the length of the\n     * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful\n     * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may\n     * consume more gas than is available in a block, leading to potential DoS.\n     *\n     * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.\n     */\n    function sort(\n        bytes32[] memory array,\n        function(bytes32, bytes32) pure returns (bool) comp\n    ) internal pure returns (bytes32[] memory) {\n        sort(_castToUint256Array(array), _castToUint256Comp(comp));\n        return array;\n    }\n\n    /**\n     * @dev Variant of {sort} that sorts an array of bytes32 in increasing order.\n     */\n    function sort(bytes32[] memory array) internal pure returns (bytes32[] memory) {\n        sort(_castToUint256Array(array), Comparators.lt);\n        return array;\n    }\n\n    /**\n     * @dev Performs a quick sort of a segment of memory. The segment sorted starts at `begin` (inclusive), and stops\n     * at end (exclusive). Sorting follows the `comp` comparator.\n     *\n     * Invariant: `begin <= end`. This is the case when initially called by {sort} and is preserved in subcalls.\n     *\n     * IMPORTANT: Memory locations between `begin` and `end` are not validated/zeroed. This function should\n     * be used only if the limits are within a memory array.\n     */\n    function _quickSort(uint256 begin, uint256 end, function(uint256, uint256) pure returns (bool) comp) private pure {\n        unchecked {\n            while (end - begin > 0x20) {\n                // Use first element as pivot\n                uint256 pivot = _mload(begin);\n                // Position where the pivot should be at the end of the loop\n                uint256 pos = begin;\n\n                for (uint256 it = begin + 0x20; it < end; it += 0x20) {\n                    if (comp(_mload(it), pivot)) {\n                        // If the value stored at the iterator's position comes before the pivot, we increment the\n                        // position of the pivot and move the value there.\n                        pos += 0x20;\n                        _swap(pos, it);\n                    }\n                }\n\n                _swap(begin, pos); // Swap pivot into place\n\n                // Recurse on the smaller partition, iterate on the larger one.\n                uint256 middle = pos + 0x20;\n                if (pos - begin < end - middle) {\n                    _quickSort(begin, pos, comp);\n                    begin = middle;\n                } else {\n                    _quickSort(middle, end, comp);\n                    end = pos;\n                }\n            }\n        }\n    }\n\n    /**\n     * @dev Pointer to the memory location of the first element of `array`.\n     */\n    function _begin(uint256[] memory array) private pure returns (uint256 ptr) {\n        assembly (\"memory-safe\") {\n            ptr := add(array, 0x20)\n        }\n    }\n\n    /**\n     * @dev Pointer to the memory location of the first memory word (32bytes) after `array`. This is the memory word\n     * that comes just after the last element of the array.\n     */\n    function _end(uint256[] memory array) private pure returns (uint256 ptr) {\n        unchecked {\n            return _begin(array) + array.length * 0x20;\n        }\n    }\n\n    /**\n     * @dev Load memory word (as a uint256) at location `ptr`.\n     */\n    function _mload(uint256 ptr) private pure returns (uint256 value) {\n        assembly {\n            value := mload(ptr)\n        }\n    }\n\n    /**\n     * @dev Swaps the elements memory location `ptr1` and `ptr2`.\n     */\n    function _swap(uint256 ptr1, uint256 ptr2) private pure {\n        assembly {\n            let value1 := mload(ptr1)\n            let value2 := mload(ptr2)\n            mstore(ptr1, value2)\n            mstore(ptr2, value1)\n        }\n    }\n\n    /// @dev Helper: low level cast address memory array to uint256 memory array\n    function _castToUint256Array(address[] memory input) private pure returns (uint256[] memory output) {\n        assembly {\n            output := input\n        }\n    }\n\n    /// @dev Helper: low level cast bytes32 memory array to uint256 memory array\n    function _castToUint256Array(bytes32[] memory input) private pure returns (uint256[] memory output) {\n        assembly {\n            output := input\n        }\n    }\n\n    /// @dev Helper: low level cast address comp function to uint256 comp function\n    function _castToUint256Comp(\n        function(address, address) pure returns (bool) input\n    ) private pure returns (function(uint256, uint256) pure returns (bool) output) {\n        assembly {\n            output := input\n        }\n    }\n\n    /// @dev Helper: low level cast bytes32 comp function to uint256 comp function\n    function _castToUint256Comp(\n        function(bytes32, bytes32) pure returns (bool) input\n    ) private pure returns (function(uint256, uint256) pure returns (bool) output) {\n        assembly {\n            output := input\n        }\n    }\n\n    /**\n     * @dev Searches a sorted `array` and returns the first index that contains\n     * a value greater or equal to `element`. If no such index exists (i.e. all\n     * values in the array are strictly less than `element`), the array length is\n     * returned. Time complexity O(log n).\n     *\n     * NOTE: The `array` is expected to be sorted in ascending order, and to\n     * contain no repeated elements.\n     *\n     * IMPORTANT: Deprecated. This implementation behaves as {lowerBound} but lacks\n     * support for repeated elements in the array. The {lowerBound} function should\n     * be used instead.\n     */\n    function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n        uint256 low = 0;\n        uint256 high = array.length;\n\n        if (high == 0) {\n            return 0;\n        }\n\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n\n            // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n            // because Math.average rounds towards zero (it does integer division with truncation).\n            if (unsafeAccess(array, mid).value > element) {\n                high = mid;\n            } else {\n                low = mid + 1;\n            }\n        }\n\n        // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\n        if (low > 0 && unsafeAccess(array, low - 1).value == element) {\n            return low - 1;\n        } else {\n            return low;\n        }\n    }\n\n    /**\n     * @dev Searches an `array` sorted in ascending order and returns the first\n     * index that contains a value greater or equal than `element`. If no such index\n     * exists (i.e. all values in the array are strictly less than `element`), the array\n     * length is returned. Time complexity O(log n).\n     *\n     * See C++'s https://en.cppreference.com/w/cpp/algorithm/lower_bound[lower_bound].\n     */\n    function lowerBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n        uint256 low = 0;\n        uint256 high = array.length;\n\n        if (high == 0) {\n            return 0;\n        }\n\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n\n            // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n            // because Math.average rounds towards zero (it does integer division with truncation).\n            if (unsafeAccess(array, mid).value < element) {\n                // this cannot overflow because mid < high\n                unchecked {\n                    low = mid + 1;\n                }\n            } else {\n                high = mid;\n            }\n        }\n\n        return low;\n    }\n\n    /**\n     * @dev Searches an `array` sorted in ascending order and returns the first\n     * index that contains a value strictly greater than `element`. If no such index\n     * exists (i.e. all values in the array are strictly less than `element`), the array\n     * length is returned. Time complexity O(log n).\n     *\n     * See C++'s https://en.cppreference.com/w/cpp/algorithm/upper_bound[upper_bound].\n     */\n    function upperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n        uint256 low = 0;\n        uint256 high = array.length;\n\n        if (high == 0) {\n            return 0;\n        }\n\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n\n            // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n            // because Math.average rounds towards zero (it does integer division with truncation).\n            if (unsafeAccess(array, mid).value > element) {\n                high = mid;\n            } else {\n                // this cannot overflow because mid < high\n                unchecked {\n                    low = mid + 1;\n                }\n            }\n        }\n\n        return low;\n    }\n\n    /**\n     * @dev Same as {lowerBound}, but with an array in memory.\n     */\n    function lowerBoundMemory(uint256[] memory array, uint256 element) internal pure returns (uint256) {\n        uint256 low = 0;\n        uint256 high = array.length;\n\n        if (high == 0) {\n            return 0;\n        }\n\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n\n            // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n            // because Math.average rounds towards zero (it does integer division with truncation).\n            if (unsafeMemoryAccess(array, mid) < element) {\n                // this cannot overflow because mid < high\n                unchecked {\n                    low = mid + 1;\n                }\n            } else {\n                high = mid;\n            }\n        }\n\n        return low;\n    }\n\n    /**\n     * @dev Same as {upperBound}, but with an array in memory.\n     */\n    function upperBoundMemory(uint256[] memory array, uint256 element) internal pure returns (uint256) {\n        uint256 low = 0;\n        uint256 high = array.length;\n\n        if (high == 0) {\n            return 0;\n        }\n\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n\n            // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n            // because Math.average rounds towards zero (it does integer division with truncation).\n            if (unsafeMemoryAccess(array, mid) > element) {\n                high = mid;\n            } else {\n                // this cannot overflow because mid < high\n                unchecked {\n                    low = mid + 1;\n                }\n            }\n        }\n\n        return low;\n    }\n\n    /**\n     * @dev Copies the content of `array`, from `start` (included) to the end of `array` into a new address array in\n     * memory.\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice[Javascript's `Array.slice`]\n     */\n    function slice(address[] memory array, uint256 start) internal pure returns (address[] memory) {\n        return slice(array, start, array.length);\n    }\n\n    /**\n     * @dev Copies the content of `array`, from `start` (included) to `end` (excluded) into a new address array in\n     * memory. The `end` argument is truncated to the length of the `array`.\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice[Javascript's `Array.slice`]\n     */\n    function slice(address[] memory array, uint256 start, uint256 end) internal pure returns (address[] memory) {\n        // sanitize\n        end = Math.min(end, array.length);\n        start = Math.min(start, end);\n\n        // allocate and copy\n        address[] memory result = new address[](end - start);\n        assembly (\"memory-safe\") {\n            mcopy(add(result, 0x20), add(add(array, 0x20), mul(start, 0x20)), mul(sub(end, start), 0x20))\n        }\n\n        return result;\n    }\n\n    /**\n     * @dev Copies the content of `array`, from `start` (included) to the end of `array` into a new bytes32 array in\n     * memory.\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice[Javascript's `Array.slice`]\n     */\n    function slice(bytes32[] memory array, uint256 start) internal pure returns (bytes32[] memory) {\n        return slice(array, start, array.length);\n    }\n\n    /**\n     * @dev Copies the content of `array`, from `start` (included) to `end` (excluded) into a new bytes32 array in\n     * memory. The `end` argument is truncated to the length of the `array`.\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice[Javascript's `Array.slice`]\n     */\n    function slice(bytes32[] memory array, uint256 start, uint256 end) internal pure returns (bytes32[] memory) {\n        // sanitize\n        end = Math.min(end, array.length);\n        start = Math.min(start, end);\n\n        // allocate and copy\n        bytes32[] memory result = new bytes32[](end - start);\n        assembly (\"memory-safe\") {\n            mcopy(add(result, 0x20), add(add(array, 0x20), mul(start, 0x20)), mul(sub(end, start), 0x20))\n        }\n\n        return result;\n    }\n\n    /**\n     * @dev Copies the content of `array`, from `start` (included) to the end of `array` into a new uint256 array in\n     * memory.\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice[Javascript's `Array.slice`]\n     */\n    function slice(uint256[] memory array, uint256 start) internal pure returns (uint256[] memory) {\n        return slice(array, start, array.length);\n    }\n\n    /**\n     * @dev Copies the content of `array`, from `start` (included) to `end` (excluded) into a new uint256 array in\n     * memory. The `end` argument is truncated to the length of the `array`.\n     *\n     * NOTE: replicates the behavior of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice[Javascript's `Array.slice`]\n     */\n    function slice(uint256[] memory array, uint256 start, uint256 end) internal pure returns (uint256[] memory) {\n        // sanitize\n        end = Math.min(end, array.length);\n        start = Math.min(start, end);\n\n        // allocate and copy\n        uint256[] memory result = new uint256[](end - start);\n        assembly (\"memory-safe\") {\n            mcopy(add(result, 0x20), add(add(array, 0x20), mul(start, 0x20)), mul(sub(end, start), 0x20))\n        }\n\n        return result;\n    }\n\n    /**\n     * @dev Moves the content of `array`, from `start` (included) to the end of `array` to the start of that array,\n     * and shrinks the array length accordingly, effectively overwriting the array with array[start:].\n     *\n     * NOTE: This function modifies the provided array in place. If you need to preserve the original array, use {slice} instead.\n     */\n    function splice(address[] memory array, uint256 start) internal pure returns (address[] memory) {\n        return splice(array, start, array.length);\n    }\n\n    /**\n     * @dev Moves the content of `array`, from `start` (included) to `end` (excluded) to the start of that array,\n     * and shrinks the array length accordingly, effectively overwriting the array with array[start:end]. The\n     * `end` argument is truncated to the length of the `array`.\n     *\n     * NOTE: This function modifies the provided array in place. If you need to preserve the original array, use {slice} instead.\n     */\n    function splice(address[] memory array, uint256 start, uint256 end) internal pure returns (address[] memory) {\n        // sanitize\n        end = Math.min(end, array.length);\n        start = Math.min(start, end);\n\n        // move and resize\n        assembly (\"memory-safe\") {\n            mcopy(add(array, 0x20), add(add(array, 0x20), mul(start, 0x20)), mul(sub(end, start), 0x20))\n            mstore(array, sub(end, start))\n        }\n\n        return array;\n    }\n\n    /**\n     * @dev Replaces elements in `array` starting at `pos` with all elements from `replacement`.\n     *\n     * Parameters are clamped to valid ranges (e.g. `pos` is clamped to `[0, array.length]`).\n     * If `pos >= array.length`, no replacement occurs and the array is returned unchanged.\n     *\n     * NOTE: This function modifies the provided array in place.\n     */\n    function replace(\n        address[] memory array,\n        uint256 pos,\n        address[] memory replacement\n    ) internal pure returns (address[] memory) {\n        return replace(array, pos, replacement, 0, replacement.length);\n    }\n\n    /**\n     * @dev Replaces elements in `array` starting at `pos` with elements from `replacement` starting at `offset`.\n     * Copies at most `length` elements from `replacement` to `array`.\n     *\n     * Parameters are clamped to valid ranges (i.e. `pos` is clamped to `[0, array.length]`, `offset` is\n     * clamped to `[0, replacement.length]`, and `length` is clamped to `min(length, replacement.length - offset,\n     * array.length - pos)`). If `pos >= array.length` or `offset >= replacement.length`, no replacement occurs\n     * and the array is returned unchanged.\n     *\n     * NOTE: This function modifies the provided array in place.\n     */\n    function replace(\n        address[] memory array,\n        uint256 pos,\n        address[] memory replacement,\n        uint256 offset,\n        uint256 length\n    ) internal pure returns (address[] memory) {\n        // sanitize\n        pos = Math.min(pos, array.length);\n        offset = Math.min(offset, replacement.length);\n        length = Math.min(length, Math.min(replacement.length - offset, array.length - pos));\n\n        // replace\n        assembly (\"memory-safe\") {\n            mcopy(\n                add(add(array, 0x20), mul(pos, 0x20)),\n                add(add(replacement, 0x20), mul(offset, 0x20)),\n                mul(length, 0x20)\n            )\n        }\n\n        return array;\n    }\n\n    /**\n     * @dev Moves the content of `array`, from `start` (included) to the end of `array` to the start of that array,\n     * and shrinks the array length accordingly, effectively overwriting the array with array[start:].\n     *\n     * NOTE: This function modifies the provided array in place. If you need to preserve the original array, use {slice} instead.\n     */\n    function splice(bytes32[] memory array, uint256 start) internal pure returns (bytes32[] memory) {\n        return splice(array, start, array.length);\n    }\n\n    /**\n     * @dev Moves the content of `array`, from `start` (included) to `end` (excluded) to the start of that array,\n     * and shrinks the array length accordingly, effectively overwriting the array with array[start:end]. The\n     * `end` argument is truncated to the length of the `array`.\n     *\n     * NOTE: This function modifies the provided array in place. If you need to preserve the original array, use {slice} instead.\n     */\n    function splice(bytes32[] memory array, uint256 start, uint256 end) internal pure returns (bytes32[] memory) {\n        // sanitize\n        end = Math.min(end, array.length);\n        start = Math.min(start, end);\n\n        // move and resize\n        assembly (\"memory-safe\") {\n            mcopy(add(array, 0x20), add(add(array, 0x20), mul(start, 0x20)), mul(sub(end, start), 0x20))\n            mstore(array, sub(end, start))\n        }\n\n        return array;\n    }\n\n    /**\n     * @dev Replaces elements in `array` starting at `pos` with all elements from `replacement`.\n     *\n     * Parameters are clamped to valid ranges (e.g. `pos` is clamped to `[0, array.length]`).\n     * If `pos >= array.length`, no replacement occurs and the array is returned unchanged.\n     *\n     * NOTE: This function modifies the provided array in place.\n     */\n    function replace(\n        bytes32[] memory array,\n        uint256 pos,\n        bytes32[] memory replacement\n    ) internal pure returns (bytes32[] memory) {\n        return replace(array, pos, replacement, 0, replacement.length);\n    }\n\n    /**\n     * @dev Replaces elements in `array` starting at `pos` with elements from `replacement` starting at `offset`.\n     * Copies at most `length` elements from `replacement` to `array`.\n     *\n     * Parameters are clamped to valid ranges (i.e. `pos` is clamped to `[0, array.length]`, `offset` is\n     * clamped to `[0, replacement.length]`, and `length` is clamped to `min(length, replacement.length - offset,\n     * array.length - pos)`). If `pos >= array.length` or `offset >= replacement.length`, no replacement occurs\n     * and the array is returned unchanged.\n     *\n     * NOTE: This function modifies the provided array in place.\n     */\n    function replace(\n        bytes32[] memory array,\n        uint256 pos,\n        bytes32[] memory replacement,\n        uint256 offset,\n        uint256 length\n    ) internal pure returns (bytes32[] memory) {\n        // sanitize\n        pos = Math.min(pos, array.length);\n        offset = Math.min(offset, replacement.length);\n        length = Math.min(length, Math.min(replacement.length - offset, array.length - pos));\n\n        // replace\n        assembly (\"memory-safe\") {\n            mcopy(\n                add(add(array, 0x20), mul(pos, 0x20)),\n                add(add(replacement, 0x20), mul(offset, 0x20)),\n                mul(length, 0x20)\n            )\n        }\n\n        return array;\n    }\n\n    /**\n     * @dev Moves the content of `array`, from `start` (included) to the end of `array` to the start of that array,\n     * and shrinks the array length accordingly, effectively overwriting the array with array[start:].\n     *\n     * NOTE: This function modifies the provided array in place. If you need to preserve the original array, use {slice} instead.\n     */\n    function splice(uint256[] memory array, uint256 start) internal pure returns (uint256[] memory) {\n        return splice(array, start, array.length);\n    }\n\n    /**\n     * @dev Moves the content of `array`, from `start` (included) to `end` (excluded) to the start of that array,\n     * and shrinks the array length accordingly, effectively overwriting the array with array[start:end]. The\n     * `end` argument is truncated to the length of the `array`.\n     *\n     * NOTE: This function modifies the provided array in place. If you need to preserve the original array, use {slice} instead.\n     */\n    function splice(uint256[] memory array, uint256 start, uint256 end) internal pure returns (uint256[] memory) {\n        // sanitize\n        end = Math.min(end, array.length);\n        start = Math.min(start, end);\n\n        // move and resize\n        assembly (\"memory-safe\") {\n            mcopy(add(array, 0x20), add(add(array, 0x20), mul(start, 0x20)), mul(sub(end, start), 0x20))\n            mstore(array, sub(end, start))\n        }\n\n        return array;\n    }\n\n    /**\n     * @dev Replaces elements in `array` starting at `pos` with all elements from `replacement`.\n     *\n     * Parameters are clamped to valid ranges (e.g. `pos` is clamped to `[0, array.length]`).\n     * If `pos >= array.length`, no replacement occurs and the array is returned unchanged.\n     *\n     * NOTE: This function modifies the provided array in place.\n     */\n    function replace(\n        uint256[] memory array,\n        uint256 pos,\n        uint256[] memory replacement\n    ) internal pure returns (uint256[] memory) {\n        return replace(array, pos, replacement, 0, replacement.length);\n    }\n\n    /**\n     * @dev Replaces elements in `array` starting at `pos` with elements from `replacement` starting at `offset`.\n     * Copies at most `length` elements from `replacement` to `array`.\n     *\n     * Parameters are clamped to valid ranges (i.e. `pos` is clamped to `[0, array.length]`, `offset` is\n     * clamped to `[0, replacement.length]`, and `length` is clamped to `min(length, replacement.length - offset,\n     * array.length - pos)`). If `pos >= array.length` or `offset >= replacement.length`, no replacement occurs\n     * and the array is returned unchanged.\n     *\n     * NOTE: This function modifies the provided array in place.\n     */\n    function replace(\n        uint256[] memory array,\n        uint256 pos,\n        uint256[] memory replacement,\n        uint256 offset,\n        uint256 length\n    ) internal pure returns (uint256[] memory) {\n        // sanitize\n        pos = Math.min(pos, array.length);\n        offset = Math.min(offset, replacement.length);\n        length = Math.min(length, Math.min(replacement.length - offset, array.length - pos));\n\n        // replace\n        assembly (\"memory-safe\") {\n            mcopy(\n                add(add(array, 0x20), mul(pos, 0x20)),\n                add(add(replacement, 0x20), mul(offset, 0x20)),\n                mul(length, 0x20)\n            )\n        }\n\n        return array;\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) {\n        bytes32 slot;\n        assembly (\"memory-safe\") {\n            slot := arr.slot\n        }\n        return slot.deriveArray().offset(pos).getAddressSlot();\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) {\n        bytes32 slot;\n        assembly (\"memory-safe\") {\n            slot := arr.slot\n        }\n        return slot.deriveArray().offset(pos).getBytes32Slot();\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) {\n        bytes32 slot;\n        assembly (\"memory-safe\") {\n            slot := arr.slot\n        }\n        return slot.deriveArray().offset(pos).getUint256Slot();\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeAccess(bytes[] storage arr, uint256 pos) internal pure returns (StorageSlot.BytesSlot storage) {\n        bytes32 slot;\n        assembly (\"memory-safe\") {\n            slot := arr.slot\n        }\n        return slot.deriveArray().offset(pos).getBytesSlot();\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeAccess(string[] storage arr, uint256 pos) internal pure returns (StorageSlot.StringSlot storage) {\n        bytes32 slot;\n        assembly (\"memory-safe\") {\n            slot := arr.slot\n        }\n        return slot.deriveArray().offset(pos).getStringSlot();\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) {\n        assembly {\n            res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n        }\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeMemoryAccess(bytes32[] memory arr, uint256 pos) internal pure returns (bytes32 res) {\n        assembly {\n            res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n        }\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) {\n        assembly {\n            res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n        }\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeMemoryAccess(bytes[] memory arr, uint256 pos) internal pure returns (bytes memory res) {\n        assembly {\n            res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n        }\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeMemoryAccess(string[] memory arr, uint256 pos) internal pure returns (string memory res) {\n        assembly {\n            res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n        }\n    }\n\n    /**\n     * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\n     *\n     * WARNING: this does not clear elements if length is reduced, or initialize elements if length is increased.\n     */\n    function unsafeSetLength(address[] storage array, uint256 len) internal {\n        assembly (\"memory-safe\") {\n            sstore(array.slot, len)\n        }\n    }\n\n    /**\n     * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\n     *\n     * WARNING: this does not clear elements if length is reduced, or initialize elements if length is increased.\n     */\n    function unsafeSetLength(bytes32[] storage array, uint256 len) internal {\n        assembly (\"memory-safe\") {\n            sstore(array.slot, len)\n        }\n    }\n\n    /**\n     * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\n     *\n     * WARNING: this does not clear elements if length is reduced, or initialize elements if length is increased.\n     */\n    function unsafeSetLength(uint256[] storage array, uint256 len) internal {\n        assembly (\"memory-safe\") {\n            sstore(array.slot, len)\n        }\n    }\n\n    /**\n     * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\n     *\n     * WARNING: this does not clear elements if length is reduced, or initialize elements if length is increased.\n     */\n    function unsafeSetLength(bytes[] storage array, uint256 len) internal {\n        assembly (\"memory-safe\") {\n            sstore(array.slot, len)\n        }\n    }\n\n    /**\n     * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\n     *\n     * WARNING: this does not clear elements if length is reduced, or initialize elements if length is increased.\n     */\n    function unsafeSetLength(string[] storage array, uint256 len) internal {\n        assembly (\"memory-safe\") {\n            sstore(array.slot, len)\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n    /**\n     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n     * address.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy.\n     */\n    function proxiableUUID() external view returns (bytes32);\n}\n"},"lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Utils.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.6.0) (proxy/ERC1967/ERC1967Utils.sol)\n\npragma solidity ^0.8.21;\n\nimport {IBeacon} from \"../beacon/IBeacon.sol\";\nimport {IERC1967} from \"../../interfaces/IERC1967.sol\";\nimport {Address} from \"../../utils/Address.sol\";\nimport {StorageSlot} from \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This library provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.\n */\nlibrary ERC1967Utils {\n    /**\n     * @dev Storage slot with the address of the current implementation.\n     * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev The `implementation` of the proxy is invalid.\n     */\n    error ERC1967InvalidImplementation(address implementation);\n\n    /**\n     * @dev The `admin` of the proxy is invalid.\n     */\n    error ERC1967InvalidAdmin(address admin);\n\n    /**\n     * @dev The `beacon` of the proxy is invalid.\n     */\n    error ERC1967InvalidBeacon(address beacon);\n\n    /**\n     * @dev An upgrade function sees `msg.value > 0` that may be lost.\n     */\n    error ERC1967NonPayable();\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function getImplementation() internal view returns (address) {\n        return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the ERC-1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        if (newImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(newImplementation);\n        }\n        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Performs implementation upgrade with additional setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) internal {\n        _setImplementation(newImplementation);\n        emit IERC1967.Upgraded(newImplementation);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(newImplementation, data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Storage slot with the admin of the contract.\n     * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /**\n     * @dev Returns the current admin.\n     *\n     * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\n     * the https://ethereum.org/developers/docs/apis/json-rpc/#eth_getstorageat[`eth_getStorageAt`] RPC call.\n     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n     */\n    function getAdmin() internal view returns (address) {\n        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the ERC-1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        if (newAdmin == address(0)) {\n            revert ERC1967InvalidAdmin(address(0));\n        }\n        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {IERC1967-AdminChanged} event.\n     */\n    function changeAdmin(address newAdmin) internal {\n        emit IERC1967.AdminChanged(getAdmin(), newAdmin);\n        _setAdmin(newAdmin);\n    }\n\n    /**\n     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n     * This is the keccak-256 hash of \"eip1967.proxy.beacon\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n    /**\n     * @dev Returns the current beacon.\n     */\n    function getBeacon() internal view returns (address) {\n        return StorageSlot.getAddressSlot(BEACON_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new beacon in the ERC-1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        if (newBeacon.code.length == 0) {\n            revert ERC1967InvalidBeacon(newBeacon);\n        }\n\n        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\n\n        address beaconImplementation = IBeacon(newBeacon).implementation();\n        if (beaconImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(beaconImplementation);\n        }\n    }\n\n    /**\n     * @dev Change the beacon and trigger a setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-BeaconUpgraded} event.\n     *\n     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\n     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\n     * efficiency.\n     */\n    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\n        _setBeacon(newBeacon);\n        emit IERC1967.BeaconUpgraded(newBeacon);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\n     * if an upgrade doesn't perform an initialization call.\n     */\n    function _checkNonPayable() private {\n        if (msg.value > 0) {\n            revert ERC1967NonPayable();\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/Panic.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n *      using Panic for uint256;\n *\n *      // Use any of the declared internal constants\n *      function foo() { Panic.GENERIC.panic(); }\n *\n *      // Alternatively\n *      function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n    /// @dev generic / unspecified error\n    uint256 internal constant GENERIC = 0x00;\n    /// @dev used by the assert() builtin\n    uint256 internal constant ASSERT = 0x01;\n    /// @dev arithmetic underflow or overflow\n    uint256 internal constant UNDER_OVERFLOW = 0x11;\n    /// @dev division or modulo by zero\n    uint256 internal constant DIVISION_BY_ZERO = 0x12;\n    /// @dev enum conversion error\n    uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n    /// @dev invalid encoding in storage\n    uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n    /// @dev empty array pop\n    uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n    /// @dev array out of bounds access\n    uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n    /// @dev resource error (too large allocation or too large array)\n    uint256 internal constant RESOURCE_ERROR = 0x41;\n    /// @dev calling invalid internal function\n    uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n    /// @dev Reverts with a panic code. Recommended to use with\n    /// the internal constants with predefined codes.\n    function panic(uint256 code) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0x00, 0x4e487b71)\n            mstore(0x20, code)\n            revert(0x1c, 0x24)\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/interfaces/IERC4337.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.7.0) (interfaces/IERC4337.sol)\n\npragma solidity >=0.8.4;\n\n/**\n * @dev A https://github.com/ethereum/ercs/blob/master/ERCS/erc-4337.md#useroperation[user operation] is composed of the following elements:\n * - `sender` (`address`): The account making the operation\n * - `nonce` (`uint256`): Anti-replay parameter (see “Semi-abstracted Nonce Support” )\n * - `factory` (`address`): account factory, only for new accounts\n * - `factoryData` (`bytes`): data for account factory (only if account factory exists)\n * - `callData` (`bytes`): The data to pass to the sender during the main execution call\n * - `callGasLimit` (`uint256`): The amount of gas to allocate the main execution call\n * - `verificationGasLimit` (`uint256`): The amount of gas to allocate for the verification step\n * - `preVerificationGas` (`uint256`): Extra gas to pay the bundler\n * - `maxFeePerGas` (`uint256`): Maximum fee per gas (similar to EIP-1559 max_fee_per_gas)\n * - `maxPriorityFeePerGas` (`uint256`): Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas)\n * - `paymaster` (`address`): Address of paymaster contract, (or empty, if account pays for itself)\n * - `paymasterVerificationGasLimit` (`uint256`): The amount of gas to allocate for the paymaster validation code\n * - `paymasterPostOpGasLimit` (`uint256`): The amount of gas to allocate for the paymaster post-operation code\n * - `paymasterData` (`bytes`): Data for paymaster (only if paymaster exists)\n * - `signature` (`bytes`): Data passed into the account to verify authorization\n *\n * When passed to on-chain contracts, the following packed version is used.\n * - `sender` (`address`)\n * - `nonce` (`uint256`)\n * - `initCode` (`bytes`): concatenation of factory address and factoryData (or empty)\n * - `callData` (`bytes`)\n * - `accountGasLimits` (`bytes32`): concatenation of verificationGas (16 bytes) and callGas (16 bytes)\n * - `preVerificationGas` (`uint256`)\n * - `gasFees` (`bytes32`): concatenation of maxPriorityFeePerGas (16 bytes) and maxFeePerGas (16 bytes)\n * - `paymasterAndData` (`bytes`): concatenation of paymaster fields (or empty)\n *   For EntryPoint v0.9+, may optionally include `paymasterSignature` at the end:\n *   `paymaster || paymasterVerificationGasLimit || paymasterPostOpGasLimit || paymasterData || paymasterSignature || paymasterSignatureSize || PAYMASTER_SIG_MAGIC`\n * - `signature` (`bytes`)\n */\nstruct PackedUserOperation {\n    address sender;\n    uint256 nonce;\n    bytes initCode; // `abi.encodePacked(factory, factoryData)`\n    bytes callData;\n    bytes32 accountGasLimits; // `abi.encodePacked(verificationGasLimit, callGasLimit)` 16 bytes each\n    uint256 preVerificationGas;\n    bytes32 gasFees; // `abi.encodePacked(maxPriorityFeePerGas, maxFeePerGas)` 16 bytes each\n    bytes paymasterAndData; // `abi.encodePacked(paymaster, paymasterVerificationGasLimit, paymasterPostOpGasLimit, paymasterData[, paymasterSignature, paymasterSignatureSize, PAYMASTER_SIG_MAGIC])` (20 bytes, 16 bytes, 16 bytes, dynamic[, dynamic, 2 bytes, 8 bytes])\n    bytes signature;\n}\n\n/**\n * @dev Aggregates and validates multiple signatures for a batch of user operations.\n *\n * A contract could implement this interface with custom validation schemes that allow signature aggregation,\n * enabling significant optimizations and gas savings for execution and transaction data cost.\n *\n * Bundlers and clients whitelist supported aggregators.\n *\n * See https://eips.ethereum.org/EIPS/eip-7766[ERC-7766]\n */\ninterface IAggregator {\n    /**\n     * @dev Validates the signature for a user operation.\n     * Returns an alternative signature that should be used during bundling.\n     */\n    function validateUserOpSignature(\n        PackedUserOperation calldata userOp\n    ) external view returns (bytes memory sigForUserOp);\n\n    /**\n     * @dev Returns an aggregated signature for a batch of user operation's signatures.\n     */\n    function aggregateSignatures(\n        PackedUserOperation[] calldata userOps\n    ) external view returns (bytes memory aggregatesSignature);\n\n    /**\n     * @dev Validates that the aggregated signature is valid for the user operations.\n     *\n     * Requirements:\n     *\n     * - The aggregated signature MUST match the given list of operations.\n     */\n    function validateSignatures(PackedUserOperation[] calldata userOps, bytes calldata signature) external view;\n}\n\n/**\n * @dev Handle nonce management for accounts.\n *\n * Nonces are used in accounts as a replay protection mechanism and to ensure the order of user operations.\n * To avoid limiting the number of operations an account can perform, the interface allows using parallel\n * nonces by using a `key` parameter.\n *\n * See https://eips.ethereum.org/EIPS/eip-4337#semi-abstracted-nonce-support[ERC-4337 semi-abstracted nonce support].\n */\ninterface IEntryPointNonces {\n    /**\n     * @dev Returns the nonce for a `sender` account and a `key`.\n     *\n     * Nonces for a certain `key` are always increasing.\n     */\n    function getNonce(address sender, uint192 key) external view returns (uint256 nonce);\n}\n\n/**\n * @dev Handle stake management for entities (i.e. accounts, paymasters, factories).\n *\n * The EntryPoint must implement the following API to let entities like paymasters have a stake,\n * and thus have more flexibility in their storage access\n * (see https://eips.ethereum.org/EIPS/eip-4337#reputation-scoring-and-throttlingbanning-for-global-entities[reputation, throttling and banning.])\n */\ninterface IEntryPointStake {\n    /**\n     * @dev Returns the balance of the account.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Deposits `msg.value` to the account.\n     */\n    function depositTo(address account) external payable;\n\n    /**\n     * @dev Withdraws `withdrawAmount` from the account to `withdrawAddress`.\n     */\n    function withdrawTo(address payable withdrawAddress, uint256 withdrawAmount) external;\n\n    /**\n     * @dev Adds stake to the account with an unstake delay of `unstakeDelaySec`.\n     */\n    function addStake(uint32 unstakeDelaySec) external payable;\n\n    /**\n     * @dev Unlocks the stake of the account.\n     */\n    function unlockStake() external;\n\n    /**\n     * @dev Withdraws the stake of the account to `withdrawAddress`.\n     */\n    function withdrawStake(address payable withdrawAddress) external;\n}\n\n/**\n * @dev Entry point for user operations.\n *\n * User operations are validated and executed by this contract.\n */\ninterface IEntryPoint is IEntryPointNonces, IEntryPointStake {\n    /**\n     * @dev A user operation at `opIndex` failed with `reason`.\n     */\n    error FailedOp(uint256 opIndex, string reason);\n\n    /**\n     * @dev A user operation at `opIndex` failed with `reason` and `inner` returned data.\n     */\n    error FailedOpWithRevert(uint256 opIndex, string reason, bytes inner);\n\n    /**\n     * @dev Batch of aggregated user operations per aggregator.\n     */\n    struct UserOpsPerAggregator {\n        PackedUserOperation[] userOps;\n        IAggregator aggregator;\n        bytes signature;\n    }\n\n    /**\n     * @dev Executes a batch of user operations.\n     * @param beneficiary Address to which gas is refunded upon completing the execution.\n     */\n    function handleOps(PackedUserOperation[] calldata ops, address payable beneficiary) external;\n\n    /**\n     * @dev Executes a batch of aggregated user operations per aggregator.\n     * @param beneficiary Address to which gas is refunded upon completing the execution.\n     */\n    function handleAggregatedOps(\n        UserOpsPerAggregator[] calldata opsPerAggregator,\n        address payable beneficiary\n    ) external;\n}\n\n/**\n * @dev Base interface for an ERC-4337 account.\n */\ninterface IAccount {\n    /**\n     * @dev Validates a user operation.\n     *\n     * * MUST validate the caller is a trusted EntryPoint\n     * * MUST validate that the signature is a valid signature of the userOpHash, and SHOULD\n     *   return SIG_VALIDATION_FAILED (and not revert) on signature mismatch. Any other error MUST revert.\n     * * MUST pay the entryPoint (caller) at least the “missingAccountFunds” (which might\n     *   be zero, in case the current account’s deposit is high enough)\n     *\n     * Returns an encoded packed validation data that is composed of the following elements:\n     *\n     * - `authorizer` (`address`): 0 for success, 1 for failure, otherwise the address of an authorizer contract\n     * - `validUntil` (`uint48`): The UserOp is valid only up to this time. Zero for “infinite”.\n     * - `validAfter` (`uint48`): The UserOp is valid only after this time.\n     */\n    function validateUserOp(\n        PackedUserOperation calldata userOp,\n        bytes32 userOpHash,\n        uint256 missingAccountFunds\n    ) external returns (uint256 validationData);\n}\n\n/**\n * @dev Support for executing user operations by prepending the {executeUserOp} function selector\n * to the UserOperation's `callData`.\n */\ninterface IAccountExecute {\n    /**\n     * @dev Executes a user operation.\n     */\n    function executeUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash) external;\n}\n\n/**\n * @dev Interface for a paymaster contract that agrees to pay for the gas costs of a user operation.\n *\n * NOTE: A paymaster must hold a stake to cover the required entrypoint stake and also the gas for the transaction.\n */\ninterface IPaymaster {\n    enum PostOpMode {\n        opSucceeded,\n        opReverted,\n        postOpReverted\n    }\n\n    /**\n     * @dev Validates whether the paymaster is willing to pay for the user operation. See\n     * {IAccount-validateUserOp} for additional information on the return value.\n     *\n     * NOTE: Bundlers will reject this method if it modifies the state, unless it's whitelisted.\n     */\n    function validatePaymasterUserOp(\n        PackedUserOperation calldata userOp,\n        bytes32 userOpHash,\n        uint256 maxCost\n    ) external returns (bytes memory context, uint256 validationData);\n\n    /**\n     * @dev Verifies the sender is the entrypoint.\n     * @param actualGasCost the actual amount paid (by account or paymaster) for this UserOperation\n     * @param actualUserOpFeePerGas total gas used by this UserOperation (including preVerification, creation, validation and execution)\n     */\n    function postOp(\n        PostOpMode mode,\n        bytes calldata context,\n        uint256 actualGasCost,\n        uint256 actualUserOpFeePerGas\n    ) external;\n}\n"},"lib/openzeppelin-contracts/contracts/utils/Calldata.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Calldata.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for manipulating objects in calldata.\n */\nlibrary Calldata {\n    // slither-disable-next-line write-after-write\n    function emptyBytes() internal pure returns (bytes calldata result) {\n        assembly (\"memory-safe\") {\n            result.offset := 0\n            result.length := 0\n        }\n    }\n\n    // slither-disable-next-line write-after-write\n    function emptyString() internal pure returns (string calldata result) {\n        assembly (\"memory-safe\") {\n            result.offset := 0\n            result.length := 0\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/Packing.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0) (utils/Packing.sol)\n// This file was procedurally generated from scripts/generate/templates/Packing.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library packing and unpacking multiple values into bytesXX.\n *\n * Example usage:\n *\n * ```solidity\n * library MyPacker {\n *     type MyType is bytes32;\n *\n *     function _pack(address account, bytes4 selector, uint64 period) external pure returns (MyType) {\n *         bytes12 subpack = Packing.pack_4_8(selector, bytes8(period));\n *         bytes32 pack = Packing.pack_20_12(bytes20(account), subpack);\n *         return MyType.wrap(pack);\n *     }\n *\n *     function _unpack(MyType self) external pure returns (address, bytes4, uint64) {\n *         bytes32 pack = MyType.unwrap(self);\n *         return (\n *             address(Packing.extract_32_20(pack, 0)),\n *             Packing.extract_32_4(pack, 20),\n *             uint64(Packing.extract_32_8(pack, 24))\n *         );\n *     }\n * }\n * ```\n *\n * _Available since v5.1._\n */\n// solhint-disable func-name-mixedcase\nlibrary Packing {\n    error OutOfRangeAccess();\n\n    function pack_1_1(bytes1 left, bytes1 right) internal pure returns (bytes2 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(248, not(0)))\n            right := and(right, shl(248, not(0)))\n            result := or(left, shr(8, right))\n        }\n    }\n\n    function pack_2_2(bytes2 left, bytes2 right) internal pure returns (bytes4 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(240, not(0)))\n            right := and(right, shl(240, not(0)))\n            result := or(left, shr(16, right))\n        }\n    }\n\n    function pack_2_4(bytes2 left, bytes4 right) internal pure returns (bytes6 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(240, not(0)))\n            right := and(right, shl(224, not(0)))\n            result := or(left, shr(16, right))\n        }\n    }\n\n    function pack_2_6(bytes2 left, bytes6 right) internal pure returns (bytes8 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(240, not(0)))\n            right := and(right, shl(208, not(0)))\n            result := or(left, shr(16, right))\n        }\n    }\n\n    function pack_2_8(bytes2 left, bytes8 right) internal pure returns (bytes10 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(240, not(0)))\n            right := and(right, shl(192, not(0)))\n            result := or(left, shr(16, right))\n        }\n    }\n\n    function pack_2_10(bytes2 left, bytes10 right) internal pure returns (bytes12 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(240, not(0)))\n            right := and(right, shl(176, not(0)))\n            result := or(left, shr(16, right))\n        }\n    }\n\n    function pack_2_20(bytes2 left, bytes20 right) internal pure returns (bytes22 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(240, not(0)))\n            right := and(right, shl(96, not(0)))\n            result := or(left, shr(16, right))\n        }\n    }\n\n    function pack_2_22(bytes2 left, bytes22 right) internal pure returns (bytes24 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(240, not(0)))\n            right := and(right, shl(80, not(0)))\n            result := or(left, shr(16, right))\n        }\n    }\n\n    function pack_4_2(bytes4 left, bytes2 right) internal pure returns (bytes6 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(224, not(0)))\n            right := and(right, shl(240, not(0)))\n            result := or(left, shr(32, right))\n        }\n    }\n\n    function pack_4_4(bytes4 left, bytes4 right) internal pure returns (bytes8 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(224, not(0)))\n            right := and(right, shl(224, not(0)))\n            result := or(left, shr(32, right))\n        }\n    }\n\n    function pack_4_6(bytes4 left, bytes6 right) internal pure returns (bytes10 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(224, not(0)))\n            right := and(right, shl(208, not(0)))\n            result := or(left, shr(32, right))\n        }\n    }\n\n    function pack_4_8(bytes4 left, bytes8 right) internal pure returns (bytes12 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(224, not(0)))\n            right := and(right, shl(192, not(0)))\n            result := or(left, shr(32, right))\n        }\n    }\n\n    function pack_4_12(bytes4 left, bytes12 right) internal pure returns (bytes16 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(224, not(0)))\n            right := and(right, shl(160, not(0)))\n            result := or(left, shr(32, right))\n        }\n    }\n\n    function pack_4_16(bytes4 left, bytes16 right) internal pure returns (bytes20 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(224, not(0)))\n            right := and(right, shl(128, not(0)))\n            result := or(left, shr(32, right))\n        }\n    }\n\n    function pack_4_20(bytes4 left, bytes20 right) internal pure returns (bytes24 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(224, not(0)))\n            right := and(right, shl(96, not(0)))\n            result := or(left, shr(32, right))\n        }\n    }\n\n    function pack_4_24(bytes4 left, bytes24 right) internal pure returns (bytes28 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(224, not(0)))\n            right := and(right, shl(64, not(0)))\n            result := or(left, shr(32, right))\n        }\n    }\n\n    function pack_4_28(bytes4 left, bytes28 right) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(224, not(0)))\n            right := and(right, shl(32, not(0)))\n            result := or(left, shr(32, right))\n        }\n    }\n\n    function pack_6_2(bytes6 left, bytes2 right) internal pure returns (bytes8 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(208, not(0)))\n            right := and(right, shl(240, not(0)))\n            result := or(left, shr(48, right))\n        }\n    }\n\n    function pack_6_4(bytes6 left, bytes4 right) internal pure returns (bytes10 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(208, not(0)))\n            right := and(right, shl(224, not(0)))\n            result := or(left, shr(48, right))\n        }\n    }\n\n    function pack_6_6(bytes6 left, bytes6 right) internal pure returns (bytes12 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(208, not(0)))\n            right := and(right, shl(208, not(0)))\n            result := or(left, shr(48, right))\n        }\n    }\n\n    function pack_6_10(bytes6 left, bytes10 right) internal pure returns (bytes16 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(208, not(0)))\n            right := and(right, shl(176, not(0)))\n            result := or(left, shr(48, right))\n        }\n    }\n\n    function pack_6_16(bytes6 left, bytes16 right) internal pure returns (bytes22 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(208, not(0)))\n            right := and(right, shl(128, not(0)))\n            result := or(left, shr(48, right))\n        }\n    }\n\n    function pack_6_22(bytes6 left, bytes22 right) internal pure returns (bytes28 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(208, not(0)))\n            right := and(right, shl(80, not(0)))\n            result := or(left, shr(48, right))\n        }\n    }\n\n    function pack_8_2(bytes8 left, bytes2 right) internal pure returns (bytes10 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(192, not(0)))\n            right := and(right, shl(240, not(0)))\n            result := or(left, shr(64, right))\n        }\n    }\n\n    function pack_8_4(bytes8 left, bytes4 right) internal pure returns (bytes12 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(192, not(0)))\n            right := and(right, shl(224, not(0)))\n            result := or(left, shr(64, right))\n        }\n    }\n\n    function pack_8_8(bytes8 left, bytes8 right) internal pure returns (bytes16 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(192, not(0)))\n            right := and(right, shl(192, not(0)))\n            result := or(left, shr(64, right))\n        }\n    }\n\n    function pack_8_12(bytes8 left, bytes12 right) internal pure returns (bytes20 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(192, not(0)))\n            right := and(right, shl(160, not(0)))\n            result := or(left, shr(64, right))\n        }\n    }\n\n    function pack_8_16(bytes8 left, bytes16 right) internal pure returns (bytes24 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(192, not(0)))\n            right := and(right, shl(128, not(0)))\n            result := or(left, shr(64, right))\n        }\n    }\n\n    function pack_8_20(bytes8 left, bytes20 right) internal pure returns (bytes28 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(192, not(0)))\n            right := and(right, shl(96, not(0)))\n            result := or(left, shr(64, right))\n        }\n    }\n\n    function pack_8_24(bytes8 left, bytes24 right) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(192, not(0)))\n            right := and(right, shl(64, not(0)))\n            result := or(left, shr(64, right))\n        }\n    }\n\n    function pack_10_2(bytes10 left, bytes2 right) internal pure returns (bytes12 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(176, not(0)))\n            right := and(right, shl(240, not(0)))\n            result := or(left, shr(80, right))\n        }\n    }\n\n    function pack_10_6(bytes10 left, bytes6 right) internal pure returns (bytes16 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(176, not(0)))\n            right := and(right, shl(208, not(0)))\n            result := or(left, shr(80, right))\n        }\n    }\n\n    function pack_10_10(bytes10 left, bytes10 right) internal pure returns (bytes20 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(176, not(0)))\n            right := and(right, shl(176, not(0)))\n            result := or(left, shr(80, right))\n        }\n    }\n\n    function pack_10_12(bytes10 left, bytes12 right) internal pure returns (bytes22 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(176, not(0)))\n            right := and(right, shl(160, not(0)))\n            result := or(left, shr(80, right))\n        }\n    }\n\n    function pack_10_22(bytes10 left, bytes22 right) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(176, not(0)))\n            right := and(right, shl(80, not(0)))\n            result := or(left, shr(80, right))\n        }\n    }\n\n    function pack_12_4(bytes12 left, bytes4 right) internal pure returns (bytes16 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(160, not(0)))\n            right := and(right, shl(224, not(0)))\n            result := or(left, shr(96, right))\n        }\n    }\n\n    function pack_12_8(bytes12 left, bytes8 right) internal pure returns (bytes20 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(160, not(0)))\n            right := and(right, shl(192, not(0)))\n            result := or(left, shr(96, right))\n        }\n    }\n\n    function pack_12_10(bytes12 left, bytes10 right) internal pure returns (bytes22 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(160, not(0)))\n            right := and(right, shl(176, not(0)))\n            result := or(left, shr(96, right))\n        }\n    }\n\n    function pack_12_12(bytes12 left, bytes12 right) internal pure returns (bytes24 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(160, not(0)))\n            right := and(right, shl(160, not(0)))\n            result := or(left, shr(96, right))\n        }\n    }\n\n    function pack_12_16(bytes12 left, bytes16 right) internal pure returns (bytes28 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(160, not(0)))\n            right := and(right, shl(128, not(0)))\n            result := or(left, shr(96, right))\n        }\n    }\n\n    function pack_12_20(bytes12 left, bytes20 right) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(160, not(0)))\n            right := and(right, shl(96, not(0)))\n            result := or(left, shr(96, right))\n        }\n    }\n\n    function pack_16_4(bytes16 left, bytes4 right) internal pure returns (bytes20 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(128, not(0)))\n            right := and(right, shl(224, not(0)))\n            result := or(left, shr(128, right))\n        }\n    }\n\n    function pack_16_6(bytes16 left, bytes6 right) internal pure returns (bytes22 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(128, not(0)))\n            right := and(right, shl(208, not(0)))\n            result := or(left, shr(128, right))\n        }\n    }\n\n    function pack_16_8(bytes16 left, bytes8 right) internal pure returns (bytes24 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(128, not(0)))\n            right := and(right, shl(192, not(0)))\n            result := or(left, shr(128, right))\n        }\n    }\n\n    function pack_16_12(bytes16 left, bytes12 right) internal pure returns (bytes28 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(128, not(0)))\n            right := and(right, shl(160, not(0)))\n            result := or(left, shr(128, right))\n        }\n    }\n\n    function pack_16_16(bytes16 left, bytes16 right) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(128, not(0)))\n            right := and(right, shl(128, not(0)))\n            result := or(left, shr(128, right))\n        }\n    }\n\n    function pack_20_2(bytes20 left, bytes2 right) internal pure returns (bytes22 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(96, not(0)))\n            right := and(right, shl(240, not(0)))\n            result := or(left, shr(160, right))\n        }\n    }\n\n    function pack_20_4(bytes20 left, bytes4 right) internal pure returns (bytes24 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(96, not(0)))\n            right := and(right, shl(224, not(0)))\n            result := or(left, shr(160, right))\n        }\n    }\n\n    function pack_20_8(bytes20 left, bytes8 right) internal pure returns (bytes28 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(96, not(0)))\n            right := and(right, shl(192, not(0)))\n            result := or(left, shr(160, right))\n        }\n    }\n\n    function pack_20_12(bytes20 left, bytes12 right) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(96, not(0)))\n            right := and(right, shl(160, not(0)))\n            result := or(left, shr(160, right))\n        }\n    }\n\n    function pack_22_2(bytes22 left, bytes2 right) internal pure returns (bytes24 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(80, not(0)))\n            right := and(right, shl(240, not(0)))\n            result := or(left, shr(176, right))\n        }\n    }\n\n    function pack_22_6(bytes22 left, bytes6 right) internal pure returns (bytes28 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(80, not(0)))\n            right := and(right, shl(208, not(0)))\n            result := or(left, shr(176, right))\n        }\n    }\n\n    function pack_22_10(bytes22 left, bytes10 right) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(80, not(0)))\n            right := and(right, shl(176, not(0)))\n            result := or(left, shr(176, right))\n        }\n    }\n\n    function pack_24_4(bytes24 left, bytes4 right) internal pure returns (bytes28 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(64, not(0)))\n            right := and(right, shl(224, not(0)))\n            result := or(left, shr(192, right))\n        }\n    }\n\n    function pack_24_8(bytes24 left, bytes8 right) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(64, not(0)))\n            right := and(right, shl(192, not(0)))\n            result := or(left, shr(192, right))\n        }\n    }\n\n    function pack_28_4(bytes28 left, bytes4 right) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            left := and(left, shl(32, not(0)))\n            right := and(right, shl(224, not(0)))\n            result := or(left, shr(224, right))\n        }\n    }\n\n    function extract_2_1(bytes2 self, uint8 offset) internal pure returns (bytes1 result) {\n        if (offset > 1) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(248, not(0)))\n        }\n    }\n\n    function replace_2_1(bytes2 self, bytes1 value, uint8 offset) internal pure returns (bytes2 result) {\n        bytes1 oldValue = extract_2_1(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(248, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_4_1(bytes4 self, uint8 offset) internal pure returns (bytes1 result) {\n        if (offset > 3) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(248, not(0)))\n        }\n    }\n\n    function replace_4_1(bytes4 self, bytes1 value, uint8 offset) internal pure returns (bytes4 result) {\n        bytes1 oldValue = extract_4_1(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(248, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_4_2(bytes4 self, uint8 offset) internal pure returns (bytes2 result) {\n        if (offset > 2) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(240, not(0)))\n        }\n    }\n\n    function replace_4_2(bytes4 self, bytes2 value, uint8 offset) internal pure returns (bytes4 result) {\n        bytes2 oldValue = extract_4_2(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(240, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_6_1(bytes6 self, uint8 offset) internal pure returns (bytes1 result) {\n        if (offset > 5) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(248, not(0)))\n        }\n    }\n\n    function replace_6_1(bytes6 self, bytes1 value, uint8 offset) internal pure returns (bytes6 result) {\n        bytes1 oldValue = extract_6_1(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(248, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_6_2(bytes6 self, uint8 offset) internal pure returns (bytes2 result) {\n        if (offset > 4) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(240, not(0)))\n        }\n    }\n\n    function replace_6_2(bytes6 self, bytes2 value, uint8 offset) internal pure returns (bytes6 result) {\n        bytes2 oldValue = extract_6_2(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(240, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_6_4(bytes6 self, uint8 offset) internal pure returns (bytes4 result) {\n        if (offset > 2) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(224, not(0)))\n        }\n    }\n\n    function replace_6_4(bytes6 self, bytes4 value, uint8 offset) internal pure returns (bytes6 result) {\n        bytes4 oldValue = extract_6_4(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(224, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_8_1(bytes8 self, uint8 offset) internal pure returns (bytes1 result) {\n        if (offset > 7) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(248, not(0)))\n        }\n    }\n\n    function replace_8_1(bytes8 self, bytes1 value, uint8 offset) internal pure returns (bytes8 result) {\n        bytes1 oldValue = extract_8_1(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(248, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_8_2(bytes8 self, uint8 offset) internal pure returns (bytes2 result) {\n        if (offset > 6) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(240, not(0)))\n        }\n    }\n\n    function replace_8_2(bytes8 self, bytes2 value, uint8 offset) internal pure returns (bytes8 result) {\n        bytes2 oldValue = extract_8_2(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(240, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_8_4(bytes8 self, uint8 offset) internal pure returns (bytes4 result) {\n        if (offset > 4) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(224, not(0)))\n        }\n    }\n\n    function replace_8_4(bytes8 self, bytes4 value, uint8 offset) internal pure returns (bytes8 result) {\n        bytes4 oldValue = extract_8_4(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(224, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_8_6(bytes8 self, uint8 offset) internal pure returns (bytes6 result) {\n        if (offset > 2) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(208, not(0)))\n        }\n    }\n\n    function replace_8_6(bytes8 self, bytes6 value, uint8 offset) internal pure returns (bytes8 result) {\n        bytes6 oldValue = extract_8_6(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(208, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_10_1(bytes10 self, uint8 offset) internal pure returns (bytes1 result) {\n        if (offset > 9) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(248, not(0)))\n        }\n    }\n\n    function replace_10_1(bytes10 self, bytes1 value, uint8 offset) internal pure returns (bytes10 result) {\n        bytes1 oldValue = extract_10_1(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(248, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_10_2(bytes10 self, uint8 offset) internal pure returns (bytes2 result) {\n        if (offset > 8) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(240, not(0)))\n        }\n    }\n\n    function replace_10_2(bytes10 self, bytes2 value, uint8 offset) internal pure returns (bytes10 result) {\n        bytes2 oldValue = extract_10_2(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(240, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_10_4(bytes10 self, uint8 offset) internal pure returns (bytes4 result) {\n        if (offset > 6) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(224, not(0)))\n        }\n    }\n\n    function replace_10_4(bytes10 self, bytes4 value, uint8 offset) internal pure returns (bytes10 result) {\n        bytes4 oldValue = extract_10_4(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(224, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_10_6(bytes10 self, uint8 offset) internal pure returns (bytes6 result) {\n        if (offset > 4) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(208, not(0)))\n        }\n    }\n\n    function replace_10_6(bytes10 self, bytes6 value, uint8 offset) internal pure returns (bytes10 result) {\n        bytes6 oldValue = extract_10_6(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(208, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_10_8(bytes10 self, uint8 offset) internal pure returns (bytes8 result) {\n        if (offset > 2) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(192, not(0)))\n        }\n    }\n\n    function replace_10_8(bytes10 self, bytes8 value, uint8 offset) internal pure returns (bytes10 result) {\n        bytes8 oldValue = extract_10_8(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(192, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_12_1(bytes12 self, uint8 offset) internal pure returns (bytes1 result) {\n        if (offset > 11) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(248, not(0)))\n        }\n    }\n\n    function replace_12_1(bytes12 self, bytes1 value, uint8 offset) internal pure returns (bytes12 result) {\n        bytes1 oldValue = extract_12_1(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(248, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_12_2(bytes12 self, uint8 offset) internal pure returns (bytes2 result) {\n        if (offset > 10) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(240, not(0)))\n        }\n    }\n\n    function replace_12_2(bytes12 self, bytes2 value, uint8 offset) internal pure returns (bytes12 result) {\n        bytes2 oldValue = extract_12_2(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(240, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_12_4(bytes12 self, uint8 offset) internal pure returns (bytes4 result) {\n        if (offset > 8) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(224, not(0)))\n        }\n    }\n\n    function replace_12_4(bytes12 self, bytes4 value, uint8 offset) internal pure returns (bytes12 result) {\n        bytes4 oldValue = extract_12_4(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(224, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_12_6(bytes12 self, uint8 offset) internal pure returns (bytes6 result) {\n        if (offset > 6) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(208, not(0)))\n        }\n    }\n\n    function replace_12_6(bytes12 self, bytes6 value, uint8 offset) internal pure returns (bytes12 result) {\n        bytes6 oldValue = extract_12_6(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(208, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_12_8(bytes12 self, uint8 offset) internal pure returns (bytes8 result) {\n        if (offset > 4) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(192, not(0)))\n        }\n    }\n\n    function replace_12_8(bytes12 self, bytes8 value, uint8 offset) internal pure returns (bytes12 result) {\n        bytes8 oldValue = extract_12_8(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(192, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_12_10(bytes12 self, uint8 offset) internal pure returns (bytes10 result) {\n        if (offset > 2) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(176, not(0)))\n        }\n    }\n\n    function replace_12_10(bytes12 self, bytes10 value, uint8 offset) internal pure returns (bytes12 result) {\n        bytes10 oldValue = extract_12_10(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(176, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_16_1(bytes16 self, uint8 offset) internal pure returns (bytes1 result) {\n        if (offset > 15) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(248, not(0)))\n        }\n    }\n\n    function replace_16_1(bytes16 self, bytes1 value, uint8 offset) internal pure returns (bytes16 result) {\n        bytes1 oldValue = extract_16_1(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(248, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_16_2(bytes16 self, uint8 offset) internal pure returns (bytes2 result) {\n        if (offset > 14) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(240, not(0)))\n        }\n    }\n\n    function replace_16_2(bytes16 self, bytes2 value, uint8 offset) internal pure returns (bytes16 result) {\n        bytes2 oldValue = extract_16_2(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(240, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_16_4(bytes16 self, uint8 offset) internal pure returns (bytes4 result) {\n        if (offset > 12) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(224, not(0)))\n        }\n    }\n\n    function replace_16_4(bytes16 self, bytes4 value, uint8 offset) internal pure returns (bytes16 result) {\n        bytes4 oldValue = extract_16_4(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(224, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_16_6(bytes16 self, uint8 offset) internal pure returns (bytes6 result) {\n        if (offset > 10) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(208, not(0)))\n        }\n    }\n\n    function replace_16_6(bytes16 self, bytes6 value, uint8 offset) internal pure returns (bytes16 result) {\n        bytes6 oldValue = extract_16_6(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(208, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_16_8(bytes16 self, uint8 offset) internal pure returns (bytes8 result) {\n        if (offset > 8) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(192, not(0)))\n        }\n    }\n\n    function replace_16_8(bytes16 self, bytes8 value, uint8 offset) internal pure returns (bytes16 result) {\n        bytes8 oldValue = extract_16_8(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(192, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_16_10(bytes16 self, uint8 offset) internal pure returns (bytes10 result) {\n        if (offset > 6) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(176, not(0)))\n        }\n    }\n\n    function replace_16_10(bytes16 self, bytes10 value, uint8 offset) internal pure returns (bytes16 result) {\n        bytes10 oldValue = extract_16_10(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(176, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_16_12(bytes16 self, uint8 offset) internal pure returns (bytes12 result) {\n        if (offset > 4) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(160, not(0)))\n        }\n    }\n\n    function replace_16_12(bytes16 self, bytes12 value, uint8 offset) internal pure returns (bytes16 result) {\n        bytes12 oldValue = extract_16_12(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(160, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_20_1(bytes20 self, uint8 offset) internal pure returns (bytes1 result) {\n        if (offset > 19) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(248, not(0)))\n        }\n    }\n\n    function replace_20_1(bytes20 self, bytes1 value, uint8 offset) internal pure returns (bytes20 result) {\n        bytes1 oldValue = extract_20_1(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(248, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_20_2(bytes20 self, uint8 offset) internal pure returns (bytes2 result) {\n        if (offset > 18) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(240, not(0)))\n        }\n    }\n\n    function replace_20_2(bytes20 self, bytes2 value, uint8 offset) internal pure returns (bytes20 result) {\n        bytes2 oldValue = extract_20_2(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(240, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_20_4(bytes20 self, uint8 offset) internal pure returns (bytes4 result) {\n        if (offset > 16) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(224, not(0)))\n        }\n    }\n\n    function replace_20_4(bytes20 self, bytes4 value, uint8 offset) internal pure returns (bytes20 result) {\n        bytes4 oldValue = extract_20_4(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(224, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_20_6(bytes20 self, uint8 offset) internal pure returns (bytes6 result) {\n        if (offset > 14) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(208, not(0)))\n        }\n    }\n\n    function replace_20_6(bytes20 self, bytes6 value, uint8 offset) internal pure returns (bytes20 result) {\n        bytes6 oldValue = extract_20_6(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(208, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_20_8(bytes20 self, uint8 offset) internal pure returns (bytes8 result) {\n        if (offset > 12) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(192, not(0)))\n        }\n    }\n\n    function replace_20_8(bytes20 self, bytes8 value, uint8 offset) internal pure returns (bytes20 result) {\n        bytes8 oldValue = extract_20_8(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(192, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_20_10(bytes20 self, uint8 offset) internal pure returns (bytes10 result) {\n        if (offset > 10) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(176, not(0)))\n        }\n    }\n\n    function replace_20_10(bytes20 self, bytes10 value, uint8 offset) internal pure returns (bytes20 result) {\n        bytes10 oldValue = extract_20_10(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(176, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_20_12(bytes20 self, uint8 offset) internal pure returns (bytes12 result) {\n        if (offset > 8) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(160, not(0)))\n        }\n    }\n\n    function replace_20_12(bytes20 self, bytes12 value, uint8 offset) internal pure returns (bytes20 result) {\n        bytes12 oldValue = extract_20_12(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(160, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_20_16(bytes20 self, uint8 offset) internal pure returns (bytes16 result) {\n        if (offset > 4) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(128, not(0)))\n        }\n    }\n\n    function replace_20_16(bytes20 self, bytes16 value, uint8 offset) internal pure returns (bytes20 result) {\n        bytes16 oldValue = extract_20_16(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(128, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_22_1(bytes22 self, uint8 offset) internal pure returns (bytes1 result) {\n        if (offset > 21) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(248, not(0)))\n        }\n    }\n\n    function replace_22_1(bytes22 self, bytes1 value, uint8 offset) internal pure returns (bytes22 result) {\n        bytes1 oldValue = extract_22_1(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(248, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_22_2(bytes22 self, uint8 offset) internal pure returns (bytes2 result) {\n        if (offset > 20) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(240, not(0)))\n        }\n    }\n\n    function replace_22_2(bytes22 self, bytes2 value, uint8 offset) internal pure returns (bytes22 result) {\n        bytes2 oldValue = extract_22_2(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(240, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_22_4(bytes22 self, uint8 offset) internal pure returns (bytes4 result) {\n        if (offset > 18) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(224, not(0)))\n        }\n    }\n\n    function replace_22_4(bytes22 self, bytes4 value, uint8 offset) internal pure returns (bytes22 result) {\n        bytes4 oldValue = extract_22_4(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(224, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_22_6(bytes22 self, uint8 offset) internal pure returns (bytes6 result) {\n        if (offset > 16) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(208, not(0)))\n        }\n    }\n\n    function replace_22_6(bytes22 self, bytes6 value, uint8 offset) internal pure returns (bytes22 result) {\n        bytes6 oldValue = extract_22_6(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(208, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_22_8(bytes22 self, uint8 offset) internal pure returns (bytes8 result) {\n        if (offset > 14) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(192, not(0)))\n        }\n    }\n\n    function replace_22_8(bytes22 self, bytes8 value, uint8 offset) internal pure returns (bytes22 result) {\n        bytes8 oldValue = extract_22_8(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(192, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_22_10(bytes22 self, uint8 offset) internal pure returns (bytes10 result) {\n        if (offset > 12) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(176, not(0)))\n        }\n    }\n\n    function replace_22_10(bytes22 self, bytes10 value, uint8 offset) internal pure returns (bytes22 result) {\n        bytes10 oldValue = extract_22_10(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(176, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_22_12(bytes22 self, uint8 offset) internal pure returns (bytes12 result) {\n        if (offset > 10) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(160, not(0)))\n        }\n    }\n\n    function replace_22_12(bytes22 self, bytes12 value, uint8 offset) internal pure returns (bytes22 result) {\n        bytes12 oldValue = extract_22_12(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(160, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_22_16(bytes22 self, uint8 offset) internal pure returns (bytes16 result) {\n        if (offset > 6) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(128, not(0)))\n        }\n    }\n\n    function replace_22_16(bytes22 self, bytes16 value, uint8 offset) internal pure returns (bytes22 result) {\n        bytes16 oldValue = extract_22_16(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(128, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_22_20(bytes22 self, uint8 offset) internal pure returns (bytes20 result) {\n        if (offset > 2) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(96, not(0)))\n        }\n    }\n\n    function replace_22_20(bytes22 self, bytes20 value, uint8 offset) internal pure returns (bytes22 result) {\n        bytes20 oldValue = extract_22_20(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(96, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_24_1(bytes24 self, uint8 offset) internal pure returns (bytes1 result) {\n        if (offset > 23) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(248, not(0)))\n        }\n    }\n\n    function replace_24_1(bytes24 self, bytes1 value, uint8 offset) internal pure returns (bytes24 result) {\n        bytes1 oldValue = extract_24_1(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(248, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_24_2(bytes24 self, uint8 offset) internal pure returns (bytes2 result) {\n        if (offset > 22) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(240, not(0)))\n        }\n    }\n\n    function replace_24_2(bytes24 self, bytes2 value, uint8 offset) internal pure returns (bytes24 result) {\n        bytes2 oldValue = extract_24_2(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(240, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_24_4(bytes24 self, uint8 offset) internal pure returns (bytes4 result) {\n        if (offset > 20) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(224, not(0)))\n        }\n    }\n\n    function replace_24_4(bytes24 self, bytes4 value, uint8 offset) internal pure returns (bytes24 result) {\n        bytes4 oldValue = extract_24_4(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(224, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_24_6(bytes24 self, uint8 offset) internal pure returns (bytes6 result) {\n        if (offset > 18) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(208, not(0)))\n        }\n    }\n\n    function replace_24_6(bytes24 self, bytes6 value, uint8 offset) internal pure returns (bytes24 result) {\n        bytes6 oldValue = extract_24_6(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(208, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_24_8(bytes24 self, uint8 offset) internal pure returns (bytes8 result) {\n        if (offset > 16) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(192, not(0)))\n        }\n    }\n\n    function replace_24_8(bytes24 self, bytes8 value, uint8 offset) internal pure returns (bytes24 result) {\n        bytes8 oldValue = extract_24_8(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(192, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_24_10(bytes24 self, uint8 offset) internal pure returns (bytes10 result) {\n        if (offset > 14) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(176, not(0)))\n        }\n    }\n\n    function replace_24_10(bytes24 self, bytes10 value, uint8 offset) internal pure returns (bytes24 result) {\n        bytes10 oldValue = extract_24_10(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(176, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_24_12(bytes24 self, uint8 offset) internal pure returns (bytes12 result) {\n        if (offset > 12) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(160, not(0)))\n        }\n    }\n\n    function replace_24_12(bytes24 self, bytes12 value, uint8 offset) internal pure returns (bytes24 result) {\n        bytes12 oldValue = extract_24_12(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(160, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_24_16(bytes24 self, uint8 offset) internal pure returns (bytes16 result) {\n        if (offset > 8) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(128, not(0)))\n        }\n    }\n\n    function replace_24_16(bytes24 self, bytes16 value, uint8 offset) internal pure returns (bytes24 result) {\n        bytes16 oldValue = extract_24_16(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(128, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_24_20(bytes24 self, uint8 offset) internal pure returns (bytes20 result) {\n        if (offset > 4) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(96, not(0)))\n        }\n    }\n\n    function replace_24_20(bytes24 self, bytes20 value, uint8 offset) internal pure returns (bytes24 result) {\n        bytes20 oldValue = extract_24_20(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(96, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_24_22(bytes24 self, uint8 offset) internal pure returns (bytes22 result) {\n        if (offset > 2) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(80, not(0)))\n        }\n    }\n\n    function replace_24_22(bytes24 self, bytes22 value, uint8 offset) internal pure returns (bytes24 result) {\n        bytes22 oldValue = extract_24_22(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(80, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_28_1(bytes28 self, uint8 offset) internal pure returns (bytes1 result) {\n        if (offset > 27) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(248, not(0)))\n        }\n    }\n\n    function replace_28_1(bytes28 self, bytes1 value, uint8 offset) internal pure returns (bytes28 result) {\n        bytes1 oldValue = extract_28_1(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(248, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_28_2(bytes28 self, uint8 offset) internal pure returns (bytes2 result) {\n        if (offset > 26) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(240, not(0)))\n        }\n    }\n\n    function replace_28_2(bytes28 self, bytes2 value, uint8 offset) internal pure returns (bytes28 result) {\n        bytes2 oldValue = extract_28_2(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(240, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_28_4(bytes28 self, uint8 offset) internal pure returns (bytes4 result) {\n        if (offset > 24) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(224, not(0)))\n        }\n    }\n\n    function replace_28_4(bytes28 self, bytes4 value, uint8 offset) internal pure returns (bytes28 result) {\n        bytes4 oldValue = extract_28_4(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(224, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_28_6(bytes28 self, uint8 offset) internal pure returns (bytes6 result) {\n        if (offset > 22) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(208, not(0)))\n        }\n    }\n\n    function replace_28_6(bytes28 self, bytes6 value, uint8 offset) internal pure returns (bytes28 result) {\n        bytes6 oldValue = extract_28_6(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(208, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_28_8(bytes28 self, uint8 offset) internal pure returns (bytes8 result) {\n        if (offset > 20) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(192, not(0)))\n        }\n    }\n\n    function replace_28_8(bytes28 self, bytes8 value, uint8 offset) internal pure returns (bytes28 result) {\n        bytes8 oldValue = extract_28_8(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(192, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_28_10(bytes28 self, uint8 offset) internal pure returns (bytes10 result) {\n        if (offset > 18) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(176, not(0)))\n        }\n    }\n\n    function replace_28_10(bytes28 self, bytes10 value, uint8 offset) internal pure returns (bytes28 result) {\n        bytes10 oldValue = extract_28_10(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(176, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_28_12(bytes28 self, uint8 offset) internal pure returns (bytes12 result) {\n        if (offset > 16) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(160, not(0)))\n        }\n    }\n\n    function replace_28_12(bytes28 self, bytes12 value, uint8 offset) internal pure returns (bytes28 result) {\n        bytes12 oldValue = extract_28_12(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(160, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_28_16(bytes28 self, uint8 offset) internal pure returns (bytes16 result) {\n        if (offset > 12) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(128, not(0)))\n        }\n    }\n\n    function replace_28_16(bytes28 self, bytes16 value, uint8 offset) internal pure returns (bytes28 result) {\n        bytes16 oldValue = extract_28_16(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(128, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_28_20(bytes28 self, uint8 offset) internal pure returns (bytes20 result) {\n        if (offset > 8) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(96, not(0)))\n        }\n    }\n\n    function replace_28_20(bytes28 self, bytes20 value, uint8 offset) internal pure returns (bytes28 result) {\n        bytes20 oldValue = extract_28_20(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(96, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_28_22(bytes28 self, uint8 offset) internal pure returns (bytes22 result) {\n        if (offset > 6) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(80, not(0)))\n        }\n    }\n\n    function replace_28_22(bytes28 self, bytes22 value, uint8 offset) internal pure returns (bytes28 result) {\n        bytes22 oldValue = extract_28_22(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(80, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_28_24(bytes28 self, uint8 offset) internal pure returns (bytes24 result) {\n        if (offset > 4) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(64, not(0)))\n        }\n    }\n\n    function replace_28_24(bytes28 self, bytes24 value, uint8 offset) internal pure returns (bytes28 result) {\n        bytes24 oldValue = extract_28_24(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(64, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_32_1(bytes32 self, uint8 offset) internal pure returns (bytes1 result) {\n        if (offset > 31) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(248, not(0)))\n        }\n    }\n\n    function replace_32_1(bytes32 self, bytes1 value, uint8 offset) internal pure returns (bytes32 result) {\n        bytes1 oldValue = extract_32_1(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(248, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_32_2(bytes32 self, uint8 offset) internal pure returns (bytes2 result) {\n        if (offset > 30) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(240, not(0)))\n        }\n    }\n\n    function replace_32_2(bytes32 self, bytes2 value, uint8 offset) internal pure returns (bytes32 result) {\n        bytes2 oldValue = extract_32_2(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(240, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_32_4(bytes32 self, uint8 offset) internal pure returns (bytes4 result) {\n        if (offset > 28) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(224, not(0)))\n        }\n    }\n\n    function replace_32_4(bytes32 self, bytes4 value, uint8 offset) internal pure returns (bytes32 result) {\n        bytes4 oldValue = extract_32_4(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(224, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_32_6(bytes32 self, uint8 offset) internal pure returns (bytes6 result) {\n        if (offset > 26) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(208, not(0)))\n        }\n    }\n\n    function replace_32_6(bytes32 self, bytes6 value, uint8 offset) internal pure returns (bytes32 result) {\n        bytes6 oldValue = extract_32_6(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(208, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_32_8(bytes32 self, uint8 offset) internal pure returns (bytes8 result) {\n        if (offset > 24) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(192, not(0)))\n        }\n    }\n\n    function replace_32_8(bytes32 self, bytes8 value, uint8 offset) internal pure returns (bytes32 result) {\n        bytes8 oldValue = extract_32_8(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(192, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_32_10(bytes32 self, uint8 offset) internal pure returns (bytes10 result) {\n        if (offset > 22) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(176, not(0)))\n        }\n    }\n\n    function replace_32_10(bytes32 self, bytes10 value, uint8 offset) internal pure returns (bytes32 result) {\n        bytes10 oldValue = extract_32_10(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(176, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_32_12(bytes32 self, uint8 offset) internal pure returns (bytes12 result) {\n        if (offset > 20) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(160, not(0)))\n        }\n    }\n\n    function replace_32_12(bytes32 self, bytes12 value, uint8 offset) internal pure returns (bytes32 result) {\n        bytes12 oldValue = extract_32_12(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(160, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_32_16(bytes32 self, uint8 offset) internal pure returns (bytes16 result) {\n        if (offset > 16) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(128, not(0)))\n        }\n    }\n\n    function replace_32_16(bytes32 self, bytes16 value, uint8 offset) internal pure returns (bytes32 result) {\n        bytes16 oldValue = extract_32_16(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(128, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_32_20(bytes32 self, uint8 offset) internal pure returns (bytes20 result) {\n        if (offset > 12) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(96, not(0)))\n        }\n    }\n\n    function replace_32_20(bytes32 self, bytes20 value, uint8 offset) internal pure returns (bytes32 result) {\n        bytes20 oldValue = extract_32_20(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(96, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_32_22(bytes32 self, uint8 offset) internal pure returns (bytes22 result) {\n        if (offset > 10) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(80, not(0)))\n        }\n    }\n\n    function replace_32_22(bytes32 self, bytes22 value, uint8 offset) internal pure returns (bytes32 result) {\n        bytes22 oldValue = extract_32_22(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(80, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_32_24(bytes32 self, uint8 offset) internal pure returns (bytes24 result) {\n        if (offset > 8) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(64, not(0)))\n        }\n    }\n\n    function replace_32_24(bytes32 self, bytes24 value, uint8 offset) internal pure returns (bytes32 result) {\n        bytes24 oldValue = extract_32_24(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(64, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n\n    function extract_32_28(bytes32 self, uint8 offset) internal pure returns (bytes28 result) {\n        if (offset > 4) revert OutOfRangeAccess();\n        assembly (\"memory-safe\") {\n            result := and(shl(mul(8, offset), self), shl(32, not(0)))\n        }\n    }\n\n    function replace_32_28(bytes32 self, bytes28 value, uint8 offset) internal pure returns (bytes32 result) {\n        bytes28 oldValue = extract_32_28(self, offset);\n        assembly (\"memory-safe\") {\n            value := and(value, shl(32, not(0)))\n            result := xor(self, shr(mul(8, offset), xor(oldValue, value)))\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/Strings.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.6.0) (utils/Strings.sol)\n\npragma solidity ^0.8.24;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SafeCast} from \"./math/SafeCast.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\nimport {Bytes} from \"./Bytes.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    using SafeCast for *;\n\n    bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n    uint8 private constant ADDRESS_LENGTH = 20;\n    uint256 private constant SPECIAL_CHARS_LOOKUP =\n        0xffffffff | // first 32 bits corresponding to the control characters (U+0000 to U+001F)\n            (1 << 0x22) | // double quote\n            (1 << 0x5c); // backslash\n\n    /**\n     * @dev The `value` string doesn't fit in the specified `length`.\n     */\n    error StringsInsufficientHexLength(uint256 value, uint256 length);\n\n    /**\n     * @dev The string being parsed contains characters that are not in scope of the given base.\n     */\n    error StringsInvalidChar();\n\n    /**\n     * @dev The string being parsed is not a properly formatted address.\n     */\n    error StringsInvalidAddressFormat();\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            uint256 length = Math.log10(value) + 1;\n            string memory buffer = new string(length);\n            uint256 ptr;\n            assembly (\"memory-safe\") {\n                ptr := add(add(buffer, 0x20), length)\n            }\n            while (true) {\n                ptr--;\n                assembly (\"memory-safe\") {\n                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\n                }\n                value /= 10;\n                if (value == 0) break;\n            }\n            return buffer;\n        }\n    }\n\n    /**\n     * @dev Converts a `int256` to its ASCII `string` decimal representation.\n     */\n    function toStringSigned(int256 value) internal pure returns (string memory) {\n        return string.concat(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value)));\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            return toHexString(value, Math.log256(value) + 1);\n        }\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        uint256 localValue = value;\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = HEX_DIGITS[localValue & 0xf];\n            localValue >>= 4;\n        }\n        if (localValue != 0) {\n            revert StringsInsufficientHexLength(value, length);\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\n     * representation.\n     */\n    function toHexString(address addr) internal pure returns (string memory) {\n        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\n    }\n\n    /**\n     * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n     * representation, according to EIP-55.\n     */\n    function toChecksumHexString(address addr) internal pure returns (string memory) {\n        bytes memory buffer = bytes(toHexString(addr));\n\n        // hash the hex part of buffer (skip length + 2 bytes, length 40)\n        uint256 hashValue;\n        assembly (\"memory-safe\") {\n            hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n        }\n\n        for (uint256 i = 41; i > 1; --i) {\n            // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n            if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n                // case shift by xoring with 0x20\n                buffer[i] ^= 0x20;\n            }\n            hashValue >>= 4;\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts a `bytes` buffer to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(bytes memory input) internal pure returns (string memory) {\n        unchecked {\n            bytes memory buffer = new bytes(2 * input.length + 2);\n            buffer[0] = \"0\";\n            buffer[1] = \"x\";\n            for (uint256 i = 0; i < input.length; ++i) {\n                uint8 v = uint8(input[i]);\n                buffer[2 * i + 2] = HEX_DIGITS[v >> 4];\n                buffer[2 * i + 3] = HEX_DIGITS[v & 0xf];\n            }\n            return string(buffer);\n        }\n    }\n\n    /**\n     * @dev Returns true if the two strings are equal.\n     */\n    function equal(string memory a, string memory b) internal pure returns (bool) {\n        return Bytes.equal(bytes(a), bytes(b));\n    }\n\n    /**\n     * @dev Parse a decimal string and returns the value as a `uint256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `[0-9]*`\n     * - The result must fit into an `uint256` type\n     */\n    function parseUint(string memory input) internal pure returns (uint256) {\n        return parseUint(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseUint-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `[0-9]*`\n     * - The result must fit into an `uint256` type\n     */\n    function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\n        (bool success, uint256 value) = tryParseUint(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {\n        return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n     * character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseUint(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, uint256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseUintUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseUintUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, uint256 value) {\n        bytes memory buffer = bytes(input);\n\n        uint256 result = 0;\n        for (uint256 i = begin; i < end; ++i) {\n            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\n            if (chr > 9) return (false, 0);\n            result *= 10;\n            result += chr;\n        }\n        return (true, result);\n    }\n\n    /**\n     * @dev Parse a decimal string and returns the value as a `int256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `[-+]?[0-9]*`\n     * - The result must fit in an `int256` type.\n     */\n    function parseInt(string memory input) internal pure returns (int256) {\n        return parseInt(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `[-+]?[0-9]*`\n     * - The result must fit in an `int256` type.\n     */\n    function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {\n        (bool success, int256 value) = tryParseInt(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if\n     * the result does not fit in a `int256`.\n     *\n     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\n     */\n    function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {\n        return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    uint256 private constant ABS_MIN_INT256 = 2 ** 255;\n\n    /**\n     * @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n     * character or if the result does not fit in a `int256`.\n     *\n     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\n     */\n    function tryParseInt(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, int256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseIntUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseInt-string-uint256-uint256} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseIntUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, int256 value) {\n        bytes memory buffer = bytes(input);\n\n        // Check presence of a negative sign.\n        bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        bool positiveSign = sign == bytes1(\"+\");\n        bool negativeSign = sign == bytes1(\"-\");\n        uint256 offset = (positiveSign || negativeSign).toUint();\n\n        (bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);\n\n        if (absSuccess && absValue < ABS_MIN_INT256) {\n            return (true, negativeSign ? -int256(absValue) : int256(absValue));\n        } else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {\n            return (true, type(int256).min);\n        } else return (false, 0);\n    }\n\n    /**\n     * @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as a `uint256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `(0x)?[0-9a-fA-F]*`\n     * - The result must fit in an `uint256` type.\n     */\n    function parseHexUint(string memory input) internal pure returns (uint256) {\n        return parseHexUint(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `(0x)?[0-9a-fA-F]*`\n     * - The result must fit in an `uint256` type.\n     */\n    function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\n        (bool success, uint256 value) = tryParseHexUint(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {\n        return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an\n     * invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseHexUint(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, uint256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseHexUintUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseHexUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseHexUintUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, uint256 value) {\n        bytes memory buffer = bytes(input);\n\n        // skip 0x prefix if present\n        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2(\"0x\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        uint256 offset = hasPrefix.toUint() * 2;\n\n        uint256 result = 0;\n        for (uint256 i = begin + offset; i < end; ++i) {\n            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\n            if (chr > 15) return (false, 0);\n            result *= 16;\n            unchecked {\n                // Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).\n                // This guarantees that adding a value < 16 will not cause an overflow, hence the unchecked.\n                result += chr;\n            }\n        }\n        return (true, result);\n    }\n\n    /**\n     * @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as an `address`.\n     *\n     * Requirements:\n     * - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`\n     */\n    function parseAddress(string memory input) internal pure returns (address) {\n        return parseAddress(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`\n     */\n    function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {\n        (bool success, address value) = tryParseAddress(input, begin, end);\n        if (!success) revert StringsInvalidAddressFormat();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly\n     * formatted address. See {parseAddress-string} requirements.\n     */\n    function tryParseAddress(string memory input) internal pure returns (bool success, address value) {\n        return tryParseAddress(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly\n     * formatted address. See {parseAddress-string-uint256-uint256} requirements.\n     */\n    function tryParseAddress(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, address value) {\n        if (end > bytes(input).length || begin > end) return (false, address(0));\n\n        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2(\"0x\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        uint256 expectedLength = 40 + hasPrefix.toUint() * 2;\n\n        // check that input is the correct length\n        if (end - begin == expectedLength) {\n            // length guarantees that this does not overflow, and value is at most type(uint160).max\n            (bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);\n            return (s, address(uint160(v)));\n        } else {\n            return (false, address(0));\n        }\n    }\n\n    function _tryParseChr(bytes1 chr) private pure returns (uint8) {\n        uint8 value = uint8(chr);\n\n        // Try to parse `chr`:\n        // - Case 1: [0-9]\n        // - Case 2: [a-f]\n        // - Case 3: [A-F]\n        // - otherwise not supported\n        unchecked {\n            if (value > 47 && value < 58) value -= 48;\n            else if (value > 96 && value < 103) value -= 87;\n            else if (value > 64 && value < 71) value -= 55;\n            else return type(uint8).max;\n        }\n\n        return value;\n    }\n\n    /**\n     * @dev Escape special characters in JSON strings. This can be useful to prevent JSON injection in NFT metadata.\n     *\n     * WARNING: This function should only be used in double quoted JSON strings. Single quotes are not escaped.\n     *\n     * NOTE: This function escapes backslashes (including those in \\uXXXX sequences) and the characters in ranges\n     * defined in section 2.5 of RFC-4627 (U+0000 to U+001F, U+0022 and U+005C). All control characters in U+0000\n     * to U+001F are escaped (\\b, \\t, \\n, \\f, \\r use short form; others use \\u00XX). ECMAScript's `JSON.parse` does\n     * recover escaped unicode characters that are not in this range, but other tooling may provide different results.\n     */\n    function escapeJSON(string memory input) internal pure returns (string memory) {\n        bytes memory buffer = bytes(input);\n\n        // Put output at the FMP. Memory will be reserved later when we figure out the actual length of the escaped\n        // string. All write are done using _unsafeWriteBytesOffset, which avoid the (expensive) length checks for\n        // each character written.\n        bytes memory output;\n        assembly (\"memory-safe\") {\n            output := mload(0x40)\n        }\n        uint256 outputLength = 0;\n\n        for (uint256 i = 0; i < buffer.length; ++i) {\n            uint8 char = uint8(bytes1(_unsafeReadBytesOffset(buffer, i)));\n            if (((SPECIAL_CHARS_LOOKUP & (1 << char)) != 0)) {\n                _unsafeWriteBytesOffset(output, outputLength++, \"\\\\\");\n                if (char == 0x08) _unsafeWriteBytesOffset(output, outputLength++, \"b\");\n                else if (char == 0x09) _unsafeWriteBytesOffset(output, outputLength++, \"t\");\n                else if (char == 0x0a) _unsafeWriteBytesOffset(output, outputLength++, \"n\");\n                else if (char == 0x0c) _unsafeWriteBytesOffset(output, outputLength++, \"f\");\n                else if (char == 0x0d) _unsafeWriteBytesOffset(output, outputLength++, \"r\");\n                else if (char == 0x5c) _unsafeWriteBytesOffset(output, outputLength++, \"\\\\\");\n                else if (char == 0x22) {\n                    // solhint-disable-next-line quotes\n                    _unsafeWriteBytesOffset(output, outputLength++, '\"');\n                } else {\n                    // U+0000 to U+001F without short form: output \\u00XX\n                    _unsafeWriteBytesOffset(output, outputLength++, \"u\");\n                    _unsafeWriteBytesOffset(output, outputLength++, \"0\");\n                    _unsafeWriteBytesOffset(output, outputLength++, \"0\");\n                    _unsafeWriteBytesOffset(output, outputLength++, HEX_DIGITS[char >> 4]);\n                    _unsafeWriteBytesOffset(output, outputLength++, HEX_DIGITS[char & 0x0f]);\n                }\n            } else {\n                _unsafeWriteBytesOffset(output, outputLength++, bytes1(char));\n            }\n        }\n        // write the actual length and reserve memory\n        assembly (\"memory-safe\") {\n            mstore(output, outputLength)\n            mstore(0x40, add(output, add(outputLength, 0x20)))\n        }\n\n        return string(output);\n    }\n\n    /**\n     * @dev Reads a bytes32 from a bytes array without bounds checking.\n     *\n     * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the\n     * assembly block as such would prevent some optimizations.\n     */\n    function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {\n        // This is not memory safe in the general case, but all calls to this private function are within bounds.\n        assembly (\"memory-safe\") {\n            value := mload(add(add(buffer, 0x20), offset))\n        }\n    }\n\n    /**\n     * @dev Write a bytes1 to a bytes array without bounds checking.\n     *\n     * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the\n     * assembly block as such would prevent some optimizations.\n     */\n    function _unsafeWriteBytesOffset(bytes memory buffer, uint256 offset, bytes1 value) private pure {\n        // This is not memory safe in the general case, but all calls to this private function are within bounds.\n        assembly (\"memory-safe\") {\n            mstore8(add(add(buffer, 0x20), offset), shr(248, value))\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/Comparators.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Comparators.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides a set of functions to compare values.\n *\n * _Available since v5.1._\n */\nlibrary Comparators {\n    function lt(uint256 a, uint256 b) internal pure returns (bool) {\n        return a < b;\n    }\n\n    function gt(uint256 a, uint256 b) internal pure returns (bool) {\n        return a > b;\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/SlotDerivation.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/SlotDerivation.sol)\n// This file was procedurally generated from scripts/generate/templates/SlotDerivation.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for computing storage (and transient storage) locations from namespaces and deriving slots\n * corresponding to standard patterns. The derivation method for array and mapping matches the storage layout used by\n * the solidity language / compiler.\n *\n * See https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays[Solidity docs for mappings and dynamic arrays.].\n *\n * Example usage:\n * ```solidity\n * contract Example {\n *     // Add the library methods\n *     using StorageSlot for bytes32;\n *     using SlotDerivation for *;\n *\n *     // Declare a namespace\n *     string private constant _NAMESPACE = \"<namespace>\"; // eg. OpenZeppelin.Slot\n *\n *     function setValueInNamespace(uint256 key, address newValue) internal {\n *         _NAMESPACE.erc7201Slot().deriveMapping(key).getAddressSlot().value = newValue;\n *     }\n *\n *     function getValueInNamespace(uint256 key) internal view returns (address) {\n *         return _NAMESPACE.erc7201Slot().deriveMapping(key).getAddressSlot().value;\n *     }\n * }\n * ```\n *\n * TIP: Consider using this library along with {StorageSlot}.\n *\n * NOTE: This library provides a way to manipulate storage locations in a non-standard way. Tooling for checking\n * upgrade safety will ignore the slots accessed through this library.\n *\n * _Available since v5.1._\n */\nlibrary SlotDerivation {\n    /**\n     * @dev Derive an ERC-7201 slot from a string (namespace).\n     */\n    function erc7201Slot(string memory namespace) internal pure returns (bytes32 slot) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, sub(keccak256(add(namespace, 0x20), mload(namespace)), 1))\n            slot := and(keccak256(0x00, 0x20), not(0xff))\n        }\n    }\n\n    /**\n     * @dev Add an offset to a slot to get the n-th element of a structure or an array.\n     */\n    function offset(bytes32 slot, uint256 pos) internal pure returns (bytes32 result) {\n        unchecked {\n            return bytes32(uint256(slot) + pos);\n        }\n    }\n\n    /**\n     * @dev Derive the location of the first element in an array from the slot where the length is stored.\n     */\n    function deriveArray(bytes32 slot) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, slot)\n            result := keccak256(0x00, 0x20)\n        }\n    }\n\n    /**\n     * @dev Derive the location of a mapping element from the key.\n     */\n    function deriveMapping(bytes32 slot, address key) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, and(key, shr(96, not(0))))\n            mstore(0x20, slot)\n            result := keccak256(0x00, 0x40)\n        }\n    }\n\n    /**\n     * @dev Derive the location of a mapping element from the key.\n     */\n    function deriveMapping(bytes32 slot, bool key) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, iszero(iszero(key)))\n            mstore(0x20, slot)\n            result := keccak256(0x00, 0x40)\n        }\n    }\n\n    /**\n     * @dev Derive the location of a mapping element from the key.\n     */\n    function deriveMapping(bytes32 slot, bytes32 key) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, key)\n            mstore(0x20, slot)\n            result := keccak256(0x00, 0x40)\n        }\n    }\n\n    /**\n     * @dev Derive the location of a mapping element from the key.\n     */\n    function deriveMapping(bytes32 slot, uint256 key) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, key)\n            mstore(0x20, slot)\n            result := keccak256(0x00, 0x40)\n        }\n    }\n\n    /**\n     * @dev Derive the location of a mapping element from the key.\n     */\n    function deriveMapping(bytes32 slot, int256 key) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, key)\n            mstore(0x20, slot)\n            result := keccak256(0x00, 0x40)\n        }\n    }\n\n    /**\n     * @dev Derive the location of a mapping element from the key.\n     */\n    function deriveMapping(bytes32 slot, string memory key) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            let length := mload(key)\n            let begin := add(key, 0x20)\n            let end := add(begin, length)\n            let cache := mload(end)\n            mstore(end, slot)\n            result := keccak256(begin, add(length, 0x20))\n            mstore(end, cache)\n        }\n    }\n\n    /**\n     * @dev Derive the location of a mapping element from the key.\n     */\n    function deriveMapping(bytes32 slot, bytes memory key) internal pure returns (bytes32 result) {\n        assembly (\"memory-safe\") {\n            let length := mload(key)\n            let begin := add(key, 0x20)\n            let end := add(begin, length)\n            let cache := mload(end)\n            mstore(end, slot)\n            result := keccak256(begin, add(length, 0x20))\n            mstore(end, cache)\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(newImplementation.code.length > 0);\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    struct Int256Slot {\n        int256 value;\n    }\n\n    struct StringSlot {\n        string value;\n    }\n\n    struct BytesSlot {\n        bytes value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n     */\n    function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n     */\n    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n     */\n    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {UpgradeableBeacon} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"},"lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1967.sol)\n\npragma solidity >=0.4.11;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n */\ninterface IERC1967 {\n    /**\n     * @dev Emitted when the implementation is upgraded.\n     */\n    event Upgraded(address indexed implementation);\n\n    /**\n     * @dev Emitted when the admin account has changed.\n     */\n    event AdminChanged(address previousAdmin, address newAdmin);\n\n    /**\n     * @dev Emitted when the beacon is changed.\n     */\n    event BeaconUpgraded(address indexed beacon);\n}\n"},"lib/openzeppelin-contracts/contracts/utils/Address.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\nimport {LowLevelCall} from \"./LowLevelCall.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        if (address(this).balance < amount) {\n            revert Errors.InsufficientBalance(address(this).balance, amount);\n        }\n        if (LowLevelCall.callNoReturn(recipient, amount, \"\")) {\n            // call successful, nothing to do\n            return;\n        } else if (LowLevelCall.returnDataSize() > 0) {\n            LowLevelCall.bubbleRevert();\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason or custom error, it is bubbled\n     * up by this function (like regular Solidity function calls). However, if\n     * the call reverted with no returned reason, this function reverts with a\n     * {Errors.FailedCall} error.\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        if (address(this).balance < value) {\n            revert Errors.InsufficientBalance(address(this).balance, value);\n        }\n        bool success = LowLevelCall.callNoReturn(target, value, data);\n        if (success && (LowLevelCall.returnDataSize() > 0 || target.code.length > 0)) {\n            return LowLevelCall.returnData();\n        } else if (success) {\n            revert AddressEmptyCode(target);\n        } else if (LowLevelCall.returnDataSize() > 0) {\n            LowLevelCall.bubbleRevert();\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        bool success = LowLevelCall.staticcallNoReturn(target, data);\n        if (success && (LowLevelCall.returnDataSize() > 0 || target.code.length > 0)) {\n            return LowLevelCall.returnData();\n        } else if (success) {\n            revert AddressEmptyCode(target);\n        } else if (LowLevelCall.returnDataSize() > 0) {\n            LowLevelCall.bubbleRevert();\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        bool success = LowLevelCall.delegatecallNoReturn(target, data);\n        if (success && (LowLevelCall.returnDataSize() > 0 || target.code.length > 0)) {\n            return LowLevelCall.returnData();\n        } else if (success) {\n            revert AddressEmptyCode(target);\n        } else if (LowLevelCall.returnDataSize() > 0) {\n            LowLevelCall.bubbleRevert();\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n     * of an unsuccessful call.\n     *\n     * NOTE: This function is DEPRECATED and may be removed in the next major release.\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata\n    ) internal view returns (bytes memory) {\n        // only check if target is a contract if the call was successful and the return data is empty\n        // otherwise we already know that it was a contract\n        if (success && (returndata.length > 0 || target.code.length > 0)) {\n            return returndata;\n        } else if (success) {\n            revert AddressEmptyCode(target);\n        } else if (returndata.length > 0) {\n            LowLevelCall.bubbleRevert(returndata);\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n     * revert reason or with a default {Errors.FailedCall} error.\n     */\n    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else if (returndata.length > 0) {\n            LowLevelCall.bubbleRevert(returndata);\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n    /**\n     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two signed numbers.\n     */\n    function max(int256 a, int256 b) internal pure returns (int256) {\n        return ternary(a > b, a, b);\n    }\n\n    /**\n     * @dev Returns the smallest of two signed numbers.\n     */\n    function min(int256 a, int256 b) internal pure returns (int256) {\n        return ternary(a < b, a, b);\n    }\n\n    /**\n     * @dev Returns the average of two signed numbers without overflow.\n     * The result is rounded towards zero.\n     */\n    function average(int256 a, int256 b) internal pure returns (int256) {\n        // Formula from the book \"Hacker's Delight\"\n        int256 x = (a & b) + ((a ^ b) >> 1);\n        return x + (int256(uint256(x) >> 255) & (a ^ b));\n    }\n\n    /**\n     * @dev Returns the absolute unsigned value of a signed value.\n     */\n    function abs(int256 n) internal pure returns (uint256) {\n        unchecked {\n            // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n            // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n            // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n            // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n            // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n            int256 mask = n >> 255;\n\n            // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n            return uint256((n + mask) ^ mask);\n        }\n    }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/Errors.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error InsufficientBalance(uint256 balance, uint256 needed);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedCall();\n\n    /**\n     * @dev The deployment failed.\n     */\n    error FailedDeployment();\n\n    /**\n     * @dev A necessary precompile is missing.\n     */\n    error MissingPrecompile(address);\n}\n"},"lib/openzeppelin-contracts/contracts/utils/LowLevelCall.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.6.0) (utils/LowLevelCall.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library of low level call functions that implement different calling strategies to deal with the return data.\n *\n * WARNING: Using this library requires an advanced understanding of Solidity and how the EVM works. It is recommended\n * to use the {Address} library instead.\n */\nlibrary LowLevelCall {\n    /// @dev Performs a Solidity function call using a low level `call` and ignoring the return data.\n    function callNoReturn(address target, bytes memory data) internal returns (bool success) {\n        return callNoReturn(target, 0, data);\n    }\n\n    /// @dev Same as {callNoReturn-address-bytes}, but allows specifying the value to be sent in the call.\n    function callNoReturn(address target, uint256 value, bytes memory data) internal returns (bool success) {\n        assembly (\"memory-safe\") {\n            success := call(gas(), target, value, add(data, 0x20), mload(data), 0x00, 0x00)\n        }\n    }\n\n    /// @dev Performs a Solidity function call using a low level `call` and returns the first 64 bytes of the result\n    /// in the scratch space of memory. Useful for functions that return a tuple with two single-word values.\n    ///\n    /// WARNING: Do not assume that the results are zero if `success` is false. Memory can be already allocated\n    /// and this function doesn't zero it out.\n    function callReturn64Bytes(\n        address target,\n        bytes memory data\n    ) internal returns (bool success, bytes32 result1, bytes32 result2) {\n        return callReturn64Bytes(target, 0, data);\n    }\n\n    /// @dev Same as {callReturn64Bytes-address-bytes}, but allows specifying the value to be sent in the call.\n    function callReturn64Bytes(\n        address target,\n        uint256 value,\n        bytes memory data\n    ) internal returns (bool success, bytes32 result1, bytes32 result2) {\n        assembly (\"memory-safe\") {\n            success := call(gas(), target, value, add(data, 0x20), mload(data), 0x00, 0x40)\n            result1 := mload(0x00)\n            result2 := mload(0x20)\n        }\n    }\n\n    /// @dev Performs a Solidity function call using a low level `staticcall` and ignoring the return data.\n    function staticcallNoReturn(address target, bytes memory data) internal view returns (bool success) {\n        assembly (\"memory-safe\") {\n            success := staticcall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x00)\n        }\n    }\n\n    /// @dev Performs a Solidity function call using a low level `staticcall` and returns the first 64 bytes of the result\n    /// in the scratch space of memory. Useful for functions that return a tuple with two single-word values.\n    ///\n    /// WARNING: Do not assume that the results are zero if `success` is false. Memory can be already allocated\n    /// and this function doesn't zero it out.\n    function staticcallReturn64Bytes(\n        address target,\n        bytes memory data\n    ) internal view returns (bool success, bytes32 result1, bytes32 result2) {\n        assembly (\"memory-safe\") {\n            success := staticcall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x40)\n            result1 := mload(0x00)\n            result2 := mload(0x20)\n        }\n    }\n\n    /// @dev Performs a Solidity function call using a low level `delegatecall` and ignoring the return data.\n    function delegatecallNoReturn(address target, bytes memory data) internal returns (bool success) {\n        assembly (\"memory-safe\") {\n            success := delegatecall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x00)\n        }\n    }\n\n    /// @dev Performs a Solidity function call using a low level `delegatecall` and returns the first 64 bytes of the result\n    /// in the scratch space of memory. Useful for functions that return a tuple with two single-word values.\n    ///\n    /// WARNING: Do not assume that the results are zero if `success` is false. Memory can be already allocated\n    /// and this function doesn't zero it out.\n    function delegatecallReturn64Bytes(\n        address target,\n        bytes memory data\n    ) internal returns (bool success, bytes32 result1, bytes32 result2) {\n        assembly (\"memory-safe\") {\n            success := delegatecall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x40)\n            result1 := mload(0x00)\n            result2 := mload(0x20)\n        }\n    }\n\n    /// @dev Returns the size of the return data buffer.\n    function returnDataSize() internal pure returns (uint256 size) {\n        assembly (\"memory-safe\") {\n            size := returndatasize()\n        }\n    }\n\n    /// @dev Returns a buffer containing the return data from the last call.\n    function returnData() internal pure returns (bytes memory result) {\n        assembly (\"memory-safe\") {\n            result := mload(0x40)\n            mstore(result, returndatasize())\n            returndatacopy(add(result, 0x20), 0x00, returndatasize())\n            mstore(0x40, add(result, add(0x20, returndatasize())))\n        }\n    }\n\n    /// @dev Revert with the return data from the last call.\n    function bubbleRevert() internal pure {\n        assembly (\"memory-safe\") {\n            let fmp := mload(0x40)\n            returndatacopy(fmp, 0x00, returndatasize())\n            revert(fmp, returndatasize())\n        }\n    }\n\n    function bubbleRevert(bytes memory returndata) internal pure {\n        assembly (\"memory-safe\") {\n            revert(add(returndata, 0x20), mload(returndata))\n        }\n    }\n}\n"}},"matchId":"51206035","creationMatch":"exact_match","runtimeMatch":"exact_match","verifiedAt":"2026-09-17T23:13:45Z","match":"exact_match","chainId":"1","address":"0xd8E25d31606e3F5b722396A936c76C028a8a72Ab"}