瀏覽代碼

Merge branch 'develop_V3.4.0' into develop_PDFReaderProNew

# Conflicts:
#	PDF Office/PDF Master/Strings/de.lproj/Localizable.strings
#	PDF Office/PDF Master/Strings/es.lproj/Localizable.strings
#	PDF Office/PDF Master/Strings/fr.lproj/Localizable.strings
#	PDF Office/PDF Master/Strings/it.lproj/Localizable.strings
#	PDF Office/PDF Master/Strings/ja.lproj/Localizable.strings
#	PDF Office/PDF Master/Strings/nl.lproj/Localizable.strings
#	PDF Office/PDF Master/Strings/pl.lproj/Localizable.strings
#	PDF Office/PDF Master/Strings/ru.lproj/Localizable.strings
#	PDF Office/PDF Master/Strings/zh-Hans.lproj/Localizable.strings
#	PDF Office/PDF Master/Strings/zh-Hant.lproj/Localizable.strings
#	PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
niehaoyu 10 月之前
父節點
當前提交
fde1756f0d
共有 100 個文件被更改,包括 7390 次插入664 次删除
  1. 1 0
      PDF Office/PDF Master/Class/AD/KMAdsManager.swift
  2. 4 1
      PDF Office/PDF Master/Class/AD/KMAdsWebView.swift
  3. 81 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIChatInfoManager/AIChatInfoManager.swift
  4. 6 4
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIConfigWindowController.xib
  5. 677 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AINewConfigWindowController.swift
  6. 49 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AINewConfigWindowController.xib
  7. 306 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/AIChatView.swift
  8. 67 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/AIChatView.xib
  9. 152 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatDefaultTIpItem.swift
  10. 278 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatDefaultTIpItem.xib
  11. 98 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatFileInfoItem.swift
  12. 100 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatFileInfoItem.xib
  13. 357 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatStringResultItem.swift
  14. 236 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatStringResultItem.xib
  15. 64 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatStringUploadItem.swift
  16. 65 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatStringUploadItem.xib
  17. 623 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatTranslateResultItem.swift
  18. 551 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatTranslateResultItem.xib
  19. 98 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIHeaderView/AIHeaderView.swift
  20. 109 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIHeaderView/AIHeaderView.xib
  21. 756 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIInfoInputView/AIInfoInputView.swift
  22. 506 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIInfoInputView/AIInfoInputView.xib
  23. 46 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIRedoConfirmView/AIRedoConfirmView.swift
  24. 67 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIRedoConfirmView/AIRedoConfirmView.xib
  25. 278 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AITypeItemChooseView/AITypeItemChooseView.swift
  26. 97 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AITypeItemChooseView/AITypeItemChooseView.xib
  27. 82 0
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/CornerView/CustomCornerView.swift
  28. 22 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatInfoClear.imageset/Contents.json
  29. 二進制
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatInfoClear.imageset/Property 1=nor 1.pdf
  30. 二進制
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatInfoClear.imageset/Property 1=nor.pdf
  31. 二進制
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatInfoClearHover.imageset/AIChatInfoClearHover.pdf
  32. 22 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatInfoClearHover.imageset/Contents.json
  33. 二進制
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatInfoClearHover.imageset/Property 1=hover.pdf
  34. 二進制
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatRobot.imageset/AIChatRobot.pdf
  35. 22 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatRobot.imageset/Contents.json
  36. 二進制
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatRobot.imageset/Frame 1000006544.pdf
  37. 二進制
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatRobotHome.imageset/AIChatRobotHome.pdf
  38. 12 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatRobotHome.imageset/Contents.json
  39. 11 1
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIchange.imageset/Contents.json
  40. 27 27
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIchange.imageset/AIchange.pdf
  41. 105 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIchange.imageset/Property 1=nor.pdf
  42. 22 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIchange_hover.imageset/Contents.json
  43. 105 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIchange_hover.imageset/Property 1=hover 1.pdf
  44. 105 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIchange_hover.imageset/Property 1=hover.pdf
  45. 12 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/aiTextClose.imageset/Contents.json
  46. 79 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/aiTextClose.imageset/aiTextClose.pdf
  47. 22 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/aiVLine.imageset/Contents.json
  48. 150 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/aiVLine.imageset/aiVLine.pdf
  49. 153 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/aiVLine.imageset/丨.pdf
  50. 12 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/creditNoTip.imageset/Contents.json
  51. 90 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/creditNoTip.imageset/creditNoTip.pdf
  52. 10 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_btn_arrow_down.imageset/Contents.json
  53. 73 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_btn_arrow_down.imageset/ic-2.pdf
  54. 19 18
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_btn_arrow_down.imageset/ic_btn_arrow_down.pdf
  55. 14 41
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_else_alert.imageset/ic_else_alert.pdf
  56. 1 1
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_else_info_large.imageset/Contents.json
  57. 0 93
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_else_info_large.imageset/ic_else_info_large 1.pdf
  58. 11 44
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_else_info_large.imageset/ic_else_info_large.pdf
  59. 60 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_else_info_large.imageset/large.pdf
  60. 12 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_propertybar_file_pdf.imageset/Contents.json
  61. 二進制
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_propertybar_file_pdf.imageset/ic_propertybar_file_pdf.pdf
  62. 0 10
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/robot-gray.imageset/Contents.json
  63. 0 187
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/robot-gray.imageset/robot-gray 1.pdf
  64. 22 0
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/toolbar_AITools.imageset/Contents.json
  65. 二進制
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/toolbar_AITools.imageset/ai 1.pdf
  66. 二進制
      PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/toolbar_AITools.imageset/ai.pdf
  67. 24 0
      PDF Office/PDF Master/Class/AIInfo/AIInfoConfig.swift
  68. 2 1
      PDF Office/PDF Master/Class/AIInfo/AIUserInfoController/AIUserInfoController.swift
  69. 14 12
      PDF Office/PDF Master/Class/AIInfo/KMAIRequestServerManager.swift
  70. 二進制
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/Other/UXNewImage/ic_Home/AIChatRobotHome.imageset/AIChatRobotHome.pdf
  71. 12 0
      PDF Office/PDF Master/Class/Appearance/Image.xcassets/Other/UXNewImage/ic_Home/AIChatRobotHome.imageset/Contents.json
  72. 1 1
      PDF Office/PDF Master/Class/ChromiumTabs/Screen/KMScreenShotMaskViewController.swift
  73. 1 1
      PDF Office/PDF Master/Class/DigtalSignature/CPDFDigtalView/KMPDFDigitalSignViewController.swift
  74. 1 1
      PDF Office/PDF Master/Class/GuideInfo/Controllers/KMFunctionGuideMultiController.swift
  75. 1 1
      PDF Office/PDF Master/Class/GuideInfo/KMFunctionGuideWindowController.swift
  76. 7 7
      PDF Office/PDF Master/Class/GuideInfo/KMGuideInfoWindowController.swift
  77. 6 0
      PDF Office/PDF Master/Class/Home/View/HomeContentView/QucikTools/KMQucikToolsView.swift
  78. 5 1
      PDF Office/PDF Master/Class/Home/View/HomeContentView/QucikTools/Model/KMQucikToolsModel.swift
  79. 4 0
      PDF Office/PDF Master/Class/Home/View/HomeContentView/QucikTools/View/KMQucikToolCollectionViewItem.swift
  80. 3 0
      PDF Office/PDF Master/Class/Home/ViewController/KMFastToolCollectionViewItem.swift
  81. 5 0
      PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift
  82. 32 66
      PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.swift
  83. 2 2
      PDF Office/PDF Master/Class/PDFTools/Compare/ViewController/ContentComplete/KMCompareContentWindowController.swift
  84. 6 0
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMMainToolbarController.swift
  85. 2 0
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift
  86. 19 2
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift
  87. 3 4
      PDF Office/PDF Master/Class/PDFWindowController/Toolbar/PublicKey.swift
  88. 7 5
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift
  89. 3 3
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift
  90. 62 85
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift
  91. 24 24
      PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseFirstTrialWindowController.swift
  92. 5 4
      PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseFirstTrialWindowController.xib
  93. 3 3
      PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseLimitWindowController.xib
  94. 15 14
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m
  95. 35 0
      PDF Office/PDF Master/Strings/de.lproj/Localizable.strings
  96. 34 0
      PDF Office/PDF Master/Strings/es.lproj/Localizable.strings
  97. 35 0
      PDF Office/PDF Master/Strings/fr.lproj/Localizable.strings
  98. 35 0
      PDF Office/PDF Master/Strings/it.lproj/Localizable.strings
  99. 35 0
      PDF Office/PDF Master/Strings/ja.lproj/Localizable.strings
  100. 0 0
      PDF Office/PDF Master/Strings/nl.lproj/Localizable.strings

+ 1 - 0
PDF Office/PDF Master/Class/AD/KMAdsManager.swift

@@ -120,6 +120,7 @@ class KMAdsManager: NSObject {
     func dismissSheetModal(for view: NSView) {
         if let adView = adViews.first {
             adViews.removeAll { $0 == adView }
+            adView.stopLoading()
             adView.removeFromSuperview()
         }
 //        if let adView = view.viewWithTag(kADViewWithTag) as? KMAdsWebView {

+ 4 - 1
PDF Office/PDF Master/Class/AD/KMAdsWebView.swift

@@ -157,7 +157,10 @@ class KMAdsWebView: NSView, WKNavigationDelegate, CAAnimationDelegate {
     }
 
     func stopLoading() {
-
+        if timer != nil {
+            timer?.invalidate()
+            timer = nil
+        }
     }
 
     func resizeWithOldSuperviewSize(oldSize: NSSize) {

+ 81 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIChatInfoManager/AIChatInfoManager.swift

@@ -0,0 +1,81 @@
+//
+//  AIChatInfoManager.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/18.
+//
+
+import Cocoa
+
+class AIChatInfoModel: NSObject {
+    
+    var chateModelID: String = ""
+    var aiConfigType: AIConfigType = .none
+    var infoType: AIChatInfoType = .none
+    
+    var filePath: String = ""   //使用的文件路径
+    var uploadContent: String = "" //用户输入的内容
+    var chatResult: String = ""    //AI返回的结果
+    var chatInfoState: AIChatInfoState = .stateNone
+    var translateFromLanguage: String = ""
+    var translateToLanguage: String = ""
+    var creditsValid: Bool = false
+    var costCredits: Int = 0
+    var totalChart: Int = 0
+    
+    
+    var infoDict: [String : String] = [:]
+    
+    override init() {
+        super.init()
+        
+        self.chateModelID = self.tagString()
+        self.creditsValid = true
+        
+    }
+    
+    func updateTagID() {
+        self.chateModelID = self.tagString()
+    }
+    
+    @objc func tagString() -> String {
+        let dateFormatter = DateFormatter.init()
+        dateFormatter.dateFormat = "yyyyMMddHHmmss"
+        let dateString = dateFormatter.string(from: NSDate() as Date)
+        return String(format: "%@%d", dateString, arc4random()%10000)
+    }
+}
+
+@objcMembers class AIChatInfoManager: NSObject {
+
+    public static let defaultManager = AIChatInfoManager.init()
+    
+    var modelsArrM: [AIChatInfoModel] = []
+    
+    var currentFilePath: String = ""
+    
+    var isAILoading: Bool = false
+    
+    override init() {
+        super.init()
+        
+        let defaultChatModel = AIChatInfoModel.init()
+        defaultChatModel.aiConfigType = .none
+        defaultChatModel.infoType = .defaultTip
+        self.modelsArrM.append(defaultChatModel)
+        
+        
+
+    }
+    
+    func clearData() {
+        self.modelsArrM.removeAll()
+        
+        let defaultChatModel = AIChatInfoModel.init()
+        defaultChatModel.aiConfigType = .none
+        defaultChatModel.infoType = .defaultTip
+        self.modelsArrM.append(defaultChatModel)
+        
+    }
+    
+}

+ 6 - 4
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIConfigWindowController.xib

@@ -211,7 +211,7 @@
                                             </constraints>
                                         </customView>
                                         <button translatesAutoresizingMaskIntoConstraints="NO" id="NJ8-8e-0SF">
-                                            <rect key="frame" x="366" y="6" width="24" height="24"/>
+                                            <rect key="frame" x="369" y="9" width="18" height="18"/>
                                             <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="AIchange" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="jRM-u8-FH3">
                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                 <font key="font" metaFont="system"/>
@@ -221,7 +221,7 @@
                                             </connections>
                                         </button>
                                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="AHC-e4-uz8">
-                                            <rect key="frame" x="410" y="0.0" width="77" height="36"/>
+                                            <rect key="frame" x="407" y="0.0" width="77" height="36"/>
                                             <subviews>
                                                 <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lA6-HV-STg">
                                                     <rect key="frame" x="10" y="10" width="37" height="16"/>
@@ -310,6 +310,7 @@
                                                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                                 <size key="minSize" width="348" height="276"/>
                                                                 <size key="maxSize" width="348" height="10000000"/>
+                                                                <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                                             </textView>
                                                         </subviews>
                                                     </clipView>
@@ -498,6 +499,7 @@
                                                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                                 <size key="minSize" width="350" height="324"/>
                                                                 <size key="maxSize" width="355" height="10000000"/>
+                                                                <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                                             </textView>
                                                         </subviews>
                                                     </clipView>
@@ -662,10 +664,10 @@ Gw
     </objects>
     <resources>
         <image name="AIChooseFile" width="16" height="16"/>
-        <image name="AIchange" width="24" height="24"/>
+        <image name="AIchange" width="18" height="18"/>
         <image name="aiPDF_Clear" width="17" height="17"/>
         <image name="ai_summary_Empty" width="80" height="80"/>
-        <image name="ic_btn_arrow_down" width="16" height="16"/>
+        <image name="ic_btn_arrow_down" width="11" height="11"/>
         <image name="ic_else_alert" width="14" height="14"/>
         <image name="ic_else_info_large" width="14" height="14"/>
         <image name="img_licensecode_successful" width="64" height="64"/>

+ 677 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AINewConfigWindowController.swift

@@ -0,0 +1,677 @@
+//
+//  AINewConfigWindowController.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/16.
+//
+
+import Cocoa
+
+protocol AIConfigWindowDelegate: AnyObject {
+    
+    func ai_InputViewDidChooseCurFile(aiConfigWindow: AINewConfigWindowController)
+    
+}
+
+@objcMembers class AINewConfigWindowController: NSWindowController, NSWindowDelegate, AIInfoInputViewDelegate {
+
+    static var currentWindowController: AINewConfigWindowController!
+    
+    @IBOutlet weak var contendBox: NSBox!
+    
+    var aiHeaderView: AIHeaderView!
+    var aiChatView: AIChatView!
+    var aiTypeItemView: AITypeItemChooseView!
+    var aiInfoInputView: AIInfoInputView!
+    
+    var inputStringHeight: CGFloat = 40
+    var didSetOriginFrame: Bool = false
+    
+    var eventLabel: String = "AITools_Start"
+    
+    weak var aiDelegate: AIConfigWindowDelegate?
+    
+    var chooseCurFileHandle: ((_ windowVC: AINewConfigWindowController) -> Void)?
+    
+    deinit {
+        DistributedNotificationCenter.default.removeObserver(self)
+    }
+    
+    @objc static func currentWC() -> AINewConfigWindowController {
+        if currentWindowController != nil {
+            return currentWindowController
+        } else {
+            let configWC: AINewConfigWindowController = AINewConfigWindowController.init(windowNibName: "AINewConfigWindowController")
+            currentWindowController = configWC;
+            return currentWindowController
+        }
+    }
+    
+    override func showWindow(_ sender: Any?) {
+        super.showWindow(sender)
+        
+        self.window?.delegate = self
+        
+        self.aiInfoInputView.setUpTranslateUI()
+        
+        self.aiChatView.reloadData()
+        
+        self.aiTypeItemView.refreshUI()
+        
+        self.refreshViewUI()
+        
+    }
+    
+    override func windowDidLoad() {
+        super.windowDidLoad()
+
+        // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
+        
+        self.window?.title = NSLocalizedString("AI Tools", comment: "")
+        
+        self.loadAIHeaderView()
+        
+        self.loadAIChatView()
+        
+        self.loadAIInputView()
+        
+        self.loadAITypeItemView()
+        
+        self.refreshViewUI()
+        
+        self.refreshViewColor()
+        
+        DistributedNotificationCenter.default().addObserver(self, selector: #selector(themeChange), name: NSNotification.Name(rawValue: "AppleInterfaceThemeChangedNotification"), object: nil)
+        
+    }
+    
+    func refreshViewColor() {
+        if KMAppearance.isDarkMode() {
+            self.contendBox.fillColor = NSColor(red: 33/255, green: 33/255, blue: 33/255, alpha: 1)
+        } else {
+            self.contendBox.fillColor = NSColor.white
+        }
+        self.aiHeaderView.refreshViewColor()
+        self.aiInfoInputView.refreshUI()
+        self.aiChatView.reloadData()
+        self.aiTypeItemView.refreshViewColor()
+    }
+    
+    func loadAIHeaderView() {
+        self.aiHeaderView = AIHeaderView.createFromNib()
+        self.aiHeaderView.frame = CGRectMake(0, CGRectGetHeight(self.contendBox.frame)-58, CGRectGetWidth(self.contendBox.frame), 28)
+        self.aiHeaderView.autoresizingMask = [.minXMargin, .maxXMargin, .width, .minYMargin]
+        self.contendBox.addSubview(self.aiHeaderView)
+        
+    }
+    
+    func loadAIChatView() {
+        self.aiChatView = AIChatView.createFromNib()
+        self.aiChatView.wantsLayer = true
+        self.aiChatView.layer?.backgroundColor = NSColor.clear.cgColor
+        self.aiChatView.frame = CGRectMake(0, 300, CGRectGetWidth(self.contendBox.frame), CGRectGetHeight(self.contendBox.frame)-400)
+        self.aiChatView.autoresizingMask = [.width, .height]
+        self.contendBox.addSubview(self.aiChatView)
+  
+        self.aiChatView.chooseConfigHandle = {[unowned self] view, configType in
+            DispatchQueue.main.async {
+                self.chooseAIFunctionWithType(configType)
+            }
+            
+        }
+        
+        self.aiChatView.cancelAIHandle = {[unowned self] view, chatInfoModel in
+            DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.05) {
+                chatInfoModel.chatInfoState = .stateCancel
+                self.aiChatView.reloadData()
+            }
+        }
+        
+        self.aiChatView.continueAITranslateHandle = {[unowned self] view, chatInfoModel in
+            DispatchQueue.main.async {
+                chatInfoModel.chatInfoState = .stateLoading
+                
+                self.aiChatView.reloadData()
+                
+                self.continueAiTranslate(chatInfoModel)
+            }
+        }
+        
+        self.aiChatView.redoHandle = {[unowned self] view, chatInfoModel in
+            DispatchQueue.main.async {
+                let newChatModel = AIChatInfoModel.init()
+                newChatModel.aiConfigType = chatInfoModel.aiConfigType
+                newChatModel.infoType = chatInfoModel.infoType
+                newChatModel.filePath = chatInfoModel.filePath
+                newChatModel.chatInfoState = .stateLoading
+                newChatModel.uploadContent = chatInfoModel.uploadContent
+                newChatModel.translateFromLanguage = chatInfoModel.translateFromLanguage
+                newChatModel.translateToLanguage = chatInfoModel.translateToLanguage
+                
+                AIChatInfoManager.defaultManager.modelsArrM.append(newChatModel)
+                
+                self.aiChatView.reloadData()
+                
+                if newChatModel.aiConfigType == .summarize {
+                    self.aiSummarizeWithModel(newChatModel)
+                    
+                } else if newChatModel.aiConfigType == .reWriting {
+                    self.aiReWritingWithModel(newChatModel)
+                    
+                } else if newChatModel.aiConfigType == .proofreading {
+                    self.aiProofreadingWithModel(newChatModel)
+                    
+                } else if newChatModel.aiConfigType == .translate {
+                    self.startAiTranslateWithModel(newChatModel)
+                    
+                }
+            }
+        }
+        
+    }
+    
+    func loadAIInputView() {
+        self.aiInfoInputView = AIInfoInputView.createFromNib()
+        self.aiInfoInputView.frame = CGRectMake((CGRectGetWidth(self.contendBox.frame)-248)/2.0, 20, 248, 86)
+        self.aiInfoInputView.autoresizingMask = [.minXMargin, .maxXMargin, .width, .maxYMargin]
+        self.contendBox.addSubview(self.aiInfoInputView)
+        self.aiInfoInputView.aiConfigType = .none
+        self.aiInfoInputView.aiDelegate = self
+        self.aiInfoInputView.reloadData()
+        self.aiInfoInputView.startAIHandle = {[unowned self] view in
+            if view.aiConfigType == .summarize {
+                let chatModel = AIChatInfoModel.init()
+                chatModel.aiConfigType = .summarize
+                chatModel.infoType = .chatFileUpload
+                chatModel.filePath = self.aiInfoInputView.filePath
+                AIChatInfoManager.defaultManager.modelsArrM.append(chatModel)
+                
+                self.aiChatView.reloadData()
+                
+                self.aiSummarize()
+            } else if view.aiConfigType == .reWriting {
+                let chatModel = AIChatInfoModel.init()
+                chatModel.aiConfigType = .reWriting
+                chatModel.infoType = .chatStringUpload
+                chatModel.uploadContent = self.aiInfoInputView.fileEmptyTextView.string
+                AIChatInfoManager.defaultManager.modelsArrM.append(chatModel)
+                
+                self.aiChatView.reloadData()
+                
+                self.aiReWriting()
+            } else if view.aiConfigType == .proofreading {
+                let chatModel = AIChatInfoModel.init()
+                chatModel.aiConfigType = .proofreading
+                chatModel.infoType = .chatStringUpload
+                chatModel.uploadContent = self.aiInfoInputView.fileEmptyTextView.string
+                AIChatInfoManager.defaultManager.modelsArrM.append(chatModel)
+                
+                self.aiChatView.reloadData()
+                
+                self.aiProofreading()
+            } else if view.aiConfigType == .translate {
+                let chatModel = AIChatInfoModel.init()
+                chatModel.aiConfigType = .translate
+                
+                if self.aiInfoInputView.filePath.isEmpty == false {
+                    //文件
+                    chatModel.filePath = self.aiInfoInputView.filePath
+                    chatModel.infoType = .chatFileUpload
+                } else {
+                    //文字
+                    chatModel.uploadContent = self.aiInfoInputView.fileEmptyTextView.string
+                    chatModel.infoType = .chatStringUpload
+                }
+                chatModel.translateFromLanguage = self.aiInfoInputView.fromLanguage
+                chatModel.translateToLanguage = self.aiInfoInputView.toLanguage
+                
+                AIChatInfoManager.defaultManager.modelsArrM.append(chatModel)
+                
+                self.aiChatView.reloadData()
+                
+                self.startAiTranslate()
+            }
+            self.refreshViewUI()
+            
+            self.aiTypeItemView.reloadData()
+            
+        }
+        
+        self.aiInfoInputView.inputFrameUpdateHandle = {[unowned self] view, stringSize in
+            if view.aiConfigType == .summarize {
+                self.inputStringHeight = max(stringSize.height, 40)
+            } else if view.aiConfigType == .reWriting {
+                self.inputStringHeight = max(stringSize.height, 40)
+            } else if view.aiConfigType == .proofreading {
+                self.inputStringHeight = max(stringSize.height, 40)
+            } else if view.aiConfigType == .translate {
+                if view.filePath.isEmpty {
+                    self.inputStringHeight = max(stringSize.height, 40)
+                } else {
+                    self.inputStringHeight = 40
+                }
+            }
+            self.refreshViewUI()
+        }
+        self.aiInfoInputView.refreshUI()
+        
+    }
+    
+    func loadAITypeItemView() {
+        self.aiTypeItemView =  AITypeItemChooseView.createFromNib()
+        self.aiTypeItemView.wantsLayer = true
+        self.aiTypeItemView.layer?.backgroundColor = NSColor.clear.cgColor
+        self.aiTypeItemView.frame = CGRectMake((CGRectGetWidth(self.contendBox.frame)-246)/2, CGRectGetMaxY(self.aiInfoInputView.frame)+13, 246, 52)
+        self.aiTypeItemView.autoresizingMask = [.minXMargin, .maxXMargin, .width, .maxYMargin]
+        self.contendBox.addSubview(self.aiTypeItemView)
+        
+        self.aiTypeItemView.chooseTypeHandle = {[unowned self] itemView, aiConfigtype in
+            self.chooseAIFunctionWithType(aiConfigtype)
+        }
+        
+        self.aiTypeItemView.clearHandle = {[unowned self] itemView in
+            if AIChatInfoManager.defaultManager.modelsArrM.count < 1 {
+                return
+            }
+            let alert = NSAlert()
+            alert.alertStyle = .critical
+            alert.informativeText = NSLocalizedString("All the AI content will be removed. Are you sure you want to clear the session?", comment: "")
+            alert.messageText = NSLocalizedString("Clear session", comment: "")
+            alert.addButton(withTitle: NSLocalizedString("Clear", comment: ""))
+            alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
+            let response = alert.runModal()
+            if response.rawValue == 1000 {
+                DispatchQueue.main.async {
+                    AIChatInfoManager.defaultManager.clearData()
+                    self.aiChatView.reloadData()
+                }
+            }
+        }
+        
+    }
+    
+    func chooseAIFunctionWithType(_ aiConfigType: AIConfigType) -> Void {
+        if AIInfoManager.default().aiInfo.infoDict.keys.count == 0 {
+#if VERSION_DMG
+            KMPurchaseCompareWindowController.dmgPurchaseInstance().showWindow(nil)
+#else
+            AIPurchaseWindowController.currentWC().showWindow(nil)
+#endif
+            return;
+        }
+        
+        if self.eventLabel.isEmpty {
+            self.eventLabel = "AITools_Start"
+        }
+        
+        if aiConfigType == .summarize {
+            FMTrackEventManager.defaultManager.trackOnceEvent(event: "AITools", withProperties: [self.eventLabel:"AISum"])
+        } else if aiConfigType == .reWriting {
+            FMTrackEventManager.defaultManager.trackOnceEvent(event: "AITools", withProperties: [self.eventLabel:"AIRewrite"])
+         } else if aiConfigType == .proofreading {
+            FMTrackEventManager.defaultManager.trackOnceEvent(event: "AITools", withProperties: [self.eventLabel:"AIProofread"])
+         } else if aiConfigType == .translate {
+            FMTrackEventManager.defaultManager.trackOnceEvent(event: "AITools", withProperties: [self.eventLabel:"AITranslate"])
+         }
+        
+        self.aiInfoInputView.aiConfigType = aiConfigType
+        self.aiInfoInputView.reloadData()
+        self.aiInfoInputView.aiFunctionTypeChanged()
+        
+        if self.aiInfoInputView.fileEmptyTextView.string.isEmpty == false {
+            self.aiInfoInputView.updateCountLabelInfo()
+            self.aiInfoInputView.refreshStringSize()
+        }
+        
+        self.refreshViewUI()
+        
+    }
+    
+    func setCurrentPDFSelection(_ string: String) -> Void {
+        self.aiInfoInputView.fileEmptyTextView.string = string
+    }
+    
+    func refreshViewUI() {
+        self.aiHeaderView.frame = CGRectMake(0, CGRectGetHeight(self.contendBox.frame)-58, CGRectGetWidth(self.contendBox.frame), 28)
+        if self.aiInfoInputView.aiConfigType == .none {
+            self.aiInfoInputView.frame = CGRectMake(13, 17, 240, 86)
+        } else if self.aiInfoInputView.aiConfigType == .summarize {
+            self.aiInfoInputView.frame = CGRectMake(13, 17, 240, min(96+self.inputStringHeight, 500))
+        } else if self.aiInfoInputView.aiConfigType == .reWriting {
+            self.aiInfoInputView.frame = CGRectMake(13, 17, 240, min(72+self.inputStringHeight, 500))
+        } else if self.aiInfoInputView.aiConfigType == .proofreading {
+            self.aiInfoInputView.frame = CGRectMake(13, 17, 240, min(72+self.inputStringHeight, 500))
+        } else if self.aiInfoInputView.aiConfigType == .translate {
+            self.aiInfoInputView.frame = CGRectMake(13, 17, 240, min(125+self.inputStringHeight, 500))
+        }
+        
+        self.aiTypeItemView.frame = CGRectMake(13, CGRectGetMaxY(self.aiInfoInputView.frame)+8, 240, self.aiTypeItemView.viewHeight)
+        self.aiChatView.frame = CGRectMake(0, CGRectGetMaxY(self.aiTypeItemView.frame)+8, CGRectGetWidth(self.contendBox.frame), CGRectGetHeight(self.contendBox.frame) - CGRectGetMaxY(self.aiTypeItemView.frame) - 16 - 58)
+        
+    }
+    
+    
+    
+    //MARK: AI-Action
+    func aiSummarize() -> Void {
+        if FileManager.default.fileExists(atPath: self.aiInfoInputView.filePath) {
+           
+            let chatModel = AIChatInfoModel.init()
+            chatModel.aiConfigType = .summarize
+            chatModel.infoType = .chatStringResult
+            chatModel.filePath = self.aiInfoInputView.filePath
+            chatModel.chatInfoState = .stateLoading
+            
+            AIChatInfoManager.defaultManager.modelsArrM.append(chatModel)
+            
+            self.aiChatView.reloadData()
+             
+            self.aiSummarizeWithModel(chatModel)
+        }
+    }
+    
+    func aiSummarizeWithModel(_ chatModel: AIChatInfoModel) -> Void {
+        if FileManager.default.fileExists(atPath: chatModel.filePath) {
+            AIChatInfoManager.defaultManager.isAILoading = true
+            
+            //MARK: TestData
+//            DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 13) {
+//                DispatchQueue.main.async {
+//                    AIChatInfoManager.defaultManager.isAILoading = false
+//                    chatModel.chatResult = "AI Summary 返回的结果\nAI Summary 返回的结果\nAI Summary 返回的结果\nAI Summary 返回的结果\nAI Summary 返回的结果\nAI Summary 返回的结果\nAI Summary 返回的结果\nAI Summary 返回的结果"
+//                    chatModel.chatInfoState = .stateSuccess
+//                    self.aiChatView.reloadData()
+//                    self.aiTypeItemView.reloadData()
+//                    self.aiInfoInputView.reloadData()
+//
+//                    DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 14) {
+//                        DispatchQueue.main.async {
+//                            chatModel.chatInfoState = .stateFailed
+//                            chatModel.chatResult = "Unknown error"
+//
+//                            self.aiChatView.reloadData()
+//                            self.aiTypeItemView.reloadData()
+//                            self.aiInfoInputView.reloadData()
+//                        }
+//                    }
+//                }
+//            }
+            
+            //MARK: 正式数据
+            KMAIRequestServerManager.defaultManager.aiAction(content: chatModel.filePath, state: .extractSummaryFile) { wrapper in
+                DispatchQueue.main.async {
+                    AIChatInfoManager.defaultManager.isAILoading = false
+                    
+                    let resultStr = wrapper.content
+                    chatModel.chatResult = resultStr
+                    chatModel.chatInfoState = wrapper.success ? .stateSuccess : .stateFailed
+                    
+                    self.aiChatView.reloadData()
+                    self.aiTypeItemView.reloadData()
+                    self.aiInfoInputView.reloadData()
+                }
+            }
+        }
+    }
+    
+    func aiReWriting() -> Void {
+        //Loading(28+155)->Finish(实际大小)
+        
+        let chatModel = AIChatInfoModel.init()
+        chatModel.aiConfigType = .reWriting
+        chatModel.infoType = .chatStringResult
+        chatModel.uploadContent = self.aiInfoInputView.fileEmptyTextView.string
+        chatModel.chatInfoState = .stateLoading
+        AIChatInfoManager.defaultManager.modelsArrM.append(chatModel)
+        
+        self.aiChatView.reloadData()
+        
+        self.aiReWritingWithModel(chatModel)
+    }
+    
+    func aiReWritingWithModel(_ chatModel: AIChatInfoModel) -> Void {
+        AIChatInfoManager.defaultManager.isAILoading = true
+        
+        //MARK: TestData
+//        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 3) {
+//            DispatchQueue.main.async {
+//                AIChatInfoManager.defaultManager.isAILoading = false
+//                chatModel.chatInfoState = .stateSuccess
+//                chatModel.chatResult = "AI Rewrite返回的结果AI Rewrite返回的结果AI Rewrite返回的结果AI Rewrite返回的结果AI Rewrite返回的结果AI Rewrite返回的结果AI Rewrite返回的结果AI Rewrite返回的结果AI Rewrite返回的结果AI Rewrite返回的结果AI Rewrite返回的结果AI Rewrite返回的结果AI Rewrite返回的结果"
+//                self.aiChatView.reloadData()
+//                self.aiTypeItemView.reloadData()
+//                self.aiInfoInputView.reloadData()
+//            }
+//        }
+        
+        //MARK: 正式数据
+        KMAIRequestServerManager.defaultManager.aiAction(content: chatModel.uploadContent,
+                                                         state: .rewrite) { wrapper in
+            DispatchQueue.main.async {
+                AIChatInfoManager.defaultManager.isAILoading = false
+                
+                let resultStr = wrapper.content
+                chatModel.chatResult = resultStr
+                chatModel.chatInfoState = wrapper.success ? .stateSuccess : .stateFailed
+
+                self.aiChatView.reloadData()
+                self.aiTypeItemView.reloadData()
+                self.aiInfoInputView.reloadData()
+            }
+        }
+    }
+    
+    func aiProofreading() -> Void {
+        let chatModel = AIChatInfoModel.init()
+        chatModel.aiConfigType = .proofreading
+        chatModel.infoType = .chatStringResult
+        chatModel.uploadContent = self.aiInfoInputView.fileEmptyTextView.string
+        chatModel.chatInfoState = .stateLoading
+        AIChatInfoManager.defaultManager.modelsArrM.append(chatModel)
+        
+        self.aiChatView.reloadData()
+        
+        self.aiProofreadingWithModel(chatModel)
+    }
+    
+    func aiProofreadingWithModel(_ chatModel: AIChatInfoModel) -> Void {
+        AIChatInfoManager.defaultManager.isAILoading = true
+        
+        //MARK: TestData
+//        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 3) {
+//            DispatchQueue.main.async {
+//                chatModel.chatInfoState = .stateSuccess
+//                AIChatInfoManager.defaultManager.isAILoading = false
+//                chatModel.chatResult = "AI Proofreading 返回的结果"
+//                self.aiChatView.reloadData()
+//                self.aiTypeItemView.reloadData()
+//                self.aiInfoInputView.reloadData()
+//                
+//            }
+//        }
+        
+        //MARK: 正式数据
+        KMAIRequestServerManager.defaultManager.aiAction(content: chatModel.uploadContent,
+                                                         state: .correctTypos) { wrapper in
+            DispatchQueue.main.async {
+                AIChatInfoManager.defaultManager.isAILoading = false
+                let resultStr = wrapper.content
+                chatModel.chatResult = resultStr
+                chatModel.chatInfoState = wrapper.success ? .stateSuccess : .stateFailed
+
+                self.aiChatView.reloadData()
+                self.aiTypeItemView.reloadData()
+                self.aiInfoInputView.reloadData()
+            }
+        }
+    }
+    
+    func startAiTranslate() -> Void {
+        
+        let chatModel = AIChatInfoModel.init()
+        chatModel.aiConfigType = .translate
+        
+        if self.aiInfoInputView.filePath.isEmpty {
+            //文字
+            chatModel.infoType = .chatTranslateResult
+            chatModel.uploadContent = self.aiInfoInputView.fileEmptyTextView.string
+            chatModel.filePath = ""
+        } else {
+            //文件
+            chatModel.infoType = .chatTranslateResult
+            chatModel.filePath =  self.aiInfoInputView.filePath
+            chatModel.uploadContent = ""
+        }
+        chatModel.translateFromLanguage = self.aiInfoInputView.fromLanguage
+        chatModel.translateToLanguage = self.aiInfoInputView.toLanguage
+        chatModel.chatInfoState = .stateLoading
+        AIChatInfoManager.defaultManager.modelsArrM.append(chatModel)
+        
+        self.aiChatView.reloadData()
+        
+        self.startAiTranslateWithModel(chatModel)
+    }
+    
+    func startAiTranslateWithModel(_ chatModel: AIChatInfoModel) -> Void {
+        
+       //MARK: TestData
+//        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 3) {
+//            DispatchQueue.main.async {
+//                chatModel.chatInfoState = .stateInfoConfirm
+//                chatModel.chatResult = "当前翻译需要的内容:"
+//                self.aiChatView.reloadData()
+//                
+//            }
+//        }
+        
+        //MARK: Data
+        if chatModel.filePath.isEmpty == true {
+            //文字
+            AIChatInfoManager.defaultManager.isAILoading = true
+            KMAIRequestServerManager.defaultManager.aiAction(content: chatModel.uploadContent,
+                                                             state: .textTranslate,
+                                                             from: chatModel.translateFromLanguage,
+                                                             to: chatModel.translateToLanguage) { wrapper in
+                DispatchQueue.main.async {
+                    AIChatInfoManager.defaultManager.isAILoading = false
+                    
+                    let resultStr = wrapper.content
+                    chatModel.chatResult = resultStr
+                    chatModel.chatInfoState = wrapper.success ? .stateSuccess : .stateFailed
+                    
+                    self.aiChatView.reloadData()
+                    self.aiTypeItemView.reloadData()
+                    self.aiInfoInputView.reloadData()
+                }
+            };
+        } else {
+            //文件
+            AIChatInfoManager.defaultManager.isAILoading = true
+            KMAIRequestServerManager.defaultManager.aiAction(content: chatModel.filePath,
+                                                             state: .fileTranslate,
+                                                             from: chatModel.translateFromLanguage,
+                                                             to: chatModel.translateToLanguage) { wrapper in
+                DispatchQueue.main.async {
+                    AIChatInfoManager.defaultManager.isAILoading = false
+                    
+                    var success = wrapper.success
+                    let resultStr = wrapper.content
+                    if success == false && resultStr == "501" {
+                        success = true
+                    }
+                    if success {
+                        let infoDict: NSDictionary = wrapper.result
+                        var credit: Int = 0
+                        if infoDict["credit"] != nil {
+                            credit = (infoDict["credit"] ?? "0") as! Int
+                        }
+                        
+                        var charCount: Int = 0
+                        if infoDict["charCount"] != nil {
+                            charCount = (infoDict["charCount"] ?? "0") as! Int
+                        }
+                        
+                        chatModel.creditsValid = true
+                        if resultStr == "501" {
+                            chatModel.creditsValid = false
+                        }
+                        chatModel.costCredits = credit
+                        chatModel.totalChart = charCount
+                        chatModel.chatInfoState = .stateInfoConfirm
+                        chatModel.chatResult = resultStr
+                        
+                        self.aiChatView.reloadData()
+                        self.aiTypeItemView.reloadData()
+                        self.aiInfoInputView.reloadData()
+                        
+                    } else {
+                        chatModel.chatResult = resultStr
+                        chatModel.chatInfoState = .stateFailed
+                        
+                        self.aiChatView.reloadData()
+                        self.aiTypeItemView.reloadData()
+                        self.aiInfoInputView.reloadData()
+
+                    }
+                }
+            };
+        }
+        
+    }
+    
+    func continueAiTranslate(_ chatModel: AIChatInfoModel) -> Void {
+        //MARK: TestData
+//        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 3) {
+//            DispatchQueue.main.async {
+//                chatModel.chatInfoState = .stateSuccess
+//                chatModel.chatResult = "/Users/kdanmobile/Desktop/Quick Start Guide v1.3.0.pdf"
+//                self.aiChatView.reloadData()
+//                self.aiTypeItemView.reloadData()
+//                self.aiInfoInputView.reloadData()
+//                
+//            }
+//        }
+        
+        KMAIRequestServerManager.defaultManager.aiTranslationFileTranslateHandle(fileKey: chatModel.chatResult,
+                                                                                 from: chatModel.translateFromLanguage,
+                                                                                 to: chatModel.translateToLanguage) { wrapper in
+            DispatchQueue.main.async {
+                AIChatInfoManager.defaultManager.isAILoading = false
+                
+                let resultStr = wrapper.content
+                chatModel.chatResult = resultStr
+                chatModel.chatInfoState = wrapper.success ? .stateSuccess : .stateFailed
+                
+                self.aiChatView.reloadData()
+                self.aiTypeItemView.reloadData()
+                self.aiInfoInputView.reloadData()
+            }
+        }
+    }
+    
+    //MARK: AIInfoInputViewDelegate
+    func ai_InputViewDidChooseCurFile(aiInputView: AIInfoInputView) {        
+        guard let callBack = self.chooseCurFileHandle else {
+            return
+        }
+        callBack(self)
+        
+    }
+    
+    //MARK: NSWindowDelegate
+    func windowDidBecomeMain(_ notification: Notification) {
+        self.aiInfoInputView.reloadData()
+        
+    }
+    
+    func windowWillClose(_ notification: Notification) {
+        
+        AINewConfigWindowController.currentWindowController = nil
+    }
+    
+    @objc func themeChange() {
+        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3) {
+            self.refreshViewColor()
+        }
+    }
+}

+ 49 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AINewConfigWindowController.xib

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="AINewConfigWindowController" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <connections>
+                <outlet property="contendBox" destination="eLa-jx-b6j" id="c3h-oe-Fzp"/>
+                <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <window title="Window" separatorStyle="none" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" titlebarAppearsTransparent="YES" titleVisibility="hidden" id="F0z-JX-Cv5">
+            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
+            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+            <rect key="contentRect" x="196" y="240" width="276" height="739"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1512" height="944"/>
+            <value key="minSize" type="size" width="276" height="739"/>
+            <value key="maxSize" type="size" width="276" height="2739"/>
+            <view key="contentView" id="se5-gp-TjO">
+                <rect key="frame" x="0.0" y="0.0" width="276" height="739"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="eLa-jx-b6j">
+                        <rect key="frame" x="0.0" y="0.0" width="276" height="739"/>
+                        <view key="contentView" id="z1B-Yx-xJy">
+                            <rect key="frame" x="0.0" y="0.0" width="276" height="739"/>
+                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        </view>
+                    </box>
+                </subviews>
+                <constraints>
+                    <constraint firstAttribute="trailing" secondItem="eLa-jx-b6j" secondAttribute="trailing" id="MEm-kj-U4e"/>
+                    <constraint firstItem="eLa-jx-b6j" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="QTi-xg-y8b"/>
+                    <constraint firstItem="eLa-jx-b6j" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="SRB-A3-kbG"/>
+                    <constraint firstAttribute="bottom" secondItem="eLa-jx-b6j" secondAttribute="bottom" id="Z3v-uG-fBF"/>
+                </constraints>
+            </view>
+            <connections>
+                <outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
+            </connections>
+            <point key="canvasLocation" x="152" y="181"/>
+        </window>
+    </objects>
+</document>

+ 306 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/AIChatView.swift

@@ -0,0 +1,306 @@
+//
+//  AIChatView.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/17.
+//
+
+import Cocoa
+
+class AIChatView: NSView, NibLoadable {
+
+    @IBOutlet weak var contendView: NSView!
+    @IBOutlet weak var scrollView: NSScrollView!
+    @IBOutlet weak var collectionView: NSCollectionView!
+    
+    var chooseConfigHandle: ((_ view: AIChatView, _ clickType: AIConfigType) -> Void)?
+    
+    var cancelAIHandle: ((_ itemView: AIChatView, _ chatInfoModel: AIChatInfoModel) -> Void)?
+    var continueAITranslateHandle: ((_ itemView: AIChatView, _ chatInfoModel: AIChatInfoModel) -> Void)?
+    
+    var redoHandle: ((_ view: AIChatView, _ model: AIChatInfoModel) -> Void)?
+    
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+    override func layout() {
+        super.layout()
+        
+        self.collectionView.reloadData()
+    }
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        self.scrollView.backgroundColor = NSColor.clear
+        self.scrollView.drawsBackground = false
+        self.scrollView.scrollerStyle = .overlay
+        
+        self.collectionView.delegate = self
+        self.collectionView.dataSource = self
+        self.collectionView.backgroundColors = [NSColor.clear]
+        self.collectionView.wantsLayer = true
+        self.collectionView.layer?.backgroundColor = NSColor.clear.cgColor
+        
+        self.collectionView.register(AIChatDefaultTIpItem.self, forItemWithIdentifier: NSUserInterfaceItemIdentifier(rawValue: "AIChatDefaultTIpItemID"))
+        self.collectionView.register(AIChatStringResultItem.self, forItemWithIdentifier: NSUserInterfaceItemIdentifier(rawValue: "AIChatStringResultItemID"))
+        self.collectionView.register(AIChatFileInfoItem.self, forItemWithIdentifier: NSUserInterfaceItemIdentifier(rawValue: "AIChatFileInfoItemID"))
+        self.collectionView.register(AIChatStringUploadItem.self, forItemWithIdentifier: NSUserInterfaceItemIdentifier(rawValue: "AIChatStringUploadItemID"))
+        self.collectionView.register(AIChatTranslateResultItem.self, forItemWithIdentifier: NSUserInterfaceItemIdentifier(rawValue: "AIChatTranslateResultItemID"))
+        
+        
+    }
+    
+    func reloadData() {
+        self.collectionView.reloadData()
+        
+        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.15) {
+            let indexPath = Set([IndexPath(item: AIChatInfoManager.defaultManager.modelsArrM.count-1, section: 0)])
+            self.collectionView.scrollToItems(at: indexPath, scrollPosition: .bottom)
+        }
+        
+    }
+    
+    
+    
+    func sizeOfString(_ string: String, _ font: NSFont, _ width: CGFloat) -> (CGSize) {
+        
+        let paragraphStyle = NSMutableParagraphStyle()
+        paragraphStyle.lineBreakMode = .byWordWrapping
+        
+        let attributes: [NSAttributedString.Key: Any] = [
+            .font: font,
+            .paragraphStyle:paragraphStyle
+        ]
+        let size = (string as NSString).boundingRect(with: NSSize(width: width, height: CGFloat(MAXFLOAT)),
+                                                     options: .usesLineFragmentOrigin,
+                                                     attributes: attributes,
+                                                     context: nil).size
+        return size
+    }
+    
+}
+
+
+extension AIChatView: NSCollectionViewDelegate {
+    //当item被选中
+//    public func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set<IndexPath>) {
+//        print("点击")
+//        let view = collectionView.item(at: indexPaths.first!) as! KMAdvertisementCollectionViewItem
+//        
+//        let content = view.model
+//        
+//        guard let callBack = didSelect else { return }
+//        
+//        content?.index = indexPaths.first!.item
+//        callBack(self, content!)
+//    }
+//    
+//   //当item取消选中
+//    public func collectionView(_ collectionView: NSCollectionView, didDeselectItemsAt indexPaths: Set<IndexPath>) {
+//        _ = collectionView.item(at: indexPaths.first!) as! KMAdvertisementCollectionViewItem
+//    }
+}
+
+extension AIChatView: NSCollectionViewDataSource {
+    public func numberOfSections(in collectionView: NSCollectionView) -> Int {
+        return 1
+    }
+    
+    public func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int {
+        return AIChatInfoManager.defaultManager.modelsArrM.count
+    }
+    
+    //返回对应的item自定义个体
+    public func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
+
+        if indexPath.item > AIChatInfoManager.defaultManager.modelsArrM.count {
+            return NSCollectionViewItem()
+        }
+        let model = AIChatInfoManager.defaultManager.modelsArrM[indexPath.item]
+        
+        if model.infoType == .defaultTip {
+            let view = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "AIChatDefaultTIpItemID"), for: indexPath) as! AIChatDefaultTIpItem
+             
+            view.clickHandle = {[unowned self] view, configType in
+                guard let callBack = self.chooseConfigHandle else {
+                    return
+                }
+                callBack(self, configType)
+            }
+            view.reloadData()
+           
+            return view
+        } else if model.infoType == .chatFileUpload {
+            let view = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "AIChatFileInfoItemID"), for: indexPath) as! AIChatFileInfoItem
+            view.chatInfoModel = model
+            
+            view.reloadData()
+            return view
+        } else if model.infoType == .chatStringUpload{
+            let view = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "AIChatStringUploadItemID"), for: indexPath) as! AIChatStringUploadItem
+            view.chatInfoModel = model
+            
+            view.reloadData()
+            return view
+        } else if model.infoType == .chatStringResult {
+            let view = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "AIChatStringResultItemID"), for: indexPath) as! AIChatStringResultItem
+            view.chatInfoModel = model
+            view.redoHandle = {[unowned self] itemView, model in
+                guard let callBack = self.redoHandle else {
+                    return
+                }
+                callBack(self, itemView.chatInfoModel)
+            }
+            view.copyHandle = {[unowned self] itemView, model in
+                let pasteboard = NSPasteboard.general
+                pasteboard.clearContents()
+                pasteboard.setString(model.chatResult, forType: .string)
+                
+                let contextString = NSLocalizedString("Copy Successfully!", comment: "")
+                _ = CustomAlertView.alertView(message: contextString, fromView: self, withStyle: .black)
+            }
+            view.reloadData()
+            view.setUI()
+            view.refreshViewColor()
+            
+            return view
+        } else if model.infoType == .chatTranslateResult {
+            let view = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "AIChatTranslateResultItemID"), for: indexPath) as! AIChatTranslateResultItem
+            view.chatInfoModel = model
+            
+            view.reloadData()
+            view.cancelAIHandle = {[unowned self] itemView in
+                guard let callBack = self.cancelAIHandle else {
+                    return
+                }
+                callBack(self, view.chatInfoModel)
+            }
+            view.startAIHandle = {[unowned self] itemView in
+                guard let callBack = self.continueAITranslateHandle else {
+                    return
+                }
+                callBack(self, view.chatInfoModel)
+            }
+            
+            view.redoHandle = {[unowned self] itemView, model in
+                guard let callBack = self.redoHandle else {
+                    return
+                }
+                callBack(self, itemView.chatInfoModel)
+            }
+            view.copyHandle = {[unowned self] itemView, model in
+                let pasteboard = NSPasteboard.general
+                pasteboard.clearContents()
+                pasteboard.setString(model.chatResult, forType: .string)
+                
+                let contextString = NSLocalizedString("Copy Successfully!", comment: "")
+                _ = CustomAlertView.alertView(message: contextString, fromView: self, withStyle: .black)
+            }
+            view.setUI()
+            return view
+        }
+        
+        return NSCollectionViewItem()
+    }
+    
+    //    public func collectionView(_ collectionView: NSCollectionView, viewForSupplementaryElementOfKind kind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath) -> NSView {
+//        var nibName: String?
+//        var view = NSView()
+//        if kind == NSCollectionView.elementKindSectionHeader {
+//            nibName = "KMAdvertisementCollectionHeadView"
+//            
+//            view = collectionView.makeSupplementaryView(ofKind: kind, withIdentifier: NSUserInterfaceItemIdentifier(rawValue: nibName!), for: indexPath)
+//            if let view = view as? KMAdvertisementCollectionHeadView {
+//                let model = self.data[indexPath.section]
+//                view.model = model
+//            }
+//        } else if kind == NSCollectionView.elementKindSectionFooter {
+//            nibName = "KMAdvertisementCollectionHeadView"
+//            
+//            view = collectionView.makeSupplementaryView(ofKind: kind, withIdentifier: NSUserInterfaceItemIdentifier(rawValue: nibName!), for: indexPath)
+//        }
+//        return view
+//    }
+}
+
+extension AIChatView: NSCollectionViewDelegateFlowLayout {
+    
+    public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> NSSize {
+        if indexPath.item > AIChatInfoManager.defaultManager.modelsArrM.count {
+            return NSSize(width: 0.01, height: 0.01)
+        }
+        let model = AIChatInfoManager.defaultManager.modelsArrM[indexPath.item]
+        if model.infoType == .defaultTip {
+            return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 160)
+        } else if model.infoType == .chatFileUpload {
+            return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 64)
+        } else if model.infoType == .chatStringUpload {
+            let height = self.sizeOfString(model.uploadContent, NSFont.SFProTextRegularFont(14), 216).height
+            return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: height + 24)
+        } else if model.infoType == .chatStringResult {
+            if model.aiConfigType == .summarize ||
+                model.aiConfigType == .reWriting ||
+                model.aiConfigType == .proofreading {
+                
+                if model.chatInfoState == .stateSuccess {
+                    let height = self.sizeOfString(model.chatResult, NSFont.SFProTextRegularFont(14), 216).height
+                    return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 28+48+height)
+                } else if model.chatInfoState == .stateFailed {
+                    let height = self.sizeOfString(model.chatResult, NSFont.SFProTextRegularFont(13), 198).height
+                    return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 28+16+height)
+                }
+                return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 155+28)
+            }
+            return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 164)
+        } else if model.infoType == .chatTranslateResult {
+            if model.aiConfigType == .translate {
+                if model.chatInfoState == .stateLoading {
+                    return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 155+28)
+                } else if model.chatInfoState == .stateInfoConfirm {
+                    if model.creditsValid == true {
+                        return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 200)
+                    } else {
+                        return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 228)
+                    }
+                } else if model.chatInfoState == .stateCancel {
+                    return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 96)
+                } else if model.chatInfoState == .stateFailed {
+                    let height = self.sizeOfString(model.chatResult, NSFont.SFProTextRegularFont(13), 198).height
+                    return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 40+28+height)
+                } else if model.chatInfoState == .stateSuccess {
+                    if model.filePath.isEmpty == false {
+                        //文件
+                        return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 160)
+                    } else {
+                        //文字
+                        let height = self.sizeOfString(model.chatResult, NSFont.SFProTextRegularFont(13), 216).height
+                        return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 100+height)
+                    }
+                }
+            }
+            return NSSize(width: CGRectGetWidth(self.collectionView.frame), height: 155+28)
+        }
+        
+        return NSSize(width: 1, height: 1)
+    }
+    
+    public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> NSSize {
+        return NSSize(width: 0, height: 0.01)
+    }
+    
+    public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, referenceSizeForFooterInSection section: Int) -> NSSize {
+        return NSSize(width: 0, height: 0.01)
+    }
+    
+    public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
+        return 16
+    }
+    
+    public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, insetForSectionAt section: Int) -> NSEdgeInsets {
+        return NSEdgeInsetsMake(13, 0, 30, 0)
+    }
+}

+ 67 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/AIChatView.xib

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe" customClass="AIChatView" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="263" height="391"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="1EA-eD-6Eg">
+                    <rect key="frame" x="0.0" y="0.0" width="263" height="391"/>
+                    <subviews>
+                        <scrollView wantsLayer="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1NU-ln-1fk">
+                            <rect key="frame" x="0.0" y="0.0" width="263" height="391"/>
+                            <clipView key="contentView" id="7vE-Iz-MZi">
+                                <rect key="frame" x="0.0" y="0.0" width="263" height="391"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                <subviews>
+                                    <collectionView id="pvz-YR-x1O">
+                                        <rect key="frame" x="0.0" y="0.0" width="263" height="391"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
+                                        <collectionViewFlowLayout key="collectionViewLayout" minimumInteritemSpacing="10" minimumLineSpacing="10" id="aZD-7F-epL">
+                                            <size key="itemSize" width="50" height="50"/>
+                                        </collectionViewFlowLayout>
+                                        <color key="primaryBackgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </collectionView>
+                                </subviews>
+                            </clipView>
+                            <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="ltu-Rk-QMO">
+                                <rect key="frame" x="-100" y="-100" width="233" height="15"/>
+                                <autoresizingMask key="autoresizingMask"/>
+                            </scroller>
+                            <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="xjj-Dj-C2q">
+                                <rect key="frame" x="234" y="1" width="15" height="143"/>
+                                <autoresizingMask key="autoresizingMask"/>
+                            </scroller>
+                        </scrollView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstAttribute="trailing" secondItem="1NU-ln-1fk" secondAttribute="trailing" id="CCl-0E-nSo"/>
+                        <constraint firstItem="1NU-ln-1fk" firstAttribute="top" secondItem="1EA-eD-6Eg" secondAttribute="top" id="UR9-Tc-RdW"/>
+                        <constraint firstAttribute="bottom" secondItem="1NU-ln-1fk" secondAttribute="bottom" id="qdq-O7-PHI"/>
+                        <constraint firstItem="1NU-ln-1fk" firstAttribute="leading" secondItem="1EA-eD-6Eg" secondAttribute="leading" id="yf4-c4-vSP"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="1EA-eD-6Eg" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="C3H-5q-pLo"/>
+                <constraint firstAttribute="trailing" secondItem="1EA-eD-6Eg" secondAttribute="trailing" id="Y8r-GB-TH0"/>
+                <constraint firstItem="1EA-eD-6Eg" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="clM-ux-tr9"/>
+                <constraint firstAttribute="bottom" secondItem="1EA-eD-6Eg" secondAttribute="bottom" id="qlC-pr-Jo6"/>
+            </constraints>
+            <connections>
+                <outlet property="collectionView" destination="pvz-YR-x1O" id="8pP-kS-8lV"/>
+                <outlet property="contendView" destination="1EA-eD-6Eg" id="dVo-OI-rll"/>
+                <outlet property="scrollView" destination="1NU-ln-1fk" id="dJC-y3-9iF"/>
+            </connections>
+            <point key="canvasLocation" x="79.5" y="194.5"/>
+        </customView>
+    </objects>
+</document>

+ 152 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatDefaultTIpItem.swift

@@ -0,0 +1,152 @@
+//
+//  AIChatDefaultTIpItem.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/18.
+//
+
+import Cocoa
+
+class AIChatDefaultTIpItem: NSCollectionViewItem {
+
+    @IBOutlet weak var contendBox: NSBox!
+    
+    @IBOutlet weak var aiSummaryBox: NSBox!
+    @IBOutlet weak var aiSummaryLabel: NSTextField!
+    @IBOutlet weak var aiSummaryBtn: KMButton!
+    
+    @IBOutlet weak var aiRewritingBox: NSBox!
+    @IBOutlet weak var aiRewritingLabel: NSTextField!
+    @IBOutlet weak var aiRewritingBtn: KMButton!
+    
+    @IBOutlet weak var aiProofreadingBox: NSBox!
+    @IBOutlet weak var aiProofreadingLabel: NSTextField!
+    @IBOutlet weak var aiProofreadingBtn: KMButton!
+    
+    @IBOutlet weak var aiTranslateBox: NSBox!
+    @IBOutlet weak var aiTranslateLabel: NSTextField!
+    @IBOutlet weak var aiTranslateBtn: KMButton!
+    
+    var clickHandle: ((_ view: AIChatDefaultTIpItem, _ clickType: AIConfigType) -> Void)?
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+        
+        self.contendBox.cornerRadius = 6
+        self.contendBox.borderWidth = 0.5
+  
+        
+        self.aiSummaryLabel.stringValue = NSLocalizedString("AI Summarize", comment: "")
+        self.aiRewritingLabel.stringValue = NSLocalizedString("AI Rewrite", comment: "")
+        self.aiProofreadingLabel.stringValue = NSLocalizedString("AI Proofread", comment: "")
+        self.aiTranslateLabel.stringValue = NSLocalizedString("AI Translate", comment: "")
+
+        self.aiSummaryLabel.font = NSFont.SFProTextRegularFont(13)
+        self.aiRewritingLabel.font = NSFont.SFProTextRegularFont(13)
+        self.aiProofreadingLabel.font = NSFont.SFProTextRegularFont(13)
+        self.aiTranslateLabel.font = NSFont.SFProTextRegularFont(13)
+        
+        self.aiSummaryLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        self.aiRewritingLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        self.aiProofreadingLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        self.aiTranslateLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        
+        self.aiSummaryBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered && self.aiSummaryBtn.isEnabled {
+                if KMAppearance.isDarkMode() {
+                    self.aiSummaryLabel.textColor = NSColor(red: 85/255, green: 245/255, blue: 1, alpha: 1)
+                } else {
+                    self.aiSummaryLabel.textColor = NSColor(red: 0, green: 209/255, blue: 222/255, alpha: 1)
+                }
+            } else {
+                self.aiSummaryLabel.textColor = KMAppearance.KMColor_Layout_H0()
+            }
+        }
+        
+        self.aiRewritingBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered && self.aiRewritingBtn.isEnabled {
+                if KMAppearance.isDarkMode() {
+                    self.aiRewritingLabel.textColor = NSColor(red: 255/255, green: 105/255, blue: 195/255, alpha: 1)
+                } else {
+                    self.aiRewritingLabel.textColor = NSColor(red: 240/255, green: 28/255, blue: 155/255, alpha: 1)
+                }
+            } else {
+                self.aiRewritingLabel.textColor = KMAppearance.KMColor_Layout_H0()
+            }
+        }
+        
+        self.aiProofreadingBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered && self.aiProofreadingBtn.isEnabled{
+                if KMAppearance.isDarkMode() {
+                    self.aiProofreadingLabel.textColor = NSColor(red: 194/255, green: 157/255, blue: 1, alpha: 1)
+                } else {
+                    self.aiProofreadingLabel.textColor = NSColor(red: 108/255, green: 28/255, blue: 240/255, alpha: 1)
+                }
+            } else {
+                self.aiProofreadingLabel.textColor = KMAppearance.KMColor_Layout_H0()
+            }
+        }
+        
+        self.aiTranslateBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered && self.aiTranslateBtn.isEnabled{
+                if KMAppearance.isDarkMode() {
+                    self.aiTranslateLabel.textColor = NSColor(red: 255/255, green: 152/255, blue: 77/255, alpha: 1)
+                } else {
+                    self.aiTranslateLabel.textColor = NSColor(red: 240/255, green: 101/255, blue: 0, alpha: 1)
+                }
+            } else {
+                self.aiTranslateLabel.textColor = KMAppearance.KMColor_Layout_H0()
+            }
+        }
+     
+        self.refreshViewColor()
+        
+    }
+    
+    func refreshViewColor() {
+        if KMAppearance.isDarkMode() {
+            self.contendBox.borderColor = NSColor.white.withAlphaComponent(0.1)
+            self.contendBox.fillColor = KMAppearance.KMColor_Layout_L_1()
+        } else {
+            self.contendBox.borderColor = NSColor.black.withAlphaComponent(0.05)
+            self.contendBox.fillColor = NSColor.black.withAlphaComponent(0.03)
+        }
+    }
+    
+    func reloadData() {
+        if AIChatInfoManager.defaultManager.isAILoading {
+            self.aiSummaryBtn.isEnabled = false
+            self.aiRewritingBtn.isEnabled = false
+            self.aiProofreadingBtn.isEnabled = false
+            self.aiTranslateBtn.isEnabled = false
+        } else {
+            self.aiSummaryBtn.isEnabled = true
+            self.aiRewritingBtn.isEnabled = true
+            self.aiProofreadingBtn.isEnabled = true
+            self.aiTranslateBtn.isEnabled = true
+        }
+        
+    }
+    
+    //MARK: IBAction
+    @IBAction func typeSelectAction(_ sender: NSButton) {
+        var configType: AIConfigType = .none
+        if sender == self.aiSummaryBtn {
+            configType = .summarize
+        } else if sender == self.aiRewritingBtn {
+            configType = .reWriting
+        } else if sender == self.aiProofreadingBtn {
+            configType = .proofreading
+        } else if sender == self.aiTranslateBtn {
+            configType = .translate
+        }
+        
+        guard let callBack = self.clickHandle else {
+            return
+        }
+        callBack(self, configType)
+    }
+    
+    
+}

+ 278 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatDefaultTIpItem.xib

@@ -0,0 +1,278 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="AIChatDefaultTIpItem" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <connections>
+                <outlet property="aiProofreadingBox" destination="dFh-N7-bCa" id="2BL-B4-tXS"/>
+                <outlet property="aiProofreadingBtn" destination="Srg-Oi-MfD" id="1D6-Q3-BcX"/>
+                <outlet property="aiProofreadingLabel" destination="4IT-Vu-4sI" id="Cgv-hf-QCd"/>
+                <outlet property="aiRewritingBox" destination="290-i6-brT" id="Ob3-dg-Fkl"/>
+                <outlet property="aiRewritingBtn" destination="l1U-oQ-hLS" id="JXU-cN-CAL"/>
+                <outlet property="aiRewritingLabel" destination="IHp-x2-iPQ" id="HCT-VB-nSS"/>
+                <outlet property="aiSummaryBox" destination="u2z-GN-8GG" id="9dk-0s-sdI"/>
+                <outlet property="aiSummaryBtn" destination="Xnx-oa-DCQ" id="jou-F4-pah"/>
+                <outlet property="aiSummaryLabel" destination="Xzu-NP-f0o" id="Brv-0P-Gud"/>
+                <outlet property="aiTranslateBox" destination="Dcy-2B-URg" id="fxJ-WO-bC4"/>
+                <outlet property="aiTranslateBtn" destination="bVI-CK-Zc3" id="b66-Px-Gqn"/>
+                <outlet property="aiTranslateLabel" destination="ulp-3u-Au7" id="enY-YC-STa"/>
+                <outlet property="contendBox" destination="kAF-ZL-SO6" id="bwW-2Y-yfN"/>
+                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="Hz6-mo-xeY">
+            <rect key="frame" x="0.0" y="0.0" width="276" height="160"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="B30-Ox-YqX">
+                    <rect key="frame" x="0.0" y="0.0" width="276" height="160"/>
+                    <subviews>
+                        <box boxType="custom" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="kAF-ZL-SO6">
+                            <rect key="frame" x="13" y="0.0" width="240" height="160"/>
+                            <view key="contentView" id="dSk-RX-TnD">
+                                <rect key="frame" x="1" y="1" width="238" height="158"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                <subviews>
+                                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="u2z-GN-8GG">
+                                        <rect key="frame" x="16" y="122" width="222" height="20"/>
+                                        <view key="contentView" id="zip-QG-1sZ">
+                                            <rect key="frame" x="0.0" y="0.0" width="222" height="20"/>
+                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                            <subviews>
+                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="zgJ-TF-fRN">
+                                                    <rect key="frame" x="0.0" y="0.0" width="20" height="20"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="20" id="MCH-Mi-Oe4"/>
+                                                        <constraint firstAttribute="height" constant="20" id="Pfd-Jz-deb"/>
+                                                    </constraints>
+                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="AISummarize" id="JEo-gc-hnb"/>
+                                                </imageView>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Xzu-NP-f0o">
+                                                    <rect key="frame" x="30" y="2" width="88" height="16"/>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" title="AI Summarize" id="6oc-ez-PPz">
+                                                        <font key="font" metaFont="system"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Xnx-oa-DCQ" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                                    <rect key="frame" x="0.0" y="0.0" width="222" height="20"/>
+                                                    <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="LUz-xn-Z4P">
+                                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                        <font key="font" metaFont="system"/>
+                                                    </buttonCell>
+                                                    <connections>
+                                                        <action selector="typeSelectAction:" target="-2" id="Dx8-gs-0Ai"/>
+                                                    </connections>
+                                                </button>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="bottom" secondItem="Xnx-oa-DCQ" secondAttribute="bottom" id="05k-Cx-YOS"/>
+                                                <constraint firstItem="zgJ-TF-fRN" firstAttribute="top" secondItem="zip-QG-1sZ" secondAttribute="top" id="5Xj-pB-RJ2"/>
+                                                <constraint firstItem="Xnx-oa-DCQ" firstAttribute="leading" secondItem="zip-QG-1sZ" secondAttribute="leading" id="9wW-yM-Mt8"/>
+                                                <constraint firstItem="Xzu-NP-f0o" firstAttribute="leading" secondItem="zgJ-TF-fRN" secondAttribute="trailing" constant="12" id="AQd-hy-hSY"/>
+                                                <constraint firstAttribute="trailing" secondItem="Xnx-oa-DCQ" secondAttribute="trailing" id="dzm-oC-mut"/>
+                                                <constraint firstItem="Xzu-NP-f0o" firstAttribute="centerY" secondItem="zip-QG-1sZ" secondAttribute="centerY" id="qGQ-MF-Uzr"/>
+                                                <constraint firstItem="zgJ-TF-fRN" firstAttribute="leading" secondItem="zip-QG-1sZ" secondAttribute="leading" id="stV-H2-7o3"/>
+                                                <constraint firstItem="Xnx-oa-DCQ" firstAttribute="top" secondItem="zip-QG-1sZ" secondAttribute="top" id="ub3-IA-MDN"/>
+                                            </constraints>
+                                        </view>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="0xx-iq-FyU"/>
+                                        </constraints>
+                                    </box>
+                                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="290-i6-brT">
+                                        <rect key="frame" x="16" y="86" width="222" height="20"/>
+                                        <view key="contentView" id="4nh-8z-Diu">
+                                            <rect key="frame" x="0.0" y="0.0" width="222" height="20"/>
+                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                            <subviews>
+                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="cPd-5N-TWy">
+                                                    <rect key="frame" x="0.0" y="0.0" width="20" height="20"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="20" id="NWE-pB-Sx4"/>
+                                                        <constraint firstAttribute="height" constant="20" id="jqe-NM-JhO"/>
+                                                    </constraints>
+                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="AIRewriting" id="aWC-4W-AdM"/>
+                                                </imageView>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IHp-x2-iPQ">
+                                                    <rect key="frame" x="30" y="2" width="77" height="16"/>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" title="AI Rewriting" id="ZRa-yW-Xtw">
+                                                        <font key="font" metaFont="system"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="l1U-oQ-hLS" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                                    <rect key="frame" x="0.0" y="0.0" width="222" height="20"/>
+                                                    <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="ccR-v6-nrQ">
+                                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                        <font key="font" metaFont="system"/>
+                                                    </buttonCell>
+                                                    <connections>
+                                                        <action selector="typeSelectAction:" target="-2" id="hes-tg-5Jy"/>
+                                                    </connections>
+                                                </button>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="trailing" secondItem="l1U-oQ-hLS" secondAttribute="trailing" id="6Hc-iP-9sN"/>
+                                                <constraint firstItem="cPd-5N-TWy" firstAttribute="top" secondItem="4nh-8z-Diu" secondAttribute="top" id="77X-3Q-JJg"/>
+                                                <constraint firstItem="cPd-5N-TWy" firstAttribute="leading" secondItem="4nh-8z-Diu" secondAttribute="leading" id="DPQ-Lg-dOd"/>
+                                                <constraint firstItem="l1U-oQ-hLS" firstAttribute="leading" secondItem="4nh-8z-Diu" secondAttribute="leading" id="ILW-G5-ZgF"/>
+                                                <constraint firstItem="IHp-x2-iPQ" firstAttribute="centerY" secondItem="4nh-8z-Diu" secondAttribute="centerY" id="Rey-Id-gEM"/>
+                                                <constraint firstAttribute="bottom" secondItem="l1U-oQ-hLS" secondAttribute="bottom" id="iMl-F2-nWG"/>
+                                                <constraint firstItem="l1U-oQ-hLS" firstAttribute="top" secondItem="4nh-8z-Diu" secondAttribute="top" id="ilA-zA-aMF"/>
+                                                <constraint firstItem="IHp-x2-iPQ" firstAttribute="leading" secondItem="cPd-5N-TWy" secondAttribute="trailing" constant="12" id="jJ4-GN-dhY"/>
+                                            </constraints>
+                                        </view>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="uBY-fc-y6A"/>
+                                        </constraints>
+                                    </box>
+                                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="dFh-N7-bCa">
+                                        <rect key="frame" x="16" y="50" width="222" height="20"/>
+                                        <view key="contentView" id="7Nw-pa-mbW">
+                                            <rect key="frame" x="0.0" y="0.0" width="222" height="20"/>
+                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                            <subviews>
+                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Gb3-oi-Esd">
+                                                    <rect key="frame" x="0.0" y="0.0" width="20" height="20"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="20" id="gg7-ka-kot"/>
+                                                        <constraint firstAttribute="width" constant="20" id="pGl-tN-vTp"/>
+                                                    </constraints>
+                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="AIProofreading" id="HaO-F0-Ivu"/>
+                                                </imageView>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4IT-Vu-4sI">
+                                                    <rect key="frame" x="30" y="2" width="98" height="16"/>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" title="AI Proofreading" id="500-ZA-pgN">
+                                                        <font key="font" metaFont="system"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Srg-Oi-MfD" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                                    <rect key="frame" x="0.0" y="0.0" width="222" height="20"/>
+                                                    <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="I3g-YU-6zW">
+                                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                        <font key="font" metaFont="system"/>
+                                                    </buttonCell>
+                                                    <connections>
+                                                        <action selector="typeSelectAction:" target="-2" id="y3N-zu-cxB"/>
+                                                    </connections>
+                                                </button>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="Gb3-oi-Esd" firstAttribute="leading" secondItem="7Nw-pa-mbW" secondAttribute="leading" id="004-uk-064"/>
+                                                <constraint firstAttribute="trailing" secondItem="Srg-Oi-MfD" secondAttribute="trailing" id="98x-8f-y1q"/>
+                                                <constraint firstItem="Srg-Oi-MfD" firstAttribute="top" secondItem="7Nw-pa-mbW" secondAttribute="top" id="9tK-B7-nMt"/>
+                                                <constraint firstItem="Srg-Oi-MfD" firstAttribute="leading" secondItem="7Nw-pa-mbW" secondAttribute="leading" id="PDv-CL-pFg"/>
+                                                <constraint firstAttribute="bottom" secondItem="Srg-Oi-MfD" secondAttribute="bottom" id="Wbh-qa-eKw"/>
+                                                <constraint firstItem="Gb3-oi-Esd" firstAttribute="top" secondItem="7Nw-pa-mbW" secondAttribute="top" id="WcY-nk-WCx"/>
+                                                <constraint firstItem="4IT-Vu-4sI" firstAttribute="leading" secondItem="Gb3-oi-Esd" secondAttribute="trailing" constant="12" id="ZJ0-I0-SB0"/>
+                                                <constraint firstItem="4IT-Vu-4sI" firstAttribute="centerY" secondItem="7Nw-pa-mbW" secondAttribute="centerY" id="njr-fn-eAX"/>
+                                            </constraints>
+                                        </view>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="wMi-bZ-xbp"/>
+                                        </constraints>
+                                    </box>
+                                    <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Dcy-2B-URg">
+                                        <rect key="frame" x="16" y="14" width="222" height="20"/>
+                                        <view key="contentView" id="rwV-eS-faJ">
+                                            <rect key="frame" x="0.0" y="0.0" width="222" height="20"/>
+                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                            <subviews>
+                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ZKj-69-IAe">
+                                                    <rect key="frame" x="0.0" y="0.0" width="20" height="20"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="20" id="Aem-Gu-GtS"/>
+                                                        <constraint firstAttribute="height" constant="20" id="lhp-uU-ru2"/>
+                                                    </constraints>
+                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="AITranslate" id="7k0-6G-JMY"/>
+                                                </imageView>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ulp-3u-Au7">
+                                                    <rect key="frame" x="30" y="2" width="174" height="16"/>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" title="AI Translate" id="7pW-KZ-qqS">
+                                                        <font key="font" metaFont="system"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bVI-CK-Zc3" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                                    <rect key="frame" x="0.0" y="0.0" width="222" height="20"/>
+                                                    <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="tj2-dd-l2h">
+                                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                        <font key="font" metaFont="system"/>
+                                                    </buttonCell>
+                                                    <connections>
+                                                        <action selector="typeSelectAction:" target="-2" id="fqN-nX-ELt"/>
+                                                    </connections>
+                                                </button>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="bottom" secondItem="bVI-CK-Zc3" secondAttribute="bottom" id="8B0-fF-gXN"/>
+                                                <constraint firstAttribute="trailing" secondItem="ulp-3u-Au7" secondAttribute="trailing" constant="20" id="Eua-xl-ICS"/>
+                                                <constraint firstItem="ZKj-69-IAe" firstAttribute="leading" secondItem="rwV-eS-faJ" secondAttribute="leading" id="GP6-yE-WEY"/>
+                                                <constraint firstItem="bVI-CK-Zc3" firstAttribute="top" secondItem="rwV-eS-faJ" secondAttribute="top" id="Maq-yG-cH3"/>
+                                                <constraint firstItem="bVI-CK-Zc3" firstAttribute="leading" secondItem="rwV-eS-faJ" secondAttribute="leading" id="Uwi-Tq-qXn"/>
+                                                <constraint firstAttribute="trailing" secondItem="bVI-CK-Zc3" secondAttribute="trailing" id="eat-Fk-tA4"/>
+                                                <constraint firstItem="ulp-3u-Au7" firstAttribute="leading" secondItem="ZKj-69-IAe" secondAttribute="trailing" constant="12" id="pKc-j6-WSh"/>
+                                                <constraint firstItem="ulp-3u-Au7" firstAttribute="centerY" secondItem="rwV-eS-faJ" secondAttribute="centerY" id="v09-kC-aMc"/>
+                                                <constraint firstItem="ZKj-69-IAe" firstAttribute="top" secondItem="rwV-eS-faJ" secondAttribute="top" id="vhL-gX-UV4"/>
+                                            </constraints>
+                                        </view>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="5oD-8H-mff"/>
+                                        </constraints>
+                                    </box>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="290-i6-brT" firstAttribute="top" secondItem="u2z-GN-8GG" secondAttribute="bottom" constant="16" id="E19-IM-rcx"/>
+                                    <constraint firstItem="u2z-GN-8GG" firstAttribute="leading" secondItem="dSk-RX-TnD" secondAttribute="leading" constant="16" id="GDb-GQ-gVL"/>
+                                    <constraint firstAttribute="trailing" secondItem="Dcy-2B-URg" secondAttribute="trailing" id="IeM-Gq-4Mn"/>
+                                    <constraint firstItem="Dcy-2B-URg" firstAttribute="top" secondItem="dFh-N7-bCa" secondAttribute="bottom" constant="16" id="Ooi-Bn-amE"/>
+                                    <constraint firstAttribute="trailing" secondItem="290-i6-brT" secondAttribute="trailing" id="P9v-ew-Jvn"/>
+                                    <constraint firstItem="Dcy-2B-URg" firstAttribute="leading" secondItem="dSk-RX-TnD" secondAttribute="leading" constant="16" id="Ri5-0B-uko"/>
+                                    <constraint firstItem="dFh-N7-bCa" firstAttribute="leading" secondItem="dSk-RX-TnD" secondAttribute="leading" constant="16" id="Trj-x4-XSe"/>
+                                    <constraint firstItem="u2z-GN-8GG" firstAttribute="top" secondItem="dSk-RX-TnD" secondAttribute="top" constant="16" id="mAu-Pa-DqV"/>
+                                    <constraint firstAttribute="trailing" secondItem="u2z-GN-8GG" secondAttribute="trailing" id="nE4-kt-iCq"/>
+                                    <constraint firstItem="290-i6-brT" firstAttribute="leading" secondItem="dSk-RX-TnD" secondAttribute="leading" constant="16" id="pFg-Vo-bOo"/>
+                                    <constraint firstItem="dFh-N7-bCa" firstAttribute="top" secondItem="290-i6-brT" secondAttribute="bottom" constant="16" id="pkw-d6-D8Y"/>
+                                    <constraint firstAttribute="trailing" secondItem="dFh-N7-bCa" secondAttribute="trailing" id="u80-bo-MfY"/>
+                                </constraints>
+                            </view>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="240" id="GuW-O1-Jds"/>
+                            </constraints>
+                        </box>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="kAF-ZL-SO6" firstAttribute="top" secondItem="B30-Ox-YqX" secondAttribute="top" id="1fj-jC-BIK"/>
+                        <constraint firstAttribute="bottom" secondItem="kAF-ZL-SO6" secondAttribute="bottom" id="Ya7-nc-VOX"/>
+                        <constraint firstItem="kAF-ZL-SO6" firstAttribute="leading" secondItem="B30-Ox-YqX" secondAttribute="leading" constant="13" id="nVQ-rI-vZB"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstAttribute="bottom" secondItem="B30-Ox-YqX" secondAttribute="bottom" id="95v-Ob-ymH"/>
+                <constraint firstItem="B30-Ox-YqX" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="bmd-tp-Cmf"/>
+                <constraint firstAttribute="trailing" secondItem="B30-Ox-YqX" secondAttribute="trailing" id="jkg-JC-2zD"/>
+                <constraint firstItem="B30-Ox-YqX" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="oZ7-Pn-38l"/>
+            </constraints>
+            <point key="canvasLocation" x="3.5" y="84"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="AIProofreading" width="20" height="20"/>
+        <image name="AIRewriting" width="20" height="20"/>
+        <image name="AISummarize" width="20" height="20"/>
+        <image name="AITranslate" width="21" height="20"/>
+    </resources>
+</document>

+ 98 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatFileInfoItem.swift

@@ -0,0 +1,98 @@
+//
+//  AIChatFileInfoItem.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/18.
+//
+//AI聊天输入文件类型
+
+import Cocoa
+import PDFKit
+
+class AIChatFileInfoItem: NSCollectionViewItem {
+
+    @IBOutlet weak var contendView: NSView!
+    
+    @IBOutlet weak var fileContendView: NSView!
+    
+    @IBOutlet weak var fileTypeImage: NSImageView!
+    @IBOutlet weak var fileNameLabel: NSTextField!
+    @IBOutlet weak var fileSizeLabel: NSTextField!
+    @IBOutlet weak var filePageCountLabel: NSTextField!
+    
+    var rightCornerView: RightTopRoundedRectView!
+    var chatInfoModel: AIChatInfoModel!
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+        
+        
+        rightCornerView = RightTopRoundedRectView.init(frame: self.fileContendView.bounds)
+        rightCornerView.autoresizingMask = [.width, .height]
+        self.fileContendView.addSubview(self.rightCornerView, positioned: .above, relativeTo: self.fileTypeImage)
+        
+        self.fileNameLabel.font = NSFont.SFProTextRegularFont(14)
+         
+        self.fileSizeLabel.font = NSFont.SFProTextRegularFont(12)
+         
+        self.filePageCountLabel.font = NSFont.SFProTextRegularFont(12)
+        
+        self.setUI()
+    }
+    
+    func setUI() {
+        if KMAppearance.isDarkMode() {
+            self.rightCornerView.fillColor = NSColor(red: 201/255.0, green: 218/255.0, blue: 247/255.0, alpha: 0.05)
+            self.rightCornerView.lineColor = NSColor(red: 201/255.0, green: 218/255.0, blue: 247/255.0, alpha: 0.15)
+            self.rightCornerView.display()
+        } else {
+            self.rightCornerView.fillColor = NSColor(red: 201/255.0, green: 218/255.0, blue: 247/255.0, alpha: 0.1)
+            self.rightCornerView.lineColor = NSColor(red: 201/255.0, green: 218/255.0, blue: 247/255.0, alpha: 1)
+            self.rightCornerView.display()
+        }
+        self.fileSizeLabel.textColor = KMAppearance.KMColor_Layout_H1()
+        self.fileNameLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        self.filePageCountLabel.textColor = KMAppearance.KMColor_Layout_H1()
+        
+    }
+    
+    func reloadData() {
+        guard let model = self.chatInfoModel else {
+            return
+        }
+        if self.chatInfoModel.filePath.isEmpty == true {
+            return
+        }
+        let filePath = model.filePath
+        let filePathURL = URL(fileURLWithPath: filePath)
+        self.fileNameLabel.stringValue = filePathURL.lastPathComponent
+        self.fileSizeLabel.stringValue = self.fileSizeString(Float(self.getFileSize(atPath: filePath)))
+        
+        if let document = PDFDocument(url: URL(fileURLWithPath: filePath)) {
+            self.filePageCountLabel.stringValue = String(format: "%d ", document.pageCount) + NSLocalizedString("Page", comment: "")
+            if document.pageCount > 1 {
+                self.filePageCountLabel.stringValue = String(format: "%d ", document.pageCount) + NSLocalizedString("Pages", comment: "")
+            }
+        } else {
+            self.filePageCountLabel.stringValue = ""
+        }
+        
+        
+    }
+    
+    func getFileSize(atPath filePath : String) -> CGFloat {
+        guard let dict = try? FileManager.default.attributesOfItem(atPath: filePath) as NSDictionary else {
+            return 0
+        }
+        return CGFloat(dict.fileSize())
+    }
+    
+    func fileSizeString(_ fSize: Float) -> String {
+        let fileSize = fSize / 1024
+        let size = fileSize >= 1024 ? (fileSize < 1048576 ? fileSize/1024 : fileSize/1048576.0) : fileSize
+        let unit = fileSize >= 1024 ? (fileSize < 1048576 ? "M" : "G") : "K"
+        return String(format: "%0.1f %@", size, unit)
+    }
+    
+}

+ 100 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatFileInfoItem.xib

@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="AIChatFileInfoItem" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <connections>
+                <outlet property="contendView" destination="bNs-2R-JfH" id="ZfS-lP-vWE"/>
+                <outlet property="fileContendView" destination="kip-Ll-p6T" id="406-gj-V9j"/>
+                <outlet property="fileNameLabel" destination="FwQ-E0-5A8" id="DRg-v8-hBg"/>
+                <outlet property="filePageCountLabel" destination="W3L-5S-i1r" id="iRM-eO-V0F"/>
+                <outlet property="fileSizeLabel" destination="Rfi-N9-FsU" id="P0S-8Z-e44"/>
+                <outlet property="fileTypeImage" destination="Im9-Lz-pr5" id="hJy-VT-BZJ"/>
+                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="Hz6-mo-xeY">
+            <rect key="frame" x="0.0" y="0.0" width="276" height="64"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="bNs-2R-JfH">
+                    <rect key="frame" x="0.0" y="0.0" width="276" height="64"/>
+                    <subviews>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="kip-Ll-p6T">
+                            <rect key="frame" x="13" y="0.0" width="240" height="64"/>
+                            <subviews>
+                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Im9-Lz-pr5">
+                                    <rect key="frame" x="12" y="16" width="32" height="32"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="32" id="QIV-CQ-ckS"/>
+                                        <constraint firstAttribute="height" constant="32" id="yni-cl-4wU"/>
+                                    </constraints>
+                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ic_propertybar_file_pdf" id="op2-dH-Zik"/>
+                                </imageView>
+                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="FwQ-E0-5A8">
+                                    <rect key="frame" x="50" y="35" width="172" height="16"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="168" id="9nd-xg-S3g"/>
+                                    </constraints>
+                                    <textFieldCell key="cell" lineBreakMode="truncatingMiddle" title="Label" id="i5T-8F-zp5">
+                                        <font key="font" metaFont="system"/>
+                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Rfi-N9-FsU">
+                                    <rect key="frame" x="50" y="15" width="37" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="8he-Zy-wzG">
+                                        <font key="font" metaFont="system"/>
+                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="W3L-5S-i1r">
+                                    <rect key="frame" x="91" y="15" width="37" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="aFV-MK-RzB">
+                                        <font key="font" metaFont="system"/>
+                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="Rfi-N9-FsU" firstAttribute="leading" secondItem="Im9-Lz-pr5" secondAttribute="trailing" constant="8" id="HXK-XW-pGG"/>
+                                <constraint firstItem="W3L-5S-i1r" firstAttribute="top" secondItem="FwQ-E0-5A8" secondAttribute="bottom" constant="4" id="JNg-IS-637"/>
+                                <constraint firstItem="Im9-Lz-pr5" firstAttribute="centerY" secondItem="kip-Ll-p6T" secondAttribute="centerY" id="Npv-uU-Gvu"/>
+                                <constraint firstItem="Rfi-N9-FsU" firstAttribute="top" secondItem="FwQ-E0-5A8" secondAttribute="bottom" constant="4" id="Rwd-Mz-5W5"/>
+                                <constraint firstItem="FwQ-E0-5A8" firstAttribute="top" secondItem="Im9-Lz-pr5" secondAttribute="top" constant="-3" id="VMH-wJ-H2T"/>
+                                <constraint firstItem="Im9-Lz-pr5" firstAttribute="leading" secondItem="kip-Ll-p6T" secondAttribute="leading" constant="12" id="eeV-1e-eHY"/>
+                                <constraint firstItem="FwQ-E0-5A8" firstAttribute="leading" secondItem="Im9-Lz-pr5" secondAttribute="trailing" constant="8" id="lNf-m6-DhM"/>
+                                <constraint firstItem="W3L-5S-i1r" firstAttribute="leading" secondItem="Rfi-N9-FsU" secondAttribute="trailing" constant="8" id="puv-Gz-P9f"/>
+                                <constraint firstAttribute="width" constant="240" id="tSc-OV-SMU"/>
+                            </constraints>
+                        </customView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstAttribute="bottom" secondItem="kip-Ll-p6T" secondAttribute="bottom" id="2NS-ul-Tjo"/>
+                        <constraint firstItem="kip-Ll-p6T" firstAttribute="top" secondItem="bNs-2R-JfH" secondAttribute="top" id="Mg4-wY-D6H"/>
+                        <constraint firstItem="kip-Ll-p6T" firstAttribute="leading" secondItem="bNs-2R-JfH" secondAttribute="leading" constant="13" id="sQi-aH-GzS"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="bNs-2R-JfH" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="2cX-YF-Qpa"/>
+                <constraint firstAttribute="bottom" secondItem="bNs-2R-JfH" secondAttribute="bottom" id="3i6-50-bKh"/>
+                <constraint firstAttribute="trailing" secondItem="bNs-2R-JfH" secondAttribute="trailing" id="6D8-3N-XZV"/>
+                <constraint firstItem="bNs-2R-JfH" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="O1q-jQ-0Xn"/>
+            </constraints>
+            <point key="canvasLocation" x="35" y="27"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="ic_propertybar_file_pdf" width="32" height="32"/>
+    </resources>
+</document>

+ 357 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatStringResultItem.swift

@@ -0,0 +1,357 @@
+//
+//  AIChatStringResultItem.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/18.
+//
+
+import Cocoa
+
+class AIChatStringResultItem: NSCollectionViewItem {
+
+    @IBOutlet weak var contendView: NSView!
+    
+    @IBOutlet weak var infoContendView: NSView!
+    
+    @IBOutlet weak var reWriteBtn: KMButton!
+    @IBOutlet weak var resultCopyBtn: KMButton!
+    @IBOutlet weak var resultSaveBtn: KMButton!
+    @IBOutlet weak var sepImage1: NSImageView!
+    @IBOutlet weak var sepImage2: NSImageView!
+    
+    @IBOutlet weak var resultBox: NSBox!
+    @IBOutlet weak var resultTitleLabel: NSTextField!
+    @IBOutlet weak var resultInfoLabel: NSTextField!
+    
+    @IBOutlet weak var loadingContendView: NSView!
+    @IBOutlet weak var loadingIndicator: NSProgressIndicator!
+    
+    @IBOutlet weak var errorInfoView: NSView!
+    @IBOutlet weak var errorTipLabel: NSTextField!
+    
+    var infoCornerView: LeftTopRoundedRectView!
+    var loadingCornerView: LeftTopRoundedRectView!
+    
+    var chatInfoModel: AIChatInfoModel!
+    
+    var redoHandle: ((_ view: AIChatStringResultItem, _ model: AIChatInfoModel) -> Void)?
+    var copyHandle: ((_ view: AIChatStringResultItem, _ model: AIChatInfoModel) -> Void)?
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+        
+        self.reWriteBtn.title = NSLocalizedString("Redo", comment: "")
+        self.resultCopyBtn.title = NSLocalizedString("Copy", comment: "")
+        self.resultSaveBtn.title = NSLocalizedString("Save as", comment: "")
+        
+        self.reWriteBtn.toolTip = NSLocalizedString("Redo", comment: "")
+        self.resultCopyBtn.toolTip = NSLocalizedString("Copy", comment: "")
+        self.resultSaveBtn.toolTip = NSLocalizedString("Save as", comment: "")
+        
+        self.infoCornerView = LeftTopRoundedRectView.init(frame: self.resultBox.bounds)
+        self.infoCornerView.autoresizingMask = [.width, .height]
+        self.resultBox.addSubview(self.infoCornerView, positioned: .above, relativeTo: self.errorInfoView)
+        
+        self.loadingCornerView = LeftTopRoundedRectView.init(frame: self.loadingContendView.bounds)
+        self.loadingCornerView.autoresizingMask = [.width, .height]
+        self.loadingContendView.addSubview(self.loadingCornerView, positioned: .above, relativeTo: self.loadingIndicator)
+        
+        
+        self.setUI()
+        
+        self.refreshViewColor()
+        
+        self.reloadData()
+    }
+    
+    func setUI() {
+        
+        self.errorTipLabel.font = NSFont.SFProTextRegularFont(13)
+        self.errorTipLabel.textColor = KMAppearance.KMColor_Status_Err()
+        
+        if KMAppearance.isDarkMode() {
+            self.reWriteBtn.setTitleColor(KMAppearance.KMColor_Layout_W70())
+            self.resultCopyBtn.setTitleColor(KMAppearance.KMColor_Layout_W70())
+            self.resultSaveBtn.setTitleColor(KMAppearance.KMColor_Layout_W70())
+        } else {
+            self.reWriteBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+            self.resultCopyBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+            self.resultSaveBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+        }
+        
+        self.reWriteBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered {
+                if KMAppearance.isDarkMode() {
+                    self.reWriteBtn.setTitleColor(KMAppearance.KMColor_Layout_M())
+                } else {
+                    self.reWriteBtn.setTitleColor(KMAppearance.KMColor_Interactive_A1())
+                }
+            } else {
+                if KMAppearance.isDarkMode() {
+                    self.reWriteBtn.setTitleColor(KMAppearance.KMColor_Layout_W70())
+                } else {
+                    self.reWriteBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+                }
+            }
+        }
+        
+        self.resultCopyBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered {
+                if KMAppearance.isDarkMode() {
+                    self.resultCopyBtn.setTitleColor(KMAppearance.KMColor_Layout_M())
+                } else {
+                    self.resultCopyBtn.setTitleColor(KMAppearance.KMColor_Interactive_A1())
+                }
+            } else {
+                if KMAppearance.isDarkMode() {
+                    self.resultCopyBtn.setTitleColor(KMAppearance.KMColor_Layout_W70())
+                } else {
+                    self.resultCopyBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+                }
+            }
+        }
+        
+        self.resultSaveBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered {
+                if KMAppearance.isDarkMode() {
+                    self.resultSaveBtn.setTitleColor(KMAppearance.KMColor_Layout_M())
+                } else {
+                    self.resultSaveBtn.setTitleColor(KMAppearance.KMColor_Layout_M_1())
+                }
+            } else {
+                if KMAppearance.isDarkMode() {
+                    self.resultSaveBtn.setTitleColor(KMAppearance.KMColor_Layout_W70())
+                } else {
+                    self.resultSaveBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+                }
+            }
+        }
+        
+        self.resultTitleLabel.font = NSFont.SFProTextSemiboldFont(13)
+        self.resultInfoLabel.font = NSFont.SFProTextRegularFont(14)
+        
+        self.resultInfoLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        
+    }
+    
+    func refreshViewColor() {
+        if KMAppearance.isDarkMode() {
+            self.infoCornerView.fillColor = NSColor.white.withAlphaComponent(0.05)
+            self.infoCornerView.lineColor = NSColor.white.withAlphaComponent(0.05)
+            self.infoCornerView.display()
+            
+            self.loadingCornerView.fillColor = NSColor.white.withAlphaComponent(0.05)
+            self.loadingCornerView.lineColor = NSColor.white.withAlphaComponent(0.05)
+            self.loadingCornerView.display()
+            
+        } else {
+            self.infoCornerView.fillColor = NSColor.black.withAlphaComponent(0.03)
+            self.infoCornerView.lineColor = NSColor.black.withAlphaComponent(0.05)
+            self.infoCornerView.display()
+            
+            self.loadingCornerView.fillColor = NSColor.black.withAlphaComponent(0.03)
+            self.loadingCornerView.lineColor = NSColor.black.withAlphaComponent(0.05)
+            self.loadingCornerView.display()
+        }
+    }
+    
+    
+    func reloadData() {
+        guard self.chatInfoModel != nil else {
+            return
+        }
+        
+        if self.chatInfoModel.aiConfigType == .summarize {
+            self.resultTitleLabel.stringValue = "#" + NSLocalizedString("AI Summarize", comment: "")
+            if KMAppearance.isDarkMode() {
+                self.resultTitleLabel.textColor = NSColor(red: 85/255, green: 245/255, blue: 1, alpha: 1)
+            } else {
+                self.resultTitleLabel.textColor = NSColor(red: 0, green: 209/255, blue: 222/255, alpha: 1)
+            }
+        } else if self.chatInfoModel.aiConfigType == .reWriting {
+            self.resultTitleLabel.stringValue = "#" + NSLocalizedString("AI Rewrite", comment: "")
+            if KMAppearance.isDarkMode() {
+                self.resultTitleLabel.textColor = NSColor(red: 255/255, green: 105/255, blue: 195/255, alpha: 1)
+            } else {
+                self.resultTitleLabel.textColor = NSColor(red: 240/255, green: 28/255, blue: 155/255, alpha: 1)
+            }
+        } else if self.chatInfoModel.aiConfigType == .proofreading {
+            self.resultTitleLabel.stringValue = "#" + NSLocalizedString("AI Proofread", comment: "")
+            if KMAppearance.isDarkMode() {
+                self.resultTitleLabel.textColor = NSColor(red: 194/255, green: 157/255, blue: 1, alpha: 1)
+            } else {
+                self.resultTitleLabel.textColor = NSColor(red: 108/255, green: 28/255, blue: 240/255, alpha: 1)
+            }
+        } else if self.chatInfoModel.aiConfigType == .translate {
+            self.resultTitleLabel.stringValue = "#" + NSLocalizedString("AI Translate", comment: "")
+            if KMAppearance.isDarkMode() {
+                self.resultTitleLabel.textColor = NSColor(red: 255/255, green: 152/255, blue: 77/255, alpha: 1)
+            } else {
+                self.resultTitleLabel.textColor = NSColor(red: 240/255, green: 101/255, blue: 0, alpha: 1)
+            }
+        }
+        
+        self.loadingContendView.isHidden = true
+        self.resultBox.isHidden = true
+        self.reWriteBtn.isHidden = true
+        self.resultCopyBtn.isHidden = true
+        self.resultSaveBtn.isHidden = true
+        self.resultTitleLabel.isHidden = true
+        self.resultInfoLabel.isHidden = true
+        self.errorInfoView.isHidden = true
+        self.sepImage1.isHidden = true
+        self.sepImage2.isHidden = true
+      
+        if self.chatInfoModel.chatInfoState == .stateLoading {
+            self.loadingContendView.isHidden = false
+            self.loadingIndicator.startAnimation(nil)
+            
+        } else if self.chatInfoModel.chatInfoState == .stateSuccess {
+            self.resultBox.isHidden = false
+            self.reWriteBtn.isHidden = false
+            self.resultCopyBtn.isHidden = false
+            self.resultSaveBtn.isHidden = false
+            self.resultTitleLabel.isHidden = false
+            self.resultInfoLabel.isHidden = false
+            self.loadingIndicator.stopAnimation(nil)
+            self.sepImage1.isHidden = false
+            self.sepImage2.isHidden = false
+            
+            self.resultInfoLabel.stringValue = self.chatInfoModel.chatResult
+            
+            
+        } else if self.chatInfoModel.chatInfoState == .stateFailed {
+            self.resultBox.isHidden = false
+            self.errorInfoView.isHidden = false
+            self.errorTipLabel.stringValue = self.chatInfoModel.chatResult
+            
+            self.loadingIndicator.stopAnimation(nil)
+        }
+    }
+    
+    //MARK: IBAction
+    @IBAction func redoAction(_ sender: KMButton) {
+        
+        let menu = NSMenu()
+        
+        let confirmView = AIRedoConfirmView.createFromNib()
+        confirmView?.redoHandle = {[unowned self] view in
+            menu.cancelTracking()
+            guard let callBack = self.redoHandle else {
+                return
+            }
+            callBack(self, self.chatInfoModel)
+        }
+        let menuItem = NSMenuItem(title: NSLocalizedString("Save as TXT", comment: ""), action: #selector(saveAsTextItemClicked(_:)), keyEquivalent: "")
+        menuItem.target = self
+        menuItem.view = confirmView
+        menu.addItem(menuItem)
+        
+        menu.popUp(positioning: nil, at: CGPoint(x: sender.frame.size.width, y: 0 ), in: sender)
+
+    }
+    
+    @IBAction func copyAction(_ sender: KMButton) {
+        
+        guard let callBack = self.copyHandle else {
+            return
+        }
+        callBack(self, self.chatInfoModel)
+        
+        
+    }
+     
+    @IBAction func saveAsAction(_ sender: KMButton) {
+        
+        let menu = NSMenu()
+        
+        let menuItem = NSMenuItem(title: NSLocalizedString("Save as TXT", comment: ""), action: #selector(saveAsTextItemClicked(_:)), keyEquivalent: "")
+        menuItem.target = self
+        menu.addItem(menuItem)
+        
+        let pdfItem = NSMenuItem(title: NSLocalizedString("Save as PDF", comment: ""), action: #selector(saveAsPDFItemClicked(_:)), keyEquivalent: "")
+        pdfItem.target = self
+        menu.addItem(pdfItem)
+        
+        let point = sender.superview?.convert(sender.frame.origin, from: self.view.window?.contentView)
+        menu.popUp(positioning: nil, at: CGPoint(x: sender.frame.size.width, y: 0 ), in: sender)
+        
+    }
+    
+    @objc func saveAsTextItemClicked(_ item: NSMenuItem) {
+        let fileName = "Untitled"
+        let outputSavePanel = NSSavePanel()
+        outputSavePanel.allowedFileTypes = ["txt"]
+        outputSavePanel.nameFieldStringValue = fileName
+        let result = outputSavePanel.runModal()
+        if result == .OK {
+            let filePath = outputSavePanel.url?.path
+            do {
+                
+                if self.chatInfoModel.aiConfigType == .summarize ||
+                    self.chatInfoModel.aiConfigType == .reWriting ||
+                    self.chatInfoModel.aiConfigType == .proofreading {
+                    
+                    try self.chatInfoModel.chatResult.write(to: outputSavePanel.url!, atomically: true, encoding: .utf8)
+                    
+                    NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: filePath!)])
+                    KMFunctionGuideWindowController.setDidShowFor(.aiInfoResultSave)
+                }
+                 
+            } catch {
+                
+            }
+            
+        }
+    }
+    
+    @objc func saveAsPDFItemClicked(_ item: NSMenuItem) {
+        let fileName = "Untitled"
+        let outputSavePanel = NSSavePanel()
+        outputSavePanel.allowedFileTypes = ["pdf"]
+        outputSavePanel.nameFieldStringValue = fileName
+        let result = outputSavePanel.runModal()
+        if result == .OK {
+            let filePath = outputSavePanel.url?.path
+            let text = self.chatInfoModel.chatResult
+            self.createPDF(from: text, saveTo: filePath!)
+            
+            NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: filePath!)])
+            
+            KMFunctionGuideWindowController.setDidShowFor(.aiInfoResultSave)
+            
+        }
+    }
+    
+    @objc func emptyItemClicked(_ item: NSMenuItem) {
+        
+    }
+    
+    func createPDF(from text: String, saveTo path: String) {
+        let attributedText = NSAttributedString(string: text)
+        let pdfData = NSMutableData()
+        
+        let pdfConsumer = CGDataConsumer(data: pdfData)!
+        var mediaBox = CGRect(x: 0, y: 0, width: 612, height: 792) // 设置页面尺寸,这里使用默认的美国信纸尺寸
+        
+        let pdfContext = CGContext(consumer: pdfConsumer, mediaBox: &mediaBox, nil)!
+        pdfContext.beginPage(mediaBox: &mediaBox)
+        pdfContext.textMatrix = .identity
+        pdfContext.setShouldAntialias(true)
+        
+        let frame = mediaBox.insetBy(dx: 20, dy: 20) // 设置文字边距
+        
+        let framesetter = CTFramesetterCreateWithAttributedString(attributedText as CFAttributedString)
+        let framePath = CGPath(rect: frame, transform: nil)
+        let frameRef = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, attributedText.length), framePath, nil)
+        CTFrameDraw(frameRef, pdfContext)
+        
+        pdfContext.endPage()
+        pdfContext.closePDF()
+        
+        pdfData.write(toFile: path, atomically: true)
+        print("PDF 文件已保存至:\(path)")
+    }
+    
+}

+ 236 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatStringResultItem.xib

@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="AIChatStringResultItem" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <connections>
+                <outlet property="contendView" destination="op2-g1-uMR" id="mk9-uN-uPS"/>
+                <outlet property="errorInfoView" destination="Z4d-F0-7S2" id="Bzf-JQ-Snl"/>
+                <outlet property="errorTipLabel" destination="5bn-kF-Wge" id="ytn-H6-2zH"/>
+                <outlet property="infoContendView" destination="3qi-Iz-VRb" id="C1d-a1-znn"/>
+                <outlet property="loadingContendView" destination="h5s-eW-L4S" id="ggf-LJ-y7O"/>
+                <outlet property="loadingIndicator" destination="Lmg-3J-PG4" id="7zz-ET-eZC"/>
+                <outlet property="reWriteBtn" destination="bzs-PG-uSh" id="u0M-1R-Rqj"/>
+                <outlet property="resultBox" destination="ESq-b1-AbU" id="0Vk-sS-PXn"/>
+                <outlet property="resultCopyBtn" destination="Udz-mm-mGv" id="jfI-wg-3Zh"/>
+                <outlet property="resultInfoLabel" destination="X87-39-tV3" id="XTf-lP-mBn"/>
+                <outlet property="resultSaveBtn" destination="VXo-ZF-UHa" id="xw9-CS-Kzl"/>
+                <outlet property="resultTitleLabel" destination="X0X-oC-au4" id="WmQ-ei-OFx"/>
+                <outlet property="sepImage1" destination="hvj-BK-Ynj" id="8h6-em-Jih"/>
+                <outlet property="sepImage2" destination="S5a-RU-MEu" id="VN1-nV-tpd"/>
+                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="Hz6-mo-xeY">
+            <rect key="frame" x="0.0" y="0.0" width="276" height="154"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="op2-g1-uMR">
+                    <rect key="frame" x="0.0" y="0.0" width="276" height="154"/>
+                    <subviews>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="3qi-Iz-VRb">
+                            <rect key="frame" x="13" y="0.0" width="240" height="154"/>
+                            <subviews>
+                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Cl1-Mv-VTO">
+                                    <rect key="frame" x="0.0" y="130" width="24" height="24"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="24" id="QQO-ty-J5F"/>
+                                        <constraint firstAttribute="height" constant="24" id="rLo-4F-2rD"/>
+                                    </constraints>
+                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="AIChatRobot" id="VGD-Hd-rxb"/>
+                                </imageView>
+                                <button allowsExpansionToolTips="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bzs-PG-uSh" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                    <rect key="frame" x="87" y="134" width="36" height="16"/>
+                                    <buttonCell key="cell" type="bevel" title="Redo" bezelStyle="rounded" alignment="center" lineBreakMode="truncatingMiddle" imageScaling="proportionallyDown" inset="2" id="V9o-M6-I1B">
+                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                        <font key="font" metaFont="system"/>
+                                    </buttonCell>
+                                    <constraints>
+                                        <constraint firstAttribute="width" relation="lessThanOrEqual" constant="60" id="StS-01-eTp"/>
+                                    </constraints>
+                                    <connections>
+                                        <action selector="redoAction:" target="-2" id="d6x-8u-92y"/>
+                                    </connections>
+                                </button>
+                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="hvj-BK-Ynj">
+                                    <rect key="frame" x="130" y="137" width="1" height="10"/>
+                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="aiVLine" id="zy2-VI-W8W"/>
+                                </imageView>
+                                <button allowsExpansionToolTips="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Udz-mm-mGv" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                    <rect key="frame" x="138" y="134" width="36" height="16"/>
+                                    <buttonCell key="cell" type="bevel" title="Copy" bezelStyle="rounded" alignment="center" lineBreakMode="truncatingMiddle" imageScaling="proportionallyDown" inset="2" id="Efy-fs-NUi">
+                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                        <font key="font" metaFont="system"/>
+                                    </buttonCell>
+                                    <constraints>
+                                        <constraint firstAttribute="width" relation="lessThanOrEqual" constant="60" id="Nil-qz-1BM"/>
+                                    </constraints>
+                                    <connections>
+                                        <action selector="copyAction:" target="-2" id="QRf-ge-5m7"/>
+                                    </connections>
+                                </button>
+                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="S5a-RU-MEu">
+                                    <rect key="frame" x="181" y="137" width="1" height="10"/>
+                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="aiVLine" id="cF0-u0-f1D"/>
+                                </imageView>
+                                <button allowsExpansionToolTips="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="VXo-ZF-UHa" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                    <rect key="frame" x="189" y="134" width="51" height="16"/>
+                                    <buttonCell key="cell" type="bevel" title="Save as" bezelStyle="rounded" alignment="center" lineBreakMode="truncatingMiddle" imageScaling="proportionallyDown" inset="2" id="laf-ou-eFF">
+                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                        <font key="font" metaFont="system"/>
+                                    </buttonCell>
+                                    <constraints>
+                                        <constraint firstAttribute="width" relation="lessThanOrEqual" constant="60" id="8vJ-9c-EZF"/>
+                                    </constraints>
+                                    <connections>
+                                        <action selector="saveAsAction:" target="-2" id="KdA-Ka-vY2"/>
+                                    </connections>
+                                </button>
+                                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="ESq-b1-AbU">
+                                    <rect key="frame" x="0.0" y="0.0" width="240" height="126"/>
+                                    <view key="contentView" id="Tb9-5B-iZl">
+                                        <rect key="frame" x="0.0" y="0.0" width="240" height="126"/>
+                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                        <subviews>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="Z4d-F0-7S2">
+                                                <rect key="frame" x="0.0" y="94" width="240" height="32"/>
+                                                <subviews>
+                                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Sgv-f1-xXt">
+                                                        <rect key="frame" x="12" y="5" width="15" height="15"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="height" constant="15" id="Ich-sQ-Dy4"/>
+                                                            <constraint firstAttribute="width" constant="15" id="RWC-iq-IHu"/>
+                                                        </constraints>
+                                                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="creditNoTip" id="ByR-lf-x6K"/>
+                                                    </imageView>
+                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5bn-kF-Wge">
+                                                        <rect key="frame" x="29" y="8" width="202" height="16"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="198" id="eqC-mh-aM7"/>
+                                                        </constraints>
+                                                        <textFieldCell key="cell" title="--" id="w5o-dN-xgM">
+                                                            <font key="font" usesAppearanceFont="YES"/>
+                                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                        </textFieldCell>
+                                                    </textField>
+                                                </subviews>
+                                                <constraints>
+                                                    <constraint firstItem="Sgv-f1-xXt" firstAttribute="leading" secondItem="Z4d-F0-7S2" secondAttribute="leading" constant="12" id="6zk-hm-ShS"/>
+                                                    <constraint firstItem="5bn-kF-Wge" firstAttribute="top" secondItem="Z4d-F0-7S2" secondAttribute="top" constant="8" id="BAk-MH-BFI"/>
+                                                    <constraint firstItem="5bn-kF-Wge" firstAttribute="leading" secondItem="Sgv-f1-xXt" secondAttribute="trailing" constant="4" id="KBy-ZU-aQq"/>
+                                                    <constraint firstAttribute="bottom" secondItem="5bn-kF-Wge" secondAttribute="bottom" constant="8" id="KyK-1T-e9t"/>
+                                                    <constraint firstItem="Sgv-f1-xXt" firstAttribute="top" secondItem="Z4d-F0-7S2" secondAttribute="top" constant="12" id="OPQ-7S-NJS"/>
+                                                </constraints>
+                                            </customView>
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="X0X-oC-au4">
+                                                <rect key="frame" x="10" y="98" width="17" height="16"/>
+                                                <textFieldCell key="cell" lineBreakMode="clipping" title="--" id="GzQ-tr-7p7">
+                                                    <font key="font" usesAppearanceFont="YES"/>
+                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                </textFieldCell>
+                                            </textField>
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="X87-39-tV3">
+                                                <rect key="frame" x="10" y="74" width="220" height="16"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="216" id="XTd-W9-I28"/>
+                                                </constraints>
+                                                <textFieldCell key="cell" selectable="YES" title="--" id="7Uu-8M-7R1">
+                                                    <font key="font" usesAppearanceFont="YES"/>
+                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                </textFieldCell>
+                                            </textField>
+                                        </subviews>
+                                        <constraints>
+                                            <constraint firstItem="X87-39-tV3" firstAttribute="leading" secondItem="Tb9-5B-iZl" secondAttribute="leading" constant="12" id="0OF-Cb-atT"/>
+                                            <constraint firstItem="Z4d-F0-7S2" firstAttribute="leading" secondItem="Tb9-5B-iZl" secondAttribute="leading" id="Imf-t2-HKN"/>
+                                            <constraint firstItem="X87-39-tV3" firstAttribute="top" secondItem="Tb9-5B-iZl" secondAttribute="top" constant="36" id="SCt-5H-oZw"/>
+                                            <constraint firstItem="X0X-oC-au4" firstAttribute="top" secondItem="Tb9-5B-iZl" secondAttribute="top" constant="12" id="aoI-Ti-GuI"/>
+                                            <constraint firstItem="X0X-oC-au4" firstAttribute="leading" secondItem="Tb9-5B-iZl" secondAttribute="leading" constant="12" id="psS-Y8-Yzq"/>
+                                            <constraint firstItem="Z4d-F0-7S2" firstAttribute="top" secondItem="Tb9-5B-iZl" secondAttribute="top" id="qjD-if-yTD"/>
+                                            <constraint firstAttribute="trailing" secondItem="Z4d-F0-7S2" secondAttribute="trailing" id="seT-UG-06A"/>
+                                        </constraints>
+                                    </view>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="240" id="C5h-M0-UL1"/>
+                                    </constraints>
+                                </box>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="h5s-eW-L4S">
+                                    <rect key="frame" x="0.0" y="0.0" width="240" height="126"/>
+                                    <subviews>
+                                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="hnh-aH-wFZ">
+                                            <rect key="frame" x="80" y="23" width="80" height="80"/>
+                                            <constraints>
+                                                <constraint firstAttribute="width" constant="80" id="aXh-jS-i7Z"/>
+                                                <constraint firstAttribute="height" constant="80" id="jy1-Ls-HIa"/>
+                                            </constraints>
+                                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="robot-gray" id="0L3-Mw-9iz"/>
+                                        </imageView>
+                                        <progressIndicator maxValue="100" indeterminate="YES" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="Lmg-3J-PG4">
+                                            <rect key="frame" x="104" y="47" width="32" height="32"/>
+                                        </progressIndicator>
+                                    </subviews>
+                                    <constraints>
+                                        <constraint firstItem="hnh-aH-wFZ" firstAttribute="centerX" secondItem="h5s-eW-L4S" secondAttribute="centerX" id="R7k-dS-bLv"/>
+                                        <constraint firstItem="Lmg-3J-PG4" firstAttribute="centerX" secondItem="h5s-eW-L4S" secondAttribute="centerX" id="Sbh-Te-8hW"/>
+                                        <constraint firstItem="Lmg-3J-PG4" firstAttribute="centerY" secondItem="h5s-eW-L4S" secondAttribute="centerY" id="n37-Gi-XMw"/>
+                                        <constraint firstItem="hnh-aH-wFZ" firstAttribute="centerY" secondItem="h5s-eW-L4S" secondAttribute="centerY" id="pr4-Gz-xG9"/>
+                                    </constraints>
+                                </customView>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="Udz-mm-mGv" firstAttribute="leading" secondItem="bzs-PG-uSh" secondAttribute="trailing" constant="15" id="2b7-nm-EBp"/>
+                                <constraint firstItem="VXo-ZF-UHa" firstAttribute="centerY" secondItem="S5a-RU-MEu" secondAttribute="centerY" id="2qo-Zl-iL0"/>
+                                <constraint firstItem="ESq-b1-AbU" firstAttribute="top" secondItem="3qi-Iz-VRb" secondAttribute="top" constant="28" id="5ha-0l-b8M"/>
+                                <constraint firstItem="Udz-mm-mGv" firstAttribute="centerY" secondItem="bzs-PG-uSh" secondAttribute="centerY" id="C3C-CZ-3Jn"/>
+                                <constraint firstItem="VXo-ZF-UHa" firstAttribute="leading" secondItem="Udz-mm-mGv" secondAttribute="trailing" constant="15" id="JHT-Rn-LuJ"/>
+                                <constraint firstAttribute="trailing" secondItem="h5s-eW-L4S" secondAttribute="trailing" id="Op9-mN-EI0"/>
+                                <constraint firstItem="h5s-eW-L4S" firstAttribute="leading" secondItem="3qi-Iz-VRb" secondAttribute="leading" id="QIp-7n-Y9D"/>
+                                <constraint firstItem="h5s-eW-L4S" firstAttribute="top" secondItem="3qi-Iz-VRb" secondAttribute="top" constant="28" id="SJp-Z5-kWR"/>
+                                <constraint firstAttribute="width" constant="240" id="VnR-M5-Noi"/>
+                                <constraint firstItem="VXo-ZF-UHa" firstAttribute="top" secondItem="3qi-Iz-VRb" secondAttribute="top" constant="4" id="WNq-Xv-bs4"/>
+                                <constraint firstItem="Udz-mm-mGv" firstAttribute="centerY" secondItem="hvj-BK-Ynj" secondAttribute="centerY" id="YXh-Wd-0Zr"/>
+                                <constraint firstItem="bzs-PG-uSh" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Cl1-Mv-VTO" secondAttribute="trailing" constant="8" id="Z3V-mP-oBO"/>
+                                <constraint firstItem="Cl1-Mv-VTO" firstAttribute="leading" secondItem="3qi-Iz-VRb" secondAttribute="leading" id="bGk-FX-Gyb"/>
+                                <constraint firstAttribute="bottom" secondItem="h5s-eW-L4S" secondAttribute="bottom" id="cD7-eu-fad"/>
+                                <constraint firstItem="ESq-b1-AbU" firstAttribute="centerX" secondItem="3qi-Iz-VRb" secondAttribute="centerX" id="ca5-Jy-6dT"/>
+                                <constraint firstItem="Udz-mm-mGv" firstAttribute="leading" secondItem="hvj-BK-Ynj" secondAttribute="trailing" constant="7" id="eLX-vL-BMl"/>
+                                <constraint firstAttribute="bottom" secondItem="ESq-b1-AbU" secondAttribute="bottom" id="knd-bv-FGZ"/>
+                                <constraint firstAttribute="trailing" secondItem="VXo-ZF-UHa" secondAttribute="trailing" id="lRD-Ta-Lvj"/>
+                                <constraint firstItem="VXo-ZF-UHa" firstAttribute="centerY" secondItem="Udz-mm-mGv" secondAttribute="centerY" id="pmk-eN-uJm"/>
+                                <constraint firstItem="Cl1-Mv-VTO" firstAttribute="top" secondItem="3qi-Iz-VRb" secondAttribute="top" id="s5p-1r-bdM"/>
+                                <constraint firstItem="VXo-ZF-UHa" firstAttribute="leading" secondItem="S5a-RU-MEu" secondAttribute="trailing" constant="7" id="zph-dI-JpL"/>
+                            </constraints>
+                        </customView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="3qi-Iz-VRb" firstAttribute="top" secondItem="op2-g1-uMR" secondAttribute="top" id="02d-Ge-ZGM"/>
+                        <constraint firstItem="3qi-Iz-VRb" firstAttribute="leading" secondItem="op2-g1-uMR" secondAttribute="leading" constant="13" id="TuT-fL-cem"/>
+                        <constraint firstAttribute="bottom" secondItem="3qi-Iz-VRb" secondAttribute="bottom" id="ypN-r4-AF9"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="op2-g1-uMR" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="12c-Fc-wqP"/>
+                <constraint firstItem="op2-g1-uMR" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="MRw-fF-VBC"/>
+                <constraint firstAttribute="trailing" secondItem="op2-g1-uMR" secondAttribute="trailing" id="bVk-tc-tda"/>
+                <constraint firstAttribute="bottom" secondItem="op2-g1-uMR" secondAttribute="bottom" id="d4E-DV-CDa"/>
+            </constraints>
+            <point key="canvasLocation" x="-6" y="124"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="AIChatRobot" width="24" height="24"/>
+        <image name="aiVLine" width="1" height="10"/>
+        <image name="creditNoTip" width="14" height="15"/>
+        <image name="robot-gray" width="80" height="80"/>
+    </resources>
+</document>

+ 64 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatStringUploadItem.swift

@@ -0,0 +1,64 @@
+//
+//  AIChatStringUploadItem.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/19.
+//
+
+import Cocoa
+
+class AIChatStringUploadItem: NSCollectionViewItem {
+
+    @IBOutlet weak var contendView: NSView!
+    
+    @IBOutlet weak var fileContendView: NSView!
+    
+    @IBOutlet weak var contentInfoLabel: NSTextField!
+    
+    var rightCornerView: RightTopRoundedRectView!
+    
+    var chatInfoModel: AIChatInfoModel!
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+        
+        self.contentInfoLabel.font = NSFont.SFProTextRegularFont(14)
+        self.contentInfoLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        
+        rightCornerView = RightTopRoundedRectView.init(frame: self.fileContendView.bounds)
+        rightCornerView.autoresizingMask = [.width, .height]
+        self.fileContendView.addSubview(self.rightCornerView, positioned: .above, relativeTo: self.contentInfoLabel)
+        
+        self.refreshViewColor()
+        
+        self.reloadData()
+    }
+    
+    func refreshViewColor() {
+        if KMAppearance.isDarkMode() {
+            self.rightCornerView.fillColor = NSColor(red: 201/255, green: 218/255, blue: 247/255, alpha: 0.05)
+            self.rightCornerView.lineColor = NSColor(red: 201/255.0, green: 218/255.0, blue: 247/255.0, alpha: 0.15)
+            self.rightCornerView.display()
+            
+        } else {
+            self.rightCornerView.fillColor = NSColor(red: 201/255, green: 218/255, blue: 247/255, alpha: 0.1)
+            self.rightCornerView.lineColor = NSColor(red: 201/255.0, green: 218/255.0, blue: 247/255.0, alpha: 1)
+            self.rightCornerView.display()
+        }
+       
+    }
+    
+    func reloadData() {
+        guard self.chatInfoModel != nil else {
+            return
+        }
+        
+        if self.chatInfoModel.uploadContent.isEmpty == false {
+            self.contentInfoLabel.stringValue = self.chatInfoModel.uploadContent
+        }
+        
+        
+    }
+    
+}

+ 65 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatStringUploadItem.xib

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="AIChatStringUploadItem" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <connections>
+                <outlet property="contendView" destination="DLH-wF-CXq" id="uz5-Vi-L24"/>
+                <outlet property="contentInfoLabel" destination="mPP-UL-SDp" id="Hr7-tF-3li"/>
+                <outlet property="fileContendView" destination="otp-Mg-Axp" id="jKk-GK-vvw"/>
+                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="Hz6-mo-xeY">
+            <rect key="frame" x="0.0" y="0.0" width="276" height="40"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="DLH-wF-CXq">
+                    <rect key="frame" x="0.0" y="0.0" width="276" height="40"/>
+                    <subviews>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="otp-Mg-Axp">
+                            <rect key="frame" x="13" y="0.0" width="240" height="40"/>
+                            <subviews>
+                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mPP-UL-SDp">
+                                    <rect key="frame" x="10" y="12" width="220" height="16"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="216" id="QWr-kW-m6M"/>
+                                    </constraints>
+                                    <textFieldCell key="cell" selectable="YES" title="--" id="5sG-yd-NJ7">
+                                        <font key="font" usesAppearanceFont="YES"/>
+                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="mPP-UL-SDp" firstAttribute="leading" secondItem="otp-Mg-Axp" secondAttribute="leading" constant="12" id="L55-Hg-zbJ"/>
+                                <constraint firstItem="mPP-UL-SDp" firstAttribute="top" secondItem="otp-Mg-Axp" secondAttribute="top" constant="12" id="OSf-5I-CtX"/>
+                                <constraint firstItem="mPP-UL-SDp" firstAttribute="centerX" secondItem="otp-Mg-Axp" secondAttribute="centerX" id="OjA-mS-I9a"/>
+                                <constraint firstAttribute="bottom" secondItem="mPP-UL-SDp" secondAttribute="bottom" constant="12" id="v9L-VV-fBE"/>
+                            </constraints>
+                        </customView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="otp-Mg-Axp" firstAttribute="top" secondItem="DLH-wF-CXq" secondAttribute="top" id="OsM-BF-STD"/>
+                        <constraint firstItem="otp-Mg-Axp" firstAttribute="leading" secondItem="DLH-wF-CXq" secondAttribute="leading" constant="13" id="VkQ-g3-AFj"/>
+                        <constraint firstAttribute="bottom" secondItem="otp-Mg-Axp" secondAttribute="bottom" id="w7G-uj-X5E"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstAttribute="trailing" secondItem="DLH-wF-CXq" secondAttribute="trailing" id="5KZ-mD-8LL"/>
+                <constraint firstItem="DLH-wF-CXq" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="HmK-Pq-w0Y"/>
+                <constraint firstAttribute="bottom" secondItem="DLH-wF-CXq" secondAttribute="bottom" id="fHy-I7-4cf"/>
+                <constraint firstItem="DLH-wF-CXq" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="ges-3i-Zln"/>
+            </constraints>
+            <point key="canvasLocation" x="-48" y="10"/>
+        </customView>
+    </objects>
+</document>

+ 623 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatTranslateResultItem.swift

@@ -0,0 +1,623 @@
+//
+//  AIChatTranslateResultItem.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/19.
+//
+
+import Cocoa
+
+class AIChatTranslateResultItem: NSCollectionViewItem {
+    
+    @IBOutlet weak var contendView: NSView!
+    
+    @IBOutlet weak var reWriteBtn: KMButton!
+    @IBOutlet weak var resultCopyBtn: KMButton!
+    @IBOutlet weak var resultSaveBtn: KMButton!
+    @IBOutlet weak var sepImage1: NSImageView!
+    @IBOutlet weak var sepImage2: NSImageView!
+    
+    @IBOutlet weak var loadingContendView: NSView!
+    @IBOutlet weak var loadingIndicator: NSProgressIndicator!
+    @IBOutlet weak var loadingCornerView: LeftTopRoundedRectView!
+    
+    @IBOutlet weak var infoContendView: NSView!
+    @IBOutlet weak var configTypeTitleLabel: NSTextField!
+     
+    
+    @IBOutlet weak var confrimContendView: NSView!
+    
+    @IBOutlet weak var resultContendView: NSView!
+    
+    @IBOutlet weak var languageChooseView: NSView!
+    @IBOutlet weak var fromLanguageView: NSView!
+    @IBOutlet weak var fromLanguageLabel: NSTextField!
+    @IBOutlet weak var fromLanguageBtn: NSButton!
+    @IBOutlet weak var toLanguageView: NSView!
+    @IBOutlet weak var toLanguageLabel: NSTextField!
+    @IBOutlet weak var toLanguageBtn: NSButton!
+    @IBOutlet weak var languageChangeBtn: KMButton!
+    
+    @IBOutlet weak var resultLabel: NSTextField!
+    @IBOutlet weak var resultLabelTopConst: NSLayoutConstraint!
+    
+    @IBOutlet weak var resultFileView: NSView!
+    @IBOutlet weak var resultFileDownloadBtn: NSButton!
+    @IBOutlet weak var resultFileNameLabel: NSTextField!
+    @IBOutlet weak var resultFileSIzeLabel: NSTextField!
+    
+    @IBOutlet weak var downloadProgressView: NSView!
+    @IBOutlet weak var downloadInView: NSView!
+    
+    
+    @IBOutlet weak var titleLabel1: NSTextField!
+    @IBOutlet weak var titleBox: KMBox!
+    @IBOutlet weak var creditsLabel: NSTextField!
+    @IBOutlet weak var charactersLabel: NSTextField!
+    @IBOutlet weak var creditTipLabel: NSTextField!
+    @IBOutlet weak var creditTipLabelTopConst: NSLayoutConstraint!
+    
+    
+    @IBOutlet weak var errorTipImage: NSImageView!
+    @IBOutlet weak var errorTipLabel: NSTextField!
+    
+    @IBOutlet weak var cancelBtn: NSButton!
+    @IBOutlet weak var confirmBtn: NSButton!
+
+    var infoCornerView: LeftTopRoundedRectView!
+    
+    var chatInfoModel: AIChatInfoModel!
+    
+    var fromLanguage: String = ""
+    var toLanguage: String = ""
+    
+    var cancelAIHandle: ((_ itemView: AIChatTranslateResultItem) -> Void)?
+    var startAIHandle: ((_ itemView: AIChatTranslateResultItem) -> Void)?
+    var redoHandle: ((_ view: AIChatTranslateResultItem, _ model: AIChatInfoModel) -> Void)?
+    var copyHandle: ((_ view: AIChatTranslateResultItem, _ model: AIChatInfoModel) -> Void)?
+    
+    override func viewWillLayout() {
+        super.viewWillLayout()
+        
+        self.setUI()
+    }
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+        
+        self.infoCornerView = LeftTopRoundedRectView.init(frame: self.infoContendView.bounds)
+        self.infoCornerView.autoresizingMask = [.width, .height]
+        self.infoContendView.addSubview(self.infoCornerView, positioned: .below, relativeTo: self.configTypeTitleLabel)
+        
+        self.configTypeTitleLabel.stringValue = "#" + NSLocalizedString("AI Translate", comment: "")
+        self.configTypeTitleLabel.font = NSFont.SFProTextSemiboldFont(13)
+        
+        self.titleLabel1.font = NSFont.SFProTextRegularFont(13)
+        self.creditsLabel.font = NSFont.SFProTextRegularFont(13)
+        self.charactersLabel.font = NSFont.SFProTextRegularFont(13)
+        self.creditTipLabel.font = NSFont.SFProTextRegularFont(12)
+        self.errorTipLabel.font = NSFont.SFProTextRegularFont(12)
+        
+        self.titleLabel1.stringValue = NSLocalizedString("You will cost:", comment: "")
+        self.creditTipLabel.stringValue = NSLocalizedString("Tip: 1 credit for each 10,000 characters", comment: "")
+        self.errorTipLabel.stringValue = NSLocalizedString("Insufficient credit", comment: "")
+        
+        self.cancelBtn.title = NSLocalizedString("Cancel", comment: "")
+        self.confirmBtn.title = NSLocalizedString("Translate", comment: "")
+        
+        self.reWriteBtn.title = NSLocalizedString("Redo", comment: "")
+        self.resultCopyBtn.title = NSLocalizedString("Copy", comment: "")
+        self.resultSaveBtn.title = NSLocalizedString("Save as", comment: "")
+        
+        self.reWriteBtn.toolTip = NSLocalizedString("Redo", comment: "")
+        self.resultCopyBtn.toolTip = NSLocalizedString("Copy", comment: "")
+        self.resultSaveBtn.toolTip = NSLocalizedString("Save as", comment: "")
+        
+        self.fromLanguageView.wantsLayer = true
+        self.toLanguageView.wantsLayer = true
+        
+        self.titleBox.wantsLayer = true
+        self.titleBox.layer!.borderWidth = 1
+        
+        self.setUpTranslateUI()
+        
+        self.downloadProgressView.wantsLayer = true
+        self.downloadInView.wantsLayer = true
+        self.downloadProgressView.isHidden = true
+        
+        self.languageChangeBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered {
+                self.languageChangeBtn.image = NSImage(named: "AIchange_hover")
+            } else {
+                self.languageChangeBtn.image = NSImage(named: "AIchange")
+            }
+        }
+        
+        self.setUI()
+    }
+    
+    func setUI() {
+        if KMAppearance.isDarkMode() {
+            self.configTypeTitleLabel.textColor = NSColor(red: 255/255, green: 152/255, blue: 77/255, alpha: 1)
+            
+            self.toLanguageView.layer?.backgroundColor = NSColor(red: 110/255, green: 109/255, blue: 112/255, alpha: 1).cgColor
+            self.fromLanguageView.layer?.backgroundColor = NSColor(red: 110/255, green: 109/255, blue: 112/255, alpha: 1).cgColor
+            
+            self.infoCornerView.fillColor = NSColor.white.withAlphaComponent(0.05)
+            self.infoCornerView.lineColor = NSColor.white.withAlphaComponent(0.1)
+            self.infoCornerView.display()
+            
+            self.loadingCornerView.fillColor = NSColor.white.withAlphaComponent(0.05)
+            self.loadingCornerView.lineColor = NSColor.white.withAlphaComponent(0.1)
+            self.loadingCornerView.display()
+            
+            self.downloadProgressView.layer?.backgroundColor = KMAppearance.KMColor_Layout_L_2().cgColor
+            self.downloadInView.layer?.backgroundColor = NSColor(red: 0, green: 223/255, blue: 143/255, alpha: 1).cgColor
+        } else {
+            self.configTypeTitleLabel.textColor = NSColor(red: 240/255, green: 101/255, blue: 0, alpha: 1)
+            
+            self.fromLanguageView.layer?.backgroundColor = NSColor(red: 236/255, green: 242/255, blue: 254/255, alpha: 1).cgColor
+            self.toLanguageView.layer?.backgroundColor = NSColor(red: 236/255, green: 242/255, blue: 254/255, alpha: 1).cgColor
+            
+            self.infoCornerView.fillColor = NSColor.black.withAlphaComponent(0.03)
+            self.infoCornerView.lineColor = NSColor.black.withAlphaComponent(0.1)
+            self.infoCornerView.display()
+            
+            self.loadingCornerView.fillColor = NSColor.black.withAlphaComponent(0.03)
+            self.loadingCornerView.lineColor = NSColor.black.withAlphaComponent(0.1)
+            self.loadingCornerView.display()
+            
+            self.downloadProgressView.layer?.backgroundColor = KMAppearance.KMColor_Layout_L1().cgColor
+            self.downloadInView.layer?.backgroundColor = NSColor(red: 0, green: 223/255, blue: 143/255, alpha: 1).cgColor
+        }
+        
+        
+        
+        self.reWriteBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+        self.resultCopyBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+        self.resultSaveBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+        
+        self.reWriteBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered {
+                if KMAppearance.isDarkMode() {
+                    self.reWriteBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+                } else {
+                    self.reWriteBtn.setTitleColor(KMAppearance.KMColor_Layout_M_1())
+                }
+            } else {
+                self.reWriteBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+            }
+        }
+        
+        self.resultCopyBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered {
+                if KMAppearance.isDarkMode() {
+                    self.resultCopyBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+                } else {
+                    self.resultCopyBtn.setTitleColor(KMAppearance.KMColor_Layout_M_1())
+                }
+            } else {
+                self.resultCopyBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+            }
+        }
+        
+        self.resultSaveBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered {
+                if KMAppearance.isDarkMode() {
+                    self.resultSaveBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+                } else {
+                    self.resultSaveBtn.setTitleColor(KMAppearance.KMColor_Layout_M_1())
+                }
+            } else {
+                self.resultSaveBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
+            }
+        }
+        
+        if KMAppearance.isDarkMode() {
+            self.titleLabel1.textColor = NSColor.white.withAlphaComponent(0.85)
+            self.creditsLabel.textColor = NSColor.white.withAlphaComponent(0.85)
+            self.charactersLabel.textColor = NSColor.white.withAlphaComponent(0.5)
+            self.creditTipLabel.textColor = NSColor.white.withAlphaComponent(0.85)
+            
+            self.titleBox.fillColor = KMAppearance.KMColor_Layout_L1()
+            self.titleBox.layer!.borderColor = NSColor.white.withAlphaComponent(0.1).cgColor
+        } else {
+            self.titleLabel1.textColor = NSColor.black.withAlphaComponent(0.85)
+            self.creditsLabel.textColor = NSColor.black.withAlphaComponent(0.85)
+            self.charactersLabel.textColor = NSColor.black.withAlphaComponent(0.85)
+            self.creditTipLabel.textColor = NSColor.black.withAlphaComponent(0.5)
+            
+            self.titleBox.fillColor = KMAppearance.KMColor_Layout_L_1()
+            self.titleBox.layer!.borderColor = NSColor.black.withAlphaComponent(0.1).cgColor
+            
+        }
+        self.titleBox.cornerRadius = 2
+        self.titleBox.layer?.cornerRadius = 2
+        
+        self.errorTipLabel.textColor = KMAppearance.KMColor_Status_Err()
+        
+        self.resultFileDownloadBtn.title = NSLocalizedString("Download", comment: "")
+    }
+    
+    func reloadData() {
+        guard self.chatInfoModel != nil else {
+            return
+        }
+        
+        self.fromLanguage = self.chatInfoModel.translateFromLanguage
+        self.toLanguage = self.chatInfoModel.translateToLanguage
+        
+        self.setUpTranslateUI()
+        
+        self.reWriteBtn.isHidden = true
+        self.resultCopyBtn.isHidden = true
+        self.resultSaveBtn.isHidden = true
+        self.loadingContendView.isHidden = true
+        self.infoContendView.isHidden = true
+        self.sepImage1.isHidden = true
+        self.sepImage2.isHidden = true
+        self.downloadProgressView.isHidden = true
+        
+        if self.chatInfoModel.chatInfoState == .stateLoading {
+            self.loadingContendView.isHidden = false
+            self.loadingIndicator.startAnimation(nil)
+        } else {
+            self.loadingIndicator.stopAnimation(nil)
+            self.infoContendView.isHidden = false
+            self.confrimContendView.isHidden = true
+            self.resultContendView.isHidden = true
+            self.resultLabelTopConst.constant = 26
+            self.confirmBtn.isEnabled = false
+            
+            if self.chatInfoModel.chatInfoState == .stateInfoConfirm {
+                self.confrimContendView.isHidden = false
+                self.creditTipLabelTopConst.constant = 28
+                
+                if self.chatInfoModel.creditsValid == true {
+                    self.confirmBtn.isEnabled = true
+                    self.errorTipImage.isHidden = true
+                    self.errorTipLabel.isHidden = true
+                    self.confirmBtn.isEnabled = true
+                    self.creditTipLabelTopConst.constant = 4
+                } else {
+                    self.confirmBtn.isEnabled = false
+                    self.errorTipImage.isHidden = false
+                    self.errorTipLabel.isHidden = false
+                    self.confirmBtn.isEnabled = false
+                }
+                if self.chatInfoModel.costCredits > 1 {
+                    self.creditsLabel.stringValue = String(format: NSLocalizedString("%@ credits", comment: ""), String(format: "%d", self.chatInfoModel.costCredits))
+                } else {
+                    self.creditsLabel.stringValue = String(format: NSLocalizedString("%@ credit", comment: ""), String(format: "%d", self.chatInfoModel.costCredits))
+                }
+                self.charactersLabel.stringValue = String(format: NSLocalizedString("(Total %@ characters)", comment: ""), String(format: "%d", self.chatInfoModel.totalChart))
+
+                
+            } else {
+                self.resultFileView.isHidden = true
+                self.resultFileDownloadBtn.isHidden = true
+                self.languageChooseView.isHidden = true
+                self.resultLabel.isHidden = true
+                self.resultLabel.textColor = KMAppearance.KMColor_Layout_H0()
+                
+                if self.chatInfoModel.chatInfoState == .stateSuccess {
+                    self.resultContendView.isHidden = false
+                   
+                    if self.chatInfoModel.filePath.isEmpty == false {
+                        //文件
+                        self.resultFileView.isHidden = false
+                        self.resultFileDownloadBtn.isHidden = false
+                        
+                        let filePathURL = URL(fileURLWithPath: self.chatInfoModel.filePath)
+                        
+//                        self.fileNameLabel.stringValue = filePathURL.lastPathComponent
+                        let newFileName = filePathURL.deletingPathExtension().lastPathComponent + "_download." + filePathURL.pathExtension
+                        self.resultFileNameLabel.stringValue = newFileName
+                        
+                        self.resultFileSIzeLabel.stringValue = self.fileSizeString(Float(self.getFileSize(atPath: self.chatInfoModel.filePath)))
+                        
+                    } else {
+                        //文字
+                        self.reWriteBtn.isHidden = false
+                        self.resultCopyBtn.isHidden = false
+                        self.resultSaveBtn.isHidden = false
+                        self.sepImage1.isHidden = false
+                        self.sepImage2.isHidden = false
+                        
+                        self.languageChooseView.isHidden = false
+                        self.resultLabel.isHidden = false
+                        self.resultLabel.stringValue = self.chatInfoModel.chatResult
+                        
+                    }
+                    
+                } else if self.chatInfoModel.chatInfoState == .stateCancel {
+                    self.resultContendView.isHidden = false
+                    self.resultLabel.isHidden = false
+                    self.resultLabelTopConst.constant = 0
+                    self.resultLabel.stringValue = NSLocalizedString("The translation is canceled.", comment: "")
+                    
+                } else if self.chatInfoModel.chatInfoState == .stateFailed {
+                    self.resultContendView.isHidden = false
+                    self.resultLabel.isHidden = false
+                    self.resultLabelTopConst.constant = 0
+                    self.resultLabel.textColor = KMAppearance.KMColor_Status_Err()
+                    self.resultLabel.stringValue = self.chatInfoModel.chatResult
+                }
+            }
+        }
+    }
+    
+    func setUpTranslateUI() {
+        
+        var languages = ["Automatic", "English", "Simplified Chinese", "Traditional Chinese", "Japanese", "Korean", "French", "Spanish", "Italian", "German", "Portuguese", "Russian", "Vietnamese", "Thai", "Arabic", "Greek", "Bulgarian", "Finnish", "Slovene", "Dutch", "Czech", "Swedish", "Polish", "Danish", "Romanian", "Hungarian"]
+        let menu = NSMenu.init()
+        for idx in 0...languages.count-1 {
+            let string = languages[idx]
+            let menuItem = NSMenuItem.init(title: string, action: #selector(menuItemClick(_:)), keyEquivalent: "")
+            menuItem.tag = 1000 + idx
+            menuItem.target = self
+            menu.addItem(menuItem)
+        }
+        self.fromLanguageView?.menu = menu
+        if self.fromLanguage.isEmpty {
+            self.fromLanguage = "Automatic"
+        }
+        
+        languages = ["English", "Simplified Chinese", "Traditional Chinese", "Japanese", "Korean", "French", "Spanish", "Italian", "German", "Portuguese", "Russian", "Vietnamese", "Thai", "Arabic", "Greek", "Bulgarian", "Finnish", "Slovene", "Dutch", "Czech", "Swedish", "Polish", "Danish", "Romanian", "Hungarian"]
+        let toMenu = NSMenu.init()
+        for idx in 0...languages.count-1 {
+            let string = languages[idx]
+            let menuItem = NSMenuItem.init(title: string, action: #selector(menuItemClick(_:)), keyEquivalent: "")
+            menuItem.tag = 3000 + idx
+            menuItem.target = self
+            toMenu.addItem(menuItem)
+        }
+        self.toLanguageView?.menu = toMenu
+        if self.toLanguage.isEmpty {
+            self.toLanguage = "English"
+        }
+        
+        self.fromLanguageLabel.font = NSFont.SFProTextRegularFont(13)
+        self.toLanguageLabel.font = NSFont.SFProTextRegularFont(13)
+        self.fromLanguageLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        self.toLanguageLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        
+        self.fromLanguageLabel.stringValue = self.fromLanguage
+        self.toLanguageLabel.stringValue = self.toLanguage
+        
+        
+    }
+    
+    func getFileSize(atPath filePath : String) -> CGFloat {
+        guard let dict = try? FileManager.default.attributesOfItem(atPath: filePath) as NSDictionary else {
+            return 0
+        }
+        return CGFloat(dict.fileSize())
+    }
+    
+    func fileSizeString(_ fSize: Float) -> String {
+        let fileSize = fSize / 1024
+        let size = fileSize >= 1024 ? (fileSize < 1048576 ? fileSize/1024 : fileSize/1048576.0) : fileSize
+        let unit = fileSize >= 1024 ? (fileSize < 1048576 ? "M" : "G") : "K"
+        return String(format: "%0.1f %@", size, unit)
+    }
+    
+    //MARK: IBAction
+    @objc func menuItemClick(_ item: NSMenuItem) {
+        if item.tag < 2000 {
+            self.fromLanguage = item.title
+        } else {
+            self.toLanguage = item.title
+        }
+        self.fromLanguageLabel.stringValue = self.fromLanguage
+        self.toLanguageLabel.stringValue = self.toLanguage
+    }
+    
+    @IBAction func confirmCancelAction(_ sender: Any) {
+        guard let callBack = self.cancelAIHandle else {
+            return
+        }
+        callBack(self)
+    }
+    
+    @IBAction func confirmStartAction(_ sender: Any) {
+        guard let callBack = self.startAIHandle else {
+            return
+        }
+        callBack(self)
+    }
+    
+    @IBAction func fileDownloadAction(_ sender: NSButton) {
+        let fileName = self.resultFileNameLabel.stringValue
+        let outputSavePanel = NSSavePanel()
+        outputSavePanel.allowedFileTypes = ["pdf"]
+        outputSavePanel.nameFieldStringValue = fileName
+        let result = outputSavePanel.runModal()
+        if result == .OK {
+            let filePath = outputSavePanel.url?.path
+            
+            self.resultFileDownloadBtn.isEnabled = false
+            
+            self.downloadProgressView.isHidden = false
+            var rect = self.downloadInView.frame
+            rect.size.width = 0
+            self.downloadInView.frame = rect
+            
+            let timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true) { timer in
+                var rect = self.downloadInView.frame
+                rect.size.width += 1
+                if rect.size.width > CGRectGetWidth(self.downloadProgressView.frame) {
+                    rect.size.width = CGRectGetWidth(self.downloadProgressView.frame)
+                }
+                self.downloadInView.frame = rect
+                
+            }
+            
+            //MARK: TestData
+//            DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 13) {
+//                self.resultFileDownloadBtn.isEnabled = true
+//                timer.invalidate()
+//            }
+            
+            KMAIRequestServerManager.defaultManager.downloadFile(filePath: self.chatInfoModel.chatResult, downFileName: KMAIRequestServerManager.defaultManager.downFileName, toPath: filePath!) { wrapper in
+                DispatchQueue.main.async {
+                    self.downloadProgressView.isHidden = true
+                    self.resultFileDownloadBtn.isEnabled = true
+                    timer .invalidate()
+                    if wrapper.success {
+                        NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: wrapper.content)])
+                    } else {
+                        
+                    }
+                }
+            }
+            
+        }
+    }
+    
+    @IBAction func chooseLanguageAction(_ sender: NSButton) {
+        if sender == self.fromLanguageBtn {
+            let menu = self.fromLanguageView?.menu
+            menu?.popUp(positioning: menu?.item(at: 0), at: CGPoint(x: 0, y: 15), in: sender)
+        } else if sender == self.toLanguageBtn {
+            let menu = self.toLanguageView?.menu
+            menu?.popUp(positioning: menu?.item(at: 0), at: CGPoint(x: 0, y: 15), in: sender)
+        }
+    }
+    
+    @IBAction func languageChangeAction(_ sender: Any) {
+        let curLan = self.fromLanguage
+        self.fromLanguage = self.toLanguage
+        self.toLanguage = curLan
+        
+        self.fromLanguageLabel.stringValue = self.fromLanguage
+        self.toLanguageLabel.stringValue = self.toLanguage
+    }
+    
+    @IBAction func redoAction(_ sender: KMButton) {
+        
+        let menu = NSMenu()
+        
+        let confirmView = AIRedoConfirmView.createFromNib()
+        confirmView?.redoHandle = {[unowned self] view in
+            menu.cancelTracking()
+            
+            self.chatInfoModel.translateFromLanguage = self.fromLanguage
+            self.chatInfoModel.translateToLanguage = self.toLanguage
+            
+            guard let callBack = self.redoHandle else {
+                return
+            }
+            callBack(self, self.chatInfoModel)
+        }
+        let menuItem = NSMenuItem(title: NSLocalizedString("Save as TXT", comment: ""), action: #selector(saveAsTextItemClicked(_:)), keyEquivalent: "")
+        menuItem.target = self
+        menuItem.view = confirmView
+        menu.addItem(menuItem)
+        
+        menu.popUp(positioning: nil, at: CGPoint(x: sender.frame.size.width, y: 0 ), in: sender)
+
+    }
+    
+    @IBAction func copyAction(_ sender: KMButton) {
+        guard let callBack = self.copyHandle else {
+            return
+        }
+        callBack(self, self.chatInfoModel)
+        
+    }
+     
+    @IBAction func saveAsAction(_ sender: KMButton) {
+        
+        let menu = NSMenu()
+        
+        let menuItem = NSMenuItem(title: NSLocalizedString("Save as TXT", comment: ""), action: #selector(saveAsTextItemClicked(_:)), keyEquivalent: "")
+        menuItem.target = self
+        menu.addItem(menuItem)
+        
+        let pdfItem = NSMenuItem(title: NSLocalizedString("Save as PDF", comment: ""), action: #selector(saveAsPDFItemClicked(_:)), keyEquivalent: "")
+        pdfItem.target = self
+        menu.addItem(pdfItem)
+        
+        let point = sender.superview?.convert(sender.frame.origin, from: self.view.window?.contentView)
+        menu.popUp(positioning: nil, at: CGPoint(x: sender.frame.size.width, y: 0 ), in: sender)
+        
+    }
+    
+    
+    @objc func saveAsTextItemClicked(_ item: NSMenuItem) {
+        let fileName = "Untitled"
+        let outputSavePanel = NSSavePanel()
+        outputSavePanel.allowedFileTypes = ["txt"]
+        outputSavePanel.nameFieldStringValue = fileName
+        let result = outputSavePanel.runModal()
+        if result == .OK {
+            let filePath = outputSavePanel.url?.path
+            do {
+                
+                if self.chatInfoModel.aiConfigType == .summarize ||
+                    self.chatInfoModel.aiConfigType == .reWriting ||
+                    self.chatInfoModel.aiConfigType == .proofreading {
+                    
+                    try self.chatInfoModel.chatResult.write(to: outputSavePanel.url!, atomically: true, encoding: .utf8)
+                    
+                    NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: filePath!)])
+                    KMFunctionGuideWindowController.setDidShowFor(.aiInfoResultSave)
+                }
+                 
+            } catch {
+                
+            }
+            
+        }
+    }
+    
+    @objc func saveAsPDFItemClicked(_ item: NSMenuItem) {
+        let fileName = "Untitled"
+        let outputSavePanel = NSSavePanel()
+        outputSavePanel.allowedFileTypes = ["pdf"]
+        outputSavePanel.nameFieldStringValue = fileName
+        let result = outputSavePanel.runModal()
+        if result == .OK {
+            let filePath = outputSavePanel.url?.path
+            let text = self.chatInfoModel.chatResult
+            self.createPDF(from: text, saveTo: filePath!)
+            
+            NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: filePath!)])
+            
+            KMFunctionGuideWindowController.setDidShowFor(.aiInfoResultSave)
+            
+        }
+    }
+    
+    @objc func emptyItemClicked(_ item: NSMenuItem) {
+        
+    }
+    
+    func createPDF(from text: String, saveTo path: String) {
+        let attributedText = NSAttributedString(string: text)
+        let pdfData = NSMutableData()
+        
+        let pdfConsumer = CGDataConsumer(data: pdfData)!
+        var mediaBox = CGRect(x: 0, y: 0, width: 612, height: 792) // 设置页面尺寸,这里使用默认的美国信纸尺寸
+        
+        let pdfContext = CGContext(consumer: pdfConsumer, mediaBox: &mediaBox, nil)!
+        pdfContext.beginPage(mediaBox: &mediaBox)
+        pdfContext.textMatrix = .identity
+        pdfContext.setShouldAntialias(true)
+        
+        let frame = mediaBox.insetBy(dx: 20, dy: 20) // 设置文字边距
+        
+        let framesetter = CTFramesetterCreateWithAttributedString(attributedText as CFAttributedString)
+        let framePath = CGPath(rect: frame, transform: nil)
+        let frameRef = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, attributedText.length), framePath, nil)
+        CTFrameDraw(frameRef, pdfContext)
+        
+        pdfContext.endPage()
+        pdfContext.closePDF()
+        
+        pdfData.write(toFile: path, atomically: true)
+        print("PDF 文件已保存至:\(path)")
+    }
+}

+ 551 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIChatView/CollectionViewItems/AIChatTranslateResultItem.xib

@@ -0,0 +1,551 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="AIChatTranslateResultItem" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <connections>
+                <outlet property="cancelBtn" destination="xsO-hA-gdz" id="OYj-2b-oYp"/>
+                <outlet property="charactersLabel" destination="eL4-4t-skv" id="e11-36-Rhn"/>
+                <outlet property="configTypeTitleLabel" destination="HeC-uc-Lvd" id="2Wt-As-6s4"/>
+                <outlet property="confirmBtn" destination="Jgb-Ot-ndE" id="Hsk-iN-MEu"/>
+                <outlet property="confrimContendView" destination="QoN-Ij-W9s" id="Vqw-vI-zqG"/>
+                <outlet property="contendView" destination="hj2-WS-US0" id="mIL-2G-09n"/>
+                <outlet property="creditTipLabel" destination="naT-Y0-9kC" id="F7p-yR-qoL"/>
+                <outlet property="creditTipLabelTopConst" destination="d4U-hA-JBu" id="vcr-HO-azv"/>
+                <outlet property="creditsLabel" destination="Gbk-GY-H9S" id="kEe-xK-RUZ"/>
+                <outlet property="downloadInView" destination="jOO-UF-1S7" id="kYy-WX-bde"/>
+                <outlet property="downloadProgressView" destination="hZq-qe-ZwO" id="2Zi-Dm-dB3"/>
+                <outlet property="errorTipImage" destination="VDo-2Y-CJn" id="O2R-xN-7rx"/>
+                <outlet property="errorTipLabel" destination="a2a-dv-0Nh" id="Gj3-Ag-LKX"/>
+                <outlet property="fromLanguageBtn" destination="rN9-U5-KQT" id="zB5-d7-dlk"/>
+                <outlet property="fromLanguageLabel" destination="3q7-ZI-Tz5" id="FSM-QY-fRl"/>
+                <outlet property="fromLanguageView" destination="mAu-p4-Ddb" id="eTh-tb-SRx"/>
+                <outlet property="infoContendView" destination="6SG-A3-eYJ" id="r7G-zI-Pgf"/>
+                <outlet property="languageChangeBtn" destination="aNa-ze-qpF" id="Hcu-PJ-QjN"/>
+                <outlet property="languageChooseView" destination="3uH-1g-e9P" id="UR6-3a-Hj8"/>
+                <outlet property="loadingContendView" destination="y04-IX-qtb" id="n0K-79-iql"/>
+                <outlet property="loadingCornerView" destination="WSL-1b-Epz" id="cSm-BD-IFH"/>
+                <outlet property="loadingIndicator" destination="f2W-tQ-ab2" id="0W9-qD-zRF"/>
+                <outlet property="reWriteBtn" destination="ZE8-Jn-wNb" id="a5e-tC-Jy4"/>
+                <outlet property="resultContendView" destination="TRx-EZ-2Pp" id="Np5-rl-fWs"/>
+                <outlet property="resultCopyBtn" destination="oQu-jj-W6q" id="fPQ-CX-pfc"/>
+                <outlet property="resultFileDownloadBtn" destination="nhk-ig-b3B" id="9fz-iK-6nS"/>
+                <outlet property="resultFileNameLabel" destination="NI0-Jx-fTP" id="7ft-PY-oBD"/>
+                <outlet property="resultFileSIzeLabel" destination="Mj9-uy-fOq" id="a4Z-sd-QKm"/>
+                <outlet property="resultFileView" destination="4jJ-S8-8Zo" id="iRe-A7-5cI"/>
+                <outlet property="resultLabel" destination="b3H-r0-MzM" id="rE0-kM-cee"/>
+                <outlet property="resultLabelTopConst" destination="9Eh-wb-sqi" id="f9S-4d-SBW"/>
+                <outlet property="resultSaveBtn" destination="9ef-8h-vxe" id="RG8-eB-YDo"/>
+                <outlet property="sepImage1" destination="6Pu-q0-WyG" id="zaD-H1-BaI"/>
+                <outlet property="sepImage2" destination="msJ-8N-bgb" id="nYN-w9-zZM"/>
+                <outlet property="titleBox" destination="v1L-lI-6Dc" id="l0R-kj-FEo"/>
+                <outlet property="titleLabel1" destination="15y-ao-sJW" id="P2K-2Q-fW2"/>
+                <outlet property="toLanguageBtn" destination="99O-kV-8Es" id="fUa-tq-PXE"/>
+                <outlet property="toLanguageLabel" destination="sZu-bd-B0e" id="pHM-l9-HGr"/>
+                <outlet property="toLanguageView" destination="KKz-t2-o7n" id="VoY-9X-pOf"/>
+                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="Hz6-mo-xeY">
+            <rect key="frame" x="0.0" y="0.0" width="276" height="228"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="hj2-WS-US0">
+                    <rect key="frame" x="0.0" y="0.0" width="276" height="228"/>
+                    <subviews>
+                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="b2Z-dU-aPH">
+                            <rect key="frame" x="13" y="204" width="24" height="24"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="24" id="Plj-dN-3UH"/>
+                                <constraint firstAttribute="height" constant="24" id="zzm-Ap-IUO"/>
+                            </constraints>
+                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="AIChatRobot" id="8yn-2p-9uQ"/>
+                        </imageView>
+                        <button allowsExpansionToolTips="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZE8-Jn-wNb" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                            <rect key="frame" x="86" y="208" width="50" height="16"/>
+                            <buttonCell key="cell" type="bevel" title="Rewrite" bezelStyle="rounded" alignment="center" lineBreakMode="truncatingMiddle" imageScaling="proportionallyDown" inset="2" id="cyR-Jh-AaY">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                            <constraints>
+                                <constraint firstAttribute="width" relation="lessThanOrEqual" constant="65" id="sXT-XN-ouA"/>
+                            </constraints>
+                            <connections>
+                                <action selector="redoAction:" target="-2" id="5w6-it-5tJ"/>
+                            </connections>
+                        </button>
+                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="6Pu-q0-WyG">
+                            <rect key="frame" x="143" y="211" width="1" height="10"/>
+                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="aiVLine" id="lGF-TG-4Ud"/>
+                        </imageView>
+                        <button allowsExpansionToolTips="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="oQu-jj-W6q" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                            <rect key="frame" x="151" y="208" width="36" height="16"/>
+                            <buttonCell key="cell" type="bevel" title="Copy" bezelStyle="rounded" alignment="center" lineBreakMode="truncatingMiddle" imageScaling="proportionallyDown" inset="2" id="Jr6-LU-hLc">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                            <constraints>
+                                <constraint firstAttribute="width" relation="lessThanOrEqual" constant="65" id="0WP-OZ-Y1h"/>
+                            </constraints>
+                            <connections>
+                                <action selector="copyAction:" target="-2" id="TgY-Kx-qC8"/>
+                            </connections>
+                        </button>
+                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="msJ-8N-bgb">
+                            <rect key="frame" x="194" y="211" width="1" height="10"/>
+                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="aiVLine" id="Cwr-Ze-x1n"/>
+                        </imageView>
+                        <button allowsExpansionToolTips="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9ef-8h-vxe" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                            <rect key="frame" x="202" y="208" width="51" height="16"/>
+                            <buttonCell key="cell" type="bevel" title="Save as" bezelStyle="rounded" alignment="center" lineBreakMode="truncatingMiddle" imageScaling="proportionallyDown" inset="2" id="28i-Kv-gdC">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                            <constraints>
+                                <constraint firstAttribute="width" relation="lessThanOrEqual" constant="65" id="7Xt-Pd-9jA"/>
+                            </constraints>
+                            <connections>
+                                <action selector="saveAsAction:" target="-2" id="zBR-aI-xhD"/>
+                            </connections>
+                        </button>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="y04-IX-qtb">
+                            <rect key="frame" x="13" y="0.0" width="240" height="200"/>
+                            <subviews>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="WSL-1b-Epz" customClass="LeftTopRoundedRectView" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                    <rect key="frame" x="0.0" y="0.0" width="240" height="200"/>
+                                </customView>
+                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Jye-MB-ieh">
+                                    <rect key="frame" x="80" y="60" width="80" height="80"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="80" id="KtZ-Pz-qdh"/>
+                                        <constraint firstAttribute="height" constant="80" id="U40-gH-A1d"/>
+                                    </constraints>
+                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="robot-gray" id="neH-mb-JBJ"/>
+                                </imageView>
+                                <progressIndicator maxValue="100" indeterminate="YES" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="f2W-tQ-ab2">
+                                    <rect key="frame" x="104" y="84" width="32" height="32"/>
+                                </progressIndicator>
+                            </subviews>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="240" id="LMC-ye-IEG"/>
+                                <constraint firstItem="WSL-1b-Epz" firstAttribute="top" secondItem="y04-IX-qtb" secondAttribute="top" id="N7E-37-7R8"/>
+                                <constraint firstAttribute="trailing" secondItem="WSL-1b-Epz" secondAttribute="trailing" id="NHE-2p-BBO"/>
+                                <constraint firstAttribute="bottom" secondItem="WSL-1b-Epz" secondAttribute="bottom" id="QHM-P9-8XH"/>
+                                <constraint firstItem="Jye-MB-ieh" firstAttribute="centerY" secondItem="y04-IX-qtb" secondAttribute="centerY" id="SdQ-tN-Iyh"/>
+                                <constraint firstItem="Jye-MB-ieh" firstAttribute="centerX" secondItem="y04-IX-qtb" secondAttribute="centerX" id="b0F-0R-wNH"/>
+                                <constraint firstItem="f2W-tQ-ab2" firstAttribute="centerY" secondItem="y04-IX-qtb" secondAttribute="centerY" id="gaS-HI-CWK"/>
+                                <constraint firstItem="WSL-1b-Epz" firstAttribute="leading" secondItem="y04-IX-qtb" secondAttribute="leading" id="q8d-na-lis"/>
+                                <constraint firstItem="f2W-tQ-ab2" firstAttribute="centerX" secondItem="y04-IX-qtb" secondAttribute="centerX" id="reO-gr-2rl"/>
+                            </constraints>
+                        </customView>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="6SG-A3-eYJ">
+                            <rect key="frame" x="13" y="0.0" width="240" height="200"/>
+                            <subviews>
+                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HeC-uc-Lvd">
+                                    <rect key="frame" x="10" y="176" width="49" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" title="# AI XX" id="KHm-Ru-wfh">
+                                        <font key="font" usesAppearanceFont="YES"/>
+                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="QoN-Ij-W9s">
+                                    <rect key="frame" x="0.0" y="12" width="240" height="152"/>
+                                    <subviews>
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="15y-ao-sJW">
+                                            <rect key="frame" x="10" y="132" width="121" height="16"/>
+                                            <textFieldCell key="cell" lineBreakMode="clipping" title="You need to spend:" id="fym-zS-3lv">
+                                                <font key="font" usesAppearanceFont="YES"/>
+                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            </textFieldCell>
+                                        </textField>
+                                        <box boxType="custom" borderType="none" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="v1L-lI-6Dc" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                            <rect key="frame" x="137" y="128" width="79" height="24"/>
+                                            <view key="contentView" id="SlD-d5-DfR">
+                                                <rect key="frame" x="0.0" y="0.0" width="79" height="24"/>
+                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                <subviews>
+                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Gbk-GY-H9S">
+                                                        <rect key="frame" x="6" y="4" width="67" height="16"/>
+                                                        <textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="2 Credits" id="e5F-0a-Nci">
+                                                            <font key="font" metaFont="systemBold"/>
+                                                            <color key="textColor" red="0.99999600649999998" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                        </textFieldCell>
+                                                    </textField>
+                                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zgC-Pk-L2T" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                                        <rect key="frame" x="0.0" y="0.0" width="79" height="24"/>
+                                                        <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="lQo-iH-S4R">
+                                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                            <font key="font" metaFont="system"/>
+                                                        </buttonCell>
+                                                    </button>
+                                                </subviews>
+                                                <constraints>
+                                                    <constraint firstItem="zgC-Pk-L2T" firstAttribute="leading" secondItem="SlD-d5-DfR" secondAttribute="leading" id="635-OA-Qk0"/>
+                                                    <constraint firstAttribute="trailing" secondItem="zgC-Pk-L2T" secondAttribute="trailing" id="AS8-TL-Eby"/>
+                                                    <constraint firstItem="Gbk-GY-H9S" firstAttribute="centerY" secondItem="SlD-d5-DfR" secondAttribute="centerY" id="Dhh-3Q-6d0"/>
+                                                    <constraint firstItem="Gbk-GY-H9S" firstAttribute="leading" secondItem="SlD-d5-DfR" secondAttribute="leading" constant="8" id="Mvj-wJ-NEk"/>
+                                                    <constraint firstAttribute="trailing" secondItem="Gbk-GY-H9S" secondAttribute="trailing" constant="8" id="TRx-DV-elu"/>
+                                                    <constraint firstItem="Gbk-GY-H9S" firstAttribute="centerX" secondItem="SlD-d5-DfR" secondAttribute="centerX" id="ZYk-9R-fIG"/>
+                                                    <constraint firstItem="zgC-Pk-L2T" firstAttribute="top" secondItem="SlD-d5-DfR" secondAttribute="top" id="ud6-Ml-egm"/>
+                                                    <constraint firstAttribute="bottom" secondItem="zgC-Pk-L2T" secondAttribute="bottom" id="w9t-xK-M7H"/>
+                                                </constraints>
+                                            </view>
+                                            <constraints>
+                                                <constraint firstAttribute="height" constant="24" id="kIR-hb-Ktv"/>
+                                            </constraints>
+                                            <color key="fillColor" red="1" green="0.36862745099999999" blue="0.17254901959999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        </box>
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="eL4-4t-skv">
+                                            <rect key="frame" x="10" y="104" width="148" height="16"/>
+                                            <textFieldCell key="cell" lineBreakMode="clipping" title="(Total 2483 characters)" id="Z9g-oL-ucD">
+                                                <font key="font" usesAppearanceFont="YES"/>
+                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            </textFieldCell>
+                                        </textField>
+                                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="VDo-2Y-CJn">
+                                            <rect key="frame" x="12" y="81" width="15" height="15"/>
+                                            <constraints>
+                                                <constraint firstAttribute="height" constant="15" id="IZ8-AS-I54"/>
+                                                <constraint firstAttribute="width" constant="15" id="dsZ-uw-oQ6"/>
+                                            </constraints>
+                                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="creditNoTip" id="Ghd-Qi-6It"/>
+                                        </imageView>
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="a2a-dv-0Nh">
+                                            <rect key="frame" x="29" y="81" width="113" height="16"/>
+                                            <textFieldCell key="cell" lineBreakMode="clipping" title="Insufficient Credit" id="Fqh-xG-54K">
+                                                <font key="font" usesAppearanceFont="YES"/>
+                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            </textFieldCell>
+                                        </textField>
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="naT-Y0-9kC">
+                                            <rect key="frame" x="10" y="40" width="220" height="32"/>
+                                            <constraints>
+                                                <constraint firstAttribute="width" constant="216" id="pkR-QP-VVC"/>
+                                            </constraints>
+                                            <textFieldCell key="cell" title="1 Credit is consumed per 10000 characters." id="6eI-Zg-0Xd">
+                                                <font key="font" usesAppearanceFont="YES"/>
+                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            </textFieldCell>
+                                        </textField>
+                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xsO-hA-gdz">
+                                            <rect key="frame" x="101" y="-7" width="76" height="32"/>
+                                            <buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="IdT-9s-Smj">
+                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                <font key="font" metaFont="system"/>
+                                            </buttonCell>
+                                            <connections>
+                                                <action selector="confirmCancelAction:" target="-2" id="Owo-5n-Edm"/>
+                                            </connections>
+                                        </button>
+                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Jgb-Ot-ndE">
+                                            <rect key="frame" x="171" y="-7" width="64" height="32"/>
+                                            <buttonCell key="cell" type="push" title="Start" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="3Lm-by-yEL">
+                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                <font key="font" metaFont="system"/>
+                                                <string key="keyEquivalent" base64-UTF8="YES">
+DQ
+</string>
+                                            </buttonCell>
+                                            <connections>
+                                                <action selector="confirmStartAction:" target="-2" id="v3M-Qd-E2d"/>
+                                            </connections>
+                                        </button>
+                                    </subviews>
+                                    <constraints>
+                                        <constraint firstItem="Jgb-Ot-ndE" firstAttribute="leading" secondItem="xsO-hA-gdz" secondAttribute="trailing" constant="8" id="1xv-WC-0rd"/>
+                                        <constraint firstAttribute="bottom" secondItem="xsO-hA-gdz" secondAttribute="bottom" id="DE2-rW-AK3"/>
+                                        <constraint firstAttribute="trailing" secondItem="Jgb-Ot-ndE" secondAttribute="trailing" constant="12" id="JAw-8r-2Hx"/>
+                                        <constraint firstItem="v1L-lI-6Dc" firstAttribute="centerY" secondItem="15y-ao-sJW" secondAttribute="centerY" id="Mfr-aW-Le8"/>
+                                        <constraint firstItem="eL4-4t-skv" firstAttribute="leading" secondItem="QoN-Ij-W9s" secondAttribute="leading" constant="12" id="VLm-Pg-Npn"/>
+                                        <constraint firstItem="a2a-dv-0Nh" firstAttribute="leading" secondItem="VDo-2Y-CJn" secondAttribute="trailing" constant="4" id="Vcr-Wa-rPU"/>
+                                        <constraint firstItem="a2a-dv-0Nh" firstAttribute="centerY" secondItem="VDo-2Y-CJn" secondAttribute="centerY" id="cCU-8N-aGV"/>
+                                        <constraint firstItem="naT-Y0-9kC" firstAttribute="top" secondItem="eL4-4t-skv" secondAttribute="bottom" constant="32" id="d4U-hA-JBu"/>
+                                        <constraint firstItem="15y-ao-sJW" firstAttribute="leading" secondItem="QoN-Ij-W9s" secondAttribute="leading" constant="12" id="efQ-pa-E1Q"/>
+                                        <constraint firstItem="v1L-lI-6Dc" firstAttribute="leading" secondItem="15y-ao-sJW" secondAttribute="trailing" constant="8" id="hvk-b2-Qut"/>
+                                        <constraint firstAttribute="bottom" secondItem="Jgb-Ot-ndE" secondAttribute="bottom" id="jkb-c0-xeV"/>
+                                        <constraint firstItem="VDo-2Y-CJn" firstAttribute="leading" secondItem="QoN-Ij-W9s" secondAttribute="leading" constant="12" id="rXx-b3-2MA"/>
+                                        <constraint firstItem="naT-Y0-9kC" firstAttribute="leading" secondItem="QoN-Ij-W9s" secondAttribute="leading" constant="12" id="rrE-Na-Ogd"/>
+                                        <constraint firstItem="VDo-2Y-CJn" firstAttribute="top" secondItem="eL4-4t-skv" secondAttribute="bottom" constant="8" id="sU3-ld-nyr"/>
+                                        <constraint firstItem="eL4-4t-skv" firstAttribute="top" secondItem="v1L-lI-6Dc" secondAttribute="bottom" constant="8" id="yfV-M9-nvz"/>
+                                        <constraint firstItem="v1L-lI-6Dc" firstAttribute="top" secondItem="QoN-Ij-W9s" secondAttribute="top" id="zSE-p1-VkN"/>
+                                    </constraints>
+                                </customView>
+                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="TRx-EZ-2Pp">
+                                    <rect key="frame" x="0.0" y="12" width="240" height="152"/>
+                                    <subviews>
+                                        <customView hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3uH-1g-e9P">
+                                            <rect key="frame" x="0.0" y="132" width="240" height="20"/>
+                                            <subviews>
+                                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="mAu-p4-Ddb">
+                                                    <rect key="frame" x="8" y="0.0" width="61" height="20"/>
+                                                    <subviews>
+                                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3q7-ZI-Tz5">
+                                                            <rect key="frame" x="6" y="2" width="37" height="16"/>
+                                                            <textFieldCell key="cell" lineBreakMode="truncatingTail" title="Label" id="NBt-b1-pYC">
+                                                                <font key="font" usesAppearanceFont="YES"/>
+                                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                            </textFieldCell>
+                                                        </textField>
+                                                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Ss4-oy-URV">
+                                                            <rect key="frame" x="43" y="5" width="10" height="10"/>
+                                                            <constraints>
+                                                                <constraint firstAttribute="width" constant="10" id="Bs0-Bs-Mbe"/>
+                                                                <constraint firstAttribute="height" constant="10" id="PVv-hl-QSp"/>
+                                                            </constraints>
+                                                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ic_btn_arrow_down" id="RkN-NR-Yzm"/>
+                                                        </imageView>
+                                                        <button translatesAutoresizingMaskIntoConstraints="NO" id="rN9-U5-KQT">
+                                                            <rect key="frame" x="0.0" y="0.0" width="61" height="20"/>
+                                                            <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="Idl-ce-m1B">
+                                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                                <font key="font" metaFont="system"/>
+                                                            </buttonCell>
+                                                            <connections>
+                                                                <action selector="chooseLanguageAction:" target="-2" id="qJk-Dm-8Y3"/>
+                                                            </connections>
+                                                        </button>
+                                                    </subviews>
+                                                    <constraints>
+                                                        <constraint firstItem="3q7-ZI-Tz5" firstAttribute="leading" secondItem="mAu-p4-Ddb" secondAttribute="leading" constant="8" id="31S-2n-eZ0"/>
+                                                        <constraint firstAttribute="trailing" secondItem="rN9-U5-KQT" secondAttribute="trailing" id="5eR-a5-iNK"/>
+                                                        <constraint firstItem="Ss4-oy-URV" firstAttribute="leading" secondItem="3q7-ZI-Tz5" secondAttribute="trailing" constant="2" id="Gke-ge-M5F"/>
+                                                        <constraint firstAttribute="bottom" secondItem="rN9-U5-KQT" secondAttribute="bottom" id="X0S-OY-6eU"/>
+                                                        <constraint firstItem="rN9-U5-KQT" firstAttribute="top" secondItem="mAu-p4-Ddb" secondAttribute="top" id="fy8-q7-biw"/>
+                                                        <constraint firstItem="rN9-U5-KQT" firstAttribute="leading" secondItem="mAu-p4-Ddb" secondAttribute="leading" id="iRo-bx-64H"/>
+                                                        <constraint firstAttribute="trailing" secondItem="Ss4-oy-URV" secondAttribute="trailing" constant="8" id="mbf-RJ-ylI"/>
+                                                        <constraint firstAttribute="width" relation="lessThanOrEqual" constant="95" id="nhr-2B-ILu"/>
+                                                        <constraint firstItem="Ss4-oy-URV" firstAttribute="centerY" secondItem="mAu-p4-Ddb" secondAttribute="centerY" id="ov0-sC-YLy"/>
+                                                        <constraint firstItem="3q7-ZI-Tz5" firstAttribute="centerY" secondItem="mAu-p4-Ddb" secondAttribute="centerY" id="yZ1-fx-ieD"/>
+                                                    </constraints>
+                                                </customView>
+                                                <button translatesAutoresizingMaskIntoConstraints="NO" id="aNa-ze-qpF" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                                    <rect key="frame" x="73" y="1" width="18" height="18"/>
+                                                    <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="AIchange" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="UNm-pG-Qkg">
+                                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                        <font key="font" metaFont="system"/>
+                                                    </buttonCell>
+                                                    <connections>
+                                                        <action selector="languageChangeAction:" target="-2" id="k1H-5z-FCs"/>
+                                                    </connections>
+                                                </button>
+                                                <customView translatesAutoresizingMaskIntoConstraints="NO" id="KKz-t2-o7n">
+                                                    <rect key="frame" x="95" y="0.0" width="61" height="20"/>
+                                                    <subviews>
+                                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sZu-bd-B0e">
+                                                            <rect key="frame" x="6" y="2" width="37" height="16"/>
+                                                            <textFieldCell key="cell" lineBreakMode="truncatingTail" title="Label" id="7vr-zH-rw8">
+                                                                <font key="font" usesAppearanceFont="YES"/>
+                                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                            </textFieldCell>
+                                                        </textField>
+                                                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="13l-eS-52a">
+                                                            <rect key="frame" x="43" y="5" width="10" height="10"/>
+                                                            <constraints>
+                                                                <constraint firstAttribute="width" constant="10" id="RXr-6T-ARO"/>
+                                                                <constraint firstAttribute="height" constant="10" id="vHz-3e-rnZ"/>
+                                                            </constraints>
+                                                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ic_btn_arrow_down" id="3Fd-8o-RbG"/>
+                                                        </imageView>
+                                                        <button translatesAutoresizingMaskIntoConstraints="NO" id="99O-kV-8Es">
+                                                            <rect key="frame" x="0.0" y="0.0" width="61" height="20"/>
+                                                            <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="Z1O-OX-OF6">
+                                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                                <font key="font" metaFont="system"/>
+                                                            </buttonCell>
+                                                            <connections>
+                                                                <action selector="chooseLanguageAction:" target="-2" id="lPe-7S-e0p"/>
+                                                            </connections>
+                                                        </button>
+                                                    </subviews>
+                                                    <constraints>
+                                                        <constraint firstItem="sZu-bd-B0e" firstAttribute="leading" secondItem="KKz-t2-o7n" secondAttribute="leading" constant="8" id="56l-fg-Pw0"/>
+                                                        <constraint firstItem="99O-kV-8Es" firstAttribute="leading" secondItem="KKz-t2-o7n" secondAttribute="leading" id="DNZ-xd-ys7"/>
+                                                        <constraint firstAttribute="bottom" secondItem="99O-kV-8Es" secondAttribute="bottom" id="EG0-4P-TyR"/>
+                                                        <constraint firstItem="13l-eS-52a" firstAttribute="leading" secondItem="sZu-bd-B0e" secondAttribute="trailing" constant="2" id="MK3-6M-1g5"/>
+                                                        <constraint firstAttribute="width" relation="lessThanOrEqual" constant="95" id="P4Q-ix-VQr"/>
+                                                        <constraint firstAttribute="trailing" secondItem="13l-eS-52a" secondAttribute="trailing" constant="8" id="QwG-ic-lkb"/>
+                                                        <constraint firstItem="99O-kV-8Es" firstAttribute="top" secondItem="KKz-t2-o7n" secondAttribute="top" id="bkf-A2-8s4"/>
+                                                        <constraint firstItem="13l-eS-52a" firstAttribute="centerY" secondItem="KKz-t2-o7n" secondAttribute="centerY" id="nov-qd-q1I"/>
+                                                        <constraint firstAttribute="trailing" secondItem="99O-kV-8Es" secondAttribute="trailing" id="usG-CY-Rga"/>
+                                                        <constraint firstItem="sZu-bd-B0e" firstAttribute="centerY" secondItem="KKz-t2-o7n" secondAttribute="centerY" id="w6h-iA-Jrf"/>
+                                                    </constraints>
+                                                </customView>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="aNa-ze-qpF" firstAttribute="leading" secondItem="mAu-p4-Ddb" secondAttribute="trailing" constant="4" id="1Rr-NN-BN3"/>
+                                                <constraint firstItem="mAu-p4-Ddb" firstAttribute="leading" secondItem="3uH-1g-e9P" secondAttribute="leading" constant="8" id="Ihb-Bo-c4K"/>
+                                                <constraint firstItem="KKz-t2-o7n" firstAttribute="leading" secondItem="aNa-ze-qpF" secondAttribute="trailing" constant="4" id="Qvh-HO-DjE"/>
+                                                <constraint firstItem="aNa-ze-qpF" firstAttribute="centerY" secondItem="3uH-1g-e9P" secondAttribute="centerY" id="nwW-Mk-BeW"/>
+                                                <constraint firstAttribute="height" constant="20" id="tJx-kR-WAf"/>
+                                                <constraint firstAttribute="bottom" secondItem="KKz-t2-o7n" secondAttribute="bottom" id="tqk-CP-AFd"/>
+                                                <constraint firstAttribute="bottom" secondItem="mAu-p4-Ddb" secondAttribute="bottom" id="uml-2e-8Xc"/>
+                                                <constraint firstItem="mAu-p4-Ddb" firstAttribute="top" secondItem="3uH-1g-e9P" secondAttribute="top" id="wYa-Yf-GTr"/>
+                                                <constraint firstItem="KKz-t2-o7n" firstAttribute="top" secondItem="3uH-1g-e9P" secondAttribute="top" id="zUu-6h-3CD"/>
+                                            </constraints>
+                                        </customView>
+                                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="b3H-r0-MzM">
+                                            <rect key="frame" x="10" y="110" width="210" height="16"/>
+                                            <constraints>
+                                                <constraint firstAttribute="width" constant="206" id="RxZ-lF-oZg"/>
+                                            </constraints>
+                                            <textFieldCell key="cell" selectable="YES" title="Label" id="KVT-7M-cuQ">
+                                                <font key="font" metaFont="system"/>
+                                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                            </textFieldCell>
+                                        </textField>
+                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="4jJ-S8-8Zo">
+                                            <rect key="frame" x="0.0" y="106" width="240" height="46"/>
+                                            <subviews>
+                                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="9cg-Mx-qQE">
+                                                    <rect key="frame" x="12" y="7" width="32" height="32"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="32" id="Qog-mg-Eeu"/>
+                                                        <constraint firstAttribute="height" constant="32" id="nSR-KK-VDv"/>
+                                                    </constraints>
+                                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ic_propertybar_file_pdf" id="t6b-2d-CK9"/>
+                                                </imageView>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NI0-Jx-fTP">
+                                                    <rect key="frame" x="50" y="26" width="172" height="16"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="168" id="xjq-ko-OEg"/>
+                                                    </constraints>
+                                                    <textFieldCell key="cell" lineBreakMode="truncatingTail" title="Label" id="Bg2-Mw-2Wp">
+                                                        <font key="font" metaFont="system"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Mj9-uy-fOq">
+                                                    <rect key="frame" x="50" y="6" width="37" height="16"/>
+                                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="qJ6-lf-kzy">
+                                                        <font key="font" metaFont="system"/>
+                                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                    </textFieldCell>
+                                                </textField>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="Mj9-uy-fOq" firstAttribute="leading" secondItem="9cg-Mx-qQE" secondAttribute="trailing" constant="8" id="5V9-5O-Lka"/>
+                                                <constraint firstItem="NI0-Jx-fTP" firstAttribute="leading" secondItem="9cg-Mx-qQE" secondAttribute="trailing" constant="8" id="DF9-1p-QoO"/>
+                                                <constraint firstItem="9cg-Mx-qQE" firstAttribute="centerY" secondItem="4jJ-S8-8Zo" secondAttribute="centerY" id="Ggl-yg-5wL"/>
+                                                <constraint firstAttribute="height" constant="46" id="KQy-SO-fmw"/>
+                                                <constraint firstItem="Mj9-uy-fOq" firstAttribute="top" secondItem="NI0-Jx-fTP" secondAttribute="bottom" constant="4" id="U8y-Id-Khs"/>
+                                                <constraint firstItem="NI0-Jx-fTP" firstAttribute="top" secondItem="9cg-Mx-qQE" secondAttribute="top" constant="-3" id="YaM-Rt-ufP"/>
+                                                <constraint firstItem="9cg-Mx-qQE" firstAttribute="leading" secondItem="4jJ-S8-8Zo" secondAttribute="leading" constant="12" id="fx0-mn-8VZ"/>
+                                                <constraint firstAttribute="width" constant="240" id="sJF-gF-HMW"/>
+                                            </constraints>
+                                        </customView>
+                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="hZq-qe-ZwO">
+                                            <rect key="frame" x="12" y="94" width="216" height="4"/>
+                                            <subviews>
+                                                <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jOO-UF-1S7">
+                                                    <rect key="frame" x="0.0" y="0.0" width="120" height="4"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                                                </customView>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="height" constant="4" id="95x-JE-dzf"/>
+                                            </constraints>
+                                        </customView>
+                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nhk-ig-b3B">
+                                            <rect key="frame" x="140" y="63" width="95" height="32"/>
+                                            <buttonCell key="cell" type="push" title="Download" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="kMU-uk-npG">
+                                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                <font key="font" metaFont="system"/>
+                                                <string key="keyEquivalent" base64-UTF8="YES">
+DQ
+</string>
+                                            </buttonCell>
+                                            <connections>
+                                                <action selector="fileDownloadAction:" target="-2" id="lW2-IK-yRO"/>
+                                            </connections>
+                                        </button>
+                                    </subviews>
+                                    <constraints>
+                                        <constraint firstItem="3uH-1g-e9P" firstAttribute="top" secondItem="TRx-EZ-2Pp" secondAttribute="top" id="4TA-Gz-gwY"/>
+                                        <constraint firstItem="b3H-r0-MzM" firstAttribute="top" secondItem="TRx-EZ-2Pp" secondAttribute="top" constant="26" id="9Eh-wb-sqi"/>
+                                        <constraint firstItem="4jJ-S8-8Zo" firstAttribute="top" secondItem="TRx-EZ-2Pp" secondAttribute="top" id="J02-rx-W3F"/>
+                                        <constraint firstAttribute="trailing" secondItem="hZq-qe-ZwO" secondAttribute="trailing" constant="12" id="OHd-tM-JBI"/>
+                                        <constraint firstAttribute="trailing" secondItem="nhk-ig-b3B" secondAttribute="trailing" constant="12" id="PIY-Jt-BrS"/>
+                                        <constraint firstItem="nhk-ig-b3B" firstAttribute="top" secondItem="4jJ-S8-8Zo" secondAttribute="bottom" constant="16" id="WIm-1k-3Vs"/>
+                                        <constraint firstItem="3uH-1g-e9P" firstAttribute="leading" secondItem="TRx-EZ-2Pp" secondAttribute="leading" id="X3x-AZ-mWu"/>
+                                        <constraint firstAttribute="trailing" secondItem="3uH-1g-e9P" secondAttribute="trailing" id="e1w-jt-YTv"/>
+                                        <constraint firstItem="4jJ-S8-8Zo" firstAttribute="leading" secondItem="TRx-EZ-2Pp" secondAttribute="leading" id="od9-Ex-fDL"/>
+                                        <constraint firstItem="hZq-qe-ZwO" firstAttribute="leading" secondItem="TRx-EZ-2Pp" secondAttribute="leading" constant="12" id="qEA-8O-QD8"/>
+                                        <constraint firstItem="b3H-r0-MzM" firstAttribute="leading" secondItem="TRx-EZ-2Pp" secondAttribute="leading" constant="12" id="qtF-pK-A94"/>
+                                        <constraint firstItem="hZq-qe-ZwO" firstAttribute="top" secondItem="4jJ-S8-8Zo" secondAttribute="bottom" constant="8" id="yla-ti-xuV"/>
+                                    </constraints>
+                                </customView>
+                            </subviews>
+                            <constraints>
+                                <constraint firstAttribute="bottom" secondItem="QoN-Ij-W9s" secondAttribute="bottom" constant="12" id="0Ra-Ez-RWC"/>
+                                <constraint firstAttribute="trailing" secondItem="QoN-Ij-W9s" secondAttribute="trailing" id="3aM-kK-bIw"/>
+                                <constraint firstItem="QoN-Ij-W9s" firstAttribute="top" secondItem="6SG-A3-eYJ" secondAttribute="top" constant="36" id="4Bj-Oq-Lwc"/>
+                                <constraint firstAttribute="width" constant="240" id="7af-UC-oKn"/>
+                                <constraint firstItem="HeC-uc-Lvd" firstAttribute="top" secondItem="6SG-A3-eYJ" secondAttribute="top" constant="8" id="8pM-ht-zU9"/>
+                                <constraint firstItem="QoN-Ij-W9s" firstAttribute="leading" secondItem="6SG-A3-eYJ" secondAttribute="leading" id="9vq-Ai-L70"/>
+                                <constraint firstAttribute="trailing" secondItem="TRx-EZ-2Pp" secondAttribute="trailing" id="B0M-H0-3Gi"/>
+                                <constraint firstAttribute="bottom" secondItem="TRx-EZ-2Pp" secondAttribute="bottom" constant="12" id="Lz5-nc-Rak"/>
+                                <constraint firstItem="TRx-EZ-2Pp" firstAttribute="top" secondItem="6SG-A3-eYJ" secondAttribute="top" constant="36" id="ZYw-HJ-2IN"/>
+                                <constraint firstItem="TRx-EZ-2Pp" firstAttribute="leading" secondItem="6SG-A3-eYJ" secondAttribute="leading" id="o8k-rY-eZf"/>
+                                <constraint firstItem="HeC-uc-Lvd" firstAttribute="leading" secondItem="6SG-A3-eYJ" secondAttribute="leading" constant="12" id="xXf-lL-3HU"/>
+                            </constraints>
+                        </customView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="y04-IX-qtb" firstAttribute="top" secondItem="hj2-WS-US0" secondAttribute="top" constant="28" id="2wM-uP-hzJ"/>
+                        <constraint firstItem="b2Z-dU-aPH" firstAttribute="top" secondItem="hj2-WS-US0" secondAttribute="top" id="5wY-De-OGO"/>
+                        <constraint firstItem="9ef-8h-vxe" firstAttribute="trailing" secondItem="y04-IX-qtb" secondAttribute="trailing" id="8XS-BS-dGb"/>
+                        <constraint firstItem="oQu-jj-W6q" firstAttribute="leading" secondItem="6Pu-q0-WyG" secondAttribute="trailing" constant="7" id="A85-PM-d4W"/>
+                        <constraint firstAttribute="bottom" secondItem="6SG-A3-eYJ" secondAttribute="bottom" id="BCK-bm-O5h"/>
+                        <constraint firstAttribute="bottom" secondItem="y04-IX-qtb" secondAttribute="bottom" id="Cer-GH-Hjy"/>
+                        <constraint firstItem="9ef-8h-vxe" firstAttribute="leading" secondItem="msJ-8N-bgb" secondAttribute="trailing" constant="7" id="Dzq-4c-TiC"/>
+                        <constraint firstItem="oQu-jj-W6q" firstAttribute="leading" secondItem="ZE8-Jn-wNb" secondAttribute="trailing" constant="15" id="HT5-Yc-13h"/>
+                        <constraint firstItem="9ef-8h-vxe" firstAttribute="leading" secondItem="oQu-jj-W6q" secondAttribute="trailing" constant="15" id="Ie5-36-ZQy"/>
+                        <constraint firstItem="9ef-8h-vxe" firstAttribute="centerY" secondItem="oQu-jj-W6q" secondAttribute="centerY" id="NxQ-tp-B2h"/>
+                        <constraint firstItem="y04-IX-qtb" firstAttribute="leading" secondItem="hj2-WS-US0" secondAttribute="leading" constant="13" id="PlJ-iu-NNk"/>
+                        <constraint firstItem="9ef-8h-vxe" firstAttribute="centerY" secondItem="b2Z-dU-aPH" secondAttribute="centerY" id="SRV-bG-2Nx"/>
+                        <constraint firstItem="9ef-8h-vxe" firstAttribute="centerY" secondItem="msJ-8N-bgb" secondAttribute="centerY" id="TyH-lx-uZF"/>
+                        <constraint firstItem="ZE8-Jn-wNb" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="b2Z-dU-aPH" secondAttribute="trailing" constant="7" id="WWF-qF-UhJ"/>
+                        <constraint firstItem="b2Z-dU-aPH" firstAttribute="leading" secondItem="hj2-WS-US0" secondAttribute="leading" constant="13" id="Zuv-Ib-nj8"/>
+                        <constraint firstItem="oQu-jj-W6q" firstAttribute="centerY" secondItem="ZE8-Jn-wNb" secondAttribute="centerY" id="arm-x9-tul"/>
+                        <constraint firstItem="6SG-A3-eYJ" firstAttribute="top" secondItem="hj2-WS-US0" secondAttribute="top" constant="28" id="cRn-dX-Tex"/>
+                        <constraint firstItem="6Pu-q0-WyG" firstAttribute="centerY" secondItem="oQu-jj-W6q" secondAttribute="centerY" id="jBL-nx-9gF"/>
+                        <constraint firstItem="6SG-A3-eYJ" firstAttribute="leading" secondItem="hj2-WS-US0" secondAttribute="leading" constant="13" id="xMO-eT-lXi"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="hj2-WS-US0" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="1kB-oo-Z5j"/>
+                <constraint firstAttribute="bottom" secondItem="hj2-WS-US0" secondAttribute="bottom" id="Y9N-Vq-UC7"/>
+                <constraint firstItem="hj2-WS-US0" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="Yp8-dA-eal"/>
+                <constraint firstAttribute="trailing" secondItem="hj2-WS-US0" secondAttribute="trailing" id="mNj-GG-nUG"/>
+            </constraints>
+            <point key="canvasLocation" x="130" y="268"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="AIChatRobot" width="24" height="24"/>
+        <image name="AIchange" width="18" height="18"/>
+        <image name="aiVLine" width="1" height="10"/>
+        <image name="creditNoTip" width="14" height="15"/>
+        <image name="ic_btn_arrow_down" width="11" height="11"/>
+        <image name="ic_propertybar_file_pdf" width="32" height="32"/>
+        <image name="robot-gray" width="80" height="80"/>
+    </resources>
+</document>

+ 98 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIHeaderView/AIHeaderView.swift

@@ -0,0 +1,98 @@
+//
+//  AIHeaderView.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/17.
+//
+
+import Cocoa
+
+class AIHeaderView: NSView, NibLoadable {
+
+    @IBOutlet weak var contendView: NSView!
+    @IBOutlet weak var titleLabel: NSTextField!
+    @IBOutlet weak var seplineView: NSView!
+    @IBOutlet weak var myCreditLabel: NSTextField!
+        
+    var guideWindowVC: KMFunctionGuideWindowController!
+    
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        
+        self.titleLabel.font = NSFont.SFProTextSemiboldFont(14)
+        self.myCreditLabel.font = NSFont.SFProTextSemiboldFont(11)
+        
+        self.titleLabel.stringValue = NSLocalizedString("AI Tools", comment: "")
+        self.myCreditLabel.stringValue = NSLocalizedString("My AI Credit", comment: "")
+        
+        self.seplineView.wantsLayer = true
+        
+        
+        self.refreshViewColor()
+    }
+    
+    func refreshViewColor() {
+        if KMAppearance.isDarkMode() {
+            self.titleLabel.textColor = KMAppearance.KMColor_Layout_W0()
+            self.myCreditLabel.textColor = NSColor.white
+            self.seplineView.layer?.backgroundColor = NSColor.white.withAlphaComponent(0.1).cgColor
+        } else {
+            self.titleLabel.textColor = KMAppearance.KMColor_Layout_M()
+            self.myCreditLabel.textColor = NSColor.white
+            self.seplineView.layer?.backgroundColor = NSColor.black.withAlphaComponent(0.05).cgColor
+        }
+    }
+    
+    //MARK: IBAction
+    @IBAction func creditInfoAction(_ sender: NSButton) {
+       
+        AIInfoManager.default().fetchAIInfo { dict, error in
+            
+        }
+        
+        let controller = AIUserInfoController.init()
+        controller.purchaseHandle = { vc in
+#if VERSION_DMG
+            let url = URL(string: kAIStoreServerLink)
+            NSWorkspace.shared.open(url!)
+#else
+            AIPurchaseWindowController.currentWC().showWindow(nil)
+#endif
+        }
+        
+        controller.enterLicenseHandle = { vc in
+            let verifyVC = KMVerificationWindowController.verification(with: .activateExpired)
+            verifyVC?.callback = {
+                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            }
+            verifyVC?.showWindow(nil)
+            
+        }
+        
+        controller.guideHandle = {[unowned self] vc in
+            if self.guideWindowVC == nil {
+                let guideWindowVC = KMFunctionGuideWindowController.init(windowNibName: "KMFunctionGuideWindowController")
+                self.guideWindowVC = guideWindowVC
+            }
+            self.guideWindowVC.type = .functionMulti
+            self.guideWindowVC.showWindow(nil)
+            KMFunctionGuideWindowController.setDidShowFor(.functionMultiAIGuide)
+            self.guideWindowVC.window?.orderFront(nil)
+            
+        }
+        
+        let popover = NSPopover.init()
+        popover.contentViewController = controller
+        popover.behavior = .transient
+        popover.show(relativeTo: sender.bounds, of: sender, preferredEdge: .minY)
+        
+        
+    }
+}

+ 109 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIHeaderView/AIHeaderView.xib

@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe" customClass="AIHeaderView" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="276" height="28"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="5lh-br-Aha">
+                    <rect key="frame" x="0.0" y="0.0" width="276" height="28"/>
+                    <subviews>
+                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="O3R-FR-hei">
+                            <rect key="frame" x="11" y="12" width="52" height="16"/>
+                            <textFieldCell key="cell" lineBreakMode="clipping" title="AI Tools" id="jmN-fM-TzH">
+                                <font key="font" metaFont="system"/>
+                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                            </textFieldCell>
+                        </textField>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="z8M-Op-YEn">
+                            <rect key="frame" x="157" y="8" width="111" height="20"/>
+                            <subviews>
+                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Bss-Z9-UZc">
+                                    <rect key="frame" x="0.0" y="0.0" width="111" height="20"/>
+                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="AICreditIcon" id="Pcg-3x-rDo"/>
+                                </imageView>
+                                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Fdq-A3-4Qq">
+                                    <rect key="frame" x="8" y="2" width="16" height="16"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="16" id="Mi1-UU-paE"/>
+                                        <constraint firstAttribute="height" constant="16" id="Zxq-S7-lqd"/>
+                                    </constraints>
+                                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="aiIconA" id="5ZC-K5-d3k"/>
+                                </imageView>
+                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Fxp-Me-pe7">
+                                    <rect key="frame" x="26" y="2" width="79" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" title="My AI Credit" id="ktG-60-NbH">
+                                        <font key="font" metaFont="system"/>
+                                        <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                                <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0zC-B6-jlS">
+                                    <rect key="frame" x="0.0" y="0.0" width="111" height="20"/>
+                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                    <buttonCell key="cell" type="bevel" bezelStyle="rounded" imagePosition="overlaps" alignment="center" lineBreakMode="charWrapping" imageScaling="axesIndependently" inset="2" id="LJQ-YD-tZZ">
+                                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                        <font key="font" metaFont="smallSystem"/>
+                                    </buttonCell>
+                                    <connections>
+                                        <action selector="creditInfoAction:" target="c22-O7-iKe" id="cei-gp-6Dd"/>
+                                    </connections>
+                                </button>
+                            </subviews>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="20" id="4mQ-kY-57E"/>
+                                <constraint firstItem="Fxp-Me-pe7" firstAttribute="leading" secondItem="Fdq-A3-4Qq" secondAttribute="trailing" constant="4" id="MxP-Sg-MnF"/>
+                                <constraint firstItem="Fdq-A3-4Qq" firstAttribute="leading" secondItem="z8M-Op-YEn" secondAttribute="leading" constant="8" id="OEb-L0-Wfq"/>
+                                <constraint firstItem="Fxp-Me-pe7" firstAttribute="centerY" secondItem="z8M-Op-YEn" secondAttribute="centerY" id="nMr-JV-glL"/>
+                                <constraint firstAttribute="trailing" secondItem="Fxp-Me-pe7" secondAttribute="trailing" constant="8" id="yqS-1h-Byl"/>
+                                <constraint firstItem="Fdq-A3-4Qq" firstAttribute="centerY" secondItem="z8M-Op-YEn" secondAttribute="centerY" id="zMQ-c0-aod"/>
+                            </constraints>
+                        </customView>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="Mub-uz-ya0">
+                            <rect key="frame" x="8" y="0.0" width="260" height="1"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="1" id="iMp-lz-hyt"/>
+                            </constraints>
+                        </customView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="Mub-uz-ya0" firstAttribute="leading" secondItem="5lh-br-Aha" secondAttribute="leading" constant="8" id="4dV-sP-wbL"/>
+                        <constraint firstAttribute="trailing" secondItem="Mub-uz-ya0" secondAttribute="trailing" constant="8" id="5rj-DH-lCd"/>
+                        <constraint firstItem="z8M-Op-YEn" firstAttribute="top" secondItem="5lh-br-Aha" secondAttribute="top" id="Evu-sG-s96"/>
+                        <constraint firstItem="O3R-FR-hei" firstAttribute="leading" secondItem="5lh-br-Aha" secondAttribute="leading" constant="13" id="MyB-OO-tyH"/>
+                        <constraint firstAttribute="bottom" secondItem="Mub-uz-ya0" secondAttribute="bottom" id="PQZ-oD-7mR"/>
+                        <constraint firstItem="O3R-FR-hei" firstAttribute="top" secondItem="5lh-br-Aha" secondAttribute="top" id="hbP-52-ANg"/>
+                        <constraint firstAttribute="trailing" secondItem="z8M-Op-YEn" secondAttribute="trailing" constant="8" id="qdy-yl-wdj"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="5lh-br-Aha" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="4Ne-tK-47X"/>
+                <constraint firstAttribute="bottom" secondItem="5lh-br-Aha" secondAttribute="bottom" id="Bk2-mJ-Do4"/>
+                <constraint firstItem="5lh-br-Aha" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="Kf9-x7-NLH"/>
+                <constraint firstAttribute="trailing" secondItem="5lh-br-Aha" secondAttribute="trailing" id="hEP-CN-wSf"/>
+            </constraints>
+            <connections>
+                <outlet property="contendView" destination="5lh-br-Aha" id="AJT-YG-Ll6"/>
+                <outlet property="myCreditLabel" destination="Fxp-Me-pe7" id="D72-7D-1Ql"/>
+                <outlet property="seplineView" destination="Mub-uz-ya0" id="iA6-40-sic"/>
+                <outlet property="titleLabel" destination="O3R-FR-hei" id="PM2-Vy-wYu"/>
+            </connections>
+            <point key="canvasLocation" x="35.5" y="109.5"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="AICreditIcon" width="103" height="20"/>
+        <image name="aiIconA" width="16" height="16"/>
+    </resources>
+</document>

+ 756 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIInfoInputView/AIInfoInputView.swift

@@ -0,0 +1,756 @@
+//
+//  AIInfoInputView.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/17.
+//
+
+import Cocoa
+import PDFKit
+
+class customTextView: NSTextView {
+    
+    var firstResponderHandle: ((_ view: customTextView, _ isFirstResponder: Bool) -> Void)?
+    
+    override func becomeFirstResponder() -> Bool {
+        guard let callBack = self.firstResponderHandle else {
+            return super.becomeFirstResponder()
+        }
+        callBack(self, true)
+        
+        return super.becomeFirstResponder()
+    }
+    
+    override func resignFirstResponder() -> Bool {
+        guard let callBack = self.firstResponderHandle else {
+            return super.resignFirstResponder()
+        }
+        callBack(self, false)
+        
+        return super.resignFirstResponder()
+    }
+}
+
+protocol AIInfoInputViewDelegate: AnyObject {
+    
+    func ai_InputViewDidChooseCurFile(aiInputView: AIInfoInputView)
+    
+}
+
+
+class AIInfoInputView: NSView, NibLoadable, NSTextFieldDelegate, NSTextViewDelegate {
+    
+    @IBOutlet weak var contendBox: NSBox!
+    
+    @IBOutlet weak var typeEmptyTipView: NSView!
+    @IBOutlet weak var typeEmptyTipLabel: NSTextField!
+    
+    @IBOutlet weak var infoContendView: NSView!
+    
+    @IBOutlet weak var typeHeaderView: NSView!
+    @IBOutlet weak var titleLabel: NSTextField!
+    @IBOutlet weak var titleTipBtn: KMButton!
+    @IBOutlet weak var stringClearBtn: NSButton!
+    
+    @IBOutlet weak var chooseFileBtnView: NSView!
+    @IBOutlet weak var chooseCurFileBtn: NSButton!
+    @IBOutlet weak var chooseFileBtn: NSButton!
+    @IBOutlet weak var chooseFileViewTopConst: NSLayoutConstraint!
+    
+    @IBOutlet weak var fileSizeTipView: NSView!
+    @IBOutlet weak var fileSizeTipLabel: NSTextField!
+    
+    @IBOutlet weak var placeholdLabel: NSTextField!
+    @IBOutlet weak var placeholdLabelTopConst: NSLayoutConstraint!
+    
+    @IBOutlet weak var fileInfoContendView: NSView!
+    @IBOutlet weak var fileInfoImg: NSImageView!
+    @IBOutlet weak var fileNameLabel: NSTextField!
+    @IBOutlet weak var fileSizeLabel: NSTextField!
+    @IBOutlet weak var filePageCountLabel: NSTextField!
+    @IBOutlet weak var removeChooseFileBtn: NSButton!
+    @IBOutlet weak var fileInfoViewTopConst: NSLayoutConstraint!
+    
+    @IBOutlet weak var textScrollView: NSScrollView!
+    @IBOutlet var fileEmptyTextView: customTextView!
+    @IBOutlet weak var textScrollViewTopConst: NSLayoutConstraint!
+    
+    
+    @IBOutlet weak var inputTextCountLabel: NSTextField!
+    
+    @IBOutlet weak var translateConfigView: NSView!
+    @IBOutlet weak var fromLanguageView: NSView!
+    @IBOutlet weak var fromLanguageLabel: NSTextField!
+    @IBOutlet weak var fromLanguageBtn: NSButton!
+    @IBOutlet weak var toLanguageView: NSView!
+    @IBOutlet weak var toLanguageLabel: NSTextField!
+    @IBOutlet weak var toLanguageBtn: NSButton!
+    @IBOutlet weak var translateChangeBtn: KMButton!
+    
+    @IBOutlet weak var startButton: NSButton!
+    
+    weak var aiDelegate: AIInfoInputViewDelegate?
+    
+    var area: NSTrackingArea?
+    var popOver: NSPopover!
+    
+    var aiConfigType: AIConfigType = .none
+    var filePath: String = ""
+    var fromLanguage: String = ""
+    var toLanguage: String = ""
+    
+    var startAIHandle: ((_ view: AIInfoInputView) -> Void)?
+    
+    var inputFrameUpdateHandle: ((_ view: AIInfoInputView, _ stringSize: CGSize) -> Void)?
+    
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+        
+        // Drawing code here.
+    }
+    
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        self.contendBox.borderWidth = 1
+        self.contendBox.cornerRadius = 7
+        
+        self.titleLabel.font = NSFont.SFProTextSemiboldFont(13)
+        
+        self.titleTipBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered {
+                var tipString = NSLocalizedString("Recommended file size: 10M or less.", comment: "")
+                if self.aiConfigType == .reWriting {
+                    tipString = NSLocalizedString("No more than 2000 characters.", comment: "")
+                } else if self.aiConfigType == .proofreading {
+                    tipString = NSLocalizedString("No more than 2000 characters.", comment: "")
+                } else if self.aiConfigType == .translate {
+                    tipString = NSLocalizedString("1 credit for every 10,000 characters; No more than 10M of a document. ", comment: "")
+                }
+                let popViewController = KMToolbarItemPopViewController.init()
+                if self.popOver == nil {
+                    self.popOver = NSPopover.init()
+                }
+                self.popOver.contentViewController = popViewController
+                self.popOver.animates = false
+                self.popOver.behavior = .semitransient
+                self.popOver.contentSize = (popViewController.view.frame.size)
+                popViewController.updateWithHelpTip(helpTip: tipString)
+                
+                let origin = self.titleTipBtn.superview?.convert(self.titleTipBtn.frame.origin, to: self)
+                var frame = self.titleTipBtn.frame
+                frame.origin.x = origin!.x + 12
+                frame.origin.y = origin!.y + 20
+                self.popOver.show(relativeTo: frame, of: (self.window?.contentView)!, preferredEdge: .maxY)
+                
+            } else {
+                self.popOver.close()
+            }
+        }
+        
+        let countFormatter = TextFieldFormatter.init()
+        countFormatter.setMaximumLength(2000)
+        self.inputTextCountLabel.formatter = countFormatter
+        self.inputTextCountLabel.delegate = self
+        
+        self.fileEmptyTextView.font = NSFont.SFProTextRegularFont(14)
+        self.fileEmptyTextView.delegate = self
+        self.fileEmptyTextView.firstResponderHandle = {[unowned self] view, isFirstResponder in
+            if isFirstResponder {
+                if self.fileSizeTipView.isHidden == false {
+                    self.fileSizeTipView.isHidden = true
+                    NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(hideFileSizeTipView), object: nil)
+                }
+            }
+        }
+        
+        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3) {
+            self.setUpTranslateUI()
+        }
+        
+        self.fileSizeTipView.isHidden = true
+        self.fileSizeTipView.wantsLayer = true
+        self.fileSizeTipLabel.font = NSFont.SFProTextRegularFont(12)
+        self.fileSizeTipLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        self.fileSizeTipLabel.stringValue = NSLocalizedString("Please upload a file smaller than 10M.", comment: "")
+        self.fileSizeTipView.layer?.cornerRadius = 2
+        self.fileSizeTipView.layer?.masksToBounds = true
+        
+        self.fileInfoContendView.wantsLayer = true
+        self.fileInfoContendView.layer?.cornerRadius = 6
+        self.fileInfoContendView.layer?.masksToBounds = true
+        
+        self.translateConfigView.wantsLayer = true
+        self.translateConfigView.layer?.backgroundColor = NSColor.clear.cgColor
+        
+        self.typeEmptyTipLabel.stringValue = NSLocalizedString("Select the AI tool", comment: "")
+        
+        self.chooseCurFileBtn.title = NSLocalizedString("Current File", comment: "")
+        self.chooseFileBtn.title = NSLocalizedString("Choose", comment: "")
+        
+        self.translateChangeBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered {
+                self.translateChangeBtn.image = NSImage(named: "AIchange_hover")
+            } else {
+                self.translateChangeBtn.image = NSImage(named: "AIchange")
+            }
+        }
+        
+        self.updateCountLabelInfo()
+        
+    }
+    
+    override func updateTrackingAreas() {
+        super.updateTrackingAreas()
+
+        if let _area = self.area, _area.rect.isEmpty == false {
+            if (_area.rect.equalTo(self.bounds)) {
+                return
+            }
+        }
+        
+        if (self.area != nil) {
+            self.removeTrackingArea(self.area!)
+            self.area = nil
+        }
+        
+        self.area = NSTrackingArea(rect: self.bounds, options: [.mouseEnteredAndExited, .mouseMoved, .activeAlways], owner: self)
+        self.addTrackingArea(self.area!)
+    }
+    
+    func setUpTranslateUI() {
+        
+        var languages = ["Automatic", "English", "Simplified Chinese", "Traditional Chinese", "Japanese", "Korean", "French", "Spanish", "Italian", "German", "Portuguese", "Russian", "Vietnamese", "Thai", "Arabic", "Greek", "Bulgarian", "Finnish", "Slovene", "Dutch", "Czech", "Swedish", "Polish", "Danish", "Romanian", "Hungarian"]
+        let menu = NSMenu.init()
+        for idx in 0...languages.count-1 {
+            let string = languages[idx]
+            let menuItem = NSMenuItem.init(title: string, action: #selector(menuItemClick(_:)), keyEquivalent: "")
+            menuItem.tag = 1000 + idx
+            menuItem.target = self
+            menu.addItem(menuItem)
+        }
+        self.fromLanguageView?.menu = menu
+        self.fromLanguage = "Automatic"
+        
+        languages = ["English", "Simplified Chinese", "Traditional Chinese", "Japanese", "Korean", "French", "Spanish", "Italian", "German", "Portuguese", "Russian", "Vietnamese", "Thai", "Arabic", "Greek", "Bulgarian", "Finnish", "Slovene", "Dutch", "Czech", "Swedish", "Polish", "Danish", "Romanian", "Hungarian"]
+        let toMenu = NSMenu.init()
+        for idx in 0...languages.count-1 {
+            let string = languages[idx]
+            let menuItem = NSMenuItem.init(title: string, action: #selector(menuItemClick(_:)), keyEquivalent: "")
+            menuItem.tag = 3000 + idx
+            menuItem.target = self
+            toMenu.addItem(menuItem)
+        }
+        self.toLanguageView?.menu = toMenu
+        self.toLanguage = "English"
+        
+        self.fromLanguageLabel.font = NSFont.SFProTextRegularFont(13)
+        self.toLanguageLabel.font = NSFont.SFProTextRegularFont(13)
+        self.fromLanguageLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        self.toLanguageLabel.textColor = KMAppearance.KMColor_Layout_H0()
+        
+        self.fromLanguageLabel.stringValue = self.fromLanguage
+        self.toLanguageLabel.stringValue = self.toLanguage
+        
+        
+    }
+    
+    func aiFunctionTypeChanged() {
+        self.refreshStringSize()
+    }
+    
+    func reloadData() {
+        if AIChatInfoManager.defaultManager.currentFilePath.isEmpty || AIChatInfoManager.defaultManager.isAILoading {
+            self.chooseCurFileBtn.isEnabled = false
+        } else {
+            self.chooseCurFileBtn.isEnabled = true
+        }
+        
+        if AIChatInfoManager.defaultManager.isAILoading {
+            self.chooseFileBtn.isEnabled = false
+        } else {
+            self.chooseFileBtn.isEnabled = true
+        }
+        
+        self.startButton.title = NSLocalizedString("Start (1 credit)", comment: "")
+        if self.aiConfigType == .none {
+            self.typeEmptyTipView.isHidden = false
+            self.infoContendView.isHidden = true
+        } else {
+            self.typeEmptyTipView.isHidden = true
+            self.infoContendView.isHidden = false
+            
+            self.chooseFileBtnView.isHidden = true
+            self.inputTextCountLabel.isHidden = false
+            self.placeholdLabel.isHidden = true
+            self.textScrollView.isHidden = true
+            self.translateConfigView.isHidden = true
+            self.fileInfoContendView.isHidden = true
+            self.removeChooseFileBtn.isHidden = true
+            
+            self.startButton.isEnabled = false
+            self.placeholdLabelTopConst.constant = -2
+            self.chooseFileViewTopConst.constant = 0
+            self.textScrollViewTopConst.constant = 0
+            self.fileInfoViewTopConst.constant = 8
+            
+            self.stringClearBtn.isHidden = true
+            if self.fileEmptyTextView.string.isEmpty == false {
+                self.stringClearBtn.isHidden = false
+            }
+            
+            if self.aiConfigType == .summarize {
+                self.inputTextCountLabel.isHidden = true
+                self.placeholdLabel.isHidden = false
+                self.chooseFileBtnView.isHidden = false
+                self.placeholdLabel.stringValue = NSLocalizedString("Summarize the current file or click choose other files.", comment: "")
+                self.placeholdLabelTopConst.constant = CGRectGetHeight(self.chooseFileBtnView.frame) + 4
+                
+                if self.filePath.isEmpty == false {
+                    self.fileInfoContendView.isHidden = false
+                    self.placeholdLabel.isHidden = true
+                    
+                    let filePathURL = URL(fileURLWithPath: self.filePath)
+                    self.fileNameLabel.stringValue = filePathURL.lastPathComponent
+                    self.fileSizeLabel.stringValue = self.fileSizeString(Float(self.getFileSize(atPath: self.filePath)))
+                    if let document = PDFDocument(url: URL(fileURLWithPath: filePath)) {
+                        self.filePageCountLabel.stringValue = String(format: "%d ", document.pageCount) + NSLocalizedString("Page", comment: "")
+                        if document.pageCount > 1 {
+                            self.filePageCountLabel.stringValue = String(format: "%d ", document.pageCount) + NSLocalizedString("Pages", comment: "")
+                        }
+                    } else {
+                        self.filePageCountLabel.stringValue = ""
+                    }
+                    self.startButton.isEnabled = true
+                }
+                
+            } else if self.aiConfigType == .reWriting {
+                self.textScrollView.isHidden = false
+                self.placeholdLabel.isHidden = false
+                if self.fileEmptyTextView.string.isEmpty == false {
+                    self.placeholdLabel.isHidden = true
+                    self.startButton.isEnabled = true
+                }
+                self.placeholdLabel.stringValue = NSLocalizedString("Enter or paste content here...", comment: "")
+                
+            } else if self.aiConfigType == .proofreading {
+                self.textScrollView.isHidden = false
+                self.placeholdLabel.isHidden = false
+                if self.fileEmptyTextView.string.isEmpty == false {
+                    self.placeholdLabel.isHidden = true
+                    self.startButton.isEnabled = true
+                }
+                self.placeholdLabel.stringValue = NSLocalizedString("Enter or paste content here...", comment: "")
+                
+            } else if self.aiConfigType == .translate {
+                self.textScrollView.isHidden = false
+                self.translateConfigView.isHidden = false
+                self.chooseFileBtnView.isHidden = false
+                self.chooseFileViewTopConst.constant = 30
+                self.placeholdLabel.isHidden = false
+                self.placeholdLabelTopConst.constant = 58
+                self.textScrollViewTopConst.constant = 58
+                
+                self.placeholdLabel.stringValue = NSLocalizedString("Enter or paste content here...", comment: "")
+                
+                if self.filePath.isEmpty == false {
+                    self.startButton.title = NSLocalizedString("Start", comment: "")
+                    self.fileEmptyTextView.string = ""
+                    self.fileInfoContendView.isHidden = false
+                    self.placeholdLabel.isHidden = true
+                    self.inputTextCountLabel.isHidden = true
+                    
+                    self.fileInfoViewTopConst.constant = 8
+                    
+                    let filePathURL = URL(fileURLWithPath: self.filePath)
+                    self.fileNameLabel.stringValue = filePathURL.lastPathComponent
+                    self.fileSizeLabel.stringValue = self.fileSizeString(Float(self.getFileSize(atPath: self.filePath)))
+                    
+                    if let document = PDFDocument(url: URL(fileURLWithPath: filePath)) {
+                        self.filePageCountLabel.stringValue = String(format: "%d ", document.pageCount) + NSLocalizedString("Page", comment: "")
+                        if document.pageCount > 1 {
+                            self.filePageCountLabel.stringValue = String(format: "%d ", document.pageCount) + NSLocalizedString("Pages", comment: "")
+                        }
+                    } else {
+                        self.filePageCountLabel.stringValue = ""
+                    }
+                    self.startButton.isEnabled = true
+                    
+                } else {
+                    self.startButton.title = NSLocalizedString("Start (1 credit)", comment: "")
+                    self.textScrollView.isHidden = false
+                    if self.fileEmptyTextView.string.isEmpty {
+                        self.placeholdLabel.isHidden = false
+                        self.startButton.isEnabled = false
+                    } else {
+                        self.placeholdLabel.isHidden = true
+                        self.startButton.isEnabled = true
+                        
+                    }
+                    
+                }
+            }
+            
+        }
+        
+        
+        self.refreshUI()
+    }
+    
+    func refreshUI() {
+        if KMAppearance.isDarkMode() {
+            self.titleLabel.textColor = NSColor.white
+            self.contendBox.fillColor = NSColor.white.withAlphaComponent(0.05)
+            self.contendBox.borderColor = KMAppearance.KMColor_Interactive_M0().withAlphaComponent(1)
+            self.fileSizeTipView.layer?.backgroundColor = NSColor(red: 251/255, green: 166/255, blue: 0, alpha: 1).cgColor
+            
+            self.typeEmptyTipLabel.textColor = KMAppearance.KMColor_Interactive_S1()
+            self.placeholdLabel.textColor = KMAppearance.KMColor_Interactive_S1()
+            self.toLanguageView.layer?.backgroundColor = NSColor(red: 110/255, green: 109/255, blue: 112/255, alpha: 1).cgColor
+            self.fromLanguageView.layer?.backgroundColor = NSColor(red: 110/255, green: 109/255, blue: 112/255, alpha: 1).cgColor
+            
+        } else {
+            self.titleLabel.textColor = NSColor.black
+            self.contendBox.borderColor = NSColor(red: 201/255, green: 218/255, blue: 247/255, alpha: 1)
+            self.fileSizeTipView.layer?.backgroundColor = NSColor(red: 253/255, green: 239/255, blue: 212/255, alpha: 1).cgColor
+            
+            self.typeEmptyTipLabel.textColor = KMAppearance.KMColor_Layout_B30()
+            self.placeholdLabel.textColor = KMAppearance.KMColor_Layout_B30()
+            
+            self.toLanguageView.layer?.backgroundColor = NSColor(red: 236/255, green: 242/255, blue: 254/255, alpha: 1).cgColor
+            self.fromLanguageView.layer?.backgroundColor = NSColor(red: 236/255, green: 242/255, blue: 254/255, alpha: 1).cgColor
+        }
+        
+        
+        if self.aiConfigType == .summarize {
+            self.titleLabel.stringValue = "#" + NSLocalizedString("AI Summarize", comment: "")
+            if KMAppearance.isDarkMode() {
+                self.titleLabel.textColor = NSColor(red: 85/255, green: 245/255, blue: 1, alpha: 1)
+            } else {
+                self.titleLabel.textColor = NSColor(red: 0, green: 209/255, blue: 222/255, alpha: 1)
+            }
+        } else if self.aiConfigType == .reWriting {
+            self.titleLabel.stringValue = "#" + NSLocalizedString("AI Rewrite", comment: "")
+            if KMAppearance.isDarkMode() {
+                self.titleLabel.textColor = NSColor(red: 255/255, green: 105/255, blue: 195/255, alpha: 1)
+            } else {
+                self.titleLabel.textColor = NSColor(red: 240/255, green: 28/255, blue: 155/255, alpha: 1)
+            }
+        } else if self.aiConfigType == .proofreading {
+            self.titleLabel.stringValue = "#" + NSLocalizedString("AI Proofread", comment: "")
+            if KMAppearance.isDarkMode() {
+                self.titleLabel.textColor = NSColor(red: 194/255, green: 157/255, blue: 1, alpha: 1)
+            } else {
+                self.titleLabel.textColor = NSColor(red: 108/255, green: 28/255, blue: 240/255, alpha: 1)
+            }
+        } else if self.aiConfigType == .translate {
+            self.titleLabel.stringValue = "#" + NSLocalizedString("AI Translate", comment: "")
+            if KMAppearance.isDarkMode() {
+                self.titleLabel.textColor = NSColor(red: 255/255, green: 152/255, blue: 77/255, alpha: 1)
+            } else {
+                self.titleLabel.textColor = NSColor(red: 240/255, green: 101/255, blue: 0, alpha: 1)
+            }
+        }
+        
+        self.placeholdLabel.font = NSFont.SFProTextRegularFont(14)
+        
+        self.fromLanguageView.wantsLayer = true
+        self.toLanguageView.wantsLayer = true
+        
+    }
+    
+    func updateCountLabelInfo() {
+        
+        self.inputTextCountLabel.stringValue = String(format: "%ld", self.fileEmptyTextView.string.count) + "/2000"
+        if self.fileEmptyTextView.string.count == 2000 {
+            self.inputTextCountLabel.textColor = KMAppearance.KMColor_Status_Err()
+        } else {
+            if KMAppearance.isDarkMode() {
+                self.inputTextCountLabel.textColor = KMAppearance.KMColor_Layout_W30()
+            } else {
+                self.inputTextCountLabel.textColor = KMAppearance.KMColor_Layout_B30()
+            }
+        }
+    }
+    
+    func getFileSize(atPath filePath : String) -> CGFloat {
+        guard let dict = try? FileManager.default.attributesOfItem(atPath: filePath) as NSDictionary else {
+            return 0
+        }
+        return CGFloat(dict.fileSize())
+    }
+    
+    func fileSizeString(_ fSize: Float) -> String {
+        let fileSize = fSize / 1024
+        let size = fileSize >= 1024 ? (fileSize < 1048576 ? fileSize/1024 : fileSize/1048576.0) : fileSize
+        let unit = fileSize >= 1024 ? (fileSize < 1048576 ? "M" : "G") : "K"
+        return String(format: "%0.1f %@", size, unit)
+    }
+    
+    @objc func hideFileSizeTipView() {
+        self.fileSizeTipView.isHidden = true
+    }
+    
+    //MARK: IBAction
+    
+    @objc func menuItemClick(_ item: NSMenuItem) {
+        if item.tag < 2000 {
+            self.fromLanguage = item.title
+        } else {
+            self.toLanguage = item.title
+        }
+        self.fromLanguageLabel.stringValue = self.fromLanguage
+        self.toLanguageLabel.stringValue = self.toLanguage
+    }
+    
+    @IBAction func chooseCurFileAction(_ sender: Any) {
+        
+        self.aiDelegate?.ai_InputViewDidChooseCurFile(aiInputView: self)
+        
+        
+        self.fileSizeTipView.isHidden = true
+        
+        let curFilePath = AIChatInfoManager.defaultManager.currentFilePath
+        let fileSize = self.getFileSize(atPath: curFilePath)
+        if fileSize/(1024*1024) > 10 {
+            self.fileSizeTipView.isHidden = false
+            
+            NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(hideFileSizeTipView), object: nil)
+        
+            self.perform(#selector(hideFileSizeTipView), with: nil, afterDelay: 5)
+            
+            self.filePath = ""
+            self.fileEmptyTextView.string = ""
+            self.reloadData()
+        } else {
+            self.filePath = curFilePath
+            self.fileEmptyTextView.string = ""
+            self.reloadData()
+        }
+        self.mouseEntered(with: NSEvent())
+    }
+    
+    
+    @IBAction func summaryUploadAction(_ sender: NSButton) {
+        self.fileSizeTipView.isHidden = true
+        
+        let openPanel = NSOpenPanel()
+        openPanel.canChooseDirectories = false
+        openPanel.canChooseFiles = true
+        openPanel.allowsMultipleSelection = false;
+        openPanel.allowedFileTypes = ["pdf","PDF"]
+        openPanel.beginSheetModal(for: self.window!) { [self] result in
+            if result == .OK {
+                let fileURL = openPanel.urls.first
+                let fileSize = self.getFileSize(atPath: fileURL!.path)
+                
+                if fileSize/(1024*1024) > 10 {
+                    self.fileSizeTipView.isHidden = false
+                    
+                    NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(hideFileSizeTipView), object: nil)
+                    
+                    self.perform(#selector(hideFileSizeTipView), with: nil, afterDelay: 5)
+                    
+                    self.filePath = ""
+                    self.fileEmptyTextView.string = ""
+                    self.reloadData()
+                } else {
+                    self.filePath = fileURL!.path
+                    self.fileEmptyTextView.string = ""
+                    self.reloadData()
+                }
+            }
+        }
+    }
+    
+    @IBAction func chooseLanguageAction(_ sender: NSButton) {
+        if sender == self.fromLanguageBtn {
+            let menu = self.fromLanguageView?.menu
+            menu?.popUp(positioning: menu?.item(at: 0), at: CGPoint(x: 0, y: 15), in: sender)
+        } else if sender == self.toLanguageBtn {
+            let menu = self.toLanguageView?.menu
+            menu?.popUp(positioning: menu?.item(at: 0), at: CGPoint(x: 0, y: 15), in: sender)
+        }
+    }
+    
+    @IBAction func languageChangeAction(_ sender: Any) {
+        let curLan = self.fromLanguage
+        self.fromLanguage = self.toLanguage
+        self.toLanguage = curLan
+        
+        self.fromLanguageLabel.stringValue = self.fromLanguage
+        self.toLanguageLabel.stringValue = self.toLanguage
+    }
+    
+    @IBAction func removeChooseFile(_ sender: NSButton) {
+        if self.aiConfigType == .summarize ||
+            self.aiConfigType == .translate {
+                
+            self.filePath = ""
+            self.reloadData()
+            self.updateCountLabelInfo()
+                
+            
+        }
+    }
+    
+    @IBAction func clearInputStringAction(_ sender: Any) {
+        self.fileEmptyTextView.string = ""
+        self.reloadData()
+        
+    }
+    
+    @IBAction func startAIAction(_ sender: NSButton) {
+        let newStatus: Bool = KMCloudServer.isConnectionAvailable()
+        if !newStatus {
+            let alert = NSAlert()
+            alert.alertStyle = .critical
+            alert.messageText = NSLocalizedString("Please make sure your internet connection is available.", comment: "")
+            alert.runModal()
+            return
+        }
+        
+        guard let callBack = self.startAIHandle else {
+            return
+        }
+        callBack(self)
+        
+        if self.aiConfigType == .summarize {
+            self.filePath = ""
+        } else if self.aiConfigType == .reWriting {
+            self.fileEmptyTextView.string = ""
+        } else if self.aiConfigType == .proofreading {
+            self.fileEmptyTextView.string = ""
+        } else if self.aiConfigType == .translate {
+            self.filePath = ""
+            self.fileEmptyTextView.string = ""
+        }
+        
+        self.reloadData()
+        
+        self.updateCountLabelInfo()
+        
+        self.refreshStringSize()
+        
+    }
+    
+    func sizeOfString(_ string: String, _ font: NSFont) -> (CGSize) {
+        let attributes: [NSAttributedString.Key: Any] = [
+            .font: font
+        ]
+        let size = (string as NSString).boundingRect(with: NSSize(width: CGRectGetWidth(self.textScrollView.frame), height: CGFloat(MAXFLOAT)),
+                                                     options: .usesLineFragmentOrigin,
+                                                     attributes: attributes,
+                                                     context: nil).size
+        return size
+    }
+    
+    func refreshStringSize() {
+        var size = self.sizeOfString(self.fileEmptyTextView.string, self.fileEmptyTextView.font!)
+        if self.aiConfigType == .summarize {
+            if self.filePath.isEmpty == true {
+                size = self.sizeOfString(self.placeholdLabel.stringValue, self.placeholdLabel.font!)
+            }
+        }
+        
+        guard let callBack = self.inputFrameUpdateHandle else {
+            return
+        }
+        callBack(self, size)
+    }
+    
+    //MARK: Deletegate
+    func textShouldBeginEditing(_ textObject: NSText) -> Bool {
+        print("textShouldBeginEditing")
+        return true
+    }
+    
+    func textDidChange(_ notification: Notification) {
+        if let textView = notification.object as? NSTextView, textView == self.fileEmptyTextView {
+            // 获取文本字段的当前字符数
+            let currentText = textView.string
+            let currentCount = currentText.count
+            
+            // 如果超过最大字符数,将文本截断为最大字符数,并设置回文本字段
+            if currentCount > 2000 {
+                let endIndex = currentText.index(currentText.startIndex, offsetBy: 2000)
+                let truncatedText = String(currentText[..<endIndex])
+                textView.string = truncatedText
+            }
+            
+            self.refreshStringSize()
+           
+        }
+        
+        if self.aiConfigType == .reWriting {
+            if self.fileEmptyTextView.string.isEmpty {
+                self.placeholdLabel.isHidden = false
+                self.startButton.isEnabled = false
+            } else {
+                self.placeholdLabel.isHidden = true
+                self.startButton.isEnabled = true
+            }
+        } else if self.aiConfigType == .proofreading {
+            if self.fileEmptyTextView.string.isEmpty {
+                self.placeholdLabel.isHidden = false
+                self.startButton.isEnabled = false
+            } else {
+                self.placeholdLabel.isHidden = true
+                self.startButton.isEnabled = true
+            }
+        } else if self.aiConfigType == .translate {
+            if self.fileEmptyTextView.string.isEmpty {
+                self.placeholdLabel.isHidden = false
+                self.startButton.isEnabled = false
+            } else {
+                self.placeholdLabel.isHidden = true
+                self.startButton.isEnabled = true
+            }
+        }
+        
+        self.updateCountLabelInfo()
+        
+        self.stringClearBtn.isHidden = true
+        if self.fileEmptyTextView.string.isEmpty == false {
+            self.stringClearBtn.isHidden = false
+        }
+        
+    }
+    
+    //MARK: MouseEvent
+    override func mouseEntered(with event: NSEvent) {
+        super.mouseEntered(with: event)
+        
+        if self.filePath.isEmpty == false {
+            self.removeChooseFileBtn.isHidden = false
+            if KMAppearance.isDarkMode() {
+                self.fileInfoContendView.layer?.backgroundColor = NSColor.white.withAlphaComponent(0.05).cgColor
+            } else {
+                self.fileInfoContendView.layer?.backgroundColor = NSColor.black.withAlphaComponent(0.05).cgColor
+            }
+        } else {
+            self.fileInfoContendView.layer?.backgroundColor = NSColor.clear.cgColor
+        }
+    }
+    
+    override func mouseExited(with event: NSEvent) {
+        super.mouseExited(with: event)
+        
+        self.removeChooseFileBtn.isHidden = true
+        self.fileInfoContendView.layer?.backgroundColor = NSColor.clear.cgColor
+    }
+    
+    override func mouseMoved(with event: NSEvent) {
+        super.mouseMoved(with: event)
+        
+    }
+    
+    override func mouseDown(with event: NSEvent) {
+        super.mouseDown(with: event)
+        
+        self.fileSizeTipView.isHidden = true
+        NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(hideFileSizeTipView), object: nil)
+
+    }
+}

+ 506 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIInfoInputView/AIInfoInputView.xib

@@ -0,0 +1,506 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe" customClass="AIInfoInputView" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="240" height="247"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <box boxType="custom" cornerRadius="8" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="pD8-rz-1tQ">
+                    <rect key="frame" x="0.0" y="0.0" width="240" height="247"/>
+                    <view key="contentView" id="sxN-il-SXN">
+                        <rect key="frame" x="1" y="1" width="238" height="245"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="6CO-V7-P4Z">
+                                <rect key="frame" x="0.0" y="0.0" width="238" height="245"/>
+                                <subviews>
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sz6-fP-Bdb">
+                                        <rect key="frame" x="6" y="221" width="124" height="16"/>
+                                        <textFieldCell key="cell" lineBreakMode="clipping" title="选择需要使用的工具" id="dJu-ok-6Gz">
+                                            <font key="font" usesAppearanceFont="YES"/>
+                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                    </textField>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="sz6-fP-Bdb" firstAttribute="leading" secondItem="6CO-V7-P4Z" secondAttribute="leading" constant="8" id="D1p-Ul-mTe"/>
+                                    <constraint firstItem="sz6-fP-Bdb" firstAttribute="top" secondItem="6CO-V7-P4Z" secondAttribute="top" constant="8" id="vii-uB-LCK"/>
+                                </constraints>
+                            </customView>
+                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="Kgd-1g-WEA">
+                                <rect key="frame" x="0.0" y="0.0" width="238" height="245"/>
+                                <subviews>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="y7L-XQ-ePy">
+                                        <rect key="frame" x="0.0" y="221" width="238" height="24"/>
+                                        <subviews>
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2Wj-F1-dBg">
+                                                <rect key="frame" x="6" y="4" width="37" height="16"/>
+                                                <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="LAJ-dW-gv1">
+                                                    <font key="font" usesAppearanceFont="YES"/>
+                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                </textFieldCell>
+                                            </textField>
+                                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="n96-Bm-cmt" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                                <rect key="frame" x="51" y="5" width="14" height="14"/>
+                                                <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="ic_else_info_large" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="6t1-ko-Kii">
+                                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                    <font key="font" metaFont="system"/>
+                                                </buttonCell>
+                                            </button>
+                                            <button translatesAutoresizingMaskIntoConstraints="NO" id="0vw-Pt-XuK">
+                                                <rect key="frame" x="214" y="4" width="16" height="16"/>
+                                                <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="aiTextClose" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="y9h-U2-9FO">
+                                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                    <font key="font" metaFont="system"/>
+                                                </buttonCell>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="16" id="HeR-Wc-V1d"/>
+                                                    <constraint firstAttribute="width" constant="16" id="XlK-Gq-dro"/>
+                                                </constraints>
+                                                <connections>
+                                                    <action selector="clearInputStringAction:" target="c22-O7-iKe" id="jab-YX-zEd"/>
+                                                </connections>
+                                            </button>
+                                        </subviews>
+                                        <constraints>
+                                            <constraint firstItem="n96-Bm-cmt" firstAttribute="centerY" secondItem="y7L-XQ-ePy" secondAttribute="centerY" id="0m2-Aj-qKD"/>
+                                            <constraint firstItem="0vw-Pt-XuK" firstAttribute="top" secondItem="y7L-XQ-ePy" secondAttribute="top" constant="4" id="1jj-Ov-m0d"/>
+                                            <constraint firstItem="2Wj-F1-dBg" firstAttribute="leading" secondItem="y7L-XQ-ePy" secondAttribute="leading" constant="8" id="8NC-5t-PgX"/>
+                                            <constraint firstItem="n96-Bm-cmt" firstAttribute="leading" secondItem="2Wj-F1-dBg" secondAttribute="trailing" constant="10" id="MtC-NO-MF5"/>
+                                            <constraint firstAttribute="trailing" secondItem="0vw-Pt-XuK" secondAttribute="trailing" constant="8" id="XMK-T2-Ukm"/>
+                                            <constraint firstItem="2Wj-F1-dBg" firstAttribute="centerY" secondItem="y7L-XQ-ePy" secondAttribute="centerY" id="p9z-PI-Njz"/>
+                                            <constraint firstAttribute="height" constant="24" id="tcr-pI-25Z"/>
+                                        </constraints>
+                                    </customView>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="Tld-qg-AAs">
+                                        <rect key="frame" x="0.0" y="32" width="238" height="185"/>
+                                        <subviews>
+                                            <textField hidden="YES" focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dSN-RY-s4T">
+                                                <rect key="frame" x="10" y="155" width="228" height="32"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="224" id="6s5-gx-pwz"/>
+                                                </constraints>
+                                                <textFieldCell key="cell" title="点击开始分析本文档,如需分析其他文档请点击上传。" id="aJF-PI-eBq">
+                                                    <font key="font" usesAppearanceFont="YES"/>
+                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                </textFieldCell>
+                                            </textField>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="ruh-uQ-Fyv">
+                                                <rect key="frame" x="0.0" y="161" width="238" height="24"/>
+                                                <subviews>
+                                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2bI-Ru-o29">
+                                                        <rect key="frame" x="1" y="-5" width="78" height="32"/>
+                                                        <buttonCell key="cell" type="push" title="Upload" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="5Ce-cQ-sA9">
+                                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                            <font key="font" metaFont="system"/>
+                                                        </buttonCell>
+                                                        <connections>
+                                                            <action selector="chooseCurFileAction:" target="c22-O7-iKe" id="DUc-Y1-q0k"/>
+                                                        </connections>
+                                                    </button>
+                                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5an-3P-NBy">
+                                                        <rect key="frame" x="73" y="-5" width="78" height="32"/>
+                                                        <buttonCell key="cell" type="push" title="Upload" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="6lj-HK-fgf">
+                                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                            <font key="font" metaFont="system"/>
+                                                        </buttonCell>
+                                                        <connections>
+                                                            <action selector="summaryUploadAction:" target="c22-O7-iKe" id="02n-uB-NDe"/>
+                                                        </connections>
+                                                    </button>
+                                                </subviews>
+                                                <constraints>
+                                                    <constraint firstItem="2bI-Ru-o29" firstAttribute="top" secondItem="ruh-uQ-Fyv" secondAttribute="top" constant="2" id="12p-KM-n9l"/>
+                                                    <constraint firstItem="2bI-Ru-o29" firstAttribute="leading" secondItem="ruh-uQ-Fyv" secondAttribute="leading" constant="8" id="Ksb-Md-ibX"/>
+                                                    <constraint firstAttribute="bottom" secondItem="2bI-Ru-o29" secondAttribute="bottom" constant="2" id="QRo-CV-tan"/>
+                                                    <constraint firstItem="5an-3P-NBy" firstAttribute="centerY" secondItem="2bI-Ru-o29" secondAttribute="centerY" id="aIg-Za-BIH"/>
+                                                    <constraint firstItem="5an-3P-NBy" firstAttribute="leading" secondItem="2bI-Ru-o29" secondAttribute="trailing" constant="8" id="eni-1y-4o8"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="t76-8V-Z4p">
+                                                <rect key="frame" x="8" y="129" width="222" height="28"/>
+                                                <subviews>
+                                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="o4b-jd-TJ4">
+                                                        <rect key="frame" x="8" y="6" width="14" height="14"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="14" id="Aos-5a-K0O"/>
+                                                            <constraint firstAttribute="height" constant="14" id="FkW-i0-L9q"/>
+                                                        </constraints>
+                                                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="ic_else_alert" id="Dh6-Iw-zHM"/>
+                                                    </imageView>
+                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gTS-09-xht">
+                                                        <rect key="frame" x="24" y="8" width="194" height="16"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="190" id="0MZ-vx-2fb"/>
+                                                        </constraints>
+                                                        <textFieldCell key="cell" title="Please upload a file under 10M" id="t2q-7Z-HUT">
+                                                            <font key="font" usesAppearanceFont="YES"/>
+                                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                        </textFieldCell>
+                                                    </textField>
+                                                </subviews>
+                                                <constraints>
+                                                    <constraint firstItem="gTS-09-xht" firstAttribute="top" secondItem="t76-8V-Z4p" secondAttribute="top" constant="4" id="OjE-wX-Txe"/>
+                                                    <constraint firstAttribute="bottom" secondItem="gTS-09-xht" secondAttribute="bottom" constant="8" id="SaP-dC-oTs"/>
+                                                    <constraint firstItem="o4b-jd-TJ4" firstAttribute="leading" secondItem="t76-8V-Z4p" secondAttribute="leading" constant="8" id="ggt-AA-fLX"/>
+                                                    <constraint firstItem="o4b-jd-TJ4" firstAttribute="top" secondItem="t76-8V-Z4p" secondAttribute="top" constant="8" id="od5-av-DfQ"/>
+                                                    <constraint firstItem="gTS-09-xht" firstAttribute="leading" secondItem="o4b-jd-TJ4" secondAttribute="trailing" constant="4" id="t0H-Rn-qFg"/>
+                                                </constraints>
+                                            </customView>
+                                            <scrollView borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" hasVerticalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Otk-4Z-gC7">
+                                                <rect key="frame" x="8" y="16" width="222" height="169"/>
+                                                <clipView key="contentView" drawsBackground="NO" id="Puq-CN-AwZ">
+                                                    <rect key="frame" x="0.0" y="0.0" width="222" height="169"/>
+                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                    <subviews>
+                                                        <textView wantsLayer="YES" drawsBackground="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" spellingCorrection="YES" smartInsertDelete="YES" id="HF1-Pc-Fff" customClass="customTextView" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                                            <rect key="frame" x="0.0" y="0.0" width="222" height="169"/>
+                                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                            <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                            <size key="minSize" width="222" height="169"/>
+                                                            <size key="maxSize" width="385" height="10000000"/>
+                                                            <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
+                                                        </textView>
+                                                    </subviews>
+                                                </clipView>
+                                                <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="Zu2-Ss-ueK">
+                                                    <rect key="frame" x="-100" y="-100" width="225" height="15"/>
+                                                    <autoresizingMask key="autoresizingMask"/>
+                                                </scroller>
+                                                <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="oLI-LF-Txr">
+                                                    <rect key="frame" x="-100" y="-100" width="15" height="135"/>
+                                                    <autoresizingMask key="autoresizingMask"/>
+                                                </scroller>
+                                            </scrollView>
+                                            <customView hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="86l-M4-ksM">
+                                                <rect key="frame" x="8" y="165" width="222" height="20"/>
+                                                <subviews>
+                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="z3M-0o-bfB">
+                                                        <rect key="frame" x="0.0" y="0.0" width="61" height="20"/>
+                                                        <subviews>
+                                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="awg-zk-OOg">
+                                                                <rect key="frame" x="6" y="2" width="37" height="16"/>
+                                                                <textFieldCell key="cell" lineBreakMode="truncatingTail" title="Label" id="dZ8-fk-3O1">
+                                                                    <font key="font" usesAppearanceFont="YES"/>
+                                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                                </textFieldCell>
+                                                            </textField>
+                                                            <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="GrX-qb-j6E">
+                                                                <rect key="frame" x="43" y="5" width="10" height="10"/>
+                                                                <constraints>
+                                                                    <constraint firstAttribute="height" constant="10" id="Fb9-Ul-tit"/>
+                                                                    <constraint firstAttribute="width" constant="10" id="XF6-Wa-GEd"/>
+                                                                </constraints>
+                                                                <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ic_btn_arrow_down" id="loV-G4-FQh"/>
+                                                            </imageView>
+                                                            <button translatesAutoresizingMaskIntoConstraints="NO" id="cfR-eg-Ej9">
+                                                                <rect key="frame" x="0.0" y="0.0" width="61" height="20"/>
+                                                                <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="neT-zS-hCT">
+                                                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                                    <font key="font" metaFont="system"/>
+                                                                </buttonCell>
+                                                                <connections>
+                                                                    <action selector="chooseLanguageAction:" target="c22-O7-iKe" id="oYU-Dz-DtR"/>
+                                                                </connections>
+                                                            </button>
+                                                        </subviews>
+                                                        <constraints>
+                                                            <constraint firstItem="awg-zk-OOg" firstAttribute="leading" secondItem="z3M-0o-bfB" secondAttribute="leading" constant="8" id="4We-Cd-RoP"/>
+                                                            <constraint firstItem="cfR-eg-Ej9" firstAttribute="top" secondItem="z3M-0o-bfB" secondAttribute="top" id="4ue-N0-axb"/>
+                                                            <constraint firstAttribute="width" relation="lessThanOrEqual" constant="95" id="9ZP-wI-LGA"/>
+                                                            <constraint firstItem="GrX-qb-j6E" firstAttribute="centerY" secondItem="z3M-0o-bfB" secondAttribute="centerY" id="9wj-1Q-dU9"/>
+                                                            <constraint firstItem="GrX-qb-j6E" firstAttribute="leading" secondItem="awg-zk-OOg" secondAttribute="trailing" constant="2" id="Ahf-81-tvo"/>
+                                                            <constraint firstAttribute="bottom" secondItem="cfR-eg-Ej9" secondAttribute="bottom" id="Xhe-rd-rcO"/>
+                                                            <constraint firstAttribute="trailing" secondItem="cfR-eg-Ej9" secondAttribute="trailing" id="giv-8T-RWq"/>
+                                                            <constraint firstItem="awg-zk-OOg" firstAttribute="centerY" secondItem="z3M-0o-bfB" secondAttribute="centerY" id="qqf-yR-3bB"/>
+                                                            <constraint firstItem="cfR-eg-Ej9" firstAttribute="leading" secondItem="z3M-0o-bfB" secondAttribute="leading" id="qri-y8-VQu"/>
+                                                            <constraint firstAttribute="trailing" secondItem="GrX-qb-j6E" secondAttribute="trailing" constant="8" id="rC7-hZ-Scq"/>
+                                                        </constraints>
+                                                    </customView>
+                                                    <button translatesAutoresizingMaskIntoConstraints="NO" id="5Q8-wz-vXb" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                                                        <rect key="frame" x="65" y="1" width="18" height="18"/>
+                                                        <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="AIchange" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="Sth-eR-kP8">
+                                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                            <font key="font" metaFont="system"/>
+                                                        </buttonCell>
+                                                        <connections>
+                                                            <action selector="languageChangeAction:" target="c22-O7-iKe" id="eSa-Cw-rm6"/>
+                                                        </connections>
+                                                    </button>
+                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="Ek7-fa-Yrv">
+                                                        <rect key="frame" x="87" y="0.0" width="61" height="20"/>
+                                                        <subviews>
+                                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="afk-d4-8cf">
+                                                                <rect key="frame" x="6" y="2" width="37" height="16"/>
+                                                                <textFieldCell key="cell" lineBreakMode="truncatingTail" title="Label" id="ls7-Pa-Kn8">
+                                                                    <font key="font" usesAppearanceFont="YES"/>
+                                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                                </textFieldCell>
+                                                            </textField>
+                                                            <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="0hS-m6-1rS">
+                                                                <rect key="frame" x="43" y="5" width="10" height="10"/>
+                                                                <constraints>
+                                                                    <constraint firstAttribute="height" constant="10" id="Yt4-D7-odM"/>
+                                                                    <constraint firstAttribute="width" constant="10" id="sm5-9e-bhC"/>
+                                                                </constraints>
+                                                                <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ic_btn_arrow_down" id="TCr-ZO-HOJ"/>
+                                                            </imageView>
+                                                            <button translatesAutoresizingMaskIntoConstraints="NO" id="KG2-9V-syN">
+                                                                <rect key="frame" x="0.0" y="0.0" width="61" height="20"/>
+                                                                <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="cQB-vI-jJT">
+                                                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                                    <font key="font" metaFont="system"/>
+                                                                </buttonCell>
+                                                                <connections>
+                                                                    <action selector="chooseLanguageAction:" target="c22-O7-iKe" id="AzO-bV-Ps4"/>
+                                                                </connections>
+                                                            </button>
+                                                        </subviews>
+                                                        <constraints>
+                                                            <constraint firstAttribute="trailing" secondItem="KG2-9V-syN" secondAttribute="trailing" id="Dta-Sj-6j7"/>
+                                                            <constraint firstItem="KG2-9V-syN" firstAttribute="top" secondItem="Ek7-fa-Yrv" secondAttribute="top" id="EFv-Ho-rW6"/>
+                                                            <constraint firstItem="0hS-m6-1rS" firstAttribute="leading" secondItem="afk-d4-8cf" secondAttribute="trailing" constant="2" id="GLb-oQ-Fem"/>
+                                                            <constraint firstAttribute="bottom" secondItem="KG2-9V-syN" secondAttribute="bottom" id="NUf-Fk-XP4"/>
+                                                            <constraint firstItem="0hS-m6-1rS" firstAttribute="centerY" secondItem="Ek7-fa-Yrv" secondAttribute="centerY" id="S2F-lQ-1ju"/>
+                                                            <constraint firstAttribute="width" relation="lessThanOrEqual" constant="95" id="aQH-lK-xlz"/>
+                                                            <constraint firstItem="afk-d4-8cf" firstAttribute="leading" secondItem="Ek7-fa-Yrv" secondAttribute="leading" constant="8" id="khv-71-iDB"/>
+                                                            <constraint firstAttribute="trailing" secondItem="0hS-m6-1rS" secondAttribute="trailing" constant="8" id="rgc-Ae-kqM"/>
+                                                            <constraint firstItem="afk-d4-8cf" firstAttribute="centerY" secondItem="Ek7-fa-Yrv" secondAttribute="centerY" id="vIw-qs-mqK"/>
+                                                            <constraint firstItem="KG2-9V-syN" firstAttribute="leading" secondItem="Ek7-fa-Yrv" secondAttribute="leading" id="wjc-al-8P5"/>
+                                                        </constraints>
+                                                    </customView>
+                                                </subviews>
+                                                <constraints>
+                                                    <constraint firstItem="Ek7-fa-Yrv" firstAttribute="leading" secondItem="5Q8-wz-vXb" secondAttribute="trailing" constant="4" id="5Ic-Z1-QWX"/>
+                                                    <constraint firstItem="Ek7-fa-Yrv" firstAttribute="top" secondItem="86l-M4-ksM" secondAttribute="top" id="SjO-cM-wpt"/>
+                                                    <constraint firstAttribute="bottom" secondItem="Ek7-fa-Yrv" secondAttribute="bottom" id="U7x-xe-8E0"/>
+                                                    <constraint firstItem="5Q8-wz-vXb" firstAttribute="leading" secondItem="z3M-0o-bfB" secondAttribute="trailing" constant="4" id="WsE-i9-gSe"/>
+                                                    <constraint firstItem="z3M-0o-bfB" firstAttribute="top" secondItem="86l-M4-ksM" secondAttribute="top" id="bC3-nU-uQw"/>
+                                                    <constraint firstAttribute="bottom" secondItem="z3M-0o-bfB" secondAttribute="bottom" id="eNI-Dx-O13"/>
+                                                    <constraint firstAttribute="height" constant="20" id="ehD-X4-GWl"/>
+                                                    <constraint firstItem="5Q8-wz-vXb" firstAttribute="centerY" secondItem="86l-M4-ksM" secondAttribute="centerY" id="fCD-Ff-6g6"/>
+                                                    <constraint firstItem="z3M-0o-bfB" firstAttribute="leading" secondItem="86l-M4-ksM" secondAttribute="leading" id="iYt-ER-jAS"/>
+                                                </constraints>
+                                            </customView>
+                                            <customView translatesAutoresizingMaskIntoConstraints="NO" id="sDJ-cB-va9">
+                                                <rect key="frame" x="7" y="107" width="224" height="46"/>
+                                                <subviews>
+                                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="d4U-81-9Lm">
+                                                        <rect key="frame" x="4" y="7" width="32" height="32"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="height" constant="32" id="dtW-MT-c2b"/>
+                                                            <constraint firstAttribute="width" constant="32" id="fW9-HM-LLZ"/>
+                                                        </constraints>
+                                                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="ic_propertybar_file_pdf" id="9yq-c5-Xp9"/>
+                                                    </imageView>
+                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="POe-MA-3Cr">
+                                                        <rect key="frame" x="42" y="30" width="172" height="16"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="168" id="fnM-KA-hiY"/>
+                                                        </constraints>
+                                                        <textFieldCell key="cell" lineBreakMode="truncatingMiddle" title="Label" id="bKX-WH-dct">
+                                                            <font key="font" metaFont="system"/>
+                                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                        </textFieldCell>
+                                                    </textField>
+                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="D1d-zo-pBW">
+                                                        <rect key="frame" x="42" y="10" width="37" height="16"/>
+                                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="AUp-s3-0NI">
+                                                            <font key="font" metaFont="system"/>
+                                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                        </textFieldCell>
+                                                    </textField>
+                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="l6f-Zr-7WC">
+                                                        <rect key="frame" x="83" y="10" width="37" height="16"/>
+                                                        <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="pq1-Ar-zaK">
+                                                            <font key="font" metaFont="system"/>
+                                                            <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                        </textFieldCell>
+                                                    </textField>
+                                                </subviews>
+                                                <constraints>
+                                                    <constraint firstItem="POe-MA-3Cr" firstAttribute="leading" secondItem="d4U-81-9Lm" secondAttribute="trailing" constant="8" id="3gD-jg-v9u"/>
+                                                    <constraint firstItem="d4U-81-9Lm" firstAttribute="centerY" secondItem="sDJ-cB-va9" secondAttribute="centerY" id="65C-qF-QXY"/>
+                                                    <constraint firstItem="D1d-zo-pBW" firstAttribute="leading" secondItem="d4U-81-9Lm" secondAttribute="trailing" constant="8" id="E6y-WV-AFh"/>
+                                                    <constraint firstItem="POe-MA-3Cr" firstAttribute="top" secondItem="sDJ-cB-va9" secondAttribute="top" id="LJ8-Ou-WuE"/>
+                                                    <constraint firstItem="l6f-Zr-7WC" firstAttribute="top" secondItem="POe-MA-3Cr" secondAttribute="bottom" constant="4" id="SFL-2n-3Cj"/>
+                                                    <constraint firstAttribute="height" constant="46" id="TR0-3V-a4E"/>
+                                                    <constraint firstAttribute="width" constant="224" id="aGZ-Yi-r4h"/>
+                                                    <constraint firstItem="l6f-Zr-7WC" firstAttribute="leading" secondItem="D1d-zo-pBW" secondAttribute="trailing" constant="8" id="aQe-C4-cvb"/>
+                                                    <constraint firstItem="D1d-zo-pBW" firstAttribute="top" secondItem="POe-MA-3Cr" secondAttribute="bottom" constant="4" id="et3-gu-fCD"/>
+                                                    <constraint firstItem="d4U-81-9Lm" firstAttribute="leading" secondItem="sDJ-cB-va9" secondAttribute="leading" constant="4" id="rgu-2J-Mkf"/>
+                                                </constraints>
+                                            </customView>
+                                            <button translatesAutoresizingMaskIntoConstraints="NO" id="Vj8-am-8Gm">
+                                                <rect key="frame" x="218" y="140" width="20" height="20"/>
+                                                <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="aiPDF_Clear" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="V8Q-CY-OqW">
+                                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                    <font key="font" metaFont="system"/>
+                                                </buttonCell>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="20" id="Phs-Z3-91k"/>
+                                                    <constraint firstAttribute="width" constant="20" id="QDu-7B-heo"/>
+                                                </constraints>
+                                                <connections>
+                                                    <action selector="removeChooseFile:" target="c22-O7-iKe" id="enL-rL-Sz0"/>
+                                                </connections>
+                                            </button>
+                                        </subviews>
+                                        <constraints>
+                                            <constraint firstAttribute="trailing" secondItem="t76-8V-Z4p" secondAttribute="trailing" constant="8" id="0PN-JI-nGx"/>
+                                            <constraint firstItem="sDJ-cB-va9" firstAttribute="top" secondItem="ruh-uQ-Fyv" secondAttribute="bottom" constant="8" id="8Rm-T6-qki"/>
+                                            <constraint firstItem="ruh-uQ-Fyv" firstAttribute="top" secondItem="Tld-qg-AAs" secondAttribute="top" id="HIb-gx-HSP"/>
+                                            <constraint firstItem="Otk-4Z-gC7" firstAttribute="top" secondItem="Tld-qg-AAs" secondAttribute="top" id="HkR-zz-H1r"/>
+                                            <constraint firstItem="t76-8V-Z4p" firstAttribute="leading" secondItem="Tld-qg-AAs" secondAttribute="leading" constant="8" id="Qh2-d5-zYq"/>
+                                            <constraint firstItem="ruh-uQ-Fyv" firstAttribute="leading" secondItem="Tld-qg-AAs" secondAttribute="leading" id="Rm1-tY-eNw"/>
+                                            <constraint firstAttribute="trailing" secondItem="86l-M4-ksM" secondAttribute="trailing" constant="8" id="SKY-NW-GzG"/>
+                                            <constraint firstAttribute="trailing" secondItem="Otk-4Z-gC7" secondAttribute="trailing" constant="8" id="TGI-iP-9vH"/>
+                                            <constraint firstItem="86l-M4-ksM" firstAttribute="leading" secondItem="Tld-qg-AAs" secondAttribute="leading" constant="8" id="ToC-dV-TgY"/>
+                                            <constraint firstItem="t76-8V-Z4p" firstAttribute="top" secondItem="ruh-uQ-Fyv" secondAttribute="bottom" constant="4" id="USU-xA-666"/>
+                                            <constraint firstItem="dSN-RY-s4T" firstAttribute="leading" secondItem="Tld-qg-AAs" secondAttribute="leading" constant="12" id="VX7-Sc-uhG"/>
+                                            <constraint firstItem="sDJ-cB-va9" firstAttribute="centerX" secondItem="Tld-qg-AAs" secondAttribute="centerX" id="WHZ-VE-bo9"/>
+                                            <constraint firstItem="86l-M4-ksM" firstAttribute="top" secondItem="Tld-qg-AAs" secondAttribute="top" id="WZ8-zu-1QF"/>
+                                            <constraint firstAttribute="trailing" secondItem="ruh-uQ-Fyv" secondAttribute="trailing" id="YVA-f6-tzN"/>
+                                            <constraint firstItem="Otk-4Z-gC7" firstAttribute="leading" secondItem="Tld-qg-AAs" secondAttribute="leading" constant="8" id="dL9-Qt-9jT"/>
+                                            <constraint firstAttribute="bottom" secondItem="Otk-4Z-gC7" secondAttribute="bottom" constant="16" id="drG-7A-fPZ"/>
+                                            <constraint firstItem="Vj8-am-8Gm" firstAttribute="trailing" secondItem="sDJ-cB-va9" secondAttribute="trailing" constant="7" id="hmd-YZ-Hio"/>
+                                            <constraint firstItem="Vj8-am-8Gm" firstAttribute="top" secondItem="sDJ-cB-va9" secondAttribute="top" constant="-7" id="lXI-VD-OcR"/>
+                                            <constraint firstItem="dSN-RY-s4T" firstAttribute="top" secondItem="Tld-qg-AAs" secondAttribute="top" constant="-2" id="rgw-7X-Z2w"/>
+                                        </constraints>
+                                    </customView>
+                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="rB9-d1-Cdg">
+                                        <rect key="frame" x="0.0" y="0.0" width="238" height="32"/>
+                                        <subviews>
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="x8R-lQ-xRW">
+                                                <rect key="frame" x="10" y="8" width="49" height="16"/>
+                                                <textFieldCell key="cell" lineBreakMode="clipping" title="0/2000" id="Geq-53-8fy">
+                                                    <font key="font" metaFont="system"/>
+                                                    <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                                    <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                </textFieldCell>
+                                            </textField>
+                                            <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Rzz-Sx-ccf">
+                                                <rect key="frame" x="169" y="-1" width="64" height="32"/>
+                                                <buttonCell key="cell" type="push" title="Start" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="BP0-YB-WBS">
+                                                    <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                                    <font key="font" metaFont="system"/>
+                                                    <string key="keyEquivalent" base64-UTF8="YES">
+DQ
+</string>
+                                                </buttonCell>
+                                                <connections>
+                                                    <action selector="startAIAction:" target="c22-O7-iKe" id="4Y1-uT-Yem"/>
+                                                </connections>
+                                            </button>
+                                        </subviews>
+                                        <constraints>
+                                            <constraint firstAttribute="trailing" secondItem="Rzz-Sx-ccf" secondAttribute="trailing" constant="12" id="Mub-Te-wr5"/>
+                                            <constraint firstItem="x8R-lQ-xRW" firstAttribute="centerY" secondItem="rB9-d1-Cdg" secondAttribute="centerY" id="OAp-ch-fcu"/>
+                                            <constraint firstItem="Rzz-Sx-ccf" firstAttribute="centerY" secondItem="rB9-d1-Cdg" secondAttribute="centerY" id="ofM-Vh-z88"/>
+                                            <constraint firstItem="x8R-lQ-xRW" firstAttribute="leading" secondItem="rB9-d1-Cdg" secondAttribute="leading" constant="12" id="rDT-e2-d8v"/>
+                                            <constraint firstAttribute="height" constant="32" id="w5z-WG-Wbq"/>
+                                        </constraints>
+                                    </customView>
+                                </subviews>
+                                <constraints>
+                                    <constraint firstItem="Tld-qg-AAs" firstAttribute="leading" secondItem="Kgd-1g-WEA" secondAttribute="leading" id="5tC-43-kCU"/>
+                                    <constraint firstItem="Tld-qg-AAs" firstAttribute="top" secondItem="y7L-XQ-ePy" secondAttribute="bottom" constant="4" id="GrZ-s4-oKh"/>
+                                    <constraint firstAttribute="bottom" secondItem="rB9-d1-Cdg" secondAttribute="bottom" id="JBd-t3-u1s"/>
+                                    <constraint firstAttribute="trailing" secondItem="rB9-d1-Cdg" secondAttribute="trailing" id="T6Y-0m-7uJ"/>
+                                    <constraint firstAttribute="trailing" secondItem="y7L-XQ-ePy" secondAttribute="trailing" id="ibb-qA-HTL"/>
+                                    <constraint firstItem="rB9-d1-Cdg" firstAttribute="top" secondItem="Tld-qg-AAs" secondAttribute="bottom" id="ibm-cP-dSw"/>
+                                    <constraint firstItem="rB9-d1-Cdg" firstAttribute="leading" secondItem="Kgd-1g-WEA" secondAttribute="leading" id="jHf-tc-LWE"/>
+                                    <constraint firstItem="y7L-XQ-ePy" firstAttribute="leading" secondItem="Kgd-1g-WEA" secondAttribute="leading" id="ktQ-qJ-rTH"/>
+                                    <constraint firstAttribute="trailing" secondItem="Tld-qg-AAs" secondAttribute="trailing" id="lwe-RC-P4H"/>
+                                    <constraint firstItem="y7L-XQ-ePy" firstAttribute="top" secondItem="Kgd-1g-WEA" secondAttribute="top" id="r4P-dc-oWX"/>
+                                </constraints>
+                            </customView>
+                        </subviews>
+                        <constraints>
+                            <constraint firstItem="6CO-V7-P4Z" firstAttribute="leading" secondItem="sxN-il-SXN" secondAttribute="leading" id="4Rr-hc-FEx"/>
+                            <constraint firstAttribute="trailing" secondItem="Kgd-1g-WEA" secondAttribute="trailing" id="Bgn-AN-J4K"/>
+                            <constraint firstItem="Kgd-1g-WEA" firstAttribute="leading" secondItem="sxN-il-SXN" secondAttribute="leading" id="FRu-Qi-VBb"/>
+                            <constraint firstItem="Kgd-1g-WEA" firstAttribute="top" secondItem="sxN-il-SXN" secondAttribute="top" id="O6a-g5-Fzu"/>
+                            <constraint firstAttribute="bottom" secondItem="6CO-V7-P4Z" secondAttribute="bottom" id="SIM-zD-Fff"/>
+                            <constraint firstItem="6CO-V7-P4Z" firstAttribute="top" secondItem="sxN-il-SXN" secondAttribute="top" id="a8n-BQ-a5b"/>
+                            <constraint firstAttribute="bottom" secondItem="Kgd-1g-WEA" secondAttribute="bottom" id="lsV-XO-BTw"/>
+                            <constraint firstAttribute="trailing" secondItem="6CO-V7-P4Z" secondAttribute="trailing" id="wIj-LH-8Y8"/>
+                        </constraints>
+                    </view>
+                </box>
+            </subviews>
+            <constraints>
+                <constraint firstItem="pD8-rz-1tQ" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="BUD-CO-ZVR"/>
+                <constraint firstAttribute="bottom" secondItem="pD8-rz-1tQ" secondAttribute="bottom" id="a0v-F1-gTd"/>
+                <constraint firstAttribute="trailing" secondItem="pD8-rz-1tQ" secondAttribute="trailing" id="sUG-J5-xG3"/>
+                <constraint firstItem="pD8-rz-1tQ" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="zyb-zN-zvl"/>
+            </constraints>
+            <connections>
+                <outlet property="chooseCurFileBtn" destination="2bI-Ru-o29" id="sDj-Zl-fF3"/>
+                <outlet property="chooseFileBtn" destination="5an-3P-NBy" id="PWn-IC-IJg"/>
+                <outlet property="chooseFileBtnView" destination="ruh-uQ-Fyv" id="xDS-tw-h9U"/>
+                <outlet property="chooseFileViewTopConst" destination="HIb-gx-HSP" id="W5D-m1-obm"/>
+                <outlet property="contendBox" destination="pD8-rz-1tQ" id="AIt-e4-WRT"/>
+                <outlet property="fileEmptyTextView" destination="HF1-Pc-Fff" id="t95-sy-Qls"/>
+                <outlet property="fileInfoContendView" destination="sDJ-cB-va9" id="Dua-rd-btS"/>
+                <outlet property="fileInfoImg" destination="d4U-81-9Lm" id="6Kx-Oo-RI1"/>
+                <outlet property="fileInfoViewTopConst" destination="8Rm-T6-qki" id="Lwr-D7-chV"/>
+                <outlet property="fileNameLabel" destination="POe-MA-3Cr" id="f9d-ne-E62"/>
+                <outlet property="filePageCountLabel" destination="l6f-Zr-7WC" id="F05-FF-kB8"/>
+                <outlet property="fileSizeLabel" destination="D1d-zo-pBW" id="GoA-Ad-Wal"/>
+                <outlet property="fileSizeTipLabel" destination="gTS-09-xht" id="qxt-PO-m8X"/>
+                <outlet property="fileSizeTipView" destination="t76-8V-Z4p" id="JFH-k1-bsW"/>
+                <outlet property="fromLanguageBtn" destination="cfR-eg-Ej9" id="9Zk-CP-DBH"/>
+                <outlet property="fromLanguageLabel" destination="awg-zk-OOg" id="GDp-7n-K6z"/>
+                <outlet property="fromLanguageView" destination="z3M-0o-bfB" id="r4A-G8-qGa"/>
+                <outlet property="infoContendView" destination="Kgd-1g-WEA" id="Voq-5Q-mzC"/>
+                <outlet property="inputTextCountLabel" destination="x8R-lQ-xRW" id="z9a-Km-AHZ"/>
+                <outlet property="placeholdLabel" destination="dSN-RY-s4T" id="cof-tu-6Tq"/>
+                <outlet property="placeholdLabelTopConst" destination="rgw-7X-Z2w" id="uk9-PC-9mt"/>
+                <outlet property="removeChooseFileBtn" destination="Vj8-am-8Gm" id="qy5-T6-LDo"/>
+                <outlet property="startButton" destination="Rzz-Sx-ccf" id="qLj-kw-wrj"/>
+                <outlet property="stringClearBtn" destination="0vw-Pt-XuK" id="j9g-wm-z8N"/>
+                <outlet property="textScrollView" destination="Otk-4Z-gC7" id="YKG-71-3OL"/>
+                <outlet property="textScrollViewTopConst" destination="HkR-zz-H1r" id="L0M-DQ-qK7"/>
+                <outlet property="titleLabel" destination="2Wj-F1-dBg" id="fz7-RG-9ME"/>
+                <outlet property="titleTipBtn" destination="n96-Bm-cmt" id="6Sd-PV-vlc"/>
+                <outlet property="toLanguageBtn" destination="KG2-9V-syN" id="yUS-mH-esA"/>
+                <outlet property="toLanguageLabel" destination="afk-d4-8cf" id="VjJ-nq-icm"/>
+                <outlet property="toLanguageView" destination="Ek7-fa-Yrv" id="KGN-d8-Ijl"/>
+                <outlet property="translateChangeBtn" destination="5Q8-wz-vXb" id="m2i-ku-avz"/>
+                <outlet property="translateConfigView" destination="86l-M4-ksM" id="wqw-13-gX8"/>
+                <outlet property="typeEmptyTipLabel" destination="sz6-fP-Bdb" id="EvF-yG-g9j"/>
+                <outlet property="typeEmptyTipView" destination="6CO-V7-P4Z" id="MKd-pm-uVC"/>
+                <outlet property="typeHeaderView" destination="y7L-XQ-ePy" id="6fN-Sf-BwB"/>
+            </connections>
+            <point key="canvasLocation" x="2" y="176.5"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="AIchange" width="18" height="18"/>
+        <image name="aiPDF_Clear" width="17" height="17"/>
+        <image name="aiTextClose" width="16" height="16"/>
+        <image name="ic_btn_arrow_down" width="11" height="11"/>
+        <image name="ic_else_alert" width="14" height="14"/>
+        <image name="ic_else_info_large" width="14" height="14"/>
+        <image name="ic_propertybar_file_pdf" width="32" height="32"/>
+    </resources>
+</document>

+ 46 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIRedoConfirmView/AIRedoConfirmView.swift

@@ -0,0 +1,46 @@
+//
+//  AIRedoConfirmView.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/22.
+//
+
+import Cocoa
+
+class AIRedoConfirmView: NSView, NibLoadable {
+
+    @IBOutlet weak var contendView: NSView!
+    @IBOutlet weak var infoLabel: NSTextField!
+    
+    @IBOutlet weak var redoButton: NSButton!
+    
+    var redoHandle: ((_ view: AIRedoConfirmView) -> Void)?
+    
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+     
+        self.wantsLayer = true
+        self.layer?.backgroundColor = NSColor.clear.cgColor
+        
+        self.infoLabel.font = NSFont.SFProTextRegularFont(13)
+        self.infoLabel.stringValue = NSLocalizedString("Redoing will cost 1 credit. Do you want to redo it?", comment: "")
+        self.redoButton.title = NSLocalizedString("Redo (1 credit)", comment: "")
+        
+    }
+    
+    @IBAction func redoAction(_ sender: Any) {
+        guard let callBack = self.redoHandle else {
+            return
+        }
+        callBack(self)
+    }
+    
+    
+}

+ 67 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIRedoConfirmView/AIRedoConfirmView.xib

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe" customClass="AIRedoConfirmView" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="168" height="84"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="Yht-sZ-aLc">
+                    <rect key="frame" x="0.0" y="0.0" width="168" height="84"/>
+                    <subviews>
+                        <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Crj-NC-BGQ">
+                            <rect key="frame" x="6" y="36" width="156" height="48"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="152" id="w7x-ZL-FQj"/>
+                            </constraints>
+                            <textFieldCell key="cell" alignment="left" title="Redoing will cost 1 credit. Do you want to redo it?" id="ipH-J9-tkt">
+                                <font key="font" usesAppearanceFont="YES"/>
+                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                            </textFieldCell>
+                        </textField>
+                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="G4R-se-0w6">
+                            <rect key="frame" x="1" y="1" width="123" height="32"/>
+                            <buttonCell key="cell" type="push" title="Redo (1 credit)" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="nBH-pC-Yi9">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                                <string key="keyEquivalent" base64-UTF8="YES">
+DQ
+</string>
+                            </buttonCell>
+                            <connections>
+                                <action selector="redoAction:" target="c22-O7-iKe" id="rKa-xM-44d"/>
+                            </connections>
+                        </button>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="Crj-NC-BGQ" firstAttribute="top" secondItem="Yht-sZ-aLc" secondAttribute="top" id="AHX-8t-yEg"/>
+                        <constraint firstAttribute="bottom" secondItem="G4R-se-0w6" secondAttribute="bottom" constant="8" id="TpF-M3-jQQ"/>
+                        <constraint firstItem="Crj-NC-BGQ" firstAttribute="leading" secondItem="Yht-sZ-aLc" secondAttribute="leading" constant="8" id="boO-7K-yPz"/>
+                        <constraint firstItem="G4R-se-0w6" firstAttribute="leading" secondItem="Yht-sZ-aLc" secondAttribute="leading" constant="8" id="cmu-58-6XQ"/>
+                        <constraint firstItem="G4R-se-0w6" firstAttribute="top" secondItem="Crj-NC-BGQ" secondAttribute="bottom" constant="8" id="p4M-Ff-vvt"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="Yht-sZ-aLc" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="3Tl-PJ-7C5"/>
+                <constraint firstItem="Yht-sZ-aLc" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="Xep-J9-VZY"/>
+                <constraint firstAttribute="bottom" secondItem="Yht-sZ-aLc" secondAttribute="bottom" id="hex-pp-Lwy"/>
+                <constraint firstAttribute="trailing" secondItem="Yht-sZ-aLc" secondAttribute="trailing" id="iFf-yK-s7B"/>
+            </constraints>
+            <connections>
+                <outlet property="contendView" destination="Yht-sZ-aLc" id="jcL-tl-DkP"/>
+                <outlet property="infoLabel" destination="Crj-NC-BGQ" id="Crt-Xy-rbK"/>
+                <outlet property="redoButton" destination="G4R-se-0w6" id="S4f-Iy-Zk6"/>
+            </connections>
+            <point key="canvasLocation" x="27" y="116"/>
+        </customView>
+    </objects>
+</document>

+ 278 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AITypeItemChooseView/AITypeItemChooseView.swift

@@ -0,0 +1,278 @@
+//
+//  AITypeItemChooseView.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/17.
+//
+
+import Cocoa
+
+class AITypeItemChooseView: NSView, NibLoadable {
+
+    @IBOutlet weak var contendView: NSView!
+    
+    @IBOutlet weak var summarizeBtn: KMButton!
+    @IBOutlet weak var reWriteBtn: KMButton!
+    @IBOutlet weak var proofreadBtn: KMButton!
+    @IBOutlet weak var translateBtn: KMButton!
+    
+    @IBOutlet weak var closeBtn: KMButton!
+    
+    var viewHeight: CGFloat = 0
+    
+    var popOver: NSPopover!
+    
+    var chooseTypeHandle: ((_ view: AITypeItemChooseView, _ clickType: AIConfigType) -> Void)?
+    var clearHandle: ((_ view: AITypeItemChooseView) -> Void)?
+    
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+    override func layout() {
+        super.layout()
+        
+        self.refreshUI()
+    }
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+         
+        self.summarizeBtn.title = NSLocalizedString("AI Summarize", comment: "")
+        self.reWriteBtn.title = NSLocalizedString("AI Rewrite", comment: "")
+        self.proofreadBtn.title = NSLocalizedString("AI Proofread", comment: "")
+        self.translateBtn.title = NSLocalizedString("AI Translate", comment: "")
+        
+        
+        
+        self.summarizeBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered && self.summarizeBtn.isEnabled{
+                if KMAppearance.isDarkMode() {
+                    self.summarizeBtn.layer?.backgroundColor = NSColor(red: 186/255, green: 209/255, blue: 249/255, alpha: 1).cgColor
+                } else {
+                    self.summarizeBtn.layer?.backgroundColor = NSColor(red: 186/255, green: 209/255, blue: 249/255, alpha: 1).cgColor
+                }
+            } else {
+                if KMAppearance.isDarkMode() {
+                    self.summarizeBtn?.layer?.backgroundColor = KMAppearance.KMColor_Interactive_M0().cgColor
+                } else {
+                    self.summarizeBtn?.layer?.backgroundColor = NSColor(red: 216/255, green: 234/255, blue: 255/255, alpha: 1).cgColor
+                }
+            }
+        }
+        
+        self.reWriteBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered && self.reWriteBtn.isEnabled{
+                if KMAppearance.isDarkMode() {
+                    self.reWriteBtn.layer?.backgroundColor = NSColor(red: 186/255, green: 209/255, blue: 249/255, alpha: 1).cgColor
+                } else {
+                    self.reWriteBtn.layer?.backgroundColor = NSColor(red: 186/255, green: 209/255, blue: 249/255, alpha: 1).cgColor
+                }
+            } else {
+                if KMAppearance.isDarkMode() {
+                    self.reWriteBtn?.layer?.backgroundColor = KMAppearance.KMColor_Interactive_M0().cgColor
+                } else {
+                    self.reWriteBtn?.layer?.backgroundColor = NSColor(red: 216/255, green: 234/255, blue: 255/255, alpha: 1).cgColor
+                }
+            }
+        }
+        
+        self.proofreadBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered && self.proofreadBtn.isEnabled{
+                if KMAppearance.isDarkMode() {
+                    self.proofreadBtn.layer?.backgroundColor = NSColor(red: 186/255, green: 209/255, blue: 249/255, alpha: 1).cgColor
+                } else {
+                    self.proofreadBtn.layer?.backgroundColor = NSColor(red: 186/255, green: 209/255, blue: 249/255, alpha: 1).cgColor
+                }
+            } else {
+                if KMAppearance.isDarkMode() {
+                    self.proofreadBtn?.layer?.backgroundColor = KMAppearance.KMColor_Interactive_M0().cgColor
+                } else {
+                    self.proofreadBtn?.layer?.backgroundColor = NSColor(red: 216/255, green: 234/255, blue: 255/255, alpha: 1).cgColor
+                }
+            }
+        }
+        
+        self.translateBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered && self.translateBtn.isEnabled {
+                if KMAppearance.isDarkMode() {
+                    self.translateBtn.layer?.backgroundColor = NSColor(red: 186/255, green: 209/255, blue: 249/255, alpha: 1).cgColor
+                } else {
+                    self.translateBtn.layer?.backgroundColor = NSColor(red: 186/255, green: 209/255, blue: 249/255, alpha: 1).cgColor
+                }
+            } else {
+                if KMAppearance.isDarkMode() {
+                    self.translateBtn?.layer?.backgroundColor = KMAppearance.KMColor_Interactive_M0().cgColor
+                } else {
+                    self.translateBtn?.layer?.backgroundColor = NSColor(red: 216/255, green: 234/255, blue: 255/255, alpha: 1).cgColor
+                }
+            }
+        }
+        
+        self.closeBtn.mouseMoveCallback = {[unowned self] mouseEntered in
+            if mouseEntered && self.closeBtn.isEnabled == true {
+                self.closeBtn.image = NSImage(named: "AIChatInfoClearHover")
+                
+                let tipString = NSLocalizedString("Clear session", comment: "")
+                
+                let popViewController = KMToolbarItemPopViewController.init()
+                if self.popOver == nil {
+                    self.popOver = NSPopover.init()
+                }
+                self.popOver.contentViewController = popViewController
+                self.popOver.animates = false
+                self.popOver.behavior = .semitransient
+                self.popOver.contentSize = (popViewController.view.frame.size)
+                popViewController.updateWithHelpTip(helpTip: tipString)
+                
+                let origin = self.contendView.convert(self.closeBtn.frame.origin, from: self)
+                var frame = self.closeBtn.frame
+                frame.origin.x = origin.x
+                frame.origin.y = origin.y
+                self.popOver.show(relativeTo: frame, of: self, preferredEdge: .maxY)
+                
+            } else {
+                self.closeBtn.image = NSImage(named: "AIChatInfoClear")
+                self.popOver.close()
+            }
+        }
+        
+        self.refreshUI()
+        
+        self.refreshViewColor()
+    }
+    
+    func refreshViewColor() {
+        
+        for button in [self.summarizeBtn, self.reWriteBtn, self.proofreadBtn, self.translateBtn] {
+            button?.wantsLayer = true
+            button?.layer?.cornerRadius = 4
+            button?.layer?.masksToBounds = true
+            button?.font = NSFont.SFProTextRegularFont(13)
+            
+            if KMAppearance.isDarkMode() {
+                button?.setTitleColor(KMAppearance.KMColor_Layout_W0())
+                button?.layer?.backgroundColor = KMAppearance.KMColor_Interactive_M0().cgColor
+            } else {
+                button?.setTitleColor(KMAppearance.KMColor_Layout_H0())
+                button?.layer?.backgroundColor = NSColor(red: 216/255, green: 234/255, blue: 255/255, alpha: 1).cgColor
+            }
+            
+        }
+    }
+    
+    
+    func refreshUI() {
+        
+        self.summarizeBtn.sizeToFit()
+        self.reWriteBtn.sizeToFit()
+        self.proofreadBtn.sizeToFit()
+        self.translateBtn.sizeToFit()
+        
+        var maxXValue = 0.1
+        let btnHegith = 24.0
+        let btnXoffset = 2.0
+        var offsetYValue = CGRectGetHeight(self.contendView.frame)-btnHegith
+        var lineCount = 1
+        
+        self.summarizeBtn.frame = CGRectMake(maxXValue, offsetYValue, self.summarizeBtn.frame.size.width + 4, btnHegith)
+        self.summarizeBtn.autoresizingMask = [.maxXMargin, .minYMargin]
+        
+        maxXValue = CGRectGetMaxX(self.summarizeBtn.frame)
+        maxXValue += btnXoffset
+        
+        if (maxXValue + CGRectGetWidth(reWriteBtn.frame) + btnXoffset) > CGRectGetWidth(self.contendView.frame) {
+            maxXValue = 0.1
+            offsetYValue = CGRectGetMinY(self.summarizeBtn.frame) - 4 - btnHegith
+            lineCount += 1
+        }
+        self.reWriteBtn.frame = CGRectMake(maxXValue, offsetYValue, self.reWriteBtn.frame.size.width + 4, btnHegith)
+        self.reWriteBtn.autoresizingMask = [.maxXMargin, .minYMargin]
+        
+        maxXValue = CGRectGetMaxX(self.reWriteBtn.frame)
+        maxXValue += btnXoffset
+        
+        if (maxXValue + CGRectGetWidth(self.proofreadBtn.frame) + 2) > CGRectGetWidth(self.contendView.frame) {
+            maxXValue = 0.1
+            offsetYValue = CGRectGetMinY(self.reWriteBtn.frame) - 4 - btnHegith
+            lineCount += 1
+        }
+        
+        self.proofreadBtn.frame = CGRectMake(maxXValue, offsetYValue, self.proofreadBtn.frame.size.width + 4, btnHegith)
+        self.proofreadBtn.autoresizingMask = [.maxXMargin, .minYMargin]
+        
+        maxXValue = CGRectGetMaxX(self.proofreadBtn.frame)
+        maxXValue += 2
+        
+        if (maxXValue + CGRectGetWidth(self.translateBtn.frame) + 2) > CGRectGetWidth(self.contendView.frame) {
+            maxXValue = 0.1
+            offsetYValue = CGRectGetMinY(self.proofreadBtn.frame) - 4 - btnHegith
+            lineCount += 1
+        }
+        self.translateBtn.frame = CGRectMake(maxXValue, offsetYValue, self.translateBtn.frame.size.width + 4, btnHegith)
+        self.translateBtn.autoresizingMask = [.maxXMargin, .minYMargin]
+ 
+        if lineCount == 1 {
+            self.viewHeight = 30
+        } else if lineCount == 2 {
+            self.viewHeight = 56
+        } else if lineCount == 3 {
+            self.viewHeight = 82
+        } else if lineCount == 4 {
+            self.viewHeight = 108
+        }
+        
+        var rect = self.closeBtn.frame
+        rect.origin.x = CGRectGetWidth(self.contendView.frame) - 15
+        rect.origin.y = CGRectGetMidY(self.translateBtn.frame) - 7.5
+        self.closeBtn.frame = rect
+         
+    }
+    
+    func reloadData() {
+        if AIChatInfoManager.defaultManager.isAILoading {
+            self.summarizeBtn.isEnabled = false
+            self.reWriteBtn.isEnabled = false
+            self.proofreadBtn.isEnabled = false
+            self.translateBtn.isEnabled = false
+            self.closeBtn.isEnabled = false
+        } else {
+            self.summarizeBtn.isEnabled = true
+            self.reWriteBtn.isEnabled = true
+            self.proofreadBtn.isEnabled = true
+            self.translateBtn.isEnabled = true
+            self.closeBtn.isEnabled = true
+        }
+        
+    }
+    
+    //MARK: IBAction
+    @IBAction func typeChooseAction(_ sender: NSButton) {
+        var configType: AIConfigType = .none
+        if sender == self.summarizeBtn {
+            configType = .summarize
+        } else if sender == self.reWriteBtn {
+            configType = .reWriting
+        } else if sender == self.proofreadBtn {
+            configType = .proofreading
+        } else if sender == self.translateBtn {
+            configType = .translate
+        }
+        
+        guard let callBack = self.chooseTypeHandle else {
+            return
+        }
+        callBack(self, configType)
+    }
+    
+    @IBAction func clearAction(_ sender: NSButton) {
+        guard let callBack = self.clearHandle else {
+            return
+        }
+        callBack(self)
+        
+    }
+    
+}

+ 97 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AITypeItemChooseView/AITypeItemChooseView.xib

@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe" customClass="AITypeItemChooseView" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="246" height="52"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="d54-QW-nwd">
+                    <rect key="frame" x="0.0" y="0.0" width="246" height="52"/>
+                    <subviews>
+                        <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="BfS-GM-LoP" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                            <rect key="frame" x="0.0" y="31" width="110" height="20"/>
+                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            <buttonCell key="cell" type="square" title="# AI Summarize" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="hq2-1a-h0P">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                            <connections>
+                                <action selector="typeChooseAction:" target="c22-O7-iKe" id="PpU-Ls-osG"/>
+                            </connections>
+                        </button>
+                        <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ETk-KT-VTT" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                            <rect key="frame" x="118" y="29" width="89" height="20"/>
+                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            <buttonCell key="cell" type="square" title="# AI Rewrite" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="gVx-5S-hdZ">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                            <connections>
+                                <action selector="typeChooseAction:" target="c22-O7-iKe" id="7hA-yG-xgS"/>
+                            </connections>
+                        </button>
+                        <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="y5C-7p-mnl" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                            <rect key="frame" x="0.0" y="6" width="102" height="20"/>
+                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            <buttonCell key="cell" type="square" title="# AI Proofread" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="627-fq-Ac4">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                            <connections>
+                                <action selector="typeChooseAction:" target="c22-O7-iKe" id="ZsM-0q-urA"/>
+                            </connections>
+                        </button>
+                        <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="HbG-Tv-zvd" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                            <rect key="frame" x="107" y="5" width="91" height="20"/>
+                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            <buttonCell key="cell" type="square" title="# AI Translate" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="97V-3I-pfM">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                            <connections>
+                                <action selector="typeChooseAction:" target="c22-O7-iKe" id="Hg5-ue-2wL"/>
+                            </connections>
+                        </button>
+                        <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wdZ-1b-530" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                            <rect key="frame" x="231" y="0.0" width="15" height="15"/>
+                            <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                            <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="AIChatInfoClear" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="uET-ja-P7q">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                            <connections>
+                                <action selector="clearAction:" target="c22-O7-iKe" id="E8O-O1-R3W"/>
+                            </connections>
+                        </button>
+                    </subviews>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="d54-QW-nwd" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="JIP-2K-5TF"/>
+                <constraint firstAttribute="bottom" secondItem="d54-QW-nwd" secondAttribute="bottom" id="XSe-Pi-mkB"/>
+                <constraint firstAttribute="trailing" secondItem="d54-QW-nwd" secondAttribute="trailing" id="ecV-Nu-hJg"/>
+                <constraint firstItem="d54-QW-nwd" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="lll-ce-2Mj"/>
+            </constraints>
+            <connections>
+                <outlet property="closeBtn" destination="wdZ-1b-530" id="7gm-fx-YS0"/>
+                <outlet property="contendView" destination="d54-QW-nwd" id="87V-0u-4R9"/>
+                <outlet property="proofreadBtn" destination="y5C-7p-mnl" id="baX-mW-lZl"/>
+                <outlet property="reWriteBtn" destination="ETk-KT-VTT" id="bwp-YE-9CP"/>
+                <outlet property="summarizeBtn" destination="BfS-GM-LoP" id="HUB-pS-AUv"/>
+                <outlet property="translateBtn" destination="HbG-Tv-zvd" id="RyK-5u-LRE"/>
+            </connections>
+            <point key="canvasLocation" x="189" y="210.5"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="AIChatInfoClear" width="15" height="15"/>
+    </resources>
+</document>

+ 82 - 0
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/CornerView/CustomCornerView.swift

@@ -0,0 +1,82 @@
+//
+//  CustomCornerView.swift
+//  PDF Reader Pro Edition
+//
+//  Created by Niehaoyu on 2024/4/24.
+//
+
+import Cocoa
+
+class CustomCornerView: NSView {
+
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+}
+
+class LeftTopRoundedRectView: NSView {
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+        
+        let cornerRadius: CGFloat = 6
+        let path = NSBezierPath()
+        
+        path.move(to: NSPoint(x: bounds.minX, y: bounds.minY + cornerRadius))
+        path.appendArc(from: NSPoint(x: bounds.minX, y: bounds.minY), to: NSPoint(x: bounds.minX + cornerRadius, y: bounds.minY), radius: cornerRadius)
+        path.line(to: NSPoint(x: bounds.maxX - cornerRadius, y: bounds.minY))
+        path.appendArc(from: NSPoint(x: bounds.maxX, y: bounds.minY), to: NSPoint(x: bounds.maxX, y: bounds.minY + cornerRadius), radius: cornerRadius)
+        path.appendArc(from: NSPoint(x: bounds.maxX, y: bounds.maxY), to: NSPoint(x: bounds.maxX - cornerRadius, y: bounds.maxY), radius: cornerRadius)
+        path.appendArc(from: NSPoint(x: bounds.minX, y: bounds.maxY), to: NSPoint(x: bounds.minX, y: bounds.maxY), radius: cornerRadius)
+        
+        path.close()
+        
+        self.fillColor.setFill()
+        path.fill()
+        
+        path.lineWidth = 1.0
+        self.lineColor.set()
+        path.stroke()
+            
+    }
+    
+    var fillColor: NSColor = NSColor.clear
+    var lineColor: NSColor = NSColor.black
+    
+}
+
+class RightTopRoundedRectView: NSView {
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+        
+        let cornerRadius: CGFloat = 6
+        let path = NSBezierPath()
+        
+        path.move(to: NSPoint(x: bounds.minX, y: bounds.minY + cornerRadius))
+        path.appendArc(from: NSPoint(x: bounds.minX, y: bounds.minY), to: NSPoint(x: bounds.minX + cornerRadius, y: bounds.minY), radius: cornerRadius)
+        path.line(to: NSPoint(x: bounds.maxX - cornerRadius, y: bounds.minY))
+        path.appendArc(from: NSPoint(x: bounds.maxX, y: bounds.minY), to: NSPoint(x: bounds.maxX, y: bounds.minY + cornerRadius), radius: cornerRadius)
+        path.appendArc(from: NSPoint(x: bounds.maxX, y: bounds.maxY), to: NSPoint(x: bounds.maxX, y: bounds.maxY), radius: cornerRadius)
+        path.appendArc(from: NSPoint(x: bounds.minX, y: bounds.maxY), to: NSPoint(x: bounds.minX, y: bounds.maxY - cornerRadius), radius: cornerRadius)
+        
+        path.close()
+        
+        self.fillColor.setFill()
+        path.fill()
+        
+        path.lineWidth = 1.0
+        self.lineColor.set()
+        
+        path.stroke()
+        
+        NSColor.red.setFill()
+        
+    }
+    
+    var fillColor: NSColor = NSColor.clear
+    var lineColor: NSColor = NSColor.black
+    
+}
+

+ 22 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatInfoClear.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "Property 1=nor.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Property 1=nor 1.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatInfoClear.imageset/Property 1=nor 1.pdf


二進制
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatInfoClear.imageset/Property 1=nor.pdf


二進制
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatInfoClearHover.imageset/AIChatInfoClearHover.pdf


+ 22 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatInfoClearHover.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "AIChatInfoClearHover.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Property 1=hover.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatInfoClearHover.imageset/Property 1=hover.pdf


二進制
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatRobot.imageset/AIChatRobot.pdf


+ 22 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatRobot.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "AIChatRobot.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Frame 1000006544.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatRobot.imageset/Frame 1000006544.pdf


二進制
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatRobotHome.imageset/AIChatRobotHome.pdf


+ 12 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIChatRobotHome.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "AIChatRobotHome.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 11 - 1
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIchange.imageset/Contents.json

@@ -1,7 +1,17 @@
 {
   "images" : [
     {
-      "filename" : "AIchange.pdf",
+      "filename" : "Property 1=nor.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Property 1=nor 1.pdf",
       "idiom" : "universal"
     }
   ],

+ 27 - 27
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIchange.imageset/AIchange.pdf

@@ -10,47 +10,47 @@ stream
 /DeviceRGB CS
 /DeviceRGB cs
 q
-1.000000 0.000000 -0.000000 1.000000 7.000000 14.000000 cm
+1.000000 0.000000 -0.000000 1.000000 5.248047 10.500000 cm
 0.460000 0.465714 0.500000 scn
-0.000000 1.000000 m
-12.000000 1.000000 l
-12.000000 3.000000 l
-0.000000 3.000000 l
-0.000000 1.000000 l
+0.000000 0.750000 m
+9.000000 0.750000 l
+9.000000 2.250000 l
+0.000000 2.250000 l
+0.000000 0.750000 l
 h
 f
 n
 Q
 q
-1.000000 0.000000 -0.000000 1.000000 5.000000 6.000000 cm
+1.000000 0.000000 -0.000000 1.000000 3.751953 4.500488 cm
 0.460000 0.465714 0.500000 scn
-0.000000 1.000000 m
-12.000000 1.000000 l
-12.000000 3.000000 l
-0.000000 3.000000 l
-0.000000 1.000000 l
+0.000000 0.750000 m
+9.000000 0.750000 l
+9.000000 2.250000 l
+0.000000 2.250000 l
+0.000000 0.750000 l
 h
 f
 n
 Q
 q
-1.000000 0.000000 -0.000000 1.000000 17.000000 12.000000 cm
+1.000000 0.000000 -0.000000 1.000000 12.753906 9.000488 cm
 0.460000 0.465714 0.500000 scn
-0.000000 8.000000 m
-4.000000 4.000000 l
+0.000000 6.000000 m
+3.000000 3.000000 l
 0.000000 0.000000 l
-0.000000 8.000000 l
+0.000000 6.000000 l
 h
 f
 n
 Q
 q
--1.000000 -0.000000 -0.000000 1.000000 7.000000 4.000000 cm
+-1.000000 -0.000000 -0.000000 1.000000 5.248047 3.000000 cm
 0.460000 0.465714 0.500000 scn
-0.000000 8.000000 m
-4.000000 4.000000 l
+0.000000 6.000000 m
+3.000000 3.000000 l
 0.000000 0.000000 l
-0.000000 8.000000 l
+0.000000 6.000000 l
 h
 f
 n
@@ -60,13 +60,13 @@ endstream
 endobj
 
 3 0 obj
-  793
+  788
 endobj
 
 4 0 obj
   << /Annots []
      /Type /Page
-     /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ]
+     /MediaBox [ 0.000000 0.000000 18.000000 18.000000 ]
      /Resources 1 0 R
      /Contents 2 0 R
      /Parent 5 0 R
@@ -91,15 +91,15 @@ xref
 0000000000 65535 f
 0000000010 00000 n
 0000000034 00000 n
-0000000883 00000 n
-0000000905 00000 n
-0000001078 00000 n
-0000001152 00000 n
+0000000878 00000 n
+0000000900 00000 n
+0000001073 00000 n
+0000001147 00000 n
 trailer
 << /ID [ (some) (id) ]
    /Root 6 0 R
    /Size 7
 >>
 startxref
-1211
+1206
 %%EOF

+ 105 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIchange.imageset/Property 1=nor.pdf

@@ -0,0 +1,105 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 5.248047 10.500000 cm
+0.460000 0.465714 0.500000 scn
+0.000000 0.750000 m
+9.000000 0.750000 l
+9.000000 2.250000 l
+0.000000 2.250000 l
+0.000000 0.750000 l
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 3.751953 4.500488 cm
+0.460000 0.465714 0.500000 scn
+0.000000 0.750000 m
+9.000000 0.750000 l
+9.000000 2.250000 l
+0.000000 2.250000 l
+0.000000 0.750000 l
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 12.753906 9.000488 cm
+0.460000 0.465714 0.500000 scn
+0.000000 6.000000 m
+3.000000 3.000000 l
+0.000000 0.000000 l
+0.000000 6.000000 l
+h
+f
+n
+Q
+q
+-1.000000 -0.000000 -0.000000 1.000000 5.248047 3.000000 cm
+0.460000 0.465714 0.500000 scn
+0.000000 6.000000 m
+3.000000 3.000000 l
+0.000000 0.000000 l
+0.000000 6.000000 l
+h
+f
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  788
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 18.000000 18.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000878 00000 n
+0000000900 00000 n
+0000001073 00000 n
+0000001147 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1206
+%%EOF

+ 22 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIchange_hover.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "Property 1=hover.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "Property 1=hover 1.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 105 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIchange_hover.imageset/Property 1=hover 1.pdf

@@ -0,0 +1,105 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 5.248047 10.500000 cm
+0.305882 0.498039 0.858824 scn
+0.000000 0.750000 m
+9.000000 0.750000 l
+9.000000 2.250000 l
+0.000000 2.250000 l
+0.000000 0.750000 l
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 3.751953 4.500488 cm
+0.305882 0.498039 0.858824 scn
+0.000000 0.750000 m
+9.000000 0.750000 l
+9.000000 2.250000 l
+0.000000 2.250000 l
+0.000000 0.750000 l
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 12.753906 9.000488 cm
+0.305882 0.498039 0.858824 scn
+0.000000 6.000000 m
+3.000000 3.000000 l
+0.000000 0.000000 l
+0.000000 6.000000 l
+h
+f
+n
+Q
+q
+-1.000000 -0.000000 -0.000000 1.000000 5.248047 3.000000 cm
+0.305882 0.498039 0.858824 scn
+0.000000 6.000000 m
+3.000000 3.000000 l
+0.000000 0.000000 l
+0.000000 6.000000 l
+h
+f
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  788
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 18.000000 18.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000878 00000 n
+0000000900 00000 n
+0000001073 00000 n
+0000001147 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1206
+%%EOF

+ 105 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/AIchange_hover.imageset/Property 1=hover.pdf

@@ -0,0 +1,105 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 5.248047 10.500000 cm
+0.152276 0.234759 0.385445 scn
+0.000000 0.750000 m
+9.000000 0.750000 l
+9.000000 2.250000 l
+0.000000 2.250000 l
+0.000000 0.750000 l
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 3.751953 4.500488 cm
+0.152276 0.234759 0.385445 scn
+0.000000 0.750000 m
+9.000000 0.750000 l
+9.000000 2.250000 l
+0.000000 2.250000 l
+0.000000 0.750000 l
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 12.753906 9.000488 cm
+0.152276 0.234759 0.385445 scn
+0.000000 6.000000 m
+3.000000 3.000000 l
+0.000000 0.000000 l
+0.000000 6.000000 l
+h
+f
+n
+Q
+q
+-1.000000 -0.000000 -0.000000 1.000000 5.248047 3.000000 cm
+0.152276 0.234759 0.385445 scn
+0.000000 6.000000 m
+3.000000 3.000000 l
+0.000000 0.000000 l
+0.000000 6.000000 l
+h
+f
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  788
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 18.000000 18.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000878 00000 n
+0000000900 00000 n
+0000001073 00000 n
+0000001147 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1206
+%%EOF

+ 12 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/aiTextClose.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "aiTextClose.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 79 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/aiTextClose.imageset/aiTextClose.pdf

@@ -0,0 +1,79 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 2.697266 2.696777 cm
+0.460000 0.465714 0.500000 scn
+6.010407 5.303144 m
+10.606602 9.899339 l
+9.899495 10.606445 l
+5.303301 6.010252 l
+0.707107 10.606445 l
+0.000000 9.899339 l
+4.596194 5.303144 l
+0.000000 0.706950 l
+0.707107 -0.000156 l
+5.303301 4.596038 l
+9.899495 -0.000156 l
+10.606602 0.706950 l
+6.010407 5.303144 l
+h
+f
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  393
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 16.000000 16.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000483 00000 n
+0000000505 00000 n
+0000000678 00000 n
+0000000752 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+811
+%%EOF

+ 22 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/aiVLine.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "aiVLine.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "丨.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 150 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/aiVLine.imageset/aiVLine.pdf

@@ -0,0 +1,150 @@
+%PDF-1.7
+
+1 0 obj
+  << /Length 2 0 R >>
+stream
+1.000000 0 0.458000 -0.080000 0.539000 1.377000 d1
+
+endstream
+endobj
+
+2 0 obj
+  51
+endobj
+
+3 0 obj
+  [ 1.000000 ]
+endobj
+
+4 0 obj
+  << /Length 5 0 R >>
+stream
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (FigmaPDF)
+   /Ordering (FigmaPDF)
+   /Supplement 0
+>> def
+/CMapName /A-B-C def
+/CMapType 2 def
+1 begincodespacerange
+<00> <FF>
+endcodespacerange
+1 beginbfchar
+<00> <4E28>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+endstream
+endobj
+
+5 0 obj
+  332
+endobj
+
+6 0 obj
+  << /Subtype /Type3
+     /CharProcs << /C0 1 0 R >>
+     /Encoding << /Type /Encoding
+                  /Differences [ 0 /C0 ]
+               >>
+     /Widths 3 0 R
+     /FontBBox [ 0.000000 0.000000 0.000000 0.000000 ]
+     /FontMatrix [ 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 ]
+     /Type /Font
+     /ToUnicode 4 0 R
+     /FirstChar 0
+     /LastChar 0
+     /Resources << >>
+  >>
+endobj
+
+7 0 obj
+  << /Font << /F1 6 0 R >> >>
+endobj
+
+8 0 obj
+  << /Length 9 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 -5.037109 1.770996 cm
+0.056471 0.065882 0.080000 scn
+0.000000 -0.891113 m
+h
+5.038001 8.337887 m
+5.929000 8.337887 l
+5.929000 -1.771113 l
+5.038001 -1.771113 l
+5.038001 8.337887 l
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 -5.037109 1.770996 cm
+BT
+11.000000 0.000000 0.000000 11.000000 0.000000 -0.891113 Tm
+/F1 1.000000 Tf
+[ (\000) ] TJ
+ET
+Q
+
+endstream
+endobj
+
+9 0 obj
+  412
+endobj
+
+10 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 0.892578 10.108887 ]
+     /Resources 7 0 R
+     /Contents 8 0 R
+     /Parent 11 0 R
+  >>
+endobj
+
+11 0 obj
+  << /Kids [ 10 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+12 0 obj
+  << /Pages 11 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 13
+0000000000 65535 f
+0000000010 00000 n
+0000000117 00000 n
+0000000138 00000 n
+0000000169 00000 n
+0000000557 00000 n
+0000000579 00000 n
+0000000991 00000 n
+0000001037 00000 n
+0000001505 00000 n
+0000001527 00000 n
+0000001701 00000 n
+0000001777 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 12 0 R
+   /Size 13
+>>
+startxref
+1838
+%%EOF

+ 153 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/aiVLine.imageset/丨.pdf

@@ -0,0 +1,153 @@
+%PDF-1.7
+
+1 0 obj
+  << /Length 2 0 R >>
+stream
+1.000000 0 0.458000 -0.080000 0.539000 1.377000 d1
+
+endstream
+endobj
+
+2 0 obj
+  51
+endobj
+
+3 0 obj
+  [ 1.000000 ]
+endobj
+
+4 0 obj
+  << /Length 5 0 R >>
+stream
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (FigmaPDF)
+   /Ordering (FigmaPDF)
+   /Supplement 0
+>> def
+/CMapName /A-B-C def
+/CMapType 2 def
+1 begincodespacerange
+<00> <FF>
+endcodespacerange
+1 beginbfchar
+<00> <4E28>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+endstream
+endobj
+
+5 0 obj
+  332
+endobj
+
+6 0 obj
+  << /Subtype /Type3
+     /CharProcs << /C0 1 0 R >>
+     /Encoding << /Type /Encoding
+                  /Differences [ 0 /C0 ]
+               >>
+     /Widths 3 0 R
+     /FontBBox [ 0.000000 0.000000 0.000000 0.000000 ]
+     /FontMatrix [ 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 ]
+     /Type /Font
+     /ToUnicode 4 0 R
+     /FirstChar 0
+     /LastChar 0
+     /Resources << >>
+  >>
+endobj
+
+7 0 obj
+  << /Font << /F1 6 0 R >>
+     /ExtGState << /E1 << /ca 0.700000 >> >>
+  >>
+endobj
+
+8 0 obj
+  << /Length 9 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+/E1 gs
+1.000000 0.000000 -0.000000 1.000000 -5.037109 1.771484 cm
+1.000000 1.000000 1.000000 scn
+0.000000 -0.891602 m
+h
+5.038001 8.337399 m
+5.929000 8.337399 l
+5.929000 -1.771602 l
+5.038001 -1.771602 l
+5.038001 8.337399 l
+h
+f
+n
+Q
+q
+1.000000 0.000000 -0.000000 1.000000 -5.037109 1.771484 cm
+BT
+11.000000 0.000000 0.000000 11.000000 0.000000 -0.891602 Tm
+/F1 1.000000 Tf
+[ (\000) ] TJ
+ET
+Q
+
+endstream
+endobj
+
+9 0 obj
+  419
+endobj
+
+10 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 0.892578 10.108398 ]
+     /Resources 7 0 R
+     /Contents 8 0 R
+     /Parent 11 0 R
+  >>
+endobj
+
+11 0 obj
+  << /Kids [ 10 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+12 0 obj
+  << /Pages 11 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 13
+0000000000 65535 f
+0000000010 00000 n
+0000000117 00000 n
+0000000138 00000 n
+0000000169 00000 n
+0000000557 00000 n
+0000000579 00000 n
+0000000991 00000 n
+0000001084 00000 n
+0000001559 00000 n
+0000001581 00000 n
+0000001755 00000 n
+0000001831 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 12 0 R
+   /Size 13
+>>
+startxref
+1892
+%%EOF

+ 12 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/creditNoTip.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "creditNoTip.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 90 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/creditNoTip.imageset/creditNoTip.pdf

@@ -0,0 +1,90 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 1.469727 2.332520 cm
+0.980392 0.117647 0.364706 scn
+11.059082 1.310547 m
+11.059082 0.580078 10.554199 0.000000 9.748535 0.000000 c
+1.310547 0.000000 l
+0.504883 0.000000 0.000000 0.580078 0.000000 1.310547 c
+0.000000 1.530762 0.064453 1.745605 0.177246 1.949707 c
+4.398926 9.501465 l
+4.640625 9.936523 5.086426 10.167480 5.532227 10.167480 c
+5.972656 10.167480 6.418457 9.936523 6.660156 9.501465 c
+10.887207 1.955078 l
+11.005371 1.750977 11.059082 1.530762 11.059082 1.310547 c
+h
+5.532227 3.587891 m
+5.252930 3.587891 5.102539 3.749023 5.097168 4.033691 c
+5.021973 6.955566 l
+5.016602 7.240234 5.226074 7.444336 5.526855 7.444336 c
+5.822266 7.444336 6.042480 7.234863 6.037109 6.950195 c
+5.961914 4.033691 l
+5.956543 3.743652 5.800781 3.587891 5.532227 3.587891 c
+h
+5.532227 1.788574 m
+5.215332 1.788574 4.936035 2.046387 4.936035 2.363281 c
+4.936035 2.685547 5.209961 2.943359 5.532227 2.943359 c
+5.859863 2.943359 6.133789 2.690918 6.133789 2.363281 c
+6.133789 2.041016 5.854492 1.788574 5.532227 1.788574 c
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  1086
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 14.000000 15.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000001176 00000 n
+0000001199 00000 n
+0000001372 00000 n
+0000001446 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+1505
+%%EOF

+ 10 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_btn_arrow_down.imageset/Contents.json

@@ -1,6 +1,16 @@
 {
   "images" : [
     {
+      "filename" : "ic-2.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
       "filename" : "ic_btn_arrow_down.pdf",
       "idiom" : "universal"
     }

+ 73 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_btn_arrow_down.imageset/ic-2.pdf

@@ -0,0 +1,73 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Length 3 0 R >>
+stream
+/DeviceRGB CS
+/DeviceRGB cs
+q
+1.000000 0.000000 -0.000000 1.000000 3.074219 3.569824 cm
+0.460000 0.465714 0.500000 scn
+4.384543 3.236816 m
+4.978298 2.686662 l
+2.489149 0.000243 l
+0.000000 2.686662 l
+0.593756 3.236816 l
+2.489149 1.191497 l
+4.384543 3.236816 l
+h
+f*
+n
+Q
+
+endstream
+endobj
+
+3 0 obj
+  268
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 10.792969 10.792480 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000358 00000 n
+0000000380 00000 n
+0000000553 00000 n
+0000000627 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+686
+%%EOF

+ 19 - 18
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_btn_arrow_down.imageset/ic_btn_arrow_down.pdf

@@ -1,7 +1,7 @@
 %PDF-1.7
 
 1 0 obj
-  << >>
+  << /ExtGState << /E1 << /ca 0.850000 >> >> >>
 endobj
 
 2 0 obj
@@ -10,15 +10,16 @@ stream
 /DeviceRGB CS
 /DeviceRGB cs
 q
-1.000000 0.000000 -0.000000 1.000000 4.559570 5.293213 cm
-0.494118 0.498039 0.521569 scn
-6.500000 4.798096 m
-7.380231 3.982502 l
-3.690115 -0.000062 l
-0.000000 3.982502 l
-0.880231 4.798096 l
-3.690115 1.765949 l
-6.500000 4.798096 l
+/E1 gs
+1.000000 0.000000 -0.000000 1.000000 2.316406 2.688477 cm
+1.000000 1.000000 1.000000 scn
+3.301587 2.437012 m
+3.748688 2.022742 l
+1.874344 -0.000148 l
+0.000000 2.022742 l
+0.447101 2.437012 l
+1.874344 0.896874 l
+3.301587 2.437012 l
 h
 f*
 n
@@ -28,13 +29,13 @@ endstream
 endobj
 
 3 0 obj
-  269
+  276
 endobj
 
 4 0 obj
   << /Annots []
      /Type /Page
-     /MediaBox [ 0.000000 0.000000 16.000000 16.000000 ]
+     /MediaBox [ 0.000000 0.000000 8.126953 8.126953 ]
      /Resources 1 0 R
      /Contents 2 0 R
      /Parent 5 0 R
@@ -58,16 +59,16 @@ xref
 0 7
 0000000000 65535 f
 0000000010 00000 n
-0000000034 00000 n
-0000000359 00000 n
-0000000381 00000 n
-0000000554 00000 n
-0000000628 00000 n
+0000000074 00000 n
+0000000406 00000 n
+0000000428 00000 n
+0000000599 00000 n
+0000000673 00000 n
 trailer
 << /ID [ (some) (id) ]
    /Root 6 0 R
    /Size 7
 >>
 startxref
-687
+732
 %%EOF

+ 14 - 41
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_else_alert.imageset/ic_else_alert.pdf

@@ -5,47 +5,20 @@
 endobj
 
 2 0 obj
-  << /Length 3 0 R >>
+  << /Filter /FlateDecode
+     /Length 3 0 R
+  >>
 stream
-/DeviceRGB CS
-/DeviceRGB cs
-q
-1.000000 0.000000 -0.000000 1.000000 1.469727 2.332520 cm
-0.056471 0.065882 0.080000 scn
-11.059082 1.310547 m
-11.059082 0.580078 10.554199 0.000000 9.748535 0.000000 c
-1.310547 0.000000 l
-0.504883 0.000000 0.000000 0.580078 0.000000 1.310547 c
-0.000000 1.530762 0.064453 1.745605 0.177246 1.949707 c
-4.398926 9.501465 l
-4.640625 9.936523 5.086426 10.167480 5.532227 10.167480 c
-5.972656 10.167480 6.418457 9.936523 6.660156 9.501465 c
-10.887207 1.955078 l
-11.005371 1.750977 11.059082 1.530762 11.059082 1.310547 c
-h
-5.532227 3.587891 m
-5.252930 3.587891 5.102539 3.749023 5.097168 4.033691 c
-5.021973 6.955566 l
-5.016602 7.240234 5.226074 7.444336 5.526855 7.444336 c
-5.822266 7.444336 6.042480 7.234863 6.037109 6.950195 c
-5.961914 4.033691 l
-5.956543 3.743652 5.800781 3.587891 5.532227 3.587891 c
-h
-5.532227 1.788574 m
-5.215332 1.788574 4.936035 2.046387 4.936035 2.363281 c
-4.936035 2.685547 5.209961 2.943359 5.532227 2.943359 c
-5.859863 2.943359 6.133789 2.690918 6.133789 2.363281 c
-6.133789 2.041016 5.854492 1.788574 5.532227 1.788574 c
-h
-f*
-n
-Q
-
+x]“ËnÔ@D÷þ
+¯‘èÜ÷cH¬�O°‚@J"¡H|?ÕÃÐ6ñªçø>ªª=Ÿÿ<¿~þ°ü¶=œ¿Ž×í×ƃnÏNÿï×i½ãaQé´ËPÚ�ç
e–<;ëd
+å´¿/£Û›€y(“[îÏHÃQ›µ3NnÜ
„^<{�´rõ“Ðy²Ø8Y•žìr¸�_d
8Ѐ̕2¦
+3W�4š«9S,@Ú:iöÙЮ–€@'¶ph°F!Ö.º;RCœqÀ	¹ŠH^бùè”ðk]ã2ÏsXŒb­•ˆ‚FU
+$A›ûtùtK–\q°àÔ‰·@Ã^>¯hÅñRîú±e5ãª|à¢[éd>˜ÄµAÒš V;9j·Aª�ši‹„;§tˆóˆcø�=‡
�"Ai f†^—(÷“ÌYY±X2™Qa’ZÅ\CpM�C#¢ž	!Úàf;uM
íá¦7õ3\l¼}"²¾Íá¿t�l•Cô-vüNfóÊ­@bhå•h¨`Ñü„›f‘?&QC.Hâ7È}ß"ÓQyO»‹Å`Uh‰¦æº’µïÂÈ·€éåf}Q¾ö-2]·½l_¶?ÇÕf
 endstream
 endobj
 
 3 0 obj
-  1086
+  473
 endobj
 
 4 0 obj
@@ -76,15 +49,15 @@ xref
 0000000000 65535 f
 0000000010 00000 n
 0000000034 00000 n
-0000001176 00000 n
-0000001199 00000 n
-0000001372 00000 n
-0000001446 00000 n
+0000000591 00000 n
+0000000613 00000 n
+0000000786 00000 n
+0000000860 00000 n
 trailer
 << /ID [ (some) (id) ]
    /Root 6 0 R
    /Size 7
 >>
 startxref
-1505
+919
 %%EOF

+ 1 - 1
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_else_info_large.imageset/Contents.json

@@ -11,7 +11,7 @@
           "value" : "dark"
         }
       ],
-      "filename" : "ic_else_info_large 1.pdf",
+      "filename" : "large.pdf",
       "idiom" : "universal"
     }
   ],

+ 0 - 93
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_else_info_large.imageset/ic_else_info_large 1.pdf

@@ -1,93 +0,0 @@
-%PDF-1.7
-
-1 0 obj
-  << >>
-endobj
-
-2 0 obj
-  << /Length 3 0 R >>
-stream
-/DeviceRGB CS
-/DeviceRGB cs
-q
-1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
-1.000000 1.000000 1.000000 scn
-14.000000 7.000000 m
-14.000000 3.177451 10.829412 0.000000 7.000000 0.000000 c
-3.177451 0.000000 0.000000 3.177451 0.000000 7.000000 c
-0.000000 10.829412 3.170588 14.000000 6.993137 14.000000 c
-10.822549 14.000000 14.000000 10.829412 14.000000 7.000000 c
-h
-6.947363 9.249903 m
-6.471289 9.249903 6.090430 9.630762 6.090430 10.113184 c
-6.090430 10.595606 6.471289 10.976465 6.947363 10.976465 c
-7.423438 10.976465 7.797949 10.595606 7.797949 10.113184 c
-7.797949 9.630762 7.423438 9.249903 6.947363 9.249903 c
-h
-8.521582 3.321192 m
-5.861914 3.321192 l
-5.588965 3.321192 5.379492 3.517969 5.379492 3.790918 c
-5.379492 4.044825 5.588965 4.254297 5.861914 4.254297 c
-6.668067 4.254297 l
-6.668067 7.237695 l
-5.969824 7.237695 l
-5.703223 7.237695 5.493750 7.434473 5.493750 7.707422 c
-5.493750 7.961328 5.703223 8.170801 5.969824 8.170801 c
-7.201270 8.170801 l
-7.537695 8.170801 7.715430 7.929590 7.715430 7.574121 c
-7.715430 4.254297 l
-8.521582 4.254297 l
-8.794531 4.254297 9.004004 4.044825 9.004004 3.790918 c
-9.004004 3.517969 8.794531 3.321192 8.521582 3.321192 c
-h
-f*
-n
-Q
-
-endstream
-endobj
-
-3 0 obj
-  1190
-endobj
-
-4 0 obj
-  << /Annots []
-     /Type /Page
-     /MediaBox [ 0.000000 0.000000 14.000000 14.000000 ]
-     /Resources 1 0 R
-     /Contents 2 0 R
-     /Parent 5 0 R
-  >>
-endobj
-
-5 0 obj
-  << /Kids [ 4 0 R ]
-     /Count 1
-     /Type /Pages
-  >>
-endobj
-
-6 0 obj
-  << /Pages 5 0 R
-     /Type /Catalog
-  >>
-endobj
-
-xref
-0 7
-0000000000 65535 f
-0000000010 00000 n
-0000000034 00000 n
-0000001280 00000 n
-0000001303 00000 n
-0000001476 00000 n
-0000001550 00000 n
-trailer
-<< /ID [ (some) (id) ]
-   /Root 6 0 R
-   /Size 7
->>
-startxref
-1609
-%%EOF

+ 11 - 44
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_else_info_large.imageset/ic_else_info_large.pdf

@@ -5,50 +5,17 @@
 endobj
 
 2 0 obj
-  << /Length 3 0 R >>
+  << /Filter /FlateDecode
+     /Length 3 0 R
+  >>
 stream
-/DeviceRGB CS
-/DeviceRGB cs
-q
-1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
-0.258000 0.273273 0.300000 scn
-14.000000 7.000000 m
-14.000000 3.177451 10.829412 0.000000 7.000000 0.000000 c
-3.177451 0.000000 0.000000 3.177451 0.000000 7.000000 c
-0.000000 10.829412 3.170588 14.000000 6.993137 14.000000 c
-10.822549 14.000000 14.000000 10.829412 14.000000 7.000000 c
-h
-6.947363 9.249903 m
-6.471289 9.249903 6.090430 9.630762 6.090430 10.113184 c
-6.090430 10.595606 6.471289 10.976465 6.947363 10.976465 c
-7.423438 10.976465 7.797949 10.595606 7.797949 10.113184 c
-7.797949 9.630762 7.423438 9.249903 6.947363 9.249903 c
-h
-8.521582 3.321192 m
-5.861914 3.321192 l
-5.588965 3.321192 5.379492 3.517969 5.379492 3.790918 c
-5.379492 4.044825 5.588965 4.254297 5.861914 4.254297 c
-6.668067 4.254297 l
-6.668067 7.237695 l
-5.969824 7.237695 l
-5.703223 7.237695 5.493750 7.434473 5.493750 7.707422 c
-5.493750 7.961328 5.703223 8.170801 5.969824 8.170801 c
-7.201270 8.170801 l
-7.537695 8.170801 7.715430 7.929590 7.715430 7.574121 c
-7.715430 4.254297 l
-8.521582 4.254297 l
-8.794531 4.254297 9.004004 4.044825 9.004004 3.790918 c
-9.004004 3.517969 8.794531 3.321192 8.521582 3.321192 c
-h
-f*
-n
-Q
-
+xe“Áj\1E÷þŠ·.Ô±dɲ¶m¡ë¶ŸðHI`�|®'Ù!f`4Çò½–ä¹ûuÿöxÞÿýýãøù/Ý­_çkzI”Ëuå|�èë^çS*¹«t°koÊ#0l–ãõ|N$·\»O¬™ÌDé œbDZ�µ9Sä‹àëVœ¸%¾±6Ÿ‘_´÷cݦe÷JÕ6t¦ë	Vñ�nÑؽê-¶ù>$hŠÕVÏ,þ–ň»/Örñ"µ€´Z¬ñ"p ªÔr;T×Vò¦�[“¦@Ór¡3Y®RQn@Ëæ棰PÛQ¸ŒË…ØVÀô2ŠïY™´�fW&rFñš{#'Yì†A8®Ls–㤒yó�˜§‡`è½HgEÖT’Œ™±Èô2úØZ/Í»,f™«5W0Ípî,Ÿ™•Ê\Ó,^MÇà¥
+Ú°+&Ìðܘ7ªÜ‘5•úxŠ½Èô2ºÏ…°`0ý°#Òñ2 Î®>‚ jx Z“muÇŒ>1´U+-æxÓ‚Èìt�m›S¥˜lø/åÿ·ôœþ¤wX|é'
 endstream
 endobj
 
 3 0 obj
-  1190
+  429
 endobj
 
 4 0 obj
@@ -79,15 +46,15 @@ xref
 0000000000 65535 f
 0000000010 00000 n
 0000000034 00000 n
-0000001280 00000 n
-0000001303 00000 n
-0000001476 00000 n
-0000001550 00000 n
+0000000547 00000 n
+0000000569 00000 n
+0000000742 00000 n
+0000000816 00000 n
 trailer
 << /ID [ (some) (id) ]
    /Root 6 0 R
    /Size 7
 >>
 startxref
-1609
+875
 %%EOF

+ 60 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_else_info_large.imageset/large.pdf

@@ -0,0 +1,60 @@
+%PDF-1.7
+
+1 0 obj
+  << >>
+endobj
+
+2 0 obj
+  << /Filter /FlateDecode
+     /Length 3 0 R
+  >>
+stream
+xe’Ëj\1†÷~ŠYêX7ËÚ¶…®Û>Â!¥…I úüù=9#;ÄŒÎ'Y¿uyøöøÿïñøóû—Ë×_åa}/å_¡ÚnçÒîÆç´>úÒ8žJ«>TH}ƒ1àƒ÷åx.¤÷X¿O”Jîjt!ÜâPb\‡g]Hr”ŒO–ÆGW&8ðJüãl:3¾Ù—õš^#„Ä7t”Û
6��nÖôÞò-¶éþ)È©.].QY#š þ^Õ‰G,Ök‹¦Ò@º4(„†"Ý-¬·Ž¸3Px×n@§äBGñª,*(7¡W�YXfÛQª&ÌÇe²­€S3É,~Tc²1›-LŒâ­ŽN�…Ivà OJfU¦ä¼iäÑc'-h@!z¯:ØufÒŠ™q8È©—dö±÷Ѻ/v]Ì+‹÷00«P¬ï™7a–ŬjˆÛ¼Š¢
;ñæÊÍ�E'á�¨3Ó˜«8�œzIf÷¹{[ì
+foÒÉ D67Ù9,¦‘Äú–ëd[Ý9£wm5¡Å;­ø�œ�N²ÍccçÔ2SN6õ’ÌMùý©<—å!@é
+endstream
+endobj
+
+3 0 obj
+  428
+endobj
+
+4 0 obj
+  << /Annots []
+     /Type /Page
+     /MediaBox [ 0.000000 0.000000 14.000000 14.000000 ]
+     /Resources 1 0 R
+     /Contents 2 0 R
+     /Parent 5 0 R
+  >>
+endobj
+
+5 0 obj
+  << /Kids [ 4 0 R ]
+     /Count 1
+     /Type /Pages
+  >>
+endobj
+
+6 0 obj
+  << /Pages 5 0 R
+     /Type /Catalog
+  >>
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000010 00000 n
+0000000034 00000 n
+0000000546 00000 n
+0000000568 00000 n
+0000000741 00000 n
+0000000815 00000 n
+trailer
+<< /ID [ (some) (id) ]
+   /Root 6 0 R
+   /Size 7
+>>
+startxref
+874
+%%EOF

+ 12 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_propertybar_file_pdf.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "ic_propertybar_file_pdf.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/ic_propertybar_file_pdf.imageset/ic_propertybar_file_pdf.pdf


+ 0 - 10
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/robot-gray.imageset/Contents.json

@@ -3,16 +3,6 @@
     {
       "filename" : "robot-gray.pdf",
       "idiom" : "universal"
-    },
-    {
-      "appearances" : [
-        {
-          "appearance" : "luminosity",
-          "value" : "dark"
-        }
-      ],
-      "filename" : "robot-gray 1.pdf",
-      "idiom" : "universal"
     }
   ],
   "info" : {

+ 0 - 187
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/robot-gray.imageset/robot-gray 1.pdf

@@ -1,187 +0,0 @@
-%PDF-1.7
-
-1 0 obj
-  << /ExtGState << /E2 << /ca 0.050000 >>
-                   /E1 << /ca 0.044000 >>
-                >> >>
-endobj
-
-2 0 obj
-  << /Length 3 0 R >>
-stream
-/DeviceRGB CS
-/DeviceRGB cs
-q
-/E1 gs
-1.000000 0.000000 -0.000000 1.000000 10.000000 11.838257 cm
-1.000000 1.000000 1.000000 scn
-3.198828 46.569649 m
-3.398271 45.670017 4.002666 44.785404 5.197785 43.077850 c
-2.874804 40.150791 1.221158 36.664711 0.461154 32.843914 c
-0.000000 30.525539 0.000000 27.737608 0.000000 22.161743 c
-0.000000 15.018887 l
-0.000000 10.116192 0.000000 7.664841 0.874325 5.758919 c
-1.832560 3.670082 3.508339 1.994305 5.597176 1.036068 c
-7.503099 0.161743 9.954447 0.161743 14.857141 0.161743 c
-45.142857 0.161743 l
-50.045551 0.161743 52.496899 0.161743 54.402824 1.036068 c
-56.491661 1.994305 58.167439 3.670082 59.125675 5.758919 c
-60.000000 7.664841 60.000000 10.116192 60.000000 15.018887 c
-60.000000 22.161743 l
-60.000000 27.737608 60.000000 30.525539 59.538845 32.843914 c
-58.808010 36.518066 57.250816 39.882702 55.066719 42.738365 c
-55.172497 42.889431 l
-56.455311 44.721478 57.096718 45.637501 57.303371 46.569649 c
-57.578907 47.812511 57.349430 49.113926 56.665428 50.187599 c
-56.152424 50.992851 55.236401 51.634258 53.404350 52.917072 c
-51.572304 54.199886 50.656277 54.841293 49.724133 55.047947 c
-48.481266 55.323483 47.179852 55.094009 46.106182 54.410004 c
-45.300930 53.897003 44.659523 52.980976 43.376709 51.148930 c
-43.291897 51.027805 l
-42.441990 51.298557 41.571140 51.523762 40.682171 51.700588 c
-38.363796 52.161743 35.575863 52.161743 30.000000 52.161743 c
-24.424135 52.161743 21.636204 52.161743 19.317829 51.700588 c
-18.572269 51.552288 17.839453 51.369957 17.121048 51.155270 c
-15.841194 52.983093 15.200339 53.897594 14.396017 54.410004 c
-13.322346 55.094009 12.020930 55.323483 10.778066 55.047947 c
-9.845922 54.841293 8.929899 54.199890 7.097856 52.917080 c
-7.097850 52.917076 l
-7.097846 52.917072 l
-7.097842 52.917068 l
-5.265795 51.634254 4.349771 50.992851 3.836770 50.187599 c
-3.152766 49.113926 2.923291 47.812511 3.198828 46.569649 c
-h
-10.441752 38.500935 m
-9.308377 36.186359 9.212001 33.198677 9.019247 27.223322 c
-8.814944 20.889919 8.712792 17.723217 9.781059 15.255836 c
-10.940097 12.578804 13.034607 10.415642 15.672879 9.170895 c
-18.104532 8.023632 21.272886 8.023632 27.609594 8.023632 c
-32.390228 8.023632 l
-38.726925 8.023632 41.895275 8.023632 44.326927 9.170895 c
-46.965199 10.415642 49.059708 12.578804 50.218746 15.255836 c
-51.287014 17.723217 51.184864 20.889915 50.980560 27.223320 c
-50.787807 33.198677 50.691429 36.186359 49.558052 38.500935 c
-48.327835 41.013283 46.258549 43.016895 43.707844 44.165474 c
-41.357929 45.223633 38.368698 45.223633 32.390232 45.223633 c
-27.609583 45.223633 l
-21.631111 45.223633 18.641876 45.223633 16.291962 44.165474 c
-13.741258 43.016895 11.671969 41.013283 10.441752 38.500935 c
-h
-20.680481 27.506844 m
-20.803808 27.728050 20.953878 27.936029 21.129255 28.125437 c
-21.440115 28.461969 21.813635 28.721777 22.220806 28.897083 c
-22.626783 29.072870 23.053598 29.158836 23.476444 29.161629 c
-23.927456 29.165426 24.384068 29.074736 24.816111 28.881475 c
-25.194584 28.713125 25.542959 28.471243 25.837591 28.162169 c
-26.028542 27.962339 26.190685 27.740896 26.322279 27.504370 c
-30.568050 20.150551 l
-31.460047 18.605579 30.930702 16.630039 29.385725 15.738052 c
-27.840746 14.846069 25.865187 15.375420 24.973188 16.920387 c
-23.500666 19.470848 l
-22.028168 16.920433 l
-21.136169 15.375462 19.160610 14.846111 17.615633 15.738098 c
-16.070654 16.630081 15.541309 18.605625 16.433308 20.150597 c
-20.680481 27.506844 l
-h
-38.230194 29.160278 m
-36.446209 29.160278 35.000000 27.714071 35.000000 25.930084 c
-35.000000 18.393101 l
-35.000000 16.609112 36.446209 15.162907 38.230194 15.162907 c
-40.014183 15.162907 41.460388 16.609112 41.460388 18.393101 c
-41.460388 25.930084 l
-41.460388 27.714071 40.014183 29.160278 38.230194 29.160278 c
-h
-f*
-n
-Q
-q
-/E2 gs
-1.000000 0.000000 -0.000000 1.000000 0.000000 -0.008881 cm
-1.000000 1.000000 1.000000 scn
-70.694763 78.982315 m
-71.026665 80.351067 72.973335 80.351067 73.305244 78.982315 c
-74.218491 75.216110 l
-74.336990 74.727425 74.718544 74.345871 75.207230 74.227371 c
-78.973434 73.314117 l
-80.342186 72.982216 80.342194 71.035545 78.973442 70.703644 c
-75.207230 69.790390 l
-74.718544 69.671890 74.336990 69.290337 74.218491 68.801651 c
-73.305244 65.035446 l
-72.973335 63.666695 71.026665 63.666691 70.694763 65.035439 c
-69.781509 68.801651 l
-69.663010 69.290337 69.281456 69.671890 68.792770 69.790390 c
-65.026566 70.703644 l
-63.657814 71.035545 63.657814 72.982216 65.026558 73.314117 c
-68.792770 74.227371 l
-69.281456 74.345871 69.663010 74.727425 69.781509 75.216110 c
-70.694763 78.982315 l
-h
-0.000000 13.675545 m
-0.000000 11.834595 1.492385 10.342216 3.333334 10.342216 c
-5.174283 10.342216 6.666667 11.834595 6.666667 13.675545 c
-6.666667 15.516495 5.174283 17.008881 3.333334 17.008881 c
-1.492385 17.008881 0.000000 15.516495 0.000000 13.675545 c
-h
-13.333334 3.675545 m
-13.333334 1.834595 14.825719 0.342209 16.666668 0.342209 c
-18.507618 0.342209 20.000002 1.834595 20.000002 3.675545 c
-20.000002 5.516495 18.507618 7.008881 16.666668 7.008881 c
-14.825719 7.008881 13.333334 5.516495 13.333334 3.675545 c
-h
-76.666664 55.342213 m
-74.825714 55.342213 73.333336 56.834599 73.333336 58.675545 c
-73.333336 60.516495 74.825714 62.008881 76.666664 62.008881 c
-78.507614 62.008881 80.000000 60.516495 80.000000 58.675545 c
-80.000000 56.834599 78.507614 55.342213 76.666664 55.342213 c
-h
-f*
-n
-Q
-
-endstream
-endobj
-
-3 0 obj
-  5338
-endobj
-
-4 0 obj
-  << /Annots []
-     /Type /Page
-     /MediaBox [ 0.000000 0.000000 80.000000 80.000000 ]
-     /Resources 1 0 R
-     /Contents 2 0 R
-     /Parent 5 0 R
-  >>
-endobj
-
-5 0 obj
-  << /Kids [ 4 0 R ]
-     /Count 1
-     /Type /Pages
-  >>
-endobj
-
-6 0 obj
-  << /Pages 5 0 R
-     /Type /Catalog
-  >>
-endobj
-
-xref
-0 7
-0000000000 65535 f
-0000000010 00000 n
-0000000132 00000 n
-0000005526 00000 n
-0000005549 00000 n
-0000005722 00000 n
-0000005796 00000 n
-trailer
-<< /ID [ (some) (id) ]
-   /Root 6 0 R
-   /Size 7
->>
-startxref
-5855
-%%EOF

+ 22 - 0
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/toolbar_AITools.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "filename" : "ai.pdf",
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "filename" : "ai 1.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/toolbar_AITools.imageset/ai 1.pdf


二進制
PDF Office/PDF Master/Class/AIInfo/AIImage.xcassets/toolbar_AITools.imageset/ai.pdf


+ 24 - 0
PDF Office/PDF Master/Class/AIInfo/AIInfoConfig.swift

@@ -15,6 +15,30 @@ import Foundation
     case translate = 4
 }
 
+//AI对话框类型
+@objc public enum AIChatInfoType: NSInteger {
+    case none = 0
+    case defaultTip = 1 //预算提示内容
+    case chatFileUpload = 2 //上传文件类型
+    case chatStringUpload = 3 //上传文字类型
+    case chatStringResult = 4 //返回文字类型
+    case chatFileResult = 5 //返回文件类型
+    case chatTranslateResult = 6
+    
+    
+}
+
+@objc public enum AIChatInfoState: NSInteger {
+    case stateNone = 0
+    case stateLoading = 1 //预加载Loading
+    case stateFailed  = 2 //返回错误
+    case stateSuccess = 3 //返回成功
+    case stateCancel = 4 //翻译取消状态
+    case stateInfoConfirm = 5 //翻译二次确认状态
+    
+    
+}
+
 class AIInfoConfig: NSObject {
     var aiActionURL: String {
         get {

+ 2 - 1
PDF Office/PDF Master/Class/AIInfo/AIUserInfoController/AIUserInfoController.swift

@@ -187,7 +187,8 @@ import Cocoa
         self.emptyShowAIBtn.title = NSLocalizedString("Show AI robot icon", comment: "")
         self.emptyShowAIBtn.setTitleColor(KMAppearance.KMColor_Layout_H0())
         self.emptyShowAIBtn.state = AIInfoManager.default().showAIIcon ? .on : .off
-        
+        self.emptyShowAIBtn.isHidden = true
+
     }
     
     func updateCreditsViewUI() -> Void {

+ 14 - 12
PDF Office/PDF Master/Class/AIInfo/KMAIRequestServerManager.swift

@@ -59,6 +59,7 @@ class ResultWrapper: NSObject {
     static let defaultManager = KMAIRequestServerManager()
     typealias KMRequestServerComplete = (_ wrapper: ResultWrapper) -> Void
     private var downFileUrl: String = "" // 文件翻译
+    var downFileName: String = "" // 文件翻译
     
     var fromLanguages: [String] = ["Automatic", "English", "Simplified Chinese", "Traditional Chinese", "Japanese", "Korean", "French", "Spanish", "Italian", "German", "Portuguese", "Russian", "Vietnamese", "Thai", "Arabic", "Greek", "Bulgarian", "Finnish", "Slovene", "Dutch", "Czech", "Swedish", "Polish", "Danish", "Romanian", "Hungarian"]
     var toLanguages: [String] = ["English", "Simplified Chinese", "Traditional Chinese", "Japanese", "Korean", "French", "Spanish", "Italian", "German", "Portuguese", "Russian", "Vietnamese", "Thai", "Arabic", "Greek", "Bulgarian", "Finnish", "Slovene", "Dutch", "Czech", "Swedish", "Polish", "Danish", "Romanian", "Hungarian"]
@@ -109,7 +110,7 @@ class ResultWrapper: NSObject {
         return bundleID;
     }
     
-    private func downloadFile(filePath: String, downFileName: String) -> Void {
+    func downloadFile(filePath: String, downFileName: String, toPath: String, complete: @escaping KMRequestServerComplete) {
         self.downFileUrl = ""
         guard let fileURL = URL(string: filePath) else {
             let alert = NSAlert()
@@ -119,7 +120,10 @@ class ResultWrapper: NSObject {
 
             return
         }
-        let destinationURL = FileManager.default.temporaryDirectory.appendingPathComponent(downFileName)
+        var destinationURL = FileManager.default.temporaryDirectory.appendingPathComponent(downFileName)
+        if URL(fileURLWithPath: toPath) != nil {
+            destinationURL = URL(fileURLWithPath: toPath)
+        }
         if FileManager.default.fileExists(atPath: destinationURL.path) {
             do {
                 try FileManager.default.removeItem(at: destinationURL)
@@ -152,6 +156,10 @@ class ResultWrapper: NSObject {
 
             do {
                 try FileManager.default.moveItem(at: tempLocalURL, to: destinationURL)
+                
+                let wrapper = ResultWrapper(success: true, content: "")
+                wrapper.content = destinationURL.path
+                complete(wrapper)
             } catch {
                 let alert = NSAlert()
                 alert.alertStyle = .critical
@@ -294,7 +302,6 @@ class ResultWrapper: NSObject {
         
         let infoDictionary = Bundle .main.infoDictionary!
         let urlString = AIInfoConfig().aiActionURL + "/api/AI/fileTranslate"
-        var semaphore = DispatchSemaphore (value: 0)
 
         let paraDict = ["fileKey": fileKey,
                         "from": languageAbbreviation(from),
@@ -315,7 +322,6 @@ class ResultWrapper: NSObject {
         let task = URLSession.shared.dataTask(with: request) { data, response, error in
            guard let data = data else {
                print(String(describing: error))
-               semaphore.signal()
                return
            }
             let jsonObject = try? JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary ?? [:]
@@ -340,8 +346,10 @@ class ResultWrapper: NSObject {
                     let downFileName = data1["downFileName"]
                     let fromStr = data1["from"]
                     let toStr = data1["to"]
-                    self.downloadFile(filePath: ossDownUrl as! String, downFileName: downFileName as! String)
-                    complete(ResultWrapper(success: true, content: self.downFileUrl))
+                    
+                    self.downFileName = downFileName as! String
+//                    self.downloadFile(filePath: ossDownUrl as! String, downFileName: downFileName as! String)
+                    complete(ResultWrapper(success: true, content: ossDownUrl as! String))
                 } else {
                     complete(ResultWrapper(success: false, content: message))
                 }
@@ -351,10 +359,8 @@ class ResultWrapper: NSObject {
 //                complete(result)
                 complete(ResultWrapper(success: false, content: "unknown error"))
             }
-           semaphore.signal()
         }
         task.resume()
-        semaphore.wait()
     }
 
     /**
@@ -367,7 +373,6 @@ class ResultWrapper: NSObject {
         
         let infoDictionary = Bundle .main.infoDictionary!
         let urlString = AIInfoConfig().aiActionURL + "/api/AI/textTranslate"
-        var semaphore = DispatchSemaphore (value: 0)
         
         var escapedString = q
         escapedString = String(data: escapedString.data(using: .utf8)!, encoding: .utf8)!
@@ -389,7 +394,6 @@ class ResultWrapper: NSObject {
         let task = URLSession.shared.dataTask(with: request) { data, response, error in
            guard let data = data else {
                print(String(describing: error))
-               semaphore.signal()
                return
            }
             let jsonObject = try? JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary ?? [:]
@@ -407,10 +411,8 @@ class ResultWrapper: NSObject {
             } else {
                 complete(ResultWrapper(success: false, content: "unknown error"))
             }
-           semaphore.signal()
         }
         task.resume()
-        semaphore.wait()
     }
     
     /**

二進制
PDF Office/PDF Master/Class/Appearance/Image.xcassets/Other/UXNewImage/ic_Home/AIChatRobotHome.imageset/AIChatRobotHome.pdf


+ 12 - 0
PDF Office/PDF Master/Class/Appearance/Image.xcassets/Other/UXNewImage/ic_Home/AIChatRobotHome.imageset/Contents.json

@@ -0,0 +1,12 @@
+{
+  "images" : [
+    {
+      "filename" : "AIChatRobotHome.pdf",
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 1 - 1
PDF Office/PDF Master/Class/ChromiumTabs/Screen/KMScreenShotMaskViewController.swift

@@ -42,7 +42,7 @@ class KMScreenShotMaskViewController: NSViewController{
     func handlerCallBack() {
         self.screenShotMaskView.callBack = self.callBack
         
-        self.screenShotMaskView.frameCallBack = { rect in
+        self.screenShotMaskView.frameCallBack = {[unowned self] rect in
             if self.editViewController.view.isHidden {
                 self.editViewController.view.isHidden = false
             }

+ 1 - 1
PDF Office/PDF Master/Class/DigtalSignature/CPDFDigtalView/KMPDFDigitalSignViewController.swift

@@ -277,7 +277,7 @@ class KMPDFDigitalSignViewController: NSViewController, CPDFViewDelegate, CPDFDi
         configWindowVC.viewType = .fileList;
         configWindowVC.appearanceWidget = widget;
         configWindowVC.isCreatDS = false
-        configWindowVC.complentionHandle = {isSign, dic, config, isLock in
+        configWindowVC.complentionHandle = {[unowned self] isSign, dic, config, isLock in
             widget.page.removeAnnotation(widget)
             if isSign {
                 if (dic.object(forKey: SAVEFILEPATH_KEY) != nil) {

+ 1 - 1
PDF Office/PDF Master/Class/GuideInfo/Controllers/KMFunctionGuideMultiController.swift

@@ -119,7 +119,7 @@ class KMFunctionGuideMultiController: NSViewController {
             let nameItem: KMFunctionGuideNameItemView = KMFunctionGuideNameItemView.createFromNib()!
             nameItem.frame = CGRectMake(0, viewHeight - offsetY - itemHeight, CGRectGetWidth(self.typeNameView.frame), itemHeight)
             nameItem.infoDict = dict as! NSDictionary
-            nameItem.clickHandle = { view in
+            nameItem.clickHandle = {[unowned self] view in
                 self.currentNameKEY = view.infoDict["key"] as! String
                 self.reloadNameViewInfo()
                 self.reloadDescriptionInfo()

+ 1 - 1
PDF Office/PDF Master/Class/GuideInfo/KMFunctionGuideWindowController.swift

@@ -91,7 +91,7 @@ class KMFunctionGuideWindowController: NSWindowController {
                 self.singleController = KMFunctionGuideSingleController.init()
             } else if _type == .functionMulti {
                 self.multiController = KMFunctionGuideMultiController.init()
-                self.multiController.clickHandle = { controller in
+                self.multiController.clickHandle = {[unowned self] controller in
 #if VERSION_DMG
                     var url = URL(string:kAIStoreServerLink)!
                     NSWorkspace.shared.open(url)

+ 7 - 7
PDF Office/PDF Master/Class/GuideInfo/KMGuideInfoWindowController.swift

@@ -199,7 +199,7 @@ class KMGuideInfoWindowController: NSWindowController {
                 }
                 self.openFileGuidePanel.frame = self.coverView.bounds
                 self.openFileGuidePanel.autoresizingMask = [.width, .height]
-                self.openFileGuidePanel.clickHandle = { view, actionType in
+                self.openFileGuidePanel.clickHandle = {[unowned self] view, actionType in
                     if actionType == .skip {
                         //Skip->数字签名
                         //Skip->
@@ -244,7 +244,7 @@ class KMGuideInfoWindowController: NSWindowController {
                 }
                 self.openFileGuideProperty.frame = self.coverView.bounds
                 self.openFileGuideProperty.autoresizingMask = [.width, .height]
-                self.openFileGuideProperty.clickHandle = { view, actionType in
+                self.openFileGuideProperty.clickHandle = {[unowned self] view, actionType in
                     if actionType == .skip {
                         //Skip->数字签名
                         //Skip->
@@ -297,7 +297,7 @@ class KMGuideInfoWindowController: NSWindowController {
                 }
                 self.openFileGuideToolbar.frame = self.coverView.bounds
                 self.openFileGuideToolbar.autoresizingMask = [.width, .height]
-                self.openFileGuideToolbar.clickHandle = { view, actionType in
+                self.openFileGuideToolbar.clickHandle = {[unowned self] view, actionType in
                     if actionType == .skip {
                         //Skip->数字签名
                         //Skip->
@@ -360,7 +360,7 @@ class KMGuideInfoWindowController: NSWindowController {
                 self.openFileFunctionView.frame = self.coverView.bounds
                 self.openFileFunctionView.autoresizingMask = [.width, .height]
                 self.openFileFunctionView.type =  self.type
-                self.openFileFunctionView.clickHandle = { view, actionType in
+                self.openFileFunctionView.clickHandle = {[unowned self] view, actionType in
                     if self.type == .digitalSignGuide {
                         guard let callBack = self.finishHandle else {
                             return
@@ -383,7 +383,7 @@ class KMGuideInfoWindowController: NSWindowController {
                 }
                 self.convertGuideView.frame = self.coverView.bounds
                 self.convertGuideView.autoresizingMask = [.width, .height]
-                self.convertGuideView.clickHandle = { view, actionType in
+                self.convertGuideView.clickHandle = {[unowned self] view, actionType in
                     if actionType == .skip {
                         self.closeAction()
                     } else if actionType == .purchase {
@@ -404,7 +404,7 @@ class KMGuideInfoWindowController: NSWindowController {
                 }
                 self.customColorGuideView.frame = self.coverView.bounds
                 self.customColorGuideView.autoresizingMask = [.width, .height]
-                self.customColorGuideView.clickHandle = { view, actionType in
+                self.customColorGuideView.clickHandle = {[unowned self] view, actionType in
                     if actionType == .getIt {
                         self.closeAction()
                     }
@@ -419,7 +419,7 @@ class KMGuideInfoWindowController: NSWindowController {
                 }
                 self.aiIconGuideView.frame = self.coverView.bounds
                 self.aiIconGuideView.autoresizingMask = [.width, .height]
-                self.aiIconGuideView.clickHandle = { view, actionType in
+                self.aiIconGuideView.clickHandle = {[unowned self] view, actionType in
                     if actionType == .getIt {
                         self.closeAction()
                     }

+ 6 - 0
PDF Office/PDF Master/Class/Home/View/HomeContentView/QucikTools/KMQucikToolsView.swift

@@ -74,6 +74,12 @@ class KMQucikToolsView: KMBaseXibView {
                     isNew = isNewValue
                 }
                 model.isNew = !isNew
+            } else if model.type == .AITools {
+                var isNew = false
+                if let isNewValue = UserDefaults.standard.object(forKey: "QucikToolsModelAIToolsKey") as? Bool {
+                    isNew = isNewValue
+                }
+                model.isNew = !isNew
             }
             self.data.append(model)
         }

+ 5 - 1
PDF Office/PDF Master/Class/Home/View/HomeContentView/QucikTools/Model/KMQucikToolsModel.swift

@@ -16,7 +16,7 @@ class KMQucikToolsModel: NSObject {
     var isNew: Bool = false
     
     static func allType() -> [DataNavigationViewButtonActionType] {
-        let array: [DataNavigationViewButtonActionType] = [.Batch, .ConvertPDF, .PDFToWord, .PDFToExcel, .FileCompare, .PDFToPPT, .ImageToPDF, .OCR, .PageEdit, .MergePDF, .BreakUp, .Insert, .Compression, .Security, .Watermark, .Background, .HeaderAndFooter, .BatesCode, .PrintPoster, .PrintMultipage, .PrintBooklet]
+        let array: [DataNavigationViewButtonActionType] = [.AITools, .Batch, .ConvertPDF, .PDFToWord, .PDFToExcel, .FileCompare, .PDFToPPT, .ImageToPDF, .OCR, .PageEdit, .MergePDF, .BreakUp, .Insert, .Compression, .Security, .Watermark, .Background, .HeaderAndFooter, .BatesCode, .PrintPoster, .PrintMultipage, .PrintBooklet]
         return array
     }
     
@@ -82,6 +82,7 @@ extension KMQucikToolsModel {
         case .PrintBooklet: string = "Booklet"
         case .Batch: string = "Batch"
         case .FileCompare: string = "Compare Files"
+        case .AITools: string = "AI Tools"
         default: string = ""
         }
             
@@ -113,6 +114,7 @@ extension KMQucikToolsModel {
         case .PrintBooklet: string = "Print a multipage document as a booklet"
         case .Batch: string = "Batch convert, compress, secure, watermark PDFs"
         case .FileCompare: string = "Compare the differences between two files"
+        case .AITools: string = "Unleash productivity with AI assistant."
         default: string = ""
         }
             
@@ -145,6 +147,7 @@ extension KMQucikToolsModel {
             case .PrintBooklet: string = "KMImageNameUXIconHomeQuicktoolBookHov"
             case .Batch: string = "KMImageNameUXIconHomeQuicktoolBatchHov"
             case .FileCompare: string = "KMImageNameUXIconHomeQuicktoolComprisonHov"
+            case .AITools: string = "AIChatRobotHome"
             default: string = ""
             }
         } else {
@@ -170,6 +173,7 @@ extension KMQucikToolsModel {
             case .PrintBooklet: string = "KMImageNameUXIconHomeQuicktoolBookNor"
             case .Batch: string = "KMImageNameUXIconHomeQuicktoolBatchNor"
             case .FileCompare: string = "KMImageNameUXIconHomeQuicktoolComprison"
+            case .AITools: string = "AIChatRobotHome"
             default: string = ""
             }
         }

+ 4 - 0
PDF Office/PDF Master/Class/Home/View/HomeContentView/QucikTools/View/KMQucikToolCollectionViewItem.swift

@@ -122,6 +122,10 @@ class KMQucikToolCollectionViewItem: NSCollectionViewItem {
                         model?.isNew = false
                         UserDefaults.standard.setValue(true, forKey: "QucikToolsModelFileCompareKey")
                         UserDefaults.standard.synchronize()
+                    } else if model?.type == .AITools {
+                        model?.isNew = false
+                        UserDefaults.standard.setValue(true, forKey: "QucikToolsModelAIToolsKey")
+                        UserDefaults.standard.synchronize()
                     }
                 }
                 self.downAction?(self, model!)

+ 3 - 0
PDF Office/PDF Master/Class/Home/ViewController/KMFastToolCollectionViewItem.swift

@@ -37,6 +37,7 @@ public enum DataNavigationViewButtonActionType : Int, CaseIterable {
     case FileCompare    // 文件对比
     case ComparativeTable    // 比较表
     case equity    // 权益弹窗
+    case AITools  //AI Tools
 }
 
 
@@ -178,6 +179,8 @@ class KMFastToolMode: NSObject {
             break
         case .PrintBooklet:
             break
+        case .AITools:
+            break
         }
         return mode
     }

+ 5 - 0
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -212,6 +212,11 @@ extension KMHomeViewController {
             FMTrackEventManager.defaultManager.trackEvent(event: "Onbrd", withProperties: ["HP_Tools": "Booklet"])
             self.fastTool_printBooklet()
             break
+        case .AITools:
+//            FMTrackEventManager.defaultManager.trackEvent(event: "Onbrd", withProperties: ["HP_Tools": "Booklet"])
+//            self.fastTool_printBooklet()
+            self.showAITypeChooseView()
+            break
         }
     }
     

+ 32 - 66
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.swift

@@ -182,7 +182,7 @@ import Cocoa
         NotificationCenter.default.addObserver(self, selector: #selector(importFromScanner), name: Notification.Name("kDeviceScannerMenuItemNotification"), object: nil)
         self.loadFunctionGuide()
         
-        self.loadAIIconView()
+//        self.loadAIIconView()
     }
     
     override func viewDidAppear() {
@@ -195,7 +195,8 @@ import Cocoa
         super.viewDidLayout()
         
         refreshScrollView()
-        self.loadAITipIconGuide()
+        
+//        self.loadAITipIconGuide()
     }
     
     func initNetworkingData() {
@@ -888,75 +889,40 @@ extension KMHomeViewController {
      
     
     func showAITypeChooseView() -> Void {
-        if AIInfoManager.default().aiInfo.infoDict.isEmpty == true {
-#if VERSION_DMG
-            KMPurchaseCompareWindowController.dmgPurchaseInstance().showWindow(nil)
-#else
-            AIPurchaseWindowController.currentWC().showWindow(nil)
-#endif
-            return
-        }
-        let controller = NSViewController.init()
-        let view = NSView.init()
-        controller.view = view
-        
-        var string: String = NSLocalizedString("AI Summarize", comment: "")
-        if string.count < NSLocalizedString("AI Rewrite", comment: "").count {
-            string = NSLocalizedString("AI Rewrite", comment: "")
-        }
-        if string.count < NSLocalizedString("AI Proofread", comment: "").count {
-            string = NSLocalizedString("AI Proofread", comment: "")
-        }
-        if string.count < NSLocalizedString("AI Translate", comment: "").count {
-            string = NSLocalizedString("AI Translate", comment: "")
-        }
-         
-        let font = NSFont.SFProTextRegularFont(13)
-        var style = NSMutableParagraphStyle.init()
-        style.alignment = .center
-        style.lineBreakMode = .byCharWrapping
-        let size: NSSize = string.boundingRect(with: NSSize(width: 1000, height: 100),
-                                               options: NSString.DrawingOptions(rawValue: 3),
-                                               attributes: [NSAttributedString.Key.font : NSFont.SFProTextRegularFont(13), NSAttributedString.Key.paragraphStyle : style]).size
-         
-        controller.view.frame = CGRectMake(0, 0, size.width+80, 160)
-        if self.aiTypeChooseView == nil {
-            self.aiTypeChooseView = AITypeChooseView.createFromNib()
-        }
-        self.aiTypeChooseView.clickHandle = { [weak self] view, type in
-            DispatchQueue.main.async {
-                let windowVC = AIConfigWindowController.currentWC()
-                windowVC.configType = type
-                if type == .summarize {
-                    windowVC.window?.setFrame(CGRectMake(0, 0, 800, 500), display: true)
-                } else if type == .reWriting {
-                    windowVC.window?.setFrame(CGRectMake(0, 0, 800, 460), display: true)
-                } else if type == .proofreading {
-                    windowVC.window?.setFrame(CGRectMake(0, 0, 800, 460), display: true)
-                } else if type == .translate {
-                    windowVC.window?.setFrame(CGRectMake(0, 0, 800, 545), display: true)
+        let windowVC: AINewConfigWindowController = AINewConfigWindowController.currentWC()
+        windowVC.chooseCurFileHandle = {[unowned self] windowVC in
+            if AIChatInfoManager.defaultManager.currentFilePath.isEmpty == false {
+                let documentArray = NSDocumentController.shared.documents
+                var didFileEdit: Bool = false
+                var curDoc: KMMainDocument!
+                for document in documentArray {
+                    if document.fileURL?.path == AIChatInfoManager.defaultManager.currentFilePath {
+                        didFileEdit = document.isDocumentEdited
+                        curDoc = document as! KMMainDocument
+                        break
+                    }
                 }
-                
-                windowVC.cancelHandle = { [weak self] windowVC in
-                    self?.view.window?.endSheet(windowVC.window!)
+                if didFileEdit {
+                    let tempFileURL = FileManager.default.temporaryDirectory.appendingPathComponent(AIChatInfoManager.defaultManager.currentFilePath.lastPathComponent)
+                    if FileManager.default.fileExists(atPath: tempFileURL.path) {
+                        do {
+                            try FileManager.default.removeItem(at: tempFileURL)
+                            
+                        } catch {
+                           
+                        }
+                    }
+                    if curDoc != nil {
+                        curDoc.mainViewController?.SaveTempPDFDocumentToURLPath(tempPath: tempFileURL.path)
+                    }
                 }
-                windowVC.refreshUI()
-                self?.view.window?.beginSheet(windowVC.window!)
-                windowVC.refreshUI()
+                windowVC.window?.becomeMain()
             }
         }
-        self.aiTypeChooseView.frame = controller.view.bounds
-        self.aiTypeChooseView.autoresizingMask = [.width, .height]
-        controller.view.addSubview(self.aiTypeChooseView)
+        windowVC.window?.center()
+        windowVC.eventLabel = "AITools_Onboard"
+        windowVC.showWindow(nil)
         
-        let popover = NSPopover.init()
-        popover.contentViewController = controller
-        popover.animates = true
-        popover.behavior = .transient
-        var rect = self.aiTipView.bounds
-        rect.origin.y += 20
-        popover.show(relativeTo: rect, of: self.aiTipView, preferredEdge: .minY)
-
     }
     
     func loadAITipIconGuide() {

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/Compare/ViewController/ContentComplete/KMCompareContentWindowController.swift

@@ -38,11 +38,11 @@ class KMCompareContentWindowController: NSWindowController {
         contentView.oldDocument = pdfOldDocumnet
         contentView.document = pdfDocument
         contentView.compareResults = results
-        contentView.closeHandle = { view in
+        contentView.closeHandle = {[unowned self] view in
             self.closeHandle?(self)
         }
         
-        contentView.saveHandle = { view in
+        contentView.saveHandle = {[unowned self] view in
             self.saveHandle?(self)
         }
     }

+ 6 - 0
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMMainToolbarController.swift

@@ -130,6 +130,10 @@ extension KMMainToolbarController : NSToolbarDelegate ,NSToolbarItemValidation,N
                 let menuItem = NSMenuItem.init(title: "scan", action: #selector(leftControllButtonAction), target: self)
                 item?.setViewWithSizes(self.scanORCModelButton)
                 item?.menuFormRepresentation = menuItem
+            } else if itemIdentifier.rawValue == KMDocumentAIToolsToolbarItemIdentifier {
+                let menuItem = NSMenuItem.init(title: "AI Tools", action: #selector(leftControllButtonAction), target: self)
+                item?.setViewWithSizes(self.scanORCModelButton)
+                item?.menuFormRepresentation = menuItem
             } else if itemIdentifier.rawValue == KMDocumentEditToolbarItemIdentifier {
                 let menuItem = NSMenuItem.init(title: "edit", action: #selector(editPDFButtonAction), target: self)
                 item?.setViewWithSizes(self.editModelButton)
@@ -176,6 +180,7 @@ extension KMMainToolbarController : NSToolbarDelegate ,NSToolbarItemValidation,N
                 NSToolbarItem.Identifier(KMDocumentPageToolbarItemIdentifier),
                 NSToolbarItem.Identifier(KMDocumentConversonToolbarItemIdentifier),
                 NSToolbarItem.Identifier(KMDocumentScanOCRToolbarItemIdentifier),
+                NSToolbarItem.Identifier(KMDocumentAIToolsToolbarItemIdentifier),
                 NSToolbarItem.Identifier(KMDocumentEditToolbarItemIdentifier),
                 NSToolbarItem.Identifier(KMDocumentFormToolbarItemIdentifier),
                 NSToolbarItem.Identifier(KMDocumentFillSginToolbarItemIdentifier),
@@ -196,6 +201,7 @@ extension KMMainToolbarController : NSToolbarDelegate ,NSToolbarItemValidation,N
                 NSToolbarItem.Identifier(KMDocumentPageToolbarItemIdentifier),
                 NSToolbarItem.Identifier(KMDocumentConversonToolbarItemIdentifier),
                 NSToolbarItem.Identifier(KMDocumentScanOCRToolbarItemIdentifier),
+                NSToolbarItem.Identifier(KMDocumentAIToolsToolbarItemIdentifier),
                 NSToolbarItem.Identifier(KMDocumentEditToolbarItemIdentifier),
                 NSToolbarItem.Identifier(KMDocumentFormToolbarItemIdentifier),
                 NSToolbarItem.Identifier(KMDocumentFillSginToolbarItemIdentifier),

+ 2 - 0
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarController.swift

@@ -329,6 +329,8 @@ class KMToolbarController: NSViewController {
                 self.mainToolBarView?.itemAction(data)
             } else if identifier == KMDocumentScanOCRToolbarItemIdentifier {
                 self.mainToolBarView?.itemAction(data)
+            } else if identifier == KMDocumentAIToolsToolbarItemIdentifier {
+                self.mainToolBarView?.itemAction(data)
             }
             
             return

+ 19 - 2
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarViewController.swift

@@ -26,6 +26,7 @@ import Cocoa
     case LeftPanel
     case RightPanel
     case viewSetting
+    case AITools
     
     func isToolMode() -> Bool {
         return (self == .Move || self == .Magnify || self == .Select || self == .SelectZoom)
@@ -60,6 +61,8 @@ import Cocoa
             return KMLeftControlToolbarItemIdentifier
         } else if (self == .RightPanel) {
             return KMRightControlToolbarItemIdentifier
+        } else if (self == .AITools) {
+            return KMDocumentAIToolsToolbarItemIdentifier
         }
         return ""
     }
@@ -676,7 +679,8 @@ extension KMToolbarViewController : KMToolbarViewDelegate,NSToolbarItemValidatio
                     KMDocumentEditToolbarItemIdentifier,
                     KMDocumentDigitalSignToolbarItemIdentifier,
                     KMDocumentRedactToolbarItemIdentifier,
-                    KMDocumentScanOCRToolbarItemIdentifier]
+                    KMDocumentScanOCRToolbarItemIdentifier,
+                    KMDocumentAIToolsToolbarItemIdentifier]
         case .Annatiton,.Magnify,.Move,.Select,.SelectZoom:
             let itemIdentifiers: [String]? = self.toolbar?.toolbarIdentifier != nil ? (UserDefaults.standard.object(forKey: self.toolbar?.toolbarIdentifier ?? "") as? [String]) : []
             if itemIdentifiers == nil || itemIdentifiers!.count <= 0 {
@@ -708,7 +712,7 @@ extension KMToolbarViewController : KMToolbarViewDelegate,NSToolbarItemValidatio
             return [KMToolbarToolCompressItemIdentifier, KMToolbarToolMergeItemIdentifier,
                     KMToolbarToolSecureItemIdentifier, KMToolbarComparisonItemIdentifier,
                     KMToolbarToolWatermarkItemIdentifier, KMToolbarToolBackgroundItemIdentifier,
-                    KMToolbarToolHeaderFooterItemIdentifier, KMToolbarToolBatesItemIdentifier, KMToolbarAIItemIdentifier]
+                    KMToolbarToolHeaderFooterItemIdentifier, KMToolbarToolBatesItemIdentifier]
         case .Form:
             return [KMToolbarToolTextFieldItemIdentifier,
                     KMToolbarToolCheckBoxItemIdentifier,
@@ -1310,6 +1314,19 @@ extension KMToolbarViewController {
             let menuItem = NSMenuItem.init(title: NSLocalizedString("Page Display", comment: ""), action: #selector(_menuItemAction), target: self)
             menuItem.representedObject = identifier
             item?.menuFormRepresentation = menuItem
+        } else if identifier == KMDocumentAIToolsToolbarItemIdentifier {
+            item?.image = NSImage(named: "KMImageNameUXIconAINor")
+            item?.titleName = NSLocalizedString("AI Tools", comment: "")
+            item?.target = self
+            item?.toolTip = NSLocalizedString("AI Tools", comment: "")
+            item?.boxImagePosition = .imageAbove
+            item?.selectBackgroundType = .imageBox
+            item?.btnAction = #selector(_itemAction)
+            item?.promptIdentifier = identifier
+            
+            let menuItem = NSMenuItem.init(title: NSLocalizedString("AI Tools", comment: ""), action: #selector(_menuItemAction), target: self)
+            menuItem.representedObject = identifier
+            item?.menuFormRepresentation = menuItem
         } else if identifier == KMDocumentShareToolbarItemIdentifier {
             item?.image = NSImage(named: "KMImageNameUXIconToolbarShareNor")
             item?.titleName = NSLocalizedString("Share", comment: "")

+ 3 - 4
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/PublicKey.swift

@@ -31,10 +31,10 @@ let KMDocumentAITranslationToolbarItemIdentifier = "KMDocumentAITranslationToolb
 let KMDocumentShareToolbarItemIdentifier = "KMDocumentShareToolbarItemIdentifier"
 let KMDocumentSearchToolbarItemIdentifier = "KMDocumentSearchToolbarItemIdentifier"
 let KMRightControlToolbarItemIdentifier  = "KMRightControlToolbarItemIdentifier"
+let KMDocumentAIToolsToolbarItemIdentifier = "KMDocumentAIToolsToolbarItemIdentifier"
 let mainToolIdentifiers = [KMLeftControlToolbarItemIdentifier, KMDocumentZoomToolbarItemIdentifier, KMDocumentZoomOutToolbarItemIdentifier,
                            KMDocumentZoomViewToolbarItemIdentifier, KMDocumentPreviousPageToolbarItemIdentifier, KMDocumentNextPageToolbarItemIdentifier,
-                           KMDocumentHomeToolbarItemIdentifier, KMDocumentAnnotationToolbarItemIdentifier, KMDocumentPageToolbarItemIdentifier, KMDocumentConversonToolbarItemIdentifier,KMDocumentRedactToolbarItemIdentifier,KMDocumentViewDisplayToolbarItemIdentifier,
-                           KMDocumentScanOCRToolbarItemIdentifier, KMDocumentFormToolbarItemIdentifier, KMDocumentEditToolbarItemIdentifier, KMDocumentDigitalSignToolbarItemIdentifier,
+                           KMDocumentHomeToolbarItemIdentifier, KMDocumentAnnotationToolbarItemIdentifier, KMDocumentPageToolbarItemIdentifier, KMDocumentConversonToolbarItemIdentifier,KMDocumentRedactToolbarItemIdentifier,KMDocumentAIToolsToolbarItemIdentifier,KMDocumentViewDisplayToolbarItemIdentifier,KMDocumentScanOCRToolbarItemIdentifier, KMDocumentFormToolbarItemIdentifier, KMDocumentEditToolbarItemIdentifier, KMDocumentDigitalSignToolbarItemIdentifier,
                            KMDocumentFillSginToolbarItemIdentifier, KMDocumentToolToolbarItemIdentifier, KMDocumentPrintToolbarItemIdentifier,
                            KMDocumentShareToolbarItemIdentifier, KMDocumentSearchToolbarItemIdentifier, KMRightControlToolbarItemIdentifier]
 
@@ -132,8 +132,7 @@ let toolToolIdentifiers = [KMToolbarToolCropItemIdentifier, KMToolbarToolBatesIt
                            KMToolbarToolHeaderFooterItemIdentifier, KMToolbarToolBackgroundItemIdentifier,
                            KMToolbarToolWatermarkItemIdentifier, KMToolbarToolRedactItemIdentifier,
                            KMToolbarToolCompressItemIdentifier, KMToolbarToolSecureItemIdentifier,
-                           KMToolbarToolMergeItemIdentifier,KMToolbarComparisonItemIdentifier,
-                           KMToolbarAIItemIdentifier]
+                           KMToolbarToolMergeItemIdentifier,KMToolbarComparisonItemIdentifier]
 
 /// Form
 let KMToolbarToolTextFieldItemIdentifier =  "KMToolbarFormTextFieldItemIdentifier"

+ 7 - 5
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -4433,6 +4433,8 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     self.enterRedact()
                 } else if itemID == KMDocumentScanOCRToolbarItemIdentifier {
                     showOCRWindow()
+                } else if itemID == KMDocumentAIToolsToolbarItemIdentifier {
+                    self.showAITypeChooseView(aiConfigType: .none)
                 } else if itemID == KMDocumentDigitalSignToolbarItemIdentifier {
                     if self.canEnterDigitalSign() == false {
                         Task {
@@ -4643,13 +4645,13 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
             self.showOCRWindow()
         } else if toolbarItem.itemIdentifier == KMToolbarAIItemIdentifier {
             if index == 1 {
-                self.loadAIConfigWindowWithType(.summarize)
+                self.showAITypeChooseView(aiConfigType: .summarize)
             } else if index == 2 {
-                self.loadAIConfigWindowWithType(.reWriting)
+                self.showAITypeChooseView(aiConfigType: .reWriting)
             } else if index == 3 {
-                self.loadAIConfigWindowWithType(.proofreading)
-            } else if index == 4 { 
-                self.loadAIConfigWindowWithType(.translate)
+                self.showAITypeChooseView(aiConfigType: .proofreading)
+            } else if index == 4 {
+                self.showAITypeChooseView(aiConfigType: .translate)
             }
         } else if toolbarItem.itemIdentifier == KMDocumentScanOCRToolbarItemIdentifier {
             self.showOCRWindow()

+ 3 - 3
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

@@ -899,13 +899,13 @@ extension KMMainViewController {
         
     }
     @objc func AITranslateItemAction(sender: NSMenuItem) {
-        self.loadAIConfigWindowWithType(.translate)
+        self.showAITypeChooseView(aiConfigType: .translate)
     }
     @objc func AIProofreadItemAction(sender: NSMenuItem) {
-        self.loadAIConfigWindowWithType(.proofreading)
+        self.showAITypeChooseView(aiConfigType: .proofreading)
     }
     @objc func AIRewriteItemAction(sender: NSMenuItem) {
-        self.loadAIConfigWindowWithType(.reWriting)
+        self.showAITypeChooseView(aiConfigType: .reWriting)
     }
     
 //    @objc func highlightLinks() {

+ 62 - 85
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -267,7 +267,7 @@ import Cocoa
         
         if (self.document == nil || self.document!.isLocked == false) {
             self.loadFunctionGuide()
-            self.loadAIIconView()
+//            self.loadAIIconView()
         }
         
         if (self.document?.isLocked == false) {
@@ -696,9 +696,9 @@ import Cocoa
         if self.aiTipView == nil {
             self.aiTipView = AITipIconView.createFromNib()
             self.aiTipView.clickHandle = { [weak self] view in
-                self?.showAITypeChooseView()
+//                self?.showAITypeChooseView()
             }
-            self.aiTipView.rightClickHandle = { view in
+            self.aiTipView.rightClickHandle = {[unowned self] view in
                 AIInfoManager.default().showAIIcon = false
                 NotificationCenter.default.post(name: NSNotification.Name(rawValue: "kAIIconShowStateChangeNotification"), object: nil)
             }
@@ -728,91 +728,64 @@ import Cocoa
         }
     }
     
-    func showAITypeChooseView() -> Void {
-        if AIInfoManager.default().aiInfo.infoDict.isEmpty == true {
-#if VERSION_DMG
-            KMPurchaseCompareWindowController.dmgPurchaseInstance().showWindow(nil)
-#else
-            AIPurchaseWindowController.currentWC().showWindow(nil)
-#endif
-            return
-        }
-        let controller = NSViewController.init()
-        let view = NSView.init()
-        controller.view = view
-        
-        var string: String = NSLocalizedString("AI Summarize", comment: "")
-        if string.count < NSLocalizedString("AI Rewrite", comment: "").count {
-            string = NSLocalizedString("AI Rewrite", comment: "")
-        }
-        if string.count < NSLocalizedString("AI Proofread", comment: "").count {
-            string = NSLocalizedString("AI Proofread", comment: "")
-        }
-        if string.count < NSLocalizedString("AI Translate", comment: "").count {
-            string = NSLocalizedString("AI Translate", comment: "")
-        }
-         
-        _ = NSFont.SFProTextRegularFont(13)
-        let style = NSMutableParagraphStyle.init()
-        style.alignment = .center
-        style.lineBreakMode = .byCharWrapping
-        let size: NSSize = string.boundingRect(with: NSSize(width: 1000, height: 100),
-                                               options: NSString.DrawingOptions(rawValue: 3),
-                                               attributes: [NSAttributedString.Key.font : NSFont.SFProTextRegularFont(13), NSAttributedString.Key.paragraphStyle : style]).size
-         
-        controller.view.frame = CGRectMake(0, 0, size.width+80, 160)
-        if self.aiTypeChooseView == nil {
-            self.aiTypeChooseView = AITypeChooseView.createFromNib()
-        }
-        self.aiTypeChooseView.clickHandle = { [weak self] view, type in
-            DispatchQueue.main.async {
-                self?.loadAIConfigWindowWithType(type)
-            }
-        }
-        self.aiTypeChooseView.frame = controller.view.bounds
-        self.aiTypeChooseView.autoresizingMask = [.width, .height]
-        controller.view.addSubview(self.aiTypeChooseView)
+    func showAITypeChooseView(aiConfigType: AIConfigType) -> Void {
         
-        let popover = NSPopover.init()
-        popover.contentViewController = controller
-        popover.animates = true
-        popover.behavior = .transient
-        var rect = self.aiTipView.bounds
-        rect.origin.y += 20
-        popover.show(relativeTo: rect, of: self.aiTipView, preferredEdge: .minY)
-    }
-    
-    func loadAIConfigWindowWithType(_ type: AIConfigType) -> Void {
-        if AIInfoManager.default().aiInfo.infoDict.isEmpty == true {
-#if VERSION_DMG
-            KMPurchaseCompareWindowController.dmgPurchaseInstance().showWindow(nil)
-#else
-            AIPurchaseWindowController.currentWC().showWindow(nil)
-#endif
-            return
+        if (self.document != nil) {
+            AIChatInfoManager.defaultManager.currentFilePath = (self.document?.documentURL.path)!
+        } else {
+            AIChatInfoManager.defaultManager.currentFilePath = ""
+        }
+        
+        let windowVC: AINewConfigWindowController = AINewConfigWindowController.currentWC()
+        windowVC.chooseCurFileHandle = {[unowned self] windowVC in
+            if AIChatInfoManager.defaultManager.currentFilePath.isEmpty == false {
+                let documentArray = NSDocumentController.shared.documents
+                var didFileEdit: Bool = false
+                var curDoc: KMMainDocument!
+                for document in documentArray {
+                    if document.fileURL?.path == AIChatInfoManager.defaultManager.currentFilePath {
+                        didFileEdit = document.isDocumentEdited
+                        curDoc = document as! KMMainDocument
+                        break
+                    }
+                }
+                if didFileEdit {
+                    let tempFileURL = FileManager.default.temporaryDirectory.appendingPathComponent(AIChatInfoManager.defaultManager.currentFilePath.lastPathComponent)
+                    if FileManager.default.fileExists(atPath: tempFileURL.path) {
+                        do {
+                            try FileManager.default.removeItem(at: tempFileURL)
+                            
+                        } catch {
+                           
+                        }
+                    }
+                    if curDoc != nil {
+                        curDoc.mainViewController?.SaveTempPDFDocumentToURLPath(tempPath: tempFileURL.path)
+                    }
+                }
+                windowVC.window?.becomeMain()
+            }
         }
-        let windowVC = AIConfigWindowController.currentWC()
-        windowVC.configType = type
-        if type == .summarize {
-            windowVC.window?.setFrame(CGRectMake(0, 0, 800, 500), display: true)
-            FMTrackEventManager.defaultManager.trackEvent(event: "AITools", withProperties: ["AITools_Btn": "AISum"])
-        } else if type == .reWriting {
-            windowVC.window?.setFrame(CGRectMake(0, 0, 800, 460), display: true)
-            FMTrackEventManager.defaultManager.trackEvent(event: "AITools", withProperties: ["AITools_Btn": "AIRewrite"])
-        } else if type == .proofreading {
-            windowVC.window?.setFrame(CGRectMake(0, 0, 800, 460), display: true)
-            FMTrackEventManager.defaultManager.trackEvent(event: "AITools", withProperties: ["AITools_Btn": "AIProofread"])
-        } else if type == .translate {
-            windowVC.window?.setFrame(CGRectMake(0, 0, 800, 545), display: true)
-            FMTrackEventManager.defaultManager.trackEvent(event: "AITools", withProperties: ["AITools_Btn": "AITranslate"])
+        windowVC.window?.center()
+        if windowVC.window?.isVisible == true && windowVC.didSetOriginFrame == true {
+            
+        } else {
+            var windowRect = windowVC.window?.frame
+            windowRect!.origin.x = CGRectGetMaxX(self.view.window!.frame) - (windowRect?.size.width)!
+            windowRect!.origin.y = CGRectGetMaxY(self.view.window!.frame) - (windowRect?.size.height)! - 64
+            windowVC.window?.setFrame(windowRect!, display: true)
+            
+            windowVC.didSetOriginFrame = true
         }
-        
-        windowVC.cancelHandle = { [weak self] windowVC in
-            self?.view.window?.endSheet(windowVC.window!)
+        windowVC.eventLabel = "AITools_Tbr"
+        windowVC.showWindow(nil)
+        if (aiConfigType != .none) {
+            windowVC.eventLabel = "AITools_Start"
+            if self.listView.currentSelection.string().isEmpty == false {
+                windowVC.setCurrentPDFSelection(self.listView.currentSelection.string())
+            }
+            windowVC.chooseAIFunctionWithType(aiConfigType)
         }
-        windowVC.refreshUI()
-        self.view.window?.beginSheet(windowVC.window!)
-        windowVC.refreshUI()
     }
     
     @objc func aiTipIconViewShowStateChangeNoti() {
@@ -1568,6 +1541,9 @@ import Cocoa
             }
         }
     }
+    func SaveTempPDFDocumentToURLPath(tempPath: String) {
+        self.document?.write(toFile: tempPath)
+    }
     
     // MARK: - 定时保存
     
@@ -1920,6 +1896,7 @@ import Cocoa
             NSSpellChecker.shared.closeSpellDocument(withTag: self.listView.spellingTag())
         }
         self.removeAutoSaveInfo()
+        KMAdsManager.defaultManager.dismissSheetModal(for: self.readContentView)
     }
     
     public func clearSecureOptions() {
@@ -2004,7 +1981,7 @@ import Cocoa
     internal func documentDidUnlockNotification(_ sender: Notification) {
         if (self.listView.document != nil && self.listView.document.isEqual(to: sender.object)) {
             
-            self.loadAIIconView()
+//            self.loadAIIconView()
             
             if (self.myDocument == nil) {
                 return

+ 24 - 24
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseFirstTrialWindowController.swift

@@ -7,7 +7,7 @@
 
 import Cocoa
 
-@objc class KMPurchaseFirstTrialWindowController: NSWindowController,NSTextFieldDelegate,NSTextViewDelegate {
+@objc class KMPurchaseFirstTrialWindowController: NSWindowController,NSTextFieldDelegate,NSTextViewDelegate, NSWindowDelegate {
     @IBOutlet weak var contentImageView: NSImageView!
     @IBOutlet weak var titleField: NSTextField!
     @IBOutlet weak var rView: NSView!
@@ -49,27 +49,19 @@ import Cocoa
     @IBOutlet weak var enterLicenseBox: NSBox!
     @IBOutlet weak var enterLicenseBtn: HyperLinkButton!
     
+    static var currentWindowController: KMPurchaseFirstTrialWindowController!
+    
     @objc var buttonActionBlock: ((_ firstTrialWinVC: KMPurchaseFirstTrialWindowController, _ btn: KMButton, _ email : String, _ name : String)->Void)?
     
     //MARK: 打开文件
    @objc static func currentFirstTrialWC() -> KMPurchaseFirstTrialWindowController {
-        if let controller: KMPurchaseFirstTrialWindowController = KMPurchaseFirstTrialWindowController.fetchSampleController() {
-            return controller
-        } else {
-            let purchaseLimitWC: KMPurchaseFirstTrialWindowController = KMPurchaseFirstTrialWindowController.init(windowNibName: "KMPurchaseFirstTrialWindowController")
-            return purchaseLimitWC
-        }
-    }
-    
-    static func fetchSampleController() -> KMPurchaseFirstTrialWindowController? {
-        for window in NSApp.windows {
-            let controller = window.windowController
-            if controller is KMPurchaseFirstTrialWindowController {
-                return controller as? KMPurchaseFirstTrialWindowController
-            }
-        }
-        
-        return nil
+       if currentWindowController != nil {
+           return currentWindowController
+       } else {
+           let configWC: KMPurchaseFirstTrialWindowController = KMPurchaseFirstTrialWindowController.init(windowNibName: "KMPurchaseFirstTrialWindowController")
+           currentWindowController = configWC;
+           return currentWindowController
+       }
     }
     
     deinit {
@@ -79,8 +71,12 @@ import Cocoa
     
     override func windowDidLoad() {
         super.windowDidLoad()
+        
         DistributedNotificationCenter.default.addObserver(self, selector: #selector(themeChanged(_:)), name: NSNotification.Name(rawValue:"AppleInterfaceThemeChangedNotification"), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(windowDidBecomeVisible(_:)), name: NSWindow.didBecomeKeyNotification, object: nil)
+        
+        self.window?.delegate = self
+        
         self.activateTrialNowBtn.tag = 10001
         self.buyNowBtn.tag = 10002
         self.enterLicenseBtn.tag = 10003
@@ -234,7 +230,7 @@ import Cocoa
             self.btnBox.layer?.backgroundColor = NSColor(red: 181.0/255.0, green: 177.0/255.0, blue: 239.0/255.0, alpha: 1).cgColor
             self.activateTrialNowBtn.layer?.backgroundColor = NSColor(red: 181.0/255.0, green: 177.0/255.0, blue: 239.0/255.0, alpha: 1).cgColor
             self.activateTrialNowBtn.setTitleColor(NSColor(red: 7.0/255.0, green: 1.0/255.0, blue: 34.0/255.0, alpha: 1))
-            self.activateTrialNowBtn.mouseMoveCallback = { (mouseEntered) in
+            self.activateTrialNowBtn.mouseMoveCallback = {[unowned self] (mouseEntered) in
                 if mouseEntered {
                     self.activateTrialNowBtn.layer?.backgroundColor = NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1).cgColor
                     self.btnBox.fillColor = NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1)
@@ -254,7 +250,7 @@ import Cocoa
             self.buyNowBtn.title = NSLocalizedString("Buy Now", comment: "")
             
             self.buyNowBtn.setTitleColor(NSColor(red: 181.0/255.0, green: 177.0/255.0, blue: 239.0/255.0, alpha: 1))
-            self.buyNowBtn.mouseMoveCallback = { (mouseEntered) in
+            self.buyNowBtn.mouseMoveCallback = {[unowned self] (mouseEntered) in
                 if mouseEntered {
                     self.buyNowBtn.setTitleColor(NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1))
                 } else {
@@ -264,7 +260,7 @@ import Cocoa
             
             self.enterLicenseBtn.title = NSLocalizedString("Enter License", comment: "")
             self.enterLicenseBtn.setTitleColor(NSColor(red: 181.0/255.0, green: 177.0/255.0, blue: 239.0/255.0, alpha: 1))
-            self.enterLicenseBtn.mouseMoveCallback = { (mouseEntered) in
+            self.enterLicenseBtn.mouseMoveCallback = {[unowned self] (mouseEntered) in
                 if mouseEntered {
                     self.enterLicenseBtn.setTitleColor(NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1))
                 } else {
@@ -309,7 +305,7 @@ import Cocoa
             self.btnBox.layer?.backgroundColor = NSColor(red: 39.0/255.0, green: 60.0/255.0, blue: 98.0/255.0, alpha: 1).cgColor
             self.activateTrialNowBtn.layer?.backgroundColor = NSColor(red: 39.0/255.0, green: 60.0/255.0, blue: 98.0/255.0, alpha: 1).cgColor
             self.activateTrialNowBtn.setTitleColor(NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1))
-            self.activateTrialNowBtn.mouseMoveCallback = { (mouseEntered) in
+            self.activateTrialNowBtn.mouseMoveCallback = {[unowned self] (mouseEntered) in
                 if mouseEntered {
                     self.activateTrialNowBtn.layer?.backgroundColor = NSColor(red: 0.0/255.0, green: 207.0/255.0, blue: 133.0/255.0, alpha: 1).cgColor
                     self.btnBox.fillColor = NSColor(red: 0.0/255.0, green: 207.0/255.0, blue: 133.0/255.0, alpha: 1)
@@ -326,7 +322,7 @@ import Cocoa
             
             self.buyNowBtn.title = NSLocalizedString("Buy Now", comment: "")
             self.buyNowBtn.setTitleColor(NSColor(red: 39.0/255.0, green: 60.0/255.0, blue: 98.0/255.0, alpha: 1))
-            self.buyNowBtn.mouseMoveCallback = { (mouseEntered) in
+            self.buyNowBtn.mouseMoveCallback = {[unowned self] (mouseEntered) in
                 if mouseEntered {
                     self.buyNowBtn.setTitleColor(NSColor(red: 8.0/255.0, green: 124.0/255.0, blue: 255.0/255.0, alpha: 1))
                 } else {
@@ -336,7 +332,7 @@ import Cocoa
             
             self.enterLicenseBtn.title = NSLocalizedString("Enter License", comment: "")
             self.enterLicenseBtn.setTitleColor(NSColor(red: 39.0/255.0, green: 60.0/255.0, blue: 98.0/255.0, alpha: 1))
-            self.enterLicenseBtn.mouseMoveCallback = { (mouseEntered) in
+            self.enterLicenseBtn.mouseMoveCallback = {[unowned self] (mouseEntered) in
                 if mouseEntered {
                     self.enterLicenseBtn.setTitleColor(NSColor(red: 8.0/255.0, green: 124.0/255.0, blue: 255.0/255.0, alpha: 1))
                 } else {
@@ -529,4 +525,8 @@ import Cocoa
         
         return true
     }
+    
+    func windowWillClose(_ notification: Notification) {
+        KMPurchaseFirstTrialWindowController.currentWindowController = nil
+    }
 }

+ 5 - 4
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseFirstTrialWindowController.xib

@@ -7,7 +7,7 @@
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMPurchaseFirstTrialWindowController" customModule="PDF_Master" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMPurchaseFirstTrialWindowController" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
                 <outlet property="activateTrialNowBtn" destination="IGp-1C-Tbg" id="ibx-WR-cwx"/>
                 <outlet property="bottomTextView" destination="6cO-55-aAM" id="hSV-mZ-ink"/>
@@ -313,7 +313,7 @@
                                             <rect key="frame" x="0.0" y="0.0" width="240" height="48"/>
                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                             <subviews>
-                                                <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IGp-1C-Tbg" customClass="KMButton" customModule="PDF_Master" customModuleProvider="target">
+                                                <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IGp-1C-Tbg" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                                     <rect key="frame" x="0.0" y="0.0" width="240" height="48"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                                     <buttonCell key="cell" type="bevel" title="Activate Trial Now" bezelStyle="rounded" imagePosition="overlaps" alignment="center" imageScaling="axesIndependently" inset="2" id="WSR-aq-hXl">
@@ -346,6 +346,7 @@
                                                     <color key="backgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                     <size key="minSize" width="404" height="68"/>
                                                     <size key="maxSize" width="404" height="10000000"/>
+                                                    <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                                 </textView>
                                             </subviews>
                                             <color key="backgroundColor" red="1" green="1" blue="1" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
@@ -368,7 +369,7 @@
                                                     <rect key="frame" x="0.0" y="0.0" width="65" height="21"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <subviews>
-                                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1Lk-iR-tGS" customClass="HyperLinkButton" customModule="PDF_Master" customModuleProvider="target">
+                                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1Lk-iR-tGS" customClass="HyperLinkButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                                             <rect key="frame" x="0.0" y="0.0" width="65" height="21"/>
                                                             <buttonCell key="cell" type="bevel" title="Buy Now" bezelStyle="rounded" imagePosition="overlaps" alignment="center" imageScaling="axesIndependently" inset="2" id="veD-K9-dCw">
                                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -397,7 +398,7 @@
                                                     <rect key="frame" x="0.0" y="0.0" width="124" height="21"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <subviews>
-                                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="848-I0-ckh" customClass="HyperLinkButton" customModule="PDF_Master" customModuleProvider="target">
+                                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="848-I0-ckh" customClass="HyperLinkButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                                             <rect key="frame" x="0.0" y="0.0" width="124" height="21"/>
                                                             <buttonCell key="cell" type="bevel" title="Enter the License" bezelStyle="rounded" imagePosition="overlaps" alignment="center" imageScaling="axesIndependently" inset="2" id="orV-D8-Oxt">
                                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>

+ 3 - 3
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseLimitWindowController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -28,7 +28,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="726" height="460"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
             <value key="minSize" type="size" width="726" height="460"/>
             <value key="maxSize" type="size" width="726" height="460"/>
             <view key="contentView" id="se5-gp-TjO">

+ 15 - 14
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -315,20 +315,21 @@ NSPopoverDelegate>
     
     CGFloat totalWidth = CGRectGetMaxX(self.labelContentView.frame) + 8;
     
-    self.aiLabel.stringValue = NSLocalizedString(@"My AI Credit", nil);
-    [self.aiLabel sizeToFit];
-    CGFloat aiWidth = self.aiLabel.frame.size.width;
-    aiWidth += 4;
-    aiWidth += 16;
-    aiWidth += 16;
-    self.aiContendView.frame = CGRectMake(totalWidth, 0, aiWidth, self.view.frame.size.height);
-    self.aiIconImg.frame = CGRectMake(8, CGRectGetHeight(self.view.frame)/2.-8, 16, 16);
-    CGRect ailabelRect = self.aiLabel.frame;
-    ailabelRect.origin.x = CGRectGetMaxX(self.aiIconImg.frame) + 4;
-    self.aiLabel.frame = ailabelRect;
-    
-    totalWidth += aiWidth;
-    totalWidth += 8;
+//    self.aiLabel.stringValue = NSLocalizedString(@"My AI Credit", nil);
+//    [self.aiLabel sizeToFit];
+//    CGFloat aiWidth = self.aiLabel.frame.size.width;
+//    aiWidth += 4;
+//    aiWidth += 16;
+//    aiWidth += 16;
+//    self.aiContendView.frame = CGRectMake(totalWidth, 0, aiWidth, self.view.frame.size.height);
+//    self.aiIconImg.frame = CGRectMake(8, CGRectGetHeight(self.view.frame)/2.-8, 16, 16);
+//    CGRect ailabelRect = self.aiLabel.frame;
+//    ailabelRect.origin.x = CGRectGetMaxX(self.aiIconImg.frame) + 4;
+//    self.aiLabel.frame = ailabelRect;
+//    
+//    totalWidth += aiWidth;
+//    totalWidth += 8;
+    self.aiContendView.hidden = YES;
     
     if (self.button.hidden == NO) {
         CGFloat buttonWidth = CGRectGetMaxX(self.button.frame);

+ 35 - 0
PDF Office/PDF Master/Strings/de.lproj/Localizable.strings

@@ -2799,3 +2799,38 @@
 
 "This PDF has password protect." = "Dies ist ein verschlüsseltes Dokument.";
 "The password is invalid !" = "Ungültiges Passwort";
+
+"AI Tools"="KI-Tools";
+"Unlock efficiency with AI Translate, AI Summarize, AI Proofread, and AI Rewrite "="Steigern Sie die Effizienz mit AI Translate, AI Summarize, AI Proofread und AI Rewrite";
+"AI Summarize"="KI zusammenfassen";
+"AI Rewrite"="KI-Umschreibung";
+"AI Proofread"="KI-Korrekturlesen";
+"AI Translate"="KI-Übersetzung";
+"Redo"="Wiederholen";
+"Copy"="Kopieren";
+"Save as"="Speichern als";
+"Select the AI tool"="Wählen Sie das KI-Tool aus";
+"Current File"="Aktuelle Datei";
+"Choose"="Wählen";
+"Start (1 credit)"="Start (1 Credit)";
+"File size: 10M or less"="Dateigröße: 10 MB oder weniger";
+"Please upload a file under 10M"="Bitte laden Sie eine Datei unter 10 MB hoch";
+"You can summarize the current document or click “Choose” to summarize other files."="Sie können das aktuelle Dokument zusammenfassen oder auf „Auswählen“ klicken, um andere Dateien zusammenzufassen.";
+"Redoing will cost 1 credit. Do you want to redo it?"="Das Wiederherstellen kostet 1 Credit. Möchten Sie es wiederholen?";
+"Redo (1 credit)"="Wiederholen (1 Credit)";
+"Copy Successfully!"="Kopieren erfolgreich!";
+"Save as Text"="Als Text speichern";
+"Save as PDF"="Als PDF speichern";
+"Enter or paste content here..."="Geben Sie hier Inhalte ein oder fügen Sie sie ein...";
+"The translation is canceled."="Die Übersetzung wird abgebrochen.";
+"Start" = "Start";
+"Unleash productivity with AI assistant."="Steigern Sie die Produktivität mit dem KI-Assistenten.";
+"Summarize the current file or click “Choose” to summarize other files."="Fassen Sie die aktuelle Datei zusammen oder klicken Sie auf „Auswählen“, um andere Dateien zusammenzufassen.";
+"Clear session"="Sitzung löschen";
+"All the AI content will be removed. Are you sure you want to clear the session?"="Der gesamte KI-Inhalt wird entfernt. Sind Sie sicher, dass Sie die Sitzung löschen möchten?";
+"Summarize the current file or click choose other files."="Fassen Sie die aktuelle Datei zusammen oder klicken Sie auf „Andere Dateien auswählen“.";
+"Clear session"="Sitzung löschen";
+"All the AI content will be removed. Are you sure you want to clear the session?"="Der gesamte KI-Inhalt wird entfernt. Möchten Sie die Sitzung wirklich löschen?";
+"Clear"="Klar";
+"Tip: 1 credit for each 10,000 characters" = "Tipp: 1 Credit pro 10.000 Zeichen";
+

+ 34 - 0
PDF Office/PDF Master/Strings/es.lproj/Localizable.strings

@@ -2892,3 +2892,37 @@
 
 "This PDF has password protect." = "Este es un documento cifrado.";
 "The password is invalid !" = "Contraseña invalida";
+
+"AI Tools"="Herramientas de IA";
+"Unlock efficiency with AI Translate, AI Summarize, AI Proofread, and AI Rewrite "="Aumente la eficiencia con AI Translate, AI Summarize, AI Proofread y AI Rewrite";
+"AI Summarize"="Resumen de IA";
+"AI Rewrite"="Reescritura de IA";
+"AI Proofread"="Corrección de IA";
+"AI Translate"="Traductor AI";
+"Redo"="Rehacer";
+"Copy"="Copiar";
+"Save as"="Guardar como";
+"Select the AI tool"="Seleccione la herramienta de IA";
+"Current File"="Archivo actual";
+"Choose"="Elegir";
+"Start (1 credit)"="Inicio (1 crédito)";
+"File size: 10M or less"="Tamaño del archivo: 10M o menos";
+"Please upload a file under 10M"="Sube un archivo de menos de 10 M";
+"You can summarize the current document or click “Choose” to summarize other files."="Puede resumir el documento actual o hacer clic en \"Elegir\" para resumir otros archivos.";
+"Redoing will cost 1 credit. Do you want to redo it?"="Rehacer costará 1 crédito. ¿Quieres rehacerlo?";
+"Redo (1 credit)"="Rehacer (1 crédito)";
+"Copy Successfully!"="¡Copia con éxito!";
+"Save as Text"="Guardar como texto";
+"Save as PDF"="Guardar como pdf";
+"Enter or paste content here..."="Ingrese o pegue el contenido aquí...";
+"The translation is canceled."="La traducción está cancelada.";
+"Start" = "Comenzar";
+"Unleash productivity with AI assistant."="Libere la productividad con el asistente de IA.";
+"Summarize the current file or click “Choose” to summarize other files."="Resuma el archivo actual o haga clic en \"Elegir\" para resumir otros archivos.";
+"Clear session"="Borrar sesión";
+"All the AI content will be removed. Are you sure you want to clear the session?"="Se eliminará todo el contenido de IA. ¿Está seguro de que desea borrar la sesión?";
+"Summarize the current file or click choose other files."="Resuma el archivo actual o haga clic en elegir otros archivos.";
+"Clear session"="Borrar sesión";
+"All the AI content will be removed. Are you sure you want to clear the session?"="Se eliminará todo el contenido de IA. ¿Está seguro de que desea borrar la sesión?";
+"Clear"="Claro";
+"Tip: 1 credit for each 10,000 characters" = "Consejo: 1 crédito por cada 10.000 caracteres";

+ 35 - 0
PDF Office/PDF Master/Strings/fr.lproj/Localizable.strings

@@ -2760,5 +2760,40 @@
 /* Class = "NSTabViewItem"; label = "Summary"; ObjectID = "94"; */
 "Summary" = "Récapitulatif";
 
+
 "This PDF has password protect." = "Il s'agit d'un document crypté.";
 "The password is invalid !" = "Mot de passe incorrect";
+
+"AI Tools"="Outils d'IA";
+"Unlock efficiency with AI Translate, AI Summarize, AI Proofread, and AI Rewrite "="Gagnez en efficacité avec AI Translate, AI Summarize, AI Proofread et AI Rewrite";
+"AI Summarize"="Résumé de l'IA";
+"AI Rewrite"="Réécriture de l'IA";
+"AI Proofread"="Relecture IA";
+"AI Translate"="Traduction par l'IA";
+"Redo"="Refaire";
+"Copy"="Copie";
+"Save as"="Enregistrer sous";
+"Select the AI tool"="Sélectionnez l'outil IA";
+"Current File"="Fichier actuel";
+"Choose"="Choisir";
+"Start (1 credit)"="Début (1 crédit)";
+"File size: 10M or less"="Taille du fichier : 10 Mo ou moins";
+"Please upload a file under 10M"="Veuillez télécharger un fichier de moins de 10 Mo";
+"You can summarize the current document or click “Choose” to summarize other files."="Vous pouvez résumer le document actuel ou cliquer sur « Choisir » pour résumer d'autres fichiers.";
+"Redoing will cost 1 credit. Do you want to redo it?"="Refaire coûtera 1 crédit. Voulez-vous le refaire ?";
+"Redo (1 credit)"="Refaire (1 crédit)";
+"Copy Successfully!"="Copiez avec succès !";
+"Save as Text"="Enregistrer sous forme de texte";
+"Save as PDF"="Enregistrer au format PDF";
+"Enter or paste content here..."="Entrez ou collez le contenu ici...";
+"The translation is canceled."="La traduction est annulée.";
+"Start" = "Commencer";
+"Unleash productivity with AI assistant."="Libérez la productivité avec l’assistant AI.";
+"Summarize the current file or click “Choose” to summarize other files."="Résumez le fichier actuel ou cliquez sur « Choisir » pour résumer les autres fichiers.";
+"Clear session"="Effacer la session";
+"All the AI content will be removed. Are you sure you want to clear the session?"="Tout le contenu de l'IA sera supprimé. Êtes-vous sûr de vouloir effacer la session ?";
+"Summarize the current file or click choose other files."="Résumez le fichier actuel ou cliquez sur Choisir d'autres fichiers.";
+"Clear session"="Effacer la session";
+"All the AI content will be removed. Are you sure you want to clear the session?"="Tout le contenu de l'IA sera supprimé. Êtes-vous sûr de vouloir effacer la session ?";
+"Clear"="Clair";
+"Tip: 1 credit for each 10,000 characters" = "Astuce : 1 crédit pour 10 000 caractères";

+ 35 - 0
PDF Office/PDF Master/Strings/it.lproj/Localizable.strings

@@ -2688,3 +2688,38 @@
 
 "This PDF has password protect." = "Questo è un documento crittografato.";
 "The password is invalid !" = "Password non valida";
+
+"AI Tools"="Strumenti di intelligenza artificiale";
+"Unlock efficiency with AI Translate, AI Summarize, AI Proofread, and AI Rewrite "="Ottieni efficienza con AI Translate, AI Summarize, AI Proofread e AI Rewrite";
+"AI Summarize"="AI Riassume";
+"AI Rewrite"="Riscrittura dell'intelligenza artificiale";
+"AI Proofread"="Correzione bozze AI";
+"AI Translate"="AI Traduci";
+"Redo"="Rifare";
+"Copy"="copia";
+"Save as"="Salva come";
+"Select the AI tool"="Seleziona lo strumento AI";
+"Current File"="File corrente";
+"Choose"="Scegliere";
+"Start (1 credit)"="Inizio (1 credito)";
+"File size: 10M or less"="Dimensione del file: 10 milioni o meno";
+"Please upload a file under 10M"="Carica un file inferiore a 10 milioni";
+"You can summarize the current document or click “Choose” to summarize other files."="È possibile riepilogare il documento corrente o fare clic su \"Scegli\" per riepilogare altri file.";
+"Redoing will cost 1 credit. Do you want to redo it?"="La rifacimento costerà 1 credito. Vuoi rifarlo?";
+"Redo (1 credit)"="Ripeti (1 credito)";
+"Copy Successfully!"="Copia con successo!";
+"Save as Text"="Salva come testo";
+"Save as PDF"="Salva come PDF";
+"Enter or paste content here..."="Inserisci o incolla il contenuto qui...";
+"The translation is canceled."="La traduzione è annullata.";
+"Start" = "Inizio";
+"Unleash productivity with AI assistant."="Scatena la produttività con l'assistente AI.";
+"Summarize the current file or click “Choose” to summarize other files."="Riepiloga il file corrente o fai clic su \"Scegli\" per riepilogare altri file.";
+"Clear session"="Sessione chiara";
+"All the AI content will be removed. Are you sure you want to clear the session?"=" Tutto il contenuto AI verrà rimosso. Sei sicuro di voler cancellare la sessione?";
+"Summarize the current file or click choose other files."="Riepilogare il file corrente o fare clic su Scegli altri file.";
+"Clear session"="Sessione chiara";
+"All the AI content will be removed. Are you sure you want to clear the session?"="Tutto il contenuto AI verrà rimosso. Sei sicuro di voler cancellare la sessione?";
+"Clear"="Chiaro";
+"Tip: 1 credit for each 10,000 characters" = "Suggerimento: 1 credito ogni 10.000 caratteri";
+

+ 35 - 0
PDF Office/PDF Master/Strings/ja.lproj/Localizable.strings

@@ -2955,3 +2955,38 @@
 
 "This PDF has password protect." = "これは暗号化された文書です。";
 "The password is invalid !" = "無効なパスワード";
+
+"AI Tools"="AIツール";
+"Unlock efficiency with AI Translate, AI Summarize, AI Proofread, and AI Rewrite "="AI翻訳、AI要約、AI校正、AIリライトで効率を上げる ";
+"AI Summarize"="AIサマリー";
+"AI Rewrite"="AIリライト";
+"AI Proofread"="AI校正";
+"AI Translate"="AI翻訳";
+"Redo"="やり直し";
+"Copy"="コピー";
+"Save as"="名前を付けて保存";
+"Select the AI tool"="AIツールを選択します";
+"Current File"="現行ファイル";
+"Choose"="選ぶ";
+"Start (1 credit)"="スタート(1単位)";
+"File size: 10M or less"="ファイルサイズ:10M以下";
+"Please upload a file under 10M"="10M 未満のファイルをアップロードしてください";
+"You can summarize the current document or click “Choose” to summarize other files."="現在のドキュメントを要約するか、「選択」をクリックして他のファイルを要約することができます。";
+"Redoing will cost 1 credit. Do you want to redo it?"="やり直しには1クレジットかかります。やり直しますか?";
+"Redo (1 credit)"="やり直し(1クレジット)";
+"Copy Successfully!"="コピー成功!";
+"Save as Text"="テキストとして保存";
+"Save as PDF"="PDFとして保存";
+"Enter or paste content here..."="ここにコンテンツを入力または貼り付け...";
+"The translation is canceled."="翻訳はキャンセルされます。";
+"Start" = "始める";
+"Unleash productivity with AI assistant."="AI翻訳、AI要約、AI校正、AIリライトで効率を上げる ";
+"Summarize the current file or click “Choose” to summarize other files."="現在のファイルを要約するか、「選択」をクリックして他のファイルを要約します。";
+"Clear session"="セッションをクリアする";
+"All the AI content will be removed. Are you sure you want to clear the session?"=" すべての AI コンテンツが削除されます。セッションをクリアしてもよろしいですか?";
+"Summarize the current file or click choose other files."="現在のファイルを要約するか、「他のファイルを選択」をクリックします。";
+"Clear session"="セッションをクリアする";
+"All the AI content will be removed. Are you sure you want to clear the session?"="すべての AI コンテンツが削除されます。セッションをクリアしてもよろしいですか?";
+"Clear"="クリア";
+"Tip: 1 credit for each 10,000 characters" = "ヒント: 10,000 文字ごとに 1 クレジット";
+

+ 0 - 0
PDF Office/PDF Master/Strings/nl.lproj/Localizable.strings


部分文件因文件數量過多而無法顯示