From a2780227489e619f64a7bdb8e56c978d8fbdaabe Mon Sep 17 00:00:00 2001 From: Tolotsoa Date: Tue, 2 Sep 2025 20:49:17 +0300 Subject: [PATCH] feat generate recap devis --- gestion/appinfo/routes.php | 6 +- gestion/js/apercusTousDevis.app.js | 2 +- gestion/js/devis.app.js | 2 +- gestion/lib/Controller/PageController.php | 6489 +++++++++-------- gestion/lib/Db/Bdd.php | 2364 +++--- .../lib/Service/Devis/DevisDataProcessor.php | 173 + .../lib/Service/Devis/DevisPdfGenerator.php | 144 + .../Service/Devis/DevisPdfLayoutManager.php | 155 + .../Service/Devis/DevisPdfTableRenderer.php | 176 + .../lib/Service/Devis/DevisRecapService.php | 89 + gestion/lib/Service/Devis/PageContext.php | 32 + gestion/lib/Service/InvoicePdfService.php | 230 +- gestion/src/js/apercusTousDevis.js | 2 +- gestion/src/js/listener/devisListener.js | 101 +- gestion/src/js/modules/ajaxRequest.mjs | 1 + .../templates/content/apercustousdevis.php | 219 +- 16 files changed, 5938 insertions(+), 4247 deletions(-) create mode 100644 gestion/lib/Service/Devis/DevisDataProcessor.php create mode 100644 gestion/lib/Service/Devis/DevisPdfGenerator.php create mode 100644 gestion/lib/Service/Devis/DevisPdfLayoutManager.php create mode 100644 gestion/lib/Service/Devis/DevisPdfTableRenderer.php create mode 100644 gestion/lib/Service/Devis/DevisRecapService.php create mode 100644 gestion/lib/Service/Devis/PageContext.php diff --git a/gestion/appinfo/routes.php b/gestion/appinfo/routes.php index 7095824..5b46e6b 100644 --- a/gestion/appinfo/routes.php +++ b/gestion/appinfo/routes.php @@ -1,4 +1,5 @@ [ ['name' => 'page#index', 'url' => '/', 'verb' => 'GET'], @@ -72,6 +73,7 @@ return [ ['name' => 'page#exportDevisToFacture', 'url' => '/exportDevisToFacture', 'verb' => 'POST'], ['name' => 'page#exportFactureToPdf', 'url' => '/facture/exportFactureToPdf', 'verb' => 'POST'], ['name' => 'page#exportFactureByClientAndMonthYearToPdf', 'url' => '/facture/exportFactureByClientAndMonthYearToPdf', 'verb' => 'POST'], + ['name' => 'page#exportDevisRecap', 'url' => '/devis/exportDevisRecap', 'verb' => 'POST'], ['name' => 'page#getProduits', 'url' => '/getProduits', 'verb' => 'PROPFIND'], ['name' => 'page#getProduitsById', 'url' => '/getProduitsById', 'verb' => 'POST'], @@ -104,7 +106,7 @@ return [ ['name' => 'page#getProduits', 'url' => '/getProduits', 'verb' => 'PROPFIND'], ['name' => 'page#getProduitsById', 'url' => '/getProduitsById', 'verb' => 'POST'], ['name' => 'page#insertProduit', 'url' => '/produit/insert', 'verb' => 'POST'], - + // bibliotheque ['name' => 'page#getBibliotheques', 'url' => '/getBibliotheques', 'verb' => 'PROPFIND'], ['name' => 'page#insertBibliotheque', 'url' => '/bibliotheque/insert', 'verb' => 'POST'], @@ -121,7 +123,7 @@ return [ ['name' => 'page#savePDF', 'url' => '/savePDF', 'verb' => 'POST'], ['name' => 'page#saveDocumentRecap', 'url' => '/saveDocumentRecap', 'verb' => 'POST'], ['name' => 'page#saveNewPDF', 'url' => '/saveNewPDF', 'verb' => 'POST'], - + ['name' => 'admin#backup', 'url' => '/backup', 'verb' => 'GET'], diff --git a/gestion/js/apercusTousDevis.app.js b/gestion/js/apercusTousDevis.app.js index 5af4bb6..bf9cc8b 100644 --- a/gestion/js/apercusTousDevis.app.js +++ b/gestion/js/apercusTousDevis.app.js @@ -1,2 +1,2 @@ /*! For license information please see apercusTousDevis.app.js.LICENSE.txt */ -(()=>{var n={2:(t,n,e)=>{var r=e(6926),a=e(9310);(t.exports=function(t,n){return a[t]||(a[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.28.0",mode:r?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.28.0/LICENSE",source:"https://github.com/zloirock/core-js"})},54:(t,n,e)=>{"use strict";var r,a,o=e(2368),i=e(281),l=e(5362),s=e(6844),d=e(2192),c=e(2),p=e(3105),u=e(9206).get,m=e(1036),f=e(8121),g=c("native-string-replace",String.prototype.replace),b=RegExp.prototype.exec,h=b,v=i("".charAt),x=i("".indexOf),y=i("".replace),w=i("".slice),T=(a=/b*/g,o(b,r=/a/,"a"),o(b,a,"a"),0!==r.lastIndex||0!==a.lastIndex),_=d.BROKEN_CARET,k=void 0!==/()??/.exec("")[1];(T||k||_||m||f)&&(h=function(t){var n,e,r,a,i,d,c,m=this,f=u(m),S=l(t),C=f.raw;if(C)return C.lastIndex=m.lastIndex,n=o(h,C,S),m.lastIndex=C.lastIndex,n;var D=f.groups,L=_&&m.sticky,A=o(s,m),E=m.source,j=0,F=S;if(L&&(A=y(A,"y",""),-1===x(A,"g")&&(A+="g"),F=w(S,m.lastIndex),m.lastIndex>0&&(!m.multiline||m.multiline&&"\n"!==v(S,m.lastIndex-1))&&(E="(?: "+E+")",F=" "+F,j++),e=new RegExp("^(?:"+E+")",A)),k&&(e=new RegExp("^"+E+"$(?!\\s)",A)),T&&(r=m.lastIndex),a=o(b,L?e:m,F),L?a?(a.input=w(a.input,j),a[0]=w(a[0],j),a.index=m.lastIndex,m.lastIndex+=a[0].length):m.lastIndex=0:T&&a&&(m.lastIndex=m.global?a.index+a[0].length:r),k&&a&&a.length>1&&o(g,a[0],e,(function(){for(i=1;i{"use strict";var r=e(9070),a=e(2368),o=e(281),i=e(779),l=e(2074),s=e(3938),d=e(8420),c=e(8406),p=e(9328),u=e(3747),m=e(5362),f=e(1229),g=e(7234),b=e(6457),h=e(4433),v=e(6793),x=e(1602)("replace"),y=Math.max,w=Math.min,T=o([].concat),_=o([].push),k=o("".indexOf),S=o("".slice),C="$0"==="a".replace(/./,"$0"),D=!!/./[x]&&""===/./[x]("a","$0");i("replace",(function(t,n,e){var o=D?"$":"$0";return[function(t,e){var r=f(this),o=c(t)?void 0:b(t,x);return o?a(o,t,r,e):a(n,m(r),t,e)},function(t,a){var i=s(this),l=m(t);if("string"==typeof a&&-1===k(a,o)&&-1===k(a,"$<")){var c=e(n,i,l,a);if(c.done)return c.value}var f=d(a);f||(a=m(a));var b=i.global;if(b){var x=i.unicode;i.lastIndex=0}for(var C=[];;){var D=v(i,l);if(null===D)break;if(_(C,D),!b)break;""===m(D[0])&&(i.lastIndex=g(l,u(i.lastIndex),x))}for(var L,A="",E=0,j=0;j=E&&(A+=S(l,E,N)+M,E=N+F.length)}return A+S(l,E)}]}),!!l((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!C||D)},200:(t,n,e)=>{var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e.g&&e.g)||function(){return this}()||Function("return this")()},281:(t,n,e)=>{var r=e(8823),a=Function.prototype,o=a.call,i=r&&a.bind.bind(o,o);t.exports=r?i:function(t){return function(){return o.apply(t,arguments)}}},290:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},353:(t,n,e)=>{var r=e(2368),a=e(6490),o=e(7658),i=e(6844),l=RegExp.prototype;t.exports=function(t){var n=t.flags;return void 0!==n||"flags"in l||a(t,"flags")||!o(l,t)?n:r(i,t)}},540:t=>{"use strict";t.exports=function(t){var n=document.createElement("style");return t.setAttributes(n,t.attributes),t.insert(n,t.options),n}},580:t=>{"use strict";var n=/["'&<>]/;t.exports=function(t){var e,r=""+t,a=n.exec(r);if(!a)return r;var o="",i=0,l=0;for(i=a.index;i{var r=e(281),a=0,o=Math.random(),i=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+i(++a+o,36)}},779:(t,n,e)=>{"use strict";e(7136);var r=e(3091),a=e(7485),o=e(54),i=e(2074),l=e(1602),s=e(7712),d=l("species"),c=RegExp.prototype;t.exports=function(t,n,e,p){var u=l(t),m=!i((function(){var n={};return n[u]=function(){return 7},7!=""[t](n)})),f=m&&!i((function(){var n=!1,e=/a/;return"split"===t&&((e={}).constructor={},e.constructor[d]=function(){return e},e.flags="",e[u]=/./[u]),e.exec=function(){return n=!0,null},e[u](""),!n}));if(!m||!f||e){var g=r(/./[u]),b=n(u,""[t],(function(t,n,e,a,i){var l=r(t),s=n.exec;return s===o||s===c.exec?m&&!i?{done:!0,value:g(n,e,a)}:{done:!0,value:l(e,n,a)}:{done:!1}}));a(String.prototype,t,b[0]),a(c,u,b[1])}p&&s(c[u],"sham",!0)}},874:(t,n,e)=>{var r=e(2368),a=e(5335),o=e(2328),i=e(6457),l=e(9751),s=e(1602),d=TypeError,c=s("toPrimitive");t.exports=function(t,n){if(!a(t)||o(t))return t;var e,s=i(t,c);if(s){if(void 0===n&&(n="default"),e=r(s,t,n),!a(e)||o(e))return e;throw d("Can't convert object to primitive value")}return void 0===n&&(n="number"),l(t,n)}},1036:(t,n,e)=>{var r=e(2074),a=e(200).RegExp;t.exports=r((function(){var t=a(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},1113:t=>{"use strict";t.exports=function(t,n){if(n.styleSheet)n.styleSheet.cssText=t;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(t))}}},1144:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27%23fff%27%3e%3cpath d=%27M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z%27/%3e%3c/svg%3e"},1229:(t,n,e)=>{var r=e(8406),a=TypeError;t.exports=function(t){if(r(t))throw a("Can't call method on "+t);return t}},1479:t=>{"use strict";t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiI+CiAgPHBhdGggZD0iTTE0IDEyLjNMMTIuMyAxNCA4IDkuNyAzLjcgMTQgMiAxMi4zIDYuMyA4IDIgMy43IDMuNyAyIDggNi4zIDEyLjMgMiAxNCAzLjcgOS43IDh6IiBzdHlsZT0iZmlsbC1vcGFjaXR5OjE7ZmlsbDojZmZmZmZmIi8+Cjwvc3ZnPgo="},1601:t=>{"use strict";t.exports=function(t){return t[1]}},1602:(t,n,e)=>{var r=e(200),a=e(2),o=e(6490),i=e(665),l=e(2072),s=e(5225),d=r.Symbol,c=a("wks"),p=s?d.for||d:d&&d.withoutSetter||i;t.exports=function(t){return o(c,t)||(c[t]=l&&o(d,t)?d[t]:p("Symbol."+t)),c[t]}},1605:(t,n,e)=>{var r=e(200),a=e(7632).f,o=e(7712),i=e(7485),l=e(9430),s=e(4361),d=e(4977);t.exports=function(t,n){var e,c,p,u,m,f=t.target,g=t.global,b=t.stat;if(e=g?r:b?r[f]||l(f,{}):(r[f]||{}).prototype)for(c in n){if(u=n[c],p=t.dontCallGetSet?(m=a(e,c))&&m.value:e[c],!d(g?c:f+(b?".":"#")+c,t.forced)&&void 0!==p){if(typeof u==typeof p)continue;s(u,p)}(t.sham||p&&p.sham)&&o(u,"sham",!0),i(e,c,u,t)}}},1641:(t,n,e)=>{var r=e(6347),a=e(290);t.exports=Object.keys||function(t){return r(t,a)}},1688:(t,n,e)=>{"use strict";var r=e(5077),a=e(281),o=e(2368),i=e(2074),l=e(1641),s=e(8916),d=e(9304),c=e(2612),p=e(8664),u=Object.assign,m=Object.defineProperty,f=a([].concat);t.exports=!u||i((function(){if(r&&1!==u({b:1},u(m({},"a",{enumerable:!0,get:function(){m(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},n={},e=Symbol(),a="abcdefghijklmnopqrst";return t[e]=7,a.split("").forEach((function(t){n[t]=t})),7!=u({},t)[e]||l(u({},n)).join("")!=a}))?function(t,n){for(var e=c(t),a=arguments.length,i=1,u=s.f,m=d.f;a>i;)for(var g,b=p(arguments[i++]),h=u?f(l(b),u(b)):l(b),v=h.length,x=0;v>x;)g=h[x++],r&&!o(m,b,g)||(e[g]=b[g]);return e}:u},2071:(t,n,e)=>{var r=e(5077),a=e(6490),o=Function.prototype,i=r&&Object.getOwnPropertyDescriptor,l=a(o,"name"),s=l&&"something"===function(){}.name,d=l&&(!r||r&&i(o,"name").configurable);t.exports={EXISTS:l,PROPER:s,CONFIGURABLE:d}},2072:(t,n,e)=>{var r=e(6845),a=e(2074);t.exports=!!Object.getOwnPropertySymbols&&!a((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},2074:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},2192:(t,n,e)=>{var r=e(2074),a=e(200).RegExp,o=r((function(){var t=a("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),i=o||r((function(){return!a("a","y").sticky})),l=o||r((function(){var t=a("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:l,MISSED_STICKY:i,UNSUPPORTED_Y:o}},2328:(t,n,e)=>{var r=e(6492),a=e(8420),o=e(7658),i=e(5225),l=Object;t.exports=i?function(t){return"symbol"==typeof t}:function(t){var n=r("Symbol");return a(n)&&o(n.prototype,l(t))}},2349:(t,n,e)=>{"use strict";var r=e(2074);t.exports=function(t,n){var e=[][t];return!!e&&r((function(){e.call(null,n||function(){return 1},1)}))}},2368:(t,n,e)=>{var r=e(8823),a=Function.prototype.call;t.exports=r?a.bind(a):function(){return a.apply(a,arguments)}},2612:(t,n,e)=>{var r=e(1229),a=Object;t.exports=function(t){return a(r(t))}},2838:function(t){t.exports=function(){"use strict";function t(n){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(n)}function n(t,e){return n=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},n(t,e)}function e(t,r,a){return e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,r){var a=[null];a.push.apply(a,e);var o=new(Function.bind.apply(t,a));return r&&n(o,r.prototype),o},e.apply(null,arguments)}function r(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return a(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?a(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e1?e-1:0),a=1;a/gm),G=p(/\${[\w\W]*}/gm),W=p(/^data-[\-\w.\u00B7-\uFFFF]/),J=p(/^aria-[\-\w]+$/),X=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V=p(/^(?:\w+script|data):/i),Y=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=p(/^html$/i),Z=function(){return"undefined"==typeof window?null:window};return function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Z(),a=function(t){return n(t)};if(a.version="2.4.4",a.removed=[],!e||!e.document||9!==e.document.nodeType)return a.isSupported=!1,a;var o=e.document,i=e.document,l=e.DocumentFragment,s=e.HTMLTemplateElement,d=e.Node,p=e.Element,u=e.NodeFilter,m=e.NamedNodeMap,f=void 0===m?e.NamedNodeMap||e.MozNamedAttrMap:m,g=e.HTMLFormElement,b=e.DOMParser,L=e.trustedTypes,Q=p.prototype,tt=j(Q,"cloneNode"),nt=j(Q,"nextSibling"),et=j(Q,"childNodes"),rt=j(Q,"parentNode");if("function"==typeof s){var at=i.createElement("template");at.content&&at.content.ownerDocument&&(i=at.content.ownerDocument)}var ot=function(n,e){if("object"!==t(n)||"function"!=typeof n.createPolicy)return null;var r=null,a="data-tt-policy-suffix";e.currentScript&&e.currentScript.hasAttribute(a)&&(r=e.currentScript.getAttribute(a));var o="dompurify"+(r?"#"+r:"");try{return n.createPolicy(o,{createHTML:function(t){return t},createScriptURL:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(L,o),it=ot?ot.createHTML(""):"",lt=i,st=lt.implementation,dt=lt.createNodeIterator,ct=lt.createDocumentFragment,pt=lt.getElementsByTagName,ut=o.importNode,mt={};try{mt=E(i).documentMode?i.documentMode:{}}catch(t){}var ft={};a.isSupported="function"==typeof rt&&st&&void 0!==st.createHTMLDocument&&9!==mt;var gt,bt,ht=q,vt=B,xt=G,yt=W,wt=J,Tt=V,_t=Y,kt=X,St=null,Ct=A({},[].concat(r(F),r(N),r(O),r(I),r(M))),Dt=null,Lt=A({},[].concat(r(z),r(H),r(U),r($))),At=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Et=null,jt=null,Ft=!0,Nt=!0,Ot=!1,Pt=!0,It=!1,Rt=!1,Mt=!1,zt=!1,Ht=!1,Ut=!1,$t=!1,qt=!0,Bt=!1,Gt=!0,Wt=!1,Jt={},Xt=null,Vt=A({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Yt=null,Kt=A({},["audio","video","img","source","image","track"]),Zt=null,Qt=A({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tn="http://www.w3.org/1998/Math/MathML",nn="http://www.w3.org/2000/svg",en="http://www.w3.org/1999/xhtml",rn=en,an=!1,on=null,ln=A({},[tn,nn,en],w),sn=["application/xhtml+xml","text/html"],dn=null,cn=i.createElement("form"),pn=function(t){return t instanceof RegExp||t instanceof Function},un=function(n){dn&&dn===n||(n&&"object"===t(n)||(n={}),n=E(n),gt=gt=-1===sn.indexOf(n.PARSER_MEDIA_TYPE)?"text/html":n.PARSER_MEDIA_TYPE,bt="application/xhtml+xml"===gt?w:y,St="ALLOWED_TAGS"in n?A({},n.ALLOWED_TAGS,bt):Ct,Dt="ALLOWED_ATTR"in n?A({},n.ALLOWED_ATTR,bt):Lt,on="ALLOWED_NAMESPACES"in n?A({},n.ALLOWED_NAMESPACES,w):ln,Zt="ADD_URI_SAFE_ATTR"in n?A(E(Qt),n.ADD_URI_SAFE_ATTR,bt):Qt,Yt="ADD_DATA_URI_TAGS"in n?A(E(Kt),n.ADD_DATA_URI_TAGS,bt):Kt,Xt="FORBID_CONTENTS"in n?A({},n.FORBID_CONTENTS,bt):Vt,Et="FORBID_TAGS"in n?A({},n.FORBID_TAGS,bt):{},jt="FORBID_ATTR"in n?A({},n.FORBID_ATTR,bt):{},Jt="USE_PROFILES"in n&&n.USE_PROFILES,Ft=!1!==n.ALLOW_ARIA_ATTR,Nt=!1!==n.ALLOW_DATA_ATTR,Ot=n.ALLOW_UNKNOWN_PROTOCOLS||!1,Pt=!1!==n.ALLOW_SELF_CLOSE_IN_ATTR,It=n.SAFE_FOR_TEMPLATES||!1,Rt=n.WHOLE_DOCUMENT||!1,Ht=n.RETURN_DOM||!1,Ut=n.RETURN_DOM_FRAGMENT||!1,$t=n.RETURN_TRUSTED_TYPE||!1,zt=n.FORCE_BODY||!1,qt=!1!==n.SANITIZE_DOM,Bt=n.SANITIZE_NAMED_PROPS||!1,Gt=!1!==n.KEEP_CONTENT,Wt=n.IN_PLACE||!1,kt=n.ALLOWED_URI_REGEXP||kt,rn=n.NAMESPACE||en,n.CUSTOM_ELEMENT_HANDLING&&pn(n.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(At.tagNameCheck=n.CUSTOM_ELEMENT_HANDLING.tagNameCheck),n.CUSTOM_ELEMENT_HANDLING&&pn(n.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(At.attributeNameCheck=n.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),n.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof n.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(At.allowCustomizedBuiltInElements=n.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),It&&(Nt=!1),Ut&&(Ht=!0),Jt&&(St=A({},r(M)),Dt=[],!0===Jt.html&&(A(St,F),A(Dt,z)),!0===Jt.svg&&(A(St,N),A(Dt,H),A(Dt,$)),!0===Jt.svgFilters&&(A(St,O),A(Dt,H),A(Dt,$)),!0===Jt.mathMl&&(A(St,I),A(Dt,U),A(Dt,$))),n.ADD_TAGS&&(St===Ct&&(St=E(St)),A(St,n.ADD_TAGS,bt)),n.ADD_ATTR&&(Dt===Lt&&(Dt=E(Dt)),A(Dt,n.ADD_ATTR,bt)),n.ADD_URI_SAFE_ATTR&&A(Zt,n.ADD_URI_SAFE_ATTR,bt),n.FORBID_CONTENTS&&(Xt===Vt&&(Xt=E(Xt)),A(Xt,n.FORBID_CONTENTS,bt)),Gt&&(St["#text"]=!0),Rt&&A(St,["html","head","body"]),St.table&&(A(St,["tbody"]),delete Et.tbody),c&&c(n),dn=n)},mn=A({},["mi","mo","mn","ms","mtext"]),fn=A({},["foreignobject","desc","title","annotation-xml"]),gn=A({},["title","style","font","a","script"]),bn=A({},N);A(bn,O),A(bn,P);var hn=A({},I);A(hn,R);var vn=function(t){x(a.removed,{element:t});try{t.parentNode.removeChild(t)}catch(n){try{t.outerHTML=it}catch(n){t.remove()}}},xn=function(t,n){try{x(a.removed,{attribute:n.getAttributeNode(t),from:n})}catch(t){x(a.removed,{attribute:null,from:n})}if(n.removeAttribute(t),"is"===t&&!Dt[t])if(Ht||Ut)try{vn(n)}catch(t){}else try{n.setAttribute(t,"")}catch(t){}},yn=function(t){var n,e;if(zt)t=""+t;else{var r=T(t,/^[\r\n\t ]+/);e=r&&r[0]}"application/xhtml+xml"===gt&&rn===en&&(t=''+t+"");var a=ot?ot.createHTML(t):t;if(rn===en)try{n=(new b).parseFromString(a,gt)}catch(t){}if(!n||!n.documentElement){n=st.createDocument(rn,"template",null);try{n.documentElement.innerHTML=an?it:a}catch(t){}}var o=n.body||n.documentElement;return t&&e&&o.insertBefore(i.createTextNode(e),o.childNodes[0]||null),rn===en?pt.call(n,Rt?"html":"body")[0]:Rt?n.documentElement:o},wn=function(t){return dt.call(t.ownerDocument||t,t,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},Tn=function(n){return"object"===t(d)?n instanceof d:n&&"object"===t(n)&&"number"==typeof n.nodeType&&"string"==typeof n.nodeName},_n=function(t,n,e){ft[t]&&h(ft[t],(function(t){t.call(a,n,e,dn)}))},kn=function(t){var n,e;if(_n("beforeSanitizeElements",t,null),(e=t)instanceof g&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof f)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes))return vn(t),!0;if(C(/[\u0080-\uFFFF]/,t.nodeName))return vn(t),!0;var r=bt(t.nodeName);if(_n("uponSanitizeElement",t,{tagName:r,allowedTags:St}),t.hasChildNodes()&&!Tn(t.firstElementChild)&&(!Tn(t.content)||!Tn(t.content.firstElementChild))&&C(/<[/\w]/g,t.innerHTML)&&C(/<[/\w]/g,t.textContent))return vn(t),!0;if("select"===r&&C(/