KMPurchaseCompareDMGWindowController.m 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253
  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:@"com.brother.pdfreaderpro.mac.product_3"]];
  403. discountText = [NSString stringWithFormat:@"%@%@", abbreviation, [[KMDMGProductsManager shareInstance] getActivityPrice:@"com.brother.pdfreaderpro.mac.product_3"]];
  404. } else {
  405. originalText = [NSString stringWithFormat:@"%@%@", abbreviation, [[KMDMGProductsManager shareInstance] getPrice:@"com.brother.pdfreaderpro.mac.product_1"]];
  406. discountText = [NSString stringWithFormat:@"%@%@", abbreviation, [[KMDMGProductsManager shareInstance] getActivityPrice:@"com.brother.pdfreaderpro.mac.product_1"]];
  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)updatePriceLabel {
  450. // NSString *originalText = @"";
  451. // NSString *discountText = @"";
  452. // if ([@"USD" isEqualToString:NSLocalizedString(@"USD", nil)]) {
  453. //#if VERSION_DMG
  454. // if ([self.buySwitch state]) {
  455. // originalText = [NSString stringWithFormat:@"$%@", [[KMDMGProductsManager shareInstance] getPrice:@"com.brother.pdfreaderpro.mac.product_3"]];
  456. // discountText = [NSString stringWithFormat:@"$%@", [[KMDMGProductsManager shareInstance] getActivityPrice:@"com.brother.pdfreaderpro.mac.product_3"]];
  457. // } else {
  458. // originalText = [NSString stringWithFormat:@"$%@", [[KMDMGProductsManager shareInstance] getPrice:@"com.brother.pdfreaderpro.mac.product_1"]];
  459. // discountText = [NSString stringWithFormat:@"$%@", [[KMDMGProductsManager shareInstance] getActivityPrice:@"com.brother.pdfreaderpro.mac.product_1"]];
  460. // }
  461. //#endif
  462. // } else {
  463. //#if VERSION_DMG
  464. // if ([self.buySwitch state]) {
  465. // originalText = [NSString stringWithFormat:@"¥%@", [[KMDMGProductsManager shareInstance] getPriceCNY:@"com.brother.pdfreaderpro.mac.product_3"]];
  466. // discountText = [NSString stringWithFormat:@"¥%@", [[KMDMGProductsManager shareInstance] getActivityPriceCNY:@"com.brother.pdfreaderpro.mac.product_3"]];
  467. // } else {
  468. // originalText = [NSString stringWithFormat:@"¥%@", [[KMDMGProductsManager shareInstance] getPriceCNY:@"com.brother.pdfreaderpro.mac.product_1"]];
  469. // discountText = [NSString stringWithFormat:@"¥%@", [[KMDMGProductsManager shareInstance] getActivityPriceCNY:@"com.brother.pdfreaderpro.mac.product_1"]];
  470. // }
  471. //#endif
  472. // }
  473. // NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:originalText];
  474. // [attributedText addAttribute:NSStrikethroughStyleAttributeName
  475. // value:@(NSUnderlineStyleSingle)
  476. // range:NSMakeRange(0, originalText.length)];
  477. // self.originalPriceLabel.attributedStringValue = attributedText;
  478. // self.discountPriceLabel.stringValue = discountText;
  479. //
  480. // if ([originalText isEqualToString:discountText]) {
  481. // [self.originalPriceLabel setHidden:YES];
  482. // } else {
  483. // [self.originalPriceLabel setHidden:NO];
  484. // }
  485. //}
  486. - (void)refreshParmanentVerInfo {
  487. if ([self.buySwitch state] == NSControlStateValueOn) {
  488. self.parmanentVerInfoLbl1.stringValue = NSLocalizedString(@"View PDFs", nil);
  489. self.parmanentVerInfoLbl2.stringValue = NSLocalizedString(@"Annotate PDFs (advanced)", nil);
  490. self.parmanentVerInfoLbl3.stringValue = NSLocalizedString(@"Unlimited file conversion", nil);
  491. self.parmanentVerInfoLbl4.stringValue = NSLocalizedString(@"Edit PDF text and images", nil);
  492. self.parmanentVerInfoLbl5.stringValue = NSLocalizedString(@"Digital signature", nil);
  493. self.parmanentVerInfoLbl6.stringValue = NSLocalizedString(@"Organize pages", nil);
  494. self.parmanentVerInfoLbl7.stringValue = NSLocalizedString(@"Batch process", nil);
  495. self.parmanentVerInfoLbl8.stringValue = NSLocalizedString(@"OCR PDFs", nil);
  496. self.parmanentVerInfoLbl9.stringValue = NSLocalizedString(@"Measuring Tools", nil);
  497. self.parmanentVerInfoLbl10.stringValue = NSLocalizedString(@"Ad-free", nil);
  498. self.parmanentVerInfoImage1.image = [NSImage imageNamed:@"function_vip"];
  499. } else {
  500. self.parmanentVerInfoLbl1.stringValue = NSLocalizedString(@"Unlimited file conversion", nil);
  501. self.parmanentVerInfoLbl2.stringValue = NSLocalizedString(@"Annotate PDFs (advanced)", nil);
  502. self.parmanentVerInfoLbl3.stringValue = NSLocalizedString(@"View PDFs", nil);
  503. self.parmanentVerInfoLbl4.stringValue = NSLocalizedString(@"Edit PDF text and images", nil);
  504. self.parmanentVerInfoLbl5.stringValue = NSLocalizedString(@"Digital signature", nil);
  505. self.parmanentVerInfoLbl6.stringValue = NSLocalizedString(@"Organize pages", nil);
  506. self.parmanentVerInfoLbl7.stringValue = NSLocalizedString(@"Batch process", nil);
  507. self.parmanentVerInfoLbl8.stringValue = NSLocalizedString(@"OCR PDFs", nil);
  508. self.parmanentVerInfoLbl9.stringValue = NSLocalizedString(@"Measuring Tools", nil);
  509. self.parmanentVerInfoLbl10.stringValue = NSLocalizedString(@"Ad-free", nil);
  510. self.parmanentVerInfoImage1.image = [NSImage imageNamed:@"compare_nosupport"];
  511. }
  512. }
  513. #pragma mark - Window Method
  514. - (void)showWindow:(id)sender {
  515. [super showWindow:nil];
  516. [self.window center];
  517. [self.window orderFront:nil];
  518. [self.buySwitch setState:NSControlStateValueOn];
  519. [self updatePriceLabel];
  520. [self updatePurchaseInformation];
  521. }
  522. - (BOOL)windowShouldClose:(id)sender {
  523. [self endModal:sender];
  524. return YES;
  525. }
  526. - (void)close {
  527. [super close];
  528. // 清空埋点的数据
  529. self.kEventName = nil;
  530. self.kEventTag = 0;
  531. [self endModal:nil];
  532. }
  533. - (void)updateTitle:(NSString *)title andColor:(NSColor *)titleColor {
  534. self.titleLabel.stringValue = title ?:@"";
  535. self.titleLabel.textColor = titleColor ?:[NSColor labelColor];
  536. }
  537. #pragma mark - IBAction
  538. - (IBAction)startModal:(id)sender {
  539. [NSApp stopModal];
  540. NSInteger modalCode;
  541. self.modalSession = [NSApp beginModalSessionForWindow:self.window];
  542. do {
  543. modalCode = [NSApp runModalSession:self.modalSession];
  544. } while (modalCode == NSRunContinuesResponse);
  545. }
  546. - (IBAction)endModal:(id)sender {
  547. if (self.modalSession) {
  548. [NSApp stopModal];
  549. [NSApp endModalSession:self.modalSession];
  550. [self.window orderOut:self];
  551. self.modalSession = nil;
  552. }
  553. }
  554. - (void)showWindowRestore:(id)sender {
  555. [self showWindow:sender];
  556. }
  557. - (IBAction)enterLicenseAction:(id)sender {
  558. [self close];
  559. KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
  560. vc.callback = ^{
  561. // [[KMProductCompareWC shared] setOrientation:NO];
  562. // [[KMProductCompareWC shared] showWindow:nil];
  563. [[KMMemberInfo shared] advancedFunctionUsage];
  564. };
  565. [vc showWindow:nil];
  566. }
  567. - (IBAction)buttonItemClicked_Buy:(id)sender {
  568. #if VERSION_DMG
  569. [self trackEvent_buyNow];
  570. NSString *paidEventName = [self _buyNowEventToPaidEventName];
  571. NSDictionary *paidEventParams = [self _getPaidEventParamsWith:paidEventName];
  572. NSString *thePaidEventName = paidEventParams.allKeys.firstObject;
  573. NSDictionary *thePaidEventParams = nil;
  574. if (paidEventName != nil && paidEventParams.allValues.firstObject != nil) {
  575. thePaidEventParams = @{paidEventParams.allValues.firstObject : paidEventName};
  576. }
  577. [self close];
  578. NSString *productID = @"";
  579. if ([self.buySwitch state]) {
  580. productID = @"com.brother.pdfreaderpro.mac.product_3";
  581. } else {
  582. productID = @"com.brother.pdfreaderpro.mac.product_1";
  583. }
  584. // KMPurchaseEmbeddedWindowController *embeddedWC = [[KMPurchaseEmbeddedWindowController alloc] initWithWindowNibName:@"KMPurchaseEmbeddedWindowController"];
  585. KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:productID];
  586. // [embeddedWC beginSheetModalFor:NSApp.mainWindow completionHandler:^(NSInteger result) {
  587. //
  588. // }];
  589. embeddedWC.kEventName = thePaidEventName;
  590. embeddedWC.kEventParams = thePaidEventParams;
  591. [embeddedWC showWindow:nil];
  592. [[embeddedWC window] center];
  593. #endif
  594. }
  595. - (IBAction)buttonItemClicked_CloseWindow:(id)sender {
  596. [self close];
  597. }
  598. - (void)buttonItemClicked_License:(id)sender {
  599. // if (ActivityStatusNone == [VerificationManager manager].status) {
  600. // [self close];
  601. //
  602. // KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeTrial];
  603. // [vc showWindow:nil];
  604. // } else if (ActivityStatusTrialExpire == [VerificationManager manager].status) {
  605. if ([VerificationManager manager].secondTrialEnabled) {
  606. [[FMTrackEventManager defaultManager] trackEventWithEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_SecondTrial"}];
  607. [[VerificationManager manager] trialForDays:7
  608. email:[VerificationManager manager].email
  609. name:[VerificationManager manager].accountName
  610. complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
  611. if (error ||
  612. status != ActivityStatusTrial) {
  613. NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
  614. defaultButton:NSLocalizedString(@"Try Again", nil)
  615. alternateButton:nil
  616. otherButton:nil
  617. informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
  618. [alert runModal];
  619. } else {
  620. KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialSuccess];
  621. [vc showWindow:nil];
  622. }
  623. }];
  624. [self close];
  625. } else {
  626. [self close];
  627. KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeTrial];
  628. vc.callback = ^{
  629. // [[KMProductCompareWC shared] setOrientation:NO];
  630. // [[KMProductCompareWC shared] showWindow:nil];
  631. [[KMMemberInfo shared] advancedFunctionUsage];
  632. };
  633. [vc showWindow:nil];
  634. }
  635. }
  636. - (IBAction)aiPurchaseButtonClick:(NSButton *)sender {
  637. // NSURL *url = [NSURL URLWithString:Swift_oc_Tool.AIProduct_Link_OC];
  638. // [[NSWorkspace sharedWorkspace] openURL:url];
  639. //
  640. // [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_BuyAITools"}];
  641. [self trackEvent_buyNow];
  642. NSString *paidEventName = [self _buyNowEventToPaidEventName];
  643. NSDictionary *paidEventParams = [self _getPaidEventParamsWith:paidEventName];
  644. NSString *thePaidEventName = paidEventParams.allKeys.firstObject;
  645. NSDictionary *thePaidEventParams = nil;
  646. if (paidEventName != nil && paidEventParams.allValues.firstObject != nil) {
  647. thePaidEventParams = @{paidEventParams.allValues.firstObject : paidEventName};
  648. }
  649. [self close];
  650. #if VERSION_DMG
  651. KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.ai.product_1"];
  652. embeddedWC.kEventName = thePaidEventName;
  653. embeddedWC.kEventParams = thePaidEventParams;
  654. [embeddedWC showWindow:nil];
  655. [[embeddedWC window] center];
  656. #endif
  657. }
  658. - (IBAction)buySwitchAction:(NSSwitch *)sender {
  659. [self refreshParmanentVerInfo];
  660. [self updatePriceLabel];
  661. }
  662. #pragma mark - Noti
  663. - (void)themeChanged:(NSNotification *)notification {
  664. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  665. [self updateViewColor];
  666. });
  667. }
  668. - (void)recommondInfoUpdateNoti:(NSNotification *)noti {
  669. dispatch_async(dispatch_get_main_queue(), ^{
  670. [self updatePriceLabel];
  671. });
  672. }
  673. @end
  674. @implementation KMPurchaseCompareDMGWindowController (KMAnalytic)
  675. - (void)trackEvent_buyNow {
  676. NSDictionary *params = [self _getBuyNowEventParams];
  677. NSString *theEventName = params.allKeys.firstObject;
  678. NSDictionary *theParams = nil;
  679. if (self.kEventName != nil && params.allValues.firstObject != nil) {
  680. theParams = @{params.allValues.firstObject : self.kEventName};
  681. }
  682. [self trackEvent_dmgWithEventName:theEventName params:theParams platform:KMAnalyticsPlatformAppCenter];
  683. }
  684. - (NSDictionary *)_getBuyNowEventParams {
  685. NSString *eveN = self.kEventName;
  686. if (eveN == nil || eveN.length == 0) {
  687. return nil;
  688. }
  689. if ([eveN isEqual:@"Reading_WebsiteLink_BuyNow"] ||
  690. [eveN isEqual:@"Reading_EmailLink_BuyNow"] ||
  691. [eveN isEqual:@"Reading_DynamicStamp_BuyNow"] ||
  692. [eveN isEqual:@"Reading_CustomStamp_BuyNow"] ||
  693. [eveN isEqual:@"Reading_Signature_BuyNow"] ||
  694. [eveN isEqual:@"Reading_Table_BuyNow"]) {
  695. return @{@"Purchase_Tools" : @"SubTbr_Tools"};
  696. } else if ([eveN isEqual:@"Reading_InsertBlankPage_BuyNow"] ||
  697. [eveN isEqual:@"Reading_InsertPDF_BuyNow"] ||
  698. [eveN isEqual:@"Reading_InsertSacnner_BuyNow"] ||
  699. [eveN isEqual:@"Reading_InsertImage_BuyNow"] ||
  700. [eveN isEqual:@"Reading_InsertClipboard_BuyNow"] ||
  701. [eveN isEqual:@"Reading_Replace_BuyNow"] ||
  702. [eveN isEqual:@"Reading_Extract_BuyNow"] ||
  703. [eveN isEqual:@"Reading_Split_BuyNow"] ||
  704. ([eveN isEqual:@"Reading_Rotate_BuyNow"] && self.kEventTag == 0) ||
  705. [eveN isEqual:@"Reading_Reverse_BuyNow"] ||
  706. [eveN isEqual:@"Reading_Copy_BuyNow"] ||
  707. [eveN isEqual:@"Reading_Delete_BuyNow"] ||
  708. [eveN isEqual:@"Reading_Merge_BuyNow"]) {
  709. return @{@"Purchase_PageEdit" : @"SubTbr_PageEdit"};
  710. } else if ([eveN isEqual:@"Onbrd_EditPage_BuyNow"] ||
  711. [eveN isEqual:@"Onbrd_Merge_BuyNow"]) {
  712. return @{@"Purchase_PageEdit" : @"Home_PageEdit"};
  713. } else if ([eveN isEqual:@"Reading_RemoveSecurity_BuyNow"] ||
  714. [eveN isEqual:@"Reading_Compare_BuyNow"] ||
  715. [eveN isEqual:@"Reading_AddWatermark_BuyNow"] ||
  716. [eveN isEqual:@"Reading_RemoveWatermark_BuyNow"] ||
  717. [eveN isEqual:@"Reading_AddBackground_BuyNow"] ||
  718. [eveN isEqual:@"Reading_RemoveBackground_BuyNow"] ||
  719. [eveN isEqual:@"Reading_AddHeaderFooter_BuyNow"] ||
  720. [eveN isEqual:@"Reading_RemoveHeaderFooter_BuyNow"] ||
  721. [eveN isEqual:@"Reading_AddBates_BuyNow"] ||
  722. [eveN isEqual:@"Reading_RemoveBates_BuyNow"] ||
  723. [eveN isEqual:@"Reading_Measure_BuyNow"]) {
  724. return @{@"Purchase_Editor" : @"SubTbr_Editor"};
  725. } else if ([eveN isEqual:@"Onbrd_Compare_BuyNow"] ||
  726. [eveN isEqual:@"Onbrd_Background_BuyNow"] ||
  727. [eveN isEqual:@"Onbrd_Watermard_BuyNow"] ||
  728. [eveN isEqual:@"Onbrd_HeaderFooter_BuyNow"] ||
  729. [eveN isEqual:@"Onbrd_Bates_BuyNow"] ||
  730. [eveN isEqual:@"Onbrd_Security_BuyNow"]) {
  731. return @{@"Purchase_Editor" : @"Home_Editor"};
  732. } else if ([eveN isEqual:@"Reading_PDFtoWord_BuyNow"] ||
  733. [eveN isEqual:@"Reading_PDFtoExcel_BuyNow"] ||
  734. [eveN isEqual:@"Reading_PDFtoPPT_BuyNow"] ||
  735. [eveN isEqual:@"Reading_PDFtoRTF_BuyNow"] ||
  736. [eveN isEqual:@"Reading_PDFtoCSV_BuyNow"] ||
  737. [eveN isEqual:@"Reading_PDFtoText_BuyNow"] ||
  738. [eveN isEqual:@"Reading_PDFtoImage_BuyNow"] ||
  739. [eveN isEqual:@"Reading_ExtractImage_BuyNow"]) {
  740. return @{@"Purchase_Converter" : @"SubTbr_Converter"};
  741. } else if ([eveN isEqual:@"Onbrd_ConvertPDF_BuyNow"] ||
  742. [eveN isEqual:@"Onbrd_PDFtoWord_BuyNow"] ||
  743. [eveN isEqual:@"Onbrd_PDFtoExcel_BuyNow"] ||
  744. [eveN isEqual:@"Onbrd_PDFtoPPT_BuyNow"] ||
  745. [eveN isEqual:@"Onbrd_ImagetoPDF_BuyNow"]) {
  746. return @{@"Purchase_Converter" : @"Home_Converter"};
  747. } else if ([eveN isEqual:@"Reading_TextField_BuyNow"] ||
  748. [eveN isEqual:@"Reading_CheckBox_BuyNow"] ||
  749. [eveN isEqual:@"Reading_RadioButton_BuyNow"] ||
  750. [eveN isEqual:@"Reading_ListBox_BuyNow"] ||
  751. [eveN isEqual:@"Reading_ComboBox_BuyNow"] ||
  752. [eveN isEqual:@"Reading_Button_BuyNow"]) {
  753. return @{@"Purchase_Form" : @"SubTbr_Forms"};
  754. } else if ([eveN isEqual:@"Reading_FillSign_Signature_BuyNow"] ||
  755. [eveN isEqual:@"Reading_DigitalSign_BuyNow"] ||
  756. [eveN isEqual:@"Reading_ElectronicSign_BuyNow"]) {
  757. return @{@"Purchase_Sign" : @"SunTbr_Signature"};
  758. } else if ([eveN isEqual:@"Reading_EditPDF_BuyNow"] ||
  759. [eveN isEqual:@"Reading_ReplaceText_BuyNow"]) {
  760. return @{@"Purchase_EditPDF" : @"Tbr_Edit PDF"};
  761. } else if ([eveN isEqual:@"Reading_Redact_BuyNow"]) {
  762. return @{@"Purchase_Redact" : @"Tbr_Redact"};
  763. } else if ([eveN isEqual:@"Reading_OCR_BuyNow"] ||
  764. [eveN isEqual:@"Reading_Convert_OCR_BuyNow"] ||
  765. [eveN isEqual:@"Onbrd_OCR_BuyNow"]) {
  766. return @{@"Purchase_OCR" : @"SubTbr_OCR"};
  767. } else if ([eveN isEqual:@"Reading_SplitView_BuyNow"] ||
  768. [eveN isEqual:@"Reading_Rotate_BuyNow"] ||
  769. [eveN isEqual:@"Reading_Theme_BuyNow"] ||
  770. [eveN isEqual:@"Reading_MultiTab_BuyNow"]) {
  771. return @{@"Purchase_PageDisplay" : @"SubTbr_PageDisplay"};
  772. } else if ([eveN isEqual:@"Onbrd_PrintPoster_BuyNow"] ||
  773. [eveN isEqual:@"Onbrd_PrintMultiple_BuyNow"] ||
  774. [eveN isEqual:@"Onbrd_PrintBooklet_BuyNow"]) {
  775. return @{@"Purchase_Others" : @"Home_Others"};
  776. } else if ([eveN isEqual:@"Reading_Flatten_BuyNow"]) {
  777. return @{@"Purchase_Others" : @"SubTbr_Others"};
  778. } else if ([eveN isEqual:@"MenuBar_PrintPoster_BuyNow"] ||
  779. [eveN isEqual:@"MenuBar_PrintMultiple_BuyNow"] ||
  780. [eveN isEqual:@"MenuBar_PrintBooklet_BuyNow"]) {
  781. return @{@"Purchase_Others" : @"MenuBar_Others"};
  782. }
  783. return nil;
  784. }
  785. - (NSString *)_buyNowEventToPaidEventName {
  786. NSString *eveN = self.kEventName;
  787. if (eveN == nil || eveN.length == 0) {
  788. return nil;
  789. }
  790. // Paid_Tools
  791. if ([eveN isEqual:@"Reading_WebsiteLink_BuyNow"]) {
  792. return @"Reading_WebsiteLink_Paid";
  793. } else if ([eveN isEqual:@"Reading_EmailLink_BuyNow"]) {
  794. return @"Reading_EmailLink_Paid";
  795. } else if ([eveN isEqual:@"Reading_DynamicStamp_BuyNow"]) {
  796. return @"Reading_DynamicStamp_Paid";
  797. } else if ([eveN isEqual:@"Reading_CustomStamp_BuyNow"]) {
  798. return @"Reading_CustomStamp_Paid";
  799. } else if ([eveN isEqual:@"Reading_Signature_BuyNow"]) {
  800. return @"Reading_Signature_Paid";
  801. } else if ([eveN isEqual:@"Reading_Table_BuyNow"]) {
  802. return @"Reading_Table_Paid";
  803. }
  804. // Paid_PageEdit SubTbr_PageEdit
  805. else if ([eveN isEqual:@"Reading_InsertBlankPage_BuyNow"]) {
  806. return @"Reading_InsertBlankPage_Paid";
  807. } else if ([eveN isEqual:@"Reading_InsertPDF_BuyNow"]) {
  808. return @"Reading_InsertPDF_Paid";
  809. } else if ([eveN isEqual:@"Reading_InsertSacnner_BuyNow"]) {
  810. return @"Reading_InsertSacnner_Paid";
  811. } else if ([eveN isEqual:@"Reading_InsertImage_BuyNow"]) {
  812. return @"Reading_InsertImage_Paid";
  813. } else if ([eveN isEqual:@"Reading_InsertClipboard_BuyNow"]) {
  814. return @"Reading_InsertClipboard_Paid";
  815. } else if ([eveN isEqual:@"Reading_Replace_BuyNow"]) {
  816. return @"Reading_Replace_Paid";
  817. } else if ([eveN isEqual:@"Reading_Extract_BuyNow"]) {
  818. return @"Reading_Extract_Paid";
  819. } else if ([eveN isEqual:@"Reading_Split_BuyNow"]) {
  820. return @"Reading_Split_Paid";
  821. } else if ([eveN isEqual:@"Reading_Rotate_BuyNow"]) {
  822. return @"Reading_Rotate_Paid";
  823. } else if ([eveN isEqual:@"Reading_Reverse_BuyNow"]) {
  824. return @"Reading_Reverse_Paid";
  825. } else if ([eveN isEqual:@"Reading_Copy_BuyNow"]) {
  826. return @"Reading_Copy_Paid";
  827. } else if ([eveN isEqual:@"Reading_Delete_BuyNow"]) {
  828. return @"Reading_Delete_Paid";
  829. } else if ([eveN isEqual:@"Reading_Merge_BuyNow"]) {
  830. return @"Reading_Merge_Paid";
  831. }
  832. // Paid_PageEdit Home_PageEdit
  833. else if ([eveN isEqual:@"Onbrd_EditPage_BuyNow"]) {
  834. return @"Onbrd_EditPage_Paid";
  835. } else if ([eveN isEqual:@"Onbrd_Merge_BuyNow"]) {
  836. return @"Onbrd_Merge_Paid";
  837. }
  838. // Paid_Editor SubTbr_Editor
  839. else if ([eveN isEqual:@"Reading_RemoveSecurity_BuyNow"]) {
  840. return @"Reading_RemoveSecurity_Paid";
  841. } else if ([eveN isEqual:@"Reading_Compare_BuyNow"]) {
  842. return @"Reading_Compare_Paid";
  843. } else if ([eveN isEqual:@"Reading_AddWatermark_BuyNow"]) {
  844. return @"Reading_AddWatermark_Paid";
  845. } else if ([eveN isEqual:@"Reading_RemoveWatermark_BuyNow"]) {
  846. return @"Reading_RemoveWatermark_Paid";
  847. } else if ([eveN isEqual:@"Reading_AddBackground_BuyNow"]) {
  848. return @"Reading_AddBackground_Paid";
  849. } else if ([eveN isEqual:@"Reading_RemoveBackground_BuyNow"]) {
  850. return @"Reading_RemoveBackground_Paid";
  851. } else if ([eveN isEqual:@"Reading_AddHeaderFooter_BuyNow"]) {
  852. return @"Reading_AddHeaderFooter_Paid";
  853. } else if ([eveN isEqual:@"Reading_RemoveHeaderFooter_BuyNow"]) {
  854. return @"Reading_RemoveHeaderFooter_Paid";
  855. } else if ([eveN isEqual:@"Reading_AddBates_BuyNow"]) {
  856. return @"Reading_AddBates_Paid";
  857. } else if ([eveN isEqual:@"Reading_RemoveBates_BuyNow"]) {
  858. return @"Reading_RemoveBates_Paid";
  859. } else if ([eveN isEqual:@"Reading_Measure_BuyNow"]) {
  860. return @"Reading_Measure_Paid";
  861. }
  862. // Paid_Editor Home_Editor
  863. else if ([eveN isEqual:@"Onbrd_Compare_BuyNow"]) {
  864. return @"Onbrd_Compare_Paid";
  865. } else if ([eveN isEqual:@"Onbrd_Background_BuyNow"]) {
  866. return @"Onbrd_Background_Paid";
  867. } else if ([eveN isEqual:@"Onbrd_Watermard_BuyNow"]) {
  868. return @"Onbrd_Watermard_Paid";
  869. } else if ([eveN isEqual:@"Onbrd_HeaderFooter_BuyNow"]) {
  870. return @"Onbrd_HeaderFooter_Paid";
  871. } else if ([eveN isEqual:@"Onbrd_Bates_BuyNow"]) {
  872. return @"Onbrd_Bates_Paid";
  873. } else if ([eveN isEqual:@"Onbrd_Security_BuyNow"]) {
  874. return @"Onbrd_Security_Paid";
  875. }
  876. // Paid_Converter SubTbr_Converte
  877. else if ([eveN isEqual:@"Reading_PDFtoWord_BuyNow"]) {
  878. return @"Reading_PDFtoWord_Paid";
  879. } else if ([eveN isEqual:@"Reading_PDFtoExcel_BuyNow"]) {
  880. return @"Reading_PDFtoExcel_Paid";
  881. } else if ([eveN isEqual:@"Reading_PDFtoPPT_BuyNow"]) {
  882. return @"Reading_PDFtoPPT_Paid";
  883. } else if ([eveN isEqual:@"Reading_PDFtoRTF_BuyNow"]) {
  884. return @"Reading_PDFtoRTF_Paid";
  885. } else if ([eveN isEqual:@"Reading_PDFtoCSV_BuyNow"]) {
  886. return @"Reading_PDFtoCSV_Paid";
  887. } else if ([eveN isEqual:@"Reading_PDFtoText_BuyNow"]) {
  888. return @"Reading_PDFtoText_Paid";
  889. } else if ([eveN isEqual:@"Reading_PDFtoImage_BuyNow"]) {
  890. return @"Reading_PDFtoImage_Paid";
  891. } else if ([eveN isEqual:@"Reading_ExtractImage_BuyNow"]) {
  892. return @"Reading_ExtractImage_Paid";
  893. }
  894. // Paid_Converter Home_Converter
  895. else if ([eveN isEqual:@"Onbrd_ConvertPDF_BuyNow"]) {
  896. return @"Onbrd_ConvertPDF_Paid";
  897. } else if ([eveN isEqual:@"Onbrd_PDFtoWord_BuyNow"]) {
  898. return @"Onbrd_PDFtoWord_Paid";
  899. } else if ([eveN isEqual:@"Onbrd_PDFtoExcel_BuyNow"]) {
  900. return @"Onbrd_PDFtoExcel_Paid";
  901. } else if ([eveN isEqual:@"Onbrd_PDFtoPPT_BuyNow"]) {
  902. return @"Onbrd_PDFtoPPT_Paid";
  903. } else if ([eveN isEqual:@"Onbrd_ImagetoPDF_BuyNow"]) {
  904. return @"Onbrd_ImagetoPDF_Paid";
  905. }
  906. // Paid_Form SubTbr_Forms
  907. else if ([eveN isEqual:@"Reading_TextField_BuyNow"]) {
  908. return @"Reading_TextField_Paid";
  909. } else if ([eveN isEqual:@"Reading_CheckBox_BuyNow"]) {
  910. return @"Reading_CheckBox_Paid";
  911. } else if ([eveN isEqual:@"Reading_RadioButton_BuyNow"]) {
  912. return @"Reading_RadioButton_Paid";
  913. } else if ([eveN isEqual:@"Reading_ListBox_BuyNow"]) {
  914. return @"Reading_ListBox_Paid";
  915. } else if ([eveN isEqual:@"Reading_ComboBox_BuyNow"]) {
  916. return @"Reading_ComboBox_Paid";
  917. } else if ([eveN isEqual:@"Reading_Button_BuyNow"]) {
  918. return @"Reading_Button_Paid";
  919. }
  920. // Paid_Sign SunTbr_Signature
  921. else if ([eveN isEqual:@"Reading_FillSign_Signature_BuyNow"]) {
  922. return @"Reading_FillSign_Signature_Paid";
  923. } else if ([eveN isEqual:@"Reading_DigitalSign_BuyNow"]) {
  924. return @"Reading_DigitalSign_Paid";
  925. } else if ([eveN isEqual:@"Reading_ElectronicSign_BuyNow"]) {
  926. return @"Reading_ElectronicSign_Paid";
  927. }
  928. // Paid_EditPDF Tbr_Edit PDF
  929. else if ([eveN isEqual:@"Reading_EditPDF_BuyNow"]) {
  930. return @"Reading_EditPDF_Paid";
  931. } else if ([eveN isEqual:@"Reading_ReplaceText_BuyNow"]) {
  932. return @"Reading_ReplaceText_Paid";
  933. }
  934. // Paid_Redact Tbr_Redact
  935. else if ([eveN isEqual:@"Reading_Redact_BuyNow"]) {
  936. return @"Reading_Redact_Paid";
  937. }
  938. // Paid_OCR SubTbr_OCR
  939. else if ([eveN isEqual:@"Reading_OCR_BuyNow"]) {
  940. return @"Reading_OCR_Paid";
  941. } else if ([eveN isEqual:@"Reading_Convert_OCR_BuyNow"]) {
  942. return @"Reading_Convert_OCR_Paid";
  943. } else if ([eveN isEqual:@"Onbrd_OCR_BuyNow"]) {
  944. return @"Onbrd_OCR_Paid";
  945. }
  946. // Paid_PageDisplay SubTbr_Page Display
  947. else if ([eveN isEqual:@"Reading_SplitView_BuyNow"]) {
  948. return @"Reading_SplitView_Paid";
  949. } else if ([eveN isEqual:@"Reading_Rotate_BuyNow"]) {
  950. return @"Reading_Rotate_Paid";
  951. } else if ([eveN isEqual:@"Reading_Theme_BuyNow"]) {
  952. return @"Reading_Theme_Paid";
  953. } else if ([eveN isEqual:@"Reading_MultiTab_BuyNow"]) {
  954. return @"Reading_MultiTab_Paid";
  955. }
  956. // Home_Others
  957. else if ([eveN isEqual:@"Onbrd_PrintPoster_BuyNow"]) {
  958. return @"Onbrd_PrintPoster_Paid";
  959. } else if ([eveN isEqual:@"Onbrd_PrintMultiple_BuyNow"]) {
  960. return @"Onbrd_PrintMultiple_Paid";
  961. } else if ([eveN isEqual:@"Onbrd_PrintBooklet_BuyNow"]) {
  962. return @"Onbrd_PrintBooklet_Paid";
  963. }
  964. // Paid_Others SubTbr_Others
  965. else if ([eveN isEqual:@"Reading_Flatten_BuyNow"]) {
  966. return @"Reading_Flatten_Paid";
  967. }
  968. // Paid_Others MenuBar_Others
  969. else if ([eveN isEqual:@"MenuBar_PrintPoster_BuyNow"]) {
  970. return @"MenuBar_PrintPoster_Paid";
  971. } else if ([eveN isEqual:@"MenuBar_PrintMultiple_BuyNow"]) {
  972. return @"MenuBar_PrintMultiple_Paid";
  973. } else if ([eveN isEqual:@"MenuBar_PrintBooklet_BuyNow"]) {
  974. return @"MenuBar_PrintBooklet_Paid";
  975. }
  976. return nil;
  977. }
  978. - (NSDictionary *)_getPaidEventParamsWith:(NSString *)eventN {
  979. NSString *eveN = eventN;
  980. if (eveN == nil || eveN.length == 0) {
  981. return nil;
  982. }
  983. // Paid_Tools SubTbr_Tools
  984. if ([eveN isEqual:@"Reading_WebsiteLink_Paid"] ||
  985. [eveN isEqual:@"Reading_EmailLink_Paid"] ||
  986. [eveN isEqual:@"Reading_DynamicStamp_Paid"] ||
  987. [eveN isEqual:@"Reading_CustomStamp_Paid"] ||
  988. [eveN isEqual:@"Reading_Signature_Paid"] ||
  989. [eveN isEqual:@"Reading_Table_Paid"]) {
  990. return @{@"Paid_Tools" : @"SubTbr_Tools"};
  991. }
  992. // Paid_PageEdit SubTbr_PageEdit
  993. else if ([eveN isEqual:@"Reading_InsertBlankPage_Paid"] ||
  994. [eveN isEqual:@"Reading_InsertPDF_Paid"] ||
  995. [eveN isEqual:@"Reading_InsertSacnner_Paid"] ||
  996. [eveN isEqual:@"Reading_InsertImage_Paid"] ||
  997. [eveN isEqual:@"Reading_InsertClipboard_Paid"] ||
  998. [eveN isEqual:@"Reading_Replace_Paid"] ||
  999. [eveN isEqual:@"Reading_Extract_Paid"] ||
  1000. [eveN isEqual:@"Reading_Split_Paid"] ||
  1001. [eveN isEqual:@"Reading_Rotate_Paid"] ||
  1002. [eveN isEqual:@"Reading_Reverse_Paid"] ||
  1003. [eveN isEqual:@"Reading_Copy_Paid"] ||
  1004. [eveN isEqual:@"Reading_Delete_Paid"] ||
  1005. [eveN isEqual:@"Reading_Merge_Paid"]) {
  1006. return @{@"Paid_PageEdit" : @"SubTbr_PageEdit"};
  1007. }
  1008. // Paid_PageEdit Home_PageEdit
  1009. else if ([eveN isEqual:@"Onbrd_EditPage_Paid"] ||
  1010. [eveN isEqual:@"Onbrd_Merge_Paid"]) {
  1011. return @{@"Paid_PageEdit" : @"Home_PageEdit"};
  1012. }
  1013. // Paid_Editor SubTbr_Editor
  1014. else if ([eveN isEqual:@"Reading_RemoveSecurity_Paid"] ||
  1015. [eveN isEqual:@"Reading_Compare_Paid"] ||
  1016. [eveN isEqual:@"Reading_AddWatermark_Paid"] ||
  1017. [eveN isEqual:@"Reading_RemoveWatermark_Paid"] ||
  1018. [eveN isEqual:@"Reading_AddBackground_Paid"] ||
  1019. [eveN isEqual:@"Reading_RemoveBackground_Paid"] ||
  1020. [eveN isEqual:@"Reading_AddHeaderFooter_Paid"] ||
  1021. [eveN isEqual:@"Reading_RemoveHeaderFooter_Paid"] ||
  1022. [eveN isEqual:@"Reading_AddBates_Paid"] ||
  1023. [eveN isEqual:@"Reading_RemoveBates_Paid"] ||
  1024. [eveN isEqual:@"Reading_Measure_Paid"]) {
  1025. return @{@"" : @""};
  1026. }
  1027. // Paid_Editor Home_Editor
  1028. else if ([eveN isEqual:@"Onbrd_Compare_Paid"] ||
  1029. [eveN isEqual:@"Onbrd_Background_Paid"] ||
  1030. [eveN isEqual:@"Onbrd_Watermard_Paid"] ||
  1031. [eveN isEqual:@"Onbrd_HeaderFooter_Paid"] ||
  1032. [eveN isEqual:@"Onbrd_Bates_Paid"] ||
  1033. [eveN isEqual:@"Onbrd_Security_Paid"]) {
  1034. return @{@"Paid_Editor" : @"Home_Editor"};
  1035. }
  1036. // Paid_Converter SubTbr_Converter
  1037. else if ([eveN isEqual:@"Reading_PDFtoWord_Paid"] ||
  1038. [eveN isEqual:@"Reading_PDFtoExcel_Paid"] ||
  1039. [eveN isEqual:@"Reading_PDFtoPPT_Paid"] ||
  1040. [eveN isEqual:@"Reading_PDFtoRTF_Paid"] ||
  1041. [eveN isEqual:@"Reading_PDFtoCSV_Paid"] ||
  1042. [eveN isEqual:@"Reading_PDFtoText_Paid"] ||
  1043. [eveN isEqual:@"Reading_PDFtoImage_Paid"] ||
  1044. [eveN isEqual:@"Reading_ExtractImage_Paid"]) {
  1045. return @{@"Paid_Converter" : @"SubTbr_Converter"};
  1046. }
  1047. // Paid_Converter Home_Converter
  1048. else if ([eveN isEqual:@"Onbrd_ConvertPDF_Paid"] ||
  1049. [eveN isEqual:@"Onbrd_PDFtoWord_Paid"] ||
  1050. [eveN isEqual:@"Onbrd_PDFtoExcel_Paid"] ||
  1051. [eveN isEqual:@"Onbrd_PDFtoPPT_Paid"] ||
  1052. [eveN isEqual:@"Onbrd_ImagetoPDF_Paid"]) {
  1053. return @{@"Paid_Converter" : @"Home_Converter"};
  1054. }
  1055. // Paid_Form SubTbr_Forms
  1056. else if ([eveN isEqual:@"Reading_TextField_Paid"] ||
  1057. [eveN isEqual:@"Reading_CheckBox_Paid"] ||
  1058. [eveN isEqual:@"Reading_RadioButton_Paid"] ||
  1059. [eveN isEqual:@"Reading_ListBox_Paid"] ||
  1060. [eveN isEqual:@"Reading_ComboBox_Paid"] ||
  1061. [eveN isEqual:@"Reading_Button_Paid"]) {
  1062. return @{@"Paid_Form" : @"SubTbr_Forms"};
  1063. }
  1064. // Paid_Sign SunTbr_Signature
  1065. else if ([eveN isEqual:@"Reading_FillSign_Signature_Paid"] ||
  1066. [eveN isEqual:@"Reading_DigitalSign_Paid"] ||
  1067. [eveN isEqual:@"Reading_ElectronicSign_Paid"]) {
  1068. return @{@"Paid_Sign" : @"SunTbr_Signature"};
  1069. }
  1070. // Paid_EditPDF Tbr_Edit PDF
  1071. else if ([eveN isEqual:@"Reading_EditPDF_Paid"] ||
  1072. [eveN isEqual:@"Reading_ReplaceText_Paid"]) {
  1073. return @{@"Paid_EditPDF" : @"Tbr_Edit PDF"};
  1074. }
  1075. // Paid_Redact Tbr_Redact
  1076. else if ([eveN isEqual:@"Reading_Redact_Paid"]) {
  1077. return @{@"Paid_Redact" : @"Tbr_Redact"};
  1078. }
  1079. // Paid_OCR SubTbr_OCR
  1080. else if ([eveN isEqual:@"Reading_OCR_Paid"] ||
  1081. [eveN isEqual:@"Reading_Convert_OCR_Paid"] ||
  1082. [eveN isEqual:@"Onbrd_OCR_Paid"]) {
  1083. return @{@"Paid_OCR" : @"SubTbr_OCR"};
  1084. }
  1085. // Paid_PageDisplay SubTbr_Page Display
  1086. else if ([eveN isEqual:@"Reading_SplitView_Paid"] ||
  1087. [eveN isEqual:@"Reading_Rotate_Paid"] ||
  1088. [eveN isEqual:@"Reading_Theme_Paid"] ||
  1089. [eveN isEqual:@"Reading_MultiTab_Paid"]) {
  1090. return @{@"Paid_PageDisplay" : @"SubTbr_Page Display"};
  1091. }
  1092. // Home_Others
  1093. else if ([eveN isEqual:@"Onbrd_PrintPoster_Paid"] ||
  1094. [eveN isEqual:@"Onbrd_PrintMultiple_Paid"] ||
  1095. [eveN isEqual:@"Onbrd_PrintBooklet_Paid"]) {
  1096. return @{@"Paid_Others" : @"Home_Others"};
  1097. }
  1098. // Paid_Others SubTbr_Others
  1099. else if ([eveN isEqual:@"Reading_Flatten_Paid"]) {
  1100. return @{@"Paid_Others" : @"SubTbr_Others"};
  1101. }
  1102. // Paid_Others MenuBar_Others
  1103. else if ([eveN isEqual:@"MenuBar_PrintPoster_Paid"] ||
  1104. [eveN isEqual:@"MenuBar_PrintMultiple_Paid"] ||
  1105. [eveN isEqual:@"MenuBar_PrintBooklet_Paid"]) {
  1106. return @{@"Paid_Others" : @"MenuBar_Others"};
  1107. }
  1108. return nil;
  1109. }
  1110. @end