Clearview AI agrees to restrict sale of database in settlement