(a) Damages for breach by either party may be liquidated in the agreement but only at an amount that is reasonable in the light of the anticipated or actual harm caused by the breach, the difficulties of proof of loss, and the inconvenience or nonfeasibility of otherwise obtaining an adequate remedy. A term fixing unreasonably large liquidated damages is void as a penalty.
(b) If the seller justifiably withholds delivery of goods because of the buyer's breach, the buyer is entitled to restitution of an amount by which the sum of the buyer's payments exceeds
(1) the amount to which the seller is entitled by virtue of terms liquidating the seller's damages in accordance with (a) of this section, or
(2) in the absence of those terms, 20 percent of the value of the total performance for which the buyer is obligated under the contract or $500, whichever is smaller.
(c) The buyer's right to restitution under (b) of this section is subject to offset to the extent that the seller establishes
(1) a right to recover damages under this chapter other than (a) of this section, and
(2) the amount or value of benefits received by the buyer directly or indirectly by reason of the contract.
(d) If a seller has received payment in goods, their reasonable value or the proceeds of their resale shall be treated as payments for the purposes of (b) of this section; but, if the seller has notice of the buyer's breach before reselling goods received in part performance, the resale is subject to the conditions laid down on resale by an aggrieved seller (AS 45.02.706).