Taking into consideration a child's stated preference under AS 25.23.125(a) and consent given under AS 25.23.040(a)(5), and unless the court finds that a petition to adopt the child by an adult family member is contrary to the best interest of the child, the court shall grant a petition to adopt a child by an adult family member who has had physical custody of the child for at least 12 consecutive months before the parental rights to the child have been terminated. In this section, “adult family member” has the meaning given in AS 47.10.990.