The e-cigarette industry leader has agreed to pay hundreds of millions of dollars to settle claims it marketed its vaping products to children.