diff --git a/.gitignore b/.gitignore
index 8a87439c..83bfb857 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,8 @@ dev
# Wordpress extension
wordpress/svn/.svn
+# Published versions live on WordPress.org SVN and as wordpress@ GitHub releases, not in git
+wordpress/svn/tags/
# Chrome extension
chrome-extension/release/
diff --git a/wordpress/README.md b/wordpress/README.md
index bc93891b..b9dc9a80 100644
--- a/wordpress/README.md
+++ b/wordpress/README.md
@@ -21,7 +21,9 @@ To release a new version:
1. Set `SIMPLEPDF_WEB_EMBED_VERSION` in [simplepdf-embed.php](./svn/trunk/simplepdf-embed.php) to the `@simplepdf/web-embed-pdf` version pinned in [package.json](./package.json) (CI fails on a mismatch), and run `npm run package-plugin`
2. Set the new version in the [simplepdf-embed.php](./svn/trunk/simplepdf-embed.php) header and `SIMPLEPDF_PLUGIN_VERSION`, the `Stable tag` of [README.txt](./svn/trunk/README.txt) and [blueprint.json](./svn/assets/blueprints/blueprint.json)
3. Add the changelog entry in [README.txt](./svn/trunk/README.txt): it is posted to Discord as written
-4. Merge. Then commit the new `svn/tags//` folder to git (it mirrors WordPress.org)
+4. Merge
+
+Each published version is recorded as the `wordpress@` GitHub release, on the commit it was published from; `svn/tags/` is not kept in git.
WordPress.org strips images from `README.txt`: show the plugin through `svn/assets/screenshot-N.png`, captioned under `== Screenshots ==`.
diff --git a/wordpress/svn/tags/1.0.0/README.txt b/wordpress/svn/tags/1.0.0/README.txt
deleted file mode 100644
index e5641702..00000000
--- a/wordpress/svn/tags/1.0.0/README.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-=== SimplePDF Embed ===
-Contributors: bendersej
-Tags: pdf, embed pdf, fill & sign PDF, pdf editor
-Tested up to: 6.4.3
-Stable tag: 1.0.0
-License: GPLv2 or later
-License URI: https://www.gnu.org/licenses/gpl-2.0.html
-Requires at least: 5.8
-Requires PHP: 5.6.20
-
-Your visitors can fill & sign PDFs without leaving your website.
-
-== Description ==
-
-A lightweight plugin that automatically opens any PDF file with SimplePDF.eu: allowing your visitors to fill and edit PDFs (merge, rotate, delete pages) without leaving your website.
-
-== Try it out! ==
-
-https://wordpress.simplepdf.co/
-
-== Features ==
-- Any .pdf link on your website is automatically opened with SimplePDF.eu
-- Add text, checkboxes, pictures, signatures to PDFs
-- Fill fillable form
-- Add, delete, rotate, merge PDFs
-- Download the resulting PDF
-- Works on all browsers and mobile devices
-- Works with both Gutenber and the classic editor
-- Fully responsive
-
-== Screenshots ==
-
-1. SimplePDF Embed
-2. Admin settings of SimplePDF Embed
-3. Adding a PDF link using the Gutenber editor
-4. Adding a PDF link using the classic editor
-5. The PDF is opened on top of the existing website
-
-== Installation ==
-
-This section describes how to install the plugin and get it working.
-
-e.g.
-
-1. Install using the WordPress built-in Plugin installer, or Extract the zip file and drop the contents in the wp-content/plugins/ directory of your WordPress installation.
-2. Activate the plugin through the ‘Plugins’ menu in WordPress.
-3. Optional: Go to Settings > SimplePDF Embed and enter your "Company Identifier" (requires a SimplePDF.eu account)
-4. Now any PDF links in your wordpress pages are opened using SimplePDF (you can disable this behaviour in the settings: see 3.)
-
-== Frequently Asked Questions ==
-= I have installed the plugin: what should I do next? =
-
-All the existing PDF files will now open with SimplePDF.eu.
-
-If you wish to add new PDFs to your website, simply upload them to your Wordpress, copy the link and add it as a link to any page or paragraph in your wordpress.
-
-= The PDF is not opened with SimplePDF =
-
-Make sure that the link ends with ".pdf".
-
-Example: https://wordpress.simplepdf.co/wp-content/uploads/2024/01/example_wordpress.pdf
-
-= Do I need a SimplePDF account to use this plugin? =
-
-No: the plugin does not require an account to work: all features are available without any account.
-
-= What are the differences between using the plugin without and with a SimplePDF account? =
-
-Without an account, the plugin will open the PDF editor allowing your visitors to fill in documents and download them.
-
-With an account, the filled in documents will be automatically transmitted to you. You can configure to receive email notifications as well as use your own logo and loading.
-
-= Where should I submit my feature request or bug report? =
-
-Feel free to reach out to us at wordpress@simplepdf.eu!
-
-= Where can I see the code? =
-
-Our Github repository contains both the code for the Wordpress plugin as well as the underlying @simplepdf/web-embed-pdf code upon which it relies:
-- [Wordpress plugin source code](https://github.com/SimplePDF/simplepdf-embed/tree/main/wordpress)
-- [@simplepdf/web-embed-pdf](https://github.com/SimplePDF/simplepdf-embed/tree/main/web)
-
-== Changelog ==
-
-= 1.0.0 =
-* Initial release
-
diff --git a/wordpress/svn/tags/1.0.0/build/web-embed-pdf.js b/wordpress/svn/tags/1.0.0/build/web-embed-pdf.js
deleted file mode 100644
index 76d3d3e0..00000000
--- a/wordpress/svn/tags/1.0.0/build/web-embed-pdf.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(n){"function"==typeof define&&define.amd?define(n):n()}((function(){"use strict";function n(n,e,t){if(t||2===arguments.length)for(var o,i=0,l=e.length;i\n .simplePDF_container {\n user-select: none;\n position: fixed;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n justify-content: center;\n\n height: 100vh;\n width: 100%;\n z-index: 999999;\n padding: 16px;\n top: 0;\n left: 0;\n background: rgba(0, 0, 0, 0.4);\n }\n\n .simplePDF_content {\n width: 100%;\n height: 100%;\n position: relative;\n box-sizing: border-box;\n }\n\n .simplePDF_iframeContainer {\n overflow: hidden;\n background: #f1f7ff;\n border-radius: 6px;\n width: 100%;\n height: 100%;\n }\n\n .simplePDF_iframe {\n border: none;\n border-radius: 6px;\n width: 100%;\n height: 100%;\n }\n\n .simplePDF_close {\n z-index: 1;\n position: absolute;\n top: -12px;\n right: -12px;\n\n border: none;\n padding: 6px;\n border-radius: 50px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n box-shadow: 0 1px 3px rgb(0 0 0 / 10%), 0 1px 2px rgb(0 0 0 / 24%);\n\n cursor: pointer;\n background: #ff5959;\n text-shadow: 1px 1px #243889;\n }\n\n .simplePDF_close svg {\n fill: white;\n width: 14px;\n height: 14px;\n }\n\n .simplePDF_close:hover {\n box-shadow: 0 2px 4px rgb(0 0 0 / 10%), 0 4px 4px rgb(0 0 0 / 24%);\n }\n \n
- `;
-
- log("Creating the modal", {
- companyIdentifier: getFromConfig("companyIdentifier"),
- editorURL,
- });
- document.body.style.overflow = "hidden";
- document.body.insertAdjacentHTML("beforebegin", modal);
-
- log("Attach close modal listener", {});
- document
- .getElementById("simplePDF_modal_close_button")
- ?.addEventListener("click", closeEditor);
- };
-
-const isAnchor = (
- element: HTMLAnchorElement | Element
-): element is HTMLAnchorElement => element.hasAttribute("href");
-
-export const handleAttachOnClick =
- (editorConfig: EditorConfig) =>
- ({ elements }: { elements: Element[] }) => {
- const openEditor = handleOpenEditor(editorConfig);
- editorConfig.log("Attaching listeners to anchors", {
- anchorsCount: elements.length,
- });
- elements.forEach((element) =>
- element.addEventListener("click", (e) => {
- e.preventDefault();
- openEditor({ href: isAnchor(element) ? element.href : null });
- })
- );
- };
diff --git a/wordpress/svn/tags/1.0.0/src/types.ts b/wordpress/svn/tags/1.0.0/src/types.ts
deleted file mode 100644
index 5baf5ea2..00000000
--- a/wordpress/svn/tags/1.0.0/src/types.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-export type Locale = "de" | "en" | "es" | "fr" | "it" | "pt";
-
-export type EditorConfig = {
- getFromConfig: (key: "companyIdentifier" | "locale") => string | null;
- log: (message: string, details: Record) => void;
-};
-
-export type SimplePDF = {
- disableInit?: boolean;
- companyIdentifier?: string;
- locale?: Locale;
- closeEditor: () => void;
- openEditor: (params: {
- href: string | null;
- context?: Record;
- }) => void;
-};
diff --git a/wordpress/svn/tags/1.1.0/README.txt b/wordpress/svn/tags/1.1.0/README.txt
deleted file mode 100644
index 120057f2..00000000
--- a/wordpress/svn/tags/1.1.0/README.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-=== SimplePDF Embed ===
-Contributors: bendersej
-Tags: pdf, embed pdf, fill & sign PDF, pdf editor
-Tested up to: 6.4.3
-Stable tag: 1.1.0
-License: GPLv2 or later
-License URI: https://www.gnu.org/licenses/gpl-2.0.html
-Requires at least: 5.8
-Requires PHP: 5.6.20
-
-Your visitors can fill & sign PDFs without leaving your website.
-
-== Description ==
-
-A lightweight plugin that automatically opens any PDF file with SimplePDF.eu: allowing your visitors to fill and edit PDFs (merge, rotate, delete pages) without leaving your website.
-
-== Try it out! ==
-
-https://wordpress.simplepdf.co/
-
-== Features ==
-- Any .pdf link on your website is automatically opened with SimplePDF.eu
-- Add text, checkboxes, pictures, signatures to PDFs
-- Fill fillable form
-- Add, delete, rotate, merge PDFs
-- Download the resulting PDF
-- Works on all browsers and mobile devices
-- Works with both Gutenber and the classic editor
-- Fully responsive
-
-== Screenshots ==
-
-1. SimplePDF Embed
-2. Admin settings of SimplePDF Embed
-3. Adding a PDF link using the Gutenber editor
-4. Adding a PDF link using the classic editor
-5. The PDF is opened on top of the existing website
-
-== Installation ==
-
-This section describes how to install the plugin and get it working.
-
-e.g.
-
-1. Install using the WordPress built-in Plugin installer, or Extract the zip file and drop the contents in the wp-content/plugins/ directory of your WordPress installation.
-2. Activate the plugin through the ‘Plugins’ menu in WordPress.
-3. Optional: Go to Settings > SimplePDF Embed and enter your "Company Identifier" (requires a SimplePDF.eu account)
-4. Now any PDF links in your wordpress pages are opened using SimplePDF (you can disable this behaviour in the settings: see 3.)
-
-== Frequently Asked Questions ==
-= I have installed the plugin: what should I do next? =
-
-All the existing PDF files will now open with SimplePDF.eu.
-
-If you wish to add new PDFs to your website, simply upload them to your Wordpress, copy the link and add it as a link to any page or paragraph in your wordpress.
-
-= The PDF is not opened with SimplePDF =
-
-Make sure that the link ends with ".pdf".
-
-Example: https://wordpress.simplepdf.co/wp-content/uploads/2024/01/example_wordpress.pdf
-
-= Do I need a SimplePDF account to use this plugin? =
-
-No: the plugin does not require an account to work: all features are available without any account.
-
-= What are the differences between using the plugin without and with a SimplePDF account? =
-
-Without an account, the plugin will open the PDF editor allowing your visitors to fill in documents and download them.
-
-With an account, the filled in documents will be automatically transmitted to you. You can configure to receive email notifications as well as use your own logo and loading.
-
-= Where should I submit my feature request or bug report? =
-
-Feel free to reach out to us at wordpress@simplepdf.eu!
-
-= Where can I see the code? =
-
-Our Github repository contains both the code for the Wordpress plugin as well as the underlying @simplepdf/web-embed-pdf code upon which it relies:
-- [Wordpress plugin source code](https://github.com/SimplePDF/simplepdf-embed/tree/main/wordpress)
-- [@simplepdf/web-embed-pdf](https://github.com/SimplePDF/simplepdf-embed/tree/main/web)
-
-== Changelog ==
-
-= 1.0.0 =
-* Initial release
-= 1.1.0 =
-* Add support for SimplePDF form links
-
diff --git a/wordpress/svn/tags/1.1.0/build/web-embed-pdf.js b/wordpress/svn/tags/1.1.0/build/web-embed-pdf.js
deleted file mode 100644
index a5301de1..00000000
--- a/wordpress/svn/tags/1.1.0/build/web-embed-pdf.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(n){"function"==typeof define&&define.amd?define(n):n()}((function(){"use strict";function n(n,e,t){if(t||2===arguments.length)for(var o,i=0,l=e.length;i\n .simplePDF_container {\n user-select: none;\n position: fixed;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n justify-content: center;\n\n height: 100vh;\n width: 100%;\n z-index: 999999;\n padding: 16px;\n top: 0;\n left: 0;\n background: rgba(0, 0, 0, 0.4);\n }\n\n .simplePDF_content {\n width: 100%;\n height: 100%;\n position: relative;\n box-sizing: border-box;\n }\n\n .simplePDF_iframeContainer {\n overflow: hidden;\n background: #f1f7ff;\n border-radius: 6px;\n width: 100%;\n height: 100%;\n }\n\n .simplePDF_iframe {\n border: none;\n border-radius: 6px;\n width: 100%;\n height: 100%;\n }\n\n .simplePDF_close {\n z-index: 1;\n position: absolute;\n top: -12px;\n right: -12px;\n\n border: none;\n padding: 6px;\n border-radius: 50px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n box-shadow: 0 1px 3px rgb(0 0 0 / 10%), 0 1px 2px rgb(0 0 0 / 24%);\n\n cursor: pointer;\n background: #ff5959;\n text-shadow: 1px 1px #243889;\n }\n\n .simplePDF_close svg {\n fill: white;\n width: 14px;\n height: 14px;\n }\n\n .simplePDF_close:hover {\n box-shadow: 0 2px 4px rgb(0 0 0 / 10%), 0 4px 4px rgb(0 0 0 / 24%);\n }\n \n
- `;
-
- log("Creating the modal", {
- companyIdentifier: getFromConfig("companyIdentifier"),
- editorURL,
- });
- document.body.style.overflow = "hidden";
- document.body.insertAdjacentHTML("beforebegin", modal);
-
- log("Attach close modal listener", {});
- document
- .getElementById("simplePDF_modal_close_button")
- ?.addEventListener("click", closeEditor);
- };
-
-const isAnchor = (
- element: HTMLAnchorElement | Element
-): element is HTMLAnchorElement => element.hasAttribute("href");
-
-export const handleAttachOnClick =
- (editorConfig: EditorConfig) =>
- ({ elements }: { elements: Element[] }) => {
- const openEditor = handleOpenEditor(editorConfig);
- editorConfig.log("Attaching listeners to anchors", {
- anchorsCount: elements.length,
- });
- elements.forEach((element) =>
- element.addEventListener("click", (e) => {
- e.preventDefault();
- openEditor({ href: isAnchor(element) ? element.href : null });
- })
- );
- };
diff --git a/wordpress/svn/tags/1.1.0/src/types.ts b/wordpress/svn/tags/1.1.0/src/types.ts
deleted file mode 100644
index 5baf5ea2..00000000
--- a/wordpress/svn/tags/1.1.0/src/types.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-export type Locale = "de" | "en" | "es" | "fr" | "it" | "pt";
-
-export type EditorConfig = {
- getFromConfig: (key: "companyIdentifier" | "locale") => string | null;
- log: (message: string, details: Record) => void;
-};
-
-export type SimplePDF = {
- disableInit?: boolean;
- companyIdentifier?: string;
- locale?: Locale;
- closeEditor: () => void;
- openEditor: (params: {
- href: string | null;
- context?: Record;
- }) => void;
-};
diff --git a/wordpress/svn/tags/1.1.1/README.txt b/wordpress/svn/tags/1.1.1/README.txt
deleted file mode 100644
index e8a3483d..00000000
--- a/wordpress/svn/tags/1.1.1/README.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-=== SimplePDF Embed ===
-Contributors: bendersej
-Tags: pdf, embed pdf, fill & sign PDF, pdf editor
-Tested up to: 6.4.3
-Stable tag: 1.1.1
-License: GPLv2 or later
-License URI: https://www.gnu.org/licenses/gpl-2.0.html
-Requires at least: 5.8
-Requires PHP: 5.6.20
-
-Your visitors can fill & sign PDFs without leaving your website.
-
-== Description ==
-
-A lightweight plugin that automatically opens any PDF file with SimplePDF: allowing your visitors to fill and edit PDFs (merge, rotate, delete pages) without leaving your website.
-
-== Try it out! ==
-
-https://wordpress.simplepdf.co/
-
-== Features ==
-- Any .pdf link on your website is automatically opened with SimplePDF
-- Add text, checkboxes, pictures, signatures to PDFs
-- Fill fillable form
-- Add, delete, rotate, merge PDFs
-- Download the resulting PDF
-- Works on all browsers and mobile devices
-- Works with both Gutenber and the classic editor
-- Fully responsive
-
-== Screenshots ==
-
-1. SimplePDF Embed
-2. Admin settings of SimplePDF Embed
-3. Adding a PDF link using the Gutenber editor
-4. Adding a PDF link using the classic editor
-5. The PDF is opened on top of the existing website
-
-== Installation ==
-
-This section describes how to install the plugin and get it working.
-
-e.g.
-
-1. Install using the WordPress built-in Plugin installer, or Extract the zip file and drop the contents in the wp-content/plugins/ directory of your WordPress installation.
-2. Activate the plugin through the ‘Plugins’ menu in WordPress.
-3. Optional: Go to Settings > SimplePDF Embed and enter your "Company Identifier" (requires a SimplePDF account)
-4. Now any PDF links in your wordpress pages are opened using SimplePDF (you can disable this behaviour in the settings: see 3.)
-
-== Frequently Asked Questions ==
-= I have installed the plugin: what should I do next? =
-
-All the existing PDF files will now open with SimplePDF.
-
-If you wish to add new PDFs to your website, simply upload them to your Wordpress, copy the link and add it as a link to any page or paragraph in your wordpress.
-
-= The PDF is not opened with SimplePDF =
-
-Make sure that the link ends with ".pdf".
-
-Example: https://wordpress.simplepdf.co/wp-content/uploads/2024/01/example_wordpress.pdf
-
-= Do I need a SimplePDF account to use this plugin? =
-
-No: the plugin does not require an account to work: all features are available without any account.
-
-= What are the differences between using the plugin without and with a SimplePDF account? =
-
-Without an account, the plugin will open the PDF editor allowing your visitors to fill in documents and download them.
-
-With an account, the filled in documents will be automatically transmitted to you. You can configure to receive email notifications as well as use your own logo and loading.
-
-= Where should I submit my feature request or bug report? =
-
-Feel free to reach out to us at wordpress@simplepdf.com!
-
-= Where can I see the code? =
-
-Our Github repository contains both the code for the Wordpress plugin as well as the underlying @simplepdf/web-embed-pdf code upon which it relies:
-- [Wordpress plugin source code](https://github.com/SimplePDF/simplepdf-embed/tree/main/wordpress)
-- [@simplepdf/web-embed-pdf](https://github.com/SimplePDF/simplepdf-embed/tree/main/web)
-
-== Changelog ==
-
-= 1.0.0 =
-* Initial release
-= 1.1.0 =
-* Add support for SimplePDF form links
-= 1.1.1 =
-* Move to SimplePDF.com (from SimplePDF.eu)
-
diff --git a/wordpress/svn/tags/1.1.1/build/web-embed-pdf.js b/wordpress/svn/tags/1.1.1/build/web-embed-pdf.js
deleted file mode 100644
index a51f6917..00000000
--- a/wordpress/svn/tags/1.1.1/build/web-embed-pdf.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(n){"function"==typeof define&&define.amd?define(n):n()}((function(){"use strict";function n(n,e,t){if(t||2===arguments.length)for(var o,i=0,l=e.length;i\n .simplePDF_container {\n user-select: none;\n position: fixed;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n justify-content: center;\n\n height: 100vh;\n width: 100%;\n z-index: 999999;\n padding: 16px;\n top: 0;\n left: 0;\n background: rgba(0, 0, 0, 0.4);\n }\n\n .simplePDF_content {\n width: 100%;\n height: 100%;\n position: relative;\n box-sizing: border-box;\n }\n\n .simplePDF_iframeContainer {\n overflow: hidden;\n background: #f1f7ff;\n border-radius: 6px;\n width: 100%;\n height: 100%;\n }\n\n .simplePDF_iframe {\n border: none;\n border-radius: 6px;\n width: 100%;\n height: 100%;\n }\n\n .simplePDF_close {\n z-index: 1;\n position: absolute;\n top: -12px;\n right: -12px;\n\n border: none;\n padding: 6px;\n border-radius: 50px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n box-shadow: 0 1px 3px rgb(0 0 0 / 10%), 0 1px 2px rgb(0 0 0 / 24%);\n\n cursor: pointer;\n background: #ff5959;\n text-shadow: 1px 1px #243889;\n }\n\n .simplePDF_close svg {\n fill: white;\n width: 14px;\n height: 14px;\n }\n\n .simplePDF_close:hover {\n box-shadow: 0 2px 4px rgb(0 0 0 / 10%), 0 4px 4px rgb(0 0 0 / 24%);\n }\n \n
- `;
-
- log("Creating the modal", {
- companyIdentifier: getFromConfig("companyIdentifier"),
- editorURL,
- });
- document.body.style.overflow = "hidden";
- document.body.insertAdjacentHTML("beforebegin", modal);
-
- log("Attach close modal listener", {});
- document
- .getElementById("simplePDF_modal_close_button")
- ?.addEventListener("click", closeEditor);
- };
-
-const isAnchor = (
- element: HTMLAnchorElement | Element
-): element is HTMLAnchorElement => element.hasAttribute("href");
-
-export const handleAttachOnClick =
- (editorConfig: EditorConfig) =>
- ({ elements }: { elements: Element[] }) => {
- const openEditor = handleOpenEditor(editorConfig);
- editorConfig.log("Attaching listeners to anchors", {
- anchorsCount: elements.length,
- });
- elements.forEach((element) =>
- element.addEventListener("click", (e) => {
- e.preventDefault();
- openEditor({ href: isAnchor(element) ? element.href : null });
- })
- );
- };
diff --git a/wordpress/svn/tags/1.1.1/src/types.ts b/wordpress/svn/tags/1.1.1/src/types.ts
deleted file mode 100644
index 5baf5ea2..00000000
--- a/wordpress/svn/tags/1.1.1/src/types.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-export type Locale = "de" | "en" | "es" | "fr" | "it" | "pt";
-
-export type EditorConfig = {
- getFromConfig: (key: "companyIdentifier" | "locale") => string | null;
- log: (message: string, details: Record) => void;
-};
-
-export type SimplePDF = {
- disableInit?: boolean;
- companyIdentifier?: string;
- locale?: Locale;
- closeEditor: () => void;
- openEditor: (params: {
- href: string | null;
- context?: Record;
- }) => void;
-};
diff --git a/wordpress/svn/tags/1.1.2/README.txt b/wordpress/svn/tags/1.1.2/README.txt
deleted file mode 100644
index aac4a247..00000000
--- a/wordpress/svn/tags/1.1.2/README.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-=== SimplePDF Embed ===
-Contributors: bendersej
-Tags: pdf, embed pdf, fill & sign PDF, pdf editor
-Tested up to: 6.7.1
-Stable tag: 1.1.2
-License: GPLv2 or later
-License URI: https://www.gnu.org/licenses/gpl-2.0.html
-Requires at least: 5.8
-Requires PHP: 5.6.20
-
-Your visitors can fill & sign PDFs without leaving your website.
-
-== Description ==
-
-A lightweight plugin that automatically opens any PDF file with SimplePDF: allowing your visitors to fill and edit PDFs (merge, rotate, delete pages) without leaving your website.
-
-== Try it out! ==
-
-https://wordpress.simplepdf.co/
-
-== Features ==
-- Any .pdf link on your website is automatically opened with SimplePDF
-- Add text, checkboxes, pictures, signatures to PDFs
-- Fill fillable form
-- Add, delete, rotate, merge PDFs
-- Download the resulting PDF
-- Works on all browsers and mobile devices
-- Works with both Gutenber and the classic editor
-- Fully responsive
-
-== Screenshots ==
-
-1. SimplePDF Embed
-2. Admin settings of SimplePDF Embed
-3. Adding a PDF link using the Gutenber editor
-4. Adding a PDF link using the classic editor
-5. The PDF is opened on top of the existing website
-
-== Installation ==
-
-This section describes how to install the plugin and get it working.
-
-e.g.
-
-1. Install using the WordPress built-in Plugin installer, or Extract the zip file and drop the contents in the wp-content/plugins/ directory of your WordPress installation.
-2. Activate the plugin through the ‘Plugins’ menu in WordPress.
-3. Optional: Go to Settings > SimplePDF Embed and enter your "Company Identifier" (requires a SimplePDF account)
-4. Now any PDF links in your wordpress pages are opened using SimplePDF (you can disable this behaviour in the settings: see 3.)
-
-== Frequently Asked Questions ==
-= I have installed the plugin: what should I do next? =
-
-All the existing PDF files will now open with SimplePDF.
-
-If you wish to add new PDFs to your website, simply upload them to your Wordpress, copy the link and add it as a link to any page or paragraph in your wordpress.
-
-= The PDF is not opened with SimplePDF =
-
-Make sure that the link ends with ".pdf".
-
-Example: https://wordpress.simplepdf.co/wp-content/uploads/2024/01/example_wordpress.pdf
-
-= Do I need a SimplePDF account to use this plugin? =
-
-No: the plugin does not require an account to work: all features are available without any account.
-
-= What are the differences between using the plugin without and with a SimplePDF account? =
-
-Without an account, the plugin will open the PDF editor allowing your visitors to fill in documents and download them.
-
-With an account, the filled in documents will be automatically transmitted to you. You can configure to receive email notifications as well as use your own logo and loading animation.
-
-= Where should I submit my feature request or bug report? =
-
-Feel free to reach out to us at wordpress@simplepdf.com!
-
-= Where can I see the code? =
-
-Our Github repository contains both the code for the Wordpress plugin as well as the underlying @simplepdf/web-embed-pdf code upon which it relies:
-- [Wordpress plugin source code](https://github.com/SimplePDF/simplepdf-embed/tree/main/wordpress)
-- [@simplepdf/web-embed-pdf](https://github.com/SimplePDF/simplepdf-embed/tree/main/web)
-
-== Changelog ==
-
-= 1.0.0 =
-* Initial release
-= 1.1.0 =
-* Add support for SimplePDF form links
-= 1.1.1 =
-* Move to SimplePDF.com (from SimplePDF.eu)
-= 1.1.2 =
-* Plugin tested with the latest wordpress version (6.7.1)
-
diff --git a/wordpress/svn/tags/1.1.2/build/web-embed-pdf.js b/wordpress/svn/tags/1.1.2/build/web-embed-pdf.js
deleted file mode 100644
index b08be18f..00000000
--- a/wordpress/svn/tags/1.1.2/build/web-embed-pdf.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e,n,t,o){return new(t||(t=Promise))((function(i,r){function a(e){try{c(o.next(e))}catch(e){r(e)}}function l(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,l)}c((o=o.apply(e,n||[])).next())}))}function n(e,n){var t,o,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function l(l){return function(c){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,l[0]&&(a=0)),a;)try{if(t=1,o&&(i=2&l[0]?o.return:l[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,l[1])).done)return i;switch(o=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,o=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]\n .simplePDF_container {\n user-select: none;\n position: fixed;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n justify-content: center;\n\n height: 100vh;\n width: 100%;\n z-index: 2147483647;\n padding: 16px;\n top: 0;\n left: 0;\n background: rgba(0, 0, 0, 0.4);\n }\n\n .simplePDF_content {\n width: 100%;\n height: 100%;\n position: relative;\n box-sizing: border-box;\n }\n\n .simplePDF_iframeContainer {\n overflow: hidden;\n background: #f1f7ff;\n border-radius: 6px;\n width: 100%;\n height: 100%;\n }\n\n .simplePDF_iframe {\n border: none;\n border-radius: 6px;\n width: 100%;\n height: 100%;\n }\n\n .simplePDF_close {\n z-index: 1;\n position: absolute;\n top: -12px;\n right: -12px;\n\n border: none;\n padding: 6px;\n border-radius: 50px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n box-shadow: 0 1px 3px rgb(0 0 0 / 10%), 0 1px 2px rgb(0 0 0 / 24%);\n\n cursor: pointer;\n background: #ff5959;\n text-shadow: 1px 1px #243889;\n }\n\n .simplePDF_close svg {\n fill: white;\n width: 14px;\n height: 14px;\n }\n\n .simplePDF_close:hover {\n box-shadow: 0 2px 4px rgb(0 0 0 / 10%), 0 4px 4px rgb(0 0 0 / 24%);\n }\n \n
\n
\n \n
\n \n
\n
\n
\n ');if(l("Creating the modal",{companyIdentifier:a("companyIdentifier"),iframeURL:b}),document.body.style.overflow="hidden",document.body.insertAdjacentHTML("beforebegin",x),i){e(void 0,void 0,void 0,(function(){var e,t,o;return n(this,(function(n){switch(n.label){case 0:return[4,fetch(null!=i?i:"",{method:"GET",credentials:"same-origin"})];case 1:if(!(e=n.sent()).ok)throw new Error("Failed to retrieve the document: ".concat(JSON.stringify({status:e.status,href:i})));return[4,e.blob()];case 2:return t=n.sent(),o=new FileReader,[4,new Promise((function(e,n){o.onload=e,o.onerror=n,o.readAsDataURL(t)}))];case 3:return n.sent(),[2,o.result]}}))})).then((function(e){y({type:"LOAD_DOCUMENT",data:{data_url:e,name:i.substring(i.lastIndexOf("/")+1).split("?")[0]}})})).catch((function(){var e=p().iframe;if(!e)throw Error("Unexpected: SimplePDF iframe not instantiated");b.searchParams.delete("loadingPlaceholder"),b.searchParams.set("open",i),e.src=b.href}))}l("Attach close modal listener",{}),null===(o=document.getElementById(s))||void 0===o||o.addEventListener("click",g)}},x=function(e){return e.hasAttribute("href")},E=function(){return f.autoOpenListeners.size},F=function(){var e=E();if(e>0)f.log("Listeners already attached",{listenersCount:e});else{var n=t(t([],Array.from(document.getElementsByClassName("simplepdf")).filter((function(e){return!x(e)})),!0),Array.from(document.getElementsByTagName("a")).filter((function(e){return!e.classList.contains("exclude-simplepdf")&&(e.href.includes(".pdf")||e.classList.contains("simplepdf")||(n=e.href,/^https:\/\/[^.]+\.simplepdf\.com\/[^\/]+\/form\/.+/.test(n)));var n})),!0);f.log("Attaching listeners to anchors",{anchorsCount:n.length}),n.forEach((function(e){var n=function(n){n.preventDefault(),b({href:x(e)?e.href:null})};e.addEventListener("click",n),f.autoOpenListeners.set(e,n)}))}},P=function(){var e=E();0!==e?(f.log("Removing listeners",{listenersCount:e}),f.autoOpenListeners.forEach((function(e,n){n.removeEventListener("click",e)})),f.autoOpenListeners.clear()):f.log("No listeners to remove",{})};window.simplePDF=null!==(w=window.simplePDF)&&void 0!==w?w:{config:p,setConfig:m,openEditor:b,closeEditor:g,_ctx:{listenersMap:new Map}},"undefined"!=typeof document&&document.currentScript&&m({autoOpen:!0})}));
diff --git a/wordpress/svn/tags/1.1.2/simplepdf-embed.php b/wordpress/svn/tags/1.1.2/simplepdf-embed.php
deleted file mode 100644
index 6d16062d..00000000
--- a/wordpress/svn/tags/1.1.2/simplepdf-embed.php
+++ /dev/null
@@ -1,93 +0,0 @@
-';
- echo '
Unlock Exclusive Features - Get Your Company Identifier Now: Dive deeper at SimplePDF/embed
- `;
-
- log('Creating the modal', {
- companyIdentifier: getFromConfig('companyIdentifier'),
- iframeURL: iframeURL,
- });
- document.body.style.overflow = 'hidden';
- document.body.insertAdjacentHTML('beforebegin', modal);
-
- if (href) {
- const fetchedDocumentBlob = async (): Promise => {
- const response = await fetch(href ?? '', {
- method: 'GET',
- credentials: 'same-origin',
- });
-
- if (!response.ok) {
- throw new Error(
- `Failed to retrieve the document: ${JSON.stringify({
- status: response.status,
- href,
- })}`,
- );
- }
-
- const blob = await response.blob();
-
- const reader = new FileReader();
- await new Promise((resolve, reject) => {
- reader.onload = resolve;
- reader.onerror = reject;
- reader.readAsDataURL(blob);
- });
-
- return reader.result as string;
- };
-
- fetchedDocumentBlob()
- .then((dataURL) => {
- const [documentName] = href.substring(href.lastIndexOf('/') + 1).split('?');
- sendEventToIframe({ type: 'LOAD_DOCUMENT', data: { data_url: dataURL, name: documentName } });
- })
- .catch(() => {
- const iframe = getEditor().iframe;
- if (!iframe) {
- throw Error(UNEXPECTED_ERROR_IFRAME_NOT_INSTANTIATED);
- }
-
- iframeURL.searchParams.delete('loadingPlaceholder');
- iframeURL.searchParams.set('open', href);
-
- iframe.src = iframeURL.href;
- });
- }
-
- log('Attach close modal listener', {});
- document.getElementById(MODAL_CLOSE_BUTTON_ID)?.addEventListener('click', closeEditor);
-};
-
-const isAnchor = (element: HTMLAnchorElement | Element): element is HTMLAnchorElement => element.hasAttribute('href');
-
-const getListenersCount = (): number => editorContext.autoOpenListeners.size;
-
-const enableAutoOpen = () => {
- const listenersCount = getListenersCount();
- if (listenersCount > 0) {
- editorContext.log('Listeners already attached', { listenersCount });
- return;
- }
-
- const elements = getSimplePDFElements();
-
- editorContext.log('Attaching listeners to anchors', {
- anchorsCount: elements.length,
- });
-
- elements.forEach((element) => {
- const handler: EventListenerOrEventListenerObject = (e) => {
- e.preventDefault();
- openEditor({ href: isAnchor(element) ? element.href : null });
- };
-
- element.addEventListener('click', handler);
-
- editorContext.autoOpenListeners.set(element, handler);
- });
-};
-
-const disableAutoOpen = () => {
- const listenersCount = getListenersCount();
-
- if (listenersCount === 0) {
- editorContext.log('No listeners to remove', {});
- return;
- }
-
- editorContext.log('Removing listeners', { listenersCount });
-
- editorContext.autoOpenListeners.forEach((handler, element) => {
- element.removeEventListener('click', handler);
- });
- editorContext.autoOpenListeners.clear();
-};
diff --git a/wordpress/svn/tags/1.1.2/src/types.ts b/wordpress/svn/tags/1.1.2/src/types.ts
deleted file mode 100644
index a2c3f264..00000000
--- a/wordpress/svn/tags/1.1.2/src/types.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-export type Locale = 'de' | 'en' | 'es' | 'fr' | 'it' | 'pt';
-
-export type IncomingIframeEvent =
- | { type: 'DOCUMENT_LOADED'; data: { document_id: string } }
- | { type: 'SUBMISSION_SENT'; data: { submission_id: string } }
- | { type: 'EDITOR_READY' };
-
-export type OutgoingIframeEvent = {
- type: 'LOAD_DOCUMENT';
- data: { data_url: string; name: string };
-};
-
-export type EditorContext = {
- getFromConfig: (key: 'companyIdentifier' | 'locale') => string | null;
- log: (message: string, details: Record) => void;
- autoOpenListeners: Map;
- outgoingEventsQueue: OutgoingIframeEvent[];
- getEditor: () => {
- iframe: HTMLIFrameElement | null;
- modal: HTMLDivElement | null;
- styles: HTMLStyleElement | null;
- };
- isIframeReady: boolean;
-};
-
-export type EditorConfig = {
- companyIdentifier: string;
- locale: Locale;
- autoOpen: boolean;
-};
-
-export type ConfigSetter = (params: Partial) => EditorConfig;
-
-export type SimplePDF = {
- config: EditorConfig;
- setConfig: ConfigSetter;
- closeEditor: () => void;
- openEditor: (params: { href: string | null; context?: Record }) => void;
- _ctx: {
- listenersMap: Map;
- };
-};
diff --git a/wordpress/svn/tags/1.2.0/README.txt b/wordpress/svn/tags/1.2.0/README.txt
deleted file mode 100644
index 6106a04f..00000000
--- a/wordpress/svn/tags/1.2.0/README.txt
+++ /dev/null
@@ -1,165 +0,0 @@
-=== SimplePDF Embed ===
-Contributors: bendersej
-Tags: pdf, pdf form, fill pdf, sign pdf, form submissions
-Tested up to: 7.1.2
-Stable tag: 1.2.0
-License: GPLv2 or later
-License URI: https://www.gnu.org/licenses/gpl-2.0.html
-Requires at least: 5.8
-Requires PHP: 5.6.20
-
-Visitors fill and sign your PDFs right on your site. With a SimplePDF account, every filled PDF comes back to you, automatically.
-
-== Description ==
-
-You put a PDF form on your site. Visitors download it, print it, fill it, scan it and email it back, if they remember. Then you retype the answers.
-
-SimplePDF Embed turns every PDF link on your site into a form your visitors fill and sign right on the page. Nothing to rebuild: link a PDF the way you always have.
-
-**Get every filled PDF back, automatically**
-
-With a SimplePDF account, visitors click Submit and the filled PDF lands in your dashboard. No chasing.
-
-* Email alerts on every submission
-* Webhooks to send filled PDFs to your own systems
-* Export the form data to CSV or Excel
-* Required fields, so forms come back complete
-* Your logo in the editor (Pro and above)
-* Filled PDFs saved to your own storage (S3 or Azure Blob Storage on Pro, SharePoint on Premium)
-
-Every plan starts with a 7-day free trial: [see the plans](https://simplepdf.com/pricing?ref=wordpress).
-
-**Free, without an account**
-
-Visitors fill and sign your PDFs, then download them. The document is filled in their browser.
-
-**Works the way your site already works**
-
-* Every PDF link opens in SimplePDF by default, whatever the extension case (`Consent.PDF`) or query string (`form.pdf?ver=2`)
-* Or limit it to the pages and posts you pick, and try it on a draft before going live
-* The settings page lists the PDF links on your pages and posts, and where each one opens
-* Add the `exclude-simplepdf` class to a link to keep the browser's own PDF viewer
-* Visitors who browse with an AI assistant (ChatGPT's browser, Chrome with WebMCP) can ask it to fill the form for them, and check every answer before they submit. One checkbox turns it off.
-
-**What visitors can do in the editor**
-
-* Fill fillable forms, or add text, checkboxes, pictures and signatures to any PDF
-* Add, delete, rotate and merge pages
-* Works on desktop and mobile, in every modern browser
-* Works with the block editor and the classic editor
-
-== Try it out ==
-
-https://wordpress.simplepdf.co/
-
-== Screenshots ==
-
-1. Filled PDFs land in your SimplePDF dashboard
-2. The settings page: the PDF links on your site and where each one opens
-3. Every PDF link on your pages and posts, and where each one opens
-4. Where it runs: everywhere, or only on the pages and posts you pick, and whether AI assistants can fill your forms
-5. What a SimplePDF account adds
-6. Adding a PDF link using the block editor
-7. Adding a PDF link using the classic editor
-8. The PDF opens on top of your page
-
-== Installation ==
-
-1. Install the plugin from Plugins > Add New, or upload the zip file to `wp-content/plugins/`.
-2. Activate it from the Plugins menu.
-3. Go to Settings > SimplePDF Embed: it lists the PDF links on your site and where each one opens.
-4. Optional: to get the filled PDFs back, enter your company identifier (for `acme.simplepdf.com`, enter `acme`).
-
-== Frequently Asked Questions ==
-
-= What changes with a SimplePDF account? =
-
-Without an account, visitors fill your PDF and download it. It is then up to them to send it to you.
-
-With an account, they click Submit and the filled PDF lands in your dashboard, with an email alert or a webhook if you want one. You can export the answers to CSV or Excel, make fields required, and add your logo. [See the plans](https://simplepdf.com/pricing?ref=wordpress).
-
-= Where do the filled PDFs go? =
-
-Without an account, the visitor downloads the filled PDF: it is not sent to SimplePDF.
-
-With an account, submitted PDFs are stored in your SimplePDF dashboard, or in your own storage (S3, Azure Blob Storage or SharePoint) on the plans that include it.
-
-= Do I need a SimplePDF account? =
-
-No. Visitors can fill, sign and download PDFs without one. An account is what brings the filled PDFs back to you.
-
-= Can I try it on one page first? =
-
-Yes. In Settings > SimplePDF Embed, set "Where it runs" to "Only on pages and posts I pick" and pick a draft or private page. Every other PDF link keeps opening in the browser.
-
-= I installed the plugin: what next? =
-
-Every PDF link on your site now opens in SimplePDF. Open Settings > SimplePDF Embed to see which pages link a PDF and where each link opens. To add a new form, upload the PDF to your Media Library and link to it from any page or post.
-
-= A PDF link does not open in SimplePDF =
-
-Settings > SimplePDF Embed lists the PDF links on your pages and posts, with the reason next to any link that opens in the browser. The usual causes:
-
-* The link does not point to a `.pdf` file
-* The link has the `exclude-simplepdf` class
-* The page is not picked in "Where it runs"
-
-Links added by a page builder, a menu or a widget open the same way but are not listed.
-
-= How do I keep one PDF in the browser's viewer? =
-
-Add the `exclude-simplepdf` class to that link.
-
-= Can AI assistants fill my forms? =
-
-Yes, when a visitor browses with one (ChatGPT's browser, Chrome with WebMCP). The assistant fills the form in the editor on your page, where the visitor checks every answer, and required and read-only fields still apply. To turn it off, untick "Give AI assistants direct access to your forms" in Settings > SimplePDF Embed. Assistants that click and type like a person can still fill your forms, as on any website.
-
-= Where do I send a feature request or a bug report? =
-
-Email us at wordpress@simplepdf.com.
-
-= Where can I see the code? =
-
-The plugin and the script it bundles are open source:
-
-* [WordPress plugin](https://github.com/SimplePDF/simplepdf-embed/tree/main/wordpress)
-* [@simplepdf/web-embed-pdf](https://github.com/SimplePDF/simplepdf-embed/tree/main/web)
-
-== External services ==
-
-This plugin connects to SimplePDF (https://simplepdf.com) in two ways.
-
-**The PDF editor.** When a visitor clicks a PDF link, the plugin opens the SimplePDF editor from `https://.simplepdf.com` (`wordpress.simplepdf.com` without an account) in a frame on your page. The visitor's browser loads the PDF and hands it to the editor (or passes the PDF's address when it cannot load it), and the PDF is filled in the browser. When the visitor submits a filled PDF to your SimplePDF account, the filled PDF is sent to SimplePDF, or to your own storage if you set one up. Nothing is sent before a visitor clicks a PDF link.
-
-**The account check.** On the plugin's settings page only, the plugin sends one request to `https://.simplepdf.com` to check that the account exists. It sends the plugin's version and nothing about your site or your visitors, and the result is cached for up to an hour.
-
-* [Terms of service](https://simplepdf.com/terms-of-service)
-* [Privacy policy](https://simplepdf.com/privacy-policy)
-
-== Changelog ==
-
-= 1.2.0 =
-* New settings page: see every PDF link on your pages and posts, and where each one opens
-* Choose where it runs: everywhere, or only on the pages and posts you pick, drafts included
-* Your company identifier is checked, so a typo shows up right away
-* PDF links open in SimplePDF whatever the extension case (`Consent.PDF`), query string or `#page` fragment
-* AI assistants in your visitors' browser can now fill your forms (WebMCP). This is on after the update: to turn it off, untick "Give AI assistants direct access to your forms" in Settings > SimplePDF Embed
-* Uninstalling the plugin removes its settings
-* Update web-embed-pdf to 1.9.0
-* Plugin tested with the latest WordPress version (7.1.2)
-
-= 1.1.3 =
-* Update web-embed-pdf to 1.8.4
-* Plugin tested with the latest WordPress version (6.9.4)
-
-= 1.1.2 =
-* Plugin tested with the latest WordPress version (6.7.1)
-
-= 1.1.1 =
-* Move to SimplePDF.com (from SimplePDF.eu)
-
-= 1.1.0 =
-* Add support for SimplePDF form links
-
-= 1.0.0 =
-* Initial release
diff --git a/wordpress/svn/tags/1.2.0/assets/icon-128x128.png b/wordpress/svn/tags/1.2.0/assets/icon-128x128.png
deleted file mode 100644
index 9692f213..00000000
Binary files a/wordpress/svn/tags/1.2.0/assets/icon-128x128.png and /dev/null differ
diff --git a/wordpress/svn/tags/1.2.0/build/web-embed-pdf.js b/wordpress/svn/tags/1.2.0/build/web-embed-pdf.js
deleted file mode 100644
index c1292f8b..00000000
--- a/wordpress/svn/tags/1.2.0/build/web-embed-pdf.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{const e=[];return"modelContext"in document&&e.push(document.modelContext),"modelContext"in navigator&&e.push(navigator.modelContext),e},c=["createField","deleteFields","deletePages","detectFields","download","focusField","getAnnotatedPage","getDocumentContent","getFields","goTo","loadDocument","movePage","rotatePage","selectTool","setFieldValue","submit"],u=e=>e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`),p=e=>e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),m=(e,t)=>{if(Array.isArray(e)){return e.map(e=>m(e,t))}if((e=>{if("object"!=typeof e||null===e||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t})(e)){const n={};for(const[o,i]of Object.entries(e)){const e=t(o);"__proto__"!==e&&(n[e]=m(i,t))}return n}return e},f={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},g=e=>{const t=t=>(n,o)=>{try{Promise.resolve(e[t](n,o)).catch(()=>{})}catch{}};return{debug:t("debug"),info:t("info"),warn:t("warn"),error:t("error")}},h=e=>{if("object"!=typeof e||null===e||!("success"in e))return!1;if(!0===e.success)return!0;if(!1===e.success){if(!("error"in e))return!1;const t=e.error;return"object"==typeof t&&null!==t&&("code"in t&&"message"in t&&("string"==typeof t.code&&"string"==typeof t.message&&/^(bad_request|forbidden|unexpected):/.test(t.code)))}return!1},b=6e4,y=()=>"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():`req_${Math.random().toString(36).slice(2)}_${Date.now().toString(36)}`,w=({getIframe:e,editorOrigin:t,logger:n=f,onDispose:o,onStateChange:i,webMCP:r})=>{const a=g(n),s=new Map;let d={kind:"booting"},c=null,w=!1;const v=e=>a.error("iframe.listener_threw",{message:e instanceof Error?e.message:String(e)}),_=()=>{const e=new Set;return{subscribe:t=>(e.add(t),()=>e.delete(t)),emit:t=>{for(const n of e)try{n(t)}catch(e){v(e)}},clear:()=>e.clear()}},E={EDITOR_READY:_(),DOCUMENT_LOADED:_(),PAGE_FOCUSED:_(),SUBMISSION_SENT:_()},D=new AbortController,T=(e=>{if(void 0===e)return{enabled:!1};switch(e.enabled){case!1:return{enabled:!1};case!0:return{enabled:!0,exclude:e.exclude??[]};default:return{enabled:!1}}})(r);let x=!1;const S=e=>{d=e,i?.(e),"booting"!==e.kind&&T.enabled&&!x&&(0!==l().length?(x=!0,Promise.resolve().then(function(){return le}).then(({registerWebMCPTools:e})=>{e({dispatch:(e,t)=>F(e,t,"wire"),exclude:T.exclude,signal:D.signal,logger:a})||(x=!1)}).catch(e=>{x=!1,a.error("webmcp.load_failed",{message:e instanceof Error?e.message:String(e)})})):a.info("webmcp.unavailable",{reason:"no_model_context"}))},F=(n,o,i)=>new Promise(r=>{if(w)return void r({success:!1,error:{code:"unexpected:bridge_disposed",message:"Editor bridge was disposed"}});const d=e();if(null===d||null===d.contentWindow)return void r({success:!1,error:{code:"unexpected:iframe_not_mounted",message:"Editor iframe is not mounted"}});const l=y(),c=Date.now();a.info("iframe.request_sent",{request_id:l,type:n,timeout_ms:b});const p=setTimeout(()=>{s.delete(l),a.error("iframe.request_timed_out",{request_id:l,type:n,elapsed_ms:Date.now()-c}),r({success:!1,error:{code:"unexpected:timeout",message:`Editor request '${n}' timed out after 60000ms`}})},b);s.set(l,{resolve:e=>r((e=>e.success?{success:!0,data:e.data}:e)(e)),resultShape:i,wireType:n,startedAtMs:c,timeoutId:p});try{const e=JSON.stringify({type:n,request_id:l,data:(f=o,m(f,u))});d.contentWindow.postMessage(e,t),a.debug("iframe.request_posted",{request_id:l,type:n,char_count:e.length})}catch(e){clearTimeout(p),s.delete(l),r({success:!1,error:{code:"unexpected:unknown",message:`Failed to post '${n}': ${e instanceof Error?e.message:String(e)}`}})}var f}),L=(e,t)=>F(e,t,"sdk"),P=new Set;let O=null;const U=()=>{null!==O&&(clearInterval(O),O=null),P.clear()},C=e=>{switch(d.kind){case"documentLoaded":return void("editor_ready_event"===e&&S({kind:"editorReady"}));case"booting":return void S({kind:"editorReady"});case"editorReady":return}};let R=null;const A=()=>{null!==R&&(clearTimeout(R),R=null)},I=()=>{"documentLoaded"!==d.kind&&(A(),U(),S({kind:"documentLoaded",documentId:c}))},M=()=>{const n=e();if(null===n||null===n.contentWindow)return;const o=y();try{n.contentWindow.postMessage(JSON.stringify({type:"GET_FIELDS",request_id:o,data:{}}),t),P.add(o)}catch{}};R=setTimeout(()=>{R=null,"booting"===d.kind&&a.warn("editor.ready_fallback_timeout",{timeout_ms:3e4}),C("fallback"),U()},3e4),M(),O=setInterval(M,500);const j=n=>{if(n.origin!==t)return;const o=e();if(null===o||n.source!==o.contentWindow)return;const i=(()=>{if("string"!=typeof n.data)return null;try{const e=JSON.parse(n.data);return"object"==typeof e&&null!==e?e:null}catch{return null}})();if(null===i)return;if(a.debug("iframe.message_received",{type:i.type,request_id:i.request_id}),"EDITOR_READY"===i.type)return C("editor_ready_event"),void E.EDITOR_READY.emit({});if("DOCUMENT_LOADED"===i.type){const e=i.data?.document_id;return"string"==typeof e&&""!==e&&(E.DOCUMENT_LOADED.emit({document_id:e}),c!==e&&(c=e,"documentLoaded"===d.kind))?void S({kind:"documentLoaded",documentId:c}):void I()}if("SUBMISSION_SENT"===i.type){const e=(e=>{const t=e?.document_id,n=e?.submission_id;return"string"==typeof t&&"string"==typeof n?{document_id:t,submission_id:n}:null})(i.data);return void(null!==e&&E.SUBMISSION_SENT.emit(e))}if("PAGE_FOCUSED"===i.type){const e=(e=>{const t=e?.previous_page,n=e?.current_page,o=e?.total_pages;return null!==t&&"number"!=typeof t||"number"!=typeof n||"number"!=typeof o?null:{previous_page:t,current_page:n,total_pages:o}})(i.data);return void(null!==e&&E.PAGE_FOCUSED.emit(e))}if("REQUEST_RESULT"!==i.type)return;const r="string"==typeof i.data?.request_id?i.data.request_id:null;if(null===r)return;if(P.has(r)){P.delete(r),C("probe");const e=i.data?.result;return void(h(e)&&!0===e.success&&I())}const l=s.get(r);if(void 0===l)return void a.debug("iframe.request_unmatched",{request_id:r});s.delete(r),clearTimeout(l.timeoutId);const u=i.data?.result,f=(()=>{if(!h(u))return{success:!1,error:{code:"unexpected:malformed_result",message:"REQUEST_RESULT payload had no valid result"}};if(!0===u.success&&!("data"in u))return{success:!0,data:null};switch(l.resultShape){case"wire":return u;case"sdk":{const e=m(u,p);return h(e)?e:{success:!1,error:{code:"unexpected:malformed_result",message:"REQUEST_RESULT payload had no valid result"}}}default:return l.resultShape,u}})();a.info("iframe.request_received",{request_id:r,type:l.wireType,elapsed_ms:Date.now()-l.startedAtMs,success:f.success}),l.resolve(f)};window.addEventListener("message",j);return{actions:{createField:e=>L("CREATE_FIELD",e),deleteFields:e=>L("DELETE_FIELDS",e??{}),deletePages:e=>L("DELETE_PAGES",e),detectFields:()=>L("DETECT_FIELDS",{}),download:()=>L("DOWNLOAD",{}),focusField:e=>L("FOCUS_FIELD",e),getAnnotatedPage:e=>L("GET_ANNOTATED_PAGE",e),getDocumentContent:e=>L("GET_DOCUMENT_CONTENT",e??{}),getFields:()=>L("GET_FIELDS",{}),goTo:e=>L("GO_TO",e),loadDocument:e=>L("LOAD_DOCUMENT",e),movePage:e=>L("MOVE_PAGE",e),rotatePage:e=>L("ROTATE_PAGE",e),selectTool:e=>L("SELECT_TOOL",e),setFieldValue:e=>L("SET_FIELD_VALUE",e),submit:e=>L("SUBMIT",e)},events:{on:(e,t)=>E[e].subscribe(t)},lifecycle:{dispose:()=>{if(!w){w=!0,D.abort(),window.removeEventListener("message",j),A(),U();for(const{timeoutId:e,resolve:t}of s.values())clearTimeout(e),t({success:!1,error:{code:"unexpected:bridge_disposed",message:"Editor bridge was disposed"}});s.clear();for(const e of Object.values(E))e.clear();o?.()}}}}},v=class extends Error{code;constructor(e,t){super(t),this.name="EmbedConfigError",this.code=e}},_=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,E=52428800,D=e=>e.includes(".nil")||e.includes("localhost"),T=e=>e instanceof File?"a File":e instanceof Blob?"a Blob":null===e?"null":Array.isArray(e)?"an array":"a "+typeof e,x=new Set(c),S=new Set(Object.keys({enabled:!0,exclude:!0})),F=e=>{if(void 0===e)return;if("object"!=typeof e||null===e||Array.isArray(e))throw new v("invalid_document",`document must be an object with one of url / dataUrl / file (received ${T(e)}).`);const t=["url"in e?"url":null,"dataUrl"in e?"dataUrl":null,"file"in e?"file":null].filter(e=>null!==e);if(1!==t.length){const e=0===t.length?"none":t.join(" + ");throw new v("invalid_document",`document needs exactly one source: { url: string }, { dataUrl: string }, or { file: Blob } (got ${e}).`)}"url"in e?(e=>{if("string"!=typeof e){const t=e instanceof Blob?" To embed a Blob or File, use document: { file } instead.":"";throw new v("invalid_document",`document.url must be a string (received ${T(e)}).${t}`)}const t=(()=>{try{return new URL(e)}catch{return null}})();if(null===t)throw new v("invalid_document",`document.url must be a valid absolute URL (received '${e}').`);if("data:"===t.protocol)throw new v("invalid_document","document.url is a data URL. Use document: { dataUrl } instead.");if("blob:"===t.protocol)throw new v("invalid_document","document.url is a blob: URL. Pass the Blob itself via document: { file } instead.");if("https:"!==t.protocol&&"http:"!==t.protocol)throw new v("invalid_document",`document.url must be an http(s) URL (received '${e}').`)})(e.url):"dataUrl"in e?(e=>{if("string"!=typeof e){const t=e instanceof Blob?" To embed a Blob or File, use document: { file } instead.":"";throw new v("invalid_document",`document.dataUrl must be a string (received ${T(e)}).${t}`)}if(/^https?:\/\//i.test(e))throw new v("invalid_document","document.dataUrl looks like an http(s) URL. Use document: { url } instead.");if(!e.startsWith("data:"))throw new v("invalid_document","document.dataUrl must be a data URL (it should start with 'data:').")})(e.dataUrl):"file"in e&&(e=>{if(!(e instanceof Blob)){const t="string"==typeof e?" For a URL or a data URL, use document: { url } or document: { dataUrl }.":"";throw new v("invalid_document",`document.file must be a Blob or File (received ${T(e)}).${t}`)}})(e.file)},L=/^\/(?:[a-z]{2}\/)?documents\/[^/]+\/?$/,P=({editorOrigin:e,locale:t,encodedContext:n,hasDocumentUrl:o,openFallbackUrl:i})=>{const r=new URL(`/${t??"en"}/editor`,e);return null!==n&&r.searchParams.set("context",n),o&&r.searchParams.set("loadingPlaceholder","true"),null!==i&&r.searchParams.set("open",i),r.href},O=e=>new Promise((t,n)=>{const o=new FileReader;o.onload=()=>t("string"==typeof o.result?o.result:""),o.onerror=()=>n(o.error??new Error("Failed to read document")),o.readAsDataURL(e)}),U=async(e,t)=>{try{const n=await fetch(e,{method:"GET",credentials:"same-origin",signal:t});if(!n.ok)return await(n.body?.cancel().catch(()=>{})),null;const o=n.headers.get("content-length");if(null!==o&&Number(o)>E)return await(n.body?.cancel().catch(()=>{})),null;const i=n.body;if(null===i)return null;const r=await(async(e,t)=>{const n=e.getReader(),o=[];let i=0;for(;;){const{done:e,value:r}=await n.read();if(e)return o;if(i+=r.byteLength,i>t)return await n.cancel(),null;o.push(new Uint8Array(r))}})(i,E);if(null===r)return null;const a=n.headers.get("content-type")??"application/pdf";return await O(new Blob(r,{type:a}))}catch{return null}},C=()=>{let e=()=>{};const t=new Promise(t=>{e=t});return{onStateChange:t=>{"booting"!==t.kind&&e()},whenReady:e=>{t.then(e)}}},R=e=>{const{embed:t,embedDocument:n,signal:o,safeLogger:i,onHostFetchFail:r,whenReady:a}=e,s=((e,t)=>"dataUrl"in e?Promise.resolve(e.dataUrl):"file"in e?O(e.file).catch(()=>null):U(e.url,t))(n,o),d=(e=>void 0!==e.name?e.name:"url"in e?(e=>{const[t]=e.substring(e.lastIndexOf("/")+1).split("?");return t??""})(e.url):"file"in e&&e.file instanceof File?e.file.name:void 0)(n);a(()=>{(async()=>{const e=await s;if(o.aborted)return;if(null===e)return void 0!==r?void r():void i.error("load_document_failed",{code:"unexpected:unknown",message:"could not resolve the document to a data URL; ?open fallback is unavailable on an attached iframe"});const a=await t.actions.loadDocument({dataUrl:e,name:d,page:n.page});a.success||i.error("load_document_failed",{code:a.error.code,message:a.error.message})})()})},A=(e,t,{document:n,locale:o,context:i,iframeAttrs:r,logger:a=f,webMCP:s},d)=>{const l=void 0!==n&&"url"in n,c=(e=>{if(void 0===e)return null;try{return encodeURIComponent(btoa(JSON.stringify(e)))}catch{return null}})(i),u=document.createElement("iframe");if(u.title=r?.title??"SimplePDF",u.setAttribute("referrerPolicy","no-referrer-when-downgrade"),u.setAttribute("allow",r?.allow??"clipboard-read; clipboard-write; web-share"),void 0!==r?.sandbox){u.setAttribute("sandbox",r.sandbox);const e=r.sandbox.split(/\s+/).map(e=>e.toLowerCase());e.includes("allow-downloads")||console.warn('[SimplePDF] The iframe "sandbox" attribute is missing "allow-downloads": the editor\'s Download button will be silently blocked by the browser. Add "allow-downloads" to your sandbox tokens.'),e.includes("allow-modals")||console.warn('[SimplePDF] The iframe "sandbox" attribute is missing "allow-modals": the editor\'s "Print document" action will be silently ignored by the browser. Add "allow-modals" to your sandbox tokens.')}void 0!==r?.className&&(u.className=r.className),u.style.border="0",u.style.width="100%",u.style.height="100%",void 0!==r?.style&&Object.assign(u.style,r.style),u.src=null!==d?(()=>{const e=new URL(d.url.href);return null!==c&&e.searchParams.set("context",c),e.href})():P({editorOrigin:t,locale:o,encodedContext:c,hasDocumentUrl:l,openFallbackUrl:null}),e.appendChild(u);const p=new AbortController,m=g(a),h=C(),b=w({getIframe:()=>u,editorOrigin:t,logger:m,onStateChange:h.onStateChange,onDispose:()=>{p.abort(),u.remove()},webMCP:s});return void 0!==n&&null===d&&R({embed:b,embedDocument:n,signal:p.signal,safeLogger:m,whenReady:h.whenReady,onHostFetchFail:()=>{"url"in n&&(u.src=P({editorOrigin:t,locale:o,encodedContext:c,hasDocumentUrl:!1,openFallbackUrl:n.url}))}}),b},I=e=>{if("object"!=typeof e||!e)throw new v("invalid_config",`createEmbed expects a config object { target, companyIdentifier, ... } (received ${T(e)}).`);if((e=>{if("string"!=typeof e||""===e)throw new v("invalid_company_identifier","companyIdentifier is required: the .simplepdf.com subdomain from your SimplePDF account.");if(!_.test(e))throw new v("invalid_company_identifier",`companyIdentifier '${e}' is not a valid DNS label (lowercase letters, digits, internal hyphens)`)})(e.companyIdentifier),void 0!==e.baseDomain&&"string"!=typeof e.baseDomain)throw new v("invalid_config",`baseDomain must be a string (received ${T(e.baseDomain)}).`);F(e.document),(e=>{if(void 0===e)return;const t=()=>new v("invalid_config",`webMCP must be { enabled: false } or { enabled: true, exclude?: MethodName[] } (received ${T(e)}).`);if("object"!=typeof e||null===e||!("enabled"in e)||"boolean"!=typeof e.enabled)throw t();const n=Object.keys(e).filter(e=>!S.has(e));if(n.length>0)throw new v("invalid_config",`webMCP has no option ${n.join(", ")} (known: ${[...S].join(", ")}).`);const o="exclude"in e?e.exclude:void 0;if(void 0===o)return;if(!Array.isArray(o))throw t();const i=o;if(!i.every(e=>"string"==typeof e))throw t();const r=i.filter(e=>!x.has(e));if(r.length>0)throw new v("invalid_config",`webMCP.exclude names no tool: ${r.join(", ")} (known: ${c.join(", ")}).`)})(e.webMCP);const t=e.baseDomain??"simplepdf.com",n=((e,t)=>{if(void 0===e||!("url"in e))return null;const n=(()=>{try{return new URL(e.url)}catch{return null}})();if(null===n)return null;const o=D(t);return("https:"===n.protocol||o&&"http:"===n.protocol)&&(()=>{if(!n.host.endsWith(`.${t}`))return!1;const e=n.host.slice(0,n.host.length-t.length-1);return e.length>0&&!e.includes(".")})()&&L.test(n.pathname)?{url:n,origin:n.origin}:null})(e.document,t),o=n?.origin??(({companyIdentifier:e,baseDomain:t})=>`${D(t)?"http":"https"}://${e}.${t}`)({companyIdentifier:e.companyIdentifier,baseDomain:t}),i=(e=>{if(e instanceof HTMLElement)return e;if("string"!=typeof e)throw new v("invalid_target",`target must be a CSS selector or an HTMLElement (received ${T(e)}).`);const t=document.querySelector(e);if(null===t||!(t instanceof HTMLElement))throw new v("invalid_target",`createEmbed target '${e}' did not match an element`);return t})(e.target);return i instanceof HTMLIFrameElement?((e,t,{document:n,logger:o=f,webMCP:i},r)=>{if(null!==r)throw new v("invalid_document","a SimplePDF documents URL loads by navigating the iframe, which createEmbed only does when it creates one (a container target). For an existing