execute if data entity @s SelectedItem.components."minecraft:written_book_content".resolved run function ws:misc/passport/resolve/mainhand
execute if items entity @s weapon.offhand *[custom_data~{passport:1}] if data entity @s Inventory[-1].components."minecraft:written_book_content".resolved run function ws:misc/passport/resolve/offhand