KMPurchaseCompareDMGWindowController.m 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211
  1. //
  2. // KMPurchaseCompareDMGWindowController.m
  3. // PDF Reader Pro Edition
  4. //
  5. // Created by 王帅 on 2018/5/8.
  6. //
  7. #import "KMPurchaseCompareDMGWindowController.h"
  8. #import <PDF_Reader_Pro-Swift.h>
  9. #import "KMVerificationWindowController.h"
  10. #import "VerificationManager.h"
  11. static NSString *const KMPurchaseCompareDMGHeaderCellIdentifier = @"KMPurchaseCompareDMGHeaderCell";
  12. static NSString *const KMPurchaseCompareDMGCellIdentifier = @"KMPurchaseCompareDMGCell";
  13. #pragma mark - KMPurchaseCompareDMGHeaderCell
  14. @interface KMPurchaseCompareDMGHeaderCell : NSTableCellView
  15. @property (nonatomic,assign) IBOutlet NSView *contentView;
  16. @end
  17. @implementation KMPurchaseCompareDMGHeaderCell
  18. - (void)dealloc {
  19. [NSDistributedNotificationCenter.defaultCenter removeObserver:self];
  20. }
  21. - (void)awakeFromNib {
  22. [super awakeFromNib];
  23. self.contentView.wantsLayer = YES;
  24. [self updateViewColor];
  25. [NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(themeChanged:) name:@"AppleInterfaceThemeChangedNotification" object: nil];
  26. }
  27. - (void)themeChanged:(NSNotification *)notification {
  28. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  29. [self updateViewColor];
  30. });
  31. }
  32. - (void)updateViewColor {
  33. NSColor *textColor = [NSColor colorWithDeviceRed:51.0/255.0 green:51.0/255.0 blue:51.0/255.0 alpha:1.0];
  34. NSColor *viewColor = [NSColor colorWithDeviceRed:55.0/255.0 green:57.0/255.0 blue:59.0/255.0 alpha:0.06];
  35. if (@available(macOS 10.14, *)) {
  36. NSAppearanceName appearanceName = [[NSApp effectiveAppearance] bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
  37. if ([appearanceName isEqualToString:NSAppearanceNameDarkAqua]) {
  38. textColor = [NSColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:0.87];
  39. viewColor = [NSColor colorWithRed:52.0/255.0 green:53.0/255.0 blue:56.0/255.0 alpha:1.0];
  40. }
  41. }
  42. self.contentView.layer.backgroundColor = viewColor.CGColor;
  43. self.textField.textColor = textColor;
  44. self.textField.font = [NSFont boldSystemFontOfSize:14.0];
  45. }
  46. @end
  47. #pragma mark - KMPurchaseCompareDMGCell
  48. @interface KMPurchaseCompareDMGCell : NSTableCellView
  49. @property (nonatomic,assign) IBOutlet NSTextField *value1Label;
  50. @property (nonatomic,assign) IBOutlet NSTextField *value2Label;
  51. @property (nonatomic,assign) IBOutlet NSImageView *value1ImageView;
  52. @property (nonatomic,assign) IBOutlet NSImageView *value2ImageView;
  53. @property (nonatomic,assign) IBOutlet NSBox *lineBox;
  54. @end
  55. @implementation KMPurchaseCompareDMGCell
  56. - (void)dealloc {
  57. [NSDistributedNotificationCenter.defaultCenter removeObserver:self];
  58. }
  59. - (void)awakeFromNib {
  60. [super awakeFromNib];
  61. [self updateViewColor];
  62. [NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(themeChanged:) name:@"AppleInterfaceThemeChangedNotification" object: nil];
  63. }
  64. - (void)themeChanged:(NSNotification *)notification {
  65. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  66. [self updateViewColor];
  67. });
  68. }
  69. - (void)updateViewColor {
  70. NSColor *textColor = [NSColor colorWithRed:102.0/255.0 green:102.0/255.0 blue:102.0/255.0 alpha:0.85];
  71. NSColor *lineColor = [NSColor colorWithRed:204.0/255.0 green:204.0/255.0 blue:204.0/255.0 alpha:0.4];
  72. if (@available(macOS 10.14, *)) {
  73. NSAppearanceName appearanceName = [[NSApp effectiveAppearance] bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
  74. if ([appearanceName isEqualToString:NSAppearanceNameDarkAqua]) {
  75. textColor = [NSColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:0.6];
  76. lineColor = [NSColor colorWithRed:0.0/255.0 green:0.0/255.0 blue:0.0/255.0 alpha:0.4];
  77. }
  78. }
  79. self.value1Label.textColor = self.value2Label.textColor = textColor;
  80. self.lineBox.fillColor = lineColor;
  81. self.textField.textColor = textColor;
  82. }
  83. @end
  84. #pragma mark - KMPurchaseCompareDMGWindowController
  85. @interface KMPurchaseCompareDMGWindowController ()
  86. @property (nonatomic, assign) IBOutlet NSTextField *titleLabel;
  87. @property (assign) IBOutlet HyperLinkButton *enterLicenseButton;
  88. @property (assign) IBOutlet NSView *freeContendView;
  89. @property (assign) IBOutlet NSView *freeVersionBGView;
  90. @property (assign) IBOutlet NSTextField *freeVersionLbl;
  91. @property (assign) IBOutlet NSView *freeVersionLineView;
  92. @property (assign) IBOutlet NSTextField *freeVersionInfoLbl1;
  93. @property (assign) IBOutlet NSTextField *freeVersionInfoLbl2;
  94. @property (assign) IBOutlet NSTextField *freeVersionInfoLbl3;
  95. @property (assign) IBOutlet NSTextField *freeVersionInfoLbl4;
  96. @property (assign) IBOutlet NSTextField *freeVersionInfoLbl5;
  97. @property (assign) IBOutlet NSTextField *freeVersionInfoLbl6;
  98. @property (assign) IBOutlet NSTextField *freeVersionInfoLbl7;
  99. @property (assign) IBOutlet NSTextField *freeVersionInfoLbl8;
  100. @property (assign) IBOutlet NSTextField *freeVersionInfoLbl9;
  101. @property (weak) IBOutlet NSTextField *freeVersionInfoLbl10;
  102. @property (assign) IBOutlet NSView *parmanentVerBGView;
  103. @property (assign) IBOutlet NSTextField *parmanentVerLbl;
  104. @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl1;
  105. @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl2;
  106. @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl3;
  107. @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl4;
  108. @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl5;
  109. @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl6;
  110. @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl7;
  111. @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl8;
  112. @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl9;
  113. @property (weak) IBOutlet NSImageView *parmanentVerInfoImage1;
  114. @property (weak) IBOutlet NSTextField *parmanentVerInfoLbl10;
  115. @property (assign) IBOutlet KMButton *parmanentVerInfoBtn2;
  116. @property (assign) IBOutlet NSImageView *parmanentVerinfoimg2;
  117. @property (assign) IBOutlet NSView *parmanentInfoView;
  118. @property (assign) IBOutlet NSImageView *discountTipImage;
  119. @property (assign) IBOutlet NSTextField *oneTimeTipLbl;
  120. @property (assign) IBOutlet NSBox *freeTrialBox;
  121. @property (assign) IBOutlet KMButton *freeTrialButton;
  122. @property (assign) IBOutlet NSBox *buyNowBox;
  123. @property (assign) IBOutlet KMButton *buyNowButton;
  124. @property (assign) IBOutlet NSView *aiContendView;
  125. @property (assign) IBOutlet NSView *aiSepLineView;
  126. @property (assign) IBOutlet NSTextField *aiTitleLabel;
  127. @property (assign) IBOutlet NSTextField *aiInfoLbl1;
  128. @property (assign) IBOutlet NSTextField *aiInfoLbl2;
  129. @property (assign) IBOutlet NSTextField *aiInfoLbl3;
  130. @property (assign) IBOutlet NSTextField *aiInfoLbl4;
  131. @property (assign) IBOutlet NSTextField *aiPurchaseLabel;
  132. @property (assign) IBOutlet KMButton *aiPurchaseButton;
  133. @property (weak) IBOutlet NSTextField *premiumLabel;
  134. @property (weak) IBOutlet NSTextField *permanentLabel;
  135. @property (weak) IBOutlet NSSwitch *buySwitch;
  136. @property (weak) IBOutlet NSTextField *discountPriceLabel;
  137. @property (weak) IBOutlet NSTextField *originalPriceLabel;
  138. @property (weak) IBOutlet NSTextField *discountPriceLabel2;
  139. @property (nonatomic, assign) NSModalSession modalSession;
  140. @property (nonatomic, retain) NSArray *dataSource;
  141. @property (nonatomic, retain) NSPopover *popOver;
  142. - (NSString *)_buyNowEventToPaidEventName;
  143. - (NSDictionary *)_getPaidEventParamsWith:(NSString *)eventN;
  144. @end
  145. @implementation KMPurchaseCompareDMGWindowController
  146. #pragma mark Init Methods
  147. - (id)init {
  148. if (self = [super initWithWindowNibName:@"KMPurchaseCompareDMGWindowController"]) {
  149. }
  150. return self;
  151. }
  152. - (void)dealloc {
  153. [[NSNotificationCenter defaultCenter] removeObserver:self];
  154. [NSDistributedNotificationCenter.defaultCenter removeObserver:self];
  155. }
  156. - (void)windowDidLoad {
  157. [super windowDidLoad];
  158. self.window.movableByWindowBackground = YES;
  159. self.window.backgroundColor = [NSColor whiteColor];
  160. __block typeof(self) blockSelf = self;
  161. [self.freeVersionInfoLbl2 setEnabled:YES];
  162. self.freeVersionLineView.wantsLayer = YES;
  163. self.premiumLabel.stringValue = NSLocalizedString(@"Premium", nil);
  164. self.premiumLabel.textColor = [NSColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:0.7];
  165. self.premiumLabel.font = [NSFont SFProTextRegularFont:14.0];
  166. self.permanentLabel.stringValue = NSLocalizedString(@"Permanent", nil);
  167. self.permanentLabel.textColor = [NSColor colorWithRed:255.0/255.0 green:94.0/255.0 blue:44.0/255.0 alpha:1.0];
  168. self.permanentLabel.font = [NSFont SFProTextRegularFont:14.0];
  169. self.discountPriceLabel.textColor = [NSColor colorWithRed:255.0/255.0 green:231.0/255.0 blue:106.0/255.0 alpha:1.0];
  170. self.discountPriceLabel.font = [NSFont fontWithName:@"Ubuntu" size:36.0];
  171. self.originalPriceLabel.textColor = [NSColor whiteColor];
  172. self.originalPriceLabel.font = [NSFont fontWithName:@"Ubuntu" size:14.0];
  173. self.discountPriceLabel2.textColor = [NSColor colorWithRed:255.0/255.0 green:231.0/255.0 blue:106.0/255.0 alpha:1.0];
  174. self.discountPriceLabel2.font = [NSFont fontWithName:@"Ubuntu" size:36.0];
  175. [self.discountPriceLabel2 setHidden:YES];
  176. self.freeVersionLbl.stringValue = NSLocalizedString(@"Free Version", nil);
  177. self.parmanentVerLbl.stringValue = NSLocalizedString(@"Permanent License", nil);
  178. self.freeVersionInfoLbl1.stringValue = self.parmanentVerInfoLbl1.stringValue = NSLocalizedString(@"View PDFs", nil);
  179. self.freeVersionInfoLbl2.stringValue = NSLocalizedString(@"Annotate PDFs (basic)", nil);
  180. self.parmanentVerInfoLbl2.stringValue = NSLocalizedString(@"Annotate PDFs (advanced)", nil);
  181. self.freeVersionInfoLbl3.stringValue = self.parmanentVerInfoLbl3.stringValue = NSLocalizedString(@"Unlimited file conversion", nil);
  182. self.freeVersionInfoLbl4.stringValue = self.parmanentVerInfoLbl4.stringValue = NSLocalizedString(@"Edit PDF text and images", nil);
  183. self.freeVersionInfoLbl5.stringValue = self.parmanentVerInfoLbl5.stringValue = NSLocalizedString(@"Digital signature", nil);
  184. self.freeVersionInfoLbl6.stringValue = self.parmanentVerInfoLbl6.stringValue = NSLocalizedString(@"Organize pages", nil);
  185. self.freeVersionInfoLbl7.stringValue = self.parmanentVerInfoLbl7.stringValue = NSLocalizedString(@"Batch process", nil);
  186. self.freeVersionInfoLbl8.stringValue = self.parmanentVerInfoLbl8.stringValue = NSLocalizedString(@"OCR PDFs", nil);
  187. self.freeVersionInfoLbl9.stringValue = self.parmanentVerInfoLbl9.stringValue = NSLocalizedString(@"Measuring Tools", nil);
  188. self.freeVersionInfoLbl10.stringValue = self.parmanentVerInfoLbl10.stringValue = NSLocalizedString(@"Ad-free", nil);
  189. [self refreshParmanentVerInfo];
  190. // self.parmanentVerinfoimg2.toolTip = NSLocalizedString(@"Support insert links and custom stamps", nil);
  191. self.parmanentVerInfoBtn2.mouseMoveCallback = ^(BOOL mouseEntered) {
  192. if (mouseEntered) {
  193. KMToolbarItemPopViewController *popViewController = [[KMToolbarItemPopViewController alloc] init];
  194. self.popOver = [[NSPopover alloc] init];
  195. self.popOver.contentViewController = popViewController;
  196. self.popOver.animates = NO;
  197. self.popOver.behavior = NSPopoverBehaviorSemitransient;
  198. self.popOver.contentSize = popViewController.view.frame.size;
  199. [popViewController updateWithHelpTipWithHelpTip:NSLocalizedString(@"Support insert links and custom stamps", nil)];
  200. [self.popOver showRelativeToRect:self.parmanentVerInfoBtn2.frame ofView:self.parmanentInfoView preferredEdge:NSRectEdgeMaxY];
  201. // self.parmanentVerinfoimg2.image = [NSImage imageNamed:@"ic_Tooltip_hover"];
  202. } else {
  203. [self.popOver close];
  204. // self.parmanentVerinfoimg2.image = [NSImage imageNamed:@"ic_Tooltip"];
  205. }
  206. };
  207. self.oneTimeTipLbl.stringValue = NSLocalizedString(@"one-time purchase", nil);
  208. self.enterLicenseButton.title = NSLocalizedString(@"Enter License", nil);
  209. [self.enterLicenseButton setTitleColor:[KMAppearance KMColor_Layout_W0]];
  210. self.enterLicenseButton.mouseMoveCallback = ^(BOOL mouseEntered) {
  211. if (mouseEntered) {
  212. [blockSelf.enterLicenseButton setTitleColor:[KMAppearance KMColor_Layout_W70]];
  213. } else {
  214. [blockSelf.enterLicenseButton setTitleColor:[KMAppearance KMColor_Layout_W0]];
  215. }
  216. };
  217. self.titleLabel.font = [NSFont SFMediumFontWithSize:20];
  218. self.freeVersionLbl.font = [NSFont UbuntuBoldFontWithSize:24];
  219. self.parmanentVerLbl.font = [NSFont UbuntuBoldFontWithSize:24];
  220. self.freeVersionInfoLbl1.font = self.parmanentVerInfoLbl1.font = [NSFont SFProTextRegularFont:14.];
  221. self.freeVersionInfoLbl2.font = [NSFont SFProTextRegularFont:14.];
  222. self.parmanentVerInfoLbl2.font = [NSFont SFProTextRegularFont:14.];
  223. self.freeVersionInfoLbl3.font = self.parmanentVerInfoLbl3.font = [NSFont SFProTextRegularFont:14.];
  224. self.freeVersionInfoLbl4.font = self.parmanentVerInfoLbl4.font = [NSFont SFProTextRegularFont:14.];
  225. self.freeVersionInfoLbl5.font = self.parmanentVerInfoLbl5.font = [NSFont SFProTextRegularFont:14.];
  226. self.freeVersionInfoLbl6.font = self.parmanentVerInfoLbl6.font = [NSFont SFProTextRegularFont:14.];
  227. self.freeVersionInfoLbl7.font = self.parmanentVerInfoLbl7.font = [NSFont SFProTextRegularFont:14.];
  228. self.freeVersionInfoLbl8.font = self.parmanentVerInfoLbl8.font = [NSFont SFProTextRegularFont:14.];
  229. self.freeVersionInfoLbl9.font = self.parmanentVerInfoLbl9.font = [NSFont SFProTextRegularFont:14.];
  230. self.freeVersionInfoLbl10.font = self.parmanentVerInfoLbl10.font = [NSFont SFProTextRegularFont:14.];
  231. self.buyNowButton.font = [NSFont UbuntuMediumFontWithSize:16];
  232. self.freeTrialButton.font = [NSFont UbuntuMediumFontWithSize:16];
  233. self.freeContendView.wantsLayer = YES;
  234. self.freeContendView.layer.cornerRadius = 12;
  235. self.freeContendView.layer.masksToBounds = YES;
  236. self.parmanentVerBGView.wantsLayer = YES;
  237. self.parmanentVerBGView.layer.cornerRadius = 12;
  238. self.parmanentVerBGView.layer.masksToBounds = YES;
  239. self.buyNowBox.wantsLayer = YES;
  240. self.buyNowBox.fillColor = [NSColor colorWithRed:255/255. green:94/255. blue:44/255. alpha:1.];
  241. self.buyNowBox.cornerRadius = CGRectGetHeight(self.buyNowBox.frame)/2.;
  242. self.buyNowBox.layer.masksToBounds = YES;
  243. self.buyNowButton.wantsLayer = YES;
  244. self.buyNowButton.layer.cornerRadius = 1.0;
  245. self.buyNowButton.title = NSLocalizedString(@"Buy Now", nil);
  246. self.buyNowButton.mouseMoveCallback = ^(BOOL mouseEntered) {
  247. if (mouseEntered) {
  248. blockSelf.buyNowButton.layer.backgroundColor = [[NSColor blackColor] colorWithAlphaComponent:0.15].CGColor;
  249. } else {
  250. blockSelf.buyNowButton.layer.backgroundColor = [NSColor clearColor].CGColor;
  251. }
  252. };
  253. self.freeTrialBox.cornerRadius = CGRectGetHeight(self.freeTrialBox.frame)/2.;
  254. self.freeTrialBox.borderWidth = 1.;
  255. self.freeTrialButton.target = self;
  256. self.freeTrialButton.action = @selector(buttonItemClicked_License:);
  257. self.freeTrialButton.mouseMoveCallback = ^(BOOL mouseEntered) {
  258. if ([KMAppearance isDarkMode]) {
  259. if (mouseEntered) {
  260. blockSelf.freeTrialBox.fillColor = [NSColor colorWithRed:179/255. green:159/255. blue:1 alpha:0.2];
  261. } else {
  262. blockSelf.freeTrialBox.fillColor = [NSColor colorWithRed:179/255. green:159/255. blue:1 alpha:0.07];
  263. }
  264. } else {
  265. if (mouseEntered) {
  266. blockSelf.freeTrialBox.fillColor = [NSColor colorWithRed:85/255. green:40/255. blue:1 alpha:0.15];
  267. } else {
  268. blockSelf.freeTrialBox.fillColor = [NSColor colorWithRed:85/255. green:40/255. blue:1 alpha:0.07];
  269. }
  270. }
  271. };
  272. self.discountTipImage.hidden = YES;
  273. [self updatePriceLabel];
  274. self.aiSepLineView.wantsLayer = YES;
  275. self.aiInfoLbl1.font = self.aiInfoLbl2.font = self.aiInfoLbl3.font = self.aiInfoLbl4.font = [NSFont SFProTextRegularFont:14];
  276. self.aiPurchaseLabel.font = [NSFont UbuntuMediumFontWithSize:16];
  277. self.aiTitleLabel.stringValue = NSLocalizedString(@"AI Tools Title", nil);
  278. self.aiInfoLbl1.stringValue = NSLocalizedString(@"AI Summarize", nil);
  279. self.aiInfoLbl2.stringValue = NSLocalizedString(@"AI Rewrite", nil);
  280. self.aiInfoLbl3.stringValue = NSLocalizedString(@"AI Proofread", nil);
  281. self.aiInfoLbl4.stringValue = NSLocalizedString(@"AI Translate", nil);
  282. self.aiPurchaseLabel.stringValue = NSLocalizedString(@"Buy Now", nil);
  283. self.aiPurchaseButton.wantsLayer = YES;
  284. self.aiPurchaseButton.layer.cornerRadius = CGRectGetHeight(self.aiPurchaseButton.frame)/2.;
  285. self.aiPurchaseButton.layer.masksToBounds = YES;
  286. self.aiPurchaseButton.mouseMoveCallback = ^(BOOL mouseEntered) {
  287. if (mouseEntered) {
  288. self.aiPurchaseButton.layer.backgroundColor = [[NSColor whiteColor] colorWithAlphaComponent:0.2].CGColor;
  289. } else {
  290. self.aiPurchaseButton.layer.backgroundColor = [NSColor clearColor].CGColor;
  291. }
  292. };
  293. [self updateViewColor];
  294. [self updatePurchaseInformation];
  295. [NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(themeChanged:) name:@"AppleInterfaceThemeChangedNotification" object: nil];
  296. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(recommondInfoUpdateNoti:) name:@"KMRecommondInfoUpdateNoti" object:nil];
  297. }
  298. #pragma mark - Private Methods
  299. - (void)updateViewColor {
  300. if ([KMAppearance isDarkMode]) {
  301. self.freeContendView.layer.backgroundColor = [[NSColor blackColor] colorWithAlphaComponent:0.3].CGColor;
  302. self.freeVersionLineView.layer.backgroundColor = [[NSColor whiteColor] colorWithAlphaComponent:0.1].CGColor;
  303. self.aiSepLineView.layer.backgroundColor = [[NSColor whiteColor] colorWithAlphaComponent:0.1].CGColor;
  304. self.freeVersionLbl.textColor = [[NSColor whiteColor] colorWithAlphaComponent:0.5];
  305. self.freeTrialBox.fillColor = [NSColor colorWithRed:179/255. green:159/255. blue:1 alpha:0.07];
  306. self.freeTrialBox.borderColor = [NSColor colorWithRed:207/255. green:146/255. blue:1 alpha:1];
  307. self.freeVersionInfoLbl1.textColor =
  308. self.freeVersionInfoLbl2.textColor =
  309. self.freeVersionInfoLbl3.textColor =
  310. self.freeVersionInfoLbl4.textColor =
  311. self.freeVersionInfoLbl5.textColor =
  312. self.freeVersionInfoLbl6.textColor =
  313. self.freeVersionInfoLbl7.textColor =
  314. self.freeVersionInfoLbl8.textColor =
  315. self.freeVersionInfoLbl9.textColor =
  316. self.freeVersionInfoLbl10.textColor = [NSColor whiteColor];
  317. self.parmanentVerInfoLbl1.textColor =
  318. self.parmanentVerInfoLbl2.textColor =
  319. self.parmanentVerInfoLbl3.textColor =
  320. self.parmanentVerInfoLbl4.textColor =
  321. self.parmanentVerInfoLbl5.textColor =
  322. self.parmanentVerInfoLbl6.textColor =
  323. self.parmanentVerInfoLbl7.textColor =
  324. self.parmanentVerInfoLbl8.textColor =
  325. self.parmanentVerInfoLbl9.textColor =
  326. self.parmanentVerInfoLbl10.textColor = [NSColor whiteColor];
  327. self.aiInfoLbl1.textColor = self.aiInfoLbl2.textColor = self.aiInfoLbl3.textColor = self.aiInfoLbl4.textColor = [NSColor whiteColor];
  328. self.aiPurchaseLabel.textColor = [NSColor whiteColor];
  329. self.aiTitleLabel.textColor = [NSColor colorWithRed:239/255. green:235/255. blue:255/255. alpha:1];
  330. } else {
  331. self.freeContendView.layer.backgroundColor = [[NSColor whiteColor] colorWithAlphaComponent:0.7].CGColor;
  332. self.freeVersionLineView.layer.backgroundColor = [NSColor colorWithRed:0 green:33/255. blue:67/255. alpha:0.1].CGColor;
  333. self.aiSepLineView.layer.backgroundColor = [NSColor colorWithRed:0 green:33/255. blue:67/255. alpha:0.1].CGColor;
  334. self.freeVersionLbl.textColor = [NSColor colorWithRed:129/255. green:125/255. blue:178/255. alpha:1.];
  335. self.freeTrialBox.fillColor = [NSColor colorWithRed:85/255. green:40/255. blue:1 alpha:0.07];
  336. self.freeTrialBox.borderColor = [NSColor colorWithRed:160/255. green:40/255. blue:1 alpha:1];
  337. self.freeVersionInfoLbl1.textColor =
  338. self.freeVersionInfoLbl2.textColor =
  339. self.freeVersionInfoLbl3.textColor =
  340. self.freeVersionInfoLbl4.textColor =
  341. self.freeVersionInfoLbl5.textColor =
  342. self.freeVersionInfoLbl6.textColor =
  343. self.freeVersionInfoLbl7.textColor =
  344. self.freeVersionInfoLbl8.textColor =
  345. self.freeVersionInfoLbl9.textColor =
  346. self.freeVersionInfoLbl10.textColor = [NSColor colorWithRed:20/255.0 green:0/255.0 blue:102/255.0 alpha:1];
  347. self.parmanentVerInfoLbl1.textColor =
  348. self.parmanentVerInfoLbl2.textColor =
  349. self.parmanentVerInfoLbl3.textColor =
  350. self.parmanentVerInfoLbl4.textColor =
  351. self.parmanentVerInfoLbl5.textColor =
  352. self.parmanentVerInfoLbl6.textColor =
  353. self.parmanentVerInfoLbl7.textColor =
  354. self.parmanentVerInfoLbl8.textColor =
  355. self.parmanentVerInfoLbl9.textColor =
  356. self.parmanentVerInfoLbl10.textColor = [NSColor whiteColor];
  357. self.aiInfoLbl1.textColor = self.aiInfoLbl2.textColor = self.aiInfoLbl3.textColor = self.aiInfoLbl4.textColor = [NSColor colorWithRed:20/255. green:0 blue:102/255. alpha:1];
  358. self.aiPurchaseLabel.textColor = [NSColor whiteColor];
  359. self.aiTitleLabel.textColor = [NSColor colorWithRed:20/255. green:0 blue:102/255. alpha:1];
  360. }
  361. self.parmanentVerLbl.textColor = [NSColor colorWithRed:252/255. green:253/255. blue:255/255. alpha:1.];
  362. self.oneTimeTipLbl.textColor = [NSColor colorWithRed:255/255. green:231/255. blue:106/255. alpha:1.];
  363. if ([KMAppearance isDarkMode]) {
  364. [self.freeTrialButton setTitleColor:[NSColor colorWithRed:178/255. green:165/255. blue:1 alpha:1]];
  365. } else {
  366. [self.freeTrialButton setTitleColor:[NSColor colorWithRed:160/255. green:40/255. blue:1 alpha:1]];
  367. }
  368. }
  369. - (void)updatePurchaseInformation {
  370. self.freeTrialBox.hidden = NO;
  371. self.titleLabel.stringValue = NSLocalizedString(@"Upgrade to Pro Version", nil);
  372. self.titleLabel.textColor = [NSColor whiteColor];
  373. [self.freeTrialButton setTitle:NSLocalizedString(@"7-day Free Trial", nil)];
  374. if (ActivityStatusVerification == [VerificationManager manager].status) {
  375. self.freeTrialBox.hidden = YES;
  376. } else if (ActivityStatusNone == [VerificationManager manager].status) {
  377. } else if (ActivityStatusTrialExpire == [VerificationManager manager].status) {
  378. self.freeTrialBox.hidden = YES;
  379. if ([VerificationManager manager].secondTrialEnabled) {
  380. self.freeTrialBox.hidden = NO;
  381. }
  382. } else {
  383. self.freeTrialBox.hidden = YES;
  384. }
  385. if ([KMAppearance isDarkMode]) {
  386. [self.freeTrialButton setTitleColor:[NSColor colorWithRed:178/255. green:165/255. blue:1 alpha:1]];
  387. } else {
  388. [self.freeTrialButton setTitleColor:[NSColor colorWithRed:160/255. green:40/255. blue:1 alpha:1]];
  389. }
  390. [self.buyNowButton setTitleColor:[NSColor whiteColor]];
  391. [self updatePriceLabel];
  392. }
  393. - (void)updatePriceLabel {
  394. NSString *originalText = @"";
  395. NSString *discountText = @"";
  396. #if VERSION_DMG
  397. NSString *abbreviation = @"$";
  398. if ([@"CNY" isEqualToString:NSLocalizedString(@"USD", nil)]) {
  399. abbreviation = @"¥";
  400. }
  401. if ([self.buySwitch state]) {
  402. originalText = [NSString stringWithFormat:@"%@%@", abbreviation, [[KMDMGProductsManager shareInstance] getPrice:KMAdvancedAnnualSubscriptionCodeKey_DMG]];
  403. discountText = [NSString stringWithFormat:@"%@%@", abbreviation, [[KMDMGProductsManager shareInstance] getActivityPrice:KMAdvancedAnnualSubscriptionCodeKey_DMG]];
  404. } else {
  405. originalText = [NSString stringWithFormat:@"%@%@", abbreviation, [[KMDMGProductsManager shareInstance] getPrice:KMStandardAnnualSubscriptionCodeKey_DMG]];
  406. discountText = [NSString stringWithFormat:@"%@%@", abbreviation, [[KMDMGProductsManager shareInstance] getActivityPrice:KMStandardAnnualSubscriptionCodeKey_DMG]];
  407. }
  408. #endif
  409. NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:originalText];
  410. [attributedText addAttribute:NSStrikethroughStyleAttributeName
  411. value:@(NSUnderlineStyleSingle)
  412. range:NSMakeRange(0, originalText.length)];
  413. self.originalPriceLabel.attributedStringValue = attributedText;
  414. self.discountPriceLabel.stringValue = discountText;
  415. self.discountPriceLabel2.stringValue = discountText;
  416. if (KMAdvertisementManager.manager.info.discountContent.content.count > 0) {
  417. KMAdvertisementItemInfo *info = KMAdvertisementManager.manager.info.discountContent.content.firstObject;
  418. if ([KMAdvertisementManager checkAdvertisementValid:info]) {
  419. self.discountTipImage.hidden = NO;
  420. NSURL *url = [NSURL URLWithString:[KMAdvertisementModelTransition transitionImagePathWithImage:info.image highlight:NO]];
  421. self.discountTipImage.image = [KMAdvertisementImage imageWithURLWithUrl:url completion:^(NSImage * _Nonnull image) {
  422. self.discountTipImage.image = image;
  423. }];
  424. if ([originalText isEqualToString:discountText]) {
  425. [self.originalPriceLabel setHidden:YES];
  426. [self.discountPriceLabel setHidden:YES];
  427. [self.discountPriceLabel2 setHidden:NO];
  428. [self.discountTipImage setHidden:YES];
  429. } else {
  430. [self.originalPriceLabel setHidden:NO];
  431. [self.discountPriceLabel setHidden:NO];
  432. [self.discountPriceLabel2 setHidden:YES];
  433. [self.discountTipImage setHidden:NO];
  434. }
  435. } else {
  436. self.discountTipImage.hidden = YES;
  437. if ([originalText isEqualToString:discountText]) {
  438. [self.originalPriceLabel setHidden:YES];
  439. [self.discountPriceLabel setHidden:YES];
  440. [self.discountPriceLabel2 setHidden:NO];
  441. } else {
  442. [self.originalPriceLabel setHidden:NO];
  443. [self.discountPriceLabel setHidden:NO];
  444. [self.discountPriceLabel2 setHidden:YES];
  445. }
  446. }
  447. }
  448. }
  449. - (void)refreshParmanentVerInfo {
  450. if ([self.buySwitch state] == NSControlStateValueOn) {
  451. self.parmanentVerInfoLbl1.stringValue = NSLocalizedString(@"View PDFs", nil);
  452. self.parmanentVerInfoLbl2.stringValue = NSLocalizedString(@"Annotate PDFs (advanced)", nil);
  453. self.parmanentVerInfoLbl3.stringValue = NSLocalizedString(@"Unlimited file conversion", nil);
  454. self.parmanentVerInfoLbl4.stringValue = NSLocalizedString(@"Edit PDF text and images", nil);
  455. self.parmanentVerInfoLbl5.stringValue = NSLocalizedString(@"Digital signature", nil);
  456. self.parmanentVerInfoLbl6.stringValue = NSLocalizedString(@"Organize pages", nil);
  457. self.parmanentVerInfoLbl7.stringValue = NSLocalizedString(@"Batch process", nil);
  458. self.parmanentVerInfoLbl8.stringValue = NSLocalizedString(@"OCR PDFs", nil);
  459. self.parmanentVerInfoLbl9.stringValue = NSLocalizedString(@"Measuring Tools", nil);
  460. self.parmanentVerInfoLbl10.stringValue = NSLocalizedString(@"Ad-free", nil);
  461. self.parmanentVerInfoImage1.image = [NSImage imageNamed:@"function_vip"];
  462. } else {
  463. self.parmanentVerInfoLbl1.stringValue = NSLocalizedString(@"Unlimited file conversion", nil);
  464. self.parmanentVerInfoLbl2.stringValue = NSLocalizedString(@"Annotate PDFs (advanced)", nil);
  465. self.parmanentVerInfoLbl3.stringValue = NSLocalizedString(@"View PDFs", nil);
  466. self.parmanentVerInfoLbl4.stringValue = NSLocalizedString(@"Edit PDF text and images", nil);
  467. self.parmanentVerInfoLbl5.stringValue = NSLocalizedString(@"Digital signature", nil);
  468. self.parmanentVerInfoLbl6.stringValue = NSLocalizedString(@"Organize pages", nil);
  469. self.parmanentVerInfoLbl7.stringValue = NSLocalizedString(@"Batch process", nil);
  470. self.parmanentVerInfoLbl8.stringValue = NSLocalizedString(@"OCR PDFs", nil);
  471. self.parmanentVerInfoLbl9.stringValue = NSLocalizedString(@"Measuring Tools", nil);
  472. self.parmanentVerInfoLbl10.stringValue = NSLocalizedString(@"Ad-free", nil);
  473. self.parmanentVerInfoImage1.image = [NSImage imageNamed:@"compare_nosupport"];
  474. }
  475. }
  476. #pragma mark - Window Method
  477. - (void)showWindow:(id)sender {
  478. [super showWindow:nil];
  479. [self.window center];
  480. [self.window orderFront:nil];
  481. [self.buySwitch setState:NSControlStateValueOn];
  482. [self updatePriceLabel];
  483. [self updatePurchaseInformation];
  484. }
  485. - (BOOL)windowShouldClose:(id)sender {
  486. [self endModal:sender];
  487. return YES;
  488. }
  489. - (void)close {
  490. [super close];
  491. // 清空埋点的数据
  492. self.kEventName = nil;
  493. self.kEventTag = 0;
  494. [self endModal:nil];
  495. }
  496. - (void)updateTitle:(NSString *)title andColor:(NSColor *)titleColor {
  497. self.titleLabel.stringValue = title ?:@"";
  498. self.titleLabel.textColor = titleColor ?:[NSColor labelColor];
  499. }
  500. #pragma mark - IBAction
  501. - (IBAction)startModal:(id)sender {
  502. [NSApp stopModal];
  503. NSInteger modalCode;
  504. self.modalSession = [NSApp beginModalSessionForWindow:self.window];
  505. do {
  506. modalCode = [NSApp runModalSession:self.modalSession];
  507. } while (modalCode == NSRunContinuesResponse);
  508. }
  509. - (IBAction)endModal:(id)sender {
  510. if (self.modalSession) {
  511. [NSApp stopModal];
  512. [NSApp endModalSession:self.modalSession];
  513. [self.window orderOut:self];
  514. self.modalSession = nil;
  515. }
  516. }
  517. - (void)showWindowRestore:(id)sender {
  518. [self showWindow:sender];
  519. }
  520. - (IBAction)enterLicenseAction:(id)sender {
  521. [self close];
  522. KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
  523. vc.callback = ^{
  524. // [[KMProductCompareWC shared] setOrientation:NO];
  525. // [[KMProductCompareWC shared] showWindow:nil];
  526. [[KMMemberInfo shared] advancedFunctionUsage];
  527. };
  528. [vc showWindow:nil];
  529. }
  530. - (IBAction)buttonItemClicked_Buy:(id)sender {
  531. #if VERSION_DMG
  532. [self trackEvent_buyNow];
  533. NSString *paidEventName = [self _buyNowEventToPaidEventName];
  534. NSDictionary *paidEventParams = [self _getPaidEventParamsWith:paidEventName];
  535. NSString *thePaidEventName = paidEventParams.allKeys.firstObject;
  536. NSDictionary *thePaidEventParams = nil;
  537. if (paidEventName != nil && paidEventParams.allValues.firstObject != nil) {
  538. thePaidEventParams = @{paidEventParams.allValues.firstObject : paidEventName};
  539. }
  540. [self close];
  541. NSString *productID = @"";
  542. if ([self.buySwitch state]) {
  543. productID = KMAdvancedAnnualSubscriptionCodeKey_DMG;
  544. } else {
  545. productID = KMStandardAnnualSubscriptionCodeKey_DMG;
  546. }
  547. KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentCode:productID];
  548. embeddedWC.kEventName = thePaidEventName;
  549. embeddedWC.kEventParams = thePaidEventParams;
  550. [embeddedWC showWindow:nil];
  551. [[embeddedWC window] center];
  552. #endif
  553. }
  554. - (IBAction)buttonItemClicked_CloseWindow:(id)sender {
  555. [self close];
  556. }
  557. - (void)buttonItemClicked_License:(id)sender {
  558. // if (ActivityStatusNone == [VerificationManager manager].status) {
  559. // [self close];
  560. //
  561. // KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeTrial];
  562. // [vc showWindow:nil];
  563. // } else if (ActivityStatusTrialExpire == [VerificationManager manager].status) {
  564. if ([VerificationManager manager].secondTrialEnabled) {
  565. [[FMTrackEventManager defaultManager] trackEventWithEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_SecondTrial"}];
  566. [[VerificationManager manager] trialForDays:7
  567. email:[VerificationManager manager].email
  568. name:[VerificationManager manager].accountName
  569. complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
  570. if (error ||
  571. status != ActivityStatusTrial) {
  572. NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
  573. defaultButton:NSLocalizedString(@"Try Again", nil)
  574. alternateButton:nil
  575. otherButton:nil
  576. informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
  577. [alert runModal];
  578. } else {
  579. KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialSuccess];
  580. [vc showWindow:nil];
  581. }
  582. }];
  583. [self close];
  584. } else {
  585. [self close];
  586. KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeTrial];
  587. vc.callback = ^{
  588. // [[KMProductCompareWC shared] setOrientation:NO];
  589. // [[KMProductCompareWC shared] showWindow:nil];
  590. [[KMMemberInfo shared] advancedFunctionUsage];
  591. };
  592. [vc showWindow:nil];
  593. }
  594. }
  595. - (IBAction)aiPurchaseButtonClick:(NSButton *)sender {
  596. // NSURL *url = [NSURL URLWithString:Swift_oc_Tool.AIProduct_Link_OC];
  597. // [[NSWorkspace sharedWorkspace] openURL:url];
  598. //
  599. // [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_BuyAITools"}];
  600. [self trackEvent_buyNow];
  601. NSString *paidEventName = [self _buyNowEventToPaidEventName];
  602. NSDictionary *paidEventParams = [self _getPaidEventParamsWith:paidEventName];
  603. NSString *thePaidEventName = paidEventParams.allKeys.firstObject;
  604. NSDictionary *thePaidEventParams = nil;
  605. if (paidEventName != nil && paidEventParams.allValues.firstObject != nil) {
  606. thePaidEventParams = @{paidEventParams.allValues.firstObject : paidEventName};
  607. }
  608. [self close];
  609. #if VERSION_DMG
  610. KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentCode:KMAISubscriptionMonthCodeKey_DMG];
  611. embeddedWC.kEventName = thePaidEventName;
  612. embeddedWC.kEventParams = thePaidEventParams;
  613. [embeddedWC showWindow:nil];
  614. [[embeddedWC window] center];
  615. #endif
  616. }
  617. - (IBAction)buySwitchAction:(NSSwitch *)sender {
  618. [self refreshParmanentVerInfo];
  619. [self updatePriceLabel];
  620. }
  621. #pragma mark - Noti
  622. - (void)themeChanged:(NSNotification *)notification {
  623. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  624. [self updateViewColor];
  625. });
  626. }
  627. - (void)recommondInfoUpdateNoti:(NSNotification *)noti {
  628. dispatch_async(dispatch_get_main_queue(), ^{
  629. [self updatePriceLabel];
  630. });
  631. }
  632. @end
  633. @implementation KMPurchaseCompareDMGWindowController (KMAnalytic)
  634. - (void)trackEvent_buyNow {
  635. NSDictionary *params = [self _getBuyNowEventParams];
  636. NSString *theEventName = params.allKeys.firstObject;
  637. NSDictionary *theParams = nil;
  638. if (self.kEventName != nil && params.allValues.firstObject != nil) {
  639. theParams = @{params.allValues.firstObject : self.kEventName};
  640. }
  641. [self trackEvent_dmgWithEventName:theEventName params:theParams platform:KMAnalyticsPlatformAppCenter];
  642. }
  643. - (NSDictionary *)_getBuyNowEventParams {
  644. NSString *eveN = self.kEventName;
  645. if (eveN == nil || eveN.length == 0) {
  646. return nil;
  647. }
  648. if ([eveN isEqual:@"Reading_WebsiteLink_BuyNow"] ||
  649. [eveN isEqual:@"Reading_EmailLink_BuyNow"] ||
  650. [eveN isEqual:@"Reading_DynamicStamp_BuyNow"] ||
  651. [eveN isEqual:@"Reading_CustomStamp_BuyNow"] ||
  652. [eveN isEqual:@"Reading_Signature_BuyNow"] ||
  653. [eveN isEqual:@"Reading_Table_BuyNow"]) {
  654. return @{@"Purchase_Tools" : @"SubTbr_Tools"};
  655. } else if ([eveN isEqual:@"Reading_InsertBlankPage_BuyNow"] ||
  656. [eveN isEqual:@"Reading_InsertPDF_BuyNow"] ||
  657. [eveN isEqual:@"Reading_InsertSacnner_BuyNow"] ||
  658. [eveN isEqual:@"Reading_InsertImage_BuyNow"] ||
  659. [eveN isEqual:@"Reading_InsertClipboard_BuyNow"] ||
  660. [eveN isEqual:@"Reading_Replace_BuyNow"] ||
  661. [eveN isEqual:@"Reading_Extract_BuyNow"] ||
  662. [eveN isEqual:@"Reading_Split_BuyNow"] ||
  663. ([eveN isEqual:@"Reading_Rotate_BuyNow"] && self.kEventTag == 0) ||
  664. [eveN isEqual:@"Reading_Reverse_BuyNow"] ||
  665. [eveN isEqual:@"Reading_Copy_BuyNow"] ||
  666. [eveN isEqual:@"Reading_Delete_BuyNow"] ||
  667. [eveN isEqual:@"Reading_Merge_BuyNow"]) {
  668. return @{@"Purchase_PageEdit" : @"SubTbr_PageEdit"};
  669. } else if ([eveN isEqual:@"Onbrd_EditPage_BuyNow"] ||
  670. [eveN isEqual:@"Onbrd_Merge_BuyNow"]) {
  671. return @{@"Purchase_PageEdit" : @"Home_PageEdit"};
  672. } else if ([eveN isEqual:@"Reading_RemoveSecurity_BuyNow"] ||
  673. [eveN isEqual:@"Reading_Compare_BuyNow"] ||
  674. [eveN isEqual:@"Reading_AddWatermark_BuyNow"] ||
  675. [eveN isEqual:@"Reading_RemoveWatermark_BuyNow"] ||
  676. [eveN isEqual:@"Reading_AddBackground_BuyNow"] ||
  677. [eveN isEqual:@"Reading_RemoveBackground_BuyNow"] ||
  678. [eveN isEqual:@"Reading_AddHeaderFooter_BuyNow"] ||
  679. [eveN isEqual:@"Reading_RemoveHeaderFooter_BuyNow"] ||
  680. [eveN isEqual:@"Reading_AddBates_BuyNow"] ||
  681. [eveN isEqual:@"Reading_RemoveBates_BuyNow"] ||
  682. [eveN isEqual:@"Reading_Measure_BuyNow"]) {
  683. return @{@"Purchase_Editor" : @"SubTbr_Editor"};
  684. } else if ([eveN isEqual:@"Onbrd_Compare_BuyNow"] ||
  685. [eveN isEqual:@"Onbrd_Background_BuyNow"] ||
  686. [eveN isEqual:@"Onbrd_Watermard_BuyNow"] ||
  687. [eveN isEqual:@"Onbrd_HeaderFooter_BuyNow"] ||
  688. [eveN isEqual:@"Onbrd_Bates_BuyNow"] ||
  689. [eveN isEqual:@"Onbrd_Security_BuyNow"]) {
  690. return @{@"Purchase_Editor" : @"Home_Editor"};
  691. } else if ([eveN isEqual:@"Reading_PDFtoWord_BuyNow"] ||
  692. [eveN isEqual:@"Reading_PDFtoExcel_BuyNow"] ||
  693. [eveN isEqual:@"Reading_PDFtoPPT_BuyNow"] ||
  694. [eveN isEqual:@"Reading_PDFtoRTF_BuyNow"] ||
  695. [eveN isEqual:@"Reading_PDFtoCSV_BuyNow"] ||
  696. [eveN isEqual:@"Reading_PDFtoText_BuyNow"] ||
  697. [eveN isEqual:@"Reading_PDFtoImage_BuyNow"] ||
  698. [eveN isEqual:@"Reading_ExtractImage_BuyNow"]) {
  699. return @{@"Purchase_Converter" : @"SubTbr_Converter"};
  700. } else if ([eveN isEqual:@"Onbrd_ConvertPDF_BuyNow"] ||
  701. [eveN isEqual:@"Onbrd_PDFtoWord_BuyNow"] ||
  702. [eveN isEqual:@"Onbrd_PDFtoExcel_BuyNow"] ||
  703. [eveN isEqual:@"Onbrd_PDFtoPPT_BuyNow"] ||
  704. [eveN isEqual:@"Onbrd_ImagetoPDF_BuyNow"]) {
  705. return @{@"Purchase_Converter" : @"Home_Converter"};
  706. } else if ([eveN isEqual:@"Reading_TextField_BuyNow"] ||
  707. [eveN isEqual:@"Reading_CheckBox_BuyNow"] ||
  708. [eveN isEqual:@"Reading_RadioButton_BuyNow"] ||
  709. [eveN isEqual:@"Reading_ListBox_BuyNow"] ||
  710. [eveN isEqual:@"Reading_ComboBox_BuyNow"] ||
  711. [eveN isEqual:@"Reading_Button_BuyNow"]) {
  712. return @{@"Purchase_Form" : @"SubTbr_Forms"};
  713. } else if ([eveN isEqual:@"Reading_FillSign_Signature_BuyNow"] ||
  714. [eveN isEqual:@"Reading_DigitalSign_BuyNow"] ||
  715. [eveN isEqual:@"Reading_ElectronicSign_BuyNow"]) {
  716. return @{@"Purchase_Sign" : @"SunTbr_Signature"};
  717. } else if ([eveN isEqual:@"Reading_EditPDF_BuyNow"] ||
  718. [eveN isEqual:@"Reading_ReplaceText_BuyNow"]) {
  719. return @{@"Purchase_EditPDF" : @"Tbr_Edit PDF"};
  720. } else if ([eveN isEqual:@"Reading_Redact_BuyNow"]) {
  721. return @{@"Purchase_Redact" : @"Tbr_Redact"};
  722. } else if ([eveN isEqual:@"Reading_OCR_BuyNow"] ||
  723. [eveN isEqual:@"Reading_Convert_OCR_BuyNow"] ||
  724. [eveN isEqual:@"Onbrd_OCR_BuyNow"]) {
  725. return @{@"Purchase_OCR" : @"SubTbr_OCR"};
  726. } else if ([eveN isEqual:@"Reading_SplitView_BuyNow"] ||
  727. [eveN isEqual:@"Reading_Rotate_BuyNow"] ||
  728. [eveN isEqual:@"Reading_Theme_BuyNow"] ||
  729. [eveN isEqual:@"Reading_MultiTab_BuyNow"]) {
  730. return @{@"Purchase_PageDisplay" : @"SubTbr_PageDisplay"};
  731. } else if ([eveN isEqual:@"Onbrd_PrintPoster_BuyNow"] ||
  732. [eveN isEqual:@"Onbrd_PrintMultiple_BuyNow"] ||
  733. [eveN isEqual:@"Onbrd_PrintBooklet_BuyNow"]) {
  734. return @{@"Purchase_Others" : @"Home_Others"};
  735. } else if ([eveN isEqual:@"Reading_Flatten_BuyNow"]) {
  736. return @{@"Purchase_Others" : @"SubTbr_Others"};
  737. } else if ([eveN isEqual:@"MenuBar_PrintPoster_BuyNow"] ||
  738. [eveN isEqual:@"MenuBar_PrintMultiple_BuyNow"] ||
  739. [eveN isEqual:@"MenuBar_PrintBooklet_BuyNow"]) {
  740. return @{@"Purchase_Others" : @"MenuBar_Others"};
  741. }
  742. return nil;
  743. }
  744. - (NSString *)_buyNowEventToPaidEventName {
  745. NSString *eveN = self.kEventName;
  746. if (eveN == nil || eveN.length == 0) {
  747. return nil;
  748. }
  749. // Paid_Tools
  750. if ([eveN isEqual:@"Reading_WebsiteLink_BuyNow"]) {
  751. return @"Reading_WebsiteLink_Paid";
  752. } else if ([eveN isEqual:@"Reading_EmailLink_BuyNow"]) {
  753. return @"Reading_EmailLink_Paid";
  754. } else if ([eveN isEqual:@"Reading_DynamicStamp_BuyNow"]) {
  755. return @"Reading_DynamicStamp_Paid";
  756. } else if ([eveN isEqual:@"Reading_CustomStamp_BuyNow"]) {
  757. return @"Reading_CustomStamp_Paid";
  758. } else if ([eveN isEqual:@"Reading_Signature_BuyNow"]) {
  759. return @"Reading_Signature_Paid";
  760. } else if ([eveN isEqual:@"Reading_Table_BuyNow"]) {
  761. return @"Reading_Table_Paid";
  762. }
  763. // Paid_PageEdit SubTbr_PageEdit
  764. else if ([eveN isEqual:@"Reading_InsertBlankPage_BuyNow"]) {
  765. return @"Reading_InsertBlankPage_Paid";
  766. } else if ([eveN isEqual:@"Reading_InsertPDF_BuyNow"]) {
  767. return @"Reading_InsertPDF_Paid";
  768. } else if ([eveN isEqual:@"Reading_InsertSacnner_BuyNow"]) {
  769. return @"Reading_InsertSacnner_Paid";
  770. } else if ([eveN isEqual:@"Reading_InsertImage_BuyNow"]) {
  771. return @"Reading_InsertImage_Paid";
  772. } else if ([eveN isEqual:@"Reading_InsertClipboard_BuyNow"]) {
  773. return @"Reading_InsertClipboard_Paid";
  774. } else if ([eveN isEqual:@"Reading_Replace_BuyNow"]) {
  775. return @"Reading_Replace_Paid";
  776. } else if ([eveN isEqual:@"Reading_Extract_BuyNow"]) {
  777. return @"Reading_Extract_Paid";
  778. } else if ([eveN isEqual:@"Reading_Split_BuyNow"]) {
  779. return @"Reading_Split_Paid";
  780. } else if ([eveN isEqual:@"Reading_Rotate_BuyNow"]) {
  781. return @"Reading_Rotate_Paid";
  782. } else if ([eveN isEqual:@"Reading_Reverse_BuyNow"]) {
  783. return @"Reading_Reverse_Paid";
  784. } else if ([eveN isEqual:@"Reading_Copy_BuyNow"]) {
  785. return @"Reading_Copy_Paid";
  786. } else if ([eveN isEqual:@"Reading_Delete_BuyNow"]) {
  787. return @"Reading_Delete_Paid";
  788. } else if ([eveN isEqual:@"Reading_Merge_BuyNow"]) {
  789. return @"Reading_Merge_Paid";
  790. }
  791. // Paid_PageEdit Home_PageEdit
  792. else if ([eveN isEqual:@"Onbrd_EditPage_BuyNow"]) {
  793. return @"Onbrd_EditPage_Paid";
  794. } else if ([eveN isEqual:@"Onbrd_Merge_BuyNow"]) {
  795. return @"Onbrd_Merge_Paid";
  796. }
  797. // Paid_Editor SubTbr_Editor
  798. else if ([eveN isEqual:@"Reading_RemoveSecurity_BuyNow"]) {
  799. return @"Reading_RemoveSecurity_Paid";
  800. } else if ([eveN isEqual:@"Reading_Compare_BuyNow"]) {
  801. return @"Reading_Compare_Paid";
  802. } else if ([eveN isEqual:@"Reading_AddWatermark_BuyNow"]) {
  803. return @"Reading_AddWatermark_Paid";
  804. } else if ([eveN isEqual:@"Reading_RemoveWatermark_BuyNow"]) {
  805. return @"Reading_RemoveWatermark_Paid";
  806. } else if ([eveN isEqual:@"Reading_AddBackground_BuyNow"]) {
  807. return @"Reading_AddBackground_Paid";
  808. } else if ([eveN isEqual:@"Reading_RemoveBackground_BuyNow"]) {
  809. return @"Reading_RemoveBackground_Paid";
  810. } else if ([eveN isEqual:@"Reading_AddHeaderFooter_BuyNow"]) {
  811. return @"Reading_AddHeaderFooter_Paid";
  812. } else if ([eveN isEqual:@"Reading_RemoveHeaderFooter_BuyNow"]) {
  813. return @"Reading_RemoveHeaderFooter_Paid";
  814. } else if ([eveN isEqual:@"Reading_AddBates_BuyNow"]) {
  815. return @"Reading_AddBates_Paid";
  816. } else if ([eveN isEqual:@"Reading_RemoveBates_BuyNow"]) {
  817. return @"Reading_RemoveBates_Paid";
  818. } else if ([eveN isEqual:@"Reading_Measure_BuyNow"]) {
  819. return @"Reading_Measure_Paid";
  820. }
  821. // Paid_Editor Home_Editor
  822. else if ([eveN isEqual:@"Onbrd_Compare_BuyNow"]) {
  823. return @"Onbrd_Compare_Paid";
  824. } else if ([eveN isEqual:@"Onbrd_Background_BuyNow"]) {
  825. return @"Onbrd_Background_Paid";
  826. } else if ([eveN isEqual:@"Onbrd_Watermard_BuyNow"]) {
  827. return @"Onbrd_Watermard_Paid";
  828. } else if ([eveN isEqual:@"Onbrd_HeaderFooter_BuyNow"]) {
  829. return @"Onbrd_HeaderFooter_Paid";
  830. } else if ([eveN isEqual:@"Onbrd_Bates_BuyNow"]) {
  831. return @"Onbrd_Bates_Paid";
  832. } else if ([eveN isEqual:@"Onbrd_Security_BuyNow"]) {
  833. return @"Onbrd_Security_Paid";
  834. }
  835. // Paid_Converter SubTbr_Converte
  836. else if ([eveN isEqual:@"Reading_PDFtoWord_BuyNow"]) {
  837. return @"Reading_PDFtoWord_Paid";
  838. } else if ([eveN isEqual:@"Reading_PDFtoExcel_BuyNow"]) {
  839. return @"Reading_PDFtoExcel_Paid";
  840. } else if ([eveN isEqual:@"Reading_PDFtoPPT_BuyNow"]) {
  841. return @"Reading_PDFtoPPT_Paid";
  842. } else if ([eveN isEqual:@"Reading_PDFtoRTF_BuyNow"]) {
  843. return @"Reading_PDFtoRTF_Paid";
  844. } else if ([eveN isEqual:@"Reading_PDFtoCSV_BuyNow"]) {
  845. return @"Reading_PDFtoCSV_Paid";
  846. } else if ([eveN isEqual:@"Reading_PDFtoText_BuyNow"]) {
  847. return @"Reading_PDFtoText_Paid";
  848. } else if ([eveN isEqual:@"Reading_PDFtoImage_BuyNow"]) {
  849. return @"Reading_PDFtoImage_Paid";
  850. } else if ([eveN isEqual:@"Reading_ExtractImage_BuyNow"]) {
  851. return @"Reading_ExtractImage_Paid";
  852. }
  853. // Paid_Converter Home_Converter
  854. else if ([eveN isEqual:@"Onbrd_ConvertPDF_BuyNow"]) {
  855. return @"Onbrd_ConvertPDF_Paid";
  856. } else if ([eveN isEqual:@"Onbrd_PDFtoWord_BuyNow"]) {
  857. return @"Onbrd_PDFtoWord_Paid";
  858. } else if ([eveN isEqual:@"Onbrd_PDFtoExcel_BuyNow"]) {
  859. return @"Onbrd_PDFtoExcel_Paid";
  860. } else if ([eveN isEqual:@"Onbrd_PDFtoPPT_BuyNow"]) {
  861. return @"Onbrd_PDFtoPPT_Paid";
  862. } else if ([eveN isEqual:@"Onbrd_ImagetoPDF_BuyNow"]) {
  863. return @"Onbrd_ImagetoPDF_Paid";
  864. }
  865. // Paid_Form SubTbr_Forms
  866. else if ([eveN isEqual:@"Reading_TextField_BuyNow"]) {
  867. return @"Reading_TextField_Paid";
  868. } else if ([eveN isEqual:@"Reading_CheckBox_BuyNow"]) {
  869. return @"Reading_CheckBox_Paid";
  870. } else if ([eveN isEqual:@"Reading_RadioButton_BuyNow"]) {
  871. return @"Reading_RadioButton_Paid";
  872. } else if ([eveN isEqual:@"Reading_ListBox_BuyNow"]) {
  873. return @"Reading_ListBox_Paid";
  874. } else if ([eveN isEqual:@"Reading_ComboBox_BuyNow"]) {
  875. return @"Reading_ComboBox_Paid";
  876. } else if ([eveN isEqual:@"Reading_Button_BuyNow"]) {
  877. return @"Reading_Button_Paid";
  878. }
  879. // Paid_Sign SunTbr_Signature
  880. else if ([eveN isEqual:@"Reading_FillSign_Signature_BuyNow"]) {
  881. return @"Reading_FillSign_Signature_Paid";
  882. } else if ([eveN isEqual:@"Reading_DigitalSign_BuyNow"]) {
  883. return @"Reading_DigitalSign_Paid";
  884. } else if ([eveN isEqual:@"Reading_ElectronicSign_BuyNow"]) {
  885. return @"Reading_ElectronicSign_Paid";
  886. }
  887. // Paid_EditPDF Tbr_Edit PDF
  888. else if ([eveN isEqual:@"Reading_EditPDF_BuyNow"]) {
  889. return @"Reading_EditPDF_Paid";
  890. } else if ([eveN isEqual:@"Reading_ReplaceText_BuyNow"]) {
  891. return @"Reading_ReplaceText_Paid";
  892. }
  893. // Paid_Redact Tbr_Redact
  894. else if ([eveN isEqual:@"Reading_Redact_BuyNow"]) {
  895. return @"Reading_Redact_Paid";
  896. }
  897. // Paid_OCR SubTbr_OCR
  898. else if ([eveN isEqual:@"Reading_OCR_BuyNow"]) {
  899. return @"Reading_OCR_Paid";
  900. } else if ([eveN isEqual:@"Reading_Convert_OCR_BuyNow"]) {
  901. return @"Reading_Convert_OCR_Paid";
  902. } else if ([eveN isEqual:@"Onbrd_OCR_BuyNow"]) {
  903. return @"Onbrd_OCR_Paid";
  904. }
  905. // Paid_PageDisplay SubTbr_Page Display
  906. else if ([eveN isEqual:@"Reading_SplitView_BuyNow"]) {
  907. return @"Reading_SplitView_Paid";
  908. } else if ([eveN isEqual:@"Reading_Rotate_BuyNow"]) {
  909. return @"Reading_Rotate_Paid";
  910. } else if ([eveN isEqual:@"Reading_Theme_BuyNow"]) {
  911. return @"Reading_Theme_Paid";
  912. } else if ([eveN isEqual:@"Reading_MultiTab_BuyNow"]) {
  913. return @"Reading_MultiTab_Paid";
  914. }
  915. // Home_Others
  916. else if ([eveN isEqual:@"Onbrd_PrintPoster_BuyNow"]) {
  917. return @"Onbrd_PrintPoster_Paid";
  918. } else if ([eveN isEqual:@"Onbrd_PrintMultiple_BuyNow"]) {
  919. return @"Onbrd_PrintMultiple_Paid";
  920. } else if ([eveN isEqual:@"Onbrd_PrintBooklet_BuyNow"]) {
  921. return @"Onbrd_PrintBooklet_Paid";
  922. }
  923. // Paid_Others SubTbr_Others
  924. else if ([eveN isEqual:@"Reading_Flatten_BuyNow"]) {
  925. return @"Reading_Flatten_Paid";
  926. }
  927. // Paid_Others MenuBar_Others
  928. else if ([eveN isEqual:@"MenuBar_PrintPoster_BuyNow"]) {
  929. return @"MenuBar_PrintPoster_Paid";
  930. } else if ([eveN isEqual:@"MenuBar_PrintMultiple_BuyNow"]) {
  931. return @"MenuBar_PrintMultiple_Paid";
  932. } else if ([eveN isEqual:@"MenuBar_PrintBooklet_BuyNow"]) {
  933. return @"MenuBar_PrintBooklet_Paid";
  934. }
  935. return nil;
  936. }
  937. - (NSDictionary *)_getPaidEventParamsWith:(NSString *)eventN {
  938. NSString *eveN = eventN;
  939. if (eveN == nil || eveN.length == 0) {
  940. return nil;
  941. }
  942. // Paid_Tools SubTbr_Tools
  943. if ([eveN isEqual:@"Reading_WebsiteLink_Paid"] ||
  944. [eveN isEqual:@"Reading_EmailLink_Paid"] ||
  945. [eveN isEqual:@"Reading_DynamicStamp_Paid"] ||
  946. [eveN isEqual:@"Reading_CustomStamp_Paid"] ||
  947. [eveN isEqual:@"Reading_Signature_Paid"] ||
  948. [eveN isEqual:@"Reading_Table_Paid"]) {
  949. return @{@"Paid_Tools" : @"SubTbr_Tools"};
  950. }
  951. // Paid_PageEdit SubTbr_PageEdit
  952. else if ([eveN isEqual:@"Reading_InsertBlankPage_Paid"] ||
  953. [eveN isEqual:@"Reading_InsertPDF_Paid"] ||
  954. [eveN isEqual:@"Reading_InsertSacnner_Paid"] ||
  955. [eveN isEqual:@"Reading_InsertImage_Paid"] ||
  956. [eveN isEqual:@"Reading_InsertClipboard_Paid"] ||
  957. [eveN isEqual:@"Reading_Replace_Paid"] ||
  958. [eveN isEqual:@"Reading_Extract_Paid"] ||
  959. [eveN isEqual:@"Reading_Split_Paid"] ||
  960. [eveN isEqual:@"Reading_Rotate_Paid"] ||
  961. [eveN isEqual:@"Reading_Reverse_Paid"] ||
  962. [eveN isEqual:@"Reading_Copy_Paid"] ||
  963. [eveN isEqual:@"Reading_Delete_Paid"] ||
  964. [eveN isEqual:@"Reading_Merge_Paid"]) {
  965. return @{@"Paid_PageEdit" : @"SubTbr_PageEdit"};
  966. }
  967. // Paid_PageEdit Home_PageEdit
  968. else if ([eveN isEqual:@"Onbrd_EditPage_Paid"] ||
  969. [eveN isEqual:@"Onbrd_Merge_Paid"]) {
  970. return @{@"Paid_PageEdit" : @"Home_PageEdit"};
  971. }
  972. // Paid_Editor SubTbr_Editor
  973. else if ([eveN isEqual:@"Reading_RemoveSecurity_Paid"] ||
  974. [eveN isEqual:@"Reading_Compare_Paid"] ||
  975. [eveN isEqual:@"Reading_AddWatermark_Paid"] ||
  976. [eveN isEqual:@"Reading_RemoveWatermark_Paid"] ||
  977. [eveN isEqual:@"Reading_AddBackground_Paid"] ||
  978. [eveN isEqual:@"Reading_RemoveBackground_Paid"] ||
  979. [eveN isEqual:@"Reading_AddHeaderFooter_Paid"] ||
  980. [eveN isEqual:@"Reading_RemoveHeaderFooter_Paid"] ||
  981. [eveN isEqual:@"Reading_AddBates_Paid"] ||
  982. [eveN isEqual:@"Reading_RemoveBates_Paid"] ||
  983. [eveN isEqual:@"Reading_Measure_Paid"]) {
  984. return @{@"" : @""};
  985. }
  986. // Paid_Editor Home_Editor
  987. else if ([eveN isEqual:@"Onbrd_Compare_Paid"] ||
  988. [eveN isEqual:@"Onbrd_Background_Paid"] ||
  989. [eveN isEqual:@"Onbrd_Watermard_Paid"] ||
  990. [eveN isEqual:@"Onbrd_HeaderFooter_Paid"] ||
  991. [eveN isEqual:@"Onbrd_Bates_Paid"] ||
  992. [eveN isEqual:@"Onbrd_Security_Paid"]) {
  993. return @{@"Paid_Editor" : @"Home_Editor"};
  994. }
  995. // Paid_Converter SubTbr_Converter
  996. else if ([eveN isEqual:@"Reading_PDFtoWord_Paid"] ||
  997. [eveN isEqual:@"Reading_PDFtoExcel_Paid"] ||
  998. [eveN isEqual:@"Reading_PDFtoPPT_Paid"] ||
  999. [eveN isEqual:@"Reading_PDFtoRTF_Paid"] ||
  1000. [eveN isEqual:@"Reading_PDFtoCSV_Paid"] ||
  1001. [eveN isEqual:@"Reading_PDFtoText_Paid"] ||
  1002. [eveN isEqual:@"Reading_PDFtoImage_Paid"] ||
  1003. [eveN isEqual:@"Reading_ExtractImage_Paid"]) {
  1004. return @{@"Paid_Converter" : @"SubTbr_Converter"};
  1005. }
  1006. // Paid_Converter Home_Converter
  1007. else if ([eveN isEqual:@"Onbrd_ConvertPDF_Paid"] ||
  1008. [eveN isEqual:@"Onbrd_PDFtoWord_Paid"] ||
  1009. [eveN isEqual:@"Onbrd_PDFtoExcel_Paid"] ||
  1010. [eveN isEqual:@"Onbrd_PDFtoPPT_Paid"] ||
  1011. [eveN isEqual:@"Onbrd_ImagetoPDF_Paid"]) {
  1012. return @{@"Paid_Converter" : @"Home_Converter"};
  1013. }
  1014. // Paid_Form SubTbr_Forms
  1015. else if ([eveN isEqual:@"Reading_TextField_Paid"] ||
  1016. [eveN isEqual:@"Reading_CheckBox_Paid"] ||
  1017. [eveN isEqual:@"Reading_RadioButton_Paid"] ||
  1018. [eveN isEqual:@"Reading_ListBox_Paid"] ||
  1019. [eveN isEqual:@"Reading_ComboBox_Paid"] ||
  1020. [eveN isEqual:@"Reading_Button_Paid"]) {
  1021. return @{@"Paid_Form" : @"SubTbr_Forms"};
  1022. }
  1023. // Paid_Sign SunTbr_Signature
  1024. else if ([eveN isEqual:@"Reading_FillSign_Signature_Paid"] ||
  1025. [eveN isEqual:@"Reading_DigitalSign_Paid"] ||
  1026. [eveN isEqual:@"Reading_ElectronicSign_Paid"]) {
  1027. return @{@"Paid_Sign" : @"SunTbr_Signature"};
  1028. }
  1029. // Paid_EditPDF Tbr_Edit PDF
  1030. else if ([eveN isEqual:@"Reading_EditPDF_Paid"] ||
  1031. [eveN isEqual:@"Reading_ReplaceText_Paid"]) {
  1032. return @{@"Paid_EditPDF" : @"Tbr_Edit PDF"};
  1033. }
  1034. // Paid_Redact Tbr_Redact
  1035. else if ([eveN isEqual:@"Reading_Redact_Paid"]) {
  1036. return @{@"Paid_Redact" : @"Tbr_Redact"};
  1037. }
  1038. // Paid_OCR SubTbr_OCR
  1039. else if ([eveN isEqual:@"Reading_OCR_Paid"] ||
  1040. [eveN isEqual:@"Reading_Convert_OCR_Paid"] ||
  1041. [eveN isEqual:@"Onbrd_OCR_Paid"]) {
  1042. return @{@"Paid_OCR" : @"SubTbr_OCR"};
  1043. }
  1044. // Paid_PageDisplay SubTbr_Page Display
  1045. else if ([eveN isEqual:@"Reading_SplitView_Paid"] ||
  1046. [eveN isEqual:@"Reading_Rotate_Paid"] ||
  1047. [eveN isEqual:@"Reading_Theme_Paid"] ||
  1048. [eveN isEqual:@"Reading_MultiTab_Paid"]) {
  1049. return @{@"Paid_PageDisplay" : @"SubTbr_Page Display"};
  1050. }
  1051. // Home_Others
  1052. else if ([eveN isEqual:@"Onbrd_PrintPoster_Paid"] ||
  1053. [eveN isEqual:@"Onbrd_PrintMultiple_Paid"] ||
  1054. [eveN isEqual:@"Onbrd_PrintBooklet_Paid"]) {
  1055. return @{@"Paid_Others" : @"Home_Others"};
  1056. }
  1057. // Paid_Others SubTbr_Others
  1058. else if ([eveN isEqual:@"Reading_Flatten_Paid"]) {
  1059. return @{@"Paid_Others" : @"SubTbr_Others"};
  1060. }
  1061. // Paid_Others MenuBar_Others
  1062. else if ([eveN isEqual:@"MenuBar_PrintPoster_Paid"] ||
  1063. [eveN isEqual:@"MenuBar_PrintMultiple_Paid"] ||
  1064. [eveN isEqual:@"MenuBar_PrintBooklet_Paid"]) {
  1065. return @{@"Paid_Others" : @"MenuBar_Others"};
  1066. }
  1067. return nil;
  1068. }
  1069. @end