import "@metamask/smart-accounts-kit";
import "@metamask/smart-accounts-kit/contracts";
//#region extensions/crypto/src/services/advanced-permissions.ts
const _grantedPermissions = /* @__PURE__ */ new Map();
function storeGrantedPermissions(policyId, permissions) {
	_grantedPermissions.set(policyId, permissions);
}
/**
* Check if Advanced Permissions are available for a wallet.
* Returns true if:
* 1. The wallet is connected via WalletConnect or MetaMask provider
* 2. The wallet has an EIP-7702 designation (smart account)
* 3. There are stored granted permissions
*/
function hasAdvancedPermissions(policyId) {
	return _grantedPermissions.has(policyId);
}
/**
* Get the permission context + DelegationManager address for a policy.
* Returns null if no permissions are stored.
*/
function getPermissionContext(policyId) {
	const perms = _grantedPermissions.get(policyId);
	if (!perms || perms.length === 0) return null;
	const first = perms[0];
	if (!first) return null;
	return {
		context: first.context,
		delegationManager: first.signerMeta.delegationManager
	};
}
//#endregion
export { getPermissionContext, hasAdvancedPermissions, storeGrantedPermissions };

//# sourceMappingURL=advanced-permissions-DXYxZiXU.mjs.map